Class GRpcAgentFileStreamServiceImpl

  • All Implemented Interfaces:
    AgentFileStreamService

    public class GRpcAgentFileStreamServiceImpl
    extends java.lang.Object
    implements AgentFileStreamService
    Implementation of AgentFileStreamService over gRPC. Sets up a persistent 2-way stream ('sync') to push manifest updates and receive file requests. When a file request is received, a creates a new 2 way stream ('transmit') and pushes file chunks, waits for ACK, sends the next chunk, ... until the file range requested is transmitted. Then the stream is shut down.
    Since:
    4.0.0
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Optional<java.util.concurrent.ScheduledFuture<?>> forceServerSync()
      Request the service perform an update outside of the regular schedule to make sure the server has the most up-to-date view of local files.
      void start​(java.lang.String claimedJobId, java.nio.file.Path jobDirectoryRoot)
      Start the service.
      void stop()
      Stop the service.
      • Methods inherited from class java.lang.Object

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

      • start

        public void start​(java.lang.String claimedJobId,
                          java.nio.file.Path jobDirectoryRoot)
        Start the service.
        Specified by:
        start in interface AgentFileStreamService
        Parameters:
        claimedJobId - the claimed job id
        jobDirectoryRoot - the job directory
      • forceServerSync

        public java.util.Optional<java.util.concurrent.ScheduledFuture<?>> forceServerSync()
        Request the service perform an update outside of the regular schedule to make sure the server has the most up-to-date view of local files.
        Specified by:
        forceServerSync in interface AgentFileStreamService
        Returns:
        a scheduled future optional, which the caller can use to synchronously wait on the operation completion and outcome. The optional is empty if the task was not scheduled (because the service is not running).