public class LearnerSnapshotThrottler extends Object
LearnerHandler objects should call
 beginSnapshot(boolean) before sending a snapshot and
 endSnapshot() after finishing, successfully or not.| Constructor and Description | 
|---|
LearnerSnapshotThrottler(int maxConcurrentSnapshots)  | 
LearnerSnapshotThrottler(int maxConcurrentSnapshots,
                        long timeoutMillis)
Constructs a new instance limiting the concurrent number of snapshots to
  
maxConcurrentSnapshots. | 
| Modifier and Type | Method and Description | 
|---|---|
LearnerSnapshot | 
beginSnapshot(boolean essential)
Indicates that a new snapshot is about to be sent. 
 | 
void | 
endSnapshot()
Indicates that a snapshot has been completed. 
 | 
public LearnerSnapshotThrottler(int maxConcurrentSnapshots,
                                long timeoutMillis)
maxConcurrentSnapshots.maxConcurrentSnapshots - maximum concurrent number of snapshotstimeoutMillis - 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 attemptedIllegalArgumentException - when timeoutMillis
                                            is negative or
                                            maxConcurrentSnaphots
                                            is less than 1public LearnerSnapshotThrottler(int maxConcurrentSnapshots)
public LearnerSnapshot beginSnapshot(boolean essential) throws SnapshotThrottleException, InterruptedException
essential - if true, do not throw an exception even
                  if throttling limit is reachedSnapshotThrottleException - if throttling limit has been exceeded
                                   and essential == false,
                                   even after waiting for the timeout
                                   period, if anyInterruptedException - if thread is interrupted while trying
                              to start a snapshot; cannot happen if
                              timeout is zeropublic void endSnapshot()
Copyright © 2008–2020 The Apache Software Foundation. All rights reserved.