T - The buffer type used for the underlying IO operations.public abstract class ChannelAccess<T,R extends org.apache.flink.runtime.io.disk.iomanager.IORequest> extends Object
| Modifier and Type | Field and Description |
|---|---|
protected IOException |
exception
An exception that was encountered by the asynchronous request handling thread.
|
protected FileChannel |
fileChannel
A file channel for NIO access to the file.
|
protected Channel.ID |
id
The ID of the underlying channel.
|
protected RequestQueue<R> |
requestQueue
A request queue for submitting asynchronous requests to the corresponding
IO worker thread.
|
| Modifier | Constructor and Description |
|---|---|
protected |
ChannelAccess(Channel.ID channelID,
RequestQueue<R> requestQueue,
boolean writeEnabled)
Creates a new channel to the path indicated by the given ID.
|
| Modifier and Type | Method and Description |
|---|---|
void |
checkErroneous()
Checks the exception state of this channel.
|
void |
deleteChannel()
Deletes this channel by physically removing the file beneath it.
|
Channel.ID |
getChannelID()
Gets the channel ID of this channel.
|
abstract boolean |
isClosed()
Checks, whether this channel has been closed;
|
protected abstract void |
returnBuffer(T buffer)
This method is invoked by the asynchronous I/O thread to return a buffer after the I/O request
completed.
|
protected final Channel.ID id
protected final FileChannel fileChannel
protected final RequestQueue<R extends org.apache.flink.runtime.io.disk.iomanager.IORequest> requestQueue
protected volatile IOException exception
protected ChannelAccess(Channel.ID channelID, RequestQueue<R> requestQueue, boolean writeEnabled) throws IOException
channelID - The id describing the path of the file that the channel accessed.requestQueue - The queue that this channel hands its IO requests to.writeEnabled - Flag describing whether the channel should be opened in read/write mode, rather
than in read-only mode.IOException - Thrown, if the channel could no be opened.public abstract boolean isClosed()
protected abstract void returnBuffer(T buffer)
buffer - The buffer to be returned.public final Channel.ID getChannelID()
public final void checkErroneous()
throws IOException
IOException - Thrown, if the channel is erroneous. The thrown exception contains the original exception
that defined the erroneous state as its cause.public void deleteChannel()
Copyright © 2014 The Apache Software Foundation. All rights reserved.