|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.planx.xmlstore.regions.Region
public class Region
A Region is a collection of nodes.
There are only two ways a Region is changed:
When it is first not closed and exists only in memory, new nodes
can be added with the save method and outgoing
inter-region pointers will be found at once and the incoming
sets of the target regions updated. Thus, in this case, when
persisting the (non-closed) region it is not necessary to scan
for outgoing pointers. Also, in this case, the identifier
of the region is not changed.
Second, the Sharer may update data through the use
of a region node. This is obtained by calling getRegionRoot(org.planx.xmlstore.regions.Region).
See the Sharer code for the sequence of steps needed
to ensure consistency of incoming and outgoing sets when several
regions are shared at the same time.
Should be synchronized externally.
| Nested Class Summary | |
|---|---|
static class |
Region.Statistics
|
| Method Summary | |
|---|---|
void |
cache()
Load this Region to memory. |
void |
flush()
Flushes this Region from memory by persisting it and releasing
memory. |
LocalLocator |
getBound()
|
Group |
getGroup()
|
FileSystemIdentifier |
getIdentifier()
|
int |
getLocalId()
A local unique identifier useful for making a total order on regions for consistent canonical node choosing policies. |
int |
incomingSize()
|
boolean |
isCached()
Returns true if this Region is currently
in memory. |
boolean |
isClosed()
Returns true if this Region is closed for¨
further application writes (the sharer may still modify the region). |
boolean |
isContained(LocalLocator loc)
Returns true if the specified LocalLocator
points to data in this Region. |
boolean |
isPersisted()
Returns true if the on-disk representation of this
Region is up-to-date. |
SystemNode |
load(LocalLocator loc,
Reference secondaryRef)
Loads the node with the specified locator from this region. |
int |
originalSize()
|
int |
outgoingSize()
|
void |
persist()
Persists the in-memory version of this Region to disk. |
LocalLocator |
save(SystemNode node)
Can only save to non-closed Region. |
void |
setGroup(Group group)
|
int |
size()
|
Region.Statistics |
statistics()
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public boolean isContained(LocalLocator loc)
true if the specified LocalLocator
points to data in this Region.
public boolean isClosed()
true if this Region is closed for¨
further application writes (the sharer may still modify the region).
public boolean isCached()
true if this Region is currently
in memory.
public boolean isPersisted()
true if the on-disk representation of this
Region is up-to-date.
public Group getGroup()
public void setGroup(Group group)
public int getLocalId()
public FileSystemIdentifier getIdentifier()
public LocalLocator getBound()
public SystemNode load(LocalLocator loc,
Reference secondaryRef)
throws IOException,
UnknownReferenceException
IOException
UnknownReferenceException
public LocalLocator save(SystemNode node)
throws IOException
Region.
IOException
public void cache()
throws IOException,
UnknownReferenceException
Region to memory.
IOException
UnknownReferenceException
public void flush()
throws IOException,
UnknownReferenceException
Region from memory by persisting it and releasing
memory.
IOException
UnknownReferenceException
public void persist()
throws IOException,
UnknownReferenceException
Region to disk.
IOException
UnknownReferenceExceptionpublic String toString()
toString in class Objectpublic int size()
public int originalSize()
public int incomingSize()
public int outgoingSize()
public Region.Statistics statistics()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||