@InterfaceAudience.Private class WALProcedureMap extends Object
add(ProcedureProtos.Procedure)
and remove(long)
. It is used
when reading a proc wal file. In these methods, for the same procedure, typically the one comes
later should win, please see the comment for
isIncreasing(ProcedureProtos.Procedure, ProcedureProtos.Procedure)
to see the
exceptions.
The second group is merge(WALProcedureMap)
. We will have a global
WALProcedureMap
to hold global the active procedures, and a local WALProcedureMap
to hold the active procedures for the current proc wal file. And when we finish reading a proc
wal file, we will merge the local one into the global one, by calling the
merge(WALProcedureMap)
method of the global one and pass the local one in. In this
method, for the same procedure, the one comes earlier will win, as we read the proc wal files
from new to old(the reverse order).Modifier and Type | Field and Description |
---|---|
private static org.slf4j.Logger |
LOG |
private long |
maxModifiedProcId |
private long |
minModifiedProcId |
private Map<Long,org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.Procedure> |
procMap |
Constructor and Description |
---|
WALProcedureMap() |
Modifier and Type | Method and Description |
---|---|
void |
add(org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.Procedure proc) |
boolean |
contains(long procId) |
long |
getMaxModifiedProcId() |
long |
getMinModifiedProcId() |
Collection<org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.Procedure> |
getProcedures() |
boolean |
isEmpty() |
private static boolean |
isIncreasing(org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.Procedure current,
org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.Procedure candidate) |
void |
merge(WALProcedureMap other)
Merge the given
WALProcedureMap into this one. |
void |
remove(long procId) |
private void |
trackProcId(long procId) |
private static final org.slf4j.Logger LOG
private final Map<Long,org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.Procedure> procMap
private long minModifiedProcId
private long maxModifiedProcId
WALProcedureMap()
private void trackProcId(long procId)
private static boolean isIncreasing(org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.Procedure current, org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.Procedure candidate)
public void add(org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.Procedure proc)
public void remove(long procId)
public boolean isEmpty()
public boolean contains(long procId)
public void merge(WALProcedureMap other)
WALProcedureMap
into this one. The WALProcedureMap
passed in
will be cleared after merging.public Collection<org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.Procedure> getProcedures()
public long getMinModifiedProcId()
public long getMaxModifiedProcId()
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.