|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.blur.store.blockcache_v2.cachevalue.BaseCacheValue
public abstract class BaseCacheValue
Nested Class Summary | |
---|---|
static class |
BaseCacheValue.Evicted
|
Constructor Summary | |
---|---|
BaseCacheValue(int length)
|
Method Summary | |
---|---|
void |
decRef()
|
CacheValue |
detachFromCache()
Detach from the base cache. |
void |
incRef()
|
int |
length()
The length of the data in this block. |
byte |
read(int position)
Reads a byte from the given position. |
void |
read(int position,
byte[] buf,
int offset,
int length)
Reads data into the buffer given the position. |
int |
readInt(int position)
Reads a int from the given position. |
long |
readLong(int position)
Reads a long from the given position. |
short |
readShort(int position)
Reads a short from the given position. |
CacheValue |
trim(int length)
This method may trim the existing CacheValue and produce
potentially a new CacheValue with the same data up to the length
provided. |
void |
write(int position,
byte[] buf,
int offset,
int length)
Writes data out to a given position in this block. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.blur.store.blockcache_v2.CacheValue |
---|
release |
Constructor Detail |
---|
public BaseCacheValue(int length)
Method Detail |
---|
public final int length()
CacheValue
length
in interface CacheValue
public void write(int position, byte[] buf, int offset, int length)
CacheValue
write
in interface CacheValue
position
- the position.buf
- the buffer.offset
- the offset in the buffer.length
- the length of bytes to write.public void read(int position, byte[] buf, int offset, int length)
CacheValue
read
in interface CacheValue
position
- the position to read.buf
- the buffer to read into.offset
- the offset within the buffer.length
- the length of data to read.public byte read(int position)
CacheValue
read
in interface CacheValue
position
- the position.
public short readShort(int position)
CacheValue
readShort
in interface CacheValue
position
- the Position
to read from.
public int readInt(int position)
CacheValue
readInt
in interface CacheValue
position
- the Position
to read from.
public long readLong(int position)
CacheValue
readLong
in interface CacheValue
position
- the Position
to read from.
public CacheValue trim(int length)
CacheValue
CacheValue
and produce
potentially a new CacheValue
with the same data up to the length
provided. Also if a new CacheValue
is produced then this method is
responsible to calling release on the old CacheValue
.
trim
in interface CacheValue
length
- the valid amount of data in the CacheValue
.
CacheValue
that has been trimmed if needed.public CacheValue detachFromCache()
CacheValue
detachFromCache
in interface CacheValue
public void decRef()
decRef
in interface CacheValue
public void incRef()
incRef
in interface CacheValue
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |