public class TransactionLog extends Object implements Closeable
Modifier and Type | Class and Description |
---|---|
class |
TransactionLog.FSReverseReader |
class |
TransactionLog.LogCodec |
class |
TransactionLog.LogReader |
class |
TransactionLog.ReverseReader |
class |
TransactionLog.SortedLogReader |
Modifier and Type | Field and Description |
---|---|
protected boolean |
deleteOnClose |
static String |
END_MESSAGE |
Modifier | Constructor and Description |
---|---|
protected |
TransactionLog() |
Modifier and Type | Method and Description |
---|---|
protected void |
addGlobalStrings(Collection<String> strings) |
protected void |
checkWriteHeader(TransactionLog.LogCodec codec,
SolrInputDocument optional) |
void |
close() |
void |
closeOutput()
Move to a read-only state, closing and releasing resources while keeping the log available for reads
|
void |
decref() |
protected void |
endRecord(long startRecordPosition) |
boolean |
endsWithCommit() |
void |
finish(UpdateLog.SyncLevel syncLevel) |
void |
forceClose() |
long |
getLogSize() |
long |
getLogSizeFromStream() |
TransactionLog.LogReader |
getReader(long startingPos)
Returns a reader that can be used while a log is still in use.
|
TransactionLog.ReverseReader |
getReverseReader()
Returns a single threaded reverse reader
|
TransactionLog.LogReader |
getSortedReader(long startingPos) |
void |
incref() |
Object |
lookup(long pos) |
int |
numRecords()
Returns the number of records in the log (currently includes the header and an optional commit).
|
long |
position()
returns the current position in the log file
|
String |
toString() |
boolean |
try_incref() |
long |
write(AddUpdateCommand cmd)
Writes an add update command to the transaction log.
|
long |
write(AddUpdateCommand cmd,
long prevPointer)
Writes an add update command to the transaction log.
|
long |
writeCommit(CommitUpdateCommand cmd) |
long |
writeData(Object o) |
long |
writeDelete(DeleteUpdateCommand cmd) |
long |
writeDeleteByQuery(DeleteUpdateCommand cmd) |
protected void |
writeLogHeader(TransactionLog.LogCodec codec) |
public static final String END_MESSAGE
protected volatile boolean deleteOnClose
public int numRecords()
public boolean endsWithCommit() throws IOException
IOException
public long writeData(Object o)
protected void addGlobalStrings(Collection<String> strings)
protected void writeLogHeader(TransactionLog.LogCodec codec) throws IOException
IOException
protected void endRecord(long startRecordPosition) throws IOException
IOException
protected void checkWriteHeader(TransactionLog.LogCodec codec, SolrInputDocument optional) throws IOException
IOException
public long write(AddUpdateCommand cmd)
write(AddUpdateCommand, long)
.
(The previous pointer (applicable for in-place updates) is set to -1 while writing
the command to the transaction log.)cmd
- The add update command to be writtenwrite(AddUpdateCommand, long)
public long write(AddUpdateCommand cmd, long prevPointer)
cmd
- The add update command to be writtenprevPointer
- The pointer in the transaction log which this update depends
on (applicable for in-place updates)public long writeDelete(DeleteUpdateCommand cmd)
public long writeDeleteByQuery(DeleteUpdateCommand cmd)
public long writeCommit(CommitUpdateCommand cmd)
public Object lookup(long pos)
public void incref()
public boolean try_incref()
public void decref()
public long position()
public void closeOutput()
public void finish(UpdateLog.SyncLevel syncLevel)
public void close()
close
in interface Closeable
close
in interface AutoCloseable
public void forceClose()
public long getLogSize()
public long getLogSizeFromStream()
public TransactionLog.LogReader getReader(long startingPos)
public TransactionLog.LogReader getSortedReader(long startingPos)
public TransactionLog.ReverseReader getReverseReader() throws IOException
IOException
Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.