Package org.hivedb

Examples of org.hivedb.Hive.directory()


  @Test
  public void shouldAddOpenSessionEvents() throws Exception {
    Hive hive = getHive();
    String asia = "Asia";
    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));
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 {
View Full Code Here

  @Test
  public void shouldAddOpenSessionEventsToAllShardsSession() throws Exception {
    Hive hive = getHive();
    String asia = "Asia";
    hive.directory().insertPrimaryIndexKey(asia);
    final WeatherReportImpl report = WeatherReportImpl.generate();
    report.setContinent(asia);
    Session session = factory.openSession();
    report.setReportId(88);
    try {
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 {
View Full Code Here

        will(onConsecutiveCalls(returnValue(hive.getNode(1)), returnValue(hive.getNode(2))));
      }
    });

    String asia = "Asia";
    hive.directory().insertPrimaryIndexKey(asia);
    hive.directory().insertPrimaryIndexKey(asia);

    context.assertIsSatisfied(); //asserts that this is no longer probabalistic

    Session session = null;
View Full Code Here

      }
    });

    String asia = "Asia";
    hive.directory().insertPrimaryIndexKey(asia);
    hive.directory().insertPrimaryIndexKey(asia);

    context.assertIsSatisfied(); //asserts that this is no longer probabalistic

    Session session = null;
    try {
View Full Code Here

    context.assertIsSatisfied(); //asserts that this is no longer probabalistic

    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) {
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.