public class LearnerSnapshotThrottler extends Object
|Constructor and Description|
Constructs a new instance limiting the concurrent number of snapshots to
|Modifier and Type||Method and Description|
Indicates that a new snapshot is about to be sent.
Indicates that a snapshot has been completed.
public LearnerSnapshotThrottler(int maxConcurrentSnapshots, long timeoutMillis)
maxConcurrentSnapshots- maximum concurrent number of snapshots
timeoutMillis- milliseconds to attempt to wait when attempting to begin a snapshot that would otherwise be throttled; a value of zero means no waiting will be attempted
timeoutMillisis negative or
maxConcurrentSnaphotsis less than 1
public LearnerSnapshotThrottler(int maxConcurrentSnapshots)
public LearnerSnapshot beginSnapshot(boolean essential) throws SnapshotThrottleException, InterruptedException
true, do not throw an exception even if throttling limit is reached
SnapshotThrottleException- if throttling limit has been exceeded and
essential == false, even after waiting for the timeout period, if any
InterruptedException- if thread is interrupted while trying to start a snapshot; cannot happen if timeout is zero
public void endSnapshot()
Copyright © 2008–2020 The Apache Software Foundation. All rights reserved.