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

#include <JSONParser.hpp>

Collaboration diagram for NES::JSONParser:
[legend]

Public Member Functions

 JSONParser (uint64_t numberOfSchemaFields, std::vector< std::string > schemaKeys, std::vector< NES::PhysicalTypePtr > physicalTypes)
 public constructor for JSON input data parser More...
 
bool writeInputTupleToTupleBuffer (std::string_view jsonTuple, uint64_t tupleCount, Runtime::MemoryLayouts::TestTupleBuffer &tupleBuffer, const SchemaPtr &schema, const Runtime::BufferManagerPtr &bufferManager) override
 takes a json tuple as string, parses it using cpprest and calls Parser::writeFieldValueToTupleBuffer() for every value in the tuple More...
 
- Public Member Functions inherited from NES::Parser
 Parser (std::vector< PhysicalTypePtr > physicalTypes)
 public constructor for input data parser More...
 
virtual ~Parser ()=default
 
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...
 

Constructor & Destructor Documentation

◆ JSONParser()

NES::JSONParser::JSONParser ( uint64_t  numberOfSchemaFields,
std::vector< std::string >  schemaKeys,
std::vector< NES::PhysicalTypePtr physicalTypes 
)

public constructor for JSON input data parser

Parameters
numberOfSchemaFieldsnumber of schema fields
schemaKeysvector with schema keys to identify the keys in the json object
physicalTypesvector with physical data types

Member Function Documentation

◆ writeInputTupleToTupleBuffer()

bool NES::JSONParser::writeInputTupleToTupleBuffer ( std::string_view  jsonTuple,
uint64_t  tupleCount,
Runtime::MemoryLayouts::TestTupleBuffer tupleBuffer,
const SchemaPtr schema,
const Runtime::BufferManagerPtr bufferManager 
)
overridevirtual

takes a json tuple as string, parses it using cpprest and calls Parser::writeFieldValueToTupleBuffer() for every value in the tuple

Parameters
jsonTuplestring 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

Implements NES::Parser.

References NES_ERROR, NES_THROW_RUNTIME_ERROR, NES_TRACE, NES::Util::trimChar(), and NES::Parser::writeFieldValueToTupleBuffer().

Here is the call graph for this function:

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