@InterfaceAudience.Private @InterfaceStability.Evolving public class WALProcedureStore extends ProcedureStoreBase
| Modifier and Type | Class and Description |
|---|---|
static interface |
WALProcedureStore.LeaseRecovery |
static class |
WALProcedureStore.SyncMetrics |
ProcedureStore.ProcedureIterator, ProcedureStore.ProcedureLoader, ProcedureStore.ProcedureStoreListener| Modifier and Type | Field and Description |
|---|---|
static String |
EXEC_WAL_CLEANUP_ON_LOAD_CONF_KEY |
static String |
LOG_PREFIX |
static String |
MASTER_PROCEDURE_LOGDIR
Used to construct the name of the log directory for master procedures
|
static String |
MAX_RETRIES_BEFORE_ROLL_CONF_KEY |
static String |
MAX_SYNC_FAILURE_ROLL_CONF_KEY |
static String |
PERIODIC_ROLL_CONF_KEY |
static String |
ROLL_RETRIES_CONF_KEY |
static String |
ROLL_THRESHOLD_CONF_KEY |
static String |
STORE_WAL_SYNC_STATS_COUNT |
static String |
SYNC_WAIT_MSEC_CONF_KEY |
static String |
USE_HSYNC_CONF_KEY |
static String |
WAIT_BEFORE_ROLL_CONF_KEY |
static String |
WAL_COUNT_WARN_THRESHOLD_CONF_KEY |
| Constructor and Description |
|---|
WALProcedureStore(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.Path walDir,
org.apache.hadoop.fs.Path walArchiveDir,
WALProcedureStore.LeaseRecovery leaseRecovery) |
WALProcedureStore(org.apache.hadoop.conf.Configuration conf,
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.
|
void |
delete(long[] procIds,
int offset,
int count)
The specified procIds were removed from the executor,
due to completion, abort or failure.
|
void |
delete(Procedure proc,
long[] subProcIds)
The parent procedure completed.
|
ArrayList<ProcedureWALFile> |
getActiveLogs() |
Set<ProcedureWALFile> |
getCorruptedLogs() |
org.apache.hadoop.fs.FileSystem |
getFileSystem() |
protected org.apache.hadoop.fs.Path |
getLogFilePath(long logId) |
long |
getMillisFromLastRoll() |
long |
getMillisToNextPeriodicRoll() |
int |
getNumThreads() |
ProcedureStoreTracker |
getStoreTracker() |
ArrayList<WALProcedureStore.SyncMetrics> |
getSyncMetrics() |
org.apache.hadoop.fs.Path |
getWALDir() |
void |
insert(Procedure[] procs)
Serialize a set of new procedures.
|
void |
insert(Procedure proc,
Procedure[] subprocs)
When a procedure is submitted to the executor insert(proc, null) will be called.
|
void |
load(ProcedureStore.ProcedureLoader loader)
Load the Procedures in the store.
|
protected void |
periodicRollForTesting() |
void |
recoverLease()
Acquire the lease for the procedure store.
|
protected void |
removeInactiveLogsForTesting() |
protected boolean |
rollWriterForTesting() |
int |
setRunningProcedureCount(int count)
Set the number of procedure running.
|
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) |
protected void |
syncStream(org.apache.hadoop.fs.FSDataOutputStream stream) |
void |
update(Procedure proc)
The specified procedure was executed,
and the new state should be written to the store.
|
isRunning, registerListener, sendAbortProcessSignal, sendPostSyncSignal, setRunning, unregisterListenerpublic static final String LOG_PREFIX
public static final String MASTER_PROCEDURE_LOGDIR
public static final String WAL_COUNT_WARN_THRESHOLD_CONF_KEY
public static final String EXEC_WAL_CLEANUP_ON_LOAD_CONF_KEY
public static final String MAX_RETRIES_BEFORE_ROLL_CONF_KEY
public static final String WAIT_BEFORE_ROLL_CONF_KEY
public static final String ROLL_RETRIES_CONF_KEY
public static final String MAX_SYNC_FAILURE_ROLL_CONF_KEY
public static final String PERIODIC_ROLL_CONF_KEY
public static final String SYNC_WAIT_MSEC_CONF_KEY
public static final String USE_HSYNC_CONF_KEY
public static final String ROLL_THRESHOLD_CONF_KEY
public static final String STORE_WAL_SYNC_STATS_COUNT
public WALProcedureStore(org.apache.hadoop.conf.Configuration conf,
WALProcedureStore.LeaseRecovery leaseRecovery)
throws IOException
IOExceptionpublic WALProcedureStore(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.Path walDir,
org.apache.hadoop.fs.Path walArchiveDir,
WALProcedureStore.LeaseRecovery leaseRecovery)
throws IOException
IOExceptionpublic void start(int numSlots)
throws IOException
ProcedureStoreIOExceptionpublic void stop(boolean abort)
ProcedureStoreabort - true if the stop is an abortpublic int getNumThreads()
public int setRunningProcedureCount(int count)
ProcedureStorecount).public ProcedureStoreTracker getStoreTracker()
public ArrayList<ProcedureWALFile> getActiveLogs()
public Set<ProcedureWALFile> getCorruptedLogs()
public void recoverLease()
throws IOException
ProcedureStoreIOExceptionpublic void load(ProcedureStore.ProcedureLoader loader) throws IOException
ProcedureStoreloader - the ProcedureLoader that will handle the store-load eventsIOExceptionpublic void insert(Procedure proc, Procedure[] subprocs)
ProcedureStoreproc - the procedure to serialize and write to the store.subprocs - the newly created child of the proc.public void insert(Procedure[] procs)
ProcedureStoreprocs - the procedures to serialize and write to the store.public void update(Procedure proc)
ProcedureStoreproc - the procedure to serialize and write to the store.public void delete(long procId)
ProcedureStoreprocId - the ID of the procedure to remove.public void delete(Procedure proc, long[] subProcIds)
ProcedureStoreproc - the parent procedure to serialize and write to the store.subProcIds - the IDs of the sub-procedure to remove.public void delete(long[] procIds,
int offset,
int count)
ProcedureStoreprocIds - the IDs of the procedures to remove.offset - the array offset from where to start to deletecount - the number of IDs to deletepublic ArrayList<WALProcedureStore.SyncMetrics> getSyncMetrics()
protected long syncSlots(org.apache.hadoop.fs.FSDataOutputStream stream,
ByteSlot[] slots,
int offset,
int count)
throws IOException
IOExceptionprotected void syncStream(org.apache.hadoop.fs.FSDataOutputStream stream)
throws IOException
IOExceptionpublic long getMillisToNextPeriodicRoll()
public long getMillisFromLastRoll()
protected void periodicRollForTesting()
throws IOException
IOExceptionprotected boolean rollWriterForTesting()
throws IOException
IOExceptionprotected void removeInactiveLogsForTesting()
throws Exception
Exceptionpublic org.apache.hadoop.fs.Path getWALDir()
public org.apache.hadoop.fs.FileSystem getFileSystem()
protected org.apache.hadoop.fs.Path getLogFilePath(long logId)
throws IOException
IOExceptionCopyright © 2007–2018 The Apache Software Foundation. All rights reserved.