Package org.apache.solr.hdfs.update
Class HdfsTransactionLog
- java.lang.Object
-
- org.apache.solr.update.TransactionLog
-
- org.apache.solr.hdfs.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, StringTODO: 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 class
HdfsTransactionLog.HDFSLogReader
class
HdfsTransactionLog.HDFSReverseReader
class
HdfsTransactionLog.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, fos, globalStringList, globalStringMap, isBuffer, refcount, resolver
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
closeOutput()
boolean
endsWithCommit()
void
finish(UpdateLog.SyncLevel syncLevel)
long
getLogSize()
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 readerTransactionLog.LogReader
getSortedReader(long startingPos)
Object
lookup(long pos)
String
toString()
long
writeCommit(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:
endsWithCommit
in classTransactionLog
- Throws:
IOException
-
writeCommit
public long writeCommit(CommitUpdateCommand cmd)
- Overrides:
writeCommit
in classTransactionLog
-
lookup
public Object lookup(long pos)
- Overrides:
lookup
in classTransactionLog
-
closeOutput
public void closeOutput()
- Overrides:
closeOutput
in classTransactionLog
-
getLogSize
public long getLogSize()
- Overrides:
getLogSize
in classTransactionLog
-
finish
public void finish(UpdateLog.SyncLevel syncLevel)
- Overrides:
finish
in classTransactionLog
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classTransactionLog
-
toString
public String toString()
- Overrides:
toString
in 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:
getReader
in classTransactionLog
-
getSortedReader
public TransactionLog.LogReader getSortedReader(long startingPos)
- Overrides:
getSortedReader
in classTransactionLog
-
getReverseReader
public TransactionLog.ReverseReader getReverseReader() throws IOException
Returns a single threaded reverse reader- Overrides:
getReverseReader
in classTransactionLog
- Throws:
IOException
-
-