public class JobSchedulerStoreImpl extends AbstractKahaDBStore implements JobSchedulerStore
archiveCorruptedIndex, archiveDataLogs, checkForCorruptJournalFiles, checkpointInterval, checkpointLock, checkpointThread, checkpointThreadLock, checksumJournalFiles, cleanupInterval, deleteAllJobs, directory, directoryArchive, enableIndexDiskSyncs, enableIndexPageCaching, enableIndexRecoveryFile, enableIndexWriteAsync, enableJournalDiskSyncs, failIfDatabaseIsLocked, forceRecoverIndex, ignoreMissingJournalfiles, indexCacheSize, indexLFUEvictionFactor, indexLock, indexWriteBatchSize, journal, journalMaxFileLength, journalMaxWriteBatchSize, journalSize, LOG_SLOW_ACCESS_TIME, opened, pageFile, PROPERTY_LOG_SLOW_ACCESS_TIME, purgeStoreOnStartup, useIndexLFRUEviction
brokerService, clockDaemon
Constructor and Description |
---|
JobSchedulerStoreImpl() |
Modifier and Type | Method and Description |
---|---|
protected void |
checkpointUpdate(Transaction tx,
boolean cleanup)
Perform the checkpoint update operation.
|
protected void |
decrementJournalCount(Transaction tx,
Location location)
Removes one reference for the Journal log file indicated in the given Location value.
|
protected void |
doRecover(JournalCommand<?> data,
Location location,
Location inDoubtlocation)
Called during index recovery to rebuild the index from the last known good location.
|
protected File |
getDefaultDataDirectory() |
JobScheduler |
getJobScheduler(String name)
Returns the JobScheduler instance identified by the given name.
|
File |
getLegacyStoreArchiveDirectory()
Gets the directory where the legacy Scheduler Store files will be archived if the
broker is started and an existing Job Scheduler Store from an old version is detected.
|
protected String |
getPageFileName() |
protected ByteSequence |
getPayload(Location location)
Retrieve the scheduled Job's byte blob from the journal.
|
protected void |
incrementJournalCount(Transaction tx,
Location location)
Adds a reference for the journal log file pointed to by the given Location value.
|
void |
load()
Loads the store from disk.
|
protected void |
process(JournalCommand<?> data,
Location location)
Called during recovery to allow the store to rebuild from scratch.
|
protected void |
processLocation(Location location) |
void |
readLockIndex() |
void |
readUnlockIndex() |
protected void |
referenceRemovedLocation(Transaction tx,
Location location,
org.apache.activemq.store.kahadb.scheduler.JobLocation removedJob)
Updates the Job removal tracking index with the location of a remove command and the
original JobLocation entry.
|
boolean |
removeJobScheduler(String name)
Removes the named JobScheduler if it exists, purging all scheduled messages
assigned to it.
|
void |
setLegacyStoreArchiveDirectory(File directory)
Sets the directory where the legacy scheduler store files are archived before an
update attempt is made.
|
String |
toString() |
void |
unload()
Unload the state of the Store to disk and shuts down all resources assigned to this
KahaDB store implementation.
|
void |
writeLockIndex() |
void |
writeUnlockIndex() |
checkpointCleanup, checkpointUpdate, createDefaultLocker, createJournal, createPageFile, doStart, doStop, getCheckpointInterval, getCleanupInterval, getDirectory, getDirectoryArchive, getIndexCacheSize, getIndexLFUEvictionFactor, getIndexWriteBatchSize, getJournal, getJournalMaxFileLength, getJournalMaxWriteBatchSize, getPageFile, init, isArchiveCorruptedIndex, isArchiveDataLogs, isCheckForCorruptJournalFiles, isChecksumJournalFiles, isDeleteAllJobs, isEnableIndexDiskSyncs, isEnableIndexPageCaching, isEnableIndexRecoveryFile, isEnableIndexWriteAsync, isEnableJournalDiskSyncs, isFailIfDatabaseIsLocked, isForceRecoverIndex, isIgnoreMissingJournalfiles, isPurgeStoreOnStartup, isUseIndexLFRUEviction, load, setArchiveCorruptedIndex, setArchiveDataLogs, setCheckForCorruptJournalFiles, setCheckpointInterval, setChecksumJournalFiles, setCleanupInterval, setDeleteAllJobs, setDirectory, setDirectoryArchive, setEnableIndexDiskSyncs, setEnableIndexPageCaching, setEnableIndexRecoveryFile, setEnableIndexWriteAsync, setEnableJournalDiskSyncs, setFailIfDatabaseIsLocked, setForceRecoverIndex, setIgnoreMissingJournalfiles, setIndexCacheSize, setIndexLFUEvictionFactor, setIndexWriteBatchSize, setJournalMaxFileLength, setJournalMaxWriteBatchSize, setPurgeStoreOnStartup, setUseIndexLFRUEviction, size, startCheckpoint, store, store, store, store, store, toByteSequence
getBrokerService, getLocker, getLockKeepAlivePeriod, getScheduledThreadPoolExecutor, isUseLock, keepLockAlive, postStop, preStart, setBrokerService, setLocker, setLockKeepAlivePeriod, setScheduledThreadPoolExecutor, setUseLock, stopBroker
addServiceListener, dispose, isStarted, isStopped, isStopping, removeServiceListener, start, stop
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getDirectory, setDirectory, size
public JobSchedulerStoreImpl()
public JobScheduler getJobScheduler(String name) throws Exception
JobSchedulerStore
getJobScheduler
in interface JobSchedulerStore
name
- the name of the JobScheduler instance to lookup.Exception
- if an error occurs while loading the named scheduler.public boolean removeJobScheduler(String name) throws Exception
JobSchedulerStore
removeJobScheduler
in interface JobSchedulerStore
name
- the name of the scheduler instance to remove.Exception
- if an error occurs while removing the scheduler.public void setLegacyStoreArchiveDirectory(File directory)
directory
- The directory to move the legacy Scheduler Store files to.public File getLegacyStoreArchiveDirectory()
public void load() throws IOException
AbstractKahaDBStore
load
in class AbstractKahaDBStore
IOException
- if an error occurs during the load.public void unload() throws IOException
AbstractKahaDBStore
unload
in class AbstractKahaDBStore
IOException
- if an error occurs during the store unload.protected void checkpointUpdate(Transaction tx, boolean cleanup) throws IOException
AbstractKahaDBStore
checkpointUpdate
in class AbstractKahaDBStore
tx
- The TX under which to perform the checkpoint update.cleanup
- Should the checkpoint also do unused Journal file cleanup.IOException
- if an error occurs while performing the checkpoint.protected void incrementJournalCount(Transaction tx, Location location) throws IOException
tx
- The TX under which the update is to be performed.location
- The location value to update the reference count of.IOException
- if an error occurs while updating the journal references table.protected void decrementJournalCount(Transaction tx, Location location) throws IOException
tx
- The TX under which the update is to be performed.location
- The location value to update the reference count of.IOException
- if an error occurs while updating the journal references table.protected void referenceRemovedLocation(Transaction tx, Location location, org.apache.activemq.store.kahadb.scheduler.JobLocation removedJob) throws IOException
tx
- The TX under which the update is to be performed.location
- The location value to reference a remove command.removedJob
- The original JobLocation instance that holds the add and update locationsIOException
- if an error occurs while updating the remove location tracker.protected ByteSequence getPayload(Location location) throws IOException
location
- The location of the KahaAddScheduledJobCommand that originated the Job.IOException
- if an error occurs while reading the payload value.public void readLockIndex()
public void readUnlockIndex()
public void writeLockIndex()
public void writeUnlockIndex()
protected String getPageFileName()
getPageFileName
in class AbstractKahaDBStore
protected File getDefaultDataDirectory()
getDefaultDataDirectory
in class AbstractKahaDBStore
protected void doRecover(JournalCommand<?> data, Location location, Location inDoubtlocation) throws IOException
command
- the command read from the Journal which should be used to update the index.location
- the location in the index where the command was read.inDoubtlocation
- the location in the index known to be the last time the index was valid.IOException
- if an error occurs while recovering the index.protected void process(JournalCommand<?> data, Location location) throws IOException
process
in class AbstractKahaDBStore
data
- The command to process, which was read from the Journal.location
- The location of the command in the Journal.IOException
- if an error occurs during command processing.protected void processLocation(Location location)
Copyright © 2005–2017 The Apache Software Foundation. All rights reserved.