NebulaStream
0.6.213
NebulaStream is a data and application management framework for the internet of things
|
The file sink writes the stream result to a text file, in CSV or JSON format. More...
#include <FileSink.hpp>
Protected Attributes | |
std::string | filePath |
The output file path of the file sink. More... | |
std::ofstream | outputFile |
The output file stream. More... | |
bool | append {false} |
Indicate if the output should be appended to an existing file. More... | |
bool | isOpen {false} |
Indicate if the file could be opened during setup. More... | |
![]() | |
SinkFormatPtr | sinkFormat |
bool | schemaWritten |
Runtime::NodeEnginePtr | nodeEngine |
std::atomic< uint32_t > | activeProducers |
termination machinery More... | |
SharedQueryId | sharedQueryId |
DecomposedQueryId | decomposedQueryId |
DecomposedQueryPlanVersion | decomposedQueryVersion |
uint64_t | numberOfOrigins |
uint64_t | sentBuffer {0} |
uint64_t | sentTuples {0} |
std::recursive_mutex | writeMutex |
bool | migration {false} |
The file sink writes the stream result to a text file, in CSV or JSON format.
|
explicit |
Create a file sink.
nodeEngine | The node engine of the worker. |
numOfProducers | ? |
filePath | Name of the file to which the stream is written. |
append | True, if the stream should be appended to an existing file. If false, an existing file is first removed. |
sharedQueryId | ? |
decomposedQueryId | ? |
numberOfOrigins | number of origins of a given query |
|
overridevirtual |
Return the type of the sink medium.
Implements NES::SinkMedium.
References NES::FILE_SINK.
|
overridevirtual |
Setup the file sink.
This method attempts to open the file. If the file exists, it is first removed, unless append is true. If the file cannot be opened, subsequent calls to writeData will fail.
Implements NES::SinkMedium.
References append, filePath, isOpen, NES_DEBUG, NES_ERROR, outputFile, NES::SinkMedium::schemaWritten, and NES::SinkMedium::sinkFormat.
|
overridevirtual |
Clean up the file sink.
This method closes the file.
Implements NES::SinkMedium.
References filePath, NES_WARNING, and outputFile.
|
overridevirtual |
Return a string representation of the file sink.
Implements NES::SinkMedium.
References NES::SinkMedium::sinkFormat.
|
override |
Write the contents of a tuple buffer to the file sink.
inputBuffer | The tuple buffer that should be written to the file sink. |
References filePath, isOpen, NES_DEBUG, NES_ERROR, NES::NES_FORMAT, outputFile, NES::SinkMedium::schemaWritten, NES::SinkMedium::sinkFormat, and NES::SinkMedium::writeMutex.
|
protected |
Indicate if the output should be appended to an existing file.
Referenced by setup().
|
protected |
The output file path of the file sink.
Referenced by setup(), shutdown(), and writeData().
|
protected |
Indicate if the file could be opened during setup.
Referenced by setup(), and writeData().
|
protected |
The output file stream.
Referenced by setup(), shutdown(), and writeData().