public interface LogFactory extends Corruptable
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
LOG_DIRECTORY_NAME
The name of the default log directory.
|
static java.lang.String |
MODULE |
static java.lang.String |
RT_READONLY
An attribute that indicates the database is readonly
|
static java.lang.String |
RUNTIME_ATTRIBUTES
The name of a runtime property in the service set that defines any runtime
attributes a log factory should have.
|
Modifier and Type | Method and Description |
---|---|
void |
abortLogBackup() |
boolean |
checkpoint(RawStoreFactory rawStoreFactory,
DataFactory dataFactory,
TransactionFactory transactionFactory,
boolean wait)
Checkpoint the rawstore.
|
void |
checkpointInRFR(LogInstant cinstant,
long redoLWM,
long undoLWM,
DataFactory df)
redoing a checkpoint during rollforward recovery
|
boolean |
checkVersion(int requiredMajorVersion,
int requiredMinorVersion,
java.lang.String feature)
Check to see if a database has been upgraded to the required
level in order to use a store feature.
|
void |
createDataWarningFile()
Create readme file in log directory warning users against touching
any files in the directory
|
void |
deleteLogFileAfterCheckpointLogFile() |
void |
deleteOnlineArchivedLogFiles() |
void |
disableLogArchiveMode() |
void |
enableLogArchiveMode() |
void |
endLogBackup(java.io.File toDir) |
void |
flush(LogInstant where)
Flush all unwritten log record up to the log instance indicated to disk.
|
void |
freezePersistentStore()
Stop making any change to the persistent store
|
java.lang.String |
getCanonicalLogPath()
Return the canonical directory of the PARENT of the log directory.
|
LogInstant |
getFirstUnflushedInstant()
Get the instant for the last record in the log.
|
long |
getFirstUnflushedInstantAsLong()
Get the log instant long value of the first log record that has not
been flushed.
|
StorageFile |
getLogDirectory()
Return the location of the log directory.
|
void |
getLogFactoryProperties(PersistentSet set)
Get JBMS properties relevant to the log factory
|
Logger |
getLogger() |
boolean |
inReplicationMasterMode()
Used to determine if the replication master mode has been started,
and the logging for unlogged operations needs to be enabled.
|
boolean |
inRFR() |
boolean |
isCheckpointInLastLogFile() |
boolean |
logArchived()
checks whether is log archive mode is enabled or not.
|
ScanHandle |
openFlushedScan(DatabaseInstant startAt,
int groupsIWant)
Get a ScanHandle to scan flushed records from the log.
|
LogScan |
openForwardsFlushedScan(LogInstant startAt)
Get a LogScan to scan flushed records from the log.
|
LogScan |
openForwardsScan(LogInstant startAt,
LogInstant stopAt)
Get a LogScan to scan the log in a forward direction.
|
void |
recover(DataFactory dataFactory,
TransactionFactory transactionFactory)
Recover the database to a consistent state using the log.
|
void |
setDatabaseEncrypted(boolean isEncrypted,
boolean flushLog)
Sets whether the database is encrypted, all the transaction log has
to be encrypted, and flush the log if requested.
|
void |
setRawStoreFactory(RawStoreFactory rsf)
Make log factory aware of which raw store factory it belongs to
|
void |
startLogBackup(java.io.File toDir) |
void |
startNewLogFile() |
void |
startReplicationMasterRole(MasterFactory masterFactory)
Make this LogFactory pass log records to the MasterFactory
every time a log record is appended to the log on disk, and
notify the MasterFactory when a log disk flush has taken place.
|
void |
stopReplicationMasterRole()
Stop this LogFactory from passing log records to the
MasterFactory and from notifying the MasterFactory when a log
disk flush has taken place.
|
void |
unfreezePersistentStore()
Can start making change to the persistent store again
|
markCorrupt
static final java.lang.String RUNTIME_ATTRIBUTES
static final java.lang.String RT_READONLY
static final java.lang.String LOG_DIRECTORY_NAME
static final java.lang.String MODULE
Logger getLogger()
void createDataWarningFile() throws StandardException
StandardException
void setRawStoreFactory(RawStoreFactory rsf)
void recover(DataFactory dataFactory, TransactionFactory transactionFactory) throws StandardException
dataFactory
- - the data factorytransactionFactory
- - the transaction factoryStandardException
- - encounter exception while recovering.boolean checkpoint(RawStoreFactory rawStoreFactory, DataFactory dataFactory, TransactionFactory transactionFactory, boolean wait) throws StandardException
rawStoreFactory
- - the raw storedataFactory
- - the data factorytransactionFactory
- - the transaction factorywait
- - if true waits for any existing checkpoint to complete
and then executes and waits for another checkpoint.
if false if another thead is executing a checkpoint
routine will return immediately.StandardException
- - got exception while doing checkpoint.void flush(LogInstant where) throws StandardException
where
- flush log up to hereStandardException
- cannot flush log file due to sync errorLogScan openForwardsFlushedScan(LogInstant startAt) throws StandardException
MT- read only
startAt
- - the LogInstant where we start our scan. null means
start at the beginning of the log. This function raises an error
if startAt is a LogInstant which is not in the log.StandardException
- Standard Derby error policy
NOTE: This will be removed after the LogSniffer Rewrite.ScanHandle openFlushedScan(DatabaseInstant startAt, int groupsIWant) throws StandardException
MT- read only
startAt
- - the LogInstant where we start our scan. null means
start at the beginning of the log. This function raises an error
if startAt is a LogInstant which is not in the log.groupsIWant
- - log record groups the scanner wants.StandardException
- Standard Derby error policyLogScan openForwardsScan(LogInstant startAt, LogInstant stopAt) throws StandardException
MT- read only
startAt
- - the LogInstant where we start our scan. null means
start at the beginning of the log. This function raises an error
if startAt is a LogInstant which is not in the log.stopAt
- - the LogInstant where we stop our scan. null means
stop at the end of the log. This function raises an error
if stopAt is a LogInstant which is not in the log.StandardException
- Standard Derby error policyLogInstant getFirstUnflushedInstant()
long getFirstUnflushedInstantAsLong()
void freezePersistentStore() throws StandardException
StandardException
- Standard Derby exception policy.void unfreezePersistentStore() throws StandardException
StandardException
- Standard Derby exception policy.boolean logArchived()
boolean inReplicationMasterMode()
void getLogFactoryProperties(PersistentSet set) throws StandardException
StandardException
- Standard Derby Error PolicyStorageFile getLogDirectory() throws StandardException
StandardException
- Standard Derby Error Policyjava.lang.String getCanonicalLogPath()
void enableLogArchiveMode() throws StandardException
StandardException
void disableLogArchiveMode() throws StandardException
StandardException
void deleteOnlineArchivedLogFiles()
boolean inRFR()
void checkpointInRFR(LogInstant cinstant, long redoLWM, long undoLWM, DataFactory df) throws StandardException
cinstant
- The LogInstant of the checkpointredoLWM
- Redo Low Water Mark in the check point recordundoLWM
- Undo Low Water Mark in the checkpointdf
- - the data factoryStandardException
- - encounter exception during checkpointvoid startLogBackup(java.io.File toDir) throws StandardException
StandardException
void endLogBackup(java.io.File toDir) throws StandardException
StandardException
void abortLogBackup()
void setDatabaseEncrypted(boolean isEncrypted, boolean flushLog) throws StandardException
Log needs to be flushed first if the cryptographic state of the database changes (for instance re-encryption with a new key).
isEncrypted
- true
if the database is encrypted,
false
if notflushLog
- true
if log needs to be flushed,
false
otherwiseStandardException
void startNewLogFile() throws StandardException
StandardException
boolean isCheckpointInLastLogFile() throws StandardException
StandardException
void deleteLogFileAfterCheckpointLogFile() throws StandardException
StandardException
boolean checkVersion(int requiredMajorVersion, int requiredMinorVersion, java.lang.String feature) throws StandardException
requiredMajorVersion
- required database Engine major versionrequiredMinorVersion
- required database Engine minor versionfeature
- Non-null to throw an exception, null to return the
state of the version match. true
if the database has been upgraded to
the required level, false
otherwise.StandardException
- if the database is not at the require version
when feature
feature is
not null
.void startReplicationMasterRole(MasterFactory masterFactory) throws StandardException
masterFactory
- The MasterFactory service responsible for
controlling the master side replication behaviour.StandardException
- Standard Derby exception policy,
thrown on replication startup error. Will only be thrown if
replication is attempted started on a readonly database.void stopReplicationMasterRole()
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.