|
Rice Pastry API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectrice.persistence.DatabaseStorage
public class DatabaseStorage
| Field Summary | |
|---|---|
protected com.sleepycat.je.Database |
db
|
protected com.sleepycat.je.Environment |
dbenv
|
protected Environment |
env
|
protected IdFactory |
idf
|
protected ReverseTreeMap |
meta
|
protected com.sleepycat.je.Database |
metadb
|
| Constructor Summary | |
|---|---|
DatabaseStorage(IdFactory factory,
java.lang.String rootDir,
long size,
Environment env)
|
|
DatabaseStorage(IdFactory idf,
java.lang.String name,
java.lang.String rootDir,
Environment env)
|
|
DatabaseStorage(IdFactory idf,
java.lang.String name,
java.lang.String rootDir,
long size,
boolean index,
Environment env)
|
|
DatabaseStorage(IdFactory idf,
java.lang.String name,
java.lang.String rootDir,
long size,
Environment env)
|
|
| Method Summary | |
|---|---|
protected Id |
db2id(com.sleepycat.je.DatabaseEntry dbe)
|
protected java.io.Serializable |
dbDeserialize(com.sleepycat.je.DatabaseEntry dbe)
|
protected com.sleepycat.je.DatabaseEntry |
dbSerialize(java.io.Serializable obj)
|
boolean |
exists(Id id)
Returns whether or not an object is present in the location id. |
void |
flush(Continuation c)
Method which is used to erase all data stored in the Catalog. |
java.io.Serializable |
getMetadata(Id id)
Returns the metadata associated with the provided object, or null if no metadata exists. |
void |
getObject(Id id,
Continuation c)
Returns the object identified by the given id, or null if
there is no corresponding object (through receiveResult on c). |
int |
getSize()
Returns the number of Ids currently stored in the catalog |
long |
getTotalSize()
Returns the total size of the stored data in bytes. |
protected com.sleepycat.je.DatabaseEntry |
id2db(Id id)
|
void |
rename(Id oldId,
Id newId,
Continuation c)
Renames the given object to the new id. |
IdSet |
scan()
Return all objects currently stored by this catalog NOTE: This method blocks so if the behavior of this method changes and no longer stored in memory, this method may be deprecated. |
IdSet |
scan(IdRange range)
Return the objects identified by the given range of ids. |
java.util.SortedMap |
scanMetadata()
Returns a map which contains keys mapping ids to the associated metadata. |
java.util.SortedMap |
scanMetadata(IdRange range)
Returns a map which contains keys mapping ids to the associated metadata. |
java.util.SortedMap |
scanMetadataValuesHead(java.lang.Object value)
Returns the submapping of ids which have metadata less than the provided value. |
java.util.SortedMap |
scanMetadataValuesNull()
Returns the submapping of ids which have metadata null |
void |
setMetadata(Id id,
java.io.Serializable metadata,
Continuation c)
Updates the metadata stored under the given key to be the provided value. |
void |
store(Id id,
java.io.Serializable metadata,
java.io.Serializable obj,
Continuation c)
Stores an object in this storage. |
void |
unstore(Id id,
Continuation c)
Removes the object from the list of stored objects. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Environment env
protected com.sleepycat.je.Environment dbenv
protected com.sleepycat.je.Database db
protected com.sleepycat.je.Database metadb
protected IdFactory idf
protected ReverseTreeMap meta
| Constructor Detail |
|---|
public DatabaseStorage(IdFactory idf,
java.lang.String name,
java.lang.String rootDir,
long size,
boolean index,
Environment env)
throws java.io.IOException
java.io.IOException
public DatabaseStorage(IdFactory idf,
java.lang.String name,
java.lang.String rootDir,
long size,
Environment env)
throws java.io.IOException
java.io.IOException
public DatabaseStorage(IdFactory factory,
java.lang.String rootDir,
long size,
Environment env)
throws java.io.IOException
java.io.IOException
public DatabaseStorage(IdFactory idf,
java.lang.String name,
java.lang.String rootDir,
Environment env)
throws java.io.IOException
java.io.IOException| Method Detail |
|---|
public void store(Id id,
java.io.Serializable metadata,
java.io.Serializable obj,
Continuation c)
Storageunstore(id) followed
by store(id, obj). This method finishes by calling
receiveResult() on the provided continuation with the success
or failure of the store.
Returns True if the action succeeds, else
False (through receiveResult on c).
store in interface Storageid - The object's id.metadata - The object's metadataobj - The object to store.c - The command to run once the operation is complete
public void unstore(Id id,
Continuation c)
StorageFalse is returned.
Returns True if the action succeeds, else
False (through receiveResult on c).
unstore in interface Storagec - The command to run once the operation is completepublic boolean exists(Id id)
Catalogid.
exists in interface Catalogid - The id of the object in question.
public void getObject(Id id,
Continuation c)
Catalognull if
there is no corresponding object (through receiveResult on c).
getObject in interface Catalogid - The id of the object in question.c - The command to run once the operation is completepublic java.io.Serializable getMetadata(Id id)
Catalog
getMetadata in interface Catalogid - The id for which the metadata is needed
public void setMetadata(Id id,
java.io.Serializable metadata,
Continuation c)
Catalog
setMetadata in interface Catalogid - The id for the metadatametadata - The metadata to store
public void rename(Id oldId,
Id newId,
Continuation c)
Catalog
rename in interface CatalogoldId - The id of the object in question.newId - The new id of the object in question.c - The command to run once the operation is completepublic IdSet scan(IdRange range)
Catalog
scan in interface Catalogrange - The range to query
public IdSet scan()
Catalog
scan in interface Catalogpublic java.util.SortedMap scanMetadata(IdRange range)
Catalog
scanMetadata in interface Catalogrange - The range to query
public java.util.SortedMap scanMetadata()
Catalog
scanMetadata in interface Catalogpublic java.util.SortedMap scanMetadataValuesHead(java.lang.Object value)
Catalog
scanMetadataValuesHead in interface Catalogvalue - The maximal metadata value
public java.util.SortedMap scanMetadataValuesNull()
Catalog
scanMetadataValuesNull in interface Catalogpublic int getSize()
Catalog
getSize in interface Catalogpublic long getTotalSize()
Catalog
getTotalSize in interface Catalogpublic void flush(Continuation c)
Catalog
flush in interface Catalogc - The command to run once doneprotected com.sleepycat.je.DatabaseEntry id2db(Id id)
protected Id db2id(com.sleepycat.je.DatabaseEntry dbe)
protected com.sleepycat.je.DatabaseEntry dbSerialize(java.io.Serializable obj)
protected java.io.Serializable dbDeserialize(com.sleepycat.je.DatabaseEntry dbe)
|
Rice Pastry API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||