@InterfaceAudience.Private @InterfaceStability.Evolving public class WALProcedureStore extends java.lang.Object implements ProcedureStore
Modifier and Type | Class and Description |
---|---|
static interface |
WALProcedureStore.LeaseRecovery |
static class |
WALProcedureStore.SyncMetrics |
ProcedureStore.ProcedureStoreListener
Constructor and Description |
---|
WALProcedureStore(Configuration conf,
FileSystem fs,
Path walDir,
WALProcedureStore.LeaseRecovery leaseRecovery) |
Modifier and Type | Method and Description |
---|---|
void |
delete(long procId)
The specified procId was removed from the executor,
due to completion, abort or failure.
|
java.util.ArrayList<ProcedureWALFile> |
getActiveLogs() |
java.util.Set<ProcedureWALFile> |
getCorruptedLogs() |
FileSystem |
getFileSystem() |
protected Path |
getLogFilePath(long logId) |
long |
getMillisFromLastRoll() |
long |
getMillisToNextPeriodicRoll() |
int |
getNumThreads() |
ProcedureStoreTracker |
getStoreTracker() |
java.util.ArrayList<WALProcedureStore.SyncMetrics> |
getSyncMetrics() |
Path |
getWALDir() |
void |
insert(Procedure proc,
Procedure[] subprocs)
When a procedure is submitted to the executor insert(proc, null) will be called.
|
boolean |
isRunning() |
java.util.Iterator<Procedure> |
load()
Load the Procedures in the store.
|
protected void |
periodicRollForTesting() |
void |
recoverLease()
Acquire the lease for the procedure store.
|
void |
registerListener(ProcedureStore.ProcedureStoreListener listener)
Add the listener to the notification list.
|
protected boolean |
rollWriterForTesting() |
protected void |
sendPostSyncSignal() |
void |
start(int numSlots)
Start/Open the procedure store
|
void |
stop(boolean abort)
Stop/Close the procedure store
|
protected long |
syncSlots(FSDataOutputStream stream,
ByteSlot[] slots,
int offset,
int count) |
boolean |
unregisterListener(ProcedureStore.ProcedureStoreListener listener)
Remove the listener from the notification list.
|
void |
update(Procedure proc)
The specified procedure was executed,
and the new state should be written to the store.
|
public WALProcedureStore(Configuration conf, FileSystem fs, Path walDir, WALProcedureStore.LeaseRecovery leaseRecovery)
public void start(int numSlots) throws java.io.IOException
ProcedureStore
start
in interface ProcedureStore
java.io.IOException
public void stop(boolean abort)
ProcedureStore
stop
in interface ProcedureStore
abort
- true if the stop is an abortpublic boolean isRunning()
isRunning
in interface ProcedureStore
public int getNumThreads()
getNumThreads
in interface ProcedureStore
public ProcedureStoreTracker getStoreTracker()
public java.util.ArrayList<ProcedureWALFile> getActiveLogs()
public java.util.Set<ProcedureWALFile> getCorruptedLogs()
public void registerListener(ProcedureStore.ProcedureStoreListener listener)
ProcedureStore
registerListener
in interface ProcedureStore
listener
- The AssignmentListener to registerpublic boolean unregisterListener(ProcedureStore.ProcedureStoreListener listener)
ProcedureStore
unregisterListener
in interface ProcedureStore
listener
- The AssignmentListener to unregisterpublic void recoverLease() throws java.io.IOException
ProcedureStore
recoverLease
in interface ProcedureStore
java.io.IOException
public java.util.Iterator<Procedure> load() throws java.io.IOException
ProcedureStore
load
in interface ProcedureStore
java.io.IOException
public void insert(Procedure proc, Procedure[] subprocs)
ProcedureStore
insert
in interface ProcedureStore
proc
- the procedure to serialize and write to the store.subprocs
- the newly created child of the proc.public void update(Procedure proc)
ProcedureStore
update
in interface ProcedureStore
proc
- the procedure to serialize and write to the store.public void delete(long procId)
ProcedureStore
delete
in interface ProcedureStore
procId
- the ID of the procedure to remove.public java.util.ArrayList<WALProcedureStore.SyncMetrics> getSyncMetrics()
protected long syncSlots(FSDataOutputStream stream, ByteSlot[] slots, int offset, int count) throws java.io.IOException
java.io.IOException
protected void sendPostSyncSignal()
public long getMillisToNextPeriodicRoll()
public long getMillisFromLastRoll()
protected void periodicRollForTesting() throws java.io.IOException
java.io.IOException
protected boolean rollWriterForTesting() throws java.io.IOException
java.io.IOException
public Path getWALDir()
public FileSystem getFileSystem()
protected Path getLogFilePath(long logId) throws java.io.IOException
java.io.IOException