Package org.apache.solr.update
Class HdfsTransactionLog
- java.lang.Object
-
- org.apache.solr.update.TransactionLog
-
- org.apache.solr.update.HdfsTransactionLog
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class HdfsTransactionLog extends TransactionLog
Log Format: List{Operation, Version, ...} ADD, VERSION, DOC DELETE, VERSION, ID_BYTES DELETE_BY_QUERY, VERSION, String TODO: keep two files, one for [operation, version, id] and the other for the actual document data. That way we could throw away document log files more readily while retaining the smaller operation log files longer (and we can retrieve the stored fields from the latest documents from the index). This would require keeping all source fields stored of course. This would also allow to not log document data for requests with commit=true in them (since we know that if the request succeeds, all docs will be committed)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classHdfsTransactionLog.HDFSLogReaderclassHdfsTransactionLog.HDFSReverseReaderclassHdfsTransactionLog.HDFSSortedLogReader-
Nested classes/interfaces inherited from class org.apache.solr.update.TransactionLog
TransactionLog.FSReverseReader, TransactionLog.LogCodec, TransactionLog.LogReader, TransactionLog.ReverseReader, TransactionLog.SortedLogReader
-
-
Field Summary
-
Fields inherited from class org.apache.solr.update.TransactionLog
deleteOnClose, END_MESSAGE
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidcloseOutput()Move to a read-only state, closing and releasing resources while keeping the log available for readsbooleanendsWithCommit()voidfinish(UpdateLog.SyncLevel syncLevel)longgetLogSize()TransactionLog.LogReadergetReader(long startingPos)Returns a reader that can be used while a log is still in use.TransactionLog.ReverseReadergetReverseReader()Returns a single threaded reverse readerTransactionLog.LogReadergetSortedReader(long startingPos)Objectlookup(long pos)StringtoString()longwriteCommit(CommitUpdateCommand cmd)-
Methods inherited from class org.apache.solr.update.TransactionLog
addGlobalStrings, checkWriteHeader, decref, endRecord, forceClose, getLogSizeFromStream, incref, numRecords, position, try_incref, write, write, writeData, writeDelete, writeDeleteByQuery, writeLogHeader
-
-
-
-
Method Detail
-
endsWithCommit
public boolean endsWithCommit() throws IOException- Overrides:
endsWithCommitin classTransactionLog- Throws:
IOException
-
writeCommit
public long writeCommit(CommitUpdateCommand cmd)
- Overrides:
writeCommitin classTransactionLog
-
lookup
public Object lookup(long pos)
- Overrides:
lookupin classTransactionLog
-
closeOutput
public void closeOutput()
Description copied from class:TransactionLogMove to a read-only state, closing and releasing resources while keeping the log available for reads- Overrides:
closeOutputin classTransactionLog
-
getLogSize
public long getLogSize()
- Overrides:
getLogSizein classTransactionLog
-
finish
public void finish(UpdateLog.SyncLevel syncLevel)
- Overrides:
finishin classTransactionLog
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classTransactionLog
-
toString
public String toString()
- Overrides:
toStringin classTransactionLog
-
getReader
public TransactionLog.LogReader getReader(long startingPos)
Returns a reader that can be used while a log is still in use. Currently only *one* LogReader may be outstanding, and that log may only be used from a single thread.- Overrides:
getReaderin classTransactionLog
-
getSortedReader
public TransactionLog.LogReader getSortedReader(long startingPos)
- Overrides:
getSortedReaderin classTransactionLog
-
getReverseReader
public TransactionLog.ReverseReader getReverseReader() throws IOException
Returns a single threaded reverse reader- Overrides:
getReverseReaderin classTransactionLog- Throws:
IOException
-
-