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:
parent
95d82f3790
commit
4f88dbf419
|
@ -303,6 +303,7 @@ Trunk (unreleased changes)
|
|||
(Jean-Daniel Cryans via Stack)
|
||||
HBASE-756 In HBase shell, the put command doesn't process the timestamp
|
||||
(Jean-Daniel Cryans via Stack)
|
||||
HBASE-757 REST mangles table names (Sishen via Stack)
|
||||
|
||||
NEW FEATURES
|
||||
HBASE-47 Option to set TTL for columns in hbase
|
||||
|
|
|
@ -29,6 +29,7 @@ import javax.servlet.http.HttpServletResponse;
|
|||
import org.apache.hadoop.hbase.client.HBaseAdmin;
|
||||
import org.apache.hadoop.hbase.HBaseConfiguration;
|
||||
import org.apache.hadoop.hbase.HTableDescriptor;
|
||||
import org.apache.hadoop.hbase.util.Bytes;
|
||||
import org.znerd.xmlenc.XMLOutputter;
|
||||
|
||||
|
||||
|
@ -85,7 +86,7 @@ public class MetaHandler extends GenericHandler {
|
|||
XMLOutputter outputter = getXMLOutputter(response.getWriter());
|
||||
outputter.startTag("tables");
|
||||
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.endDocument();
|
||||
|
@ -96,7 +97,7 @@ public class MetaHandler extends GenericHandler {
|
|||
ContentType.PLAIN.toString());
|
||||
PrintWriter out = response.getWriter();
|
||||
for (int i = 0; i < tables.length; i++) {
|
||||
out.println(tables[i].getName().toString());
|
||||
out.println(Bytes.toString(tables[i].getName()));
|
||||
}
|
||||
out.close();
|
||||
break;
|
||||
|
|
|
@ -391,7 +391,7 @@ public class TableHandler extends GenericHandler {
|
|||
HTableDescriptor [] tables = this.admin.listTables();
|
||||
HTableDescriptor descriptor = null;
|
||||
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];
|
||||
break;
|
||||
}
|
||||
|
@ -406,7 +406,7 @@ public class TableHandler extends GenericHandler {
|
|||
setResponseHeader(response, 200, ContentType.XML.toString());
|
||||
XMLOutputter outputter = getXMLOutputter(response.getWriter());
|
||||
outputter.startTag("table");
|
||||
doElement(outputter, "name", descriptor.getName().toString());
|
||||
doElement(outputter, "name", Bytes.toString(descriptor.getName()));
|
||||
outputter.startTag("columnfamilies");
|
||||
for (HColumnDescriptor e: descriptor.getFamilies()) {
|
||||
outputter.startTag("columnfamily");
|
||||
|
|
Loading…
Reference in New Issue