Package org.h2.store
Interface DataHandler
-
- All Known Implementing Classes:
Database,Recover,SessionRemote
public interface DataHandlerA data handler contains a number of callback methods, mostly related to CLOB and BLOB handling. The most important implementing class is a database.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcheckPowerOff()Check if the simulated power failure occurred.voidcheckWritingAllowed()Check if writing is allowed.CompareModegetCompareMode()Return compare mode.java.lang.StringgetDatabasePath()Get the database path.SmallLRUCache<java.lang.String,java.lang.String[]>getLobFileListCache()Get the lob file list cache if it is used.LobStorageInterfacegetLobStorage()Get the lob storage mechanism to use.java.lang.ObjectgetLobSyncObject()Get the synchronization object for lob operations.intgetMaxLengthInplaceLob()Get the maximum length of a in-place large objectTempFileDeletergetTempFileDeleter()Get the temp file deleter mechanism.FileStoreopenFile(java.lang.String name, java.lang.String mode, boolean mustExist)Open a file at the given location.intreadLob(long lobId, byte[] hmac, long offset, byte[] buff, int off, int length)Read from a lob.
-
-
-
Method Detail
-
getDatabasePath
java.lang.String getDatabasePath()
Get the database path.- Returns:
- the database path
-
openFile
FileStore openFile(java.lang.String name, java.lang.String mode, boolean mustExist)
Open a file at the given location.- Parameters:
name- the file namemode- the modemustExist- whether the file must already exist- Returns:
- the file
-
checkPowerOff
void checkPowerOff() throws DbExceptionCheck if the simulated power failure occurred. This call will decrement the countdown.- Throws:
DbException- if the simulated power failure occurred
-
checkWritingAllowed
void checkWritingAllowed() throws DbExceptionCheck if writing is allowed.- Throws:
DbException- if it is not allowed
-
getMaxLengthInplaceLob
int getMaxLengthInplaceLob()
Get the maximum length of a in-place large object- Returns:
- the maximum size
-
getTempFileDeleter
TempFileDeleter getTempFileDeleter()
Get the temp file deleter mechanism.- Returns:
- the temp file deleter
-
getLobSyncObject
java.lang.Object getLobSyncObject()
Get the synchronization object for lob operations.- Returns:
- the synchronization object
-
getLobFileListCache
SmallLRUCache<java.lang.String,java.lang.String[]> getLobFileListCache()
Get the lob file list cache if it is used.- Returns:
- the cache or null
-
getLobStorage
LobStorageInterface getLobStorage()
Get the lob storage mechanism to use.- Returns:
- the lob storage mechanism
-
readLob
int readLob(long lobId, byte[] hmac, long offset, byte[] buff, int off, int length)Read from a lob.- Parameters:
lobId- the lob idhmac- the message authentication codeoffset- the offset within the lobbuff- the target bufferoff- the offset within the target bufferlength- the number of bytes to read- Returns:
- the number of bytes read
-
getCompareMode
CompareMode getCompareMode()
Return compare mode.- Returns:
- Compare mode.
-
-