Examples of HBaseRestException


Examples of org.apache.hadoop.hbase.rest.exception.HBaseRestException

  protected DatabaseMetadata getDatabaseMetadata() throws HBaseRestException {
    DatabaseMetadata databaseMetadata = null;
    try {
      databaseMetadata = new DatabaseMetadata(this.admin);
    } catch (IOException e) {
      throw new HBaseRestException(e);
    }

    return databaseMetadata;
  }
View Full Code Here

Examples of org.apache.hadoop.hbase.rest.exception.HBaseRestException

        a.add(r);
      }

      return a.toArray(new Result[0]);
    } catch (Exception e) {
      throw new HBaseRestException(e);
    }
  }
View Full Code Here

Examples of org.apache.hadoop.hbase.rest.exception.HBaseRestException

  protected boolean doesTableExist(byte [] tableName) throws HBaseRestException {
    try {
      return this.admin.tableExists(tableName);
    } catch (IOException e) {
      throw new HBaseRestException(e);
    }
  }
View Full Code Here

Examples of org.apache.hadoop.hbase.rest.exception.HBaseRestException

 
  protected void disableTable(byte [] tableName) throws HBaseRestException {
    try {
      this.admin.disableTable(tableName);
    } catch (IOException e) {
      throw new HBaseRestException("IOException disabling table", e);
    }
  }
View Full Code Here

Examples of org.apache.hadoop.hbase.rest.exception.HBaseRestException

 
  protected void enableTable(byte [] tableName) throws HBaseRestException {
    try {
      this.admin.enableTable(tableName);
    } catch (IOException e) {
      throw new HBaseRestException("IOException enabiling table", e);
    }
  }
View Full Code Here

Examples of org.apache.hadoop.hbase.rest.exception.HBaseRestException

      ArrayList<HColumnDescriptor> columns) throws HBaseRestException {
    HTableDescriptor htc = null;
    try {
      htc = this.admin.getTableDescriptor(Bytes.toBytes(tableName));
    } catch (IOException e) {
      throw new HBaseRestException("Table does not exist");
    }

    for (HColumnDescriptor column : columns) {
      if (htc.hasFamily(Bytes.toBytes(column.getNameAsString()))) {
        try {
          this.admin.disableTable(tableName);
          this.admin.modifyColumn(tableName, column.getNameAsString(), column);
          this.admin.enableTable(tableName);
        } catch (IOException e) {
          throw new HBaseRestException("unable to modify column "
              + column.getNameAsString(), e);
        }
      } else {
        try {
          this.admin.disableTable(tableName);
          this.admin.addColumn(tableName, column);
          this.admin.enableTable(tableName);
        } catch (IOException e) {
          throw new HBaseRestException("unable to add column "
              + column.getNameAsString(), e);
        }
      }
    }
View Full Code Here

Examples of org.apache.hadoop.hbase.rest.exception.HBaseRestException

      } else {
        return descriptor;
      }
    } catch (IOException e) {
      throw new HBaseRestException("error processing request.");
    }
    return descriptor;
  }
View Full Code Here

Examples of org.apache.hadoop.hbase.rest.exception.HBaseRestException

      Regions regions = new Regions(table.getStartKeys());
      // Presumption is that this.table has already been set against target
      // table
      return regions;
    } catch (IOException e) {
      throw new HBaseRestException("Unable to get regions from table");
    }
  }
View Full Code Here

Examples of org.apache.hadoop.hbase.rest.exception.HBaseRestException

      if (!this.admin.tableExists(tableName)) {
        this.admin.createTable(htd);
        return true;
      }
    } catch (IOException e) {
      throw new HBaseRestException(e);
    }
    return false;
  }
View Full Code Here

Examples of org.apache.hadoop.hbase.rest.exception.HBaseRestException

        this.admin.deleteTable(tableName);
        return true;
      }
      return false;
    } catch (Exception e) {
      throw new HBaseRestException(e);
    }
  }
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.