Class ProcedureStoreTracker

java.lang.Object
org.apache.hadoop.hbase.procedure2.store.wal.ProcedureStoreTracker

Deprecated.
Since 2.3.0, will be removed in 4.0.0. Keep here only for rolling upgrading, now we use the new region based procedure store.
Keeps track of live procedures. It can be used by the ProcedureStore to identify which procedures are already deleted/completed to avoid the deserialization step on restart
  • Field Details

    • LOG

      private static final org.slf4j.Logger LOG
      Deprecated.
    • map

      private final TreeMap<Long,BitSetNode> map
      Deprecated.
    • keepDeletes

      private boolean keepDeletes
      Deprecated.
      If true, do not remove bits corresponding to deleted procedures. Note that this can result in huge bitmaps overtime. Currently, it's set to true only when building tracker state from logs during recovery. During recovery, if we are sure that a procedure has been deleted, reading its old update entries can be skipped.
    • partial

      boolean partial
      Deprecated.
      If true, it means tracker has incomplete information about the active/deleted procedures. It's set to true only when recovering from old logs. See isDeleted(long) docs to understand it's real use.
    • minModifiedProcId

      private long minModifiedProcId
      Deprecated.
    • maxModifiedProcId

      private long maxModifiedProcId
      Deprecated.
  • Constructor Details

  • Method Details

    • resetToProto

      public void resetToProto(org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.ProcedureStoreTracker trackerProtoBuf)
      Deprecated.
    • resetTo

      public void resetTo(ProcedureStoreTracker tracker)
      Deprecated.
      Resets internal state to same as given tracker. Does deep copy of the bitmap.
    • resetTo

      public void resetTo(ProcedureStoreTracker tracker, boolean resetDelete)
      Deprecated.
      Resets internal state to same as given tracker, and change the deleted flag according to the modified flag if resetDelete is true. Does deep copy of the bitmap.

      The resetDelete will be set to true when building cleanup tracker, please see the comments in BitSetNode(BitSetNode, boolean) to learn how we change the deleted flag if resetDelete is true.

    • insert

      public void insert(long procId)
      Deprecated.
    • insert

      public void insert(long[] procIds)
      Deprecated.
    • insert

      public void insert(long procId, long[] subProcIds)
      Deprecated.
    • insert

      private BitSetNode insert(BitSetNode node, long procId)
      Deprecated.
    • update

      public void update(long procId)
      Deprecated.
    • update

      private BitSetNode update(BitSetNode node, long procId)
      Deprecated.
    • delete

      public void delete(long procId)
      Deprecated.
    • delete

      public void delete(long[] procIds)
      Deprecated.
    • delete

      private BitSetNode delete(BitSetNode node, long procId)
      Deprecated.
    • setMinMaxModifiedProcIds

      public void setMinMaxModifiedProcIds(long min, long max)
      Deprecated.
      Will be called when restarting where we need to rebuild the ProcedureStoreTracker.
    • setDeleted

      public void setDeleted(long procId, boolean isDeleted)
      Deprecated.
      This method is used when restarting where we need to rebuild the ProcedureStoreTracker. The delete(long) method above assume that the BitSetNode exists, but when restart this is not true, as we will read the wal files in reverse order so a delete may come first.
    • setDeletedIfModified

      public void setDeletedIfModified(long... procId)
      Deprecated.
      Set the given bit for the procId to delete if it was modified before.

      This method is used to test whether a procedure wal file can be safely deleted, as if all the procedures in the given procedure wal file has been modified in the new procedure wal files, then we can delete it.

    • setDeleteIf

      Deprecated.
    • setDeletedIfDeletedByThem

      Deprecated.
      For the global tracker, we will use this method to build the holdingCleanupTracker, as the modified flags will be cleared after rolling so we only need to test the deleted flags.
      See Also:
    • setDeletedIfModifiedInBoth

      Deprecated.
      Similar with setDeletedIfModified(long...), but here the procId are given by the tracker. If a procedure is modified by us, and also by the given tracker, then we mark it as deleted.
      See Also:
    • lookupClosestNode

      private BitSetNode lookupClosestNode(BitSetNode node, long procId)
      Deprecated.
      lookup the node containing the specified procId.
      Parameters:
      node - cached node to check before doing a lookup
      procId - the procId to lookup
      Returns:
      the node that may contains the procId or null
    • trackProcIds

      private void trackProcIds(long procId)
      Deprecated.
    • getModifiedMinProcId

      public long getModifiedMinProcId()
      Deprecated.
    • getModifiedMaxProcId

      public long getModifiedMaxProcId()
      Deprecated.
    • reset

      public void reset()
      Deprecated.
    • isModified

      public boolean isModified(long procId)
      Deprecated.
    • isDeleted

      Deprecated.
      If partial is false, returns state from the bitmap. If no state is found for procId, returns YES. If partial is true, tracker doesn't have complete view of system state, so it returns MAYBE if there is no update for the procedure or if it doesn't have a state in bitmap. Otherwise, returns state from the bitmap.
    • getActiveMinProcId

      public long getActiveMinProcId()
      Deprecated.
    • setKeepDeletes

      public void setKeepDeletes(boolean keepDeletes)
      Deprecated.
    • isPartial

      public boolean isPartial()
      Deprecated.
    • setPartialFlag

      public void setPartialFlag(boolean isPartial)
      Deprecated.
    • isEmpty

      public boolean isEmpty()
      Deprecated.
      Returns true, if no procedure is active, else false.
    • isAllModified

      public boolean isAllModified()
      Deprecated.
      Returns:
      true if all procedure was modified or deleted since last call to resetModified().
    • getAllActiveProcIds

      public long[] getAllActiveProcIds()
      Deprecated.
      Will be used when there are too many proc wal files. We will rewrite the states of the active procedures in the oldest proc wal file so that we can delete it.
      Returns:
      all the active procedure ids in this tracker.
    • resetModified

      public void resetModified()
      Deprecated.
      Clears the list of updated procedure ids. This doesn't affect global list of active procedure ids.
    • getOrCreateNode

      private BitSetNode getOrCreateNode(long procId)
      Deprecated.
    • growNode

      private BitSetNode growNode(BitSetNode node, long procId)
      Deprecated.
      Grows node to contain procId and updates the map.
      Returns:
      BitSetNode instance which contains procId.
    • mergeNodes

      private BitSetNode mergeNodes(BitSetNode leftNode, BitSetNode rightNode)
      Deprecated.
      Merges leftNode & rightNode and updates the map.
    • dump

      public void dump()
      Deprecated.
    • toProto

      public org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.ProcedureStoreTracker toProto() throws IOException
      Deprecated.
      Builds org.apache.hadoop.hbase.protobuf.generated.ProcedureProtos.ProcedureStoreTracker protocol buffer from current state.
      Throws:
      IOException