org.apache.solr.update
Class UpdateLog

java.lang.Object
  extended by org.apache.solr.update.UpdateLog
All Implemented Interfaces:
PluginInfoInitialized

public class UpdateLog
extends Object
implements PluginInfoInitialized

WARNING: This API is experimental and might change in incompatible ways in the next release.

Nested Class Summary
 class UpdateLog.DBQ
           
static class UpdateLog.LogPtr
           
 class UpdateLog.RecentUpdates
           
static class UpdateLog.RecoveryInfo
           
static class UpdateLog.State
           
static class UpdateLog.SyncLevel
           
 
Field Summary
static int ADD
           
static int COMMIT
           
 boolean debug
           
static int DELETE
           
static int DELETE_BY_QUERY
           
static int FLAG_GAP
           
static org.slf4j.Logger log
           
static String LOG_FILENAME_PATTERN
           
 int numRecordsToKeep
           
static int OPERATION_MASK
           
static Runnable testing_logReplayFinishHook
           
static Runnable testing_logReplayHook
           
static String TLOG_NAME
           
 boolean trace
           
 
Constructor Summary
UpdateLog()
           
 
Method Summary
 void add(AddUpdateCommand cmd)
           
 void add(AddUpdateCommand cmd, boolean clearCaches)
           
 Future<UpdateLog.RecoveryInfo> applyBufferedUpdates()
          Returns the Future to wait on, or null if no replay was needed
 void bufferUpdates()
           
 void cancelApplyBufferedUpdates()
           
 void close(boolean committed)
           
 void close(boolean committed, boolean deleteOnClose)
           
 void delete(DeleteUpdateCommand cmd)
           
 void deleteAll()
          currently for testing only
 void deleteByQuery(DeleteUpdateCommand cmd)
           
static void deleteFile(File file)
           
 boolean dropBufferedUpdates()
          Returns true if we were able to drop buffered updates and return to the ACTIVE state
 void finish(UpdateLog.SyncLevel syncLevel)
           
 List<UpdateLog.DBQ> getDBQNewer(long version)
           
 long getLastLogId()
           
 File getLogDir()
           
static String[] getLogList(File directory)
           
 UpdateLog.RecentUpdates getRecentUpdates()
           
 int getStartingOperation()
           
 List<Long> getStartingVersions()
           
 UpdateLog.State getState()
           
static File getTlogDir(SolrCore core, PluginInfo info)
           
 VersionInfo getVersionInfo()
           
 boolean hasUncommittedChanges()
           
 void init(PluginInfo info)
           
 void init(UpdateHandler uhandler, SolrCore core)
           
 Object lookup(BytesRef indexedId)
           
 Long lookupVersion(BytesRef indexedId)
           
 void postCommit(CommitUpdateCommand cmd)
           
 void postSoftCommit(CommitUpdateCommand cmd)
           
 void preCommit(CommitUpdateCommand cmd)
           
 void preSoftCommit(CommitUpdateCommand cmd)
           
 Future<UpdateLog.RecoveryInfo> recoverFromLog()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LOG_FILENAME_PATTERN

public static String LOG_FILENAME_PATTERN

TLOG_NAME

public static String TLOG_NAME

log

public static org.slf4j.Logger log

debug

public boolean debug

trace

public boolean trace

ADD

public static final int ADD
See Also:
Constant Field Values

DELETE

public static final int DELETE
See Also:
Constant Field Values

DELETE_BY_QUERY

public static final int DELETE_BY_QUERY
See Also:
Constant Field Values

COMMIT

public static final int COMMIT
See Also:
Constant Field Values

FLAG_GAP

public static final int FLAG_GAP
See Also:
Constant Field Values

OPERATION_MASK

public static final int OPERATION_MASK
See Also:
Constant Field Values

numRecordsToKeep

public final int numRecordsToKeep
See Also:
Constant Field Values

testing_logReplayHook

public static Runnable testing_logReplayHook

testing_logReplayFinishHook

public static Runnable testing_logReplayFinishHook
Constructor Detail

UpdateLog

public UpdateLog()
Method Detail

getVersionInfo

public VersionInfo getVersionInfo()

init

public void init(PluginInfo info)
Specified by:
init in interface PluginInfoInitialized

init

public void init(UpdateHandler uhandler,
                 SolrCore core)

getLogDir

public File getLogDir()

getStartingVersions

public List<Long> getStartingVersions()

getStartingOperation

public int getStartingOperation()

getLogList

public static String[] getLogList(File directory)

getLastLogId

public long getLastLogId()

add

public void add(AddUpdateCommand cmd)

add

public void add(AddUpdateCommand cmd,
                boolean clearCaches)

delete

public void delete(DeleteUpdateCommand cmd)

deleteByQuery

public void deleteByQuery(DeleteUpdateCommand cmd)

deleteAll

public void deleteAll()
currently for testing only


getDBQNewer

public List<UpdateLog.DBQ> getDBQNewer(long version)

hasUncommittedChanges

public boolean hasUncommittedChanges()

preCommit

public void preCommit(CommitUpdateCommand cmd)

postCommit

public void postCommit(CommitUpdateCommand cmd)

preSoftCommit

public void preSoftCommit(CommitUpdateCommand cmd)

postSoftCommit

public void postSoftCommit(CommitUpdateCommand cmd)

lookup

public Object lookup(BytesRef indexedId)

lookupVersion

public Long lookupVersion(BytesRef indexedId)

finish

public void finish(UpdateLog.SyncLevel syncLevel)

recoverFromLog

public Future<UpdateLog.RecoveryInfo> recoverFromLog()

close

public void close(boolean committed)

close

public void close(boolean committed,
                  boolean deleteOnClose)

getRecentUpdates

public UpdateLog.RecentUpdates getRecentUpdates()

bufferUpdates

public void bufferUpdates()

dropBufferedUpdates

public boolean dropBufferedUpdates()
Returns true if we were able to drop buffered updates and return to the ACTIVE state


applyBufferedUpdates

public Future<UpdateLog.RecoveryInfo> applyBufferedUpdates()
Returns the Future to wait on, or null if no replay was needed


getState

public UpdateLog.State getState()

toString

public String toString()
Overrides:
toString in class Object

cancelApplyBufferedUpdates

public void cancelApplyBufferedUpdates()

deleteFile

public static void deleteFile(File file)

getTlogDir

public static File getTlogDir(SolrCore core,
                              PluginInfo info)


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