Package com.clickhouse.client.data
Class ClickHousePipedStream
- java.lang.Object
-
- java.io.OutputStream
-
- com.clickhouse.client.ClickHouseOutputStream
-
- com.clickhouse.client.ClickHousePipedOutputStream
-
- com.clickhouse.client.data.ClickHousePipedStream
-
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
@Deprecated public class ClickHousePipedStream extends ClickHousePipedOutputStream
Deprecated.will be removed in v0.3.3, please useClickHouseDataStreamFactory.getInstance().createPipedStream()insteadA combination ofPipedOutputStreamandPipedInputStreamfor streaming data between server and client. To avoid dead lock and high memory usage, please make sure writer and reader are on two separate threads.
-
-
Field Summary
Fields Modifier and Type Field Description protected BlockingQueue<ByteBuffer>queueDeprecated.-
Fields inherited from class com.clickhouse.client.ClickHouseOutputStream
closed, ERROR_INCOMPLETE_READ, ERROR_NULL_BYTES, ERROR_REUSE_BUFFER, ERROR_STREAM_CLOSED, file, postCloseAction
-
-
Constructor Summary
Constructors Constructor Description ClickHousePipedStream(int bufferSize, int queueLength, int timeout)Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidclose()Deprecated.voidflush()Deprecated.ClickHouseInputStreamgetInputStream(Runnable postCloseAction)Deprecated.Gets input stream to reada data being written into the output stream.ClickHouseOutputStreamtransferBytes(byte[] bytes, int offset, int length)Deprecated.Transfers the given bytes into output stream, without creating a copy as inClickHouseOutputStream.writeBytes(byte[], int, int).ClickHouseOutputStreamwriteByte(byte b)Deprecated.Writes a single byte into output stream.ClickHouseOutputStreamwriteBytes(byte[] bytes, int offset, int length)Deprecated.Writes copy of given bytes into output stream.ClickHouseOutputStreamwriteCustom(ClickHouseDataUpdater writer)Deprecated.Writes bytes using custom writer.-
Methods inherited from class com.clickhouse.client.ClickHousePipedOutputStream
getInput, getInputStream
-
Methods inherited from class com.clickhouse.client.ClickHouseOutputStream
empty, ensureOpen, getUnderlyingFile, isClosed, of, of, of, of, transferBytes, transferBytes, write, write, write, writeAsciiString, writeBuffer, writeBytes, writeBytes, writeString, writeUnicodeString, writeUnsignedVarInt, writeVarInt
-
Methods inherited from class java.io.OutputStream
nullOutputStream
-
-
-
-
Field Detail
-
queue
protected final BlockingQueue<ByteBuffer> queue
Deprecated.
-
-
Method Detail
-
getInputStream
public ClickHouseInputStream getInputStream(Runnable postCloseAction)
Deprecated.Description copied from class:ClickHousePipedOutputStreamGets input stream to reada data being written into the output stream.- Specified by:
getInputStreamin classClickHousePipedOutputStream- Parameters:
postCloseAction- custom action will be performed right after closing the input stream- Returns:
- non-null input stream
-
close
public void close() throws IOExceptionDeprecated.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classClickHouseOutputStream- Throws:
IOException
-
flush
public void flush() throws IOExceptionDeprecated.- Specified by:
flushin interfaceFlushable- Overrides:
flushin classOutputStream- Throws:
IOException
-
transferBytes
public ClickHouseOutputStream transferBytes(byte[] bytes, int offset, int length) throws IOException
Deprecated.Description copied from class:ClickHouseOutputStreamTransfers the given bytes into output stream, without creating a copy as inClickHouseOutputStream.writeBytes(byte[], int, int).- Specified by:
transferBytesin classClickHouseOutputStream- Parameters:
bytes- non-null byte arrayoffset- offset of the byte arraylength- bytes to write- Returns:
- current output stream
- Throws:
IOException- when failed to write value into output stream, not able to sent all bytes, or opereate on a closed stream
-
writeByte
public ClickHouseOutputStream writeByte(byte b) throws IOException
Deprecated.Description copied from class:ClickHouseOutputStreamWrites a single byte into output stream.- Specified by:
writeBytein classClickHouseOutputStream- Parameters:
b- byte to write- Returns:
- current output stream
- Throws:
IOException- when failed to write value into output stream, not able to sent all bytes, or opereate on a closed stream
-
writeBytes
public ClickHouseOutputStream writeBytes(byte[] bytes, int offset, int length) throws IOException
Deprecated.Description copied from class:ClickHouseOutputStreamWrites copy of given bytes into output stream.- Specified by:
writeBytesin classClickHouseOutputStream- Parameters:
bytes- non-null byte arrayoffset- offset of the byte arraylength- bytes to write- Returns:
- current output stream
- Throws:
IOException- when failed to write value into output stream, not able to sent all bytes, or opereate on a closed stream
-
writeCustom
public ClickHouseOutputStream writeCustom(ClickHouseDataUpdater writer) throws IOException
Deprecated.Description copied from class:ClickHouseOutputStreamWrites bytes using custom writer.- Specified by:
writeCustomin classClickHouseOutputStream- Parameters:
writer- non-null data writer- Returns:
- current output stream
- Throws:
IOException- when failed to write value into output stream, not able to sent all bytes, or opereate on a closed stream
-
-