|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.planx.xmlstore.koala.storage.Segment
public class Segment
A Segment is a collection of nodes which is stored consecutively
on disk. A segment object only exists while the segment is in memory. When a
segment is in memory, all its data is cached in a MemoryFileSystem.
| Constructor Summary | |
|---|---|
Segment(SegmentManager segmentManager,
StorageConfiguration config)
Create an empty Segment. |
|
| Method Summary | |
|---|---|
void |
addIndirection(Locator oldLoc,
Locator newLoc)
|
long |
dataSize()
|
void |
delete()
Marks this Segment as deleted. |
boolean |
equals(Object o)
Returns true if the argument is also a Segment
and it has the same SourceId as this Segment
or the argument is a SourceId which is equal
to this segment's SourceId. |
NodeFileSystem<LocalLocator> |
fileSystem()
Returns the in-memory NodeFileSystem associated with this
segment. |
SourceId |
forwardId()
|
static SizeStreamer<Segment> |
getStreamer(SegmentManager segmentManager,
StorageConfiguration config)
Returns a streamer capable of writing and reading a segment including its meta data. |
int |
hashCode()
Returns the hash code of this Segments
SourceId. |
SourceId |
id()
Returns the SourceId of this segment. |
MultiMap<Locator,SourceId> |
incomingSet()
Returns the incoming set of this segment. |
Map<Locator,Locator> |
indirections()
|
boolean |
isDeleted()
|
boolean |
isEmpty()
|
boolean |
isModified()
|
boolean |
isReadOnly()
|
void |
setDataSize(long dataSize)
|
void |
setForwardId(SourceId forwardId)
|
void |
setModified(boolean isModified)
|
void |
setReadOnly(boolean isReadOnly)
|
void |
setStateId(SourceId stateId)
|
SourceId |
stateId()
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Segment(SegmentManager segmentManager,
StorageConfiguration config)
throws IOException
Segment. The SegmentManager is
provided to be able to load children in foreign segments.
IOException| Method Detail |
|---|
public SourceId id()
SourceId of this segment.
public SourceId stateId()
public void setStateId(SourceId stateId)
public SourceId forwardId()
public void setForwardId(SourceId forwardId)
public boolean isModified()
throws IOException
IOException
public void setModified(boolean isModified)
throws IOException
IOException
public boolean isReadOnly()
throws IOException
IOException
public void setReadOnly(boolean isReadOnly)
throws IOException
IOExceptionpublic long dataSize()
public void setDataSize(long dataSize)
public boolean isEmpty()
throws IOException
IOException
public NodeFileSystem<LocalLocator> fileSystem()
throws IOException
NodeFileSystem associated with this
segment.
IOExceptionpublic MultiMap<Locator,SourceId> incomingSet()
public Map<Locator,Locator> indirections()
public void addIndirection(Locator oldLoc,
Locator newLoc)
throws IOException
IOExceptionpublic boolean equals(Object o)
true if the argument is also a Segment
and it has the same SourceId as this Segment
or the argument is a SourceId which is equal
to this segment's SourceId.
equals in class Objectpublic int hashCode()
Segments
SourceId.
hashCode in class Objectpublic String toString()
toString in class Objectpublic void delete()
Segment as deleted. Any further method calls are
invalid. Note, that this does not delete it from disk.
public boolean isDeleted()
public static SizeStreamer<Segment> getStreamer(SegmentManager segmentManager,
StorageConfiguration config)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||