@InterfaceAudience.Private public class ProcedureWALFormatReader extends Object
Modifier and Type | Field and Description |
---|---|
private ProcedureWALFormat.Loader |
loader |
private WALProcedureMap |
localProcedureMap
We will use the localProcedureMap to track the active procedures for the current proc wal file,
and when we finished reading one proc wal file, we will merge he localProcedureMap to the
procedureMap, which tracks the global active procedures.
|
private ProcedureStoreTracker |
localTracker
If tracker for a log file is partial (see
ProcedureStoreTracker.partial ), we re-build
the list of procedures modified in that WAL because we need it for log cleaning purposes. |
private static org.slf4j.Logger |
LOG |
private long |
maxProcId |
private WALProcedureMap |
procedureMap |
private ProcedureStoreTracker |
tracker
Global tracker that will be used by the WALProcedureStore after load.
|
Constructor and Description |
---|
ProcedureWALFormatReader(ProcedureStoreTracker tracker,
ProcedureWALFormat.Loader loader) |
Modifier and Type | Method and Description |
---|---|
private void |
deleteEntry(long procId) |
void |
finish() |
private void |
insertIfPartial(ProcedureStoreTracker tracker,
org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.Procedure proc) |
private boolean |
isDeleted(long procId) |
private boolean |
isRequired(long procId) |
private void |
loadProcedure(org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.ProcedureWALEntry entry,
org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.Procedure proc) |
void |
read(ProcedureWALFile log) |
private void |
readDeleteEntry(org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.ProcedureWALEntry entry) |
private void |
readInitEntry(org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.ProcedureWALEntry entry) |
private void |
readInsertEntry(org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.ProcedureWALEntry entry) |
private void |
readUpdateEntry(org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.ProcedureWALEntry entry) |
private void |
setDeletedIfPartial(ProcedureStoreTracker tracker,
long procId) |
private static final org.slf4j.Logger LOG
private final WALProcedureMap localProcedureMap
WALProcedureMap
for more details.
After reading all the proc wal files, we will use the procedures in the procedureMap to build a
WALProcedureTree
, and then give the result to the upper layer. See the comments of
WALProcedureTree
and the code in finish()
for more details.private final WALProcedureMap procedureMap
private final ProcedureWALFormat.Loader loader
private final ProcedureStoreTracker tracker
private ProcedureStoreTracker localTracker
ProcedureStoreTracker.partial
), we re-build
the list of procedures modified in that WAL because we need it for log cleaning purposes. If
all procedures modified in a WAL are found to be obsolete, it can be safely deleted. (see
WALProcedureStore.removeInactiveLogs()
).
Notice that, the deleted part for this tracker will not be global valid as we can only count
the deletes in the current file, but it is not big problem as finally, the above tracker will
have the global state of deleted, and it will also be used to build the cleanup tracker.private long maxProcId
public ProcedureWALFormatReader(ProcedureStoreTracker tracker, ProcedureWALFormat.Loader loader)
public void read(ProcedureWALFile log) throws IOException
IOException
public void finish() throws IOException
IOException
private void setDeletedIfPartial(ProcedureStoreTracker tracker, long procId)
private void insertIfPartial(ProcedureStoreTracker tracker, org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.Procedure proc)
private void loadProcedure(org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.ProcedureWALEntry entry, org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.Procedure proc)
private void readInitEntry(org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.ProcedureWALEntry entry)
private void readInsertEntry(org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.ProcedureWALEntry entry)
private void readUpdateEntry(org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.ProcedureWALEntry entry)
private void readDeleteEntry(org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.ProcedureWALEntry entry)
private void deleteEntry(long procId)
private boolean isDeleted(long procId)
private boolean isRequired(long procId)
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.