Package com.clickhouse.data
Class ClickHouseDataStreamFactory
java.lang.Object
com.clickhouse.data.ClickHouseDataStreamFactory
Factory class for creating objects to handle data stream.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreatePipedOutputStream(int bufferSize, int queueSize, int timeout, Runnable postCloseAction) createPipedOutputStream(ClickHouseDataConfig config, Runnable postCloseAction) Creates a piped output stream.static ClickHouseDataStreamFactoryGets instance of the factory class.getProcessor(ClickHouseDataConfig config, ClickHouseInputStream input, ClickHouseOutputStream output, Map<String, Serializable> settings, List<ClickHouseColumn> columns) Gets data processor according to givenClickHouseDataConfigand settings.
-
Field Details
-
ERROR_NO_DESERIALIZER
- See Also:
-
ERROR_NO_SERIALIZER
- See Also:
-
ERROR_UNSUPPORTED_FORMAT
- See Also:
-
-
Constructor Details
-
ClickHouseDataStreamFactory
public ClickHouseDataStreamFactory()
-
-
Method Details
-
getInstance
Gets instance of the factory class.- Returns:
- instance of the factory class
-
getProcessor
public ClickHouseDataProcessor getProcessor(ClickHouseDataConfig config, ClickHouseInputStream input, ClickHouseOutputStream output, Map<String, Serializable> settings, List<ClickHouseColumn> columns) throws IOExceptionGets data processor according to givenClickHouseDataConfigand settings.- Parameters:
config- non-null configuration containing information likeClickHouseFormatinput- input stream for deserialization, must not be null whenoutputis nulloutput- output stream for serialization, must not be null wheninputis nullsettings- nullable settingscolumns- nullable list of columns- Returns:
- data processor, which might be null
- Throws:
IOException- when failed to read columns from input stream
-
createPipedOutputStream
public ClickHousePipedOutputStream createPipedOutputStream(ClickHouseDataConfig config, Runnable postCloseAction) Creates a piped output stream.- Parameters:
config- non-null configurationpostCloseAction- custom action will be performed right after closing the output stream- Returns:
- piped output stream
-
createPipedOutputStream
public ClickHousePipedOutputStream createPipedOutputStream(int bufferSize, int queueSize, int timeout, Runnable postCloseAction)
-