Class RandomAccessDataProxy
java.lang.Object
org.hansken.plugin.extraction.runtime.grpc.server.proxy.RandomAccessDataProxy
- All Implemented Interfaces:
Closeable,AutoCloseable,RandomAccessData
Proxy implementation for the server side of the
extraction plugin framework. It
delegates calls through gRPC (see GrpcFacade) to the data currently being processed on the client side.
Note: this implementation is not thread-safe.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()static RandomAccessDatafromRpc(RpcRandomAccessDataMeta data, String traceId, GrpcFacade facade) Create a newdata proxyfor the data described by the givenRpcRandomAccessDataMeta, using the givenGrpcFacadeto delegate calls to.longposition()intread(byte[] buffer, int offset, int count) voidseek(long position) longsize()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.hansken.plugin.extraction.api.RandomAccessData
read, read, readNBytes, remaining
-
Method Details
-
fromRpc
public static RandomAccessData fromRpc(RpcRandomAccessDataMeta data, String traceId, GrpcFacade facade) Create a newdata proxyfor the data described by the givenRpcRandomAccessDataMeta, using the givenGrpcFacadeto delegate calls to.- Parameters:
data- the meta information about the data sequence, such as the size and positiontraceId- the id of the tracefacade- the facade to delegate calls to- Returns:
- the data sequence proxy
-
size
public long size()- Specified by:
sizein interfaceRandomAccessData
-
position
public long position()- Specified by:
positionin interfaceRandomAccessData
-
seek
public void seek(long position) - Specified by:
seekin interfaceRandomAccessData
-
read
public int read(byte[] buffer, int offset, int count) - Specified by:
readin interfaceRandomAccessData
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-