示例#1
0
 private void setEnvironment() {
   envLocation = ConfigManager.getDbDir();
   envConfig = new EnvironmentConfig();
   envConfig.setAllowCreate(true);
   envConfig.setLocking(false);
   myDbEnvironment = new Environment(new File(envLocation), envConfig);
 }
  /* (non-Javadoc)
   * @see edu.buffalo.cse562.Operator#readOneTuple()
   */
  public ScanOperatorPlain(Table table) {

    this.tableName = table.getName();
    this.tableAlias = table.getAlias();

    HashMap<String, ColumnDetail> intSchema = Main.tableMapping.get(this.tableName.toLowerCase());
    this.indexMaps = Main.indexTypeMaps.get(this.tableName.toLowerCase());
    if (intSchema == null) {
      intSchema = Main.tableMapping.get(this.tableName.toUpperCase());
      this.indexMaps = Main.indexTypeMaps.get(this.tableName.toUpperCase());
    }
    this.operatorTableSchema = this.initialiseOperatorTableSchema(intSchema);

    this.dataFile =
        FileSystems.getDefault()
            .getPath(ConfigManager.getDataDir(), tableName.toLowerCase() + ".dat");

    reset();
  }