abstract class CorruptBaseStorageFactory
extends java.lang.Object
implements org.apache.derby.io.WritableStorageFactory
CorruptibleIo,
WritableStorageFactory| Modifier and Type | Field and Description |
|---|---|
protected org.apache.derby.io.WritableStorageFactory |
realStorageFactory |
| Constructor and Description |
|---|
CorruptBaseStorageFactory()
Most of the initialization is done in the init method.
|
| Modifier and Type | Method and Description |
|---|---|
org.apache.derby.io.StorageFile |
createTemporaryFile(java.lang.String prefix,
java.lang.String suffix)
Create and returns a temporary file in temporary file system of database.
|
java.lang.String |
getCanonicalName()
Get the canonical name of the database.
|
(package private) abstract org.apache.derby.io.WritableStorageFactory |
getRealStorageFactory()
get the real storage factory
|
char |
getSeparator()
Get the pathname separator character used by the StorageFile
implementation.
|
int |
getStorageFactoryVersion() |
org.apache.derby.io.StorageFile |
getTempDir()
Get the abstract name of the directory that holds temporary files.
|
void |
init(java.lang.String home,
java.lang.String databaseName,
java.lang.String tempDirName,
java.lang.String uniqueName)
Classes implementing the StorageFactory interface must have a null
constructor.
|
boolean |
isFast()
This method is used to determine whether the storage is fast
(RAM based) or slow (disk based).
|
boolean |
isReadOnlyDatabase() |
org.apache.derby.io.StorageFile |
newStorageFile(org.apache.derby.io.StorageFile directoryName,
java.lang.String fileName)
Construct a StorageFile from a directory and file name.
|
org.apache.derby.io.StorageFile |
newStorageFile(java.lang.String path)
Construct a StorageFile from a path name.
|
org.apache.derby.io.StorageFile |
newStorageFile(java.lang.String directoryName,
java.lang.String fileName)
Construct a StorageFile from a directory and file name.
|
void |
setCanonicalName(java.lang.String name)
Set the canonicalName.
|
void |
shutdown() |
boolean |
supportsRandomAccess()
Determine whether the storage supports random access.
|
boolean |
supportsWriteSync()
This method tests whether the "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.
|
protected org.apache.derby.io.WritableStorageFactory realStorageFactory
CorruptBaseStorageFactory()
public void init(java.lang.String home,
java.lang.String databaseName,
java.lang.String tempDirName,
java.lang.String uniqueName)
throws java.io.IOException
init in interface org.apache.derby.io.StorageFactoryhome - The name of the directory containing the database.
It comes from the system.home system property.
It may be null. A storage factory may decide to
ignore this parameter. (For instance the classpath
storage factory ignores it.)databaseName - The name of the database (directory).
All relative pathnames are relative to this
directory.
If null then the storage factory will only be used
to deal with the directory containing the databases.tempDirName - The name of the temporary file directory set in
properties. If null then a default directory should
be used. Each database should get a separate
temporary file directory within this one to avoid
collisions.uniqueName - A unique name that can be used to create the
temporary file directory for this database.java.io.IOException - on an error (unexpected).public void shutdown()
shutdown in interface org.apache.derby.io.StorageFactorypublic java.lang.String getCanonicalName()
throws java.io.IOException
getCanonicalName in interface org.apache.derby.io.StorageFactoryjava.io.IOException - if an IO error occurred during the construction
of the name.public void setCanonicalName(java.lang.String name)
setCanonicalName in interface org.apache.derby.io.StorageFactoryname - uniquely identifiable name for this databasepublic org.apache.derby.io.StorageFile newStorageFile(java.lang.String path)
newStorageFile in interface org.apache.derby.io.StorageFactorypath - The path name of the filepublic org.apache.derby.io.StorageFile newStorageFile(java.lang.String directoryName,
java.lang.String fileName)
newStorageFile in interface org.apache.derby.io.StorageFactorydirectoryName - The directory part of the path name.fileName - The name of the file within the directory.public org.apache.derby.io.StorageFile newStorageFile(org.apache.derby.io.StorageFile directoryName,
java.lang.String fileName)
newStorageFile in interface org.apache.derby.io.StorageFactorydirectoryName - The directory part of the path name.fileName - The name of the file within the directory.public char getSeparator()
getSeparator in interface org.apache.derby.io.StorageFactorypublic org.apache.derby.io.StorageFile getTempDir()
getTempDir in interface org.apache.derby.io.StorageFactorypublic boolean isFast()
isFast in interface org.apache.derby.io.StorageFactorypublic boolean isReadOnlyDatabase()
isReadOnlyDatabase in interface org.apache.derby.io.StorageFactorypublic boolean supportsRandomAccess()
supportsRandomAccess in interface org.apache.derby.io.StorageFactorypublic int getStorageFactoryVersion()
getStorageFactoryVersion in interface org.apache.derby.io.StorageFactorypublic void sync(java.io.OutputStream stream,
boolean metaData)
throws java.io.IOException,
java.io.SyncFailedException
sync in interface org.apache.derby.io.WritableStorageFactorystream - 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.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.public boolean supportsWriteSync()
supportsWriteSync in interface org.apache.derby.io.WritableStorageFactoryabstract org.apache.derby.io.WritableStorageFactory getRealStorageFactory()
public org.apache.derby.io.StorageFile createTemporaryFile(java.lang.String prefix,
java.lang.String suffix)
throws java.io.IOException
createTemporaryFile in interface org.apache.derby.io.StorageFactoryprefix - String to prefix the random name generator. It can be nullsuffix - String to suffix the random name generator. ".tmp" will be
used if null.java.io.IOExceptionApache Derby V10.10 Internals - Copyright © 2004,2014 The Apache Software Foundation. All Rights Reserved.