NebulaStream
0.6.213
NebulaStream is a data and application management framework for the internet of things
|
Namespaces | |
detail | |
Classes | |
class | FileMutex |
This is a mutex that uses files to perform locking. It implements the Mutex named requirements. More... | |
class | LoadedPlugin |
class | PluginLoader |
class | PluginRegistry |
The plugin registry allows the dynamic registration of plugins at runtime. A plugin is a provider of a specific type T, which defines the plugin interface. Plugins use [[maybe_unused]] static T::Add<PluginXType> pluginX; to register them self to the plugin. More... | |
class | NamedPluginRegistry |
The plugin registry allows the dynamic registration of plugins at runtime. A plugin is a provider of a specific type T, which defines the plugin interface. Plugins use [[maybe_unused]] static T::Add<PluginXType> pluginX; to register them self to the registry. More... | |
class | PluginFactory |
The plugin factory allows the dynamic registration of plugins at that dynamically create instances of the plugin at runtime. A plugin is a provider of a specific type T, which defines the plugin interface. Plugins use [[maybe_unused]] static T::Add<PluginXType> pluginX; to register them self to the registry. More... | |
class | Subprocess |
This class spawns a new subprocess and executes a specific command. As soon as the subprocess object goes out of scope the subprocess is terminated. More... | |
Enumerations | |
enum class | ends_of_pipe : uint8_t { READ = 0 , WRITE = 1 } |
Functions | |
std::string | printTupleBufferAsText (Runtime::TupleBuffer &buffer) |
Outputs a tuple buffer in text format. More... | |
std::string | printTupleBufferAsCSV (Runtime::TupleBuffer tbuffer, const SchemaPtr &schema, const std::string &lineSuffix="") |
create CSV lines from the tuples More... | |
std::vector< PhysicalTypePtr > | getPhysicalTypes (SchemaPtr schema) |
Returns the physical types of all fields of the schema. More... | |
std::string | toCSVString (const SchemaPtr &schema) |
method to get the schema as a csv string More... | |
Runtime::MemoryLayouts::MemoryLayoutPtr | createMemoryLayout (SchemaPtr schema, uint64_t bufferSize) |
Creates a memory layout from the schema and the buffer Size. More... | |
bool | assignPropertiesToQueryOperators (const QueryPlanPtr &queryPlan, std::vector< std::map< std::string, std::any >> properties) |
std::vector< Runtime::TupleBuffer > | createBuffersFromCSVFile (const std::string &csvFile, const SchemaPtr &schema, Runtime::BufferManagerPtr bufferManager, const std::string &timeStampFieldName, uint64_t lastTimeStamp) |
Creates multiple TupleBuffers from the csv file until the lastTimeStamp has been read. More... | |
std::string | escapeJson (const std::string &str) |
escapes all non text characters in a input string, such that the string could be processed as json. More... | |
std::string_view | trimWhiteSpaces (std::string_view in) |
removes leading and trailing whitespaces More... | |
std::string_view | trimChar (std::string_view in, char trimFor) |
removes leading and trailing occurences of trimFor More... | |
bool | endsWith (const std::string &fullString, const std::string &ending) |
Checks if a string ends with a given string. More... | |
uint64_t | numberOfUniqueValues (std::vector< uint64_t > &values) |
Checks if a string starts with a given string. More... | |
bool | startsWith (const std::string &fullString, const std::string &ending) |
Get number of unique elements. More... | |
std::string | toUpperCase (std::string string) |
transforms the string to an upper case version More... | |
template<typename T > | |
std::vector< T > | splitWithStringDelimiter (std::string_view inputString, std::string_view delim, std::function< T(std::string_view)> fromStringToT=detail::SplitFunctionHelper< T >::FUNCTION) |
splits a string given a delimiter into multiple substrings stored in a T vector the delimiter is allowed to be a string rather than a char only. More... | |
template<typename T > | |
std::shared_ptr< T > | checkNonNull (std::shared_ptr< T > ptr, const std::string &errorMessage) |
this method checks if the object is null More... | |
void | findAndReplaceAll (std::string &data, const std::string &toSearch, const std::string &replaceStr) |
function to replace all string occurrences More... | |
std::string | replaceFirst (std::string origin, const std::string &search, const std::string &replace) |
This function replaces the first occurrence of search term in a string with the replace term. More... | |
std::string | updateSourceName (std::string queryPlanSourceConsumed, std::string subQueryPlanSourceConsumed) |
: Update the source names by sorting and then concatenating the source names from the sub- and query plan More... | |
void | writeHeaderToCsvFile (const std::string &csvFileName, const std::string &header) |
Truncates the file and then writes the header string as is to the file. More... | |
void | writeRowToCsvFile (const std::string &csvFileName, const std::string &row) |
Appends the row as is to the csv file. More... | |
template<typename T > | |
std::vector< std::vector< T > > | partition (const std::vector< T > &vec, size_t n) |
template<typename T > | |
void | padVectorToSize (std::vector< T > &vector, size_t newSize, T newValue) |
appends newValue until the vector contains a minimum of newSize elements More... | |
uint64_t | murmurHash (uint64_t key) |
hashes the key with murmur hash More... | |
uint64_t | countLines (const std::string &str) |
Counts the number of lines of a string. More... | |
uint64_t | countLines (std::istream &stream) |
Counts the number of lines of a stream, e.g., a file. More... | |
template<typename T > | |
void | updateAtomicMax (std::atomic< T > &curVal, const T &newVal) |
Tries to update curVal until it succeeds or curVal is larger then newVal. More... | |
|
strong |
bool NES::Util::assignPropertiesToQueryOperators | ( | const QueryPlanPtr & | queryPlan, |
std::vector< std::map< std::string, std::any >> | properties | ||
) |
queryPlan | queryIdAndCatalogEntryMapping to which the properties are assigned |
properties | properties to assign |
References NES_ERROR.
Referenced by NES::TEST_F().
std::shared_ptr<T> NES::Util::checkNonNull | ( | std::shared_ptr< T > | ptr, |
const std::string & | errorMessage | ||
) |
uint64_t NES::Util::countLines | ( | const std::string & | str | ) |
Counts the number of lines of a string.
str |
Referenced by NES::Runtime::Execution::JoinDeploymentTest::runAndValidateJoinQueryTwoLogicalStreams(), NES::Runtime::Execution::MultipleJoinsTest::runJoinQuery(), NES::FileSinkIntegrationTest::runQueryAndVerifyExpectedResults(), and NES::TEST_F().
uint64_t NES::Util::countLines | ( | std::istream & | stream | ) |
Counts the number of lines of a stream, e.g., a file.
stream |
std::vector< Runtime::TupleBuffer > NES::Util::createBuffersFromCSVFile | ( | const std::string & | csvFile, |
const SchemaPtr & | schema, | ||
Runtime::BufferManagerPtr | bufferManager, | ||
const std::string & | timeStampFieldName, | ||
uint64_t | lastTimeStamp | ||
) |
Creates multiple TupleBuffers from the csv file until the lastTimeStamp has been read.
csvFile | |
schema | |
timeStampFieldName | |
lastTimeStamp | |
bufferManager |
References NES::Runtime::MemoryLayouts::TestTupleBuffer::createTestTupleBuffer(), NES::TestUtils::getPhysicalTypes(), and NES_ASSERT2_FMT.
Runtime::MemoryLayouts::MemoryLayoutPtr NES::Util::createMemoryLayout | ( | SchemaPtr | schema, |
uint64_t | bufferSize | ||
) |
Creates a memory layout from the schema and the buffer Size.
schema | |
bufferSize |
References NES::bufferSize, NES::Schema::COLUMNAR_LAYOUT, NES::Runtime::MemoryLayouts::ColumnLayout::create(), NES::Runtime::MemoryLayouts::RowLayout::create(), and NES::Schema::ROW_LAYOUT.
bool NES::Util::endsWith | ( | const std::string & | fullString, |
const std::string & | ending | ||
) |
Checks if a string ends with a given string.
fullString | |
ending |
Referenced by NES::Monitoring::MetricUtils::validateFieldsInSchema().
std::string NES::Util::escapeJson | ( | const std::string & | str | ) |
escapes all non text characters in a input string, such that the string could be processed as json.
s | input string. |
void NES::Util::findAndReplaceAll | ( | std::string & | data, |
const std::string & | toSearch, | ||
const std::string & | replaceStr | ||
) |
function to replace all string occurrences
data | input string will be replaced in-place |
toSearch | search string |
replaceStr | replace string |
References data.
Referenced by NES::Parser::writeFieldValueToTupleBuffer().
std::vector< PhysicalTypePtr > NES::Util::getPhysicalTypes | ( | SchemaPtr | schema | ) |
Returns the physical types of all fields of the schema.
schema |
References NES::DefaultPhysicalTypeFactory::getPhysicalType().
uint64_t NES::Util::murmurHash | ( | uint64_t | key | ) |
hashes the key with murmur hash
key |
uint64_t NES::Util::numberOfUniqueValues | ( | std::vector< uint64_t > & | values | ) |
Checks if a string starts with a given string.
fullString | |
start |
References magic_enum::detail::values().
void NES::Util::padVectorToSize | ( | std::vector< T > & | vector, |
size_t | newSize, | ||
T | newValue | ||
) |
appends newValue until the vector contains a minimum of newSize elements
T |
vector | the vector |
newSize | the size of the padded vector |
newValue | the value that should be added |
std::vector<std::vector<T> > NES::Util::partition | ( | const std::vector< T > & | vec, |
size_t | n | ||
) |
Partition a vector in n chunks, e.g., ([1, 2, 3, 4, 5], 3) -> [[1, 2], [3, 4], [5]]
input | the vector |
n | the chunks |
References magic_enum::detail::n().
Referenced by NES::Network::PartitionManager::addSubpartitionEventListener(), NES::Network::PartitionManager::clear(), NES::Network::PartitionManager::getConsumerRegistrationStatus(), NES::Network::PartitionManager::getDataEmitter(), NES::Network::PartitionManager::getEventListener(), NES::Network::PartitionManager::getProducerRegistrationStatus(), NES::Network::PartitionManager::getSubpartitionConsumerCounter(), NES::Network::PartitionManager::getSubpartitionProducerCounter(), NES::Network::PartitionManager::getVersion(), NES::Network::PartitionManager::pinSubpartitionConsumer(), NES::Network::PartitionManager::pinSubpartitionProducer(), NES::Network::PartitionManager::registerSubpartitionConsumer(), NES::Network::PartitionManager::registerSubpartitionProducer(), NES::Network::PartitionManager::unregisterSubpartitionConsumer(), and NES::Network::PartitionManager::unregisterSubpartitionProducer().
std::string NES::Util::printTupleBufferAsCSV | ( | Runtime::TupleBuffer | tbuffer, |
const SchemaPtr & | schema, | ||
const std::string & | lineSuffix = "" |
||
) |
create CSV lines from the tuples
tbuffer | the tuple buffer |
schema | how to read the tuples from the buffer |
lineSuffix | a string that will be appended at the end of each line |
References NES::Runtime::TupleBuffer::getBuffer(), NES::Runtime::TupleBuffer::getNumberOfTuples(), NES_DEBUG, and NES::Runtime::MemoryLayouts::readVarSizedData().
Referenced by NES::CSVSource::fillBuffer(), NES::CsvFormat::getFormattedBuffer(), NES::Runtime::Execution::JoinDeploymentTest::runAndValidateJoinQueryTwoLogicalStreams(), and TEST_P().
std::string NES::Util::printTupleBufferAsText | ( | Runtime::TupleBuffer & | buffer | ) |
Outputs a tuple buffer in text format.
buffer | the tuple buffer |
References NES::Runtime::TupleBuffer::getBuffer(), and NES::Runtime::TupleBuffer::getNumberOfTuples().
std::string NES::Util::replaceFirst | ( | std::string | origin, |
const std::string & | search, | ||
const std::string & | replace | ||
) |
This function replaces the first occurrence of search term in a string with the replace term.
origin | - The original string that is to be manipulated |
search | - The substring/term which we want to have replaced |
replace | - The string that is replacing the search term. |
Referenced by NES::QueryParsingService::createQueryFromCodeString(), and NES::TEST().
std::vector<T> NES::Util::splitWithStringDelimiter | ( | std::string_view | inputString, |
std::string_view | delim, | ||
std::function< T(std::string_view)> | fromStringToT = detail::SplitFunctionHelper<T>::FUNCTION |
||
) |
splits a string given a delimiter into multiple substrings stored in a T vector the delimiter is allowed to be a string rather than a char only.
data | - the string that is to be split |
delimiter | - the string that is to be split upon e.g. / or - |
fromStringtoT | - the function that converts a string to an arbitrary type T |
bool NES::Util::startsWith | ( | const std::string & | fullString, |
const std::string & | ending | ||
) |
Get number of unique elements.
fullString | |
start |
std::string NES::Util::toCSVString | ( | const SchemaPtr & | schema | ) |
method to get the schema as a csv string
schema |
Referenced by NES::CsvFormat::getFormattedSchema().
std::string NES::Util::toUpperCase | ( | std::string | string | ) |
transforms the string to an upper case version
string |
std::string_view NES::Util::trimChar | ( | std::string_view | in, |
char | trimFor | ||
) |
removes leading and trailing occurences of trimFor
Referenced by NES::TEST(), and NES::JSONParser::writeInputTupleToTupleBuffer().
std::string_view NES::Util::trimWhiteSpaces | ( | std::string_view | in | ) |
removes leading and trailing whitespaces
Referenced by NES::CsvFormat::getFormattedSchema(), and NES::TEST().
void NES::Util::updateAtomicMax | ( | std::atomic< T > & | curVal, |
const T & | newVal | ||
) |
Tries to update curVal until it succeeds or curVal is larger then newVal.
T |
curVal | |
newVal |
std::string NES::Util::updateSourceName | ( | std::string | queryPlanSourceConsumed, |
std::string | subQueryPlanSourceConsumed | ||
) |
: Update the source names by sorting and then concatenating the source names from the sub- and query plan
string | consumed sources of the current queryPlan |
string | consumed sources of the subQueryPlan |
void NES::Util::writeHeaderToCsvFile | ( | const std::string & | csvFileName, |
const std::string & | header | ||
) |
Truncates the file and then writes the header string as is to the file.
csvFileName | |
header |
void NES::Util::writeRowToCsvFile | ( | const std::string & | csvFileName, |
const std::string & | row | ||
) |
Appends the row as is to the csv file.
csvFileName | |
row |