HBASE-757 REST mangles table names

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@678537 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2008-07-21 19:28:44 +00:00
parent 95d82f3790
commit 4f88dbf419
3 changed files with 6 additions and 4 deletions

View File

@ -303,6 +303,7 @@ Trunk (unreleased changes)
(Jean-Daniel Cryans via Stack) (Jean-Daniel Cryans via Stack)
HBASE-756 In HBase shell, the put command doesn't process the timestamp HBASE-756 In HBase shell, the put command doesn't process the timestamp
(Jean-Daniel Cryans via Stack) (Jean-Daniel Cryans via Stack)
HBASE-757 REST mangles table names (Sishen via Stack)
NEW FEATURES NEW FEATURES
HBASE-47 Option to set TTL for columns in hbase HBASE-47 Option to set TTL for columns in hbase

View File

@ -29,6 +29,7 @@ import javax.servlet.http.HttpServletResponse;
import org.apache.hadoop.hbase.client.HBaseAdmin; import org.apache.hadoop.hbase.client.HBaseAdmin;
import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.HTableDescriptor;
import org.apache.hadoop.hbase.util.Bytes;
import org.znerd.xmlenc.XMLOutputter; import org.znerd.xmlenc.XMLOutputter;
@ -85,7 +86,7 @@ public class MetaHandler extends GenericHandler {
XMLOutputter outputter = getXMLOutputter(response.getWriter()); XMLOutputter outputter = getXMLOutputter(response.getWriter());
outputter.startTag("tables"); outputter.startTag("tables");
for (int i = 0; i < tables.length; i++) { for (int i = 0; i < tables.length; i++) {
doElement(outputter, "table", tables[i].getName().toString()); doElement(outputter, "table", Bytes.toString(tables[i].getName()));
} }
outputter.endTag(); outputter.endTag();
outputter.endDocument(); outputter.endDocument();
@ -96,7 +97,7 @@ public class MetaHandler extends GenericHandler {
ContentType.PLAIN.toString()); ContentType.PLAIN.toString());
PrintWriter out = response.getWriter(); PrintWriter out = response.getWriter();
for (int i = 0; i < tables.length; i++) { for (int i = 0; i < tables.length; i++) {
out.println(tables[i].getName().toString()); out.println(Bytes.toString(tables[i].getName()));
} }
out.close(); out.close();
break; break;

View File

@ -391,7 +391,7 @@ public class TableHandler extends GenericHandler {
HTableDescriptor [] tables = this.admin.listTables(); HTableDescriptor [] tables = this.admin.listTables();
HTableDescriptor descriptor = null; HTableDescriptor descriptor = null;
for (int i = 0; i < tables.length; i++) { for (int i = 0; i < tables.length; i++) {
if (tables[i].getName().toString().equals(tableName)) { if (Bytes.toString(tables[i].getName()).equals(tableName)) {
descriptor = tables[i]; descriptor = tables[i];
break; break;
} }
@ -406,7 +406,7 @@ public class TableHandler extends GenericHandler {
setResponseHeader(response, 200, ContentType.XML.toString()); setResponseHeader(response, 200, ContentType.XML.toString());
XMLOutputter outputter = getXMLOutputter(response.getWriter()); XMLOutputter outputter = getXMLOutputter(response.getWriter());
outputter.startTag("table"); outputter.startTag("table");
doElement(outputter, "name", descriptor.getName().toString()); doElement(outputter, "name", Bytes.toString(descriptor.getName()));
outputter.startTag("columnfamilies"); outputter.startTag("columnfamilies");
for (HColumnDescriptor e: descriptor.getFamilies()) { for (HColumnDescriptor e: descriptor.getFamilies()) {
outputter.startTag("columnfamily"); outputter.startTag("columnfamily");