Examples of BackendQueueProcessor


Examples of org.hibernate.search.backend.spi.BackendQueueProcessor

    Assert.assertTrue( "dvds backend was configured with a deleage to blackhole but it's not using it", delegatedBackend instanceof BlackHoleBackendQueueProcessor );
  }

  @Test
  public void alternativeJGroupsTimeoutConfiguration() {
    BackendQueueProcessor backendQueueProcessor = extractBackendQueue( slaveNode, "dvds" );
    JGroupsBackendQueueProcessor jgroupsProcessor = (JGroupsBackendQueueProcessor) backendQueueProcessor;
    long messageTimeout = jgroupsProcessor.getMessageTimeout();
    Assert.assertEquals( "message timeout configuration property not applied", 200, messageTimeout );
  }
View Full Code Here

Examples of org.hibernate.search.backend.spi.BackendQueueProcessor

    long messageTimeout = jgroupsProcessor.getMessageTimeout();
    Assert.assertEquals( "message timeout configuration property not applied", 200, messageTimeout );
  }

  private JGroupsReceivingMockBackend extractMockBackend(String indexName) {
    BackendQueueProcessor backendQueueProcessor = extractBackendQueue( masterNode, indexName );
    Assert.assertTrue( "Backend not using the configured Mock!", backendQueueProcessor instanceof JGroupsReceivingMockBackend );
    return (JGroupsReceivingMockBackend) backendQueueProcessor;
  }
View Full Code Here

Examples of org.hibernate.search.backend.spi.BackendQueueProcessor

    Assert.assertTrue( "Backend not using the configured Mock!", backendQueueProcessor instanceof JGroupsReceivingMockBackend );
    return (JGroupsReceivingMockBackend) backendQueueProcessor;
  }

  private JGroupsBackendQueueProcessor extractJGroupsBackend(String indexName) {
    BackendQueueProcessor backendQueueProcessor = extractBackendQueue( slaveNode, indexName );
    Assert.assertTrue( "Backend not using JGroups!", backendQueueProcessor instanceof JGroupsBackendQueueProcessor );
    return (JGroupsBackendQueueProcessor) backendQueueProcessor;
  }
View Full Code Here

Examples of org.hibernate.search.backend.spi.BackendQueueProcessor

    builder.close();
  }

  private void assertExclusiveIsEnabled(IndexManagerHolder allIndexesManager, String indexName, boolean expectExclusive) {
    DirectoryBasedIndexManager indexManager = (DirectoryBasedIndexManager) allIndexesManager.getIndexManager( indexName );
    BackendQueueProcessor backendQueueProcessor = indexManager.getBackendQueueProcessor();
    assertEquals( LuceneBackendQueueProcessor.class, backendQueueProcessor.getClass() );
    LuceneBackendQueueProcessor backend = (LuceneBackendQueueProcessor) backendQueueProcessor;
    AbstractWorkspaceImpl workspace = backend.getIndexResources().getWorkspace();
    if ( expectExclusive ) {
      assertEquals( ExclusiveIndexWorkspaceImpl.class, workspace.getClass() );
    }
View Full Code Here

Examples of org.hibernate.search.backend.spi.BackendQueueProcessor

public class JGroupsBackendQueueProcessorTest {

  @Test
  public void testCheckingForNullWork() {
    try {
      BackendQueueProcessor backend = new JGroupsBackendQueueProcessor( new SlaveNodeSelector() );
      backend.applyWork( null, null );
    }
    catch (IllegalArgumentException e2) {
      // this is ok, we just want to avoid other exceptions or NPEs
    }
  }
View Full Code Here

Examples of org.hibernate.search.backend.spi.BackendQueueProcessor

public class JndiJMSBackendQueueProcessorTest {

  @Test
  public void testCheckingForNullWork() {
    try {
      BackendQueueProcessor backend = new JndiJMSBackendQueueProcessor();
      backend.applyWork( null, null );
    }
    catch (IllegalArgumentException e2) {
      // this is ok, we just want to avoid other exceptions or NPEs
    }
  }
View Full Code Here

Examples of org.hibernate.search.backend.spi.BackendQueueProcessor

      .openFullTextSession();
    SearchFactoryImplementor searchFactory = (SearchFactoryImplementor) ftSession.getSearchFactory();
    ftSession.close();
    IndexManagerHolder allIndexesManager = searchFactory.getIndexManagerHolder();
    DirectoryBasedIndexManager indexManager = (DirectoryBasedIndexManager) allIndexesManager.getIndexManager( "org.hibernate.search.test.configuration.BlogEntry" );
    BackendQueueProcessor backendQueueProcessor = indexManager.getBackendQueueProcessor();
    assertEquals( backendType, backendQueueProcessor.getClass() );
    builder.close();
  }
View Full Code Here

Examples of org.hibernate.search.backend.spi.BackendQueueProcessor

  public static BackendQueueProcessor createBackend(DirectoryBasedIndexManager indexManager, WorkerBuildContext context, Properties properties) {

    String backend = properties.getProperty( Environment.WORKER_BACKEND );

    final BackendQueueProcessor backendQueueProcessor;

    if ( StringHelper.isEmpty( backend ) || "lucene".equalsIgnoreCase( backend ) ) {
      backendQueueProcessor = new LuceneBackendQueueProcessor();
    }
    else if ( "jms".equalsIgnoreCase( backend ) ) {
      backendQueueProcessor = new JndiJMSBackendQueueProcessor();
    }
    else if ( "blackhole".equalsIgnoreCase( backend ) ) {
      backendQueueProcessor = new BlackHoleBackendQueueProcessor();
    }
    else if ( "jgroupsMaster".equals( backend ) ) {
      backendQueueProcessor = new JGroupsBackendQueueProcessor( new MasterNodeSelector() );
    }
    else if ( "jgroupsSlave".equals( backend ) ) {
      backendQueueProcessor = new JGroupsBackendQueueProcessor( new SlaveNodeSelector() );
    }
    else if ( "jgroups".equals( backend ) ) {
      backendQueueProcessor = new JGroupsBackendQueueProcessor( new AutoNodeSelector( indexManager.getIndexName() ) );
    }
    else {
      backendQueueProcessor = ClassLoaderHelper.instanceFromName(
          BackendQueueProcessor.class,
          backend, BackendFactory.class, "processor"
      );
    }
    backendQueueProcessor.initialize( properties, context, indexManager );
    return backendQueueProcessor;
  }
View Full Code Here

Examples of org.hibernate.search.backend.spi.BackendQueueProcessor

  }

  public static BackendQueueProcessor createBackend(String backend, DirectoryBasedIndexManager indexManager, WorkerBuildContext context,
      Properties properties) {

    final BackendQueueProcessor backendQueueProcessor;

    if ( StringHelper.isEmpty( backend ) || "lucene".equalsIgnoreCase( backend ) ) {
      backendQueueProcessor = new LuceneBackendQueueProcessor();
    }
    else if ( "jms".equalsIgnoreCase( backend ) ) {
      backendQueueProcessor = new JndiJMSBackendQueueProcessor();
    }
    else if ( "blackhole".equalsIgnoreCase( backend ) ) {
      backendQueueProcessor = new BlackHoleBackendQueueProcessor();
    }
    else if ( "jgroupsMaster".equals( backend ) ) {
      backendQueueProcessor = new JGroupsBackendQueueProcessor( new MasterNodeSelector() );
    }
    else if ( "jgroupsSlave".equals( backend ) ) {
      backendQueueProcessor = new JGroupsBackendQueueProcessor( new SlaveNodeSelector() );
    }
    else if ( "jgroups".equals( backend ) ) {
      backendQueueProcessor = new JGroupsBackendQueueProcessor( new AutoNodeSelector( indexManager.getIndexName() ) );
    }
    else {
      backendQueueProcessor = ClassLoaderHelper.instanceFromName(
          BackendQueueProcessor.class,
          backend, BackendFactory.class, "processor"
      );
    }
    backendQueueProcessor.initialize( properties, context, indexManager );
    return backendQueueProcessor;
  }
View Full Code Here

Examples of org.hibernate.search.backend.spi.BackendQueueProcessor

   private static final Log log = LogFactory.getLog(InfinispanIndexManager.class, Log.class);

   private InfinispanCommandsBackend remoteMaster;

   protected BackendQueueProcessor createBackend(String indexName, Properties cfg, WorkerBuildContext buildContext) {
      BackendQueueProcessor localMaster = BackendFactory.createBackend(this, buildContext, cfg);
      remoteMaster = new InfinispanCommandsBackend();
      remoteMaster.initialize(cfg, buildContext, this);
      //localMaster is already initialized by the BackendFactory
      MasterSwitchDelegatingQueueProcessor joinedMaster = new MasterSwitchDelegatingQueueProcessor(localMaster, remoteMaster);
      return joinedMaster;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.