Package net.sf.katta.client

Examples of net.sf.katta.client.DeployClient.addIndex()


      throw new IllegalArgumentException("Index with name " + name + " already exists.");
    }

    try {
      long startTime = System.currentTimeMillis();
      IIndexDeployFuture deployFuture = deployClient.addIndex(name, path, replicationLevel);
      while (true) {
        long duration = System.currentTimeMillis() - startTime;
        if (deployFuture.getState() == IndexState.DEPLOYED) {
          System.out.println("\ndeployed index '" + name + "' in " + duration + " ms");
          break;
View Full Code Here


  }

  private static void deployIndex(InteractionProtocol protocol, String indexName, File index)
          throws InterruptedException {
    DeployClient deployClient1 = new DeployClient(protocol);
    IIndexDeployFuture deployment = deployClient1.addIndex(indexName, index.getAbsolutePath(), 1);
    LOG.info("Joining deployment on " + deployment.getClass().getName());
    deployment.joinDeployment();
  }

  private static void setupIndex(File index, int size) {
View Full Code Here

    final IDeployClient deployClient = new DeployClient(_protocol);
    WatchedEvent event = new WatchedEvent(new WatcherEvent(EventType.None.getIntValue(), KeeperState.Expired
            .getIntValue(), null));
    for (int i = 0; i < 25; i++) {
      final String indexName = "index" + i;
      IIndexDeployFuture deployFuture = deployClient.addIndex(indexName, INDEX_FILE.getAbsolutePath(), 1);
      zkClient.getEventLock().lock();
      zkClient.process(event);
      zkClient.getEventLock().unlock();
      IndexState indexState = deployFuture.joinDeployment();
      assertEquals("" + deployClient.getIndexMetaData(indexName).getDeployError(), IndexState.DEPLOYED, indexState);
View Full Code Here

  }

  @Test
  public void measureSearchPerformance() throws Exception {
    DeployClient deployClient = new DeployClient(_miniCluster.getProtocol());
    deployClient.addIndex("index1", TestResources.INDEX1.getAbsolutePath(), 1).joinDeployment();
    deployClient.addIndex("index2", TestResources.INDEX2.getAbsolutePath(), 1).joinDeployment();

    final ILuceneClient client = new LuceneClient(_miniCluster.getZkConfiguration());
    final Query query = new QueryParser(Version.LUCENE_30, "", new KeywordAnalyzer()).parse("foo: bar");
    long start = System.currentTimeMillis();
View Full Code Here

  @Test
  public void measureSearchPerformance() throws Exception {
    DeployClient deployClient = new DeployClient(_miniCluster.getProtocol());
    deployClient.addIndex("index1", TestResources.INDEX1.getAbsolutePath(), 1).joinDeployment();
    deployClient.addIndex("index2", TestResources.INDEX2.getAbsolutePath(), 1).joinDeployment();

    final ILuceneClient client = new LuceneClient(_miniCluster.getZkConfiguration());
    final Query query = new QueryParser(Version.LUCENE_30, "", new KeywordAnalyzer()).parse("foo: bar");
    long start = System.currentTimeMillis();
    for (int i = 0; i < 10000; i++) {
View Full Code Here

  }

  @Override
  protected void afterClusterStart() throws Exception {
    IDeployClient deployClient = new DeployClient(_miniCluster.getProtocol());
    deployClient.addIndex(INDEX1, TestResources.MAP_FILE_A.getAbsolutePath(), 1).joinDeployment();
    _client = new SleepClient(new DefaultNodeSelectionPolicy(), _miniCluster.getZkConfiguration(),
            new ClientConfiguration());
  }

  @AfterClass
View Full Code Here

  }

  private static void deployIndex(InteractionProtocol protocol, String indexName, File index)
          throws InterruptedException {
    DeployClient deployClient1 = new DeployClient(protocol);
    IIndexDeployFuture deployment = deployClient1.addIndex(indexName, index.getAbsolutePath(), 1);
    LOG.info("Joining deployment on " + deployment.getClass().getName());
    deployment.joinDeployment();
  }

  @Test
View Full Code Here

    List<String> indices = new ArrayList<String>();
    ArrayList<IIndexDeployFuture> deployFutures = new ArrayList<IIndexDeployFuture>();
    IDeployClient deployClient = new DeployClient(_protocol);
    for (int i = 0; i < deployCount; i++) {
      String indexName = indexFile.getName() + i;
      IIndexDeployFuture deployFuture = deployClient.addIndex(indexName, indexFile.getAbsolutePath(), replicationCount);
      indices.add(indexName);
      deployFutures.add(deployFuture);
    }
    for (IIndexDeployFuture deployFuture : deployFutures) {
      deployFuture.joinDeployment();
View Full Code Here

  }

  @Override
  protected void afterClusterStart() throws Exception {
    IDeployClient deployClient = new DeployClient(_miniCluster.getProtocol());
    deployClient.addIndex(INDEX1, TestResources.MAP_FILE_A.getAbsolutePath(), 1).joinDeployment();
    deployClient.addIndex(INDEX2, TestResources.MAP_FILE_B.getAbsolutePath(), 1).joinDeployment();
    _client = new MapFileClient(_miniCluster.getZkConfiguration());
  }

  @AfterClass
View Full Code Here

  @Override
  protected void afterClusterStart() throws Exception {
    IDeployClient deployClient = new DeployClient(_miniCluster.getProtocol());
    deployClient.addIndex(INDEX1, TestResources.MAP_FILE_A.getAbsolutePath(), 1).joinDeployment();
    deployClient.addIndex(INDEX2, TestResources.MAP_FILE_B.getAbsolutePath(), 1).joinDeployment();
    _client = new MapFileClient(_miniCluster.getZkConfiguration());
  }

  @AfterClass
  public static void onAfterClass() throws Exception {
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.