org.apache.derby.io
Interface WritableStorageFactory

All Superinterfaces:
StorageFactory
All Known Implementing Classes:
DirStorageFactory

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
 boolean supportsRws()
          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
getCanonicalName, getSeparator, getStorageFactoryVersion, getTempDir, init, isFast, isReadOnlyDatabase, newStorageFile, newStorageFile, newStorageFile, shutdown, supportsRandomAccess
 

Method Detail

sync

public 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.

supportsRws

public boolean supportsRws()
This method tests whether the StorageRandomAccessFile "rws" and "rwd" modes are implemented. If the "rws" method is supported then the database engine will conclude that the write methods of "rws" 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.

Built on Tue 2006-10-10 19:23:47+0200, from revision exported

Apache Derby V10.1 Engine Documentation - Copyright © 1997,2005 The Apache Software Foundation or its licensors, as applicable.