|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Store
A store is a resource where areas can be allocated and freed to store objects. A store can be backed by a file or main memory, or a combination of the two.
Some characteristics of implementations of Store may be separately specified. For example, a file based store that is intended to persistently store objects may have robustness as a primary requirement. A main memory based store, or other type of volatile store, may not require robustness.
Method Summary | |
---|---|
AreaWriter |
createArea(long size)
Allocates a block of memory in the store of the specified size and returns an AreaWriter object that can be used to initialize the contents of the area. |
void |
deleteArea(long id)
Deletes an area that was previously allocated by the 'createArea' method by the area id. |
java.util.List |
getAllAreas()
Returns a complete list of pointers to all areas in the Store as Long objects sorted from lowest pointer to highest. |
Area |
getArea(long id)
Returns an object that allows for the contents of an area (represented by the 'id' parameter) to be read. |
java.io.InputStream |
getAreaInputStream(long id)
Returns an InputStream implementation that allows for the area with the given identifier to be read sequentially. |
MutableArea |
getMutableArea(long id)
Returns an object that allows for the contents of an area (represented by the 'id' parameter) to be read and written. |
boolean |
lastCloseClean()
Returns true if the store was closed cleanly. |
void |
lockForWrite()
It is often useful to guarentee that a certain sequence of updates to a store is completed and not broken in the middle. |
void |
unlockForWrite()
See the 'lockForWrite' method description. |
Method Detail |
---|
AreaWriter createArea(long size) throws java.io.IOException
size
- the amount of memory to allocate.
java.io.IOException
- if not enough space available to create the area or
the store is read-only.void deleteArea(long id) throws java.io.IOException
id
- the identifier of the area to delete.
java.io.IOException
- (optional) if the id is invalid or the area can not
otherwise by deleted.java.io.InputStream getAreaInputStream(long id) throws java.io.IOException
When 'id' is -1 then a fixed area (64 bytes in size) in the store is returned. The fixed area can be used to store important static static information.
id
- the identifier of the area to read, or id = -1 is a 64 byte
fixed area in the store.
java.io.IOException
- (optional) if the id is invalid or the area can not
otherwise be accessed.Area getArea(long id) throws java.io.IOException
When 'id' is -1 then a fixed area (64 bytes in size) in the store is returned. The fixed area can be used to store important static static information.
id
- the identifier of the area to read, or id = -1 is a 64 byte
fixed area in the store.
java.io.IOException
- (optional) if the id is invalid or the area can not
otherwise be accessed.MutableArea getMutableArea(long id) throws java.io.IOException
When 'id' is -1 then a fixed area (64 bytes in size) in the store is returned. The fixed area can be used to store important static static information.
id
- the identifier of the area to access, or id = -1 is a 64 byte
fixed area in the store.
java.io.IOException
- (optional) if the id is invalid or the area can not
otherwise be accessed.void lockForWrite()
To achieve this, the 'lockForWrite' and 'unlockForWrite' methods are available. When 'lockForWrite' has been called, a check point can not created until there are no write locks obtained on the table.
void unlockForWrite()
boolean lastCloseClean()
java.util.List getAllAreas() throws java.io.IOException
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |