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 Details

    • ExtractionPluginDataReader

      public ExtractionPluginDataReader(ClientDataContext context)
  • Method Details

    • 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 trace
      dataType - which type of data to read (html, raw, ...)
      position - offset to start reading
      count - number of bytes to read
      Returns:
      byte array of available data
      Throws:
      IOException - when reading data fails
      NoSuchElementException - if no data for a given traceId and dataType combination is available