Examples of DNodeInfo


Examples of com.splout.db.hazelcast.DNodeInfo

      CoordinationStructures coord = new CoordinationStructures(hz);

      SploutConfiguration dNodeConfig = SploutConfiguration.getTestConfig();
      dNodeConfig.setProperty(DNodeProperties.PORT, 1000);

      coord.getDNodes().put("/localhost:1000", new DNodeInfo(dNodeConfig));

      dNodeConfig = SploutConfiguration.getTestConfig();
      dNodeConfig.setProperty(DNodeProperties.PORT, 1001);

      coord.getDNodes().put("/localhost:1001", new DNodeInfo(dNodeConfig));

      try {
        handler.init(config);
      } catch(Exception e) {
        // since the handler will try to connect to "localhost:1000" we skip the Exception and continue
View Full Code Here

Examples of com.splout.db.hazelcast.DNodeInfo

    HazelcastInstance hz = Hazelcast.newHazelcastInstance(HazelcastConfigBuilder.build(config));
    try {
      CoordinationStructures coord = new CoordinationStructures(hz);
      SploutConfiguration dNodeConfig = SploutConfiguration.getTestConfig();
      dNodeConfig.setProperty(DNodeProperties.PORT, 1000);
      coord.getDNodes().put("/localhost:1000", new DNodeInfo(dNodeConfig));

      try {
        handler.init(config);
      } catch(Exception e) {
        // since the handler will try to connect to "localhost:1000" we skip the Exception and continue
        // the things we want to assert should be present anyway.
      }
      Assert.assertEquals(handler.getContext().getCoordinationStructures().getDNodes().values().size(),
          1);

      coord.getDNodes().remove(coord.getDNodes().entrySet().iterator().next().getKey());

      Thread.sleep(100);
      Assert.assertEquals(handler.getContext().getCoordinationStructures().getDNodes().values().size(),
          0);

      dNodeConfig = SploutConfiguration.getTestConfig();
      dNodeConfig.setProperty(DNodeProperties.PORT, 1001);
      coord.getDNodes().put("/localhost:1001", new DNodeInfo(dNodeConfig));
      Thread.sleep(100);

      Assert.assertEquals(handler.getContext().getCoordinationStructures().getDNodes().values().size(),
          1);

      dNodeConfig = SploutConfiguration.getTestConfig();
      dNodeConfig.setProperty(DNodeProperties.PORT, 1000);
      coord.getDNodes().put("/localhost:1000", new DNodeInfo(dNodeConfig));
      Thread.sleep(100);

      Assert.assertEquals(handler.getContext().getCoordinationStructures().getDNodes().values().size(),
          2);
View Full Code Here

Examples of com.splout.db.hazelcast.DNodeInfo

              metadata.setNReplicas(2);
              writer.write(metadata);
              writer.close();
              new File(getLocalStorageFolder("t1", 0, version), "0.db").createNewFile();
              // promote info to Hazelcast
              getDnodesRegistry().changeInfo(new DNodeInfo(config));
            } catch(IOException e) {
              e.printStackTrace();
              throw new RuntimeException(e);
            }
            // countdown for finishing deployment
View Full Code Here

Examples of com.splout.db.hazelcast.DNodeInfo

  @Override
  public void giveGreenLigth() {
    int minutesToCheckRegister = config.getInt(HazelcastProperties.MAX_TIME_TO_CHECK_REGISTRATION, 5);
    int oldestMembersLeading = config.getInt(HazelcastProperties.OLDEST_MEMBERS_LEADING_COUNT, 3);

    dnodesRegistry = new DistributedRegistry(CoordinationStructures.DNODES, new DNodeInfo(config), hz,
        minutesToCheckRegister, oldestMembersLeading);
    dnodesRegistry.register();
  }
View Full Code Here

Examples of com.splout.db.hazelcast.DNodeInfo

                  executor.shutdown();

                  // Publish new DNodeInfo in distributed registry.
                  // This makes QNodes notice that a new version is available...
                  // PartitionMap and ReplicationMap will be built incrementally as DNodes finish.
                  dnodesRegistry.changeInfo(new DNodeInfo(config));

                  long end = System.currentTimeMillis();
                  log.info("Local deploy actions [" + deployActions + "] successfully finished in "
                      + (end - start) + " ms.");
                  deployInProgress.decrementAndGet();
View Full Code Here

Examples of com.splout.db.hazelcast.DNodeInfo

    }
    try {
      // Publish new DNodeInfo in distributed registry.
      // This makes QNodes notice that a new version is available...
      // PartitionMap and ReplicationMap will be built incrementally as DNodes finish.
      dnodesRegistry.changeInfo(new DNodeInfo(config));
      return JSONSerDe.ser(new DNodeStatusResponse("Ok. Delete old versions executed."));
    } catch(JSONSerDeException e) {
      unexpectedException(e);
      throw new DNodeException(EXCEPTION_UNEXPECTED, e.getMessage());
    }
View Full Code Here

Examples of com.splout.db.hazelcast.DNodeInfo

              FileUtils.moveToDirectory(binaryToMove,
                  getLocalStorageFolder(tablespace, partition, version), true);
              log.info("Balance action successfully completed, received both .db and .meta files ("
                  + tablespace + ", " + partition + ", " + version + ")");
              // Publish new changes to HZ
              dnodesRegistry.changeInfo(new DNodeInfo(config));
            } catch(IOException e) {
              log.error(e);
            } finally {
              removeBalanceActionFromHZPanel(tablespace, partition, version);
            }
View Full Code Here

Examples of com.splout.db.hazelcast.DNodeInfo

      // Assert that this DNode is registered for failover
      HazelcastInstance hz = Hazelcast.newHazelcastInstance(HazelcastConfigBuilder.build(testConfig));
      final CoordinationStructures coord = new CoordinationStructures(hz);
      // We need to implement the {@link com.splout.db.hazelcast.DistributedRegistry} for members to be
      // automatically removed from the DNODES map
      new DistributedRegistry(CoordinationStructures.DNODES, new DNodeInfo(testConfig), hz, 10, 3);

      new TestUtils.NotWaitingForeverCondition() {
        @Override
        public boolean endCondition() {
          boolean registered = false;
View Full Code Here

Examples of com.splout.db.hazelcast.DNodeInfo

      }
      servingInfo.get(tablespace).get(version).put(partition, metadata);
    }
   
    public DNodeInfo getDNodeInfo() {
      return new DNodeInfo(address, httpAddress, servingInfo);
    }
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.