Package org.hivedb

Examples of org.hivedb.Hive.directory()


      for (SecondaryIndex secondaryIndex : secondaryIndexKeyMap.keySet()) {
        for (Object secondaryIndexKeyNum : secondaryIndexKeyMap.get(secondaryIndex)) {
          hive.directory().insertSecondaryIndexKey(secondaryIndex.getResource().getName(), secondaryIndex.getName(), secondaryIndexKeyNum, primaryIndexKey);
        }
      }
      hive.directory().insertSecondaryIndexKey(numIndex.getResource().getName(), numIndex.getName(), secondaryKeyNum, primaryIndexKey);
      assertEquals(1, d.getSecondaryIndexKeysOfResourceId(nameIndex, primaryIndexKey).size());
      assertEquals(secondaryKeyString, Atom.getFirst(d.getSecondaryIndexKeysOfResourceId(nameIndex, primaryIndexKey)));
      assertEquals(1,
        d.getSecondaryIndexKeysOfResourceId(numIndex, primaryIndexKey).size());
      assertEquals(secondaryKeyNum,
View Full Code Here


  @Test
  public void shouldOpenASessionByPrimaryKey() 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));
      assertCorrectNode(session, node);
    } catch (Exception e) {
      fail(e.getMessage());
    } finally {
      session.close();
View Full Code Here

  @Test
  public void shouldOpenASessionByResourceId() throws Exception {
    Hive hive = getHive();
    String asia = "Asia";
    hive.directory().insertPrimaryIndexKey(asia);
    int id = 999;
    hive.directory().insertResourceId("WeatherReport", id, asia);
    final WeatherReportImpl report = new WeatherReportImpl();
    report.setContinent(asia);
    Session session = factory.openSession("WeatherReport", id);
View Full Code Here

  public void shouldOpenASessionByResourceId() throws Exception {
    Hive hive = getHive();
    String asia = "Asia";
    hive.directory().insertPrimaryIndexKey(asia);
    int id = 999;
    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));
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

  @Test
  public void shouldOpenASessionBySecondaryIndex() throws Exception {
    Hive hive = getHive();
    String asia = "Asia";
    int id = 999;
    hive.directory().insertPrimaryIndexKey(asia);
    hive.directory().insertResourceId("WeatherReport", id, asia);
    int code = 765;
    hive.directory().insertSecondaryIndexKey("WeatherReport", "RegionCode", code, id);

    final WeatherReportImpl report = new WeatherReportImpl();
View Full Code Here

  public void shouldOpenASessionBySecondaryIndex() throws Exception {
    Hive hive = getHive();
    String asia = "Asia";
    int id = 999;
    hive.directory().insertPrimaryIndexKey(asia);
    hive.directory().insertResourceId("WeatherReport", id, asia);
    int code = 765;
    hive.directory().insertSecondaryIndexKey("WeatherReport", "RegionCode", code, id);

    final WeatherReportImpl report = new WeatherReportImpl();
    report.setContinent(asia);
View Full Code Here

    String asia = "Asia";
    int id = 999;
    hive.directory().insertPrimaryIndexKey(asia);
    hive.directory().insertResourceId("WeatherReport", id, asia);
    int code = 765;
    hive.directory().insertSecondaryIndexKey("WeatherReport", "RegionCode", code, id);

    final WeatherReportImpl report = new WeatherReportImpl();
    report.setContinent(asia);
    Session session = factory.openSession("WeatherReport", "RegionCode", code);
    try {
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

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.