Package org.hivedb.meta

Examples of org.hivedb.meta.Node


  private Pair<Node, Node> initializeTestData(Hive hive, String primaryKey, Integer secondaryKey) throws Exception {
    hive.directory().insertPrimaryIndexKey(primaryKey);
    //Setup the test data on one node
    NodeResolver dir = new DbDirectory(hive.getPartitionDimension(), getDataSource(getConnectString(getHiveDatabaseName())));
    int originId = Atom.getFirst(dir.getKeySemamphoresOfPrimaryIndexKey(primaryKey)).getNodeId();
    Node origin = hive.getNode(originId);
    Node destination = origin.getName().equals("data1") ? hive.getNode("data2") :
      hive.getNode("data1");
    PartitionKeyMover<String> pMover = new PrimaryMover(origin.getUri());
    Mover<Integer> secMover = new SecondaryMover();
    pMover.copy(primaryKey, origin);
    secMover.copy(secondaryKey, origin);
View Full Code Here


    hive.directory().insertPrimaryIndexKey(asia);
    final WeatherReportImpl report = new WeatherReportImpl();
    report.setContinent(asia);
    Session session = factory.openSession(asia);
    try {
      Node node = getNodeForFirstId(hive, hive.directory().getNodeIdsOfPrimaryIndexKey(asia));
      assertCorrectNode(session, node);
    } catch (Exception e) {
      fail(e.getMessage());
    } finally {
      session.close();
View Full Code Here

    hive.directory().insertResourceId("WeatherReport", id, asia);
    final WeatherReportImpl report = new WeatherReportImpl();
    report.setContinent(asia);
    Session session = factory.openSession("WeatherReport", id);
    try {
      Node node = getNodeForFirstId(hive, hive.directory().getNodeIdsOfResourceId("WeatherReport", id));
      assertCorrectNode(session, node);
    } catch (Exception e) {
      fail(e.getMessage());
    } finally {
      session.close();
View Full Code Here

    final WeatherReportImpl report = new WeatherReportImpl();
    report.setContinent(asia);
    Session session = factory.openSession("WeatherReport", "RegionCode", code);
    try {
      Node node = getNodeForFirstId(hive, hive.directory().getNodeIdsOfSecondaryIndexKey("WeatherReport", "RegionCode", code));
      assertCorrectNode(session, node);
    } catch (Exception e) {
      fail(e.getMessage());
    } finally {
      session.close();
View Full Code Here

    hive.directory().insertPrimaryIndexKey(asia);
    final WeatherReportImpl report = new WeatherReportImpl();
    report.setContinent(asia);
    Session session = factory.openSession(asia);
    try {
      Node node = getNodeForFirstId(hive, hive.directory().getNodeIdsOfPrimaryIndexKey(asia));
      assertTrue("Opened a session to the wrong node", node.getUri().startsWith(RecordNodeOpenSessionEvent.getNode()));
    } catch (Exception e) {
      e.printStackTrace();
      fail("Exception thrown: " + e.getMessage());
    } finally {
      session.close();
View Full Code Here

    report.setContinent(asia);
    Session session = factory.openSession();
    report.setReportId(88);
    try {
      session.save(report);
      Node node = getNodeForFirstId(hive, hive.directory().getNodeIdsOfPrimaryIndexKey(asia));
      assertTrue("Opened a session to the wrong node", node.getUri().startsWith(RecordNodeOpenSessionEvent.getNode()));
    } catch (Exception e) {
      e.printStackTrace();
      fail("Exception thrown: " + e.getMessage());
    } finally {
      session.close();
View Full Code Here

    Session session = null;
    try {
      session = factory.openSession(asia);
      Collection<Integer> nodeIds = hive.directory().getNodeIdsOfPrimaryIndexKey(asia);
      assertEquals(2, nodeIds.size());
      Node node = getNodeForFirstId(hive, nodeIds);
      assertCorrectNode(session, node);
      fail("No exception thrown");
    } catch (IllegalStateException e) {

    } finally {
View Full Code Here

TOP

Related Classes of org.hivedb.meta.Node

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.