Package net.sf.katta.operation.master

Examples of net.sf.katta.operation.master.IndexDeployOperation


  @Test(timeout = 20000)
  public void testDeployAndUndeployIndex() throws Exception {
    final InteractionProtocol protocol = _miniCluster.getProtocol();

    IndexDeployOperation deployOperation = new IndexDeployOperation(INDEX_NAME, "file://"
            + INDEX_FILE.getAbsolutePath(), getNodeCount());
    protocol.addMasterOperation(deployOperation);

    TestUtil.waitUntilIndexDeployed(protocol, INDEX_NAME);
    assertEquals(1, protocol.getIndices().size());
View Full Code Here


  @Test(timeout = 20000)
  public void testDeployError() throws Exception {
    final InteractionProtocol protocol = _miniCluster.getProtocol();

    final File indexFile = TestResources.INVALID_INDEX;
    IndexDeployOperation deployOperation = new IndexDeployOperation(INDEX_NAME,
            "file://" + indexFile.getAbsolutePath(), getNodeCount());
    protocol.addMasterOperation(deployOperation);
    TestUtil.waitUntilIndexDeployed(protocol, INDEX_NAME);
    assertEquals(1, protocol.getIndices().size());
    IndexMetaData indexMD = protocol.getIndexMD(INDEX_NAME);
View Full Code Here

  }

  @Override
  public IIndexDeployFuture addIndex(String indexName, String indexPath, int replicationLevel) {
    validateIndexData(indexName, replicationLevel);
    _protocol.addMasterOperation(new IndexDeployOperation(indexName, indexPath, replicationLevel));
    return new IndexDeployFuture(_protocol, indexName);
  }
View Full Code Here

    }
    return shardDeployCount;
  }

  protected IndexMetaData deployIndex(String indexName, File indexFile, int replication) throws Exception {
    IndexDeployOperation deployOperation = new IndexDeployOperation(indexName, "file://" + indexFile.getAbsolutePath(),
            replication);
    _protocol.addMasterOperation(deployOperation);
    TestUtil.waitUntilIndexDeployed(_protocol, INDEX_NAME);
    return _protocol.getIndexMD(indexName);
  }
View Full Code Here

    NodeQueue nodeQueue = _protocol.publishNode(node, new NodeMetaData("node1"));
    master.start();
    TestUtil.waitUntilLeaveSafeMode(master);

    // phase I - until watchdog is running and its node turn
    IndexDeployOperation deployOperation = new IndexDeployOperation("index1", TestResources.INDEX1.getAbsolutePath(), 1);
    _protocol.addMasterOperation(deployOperation);
    while (!master.getContext().getMasterQueue().isEmpty()) {
      // wait until deploy is in watch phase
      Thread.sleep(100);
    }

    // phase II - master change while node is deploying
    master.shutdown();
    Master secMaster = new Master(_zk.getInteractionProtocol(), false);
    secMaster.start();

    // phase III - finish node operations/ mater operation should be finished
    while (!nodeQueue.isEmpty()) {
      nodeQueue.remove();
    }
    TestUtil.waitUntilIndexDeployed(_protocol, deployOperation.getIndexName());
    assertNotNull(_protocol.getIndexMD(deployOperation.getIndexName()));

    secMaster.shutdown();
  }
View Full Code Here

TOP

Related Classes of net.sf.katta.operation.master.IndexDeployOperation

Copyright © 2018 www.massapicom. 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.