Class TransferProcessor


  • public class TransferProcessor
    extends java.lang.Object
    • Constructor Detail

      • TransferProcessor

        public TransferProcessor​(NetworkManager net_man,
                                 int _processor_type,
                                 LimitedRateGroup max_rate_limit,
                                 boolean multi_threaded)
        Create new transfer processor for the given read/write type, limited to the given max rate.
        Parameters:
        processor_type - read or write processor
        max_rate_limit - to use
    • Method Detail

      • registerPeerConnection

        public void registerPeerConnection​(NetworkConnectionBase connection,
                                           boolean upload)
        Register peer connection for upload handling. NOTE: The given max rate limit is ignored until the connection is upgraded.
        Parameters:
        connection - to register
        group - rate limit group
      • deregisterPeerConnection

        public boolean deregisterPeerConnection​(NetworkConnectionBase connection)
        Cancel upload handling for the given peer connection.
        Parameters:
        connection - to cancel
      • setRateLimiterFreezeState

        public void setRateLimiterFreezeState​(boolean frozen)
      • upgradePeerConnection

        public void upgradePeerConnection​(NetworkConnectionBase connection,
                                          int partition_id)
        Upgrade the given connection to a high-speed transfer handler.
        Parameters:
        connection - to upgrade
      • downgradePeerConnection

        public void downgradePeerConnection​(NetworkConnectionBase connection)
        Downgrade the given connection back to a normal-speed transfer handler.
        Parameters:
        connection - to downgrade
      • createBucket

        private ByteBucket createBucket​(int bytes_per_sec)