|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.derby.impl.store.raw.log.ReadOnly
public class ReadOnly
A read-only version of the log factory. It doesn't do anything, it doesn't check that the database needs recovery or not.
It doesn't handle undo. No recovery.
Multithreading considerations:
This class must be MT-safe.
| Field Summary | |
|---|---|
private java.lang.String |
logArchiveDirectory
|
| Fields inherited from interface org.apache.derby.iapi.store.raw.log.LogFactory |
|---|
LOG_DIRECTORY_NAME, MODULE, RT_READONLY, RUNTIME_ATTRIBUTES |
| Constructor Summary | |
|---|---|
ReadOnly()
|
|
| Method Summary | |
|---|---|
void |
abortLogBackup()
|
boolean |
canSupport(java.util.Properties startParams)
See if this implementation can support any attributes that are listed in properties. |
boolean |
checkpoint(RawStoreFactory rawStoreFactory,
DataFactory dataFactory,
TransactionFactory transactionFactory,
boolean wait)
MT - not needed, no work is done |
void |
checkpointInRFR(LogInstant cinstant,
long redoLWM,
long undoLWM,
DataFactory df)
Perform 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()
Not applicable in readonly databases |
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()
Backup restore - stop sending log record to the log stream |
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()
|
LogInstant |
getTruncationLWM(UUID name)
|
boolean |
inReplicationMasterMode()
Replication not applicable on readonly databases. |
boolean |
inRFR()
|
boolean |
isCheckpointInLastLogFile()
|
boolean |
logArchived()
Backup restore - is the log being archived to some directory? |
StandardException |
markCorrupt(StandardException originalError)
Mark the module as corrupt. |
ScanHandle |
openFlushedScan(DatabaseInstant i,
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)
MT - not needed, no work is done |
void |
removeTruncationLWM(UUID name)
|
void |
removeTruncationLWM(UUID name,
RawStoreFactory rawStoreFactory,
TransactionFactory transFactory)
|
void |
setDatabaseEncrypted(boolean isEncrypted,
boolean flushLog)
Sets whether the database is encrypted. |
void |
setRawStoreFactory(RawStoreFactory rsf)
Not applicable in readonly databases |
void |
setTruncationLWM(UUID name,
LogInstant instant)
|
LogInstant |
setTruncationLWM(UUID name,
LogInstant instant,
RawStoreFactory rawStoreFactory,
TransactionFactory transFactory)
|
void |
startLogBackup(java.io.File toDir)
|
void |
startNewLogFile()
|
void |
startReplicationMasterRole(MasterFactory masterFactory)
Replication not applicable on readonly databases |
void |
stopReplicationMasterRole()
Replication not applicable on readonly databases |
void |
unfreezePersistentStore()
Backup restore - start sending log record to the log stream |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private java.lang.String logArchiveDirectory
| Constructor Detail |
|---|
public ReadOnly()
| Method Detail |
|---|
public Logger getLogger()
getLogger in interface LogFactory
public void createDataWarningFile()
throws StandardException
createDataWarningFile in interface LogFactoryStandardExceptionpublic void setRawStoreFactory(RawStoreFactory rsf)
setRawStoreFactory in interface LogFactory
public void recover(DataFactory dataFactory,
TransactionFactory transactionFactory)
throws StandardException
recover in interface LogFactorydataFactory - - the data factorytransactionFactory - - the transaction factory
StandardException - Standard Derby Error Policy
public boolean checkpoint(RawStoreFactory rawStoreFactory,
DataFactory dataFactory,
TransactionFactory transactionFactory,
boolean wait)
checkpoint in interface LogFactoryrawStoreFactory - - 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.
public StandardException markCorrupt(StandardException originalError)
Corruptable
markCorrupt in interface Corruptable
public void flush(LogInstant where)
throws StandardException
LogFactory
flush in interface LogFactorywhere - flush log up to here
StandardException - cannot flush log file due to sync errorpublic boolean canSupport(java.util.Properties startParams)
ModuleSupportable
The module can check for attributes in the properties to
see if it can fulfill the required behaviour. E.g. the raw
store may define an attribute called RawStore.Recoverable.
If a temporary raw store is required the property RawStore.recoverable=false
would be added to the properties before calling bootServiceModule. If a
raw store cannot support this attribute its canSupport method would
return null. Also see the Monitor class's prologue to see how the
identifier is used in looking up properties.
Actually a better way maybe to have properties of the form
RawStore.Attributes.mandatory=recoverable,smallfootprint and
RawStore.Attributes.requested=oltp,fast
canSupport in interface ModuleSupportable
public LogInstant setTruncationLWM(UUID name,
LogInstant instant,
RawStoreFactory rawStoreFactory,
TransactionFactory transFactory)
throws StandardException
StandardException
public void setTruncationLWM(UUID name,
LogInstant instant)
throws StandardException
StandardException - functionality not implemented
public void removeTruncationLWM(UUID name,
RawStoreFactory rawStoreFactory,
TransactionFactory transFactory)
throws StandardException
StandardException - functionality not implemented
public LogInstant getTruncationLWM(UUID name)
throws StandardException
StandardException - functionality not implemented
public void removeTruncationLWM(UUID name)
throws StandardException
StandardException - functionality not implemented
public ScanHandle openFlushedScan(DatabaseInstant i,
int groupsIWant)
throws StandardException
LogFactoryMT- read only
openFlushedScan in interface LogFactoryi - - 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 - functionality not implemented
public LogScan openForwardsScan(LogInstant startAt,
LogInstant stopAt)
throws StandardException
LogFactoryMT- read only
openForwardsScan in interface LogFactorystartAt - - 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 - functionality not implementedpublic LogInstant getFirstUnflushedInstant()
LogFactory
getFirstUnflushedInstant in interface LogFactorypublic long getFirstUnflushedInstantAsLong()
LogFactory
getFirstUnflushedInstantAsLong in interface LogFactory
public LogScan openForwardsFlushedScan(LogInstant startAt)
throws StandardException
LogFactoryMT- read only
openForwardsFlushedScan in interface LogFactorystartAt - - 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 - functionality not implemented
public void freezePersistentStore()
throws StandardException
freezePersistentStore in interface LogFactoryStandardException - Standard Derby error policy
public void unfreezePersistentStore()
throws StandardException
unfreezePersistentStore in interface LogFactoryStandardException - Standard Derby error policypublic boolean logArchived()
logArchived in interface LogFactorypublic void getLogFactoryProperties(PersistentSet set)
getLogFactoryProperties in interface LogFactorypublic StorageFile getLogDirectory()
LogFactory
getLogDirectory in interface LogFactorypublic java.lang.String getCanonicalLogPath()
LogFactory
getCanonicalLogPath in interface LogFactorypublic void enableLogArchiveMode()
enableLogArchiveMode in interface LogFactorypublic void disableLogArchiveMode()
disableLogArchiveMode in interface LogFactorypublic void deleteOnlineArchivedLogFiles()
deleteOnlineArchivedLogFiles in interface LogFactorypublic boolean inRFR()
inRFR in interface LogFactory
public void checkpointInRFR(LogInstant cinstant,
long redoLWM,
long undoLWM,
DataFactory df)
throws StandardException
checkpointInRFR in interface LogFactorycinstant - The LogInstant of the checkpointredoLWM - Redo Low Water Mark in the check point recordundoLWM - Undo Low Water Mark in the checkpointdf - - the data factory
StandardException
public void startLogBackup(java.io.File toDir)
throws StandardException
startLogBackup in interface LogFactoryStandardException
public void endLogBackup(java.io.File toDir)
throws StandardException
endLogBackup in interface LogFactoryStandardExceptionpublic void abortLogBackup()
abortLogBackup in interface LogFactory
public void setDatabaseEncrypted(boolean isEncrypted,
boolean flushLog)
Read-only database can not be re-encrypted, nothing to do in this case.
setDatabaseEncrypted in interface LogFactoryisEncrypted - true if the database is encrypted,
false if notflushLog - true if log needs to be flushed,
false otherwise
public void startNewLogFile()
throws StandardException
startNewLogFile in interface LogFactoryStandardException
public boolean isCheckpointInLastLogFile()
throws StandardException
isCheckpointInLastLogFile in interface LogFactoryStandardException
public void deleteLogFileAfterCheckpointLogFile()
throws StandardException
deleteLogFileAfterCheckpointLogFile in interface LogFactoryStandardException
public boolean checkVersion(int requiredMajorVersion,
int requiredMinorVersion,
java.lang.String feature)
throws StandardException
checkVersion in interface LogFactoryrequiredMajorVersion - 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 - not implemented exception is thrown
public void startReplicationMasterRole(MasterFactory masterFactory)
throws StandardException
startReplicationMasterRole in interface LogFactorymasterFactory - The MasterFactory service responsible for
controlling the master side replication behaviour.
StandardException - always thrown, indicating that
ReadOnly databases can not be replicatedpublic boolean inReplicationMasterMode()
inReplicationMasterMode in interface LogFactorypublic void stopReplicationMasterRole()
stopReplicationMasterRole in interface LogFactory
|
Built on Wed 2013-06-12 15:21:56+0000, from revision ??? | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||