Package org.apache.derby.io
Interface WritableStorageFactory
-
- All Superinterfaces:
StorageFactory
- All Known Implementing Classes:
DirStorageFactory
,VFMemoryStorageFactory
public interface WritableStorageFactory extends StorageFactory
This interface extends StorageFactory to provide read/write access to storage.The database engine will call this interface's methods from its own privilege blocks.
Each WritableStorageFactory instance may be concurrently used by multiple threads.
-
-
Field Summary
-
Fields inherited from interface org.apache.derby.io.StorageFactory
VERSION_NUMBER
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
supportsWriteSync()
This method tests whether the StorageRandomAccessFile "rws" and "rwd" modes are implemented.void
sync(java.io.OutputStream stream, boolean metaData)
Force the data of an output stream out to the underlying storage.-
Methods inherited from interface org.apache.derby.io.StorageFactory
createTemporaryFile, getCanonicalName, getSeparator, getStorageFactoryVersion, getTempDir, init, isFast, isReadOnlyDatabase, newStorageFile, newStorageFile, newStorageFile, setCanonicalName, shutdown, supportsRandomAccess
-
-
-
-
Method Detail
-
sync
void sync(java.io.OutputStream stream, boolean metaData) throws java.io.IOException, java.io.SyncFailedException
Force the data of an output stream out to the underlying storage. That is, ensure that it has been made persistent. If the database is to be transient, that is, if the database does not survive a restart, then the sync method implementation need not do anything.- Parameters:
stream
- The stream to be synchronized.metaData
- If true then this method must force both changes to the file's contents and metadata to be written to storage; if false, it need only force file content changes to be written. The implementation is allowed to ignore this parameter and always force out metadata changes.- Throws:
java.io.IOException
- if an I/O error occurs.java.io.SyncFailedException
- Thrown when the buffers cannot be flushed, or because the system cannot guarantee that all the buffers have been synchronized with physical media.
-
supportsWriteSync
boolean supportsWriteSync()
This method tests whether the StorageRandomAccessFile "rws" and "rwd" modes are implemented. If the "rws" and "rwd" modes are supported then the database engine will conclude that the write methods of "rws"/"rwd" mode StorageRandomAccessFiles are slow but the sync method is fast and optimize accordingly.- Returns:
- true if an StIRandomAccess file opened with "rws" or "rwd" modes immediately writes data to the underlying storage, false if not.
-
-