| ASF |
#752114 |
Tue Mar 10 14:02:18 UTC 2009 |
kristwaa |
DERBY-646: In-memory backend storage support.
First revision of an in-memory back end for Derby. When using the back
end, all data (except derby.log by default) will be stored in-memory only.
When the JVM is shut down, all data is lost. The database is transient.
To use the in-memory back end, supply the assoicated JDBC subSubProtocol
when creating the database (currently set to 'in-memory', see DERBY-4084
for updates).
The current state of the feature;
o undocumented
o under development
o tests are lacking
o working
(have been run with load tests, and parts of the regression suite)
o cannot be used with the client driver with a specification compliant
JDBC connection URL
o each file is limited to 256, 512, 1024 or 2048 MB depending on page size
(4, 8, 16 or 32 KB). Can by controlled with the existing page size property.
Brief code description (most classes are in impl):
* services/monitor/BaseMonitor
iapi/services/monitor/PersistentService
Adds the in-memory back end to the list of known storage facotories.
Constant for indicating the in-memory storage engine.
* io/VFMemoryStorageFactory
The in-memory storage factory. Deals mostly with high level operations
related to files/directories and the storage factory instance itself.
* io/vfmem/BlockedByteArray.java
io/vfmem/BlockedByteArrayInputStream
io/vfmem/BlockedByteArrayOutputStream
The BlockedByteArray stores the bytes of a file in memory. It grows
block by block, and currently a block can be 4, 8, 16 or 32 KB big.
Once set, the block size doesn't change. The array also shrinks when
the length is explicitly set to a smaller value by Derby. The stream
classes provide a stream interface for reading/writing from/to the
BlockedByteArray.
* io/vfmem/DataStore
Represents a database, and consists of all the virtual paths in the
database. Deals with actions suchs as creating, removing, renaming,
and listing the children of a given path. Virtual files and
directories are organized in a similar fashion as on disk.
* io/vfmem/DataStoreEntry
Represents a path, which can be either a virtual file or directory.
A file has a BlockedByteArray assoiciated with it, a directory
doesn't. Serves as the entry point for access to the BlockedByteArray.
* io/vfmem/VirtualFile.java
A virtual file handle, with numerous methods for file operations.
Basically java.io.File and some additional methods.
* io/vfmem/VirtualRandomAccessFile
Class providing random access to the BlockedByteArray. Provides both
read and write access.
* io/vfmem/PathUtil
Simple utility class for path operations. May be able to get rid of
this by now.
* tools/jar/extraDBMSclasses.properties
Added an entry for VFMemoryStorageFactory to include the required
classes in the jar files.
* unitTests/...
Some unit tests for the in-memory back end.
Patch file: DERBY-646-2b-vfmem_first_rev.diff
|