Package org.apache.solr.update
Class SolrIndexWriter
- java.lang.Object
-
- org.apache.lucene.index.IndexWriter
-
- org.apache.solr.update.SolrIndexWriter
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,org.apache.lucene.index.MergePolicy.MergeContext
,org.apache.lucene.index.TwoPhaseCommit
,org.apache.lucene.util.Accountable
public class SolrIndexWriter extends org.apache.lucene.index.IndexWriter
An IndexWriter that is configured via Solr config mechanisms.- Since:
- solr 0.9
-
-
Field Summary
Fields Modifier and Type Field Description static String
COMMIT_COMMAND_VERSION
static String
COMMIT_TIME_MSEC_KEY
Stored into each Lucene commit to record the System.currentTimeMillis() when commit was called.static AtomicLong
numCloses
static AtomicLong
numOpens
-
Constructor Summary
Constructors Constructor Description SolrIndexWriter(String name, org.apache.lucene.store.Directory d, org.apache.lucene.index.IndexWriterConfig conf)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
static SolrIndexWriter
create(SolrCore core, String name, String path, DirectoryFactory directoryFactory, boolean create, IndexSchema schema, SolrIndexConfig config, org.apache.lucene.index.IndexDeletionPolicy delPolicy, org.apache.lucene.codecs.Codec codec)
protected void
doAfterFlush()
protected void
finalize()
Map<String,Object>
getRunningMerges()
void
merge(org.apache.lucene.index.MergePolicy.OneMerge merge)
void
rollback()
static void
setCommitData(org.apache.lucene.index.IndexWriter iw, long commitCommandVersion)
-
Methods inherited from class org.apache.lucene.index.IndexWriter
addDocument, addDocuments, addIndexes, addIndexes, advanceSegmentInfosVersion, commit, decRefDeleter, deleteAll, deleteDocuments, deleteDocuments, deleteUnusedFiles, doBeforeFlush, ensureOpen, ensureOpen, flush, flushNextBuffer, forceMerge, forceMerge, forceMergeDeletes, forceMergeDeletes, getAnalyzer, getConfig, getDirectory, getDocStats, getFieldNames, getFlushingBytes, getInfoStream, getLiveCommitData, getMaxCompletedSequenceNumber, getMergingSegments, getNextMerge, getTragicException, hasDeletions, hasPendingMerges, hasUncommittedChanges, incRefDeleter, isEnableTestPoints, isOpen, maybeMerge, numDeletedDocs, numDeletesToMerge, numRamDocs, prepareCommit, ramBytesUsed, setLiveCommitData, setLiveCommitData, softUpdateDocument, softUpdateDocuments, tryDeleteDocument, tryUpdateDocValue, updateBinaryDocValue, updateDocument, updateDocuments, updateDocValues, updateNumericDocValue
-
-
-
-
Field Detail
-
numOpens
public static final AtomicLong numOpens
-
numCloses
public static final AtomicLong numCloses
-
COMMIT_TIME_MSEC_KEY
public static final String COMMIT_TIME_MSEC_KEY
Stored into each Lucene commit to record the System.currentTimeMillis() when commit was called.- See Also:
- Constant Field Values
-
COMMIT_COMMAND_VERSION
public static final String COMMIT_COMMAND_VERSION
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SolrIndexWriter
public SolrIndexWriter(String name, org.apache.lucene.store.Directory d, org.apache.lucene.index.IndexWriterConfig conf) throws IOException
- Throws:
IOException
-
-
Method Detail
-
create
public static SolrIndexWriter create(SolrCore core, String name, String path, DirectoryFactory directoryFactory, boolean create, IndexSchema schema, SolrIndexConfig config, org.apache.lucene.index.IndexDeletionPolicy delPolicy, org.apache.lucene.codecs.Codec codec) throws IOException
- Throws:
IOException
-
setCommitData
public static void setCommitData(org.apache.lucene.index.IndexWriter iw, long commitCommandVersion)
-
merge
public void merge(org.apache.lucene.index.MergePolicy.OneMerge merge) throws IOException
- Overrides:
merge
in classorg.apache.lucene.index.IndexWriter
- Throws:
IOException
-
doAfterFlush
protected void doAfterFlush() throws IOException
- Overrides:
doAfterFlush
in classorg.apache.lucene.index.IndexWriter
- Throws:
IOException
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classorg.apache.lucene.index.IndexWriter
- Throws:
IOException
-
rollback
public void rollback() throws IOException
- Specified by:
rollback
in interfaceorg.apache.lucene.index.TwoPhaseCommit
- Overrides:
rollback
in classorg.apache.lucene.index.IndexWriter
- Throws:
IOException
-
-