public abstract class AbstractRawWormStore extends AbstractRawStore implements IWORM
IRawStore
implementations that use an
append only (Write Once, Read Many) strategy. The IAddressManager
interface is delegated to an WormAddressManager
allowing flexible
configuration of the use of bits to represent the byte offset of a record in
the store and the bits used to represent the size of a record in the store.WormAddressManager
Modifier and Type | Field and Description |
---|---|
protected WormAddressManager |
am
The object that knows how to encode, decode, and (de-)serialize
addresses.
|
NULL
Constructor and Description |
---|
AbstractRawWormStore(int offsetBits) |
Modifier and Type | Method and Description |
---|---|
WormAddressManager |
getAddressManager()
The object that knows how to encode, decode, and (de-)serialize
addresses.
|
int |
getByteCount(long addr)
The length of the datum in bytes.
|
long |
getOffset(long addr)
The offset on the store at which the datum is stored.
|
int |
getOffsetBits()
The #of bits out of a 64-bit long integer that are used to encode the
byte offset as an unsigned integer.
|
long |
getPhysicalAddress(long addr)
Determine the unencoded physical address
|
long |
toAddr(int nbytes,
long offset)
Converts a byte count and offset into a long integer.
|
String |
toString(long addr)
A human readable representation of the address.
|
delete, getInputStream, getOutputStream
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, deleteResources, destroy, force, getFile, getResourceMetadata, getUUID, isFullyBuffered, isOpen, isReadOnly, isStable, read, size, write
getCounters
protected final WormAddressManager am
public AbstractRawWormStore(int offsetBits)
offsetBits
- The #of bits that will be used to represent the byte offset in
the 64-bit long integer addresses for the store. See
WormAddressManager
.public final WormAddressManager getAddressManager()
getAddressManager
in class AbstractRawStore
public final int getOffsetBits()
public final long toAddr(int nbytes, long offset)
IAddressManager
toAddr
in interface IAddressManager
nbytes
- The byte count.offset
- The byte offset.public final long getOffset(long addr)
IAddressManager
getOffset
in interface IAddressManager
addr
- The opaque identifier that is the within store locator for
some datum.public final long getPhysicalAddress(long addr)
IAddressManager
getPhysicalAddress
in interface IAddressManager
addr
- The encoded addresspublic final int getByteCount(long addr)
IAddressManager
IRawStore
.getByteCount
in interface IAddressManager
addr
- The opaque identifier that is the within store locator for
some datum.public final String toString(long addr)
IAddressManager
toString
in interface IAddressManager
addr
- The opaque identifier that is the within store locator for
some datum.Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.