Package org.hivedb.meta.persistence

Examples of org.hivedb.meta.persistence.TableInfo


    return "hive_resource_" + resource.getName().toLowerCase()
  }
 
  public static Collection<TableInfo> getTables(PartitionDimension partitionDimension) {
    Collection<TableInfo> TableInfos = new ArrayList<TableInfo>();
    TableInfos.add(new TableInfo(getPrimaryIndexTableName(partitionDimension), getCreatePrimaryIndex(partitionDimension)));
    for (Resource resource : partitionDimension.getResources()) {
      if (!resource.isPartitioningResource())
        TableInfos.add(new TableInfo(getResourceIndexTableName(resource), getCreateResourceIndex(resource, partitionDimension)));
      for (SecondaryIndex secondaryIndex : resource.getSecondaryIndexes())
        TableInfos.add(new TableInfo(
            getSecondaryIndexTableName(secondaryIndex),
            getCreateSecondaryIndex(secondaryIndex, partitionDimension)));
    }
    return TableInfos;
  }
View Full Code Here


  private ContinentalSchema() {
    super("Continent");
  }

  public Collection<TableInfo> getTables(String uri) {
    return Arrays.asList(new TableInfo("CONTINENT", "CREATE TABLE CONTINENT (" +
        "NAME VARCHAR(64) NOT NULL PRIMARY KEY," +
        "POPULATION INT);")
    );
  }
View Full Code Here

  }

  @Override
  public Collection<TableInfo> getTables(String uri) {
    Collection<TableInfo> TableInfos = new ArrayList<TableInfo>();
    TableInfos.add(new TableInfo("semaphore_metadata", getCreateHive()));
    TableInfos.add(new TableInfo("node_metadata", getCreateNode()));
    TableInfos.add(new TableInfo("partition_dimension_metadata", getCreatePartitionDimension()));
    TableInfos.add(new TableInfo("secondary_index_metadata", getCreateSecondaryIndex()));
    TableInfos.add(new TableInfo("resource_metadata", getCreateResource()));
    return TableInfos;
  }
View Full Code Here

    super("WeatherReport");
  }

  @Override
  public Collection<TableInfo> getTables(String uri) {
    return Arrays.asList(new TableInfo("WEATHER_REPORT", "CREATE TABLE WEATHER_REPORT (" +
    "REPORT_ID VARCHAR(50) NOT NULL PRIMARY KEY," +
    "CONTINENT VARCHAR(50)," +
    "REGION_CODE INT," +
    "LATITUDE DOUBLE," +
    "LONGITUDE DOUBLE," +
    "TEMPERATURE INT," +
    "TYPE VARCHAR(255)," +
    "REPORT_TIME TIMESTAMP);"),
      // Demonstrates a primitive indexed collection
      new TableInfo("WEATHER_REPORT_SOURCE", "CREATE TABLE WEATHER_REPORT_SOURCE (" +
          "REPORT_ID INT NOT NULL ," +
          "SOURCE INT);"),
      // Demonstrates a complex indexed collection (one-to-many)
      new TableInfo("WEATHER_EVENT", "CREATE TABLE WEATHER_EVENT (" +
            "EVENT_ID INT NOT NULL ," +
            "REPORT_ID INT NOT NULL ," +
            "TYPE VARCHAR(255) ," +
            "NAME VARCHAR(50));"),
        // Demonstrates an unindexed data table of an non-entity class (WeatherEvent)
      new TableInfo("EVENT_STATISTIC", "CREATE TABLE EVENT_STATISTIC (" +
            "EVENT_ID INT NOT NULL," +
            "STAT INT);"));
  }
View Full Code Here

    super("Temperature");
  }
 
  @Override
  public Collection<TableInfo> getTables(String uri) {
    return Arrays.asList(new TableInfo("TEMPERATURE", "CREATE TABLE TEMPERATURE (" +
    "TEMPERATURE_ID INT NOT NULL PRIMARY KEY," +
    "CONTINENT VARCHAR(50));"))
  }
View Full Code Here

    }

    @Override
    public Collection<TableInfo> getTables(String uri) {
      return Arrays.asList(
        new TableInfo("primary_table", "create table primary_table (id varchar(50));"),
        new TableInfo("secondary_table", "create table secondary_table (id integer);"));
    }
View Full Code Here

TOP

Related Classes of org.hivedb.meta.persistence.TableInfo

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.