Class AbstractPythonProcessService.SyncDataIngestor<D>

  • Type Parameters:
    D - type of data to be ingested
    All Implemented Interfaces:
    DataIngestor<D>
    Enclosing class:
    AbstractPythonProcessService

    protected static class AbstractPythonProcessService.SyncDataIngestor<D>
    extends java.lang.Object
    implements DataIngestor<D>
    Ingestor implementation for synchronous processing. Stores received data and returns it.
    Author:
    Holger Eichelberger, SSE
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.concurrent.BlockingQueue<D> received  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected SyncDataIngestor()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void ingest​(D data)
      Ingest data.
      D waitForResult()
      In case of synchronous services, waits for the response and returns it.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • received

        private java.util.concurrent.BlockingQueue<D> received
    • Constructor Detail

      • SyncDataIngestor

        protected SyncDataIngestor()
    • Method Detail

      • ingest

        public void ingest​(D data)
        Description copied from interface: DataIngestor
        Ingest data.
        Specified by:
        ingest in interface DataIngestor<D>
        Parameters:
        data - the data to ingest
      • waitForResult

        public D waitForResult()
                        throws java.util.concurrent.ExecutionException
        Description copied from interface: DataIngestor
        In case of synchronous services, waits for the response and returns it. In case of asynchronous services, shall always return null.
        Specified by:
        waitForResult in interface DataIngestor<D>
        Returns:
        the (synchronous) processing result
        Throws:
        java.util.concurrent.ExecutionException - if waiting was interrupted and there is no data