@InterfaceAudience.Private public class ServerNonceManager extends Object
Modifier and Type | Field and Description |
---|---|
static String |
HASH_NONCE_GRACE_PERIOD_KEY |
Constructor and Description |
---|
ServerNonceManager(org.apache.hadoop.conf.Configuration conf) |
Modifier and Type | Method and Description |
---|---|
ScheduledChore |
createCleanupScheduledChore(Stoppable stoppable)
Creates a scheduled chore that is used to clean up old nonces.
|
void |
endOperation(long group,
long nonce,
boolean success)
Ends the operation started by startOperation.
|
void |
reportOperationFromWal(long group,
long nonce,
long writeTime)
Reports the operation from WAL during replay.
|
void |
setConflictWaitIterationMs(int conflictWaitIterationMs) |
boolean |
startOperation(long group,
long nonce,
Stoppable stoppable)
Starts the operation if operation with such nonce has not already succeeded.
|
public static final String HASH_NONCE_GRACE_PERIOD_KEY
public ServerNonceManager(org.apache.hadoop.conf.Configuration conf)
public void setConflictWaitIterationMs(int conflictWaitIterationMs)
public boolean startOperation(long group, long nonce, Stoppable stoppable) throws InterruptedException
group
- Nonce group.nonce
- Nonce.stoppable
- Stoppable that terminates waiting (if any) when the server is stopped.InterruptedException
public void endOperation(long group, long nonce, boolean success)
group
- Nonce group.nonce
- Nonce.success
- Whether the operation has succeeded.public void reportOperationFromWal(long group, long nonce, long writeTime)
group
- Nonce group.nonce
- Nonce.writeTime
- Entry write time, used to ignore entries that are too old.public ScheduledChore createCleanupScheduledChore(Stoppable stoppable)
stoppable
- Stoppable for the chore.Copyright © 2007-2016 The Apache Software Foundation. All Rights Reserved.