public interface WritableFrameChannel extends Closeable
writabilityFuture()
method.
May be implemented using an in-memory queue, disk file, stream, etc.
Channels implementing this interface are used by a single writer; they do not support concurrent writes.| Modifier and Type | Method and Description |
|---|---|
void |
close()
Finish writing to this channel.
|
void |
fail(Throwable cause)
Called prior to
close() if the writer has failed. |
com.google.common.util.concurrent.ListenableFuture<?> |
writabilityFuture()
Returns a future that resolves when
write(org.apache.druid.frame.channel.FrameWithPartition) is able to receive a new frame without blocking or throwing
an exception. |
default void |
write(Frame frame)
Writes a frame without an attached partition number.
|
void |
write(FrameWithPartition frameWithPartition)
Writes a frame with an attached partition number.
|
void write(FrameWithPartition frameWithPartition) throws IOException
writabilityFuture() is unresolved.IOExceptiondefault void write(Frame frame) throws IOException
writabilityFuture() is unresolved.IOExceptionvoid fail(@Nullable Throwable cause) throws IOException
cause - optional cause of failure. Used by the in-memory channel BlockingQueueFrameChannel.Writable
to propagate exeptions to downstream processors. Most other channels ignore the provided cause.IOExceptionvoid close()
throws IOException
fail(Throwable) having previously been called, the writer is
understood to have completed successfully.
After calling this method, no additional calls to write(org.apache.druid.frame.channel.FrameWithPartition), fail(Throwable), or this method
are permitted.close in interface AutoCloseableclose in interface CloseableIOExceptioncom.google.common.util.concurrent.ListenableFuture<?> writabilityFuture()
write(org.apache.druid.frame.channel.FrameWithPartition) is able to receive a new frame without blocking or throwing
an exception. The future never resolves to an exception.Copyright © 2011–2022 The Apache Software Foundation. All rights reserved.