NebulaStream  0.6.213
NebulaStream is a data and application management framework for the internet of things
NES::Parser Class Referenceabstract

Base class for all input data parsers in NES. More...

#include <Parser.hpp>

Public Member Functions

 Parser (std::vector< PhysicalTypePtr > physicalTypes)
 public constructor for input data parser More...
 
virtual ~Parser ()=default
 
virtual bool writeInputTupleToTupleBuffer (std::string_view inputTuple, uint64_t tupleCount, Runtime::MemoryLayouts::TestTupleBuffer &tupleBuffer, const SchemaPtr &schema, const Runtime::BufferManagerPtr &bufferManager)=0
 takes a tuple as string, casts its values to the correct types and writes it to the TupleBuffer More...
 
void writeFieldValueToTupleBuffer (std::string value, uint64_t schemaFieldIndex, Runtime::MemoryLayouts::TestTupleBuffer &tupleBuffer, const SchemaPtr &schema, uint64_t tupleCount, const Runtime::BufferManagerPtr &bufferManager)
 casts a value in string format to the correct type and writes it to the TupleBuffer More...
 

Detailed Description

Base class for all input data parsers in NES.

Constructor & Destructor Documentation

◆ Parser()

NES::Parser::Parser ( std::vector< PhysicalTypePtr physicalTypes)
explicit

public constructor for input data parser

Parameters
physicalTypesvector with physical data types

◆ ~Parser()

virtual NES::Parser::~Parser ( )
virtualdefault

Member Function Documentation

◆ writeFieldValueToTupleBuffer()

void NES::Parser::writeFieldValueToTupleBuffer ( std::string  value,
uint64_t  schemaFieldIndex,
Runtime::MemoryLayouts::TestTupleBuffer tupleBuffer,
const SchemaPtr schema,
uint64_t  tupleCount,
const Runtime::BufferManagerPtr bufferManager 
)

casts a value in string format to the correct type and writes it to the TupleBuffer

Parameters
valuestring value that is cast to the PhysicalType and written to the TupleBuffer
schemaFieldIndexfield/attribute that is currently processed
tupleBufferthe TupleBuffer to which the value is written containing the currently chosen memory layout
jsondenotes whether input comes from JSON for correct parsing
schemathe schema the data are supposed to have
tupleCountcurrent tuple count, i.e. how many tuples have already been produced
bufferManagerthe buffer manager

References NES::BasicPhysicalType::BOOLEAN, NES::BasicPhysicalType::CHAR, NES::BasicPhysicalType::DOUBLE, NES::Util::findAndReplaceAll(), NES::BasicPhysicalType::FLOAT, NES::DefaultPhysicalTypeFactory::getPhysicalType(), NES::BasicPhysicalType::INT_16, NES::BasicPhysicalType::INT_32, NES::BasicPhysicalType::INT_64, NES::BasicPhysicalType::INT_8, NES_ERROR, NES_FATAL_ERROR, NES_TRACE, NES::BasicPhysicalType::UINT_16, NES::BasicPhysicalType::UINT_32, NES::BasicPhysicalType::UINT_64, NES::BasicPhysicalType::UINT_8, NES::BasicPhysicalType::UNDEFINED, and magic_enum::detail::value().

Referenced by NES::CSVParser::writeInputTupleToTupleBuffer(), and NES::JSONParser::writeInputTupleToTupleBuffer().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeInputTupleToTupleBuffer()

virtual bool NES::Parser::writeInputTupleToTupleBuffer ( std::string_view  inputTuple,
uint64_t  tupleCount,
Runtime::MemoryLayouts::TestTupleBuffer tupleBuffer,
const SchemaPtr schema,
const Runtime::BufferManagerPtr bufferManager 
)
pure virtual

takes a tuple as string, casts its values to the correct types and writes it to the TupleBuffer

Parameters
inputTuplestring value that is cast to the PhysicalType and written to the TupleBuffer
tupleCountthe number of tuples already written to the current TupleBuffer
tupleBufferthe TupleBuffer to which the value is written containing the currently chosen memory layout
schemadata schema
bufferManagerthe buffer manager

Implemented in NES::JSONParser, NES::CSVParser, and NES::NESBinaryParser.


The documentation for this class was generated from the following files: