Package com.splout.db.thrift

Examples of com.splout.db.thrift.DeployAction


        }
        for(String dNode : rEntry.getNodes()) {
          List<DeployAction> actionsSoFar = (List<DeployAction>) MapUtils.getObject(actions, dNode,
              new ArrayList<DeployAction>());
          actions.put(dNode, actionsSoFar);
          DeployAction deployAction = new DeployAction();
          deployAction.setDataURI(req.getData_uri() + "/" + rEntry.getShard() + ".db");
          deployAction.setTablespace(req.getTablespace());
          deployAction.setVersion(version);
          deployAction.setPartition(rEntry.getShard());

          // Add partition metadata to the deploy action for DNodes to save it
          PartitionMetadata metadata = new PartitionMetadata();
          metadata.setMinKey(pEntry.getMin());
          metadata.setMaxKey(pEntry.getMax());
          metadata.setNReplicas(rEntry.getNodes().size());
          metadata.setDeploymentDate(deployDate);
          metadata.setInitStatements(req.getInitStatements());
          metadata.setEngineId(req.getEngine());

          deployAction.setMetadata(metadata);
          actionsSoFar.add(deployAction);
        }
      }
    }
    return actions;
View Full Code Here


    DNode dnode = TestUtils.getTestDNode(testConfig, dHandler, "dnode-" + this.getClass().getName() + "-1");
    //
    DNodeService.Client client = DNodeClient.get("localhost", testConfig.getInt(DNodeProperties.PORT));

    try {
      DeployAction deploy = new DeployAction();
      deploy.setTablespace("tablespace3");
      deploy.setDataURI("file:///foo");
      deploy.setPartition(0);
      deploy.setVersion(1l);
      deploy.setMetadata(new PartitionMetadata());
      client.deploy(Arrays.asList(new DeployAction[] { deploy }), 1l);
      waitForDeployToFinish(client);

      Assert.assertEquals(true, dHandler.lastDeployTimedout.get());
      Assert.assertEquals(false, dHandler.deployInProgress.get() > 0);
View Full Code Here

    DNode dnode = TestUtils.getTestDNode(testConfig, dHandler, "dnode-" + this.getClass().getName() + "-2");
    //
    DNodeService.Client client = DNodeClient.get("localhost", testConfig.getInt(DNodeProperties.PORT));

    try {
      DeployAction deploy = new DeployAction();
      deploy.setTablespace("tablespace1");
      deploy.setDataURI(new File(DB_1 + ".1", "foo.db").toURI().toString());
      deploy.setPartition(0);
      deploy.setVersion(1l);
      deploy.setMetadata(new PartitionMetadata());
      client.deploy(Arrays.asList(new DeployAction[] { deploy }), 1l);
     
      Thread.sleep(1000);
      waitForDeployToFinish(client);

      Thread.sleep(200);
     
      Assert.assertEquals(false, dHandler.lastDeployTimedout.get());
      Assert.assertEquals(false, dHandler.deployInProgress.get() > 0);

      client.sqlQuery("tablespace1", 1l, 0, "SELECT 1;");
      Assert.assertEquals(dHandler.dbCache.getKeysWithExpiryCheck().size(), 1);

      deploy = new DeployAction();
      deploy.setTablespace("tablespace1");
      deploy.setDataURI(new File(DB_2 + ".1", "foo.db").toURI().toString());
      deploy.setPartition(0);
      deploy.setVersion(2l);
      deploy.setMetadata(new PartitionMetadata());
      client.deploy(Arrays.asList(new DeployAction[] { deploy }), 2l);
     
      Thread.sleep(1000);
      waitForDeployToFinish(client);
View Full Code Here

    DNode dnode = TestUtils.getTestDNode(testConfig, dHandler, "dnode-" + this.getClass().getName() + "-3");
    //
    DNodeService.Client client = DNodeClient.get("localhost", testConfig.getInt(DNodeProperties.PORT));

    try {
      DeployAction deploy = new DeployAction();
      deploy.setTablespace("tablespace1");
      deploy.setDataURI(new File(DB_1 + ".2", "foo.db").toURI().toString());
      deploy.setVersion(1l);
      deploy.setPartition(0);
      deploy.setMetadata(new PartitionMetadata());
      client.deploy(Arrays.asList(new DeployAction[] { deploy }), 1l);
      waitForDeployToFinish(client);

      Thread.sleep(200);
     
      Assert.assertEquals(false, dHandler.lastDeployTimedout.get());
      Assert.assertEquals(false, dHandler.deployInProgress.get() > 0);

      deploy = new DeployAction();
      deploy.setTablespace("tablespace1");
      deploy.setDataURI(new File(DB_2 + ".2", "foo.db").toURI().toString());
      deploy.setVersion(2l);
      deploy.setPartition(0);
      deploy.setMetadata(new PartitionMetadata());
      client.deploy(Arrays.asList(new DeployAction[] { deploy }), 2l);
      waitForDeployToFinish(client);

      ArrayList resultsV1 = JSONSerDe.deSer(client.sqlQuery("tablespace1", 1l, 0, "SELECT * FROM t;"),
          ArrayList.class);
View Full Code Here

    DNodeHandler dHandler = new DNodeHandler();
    DNode dnode = TestUtils.getTestDNode(testConfig, dHandler, dataFolder);
    //
    DNodeService.Client client = DNodeClient.get("localhost", testConfig.getInt(DNodeProperties.PORT));
    try {
      DeployAction deploy = new DeployAction();
      deploy.setTablespace("tablespace2");
      TestUtils.createFooDatabase(FOO_DEPLOY_FOLDER, 1, "foo");
      deploy.setDataURI(new File(FOO_DEPLOY_FOLDER, "foo.db").toURI().toString());
      deploy.setPartition(0);
      deploy.setVersion(1l);
      deploy.setMetadata(new PartitionMetadata());
      client.deploy(Arrays.asList(new DeployAction[] { deploy }), 1l);
      waitForDeployToFinish(client);
      Thread.sleep(200);
      File expectedDataFolder = dHandler.getLocalStorageFolder("tablespace2", 0, 1);
      Assert.assertTrue(expectedDataFolder.exists());
View Full Code Here

TOP

Related Classes of com.splout.db.thrift.DeployAction

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.