Package org.apache.hadoop.hbase.rest.exception

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


        a.add(r);
      }

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

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

 
  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

 
  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

      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

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

      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

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

        this.admin.deleteTable(tableName);
        return true;
      }
      return false;
    } catch (Exception e) {
      throw new HBaseRestException(e);
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.rest.exception.HBaseRestException

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.