Class RandomAccessDataProxy
- java.lang.Object
-
- org.hansken.plugin.extraction.runtime.grpc.server.proxy.RandomAccessDataProxy
-
- All Implemented Interfaces:
Closeable,AutoCloseable,RandomAccessData
public final class RandomAccessDataProxy extends Object implements RandomAccessData
Proxy implementation for the server side of theextraction pluginframework. It delegates calls through gRPC (seeGrpcFacade) to the data currently being processed on the client side.Note: this implementation is not thread-safe.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()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, wait
-
Methods inherited from interface org.hansken.plugin.extraction.api.RandomAccessData
read, read, readNBytes, remaining
-
-
-
-
Method Detail
-
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
-
-