Class ExtractionPluginDataReader
- java.lang.Object
-
- org.hansken.plugin.extraction.runtime.grpc.client.ExtractionPluginDataReader
-
public class ExtractionPluginDataReader extends Object
This class is used to read trace data. It keeps track of traces and dataTypes which are available and it keeps a cache of RandomAccessData instances. These are created when read is called on the datastream for the first time.
-
-
Constructor Summary
Constructors Constructor Description ExtractionPluginDataReader(ClientDataContext context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidmarkDataAvailable(SearchTrace trace)Mark the dataTypes of the provided trace as available.byte[]read(String traceUid, String dataType, long position, int count)Read count bytes of data starting on position from dataType of traceId.
-
-
-
Constructor Detail
-
ExtractionPluginDataReader
public ExtractionPluginDataReader(ClientDataContext context)
-
-
Method Detail
-
markDataAvailable
public void markDataAvailable(SearchTrace trace)
Mark the dataTypes of the provided trace as available.- Parameters:
trace- SearchTrace with available data
-
read
public byte[] read(String traceUid, String dataType, long position, int count) throws IOException
Read count bytes of data starting on position from dataType of traceId.- Parameters:
traceUid- uid of the tracedataType- which type of data to read (html, raw, ...)position- offset to start readingcount- number of bytes to read- Returns:
- byte array of available data
- Throws:
IOException- when reading data failsNoSuchElementException- if no data for a given traceId and dataType combination is available
-
-