@InterfaceAudience.Private @InterfaceStability.Evolving public class WALProcedureStore extends Object implements ProcedureStore
| Modifier and Type | Class and Description |
|---|---|
static interface |
WALProcedureStore.LeaseRecovery |
ProcedureStore.ProcedureStoreListener| Constructor and Description |
|---|
WALProcedureStore(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path logDir,
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.
|
ArrayList<ProcedureWALFile> |
getActiveLogs() |
Set<ProcedureWALFile> |
getCorruptedLogs() |
org.apache.hadoop.fs.FileSystem |
getFileSystem() |
org.apache.hadoop.fs.Path |
getLogDir() |
protected org.apache.hadoop.fs.Path |
getLogFilePath(long logId) |
int |
getNumThreads() |
ProcedureStoreTracker |
getStoreTracker() |
void |
insert(Procedure proc,
Procedure[] subprocs)
When a procedure is submitted to the executor insert(proc, null) will be called.
|
boolean |
isRunning() |
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(org.apache.hadoop.fs.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(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path logDir,
WALProcedureStore.LeaseRecovery leaseRecovery)
public void start(int numSlots)
throws IOException
ProcedureStorestart in interface ProcedureStoreIOExceptionpublic void stop(boolean abort)
ProcedureStorestop in interface ProcedureStoreabort - true if the stop is an abortpublic boolean isRunning()
isRunning in interface ProcedureStorepublic int getNumThreads()
getNumThreads in interface ProcedureStorepublic ProcedureStoreTracker getStoreTracker()
public ArrayList<ProcedureWALFile> getActiveLogs()
public Set<ProcedureWALFile> getCorruptedLogs()
public void registerListener(ProcedureStore.ProcedureStoreListener listener)
ProcedureStoreregisterListener in interface ProcedureStorelistener - The AssignmentListener to registerpublic boolean unregisterListener(ProcedureStore.ProcedureStoreListener listener)
ProcedureStoreunregisterListener in interface ProcedureStorelistener - The AssignmentListener to unregisterpublic void recoverLease()
throws IOException
ProcedureStorerecoverLease in interface ProcedureStoreIOExceptionpublic Iterator<Procedure> load() throws IOException
ProcedureStoreload in interface ProcedureStoreIOExceptionpublic void insert(Procedure proc, Procedure[] subprocs)
ProcedureStoreinsert in interface ProcedureStoreproc - the procedure to serialize and write to the store.subprocs - the newly created child of the proc.public void update(Procedure proc)
ProcedureStoreupdate in interface ProcedureStoreproc - the procedure to serialize and write to the store.public void delete(long procId)
ProcedureStoredelete in interface ProcedureStoreprocId - the ID of the procedure to remove.protected long syncSlots(org.apache.hadoop.fs.FSDataOutputStream stream,
ByteSlot[] slots,
int offset,
int count)
throws IOException
IOExceptionprotected void sendPostSyncSignal()
protected void periodicRollForTesting()
throws IOException
IOExceptionprotected boolean rollWriterForTesting()
throws IOException
IOExceptionpublic org.apache.hadoop.fs.Path getLogDir()
public org.apache.hadoop.fs.FileSystem getFileSystem()
protected org.apache.hadoop.fs.Path getLogFilePath(long logId)
throws IOException
IOExceptionCopyright © 2007–2016 The Apache Software Foundation. All rights reserved.