Class ServerNonceManager

java.lang.Object
org.apache.hadoop.hbase.regionserver.ServerNonceManager

@Private public class ServerNonceManager extends Object
Implementation of nonce manager that stores nonces in a hash map and cleans them up after some time; if nonce group/client ID is supplied, nonces are stored by client ID.
  • Field Details

  • Constructor Details

    • ServerNonceManager

      public ServerNonceManager(org.apache.hadoop.conf.Configuration conf)
  • Method Details

    • setConflictWaitIterationMs

      public void setConflictWaitIterationMs(int conflictWaitIterationMs)
    • startOperation

      public boolean startOperation(long group, long nonce, Stoppable stoppable) throws InterruptedException
      Starts the operation if operation with such nonce has not already succeeded. If the operation is in progress, waits for it to end and checks whether it has succeeded.
      Parameters:
      group - Nonce group.
      nonce - Nonce.
      stoppable - Stoppable that terminates waiting (if any) when the server is stopped.
      Returns:
      true if the operation has not already succeeded and can proceed; false otherwise.
      Throws:
      InterruptedException
    • endOperation

      public void endOperation(long group, long nonce, boolean success)
      Ends the operation started by startOperation.
      Parameters:
      group - Nonce group.
      nonce - Nonce.
      success - Whether the operation has succeeded.
    • addMvccToOperationContext

      public void addMvccToOperationContext(long group, long nonce, long mvcc)
      Store the write point in OperationContext when the operation succeed.
      Parameters:
      group - Nonce group.
      nonce - Nonce.
      mvcc - Write point of the succeed operation.
    • getMvccFromOperationContext

      public long getMvccFromOperationContext(long group, long nonce)
      Return the write point of the previous succeed operation.
      Parameters:
      group - Nonce group.
      nonce - Nonce.
      Returns:
      write point of the previous succeed operation.
    • reportOperationFromWal

      public void reportOperationFromWal(long group, long nonce, long writeTime)
      Reports the operation from WAL during replay.
      Parameters:
      group - Nonce group.
      nonce - Nonce.
      writeTime - Entry write time, used to ignore entries that are too old.
    • createCleanupScheduledChore

      Creates a scheduled chore that is used to clean up old nonces.
      Parameters:
      stoppable - Stoppable for the chore.
      Returns:
      ScheduledChore; the scheduled chore is not started.
    • cleanUpOldNonces

      private void cleanUpOldNonces()