@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 |
---|---|
void |
addMvccToOperationContext(long group,
long nonce,
long mvcc)
Store the write point in OperationContext when the operation succeed.
|
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.
|
long |
getMvccFromOperationContext(long group,
long nonce)
Return the write point of the previous succeed operation.
|
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 addMvccToOperationContext(long group, long nonce, long mvcc)
group
- Nonce group.nonce
- Nonce.mvcc
- Write point of the succeed operation.public long getMvccFromOperationContext(long group, long nonce)
group
- Nonce group.nonce
- Nonce.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–2019 Cloudera. All rights reserved.