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

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


  protected void doPut(HttpServletRequest request, HttpServletResponse response)
      throws ServletException, IOException {
    try {
      byte[][] pathSegments = getPathSegments(request);
      if(pathSegments.length == 0) {
        throw new HBaseRestException("method not supported");
      } else if (pathSegments.length == 1 && pathSegments[0].length > 0) {
        // if it has only table name
        Status s = createStatus(request, response);
        Map<String, String[]> queryMap = request.getParameterMap();
        IHBaseRestParser parser = this.getParser(request);
View Full Code Here


      Status s = createStatus(request, response);
      byte[][] pathSegments = getPathSegments(request);
      Map<String, String[]> queryMap = request.getParameterMap();
     
      if(pathSegments.length == 0) {
        throw new HBaseRestException("method not supported");
      } else if (pathSegments.length == 1 && pathSegments[0].length > 0) {
        // if it only has only table name
        tableController.delete(s, pathSegments, queryMap);
        return;
      } else if (pathSegments.length >= 3 && pathSegments[0].length > 0) {
View Full Code Here

          break;
        }
      }
      return Bytes.toBytes(resultant.trim());
    } catch (Exception e) {
      throw new HBaseRestException(e);
    }
  }
View Full Code Here

      this.serializeRowResultArray((RowResult[]) o);
    } else if (o.getClass().isArray()
        && o.getClass().getComponentType() == Cell.class) {
      this.serializeCellArray((Cell[]) o);
    } else {
      throw new HBaseRestException(
          "Object does not conform to the ISerializable "
              + "interface.  Unable to generate xml output.");
    }
  }
View Full Code Here

    public AbstractPrinter(HttpServletResponse response)
        throws HBaseRestException {
      try {
        writer = response.getWriter();
      } catch (IOException e) {
        throw new HBaseRestException(e.getMessage(), e);
      }
    }
View Full Code Here

    try {
      builder = docBuilderFactory.newDocumentBuilder();
      ByteArrayInputStream is = new ByteArrayInputStream(input);
      doc = builder.parse(is);
    } catch (Exception e) {
      throw new HBaseRestException(e);
    }

    try {
      Node name_node = doc.getElementsByTagName("name").item(0);
      String table_name = name_node.getFirstChild().getNodeValue();

      htd = new HTableDescriptor(table_name);
      NodeList columnfamily_nodes = doc.getElementsByTagName("columnfamily");
      for (int i = 0; i < columnfamily_nodes.getLength(); i++) {
        Element columnfamily = (Element) columnfamily_nodes.item(i);
        htd.addFamily(this.getColumnDescriptor(columnfamily));
      }
    } catch (Exception e) {
      throw new HBaseRestException(e);
    }
    return htd;
  }
View Full Code Here

    try {
      builder = docBuilderFactory.newDocumentBuilder();
      ByteArrayInputStream is = new ByteArrayInputStream(input);
      doc = builder.parse(is);
    } catch (Exception e) {
      throw new HBaseRestException(e);
    }

    NodeList columnfamily_nodes = doc.getElementsByTagName("columnfamily");
    for (int i = 0; i < columnfamily_nodes.getLength(); i++) {
      Element columnfamily = (Element) columnfamily_nodes.item(i);
View Full Code Here

    try {
      builder = docBuilderFactory.newDocumentBuilder();
      ByteArrayInputStream is = new ByteArrayInputStream(input);
      doc = builder.parse(is);
    } catch (Exception e) {
      throw new HBaseRestException(e.getMessage(), e);
    }

    NodeList cell_nodes = doc.getElementsByTagName(RESTConstants.COLUMN);
    System.out.println("cell_nodes.length: " + cell_nodes.getLength());
    for (int i = 0; i < cell_nodes.getLength(); i++) {
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.