Package org.hivedb.management

Examples of org.hivedb.management.HiveConfigurationSchemaInstaller


    this(dimension, dataSourceProvider, HiveDbDialect.H2);
  }

  public BourneHive(Map<String, String> dimension, HiveDataSourceProvider dataSourceProvider, HiveDbDialect dialect) {
    this.dialect = dialect;
    new HiveConfigurationSchemaInstaller(DialectTools.getHiveTestUri(dialect)).run();
    String name = dimension.get("name");
    int type = JdbcTypeMapper.parseJdbcType(stringToVarchar(dimension.get("type")));
    hive = Hive.create(DialectTools.getHiveTestUri(dialect), name, type, dataSourceProvider, null);
  }
View Full Code Here


    EntityConfig prototype = Atom.getFirstOrThrow(hiveConfigs.values());
    return new PluralHiveConfig(hiveConfigs, prototype.getPartitionDimensionName(), prototype.getPrimaryKeyClass());
  }

  public void install(String uri) {
    new HiveConfigurationSchemaInstaller(uri).run();
    install(Hive.load(uri, CachingDataSourceProvider.getInstance()));
  }
View Full Code Here

  @Override
  public void beforeMethod() {
    deleteDatabasesAfterEachTest = true;
    super.afterMethod();
    super.beforeMethod();
    new HiveConfigurationSchemaInstaller(getConnectString(H2TestCase.TEST_DB)).run();
    hive = Hive.load(getConnectString(H2TestCase.TEST_DB), CachingDataSourceProvider.getInstance());
  }
View Full Code Here

  }

  @Test
  public void createAndUseTheHive() throws Exception {
    // Install The Hive Metadata Schema
    new HiveConfigurationSchemaInstaller(getConnectString(H2TestCase.TEST_DB)).run();

    //Create a Partition Dimension
    //We are going to partition our Product domain using the product type string.
    String dimensionName = "ProductType";
View Full Code Here

  @Before
  public void beforeMethod() {
    this.deleteDatabasesAfterEachTest = true;
    super.afterMethod();
    super.beforeMethod();
    new HiveConfigurationSchemaInstaller(uri()).run();
    Hive.create(uri(), "split", Types.INTEGER, CachingDataSourceProvider.getInstance(), null);
  }
View Full Code Here

      new IndexSchema(createPopulatedPartitionDimension())});
  }

  private void prepare() {
    try {
      new HiveConfigurationSchemaInstaller(getConnectString(H2TestCase.TEST_DB)).run();
      Hive hive = Hive.create(getConnectString(H2TestCase.TEST_DB), partitionDimensionName(), Types.INTEGER, CachingDataSourceProvider.getInstance(), null);
      dimension = createPopulatedPartitionDimension();
      dimension.setId(hive.getPartitionDimension().getId());
      hive.setPartitionDimension(dimension);
      resource = Atom.getFirstOrThrow(dimension.getResources());
View Full Code Here

    assertEquals(asia.getPopulation(), Atom.getFirst(Atom.getFirst(indexes).getIndexValues(asia)));
  }

  @Test
  public void testInstallWithPartitionDimensionInstalled() throws Exception {
    new HiveConfigurationSchemaInstaller(getConnectString(H2TestCase.TEST_DB)).run();
    Hive hive = Hive.create(getConnectString(H2TestCase.TEST_DB), WeatherReport.CONTINENT, Types.VARCHAR, org.hivedb.meta.persistence.CachingDataSourceProvider.getInstance(), null);
    ConfigurationReader reader = new ConfigurationReader(WeatherReport.class);
    reader.install(hive);
    EntityConfig config = reader.getEntityConfig(WeatherReport.class.getName());
    assertNotNull(hive.getPartitionDimension().getResource(config.getResourceName()));
View Full Code Here

    assertEquals(Types.INTEGER, Atom.getFirst(hive.getPartitionDimension().getResource(config.getResourceName()).getSecondaryIndexes()).getColumnInfo().getColumnType());
  }

  @Test
  public void testInstallPartitioningResourceWithPartitionDimensionInstalled() throws Exception {
    new HiveConfigurationSchemaInstaller(getConnectString(H2TestCase.TEST_DB)).run();
    Hive hive = Hive.create(getConnectString(H2TestCase.TEST_DB), WeatherReport.CONTINENT, Types.VARCHAR, CachingDataSourceProvider.getInstance(), null);
    ConfigurationReader reader = new ConfigurationReader(Continent.class);
    reader.install(hive);
    EntityConfig config = reader.getEntityConfig(Continent.class.getName());
    assertNotNull(hive.getPartitionDimension().getResource(config.getResourceName()));
View Full Code Here

    assertEquals("population", Atom.getFirst(hive.getPartitionDimension().getResource(config.getResourceName()).getSecondaryIndexes()).getName());
  }

  @Test
  public void testInstallWithoutPartitionDimension() throws Exception {
    new HiveConfigurationSchemaInstaller(getConnectString(H2TestCase.TEST_DB)).run();
    ConfigurationReader reader = new ConfigurationReader(WeatherReport.class);
    reader.install(getConnectString(H2TestCase.TEST_DB));
    EntityConfig config = reader.getEntityConfig(WeatherReport.class.getName());
    Hive hive = Hive.load(getConnectString(H2TestCase.TEST_DB), CachingDataSourceProvider.getInstance());
    assertNotNull(hive.getPartitionDimension().getResource(config.getResourceName()));
View Full Code Here

    assertEquals(Types.INTEGER, Atom.getFirst(hive.getPartitionDimension().getResource(config.getResourceName()).getSecondaryIndexes()).getColumnInfo().getColumnType());
  }

  @Test
  public void testInstallPartitioningResourceWithoutPartitionDimension() throws Exception {
    new HiveConfigurationSchemaInstaller(getConnectString(H2TestCase.TEST_DB)).run();
    ConfigurationReader reader = new ConfigurationReader(Continent.class);
    reader.install(getConnectString(H2TestCase.TEST_DB));
    EntityConfig config = reader.getEntityConfig(Continent.class.getName());
    Hive hive = Hive.load(getConnectString(H2TestCase.TEST_DB), CachingDataSourceProvider.getInstance());
View Full Code Here

TOP

Related Classes of org.hivedb.management.HiveConfigurationSchemaInstaller

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.