Package com.splout.db.dnode

Examples of com.splout.db.dnode.IDNodeHandler


 
  @Test
  public void testRoundRobin() throws Throwable {
    SploutConfiguration testConfig = SploutConfiguration.getTestConfig();
    // A handler that returns OK to any query
    IDNodeHandler okQueryHandler = new IDNodeHandler() {
      @Override
      public void init(SploutConfiguration config) throws Exception {
      }
      @Override
      public void giveGreenLigth() {
View Full Code Here


 
  @Test
  public void testRoundRobinWithSomeDeadNodes() throws Throwable {
    SploutConfiguration testConfig = SploutConfiguration.getTestConfig();
    // A handler that returns OK to any query
    IDNodeHandler okQueryHandler = new IDNodeHandler() {
      @Override
      public void init(SploutConfiguration config) throws Exception {
      }
      @Override
      public void giveGreenLigth() {
View Full Code Here

  @Test
  public void testRoundRobinWithSomeFailingNodes() throws Throwable {
    SploutConfiguration testConfig = SploutConfiguration.getTestConfig();
    // A handler that returns OK to any query
    IDNodeHandler okQueryHandler = new IDNodeHandler() {
      @Override
      public void init(SploutConfiguration config) throws Exception {
      }
      @Override
      public void giveGreenLigth() {
View Full Code Here

  @Test
  public void testMultiDeployFiring() throws Throwable {
    // Same as test deploy firing, but with more than one DNode and different deploy actions
    SploutConfiguration config1 = SploutConfiguration.getTestConfig();

    DNode dnode1 = TestUtils.getTestDNode(config1, new IDNodeHandler() {
      @Override
      public void init(SploutConfiguration config) throws Exception {
      }

      @Override
      public String sqlQuery(String tablespace, long version, int partition, String query)
          throws DNodeException {
        return null;
      }

      @Override
      public String deploy(List<DeployAction> deployActions, long distributedBarrier)
          throws DNodeException {
        /*
         * DNode1 asserts
         */
        Assert.assertEquals(2, deployActions.size());
        Assert.assertEquals("hdfs://foo/bar1/0.db", deployActions.get(0).getDataURI());
        Assert.assertEquals("hdfs://foo/bar2/0.db", deployActions.get(1).getDataURI());
        Assert.assertEquals("partition1", deployActions.get(0).getTablespace());
        Assert.assertEquals("partition2", deployActions.get(1).getTablespace());
        return "FOO";
      }

      @Override
      public String rollback(List<RollbackAction> rollbackActions, String ignoreMe)
          throws DNodeException {
        return null;
      }

      @Override
      public String status() throws DNodeException {
        return null;
      }

      @Override
      public void stop() throws Exception {
      }

      @Override
      public void giveGreenLigth() {
      }

      @Override
      public String abortDeploy(long version) throws DNodeException {
        return null;
      }

      @Override
      public String deleteOldVersions(List<com.splout.db.thrift.TablespaceVersion> versions)
          throws DNodeException {
        return null;
      }

      @Override
      public String testCommand(String command) throws DNodeException {
        // TODO Auto-generated method stub
        return null;
      }
    }, "dnode-" + this.getClass().getName() + "-3");

    SploutConfiguration config2 = SploutConfiguration.getTestConfig();
    DNode dnode2 = TestUtils.getTestDNode(config2, new IDNodeHandler() {
      @Override
      public void init(SploutConfiguration config) throws Exception {
      }

      @Override
View Full Code Here

    // Test the business logic that produces the firing of the deployment (not the continuation of it) For that, we will
    // use dummy DNodeHandlers
    QNodeHandler handler = new QNodeHandler();
    SploutConfiguration config = SploutConfiguration.getTestConfig();

    DNode dnode = TestUtils.getTestDNode(config, new IDNodeHandler() {
      @Override
      public void init(SploutConfiguration config) throws Exception {
      }

      @Override
View Full Code Here

TOP

Related Classes of com.splout.db.dnode.IDNodeHandler

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.