You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2008/07/23 19:48:47 UTC

svn commit: r679145 - in /hadoop/hbase/trunk: CHANGES.txt src/java/org/apache/hadoop/hbase/rest/TableHandler.java

Author: stack
Date: Wed Jul 23 10:48:47 2008
New Revision: 679145

URL: http://svn.apache.org/viewvc?rev=679145&view=rev
Log:
HBASE-764 The name of column request has padding zero using REST interface

Modified:
    hadoop/hbase/trunk/CHANGES.txt
    hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/rest/TableHandler.java

Modified: hadoop/hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/CHANGES.txt?rev=679145&r1=679144&r2=679145&view=diff
==============================================================================
--- hadoop/hbase/trunk/CHANGES.txt (original)
+++ hadoop/hbase/trunk/CHANGES.txt Wed Jul 23 10:48:47 2008
@@ -209,6 +209,8 @@
    HBASE-761   IOE: Stream closed exception all over logs
    HBASE-763   ClassCastException from RowResult.get(String)
                (Andrew Purtell via Stack)
+   HBASE-764   The name of column request has padding zero using REST interface
+               (Sishen Freecity via Stack)
    
   IMPROVEMENTS
    HBASE-559   MR example job to count table rows

Modified: hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/rest/TableHandler.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/rest/TableHandler.java?rev=679145&r1=679144&r2=679145&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/rest/TableHandler.java (original)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/rest/TableHandler.java Wed Jul 23 10:48:47 2008
@@ -174,7 +174,7 @@
 
         // copy over those cells with requested column names
         for(byte [] current_column: columns_retrieved) {
-          if(requested_columns_set.contains(current_column.toString())){
+          if (requested_columns_set.contains(Bytes.toString(current_column))) {
             m.put(current_column, prefiltered_result.get(current_column));            
           }
         }
@@ -295,9 +295,8 @@
     
     try{
       // start an update
-      Text key = new Text(row);
       batchUpdate = timestamp == null ? 
-        new BatchUpdate(key) : new BatchUpdate(key, Long.parseLong(timestamp));
+        new BatchUpdate(row) : new BatchUpdate(row, Long.parseLong(timestamp));
 
       // set the columns from the xml
       NodeList columns = doc.getElementsByTagName("column");
@@ -308,7 +307,7 @@
 
         // extract the name and value children
         Node name_node = column.getElementsByTagName("name").item(0);
-        Text name = new Text(name_node.getFirstChild().getNodeValue());
+        String name = name_node.getFirstChild().getNodeValue();
 
         Node value_node = column.getElementsByTagName("value").item(0);
 
@@ -356,7 +355,7 @@
           XMLOutputter outputter = getXMLOutputter(response.getWriter());
           outputter.startTag("regions");
           for (int i = 0; i < startKeys.length; i++) {
-            doElement(outputter, "region", startKeys[i].toString());
+            doElement(outputter, "region", Bytes.toString(startKeys[i]));
           }
           outputter.endTag();
           outputter.endDocument();
@@ -368,7 +367,7 @@
           PrintWriter out = response.getWriter();
           for (int i = 0; i < startKeys.length; i++) {
             // TODO: Add in the server location.  Is it needed?
-            out.print(startKeys[i].toString());
+            out.print(Bytes.toString(startKeys[i]));
           }
           out.close();
         break;
@@ -453,8 +452,6 @@
     
     // pull the row key out of the path
     String row = URLDecoder.decode(pathSegments[2], HConstants.UTF8_ENCODING);
-    
-    Text key = new Text(row);
 
     String[] columns = request.getParameterValues(COLUMN);
         
@@ -472,7 +469,7 @@
       } else{
         // delete each column in turn      
         for(int i = 0; i < columns.length; i++){
-          table.deleteAll(key, new Text(columns[i]));
+          table.deleteAll(row, columns[i]);
         }
       }
       response.setStatus(202);