Issue Details (XML | Word | Printable)

Key: DERBY-646
Type: Improvement Improvement
Status: In Progress In Progress
Priority: Major Major
Assignee: Kristian Waagan
Reporter: Stephen Fitch
Votes: 36
Watchers: 33
Operations

If you were logged in you would be able to see more operations.
Derby

In-memory backend storage support

Created: 26/Oct/05 02:32 AM   Updated: 01/Jul/09 12:34 AM
Return to search
Component/s: Store
Affects Version/s: 10.5.1.1
Fix Version/s: None

Time Tracking:
Issue & Sub-Tasks
Issue Only
Not Specified

File Attachments:
  Size
File Licensed for inclusion in ASF works derby-646-1a-raw-compiles.diff 2006-11-14 01:07 PM Kristian Waagan 83 kB
File Licensed for inclusion in ASF works derby-646-1a-raw-compiles.stat 2006-11-14 01:07 PM Kristian Waagan 1 kB
File Licensed for inclusion in ASF works derby-646-20090222.diff 2009-02-22 11:01 PM Cheng Che Chen 196 kB
File Licensed for inclusion in ASF works derby-646-20090222.stat 2009-02-22 11:01 PM Cheng Che Chen 2 kB
File Licensed for inclusion in ASF works derby-646-2a-vfmem_first_rev.diff 2009-02-19 05:12 PM Kristian Waagan 87 kB
File Licensed for inclusion in ASF works derby-646-2a-vfmem_first_rev.stat 2009-02-19 05:12 PM Kristian Waagan 1 kB
File Licensed for inclusion in ASF works derby-646-2b-vfmem_first_rev.diff 2009-03-10 02:41 PM Kristian Waagan 95 kB
File Licensed for inclusion in ASF works derby-646-3a-jmx_experiment.diff 2009-03-11 05:11 PM Kristian Waagan 5 kB
Text File Licensed for inclusion in ASF works derby-646-performance_comparison_1a.txt 2009-02-24 02:02 PM Kristian Waagan 3 kB
File Licensed for inclusion in ASF works svn.diff 2006-03-06 09:39 AM Stephen Fitch 83 kB
Environment: All
Issue Links:
Reference
 

Sub-Tasks  All   Open   
No sub-tasks match this view.

 Description  « Hide
To allow creation and modification of databases in-memory without requiring disk access or space to store the database.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Repository Revision Date User Message
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
Files Changed
ADD /db/derby/code/trunk/java/engine/org/apache/derby/impl/io/vfmem
MODIFY /db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/monitor/PersistentService.java
ADD /db/derby/code/trunk/java/engine/org/apache/derby/impl/io/vfmem/DataStore.java
MODIFY /db/derby/code/trunk/java/engine/org/apache/derby/impl/services/monitor/BaseMonitor.java
ADD /db/derby/code/trunk/java/engine/org/apache/derby/impl/io/vfmem/DataStoreEntry.java
ADD /db/derby/code/trunk/java/engine/org/apache/derby/impl/io/VFMemoryStorageFactory.java
ADD /db/derby/code/trunk/java/engine/org/apache/derby/impl/io/vfmem/VirtualRandomAccessFile.java
ADD /db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/junit/VirtualFileTest.java
MODIFY /db/derby/code/trunk/tools/jar/extraDBMSclasses.properties
ADD /db/derby/code/trunk/java/engine/org/apache/derby/impl/io/vfmem/VirtualFile.java
ADD /db/derby/code/trunk/java/engine/org/apache/derby/impl/io/vfmem/BlockedByteArrayInputStream.java
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/junit/_Suite.java
ADD /db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/junit/PathUtilTest.java
ADD /db/derby/code/trunk/java/engine/org/apache/derby/impl/io/vfmem/PathUtil.java
ADD /db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/junit/BlockedByteArrayTest.java
ADD /db/derby/code/trunk/java/engine/org/apache/derby/impl/io/vfmem/BlockedByteArrayOutputStream.java
ADD /db/derby/code/trunk/java/engine/org/apache/derby/impl/io/vfmem/BlockedByteArray.java