public class SnapshotReader
extends java.lang.Object
SnapshotStore.| Modifier and Type | Class and Description |
|---|---|
static interface |
SnapshotReader.RecordReader
Reads the snapshot file one record at a time.
|
| Constructor and Description |
|---|
SnapshotReader(java.io.BufferedReader in,
java.lang.String inputPath,
long snapshotNumber,
DocumentSnapshotFactory documentSnapshotFactory)
Constructs a SnapshotReader.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the underlying input stream.
|
java.lang.String |
getPath() |
long |
getRecordNumber() |
long |
getSnapshotNumber() |
DocumentSnapshot |
read() |
void |
skipRecords(long number)
Read and discard
number records. |
public SnapshotReader(java.io.BufferedReader in,
java.lang.String inputPath,
long snapshotNumber,
DocumentSnapshotFactory documentSnapshotFactory)
throws SnapshotReaderException
in - input for the readerinputPath - path to the snapshotsnapshotNumber - the number of the snapshot being readSnapshotReaderExceptionpublic DocumentSnapshot read() throws SnapshotReaderException
null if we have
reached the end of the snapshotSnapshotReaderExceptionpublic java.lang.String getPath()
public long getRecordNumber()
public void skipRecords(long number)
throws SnapshotReaderException,
java.lang.InterruptedException
number records.number - of records to skip.SnapshotReaderException - on IO errors, or if there aren't enough
records.java.lang.InterruptedException - it the calling thread is interrupted.public long getSnapshotNumber()
public void close()
throws java.io.IOException
java.io.IOException