本文整理汇总了Java中org.apache.solr.core.SolrCore.getName方法的典型用法代码示例。如果您正苦于以下问题:Java SolrCore.getName方法的具体用法?Java SolrCore.getName怎么用?Java SolrCore.getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.solr.core.SolrCore
的用法示例。
在下文中一共展示了SolrCore.getName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: closeIndexWriter
import org.apache.solr.core.SolrCore; //导入方法依赖的package包/类
@Override
public synchronized void closeIndexWriter(SolrCore core, boolean rollback)
throws IOException {
log.info("Closing IndexWriter...");
String coreName = core.getName();
synchronized (writerPauseLock) {
if (closed) {
throw new SolrException(ErrorCode.SERVICE_UNAVAILABLE, "Already closed");
}
// we need to wait for the Writer to fall out of use
// first lets stop it from being lent out
pauseWriter = true;
// then lets wait until its out of use
log.info("Waiting until IndexWriter is unused... core=" + coreName);
while (!writerFree) {
try {
writerPauseLock.wait(100);
} catch (InterruptedException e) {}
if (closed) {
throw new SolrException(ErrorCode.SERVICE_UNAVAILABLE,
"SolrCoreState already closed");
}
}
if (indexWriter != null) {
if (!rollback) {
closeIndexWriter(coreName);
} else {
rollbackIndexWriter(coreName);
}
}
}
}
示例2: SolrCoreCommitAgent
import org.apache.solr.core.SolrCore; //导入方法依赖的package包/类
public SolrCoreCommitAgent(SolrCore solrCore) {
super(solrCore.getName() + "/commit", "solr/core/commit");
this.solrCore = solrCore;
SolrCore.log.info("Initializing " + this.getClass().getSimpleName() + " for Core '" + this.solrCore + "'.");
this.solrCore.registerNewSearcherListener(this);
this.solrCore.getUpdateHandler().registerCommitCallback(this);
this.solrCore.getUpdateHandler().registerSoftCommitCallback(this);
}
示例3: newIndexWriter
import org.apache.solr.core.SolrCore; //导入方法依赖的package包/类
@Override
public synchronized void newIndexWriter(SolrCore core, boolean rollback) throws IOException {
log.info("Creating new IndexWriter...");
String coreName = core.getName();
synchronized (writerPauseLock) {
if (closed) {
throw new SolrException(ErrorCode.SERVICE_UNAVAILABLE, "Already closed");
}
// we need to wait for the Writer to fall out of use
// first lets stop it from being lent out
pauseWriter = true;
// then lets wait until its out of use
log.info("Waiting until IndexWriter is unused... core=" + coreName);
while (!writerFree) {
try {
writerPauseLock.wait(100);
} catch (InterruptedException e) {}
if (closed) {
throw new SolrException(ErrorCode.SERVICE_UNAVAILABLE, "SolrCoreState already closed");
}
}
try {
if (indexWriter != null) {
if (!rollback) {
closeIndexWriter(coreName);
} else {
rollbackIndexWriter(coreName);
}
}
indexWriter = createMainIndexWriter(core, "DirectUpdateHandler2");
log.info("New IndexWriter is ready to be used.");
// we need to null this so it picks up the new writer next get call
refCntWriter = null;
} finally {
pauseWriter = false;
writerPauseLock.notifyAll();
}
}
}
示例4: SolrCoreStatisticsAgent
import org.apache.solr.core.SolrCore; //导入方法依赖的package包/类
public SolrCoreStatisticsAgent(SolrCore solrCore) {
super(solrCore.getName() + "/statistics", "solr/core/statistics");
this.solrCore = solrCore;
SolrCore.log.info("Initializing " + this.getClass().getSimpleName() + " for Core '" + this.solrCore + "'.");
}