@NotThreadSafe public final class UfsFileWriteHandler extends Object
AbstractWriteHandler
.
For more information about the implementation of the client side writer, see
UnderFileSystemFileOutStream.Modifier and Type | Field and Description |
---|---|
protected AuthenticatedUserInfo |
mUserInfo |
Modifier and Type | Method and Description |
---|---|
protected void |
cancelRequest(UfsFileWriteRequestContext context)
Cancels this write.
|
protected void |
cleanupRequest(UfsFileWriteRequestContext context)
Cleans up this write.
|
protected void |
completeRequest(UfsFileWriteRequestContext context)
Completes this write.
|
protected UfsFileWriteRequestContext |
createRequestContext(WriteRequest msg)
Creates a new request context.
|
protected void |
flushRequest(UfsFileWriteRequestContext context)
Flushes the buffered data.
|
String |
getLocation() |
protected String |
getLocationInternal(UfsFileWriteRequestContext context) |
protected void |
handleCommand(WriteRequestCommand command,
T context)
Handles a command in the write request.
|
void |
onCancel()
Handles request cancellation event.
|
void |
onCompleted()
Handles request complete event.
|
void |
onError(Throwable cause)
Handles errors from the request.
|
void |
write(WriteRequest writeRequest)
Handles write request.
|
protected void |
writeBuf(UfsFileWriteRequestContext context,
io.grpc.stub.StreamObserver<WriteResponse> observer,
DataBuffer buf,
long pos)
Writes the buffer.
|
void |
writeDataMessage(WriteRequest request,
DataBuffer buffer)
Handles write request with data message.
|
protected AuthenticatedUserInfo mUserInfo
protected UfsFileWriteRequestContext createRequestContext(WriteRequest msg)
msg
- the block write requestprotected void completeRequest(UfsFileWriteRequestContext context) throws Exception
context
- context of the request to completeException
protected void cancelRequest(UfsFileWriteRequestContext context) throws Exception
context
- context of the request to completeException
protected void cleanupRequest(UfsFileWriteRequestContext context) throws Exception
context
- context of the request to completeException
protected void flushRequest(UfsFileWriteRequestContext context) throws Exception
context
- context of the request to completeException
protected void writeBuf(UfsFileWriteRequestContext context, io.grpc.stub.StreamObserver<WriteResponse> observer, DataBuffer buf, long pos) throws Exception
context
- context of the request to completeobserver
- the response observerbuf
- the bufferpos
- the posException
protected String getLocationInternal(UfsFileWriteRequestContext context)
context
- the context of the requestpublic void write(WriteRequest writeRequest)
writeRequest
- the request from the clientpublic void writeDataMessage(WriteRequest request, DataBuffer buffer)
request
- the request from the clientbuffer
- the data associated with the requestpublic void onCompleted()
public void onCancel()
public void onError(Throwable cause)
cause
- the exceptionpublic String getLocation()
protected void handleCommand(WriteRequestCommand command, T context) throws Exception
command
- the command to be handledException
Copyright © 2023. All Rights Reserved.