gpt4 book ai didi

org.hibernate.search.backend.impl.lucene.WorkspaceHolder类的使用及代码示例

转载 作者:知者 更新时间:2024-03-24 18:19:05 26 4
gpt4 key购买 nike

本文整理了Java中org.hibernate.search.backend.impl.lucene.WorkspaceHolder类的一些代码示例,展示了WorkspaceHolder类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WorkspaceHolder类的具体详情如下:
包路径:org.hibernate.search.backend.impl.lucene.WorkspaceHolder
类名称:WorkspaceHolder

WorkspaceHolder介绍

[英]This will actually contain the Workspace and LuceneWork visitor implementation, reused per-DirectoryProvider. Both Workspace(s) and LuceneWorkVisitor(s) lifecycle are linked to the backend lifecycle (reused and shared by all transactions). The LuceneWorkVisitor(s) are stateless, the Workspace(s) are threadsafe.
[中]这实际上包含工作区和LuceneWork访问者实现,每个DirectoryProvider重复使用。工作区和LuceneWorkVisitor的生命周期都链接到后端生命周期(由所有事务重用和共享)。LuceneWorkVisitor是无状态的,工作区是线程安全的。

代码示例

代码示例来源:origin: hibernate/hibernate-search

protected WorkspaceHolder createWorkspaceHolder(String indexName, Properties cfg, WorkerBuildContext buildContext) {
  WorkspaceHolder backend = new WorkspaceHolder();
  backend.initialize( cfg, buildContext, this );
  return backend;
}

代码示例来源:origin: org.infinispan/infinispan-embedded-query

@Override
public void performStreamOperation(LuceneWork singleOperation, IndexingMonitor monitor, boolean forceAsync) {
  //TODO implement async
  workspaceHolder.applyStreamWork( singleOperation, monitor );
}

代码示例来源:origin: hibernate/hibernate-search

@Override
public void flushAndReleaseResources() {
  workspaceHolder.flushAndReleaseResources();
}

代码示例来源:origin: hibernate/hibernate-search

@Override
protected WorkspaceHolder createWorkspaceHolder(String indexName, Properties cfg, WorkerBuildContext buildContext) {
  String backend = cfg.getProperty( Environment.WORKER_BACKEND );
  if ( backend != null ) {
    log.ignoringBackendOptionForIndex( indexName, "near-real-time" );
  }
  WorkspaceHolder backendQueueProcessor = new WorkspaceHolder();
  nrtWorkspace = new NRTWorkspaceImpl( this, buildContext, cfg );
  backendQueueProcessor.setCustomWorkspace( nrtWorkspace );
  backendQueueProcessor.initialize( cfg, buildContext, this );
  return backendQueueProcessor;
}

代码示例来源:origin: hibernate/hibernate-search

/**
 * This essentially kills the backend: needed to release the IndexWriter lock
 * so that the CheckIndex task can be run.
 * You'll need to ignore further issues if indexing is attempted, and even shutdown
 * might not be graceful (the shutdown is not designed to be recoverable).
 */
private static void stopBackend(DirectoryBasedIndexManager directoryBasedIndexManager) {
  WorkspaceHolder backendQueueProcessor = (WorkspaceHolder) directoryBasedIndexManager.getWorkspaceHolder();
  backendQueueProcessor.getIndexResources().shutdown();
}

代码示例来源:origin: org.infinispan/infinispan-embedded-query

@Override
public void applyWork(List<LuceneWork> workList, IndexingMonitor monitor, IndexManager indexManager) {
 log.applyingChangeListLocally(workList);
 workspaceHolder.applyWork(workList, monitor);
}

代码示例来源:origin: hibernate/hibernate-search

private void triggerWorkspaceReconfiguration() {
  if ( boundSearchIntegrator != null ) { //otherwise it's too early
    workspaceHolder.indexMappingChanged();
  }
}

代码示例来源:origin: org.infinispan/infinispan-query

@Override
public void flushAndClose(IndexingBackend replacement) {
 workspaceHolder.close();
 log.debug("Downgraded from Master role: Index lock released.");
}

代码示例来源:origin: hibernate/hibernate-search

public Lock getDirectoryModificationLock() {
  return workspaceHolder.getExclusiveWriteLock();
}

代码示例来源:origin: hibernate/hibernate-search

private void assertExclusiveIsEnabled(IndexManagerHolder allIndexesManager, String indexName, boolean expectExclusive) {
  DirectoryBasedIndexManager indexManager = (DirectoryBasedIndexManager) allIndexesManager.getIndexManager( indexName );
  WorkspaceHolder workspaceHolder = indexManager.getWorkspaceHolder();
  AbstractWorkspaceImpl workspace = workspaceHolder.getIndexResources().getWorkspace();
  if ( expectExclusive ) {
    assertEquals( ExclusiveIndexWorkspaceImpl.class, workspace.getClass() );
  }
  else {
    assertEquals( SharedIndexWorkspaceImpl.class, workspace.getClass() );
  }
}

代码示例来源:origin: org.infinispan/infinispan-embedded-query

@Override
protected WorkspaceHolder createWorkspaceHolder(String indexName, Properties cfg, WorkerBuildContext buildContext) {
  String backend = cfg.getProperty( Environment.WORKER_BACKEND );
  if ( backend != null ) {
    log.ignoringBackendOptionForIndex( indexName, "near-real-time" );
  }
  WorkspaceHolder backendQueueProcessor = new WorkspaceHolder();
  nrtWorkspace = new NRTWorkspaceImpl( this, buildContext, cfg );
  backendQueueProcessor.setCustomWorkspace( nrtWorkspace );
  backendQueueProcessor.initialize( cfg, buildContext, this );
  return backendQueueProcessor;
}

代码示例来源:origin: org.infinispan/infinispan-query

@Override
public void applyWork(List<LuceneWork> workList, IndexingMonitor monitor, IndexManager indexManager) {
 log.applyingChangeListLocally(workList);
 workspaceHolder.applyWork(workList, monitor);
}

代码示例来源:origin: org.infinispan/infinispan-embedded-query

private void triggerWorkspaceReconfiguration() {
  if ( boundSearchIntegrator != null ) { //otherwise it's too early
    workspaceHolder.indexMappingChanged();
  }
}

代码示例来源:origin: org.infinispan/infinispan-embedded-query

@Override
public void flushAndClose(IndexingBackend replacement) {
 workspaceHolder.close();
 log.debug("Downgraded from Master role: Index lock released.");
}

代码示例来源:origin: org.infinispan/infinispan-embedded-query

public Lock getDirectoryModificationLock() {
  return workspaceHolder.getExclusiveWriteLock();
}

代码示例来源:origin: org.infinispan/infinispan-embedded-query

protected WorkspaceHolder createWorkspaceHolder(String indexName, Properties cfg, WorkerBuildContext buildContext) {
  WorkspaceHolder backend = new WorkspaceHolder();
  backend.initialize( cfg, buildContext, this );
  return backend;
}

代码示例来源:origin: hibernate/hibernate-search

public AbstractWorkspaceImpl extractWorkspace(IndexedTypeIdentifier indexedType) {
  DirectoryBasedIndexManager indexManager = (DirectoryBasedIndexManager) extractIndexManager( indexedType );
  WorkspaceHolder backend = indexManager.getWorkspaceHolder();
  return backend.getIndexResources().getWorkspace();
}

代码示例来源:origin: hibernate/hibernate-search

@Override
public void performOperations(List<LuceneWork> workList, IndexingMonitor monitor) {
  if ( log.isDebugEnabled() ) {
    log.debug( "Applying work via workspace holder of type " + workspaceHolder.getClass() );
  }
  workspaceHolder.applyWork( workList, monitor );
}

代码示例来源:origin: hibernate/hibernate-search

@Override
public void performStreamOperation(LuceneWork singleOperation, IndexingMonitor monitor, boolean forceAsync) {
  //TODO implement async
  workspaceHolder.applyStreamWork( singleOperation, monitor );
}

代码示例来源:origin: org.infinispan/infinispan-embedded-query

@Override
public void flushAndReleaseResources() {
  workspaceHolder.flushAndReleaseResources();
}

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com