Class BlockTransferThrottler


  • public final class BlockTransferThrottler
    extends java.lang.Object
    A class to restrict parallel connection per runtime edge. Executors can suffer from performance degradation and network-related exceptions when there are massive connections, especially under low network bandwidth or high volume of data.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void onTransferFinished​(java.lang.String runtimeEdgeId)
      Indicates the transfer has finished.
      java.util.concurrent.CompletableFuture<java.lang.Void> requestTransferPermission​(java.lang.String runtimeEdgeId)
      Request a permission to make a connection.
      • Methods inherited from class java.lang.Object

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

      • requestTransferPermission

        public java.util.concurrent.CompletableFuture<java.lang.Void> requestTransferPermission​(java.lang.String runtimeEdgeId)
        Request a permission to make a connection.
        Parameters:
        runtimeEdgeId - the corresponding runtime edge id.
        Returns:
        a future that will be completed when the connection is granted.
      • onTransferFinished

        public void onTransferFinished​(java.lang.String runtimeEdgeId)
        Indicates the transfer has finished.
        Parameters:
        runtimeEdgeId - the corresponding runtime edge id.