Package com.splout.db.common

Examples of com.splout.db.common.SploutConfiguration


    }
  }

  @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 {
      }
View Full Code Here


  @Test
  public void testQuery() throws Throwable {
    QNodeHandler handler = new QNodeHandler();
    handler.init(SploutConfiguration.getTestConfig());
   
    SploutConfiguration config1 = SploutConfiguration.getTestConfig();
    SploutConfiguration config2 = SploutConfiguration.getTestConfig();
    config2.setProperty(DNodeProperties.DATA_FOLDER, config1.getString(DNodeProperties.DATA_FOLDER) + "-" + 1);
   
    DNode dnode1 = TestUtils.getTestDNode(config1, failingDHandler, "dnode-" + this.getClass().getName() + "-1");
    DNode dnode2 = TestUtils.getTestDNode(config2, dHandler, "dnode-" + this.getClass().getName() + "-2");

    try {
View Full Code Here

  @Test
  public void testVersionRotation() throws Throwable {
    // Test that QNodeHandler reads the version list for each tablespace.
    // We will create more versions that needed to assert that QNode deletes the unneeded ones.
    QNodeHandler handler = new QNodeHandler();
    SploutConfiguration config = SploutConfiguration.getTestConfig();
    handler.init(config);
    config.setProperty(QNodeProperties.VERSIONS_PER_TABLESPACE, 5);
    try {

      HazelcastInstance hz = Hazelcast.newHazelcastInstance(HazelcastConfigBuilder.build(config));
      CoordinationStructures coord = new CoordinationStructures(hz);
     
View Full Code Here

  @Test
  public void testQueryVersioning() throws Throwable {
    TestUtils.createFooDatabase(DB_1 + ".2", 1, "foo1");
    TestUtils.createFooDatabase(DB_2 + ".2", 2, "foo2");

    SploutConfiguration testConfig = SploutConfiguration.getTestConfig();
    DNodeHandler dHandler = new DNodeHandler();
    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());
View Full Code Here

  }

  // simple test asserting that deploy finishes correctly and the data is there
  @Test
  public void testLocalDeploy() throws Throwable {
    SploutConfiguration testConfig = SploutConfiguration.getTestConfig();
    String dataFolder = "dnode-" + this.getClass().getName() + "-4";

    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());
View Full Code Here

        manager.query("INSERT INTO foo VALUES (" + j + ", " + "'" + randomStr + "');", 100);
      }
      manager.close();
    }

    SploutConfiguration config = SploutConfiguration.getTestConfig();
    SploutClient client = getRandomQNodeClient(random, config);
    client.deploy("p1", testTablespace.getPartitionMap(), testTablespace.getReplicationMap(),
        deployData.getAbsoluteFile().toURI());

    Thread.sleep(2000); // TODO How to improve this.
View Full Code Here

  }

  @Test
  public void test() throws TablespaceVersionInfoException {

    SploutConfiguration config = SploutConfiguration.getTestConfig();

    PartitionMetadata metadata3Replicas = new PartitionMetadata();
    metadata3Replicas.setNReplicas(3);
    PartitionMetadata metadata1Replicas = new PartitionMetadata();
    metadata1Replicas.setNReplicas(1);
View Full Code Here

  }

  @Test
  public void testDeployFinalizing() throws Throwable {
    QNodeHandler handler = new QNodeHandler();
    SploutConfiguration config = SploutConfiguration.getTestConfig();
    SploutConfiguration config1 = SploutConfiguration.getTestConfig();
    SploutConfiguration config2 = SploutConfiguration.getTestConfig();
    // since #12 and #7 we must disable replica balancing which is enabled for testing to fail the deploy
    config.setProperty(QNodeProperties.REPLICA_BALANCE_ENABLE, false);
    config.setProperty(QNodeProperties.DEPLOY_SECONDS_TO_CHECK_ERROR, 1); // this has to be quick for testing
    DNodeHandler dHandler = new DNodeHandler();
    DNode dnode1 = TestUtils
View Full Code Here

  /**
   * Test that the DNode receives "delete" events and it deletes the local storage
   */
  @Test
  public void testHandleDeleteEventAfterCreation() throws Throwable {
    SploutConfiguration testConfig = SploutConfiguration.getTestConfig();
    DNode dnode = null;
    DNodeHandler handler = new DNodeHandler();
    File dataFolder = new File("dnode-" + this.getClass().getName() + "-1");
    try {
      // First we create the DNode
View Full Code Here

  /*
   * Test membership registering
   */
  @Test
  public void testHZRegister() throws Throwable {
    SploutConfiguration testConfig = SploutConfiguration.getTestConfig();
    DNode dnode = null;
    try {
      final DNodeHandler handler = new DNodeHandler();
      dnode = TestUtils.getTestDNode(testConfig, handler, "dnode-" + this.getClass().getName() + "-4", true);

View Full Code Here

TOP

Related Classes of com.splout.db.common.SploutConfiguration

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.