org.apache.solr.update
Class HdfsTransactionLog

java.lang.Object
  extended by org.apache.solr.update.TransactionLog
      extended by org.apache.solr.update.HdfsTransactionLog

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
 class HdfsTransactionLog.HDFSLogReader
           
 class HdfsTransactionLog.HDFSReverseReader
           
 
Nested classes/interfaces inherited from class org.apache.solr.update.TransactionLog
TransactionLog.FSReverseReader, TransactionLog.LogCodec, TransactionLog.LogReader, TransactionLog.ReverseReader
 
Field Summary
static org.slf4j.Logger log
           
 
Fields inherited from class org.apache.solr.update.TransactionLog
deleteOnClose, END_MESSAGE
 
Method Summary
protected  void close()
           
 boolean endsWithCommit()
           
 void finish(UpdateLog.SyncLevel syncLevel)
           
 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
 Object lookup(long pos)
           
 void rollback(long pos)
           
 String toString()
           
 long writeCommit(CommitUpdateCommand cmd, int flags)
           
 
Methods inherited from class org.apache.solr.update.TransactionLog
addGlobalStrings, decref, endRecord, forceClose, incref, numRecords, position, snapshot, try_incref, write, writeData, writeDelete, writeDeleteByQuery, writeLogHeader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

public static org.slf4j.Logger log
Method Detail

endsWithCommit

public boolean endsWithCommit()
                       throws IOException
Overrides:
endsWithCommit in class TransactionLog
Throws:
IOException

rollback

public void rollback(long pos)
              throws IOException
Overrides:
rollback in class TransactionLog
Throws:
IOException

writeCommit

public long writeCommit(CommitUpdateCommand cmd,
                        int flags)
Overrides:
writeCommit in class TransactionLog

lookup

public Object lookup(long pos)
Overrides:
lookup in class TransactionLog

finish

public void finish(UpdateLog.SyncLevel syncLevel)
Overrides:
finish in class TransactionLog

close

protected void close()
Overrides:
close in class TransactionLog

toString

public String toString()
Overrides:
toString in class TransactionLog

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 class TransactionLog

getReverseReader

public TransactionLog.ReverseReader getReverseReader()
                                              throws IOException
Returns a single threaded reverse reader

Overrides:
getReverseReader in class TransactionLog
Throws:
IOException


Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.