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, toString
protected final IndexWriter writer
protected final long primaryGen
public PrimaryNode(IndexWriter writer, int id, long primaryGen, long forcePrimaryVersion, SearcherFactory searcherFactory, PrintStream printStream) throws IOException
IOException
public long getPrimaryGen()
public boolean flushAndRefresh() throws IOException
IOException
public long getCopyStateVersion()
public long getLastCommitVersion()
public void commit() throws IOException
commit
in class Node
IOException
public CopyState getCopyState() throws IOException
IOException
public void releaseCopyState(CopyState copyState) throws IOException
IOException
public void close() throws IOException
IOException
protected abstract void preCopyMergedSegmentFiles(SegmentCommitInfo info, Map<String,FileMetaData> files) throws IOException
IOException
Copyright © 2000-2017 Apache Software Foundation. All Rights Reserved.