public abstract class PrimaryNode extends Node
| Modifier and Type | Field and Description |
|---|---|
protected long |
primaryGen |
protected IndexWriter |
writer |
dir, globalStartNS, id, lastFileMetaData, localStartNS, mgr, PRIMARY_GEN_KEY, printStream, searcherFactory, VERBOSE_CONNECTIONS, VERBOSE_FILES, VERSION_KEY| Constructor and Description |
|---|
PrimaryNode(IndexWriter writer,
int id,
long primaryGen,
long forcePrimaryVersion,
SearcherFactory searcherFactory,
PrintStream printStream) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
commit() |
boolean |
flushAndRefresh()
Flush all index operations to disk and opens a new near-real-time reader.
|
CopyState |
getCopyState()
IncRef the current CopyState and return it
|
long |
getCopyStateVersion() |
long |
getLastCommitVersion() |
long |
getPrimaryGen()
Returns the current primary generation, which is incremented each time a new primary is started for this index
|
boolean |
isClosed() |
protected abstract void |
preCopyMergedSegmentFiles(SegmentCommitInfo info,
Map<String,FileMetaData> files)
Called when a merge has finished, but before IW switches to the merged segment
|
void |
releaseCopyState(CopyState copyState)
Called once replica is done (or failed) copying an NRT point
|
bytesToString, getCurrentSearchingVersion, getDirectory, getSearcherManager, message, name, nodeMessage, nodeMessage, readLocalFileMetaData, toStringprotected final IndexWriter writer
protected final long primaryGen
public PrimaryNode(IndexWriter writer, int id, long primaryGen, long forcePrimaryVersion, SearcherFactory searcherFactory, PrintStream printStream) throws IOException
IOExceptionpublic long getPrimaryGen()
public boolean flushAndRefresh()
throws IOException
IOExceptionpublic long getCopyStateVersion()
public long getLastCommitVersion()
public void commit()
throws IOException
commit in class NodeIOExceptionpublic CopyState getCopyState() throws IOException
IOExceptionpublic void releaseCopyState(CopyState copyState) throws IOException
IOExceptionpublic void close()
throws IOException
IOExceptionprotected abstract void preCopyMergedSegmentFiles(SegmentCommitInfo info, Map<String,FileMetaData> files) throws IOException
IOExceptionCopyright © 2000-2024 Apache Software Foundation. All Rights Reserved.