|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.flume.serialization.DurablePositionTracker
@InterfaceAudience.Private @InterfaceStability.Evolving public class DurablePositionTracker
Class that stores object state in an avro container file. The file is only ever appended to. At construction time, the object reads data from the end of the file and caches that data for use by a client application. After construction, reads never go to disk. Writes always flush to disk.
Note: This class is not thread-safe.
Method Summary | |
---|---|
void |
close()
|
static DurablePositionTracker |
getInstance(File trackerFile,
String target)
If the file exists at startup, then read it, roll it, and open a new one. |
long |
getPosition()
|
String |
getTarget()
|
void |
storePosition(long position)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static DurablePositionTracker getInstance(File trackerFile, String target) throws IOException
trackerFile
- target
-
IOException
public void storePosition(long position) throws IOException
storePosition
in interface PositionTracker
IOException
public long getPosition()
getPosition
in interface PositionTracker
public String getTarget()
getTarget
in interface PositionTracker
public void close() throws IOException
close
in interface Closeable
close
in interface PositionTracker
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |