public class MRStore extends ServerStore
Modifier and Type | Field and Description |
---|---|
static int |
BUF_SIZE |
protected ByteBuffer |
dataBuf |
protected long |
dataPos |
static int |
INDEX_SIZE |
protected ByteBuffer |
indexBuf |
protected long |
indexPos |
protected ByteBuffer |
keyBuf |
protected long |
keyPos |
protected byte[] |
r2 |
BLOCK_SIZE, dataOffset, keyOffset, lock
Constructor and Description |
---|
MRStore(String filename) |
MRStore(String filename,
boolean flag) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
checkIndexBuf()
check index buffer has enough data, if not read next buffer
|
voldemort.utils.Pair<voldemort.store.cachestore.Key,byte[]> |
next() |
protected long |
readDataBuf()
read next data buffer, update dataPos
|
protected void |
readDataBufAry(byte[] bytes)
when data block size > BUF_SIZE, pass the large byte array to be read
but not into data buffer which is 8192 bytes
|
protected byte[] |
readDataChannel(long dataLen,
long blockSize,
long offset)
read destinate data len from data buffer and advance the gap (blocksize -d datalen)
also handle if block size > BUF_SIZE
|
protected long |
readKeyBuf()
read next key buffer and update keyPos
|
protected byte[] |
readKeyChannel(int keyLen)
read next key bytes from key buffer
|
void |
setCurrent(int current)
curRecord is 0 base, so set it by current -1
if you use 1 base
|
findTotal2BatchSize, findTotalBlock, getFilename, isEnd, next, nextBlock, populate, writeExistBlock, writeRecord
close, deleteRecord, findChannel, getCurRecord, getTotalRecord, hasNext, init, isDeleted, nextKeyValue, readChannel
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, hasNext
public static final int BUF_SIZE
public static final int INDEX_SIZE
protected ByteBuffer indexBuf
protected ByteBuffer keyBuf
protected ByteBuffer dataBuf
protected volatile long keyPos
protected volatile long dataPos
protected volatile long indexPos
protected byte[] r2
public MRStore(String filename)
public MRStore(String filename, boolean flag)
protected boolean checkIndexBuf()
protected long readKeyBuf()
protected byte[] readKeyChannel(int keyLen)
keyLen
- protected long readDataBuf()
protected void readDataBufAry(byte[] bytes)
bytes
- protected byte[] readDataChannel(long dataLen, long blockSize, long offset)
dataLen
- blockSize
- offset
- public voldemort.utils.Pair<voldemort.store.cachestore.Key,byte[]> next() throws IOException
next
in interface MRIterator
next
in class voldemort.store.cachestore.voldeimpl.StoreIterator
IOException
public void setCurrent(int current)
ServerStore
setCurrent
in interface MRIterator
setCurrent
in class ServerStore
Copyright © 2016. All rights reserved.