Package org.hivedb

Examples of org.hivedb.Hive.directory()


        throw new RuntimeException("Can't find WEATHER_REPORT table on node " + node.getUri());
      }
    }
    save(factoryBuilder, report);
    Hive hive = getHive();
    assertTrue(hive.directory().doesResourceIdExist("WeatherReport", report.getReportId()));
    assertTrue(hive.directory().doesResourceIdExist("Temperature", report.getTemperature()));   
  }
 
  @Test
  public void testInsertFail() throws Exception {
View Full Code Here


      }
    }
    save(factoryBuilder, report);
    Hive hive = getHive();
    assertTrue(hive.directory().doesResourceIdExist("WeatherReport", report.getReportId()));
    assertTrue(hive.directory().doesResourceIdExist("Temperature", report.getTemperature()));   
  }
 
  @Test
  public void testInsertFail() throws Exception {
    HiveSessionFactoryBuilderImpl factoryBuilder = getHiveSessionFactoryBuilder();
View Full Code Here

      }
    }
    doInTransactionAndFailBeforeCommit(callback, session);
   
    Hive hive = getHive();
    assertFalse(hive.directory().doesResourceIdExist("WeatherReport", report.getReportId()));
    assertFalse(hive.directory().doesResourceIdExist("Temperature", report.getTemperature()));   
    assertTrue(factoryBuilder.getDefaultInterceptor().isTransient(report));
  }
 
  @Test
View Full Code Here

    }
    doInTransactionAndFailBeforeCommit(callback, session);
   
    Hive hive = getHive();
    assertFalse(hive.directory().doesResourceIdExist("WeatherReport", report.getReportId()));
    assertFalse(hive.directory().doesResourceIdExist("Temperature", report.getTemperature()));   
    assertTrue(factoryBuilder.getDefaultInterceptor().isTransient(report));
  }
 
  @Test
  public void testInsertAndRetrieve() throws Exception {
View Full Code Here

    assertNotNull(asiaIds);
    assertNotNull(reportIds);
    assertTrue(asiaIds.size() > 0);
    assertTrue(reportIds.size() > 0);

    Collection<Integer> nodeIds = hive.directory().getNodeIdsOfPrimaryIndexKey(asia.getName());
    for (ShardId id : asiaIds)
      assertTrue(nodeIds.contains(id.getId()));

    nodeIds = hive.directory().getNodeIdsOfResourceId("WeatherReport", report.getReportId());
    for (ShardId id : reportIds)
View Full Code Here

    Collection<Integer> nodeIds = hive.directory().getNodeIdsOfPrimaryIndexKey(asia.getName());
    for (ShardId id : asiaIds)
      assertTrue(nodeIds.contains(id.getId()));

    nodeIds = hive.directory().getNodeIdsOfResourceId("WeatherReport", report.getReportId());
    for (ShardId id : reportIds)
      assertTrue(nodeIds.contains(id.getId()));
  }
}
View Full Code Here

    Hive hive = getHive();
    HiveInterceptorDecorator interceptor = new HiveInterceptorDecorator(config, hive);

    WeatherReport report = generateInstance();
    Continent asia = new AsiaticContinent();
    hive.directory().insertPrimaryIndexKey(asia.getName());
    hive.directory().insertPrimaryIndexKey(report.getContinent());
    interceptor.postFlush(Arrays.asList(new Object[]{report,asia}).iterator());

    assertTrue(hive.directory().doesResourceIdExist("WeatherReport", report.getReportId()));
    assertTrue(hive.directory().doesResourceIdExist("Temperature", report.getTemperature()));
View Full Code Here

    HiveInterceptorDecorator interceptor = new HiveInterceptorDecorator(config, hive);

    WeatherReport report = generateInstance();
    Continent asia = new AsiaticContinent();
    hive.directory().insertPrimaryIndexKey(asia.getName());
    hive.directory().insertPrimaryIndexKey(report.getContinent());
    interceptor.postFlush(Arrays.asList(new Object[]{report,asia}).iterator());

    assertTrue(hive.directory().doesResourceIdExist("WeatherReport", report.getReportId()));
    assertTrue(hive.directory().doesResourceIdExist("Temperature", report.getTemperature()));
View Full Code Here

    Continent asia = new AsiaticContinent();
    hive.directory().insertPrimaryIndexKey(asia.getName());
    hive.directory().insertPrimaryIndexKey(report.getContinent());
    interceptor.postFlush(Arrays.asList(new Object[]{report,asia}).iterator());

    assertTrue(hive.directory().doesResourceIdExist("WeatherReport", report.getReportId()));
    assertTrue(hive.directory().doesResourceIdExist("Temperature", report.getTemperature()));

    assertTrue(hive.directory().doesPrimaryIndexKeyExist(asia.getName()));
    assertTrue(hive.directory().doesSecondaryIndexKeyExist("Continent", "population", asia.getPopulation(), asia.getName()));
View Full Code Here

    hive.directory().insertPrimaryIndexKey(asia.getName());
    hive.directory().insertPrimaryIndexKey(report.getContinent());
    interceptor.postFlush(Arrays.asList(new Object[]{report,asia}).iterator());

    assertTrue(hive.directory().doesResourceIdExist("WeatherReport", report.getReportId()));
    assertTrue(hive.directory().doesResourceIdExist("Temperature", report.getTemperature()));

    assertTrue(hive.directory().doesPrimaryIndexKeyExist(asia.getName()));
    assertTrue(hive.directory().doesSecondaryIndexKeyExist("Continent", "population", asia.getPopulation(), asia.getName()));

  }
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.