Class BlobTransferAdmissionController

java.lang.Object
com.linkedin.davinci.blobtransfer.server.BlobTransferAdmissionController

public class BlobTransferAdmissionController extends Object
Host-level admission control for client-origin (Stateful CDC / external consumer) blob transfer requests.

This controller governs only the new client-request feature: it bounds concurrent client-origin transfers to their own reserved cap, which is a percentage of the host blob-transfer budget. Server-to-server (and DVC-to-DVC) transfers are not tracked here -- they keep using the pre-existing global concurrency counter in P2PFileTransferServerHandler. The two budgets are intentionally independent so client traffic can never perturb the tuned server-to-server path.

The client cap is decided atomically under a single lock. Admission frequency is low (a handful of concurrent cold-start transfers, each lasting minutes), so synchronized carries no meaningful cost.

  • Constructor Details

    • BlobTransferAdmissionController

      public BlobTransferAdmissionController(int maxConcurrentTransfers, int clientCapacityPercent)
      Parameters:
      maxConcurrentTransfers - the host-wide concurrency budget N (must be > 0) that the client cap is expressed as a percentage of.
      clientCapacityPercent - the percentage [0, 50] of N reserved as the client-origin cap. 0 disables client-origin transfers entirely; any positive percentage yields a cap of at least 1 so a small budget does not silently round the client reservation down to zero. Capped at 50% so client transfers cannot dominate shared host I/O.
  • Method Details

    • tryAdmitClient

      public boolean tryAdmitClient()
      Attempt to admit a client-origin transfer, incrementing the in-flight count on success. The caller must invoke releaseClient() exactly once for every true result, when the transfer finishes.
      Returns:
      true if admitted, false if the client-origin reservation is full.
    • releaseClient

      public void releaseClient()
      Release a previously admitted client-origin slot. Clamped at 0 to defend against a double release.
    • getClientInFlight

      public int getClientInFlight()
    • getMaxClientTransfers

      public int getMaxClientTransfers()