public static class FileTxnLog.FileTxnIterator extends Object implements TxnLog.TxnIterator
Constructor and Description |
---|
FileTxnIterator(File logDir,
long zxid)
create an iterator over a transaction database directory
|
FileTxnIterator(File logDir,
long zxid,
boolean fastForward)
create an iterator over a transaction database directory
|
Modifier and Type | Method and Description |
---|---|
void |
close()
close the iterator
and release the resources.
|
protected InputArchive |
createInputArchive(File logFile)
Invoked to indicate that the input stream has been created.
|
TxnDigest |
getDigest() |
TxnHeader |
getHeader()
return the current header
|
long |
getStorageSize()
Return total storage size of txnlog that will return by this iterator.
|
Record |
getTxn()
return the current transaction
|
protected void |
inStreamCreated(InputArchive ia,
InputStream is)
read the header from the inputarchive
|
protected Checksum |
makeChecksumAlgorithm()
create a checksum algorithm
|
boolean |
next()
the iterator that moves to the next transaction
|
public FileTxnIterator(File logDir, long zxid, boolean fastForward) throws IOException
logDir
- the transaction database directoryzxid
- the zxid to start reading fromfastForward
- true if the iterator should be fast forwarded to
point to the txn of a given zxid, else the iterator will
point to the starting txn of a txnlog that may contain txn of
a given zxidIOException
public FileTxnIterator(File logDir, long zxid) throws IOException
logDir
- the transaction database directoryzxid
- the zxid to start reading fromIOException
public long getStorageSize()
getStorageSize
in interface TxnLog.TxnIterator
protected void inStreamCreated(InputArchive ia, InputStream is) throws IOException
ia
- the inputarchive to be read fromis
- the inputstreamIOException
protected InputArchive createInputArchive(File logFile) throws IOException
logFile
- the file to read.IOException
protected Checksum makeChecksumAlgorithm()
public boolean next() throws IOException
next
in interface TxnLog.TxnIterator
IOException
public TxnHeader getHeader()
getHeader
in interface TxnLog.TxnIterator
public Record getTxn()
getTxn
in interface TxnLog.TxnIterator
public TxnDigest getDigest()
getDigest
in interface TxnLog.TxnIterator
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in interface TxnLog.TxnIterator
IOException
Copyright © 2008–2020 The Apache Software Foundation. All rights reserved.