public class MemoryOffsetReader extends OffsetReader
| Modifier and Type | Field and Description |
|---|---|
protected int |
capacity
capacity of cache
|
protected static org.apache.commons.logging.Log |
log |
protected Map<Long,Long> |
offsetCache
cache of offsets
|
nbLines| Constructor and Description |
|---|
MemoryOffsetReader(int capacity) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the reader
|
long |
getOffset(long position)
Obtain an offset for a position
|
protected boolean |
needCreate() |
protected void |
storeOffset(long position,
long offset)
Save the offset of the line for a given position
|
String |
toString() |
createOffsets, createOffsets, createOffsetsForLog, deleteOffsetFile, getNbLines, isLogEntry, open, readLine, updateprotected static final org.apache.commons.logging.Log log
protected int capacity
public void close()
throws IOException
OffsetReaderclose in class OffsetReaderIOException - if any problem while closingpublic long getOffset(long position)
OffsetReadergetOffset in class OffsetReaderposition - position of the lineprotected void storeOffset(long position,
long offset)
OffsetReaderstoreOffset in class OffsetReaderposition - current line positionoffset - current offset of lineprotected boolean needCreate()
needCreate in class OffsetReadertrue if the reader need to create his internal
datas.Copyright © 1999-2012 CodeLutin. All Rights Reserved.