Class GRpcAgentFileStreamServiceImpl

java.lang.Object
com.netflix.genie.agent.execution.services.impl.grpc.GRpcAgentFileStreamServiceImpl
All Implemented Interfaces:
AgentFileStreamService

public class GRpcAgentFileStreamServiceImpl extends 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 Details

    • start

      public void start(String claimedJobId, Path jobDirectoryRoot)
      Start the service.
      Specified by:
      start in interface AgentFileStreamService
      Parameters:
      claimedJobId - the claimed job id
      jobDirectoryRoot - the job directory
    • stop

      public void stop()
      Stop the service.
      Specified by:
      stop in interface AgentFileStreamService
    • forceServerSync

      public Optional<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).