Top Description Fields Methods
org.apache.derby.io

public Interface WritableStorageFactory

extends StorageFactory
Known Direct Implementers
org.apache.derby.impl.io.DirStorageFactory, org.apache.derby.impl.io.VFMemoryStorageFactory
Imports
java.io.OutputStream, .IOException, .SyncFailedException

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

Inherited from org.apache.derby.io.StorageFactory:
VERSION_NUMBER

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if an StIRandomAccess file opened with "rws" or "rwd" modes immediately writes data to the underlying storage, false if not.
supportsWriteSync
()

This method tests whether the StorageRandomAccessFile "rws" and "rwd" modes are implemented.

public void
sync(OutputStream
The stream to be synchronized.
stream
,
boolean
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.
metaData
)

Force the data of an output stream out to the underlying storage.

Inherited from org.apache.derby.io.StorageFactory:
createTemporaryFilegetCanonicalNamegetSeparatorgetStorageFactoryVersiongetTempDirinitisFastisReadOnlyDatabasenewStorageFilenewStorageFilenewStorageFilesetCanonicalNameshutdownsupportsRandomAccess

Method Detail

supportsWriteSyncback to summary
public 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:boolean

true if an StIRandomAccess file opened with "rws" or "rwd" modes immediately writes data to the underlying storage, false if not.

syncback to summary
public void sync(OutputStream stream, boolean metaData) throws IOException, 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:OutputStream

The stream to be synchronized.

metaData:boolean

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.

Exceptions
IOException:
if an I/O error occurs.
SyncFailedException:
Thrown when the buffers cannot be flushed, or because the system cannot guarantee that all the buffers have been synchronized with physical media.