diff --git a/pom.xml b/pom.xml
index 03fe468..46c782b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -430,7 +430,7 @@
2.3.0
1.5.8
1.0.1
- 0.2.0
+ 0.5.0
3.3.1
diff --git a/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServer.java b/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServer.java
index 78f38d6..62bedb9 100644
--- a/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServer.java
+++ b/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServer.java
@@ -22,6 +22,7 @@ import java.io.IOException;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.UnknownHostException;
+import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
@@ -195,33 +196,37 @@ public class ThriftServer {
scannerMap = new HashMap();
}
- public void enableTable(final byte[] tableName) throws IOError {
+ @Override
+ public void enableTable(ByteBuffer tableName) throws IOError {
try{
- admin.enableTable(tableName);
+ admin.enableTable(tableName.array());
} catch (IOException e) {
throw new IOError(e.getMessage());
}
}
- public void disableTable(final byte[] tableName) throws IOError{
+ @Override
+ public void disableTable(ByteBuffer tableName) throws IOError{
try{
- admin.disableTable(tableName);
+ admin.disableTable(tableName.array());
} catch (IOException e) {
throw new IOError(e.getMessage());
}
}
- public boolean isTableEnabled(final byte[] tableName) throws IOError {
+ @Override
+ public boolean isTableEnabled(ByteBuffer tableName) throws IOError {
try {
- return HTable.isTableEnabled(this.conf, tableName);
+ return HTable.isTableEnabled(this.conf, tableName.array());
} catch (IOException e) {
throw new IOError(e.getMessage());
}
}
- public void compact(byte[] tableNameOrRegionName) throws IOError {
+ @Override
+ public void compact(ByteBuffer tableNameOrRegionName) throws IOError {
try{
- admin.compact(tableNameOrRegionName);
+ admin.compact(tableNameOrRegionName.array());
} catch (InterruptedException e) {
throw new IOError(e.getMessage());
} catch (IOException e) {
@@ -229,9 +234,10 @@ public class ThriftServer {
}
}
- public void majorCompact(byte[] tableNameOrRegionName) throws IOError {
+ @Override
+ public void majorCompact(ByteBuffer tableNameOrRegionName) throws IOError {
try{
- admin.majorCompact(tableNameOrRegionName);
+ admin.majorCompact(tableNameOrRegionName.array());
} catch (InterruptedException e) {
throw new IOError(e.getMessage());
} catch (IOException e) {
@@ -239,12 +245,13 @@ public class ThriftServer {
}
}
- public List getTableNames() throws IOError {
+ @Override
+ public List getTableNames() throws IOError {
try {
HTableDescriptor[] tables = this.admin.listTables();
- ArrayList list = new ArrayList(tables.length);
- for (int i = 0; i < tables.length; i++) {
- list.add(tables[i].getName());
+ List list = new ArrayList(tables.length);
+ for (HTableDescriptor table : tables) {
+ list.add(ByteBuffer.wrap(table.getName()));
}
return list;
} catch (IOException e) {
@@ -252,19 +259,20 @@ public class ThriftServer {
}
}
- public List getTableRegions(byte[] tableName)
+ @Override
+ public List getTableRegions(ByteBuffer tableName)
throws IOError {
try{
- HTable table = getTable(tableName);
+ HTable table = getTable(tableName.array());
Map regionsInfo = table.getRegionsInfo();
- List regions = new ArrayList();
+ List regions = new ArrayList(regionsInfo.size());
for (HRegionInfo regionInfo : regionsInfo.keySet()){
TRegionInfo region = new TRegionInfo();
- region.startKey = regionInfo.getStartKey();
- region.endKey = regionInfo.getEndKey();
+ region.setStartKey(regionInfo.getStartKey());
+ region.setEndKey(regionInfo.getEndKey());
region.id = regionInfo.getRegionId();
- region.name = regionInfo.getRegionName();
+ region.setName(regionInfo.getRegionName());
region.version = regionInfo.getVersion();
regions.add(region);
}
@@ -274,14 +282,15 @@ public class ThriftServer {
}
}
+ @Override
@Deprecated
- public List get(byte[] tableName, byte[] row, byte[] column)
+ public List get(ByteBuffer tableName, ByteBuffer row, ByteBuffer column)
throws IOError {
- byte [][] famAndQf = KeyValue.parseColumn(column);
+ byte [][] famAndQf = KeyValue.parseColumn(column.array());
if(famAndQf.length == 1) {
- return get(tableName, row, famAndQf[0], new byte[0]);
+ return get(tableName.array(), row.array(), famAndQf[0], new byte[0]);
}
- return get(tableName, row, famAndQf[0], famAndQf[1]);
+ return get(tableName.array(), row.array(), famAndQf[0], famAndQf[1]);
}
public List get(byte [] tableName, byte [] row, byte [] family,
@@ -301,21 +310,22 @@ public class ThriftServer {
}
}
+ @Override
@Deprecated
- public List getVer(byte[] tableName, byte[] row,
- byte[] column, int numVersions) throws IOError {
- byte [][] famAndQf = KeyValue.parseColumn(column);
+ public List getVer(ByteBuffer tableName, ByteBuffer row,
+ ByteBuffer column, int numVersions) throws IOError {
+ byte [][] famAndQf = KeyValue.parseColumn(column.array());
if(famAndQf.length == 1) {
return getVer(tableName, row, famAndQf[0], new byte[0], numVersions);
}
return getVer(tableName, row, famAndQf[0], famAndQf[1], numVersions);
}
- public List getVer(byte [] tableName, byte [] row, byte [] family,
+ public List getVer(ByteBuffer tableName, ByteBuffer row, byte [] family,
byte [] qualifier, int numVersions) throws IOError {
try {
- HTable table = getTable(tableName);
- Get get = new Get(row);
+ HTable table = getTable(tableName.array());
+ Get get = new Get(row.array());
get.addColumn(family, qualifier);
get.setMaxVersions(numVersions);
Result result = table.get(get);
@@ -325,10 +335,11 @@ public class ThriftServer {
}
}
+ @Override
@Deprecated
- public List getVerTs(byte[] tableName, byte[] row,
- byte[] column, long timestamp, int numVersions) throws IOError {
- byte [][] famAndQf = KeyValue.parseColumn(column);
+ public List getVerTs(ByteBuffer tableName, ByteBuffer row,
+ ByteBuffer column, long timestamp, int numVersions) throws IOError {
+ byte [][] famAndQf = KeyValue.parseColumn(column.array());
if(famAndQf.length == 1) {
return getVerTs(tableName, row, famAndQf[0], new byte[0], timestamp,
numVersions);
@@ -337,11 +348,11 @@ public class ThriftServer {
numVersions);
}
- public List getVerTs(byte [] tableName, byte [] row, byte [] family,
+ public List getVerTs(ByteBuffer tableName, ByteBuffer row, byte [] family,
byte [] qualifier, long timestamp, int numVersions) throws IOError {
try {
- HTable table = getTable(tableName);
- Get get = new Get(row);
+ HTable table = getTable(tableName.array());
+ Get get = new Get(row.array());
get.addColumn(family, qualifier);
get.setTimeRange(Long.MIN_VALUE, timestamp);
get.setMaxVersions(numVersions);
@@ -352,38 +363,41 @@ public class ThriftServer {
}
}
- public List getRow(byte[] tableName, byte[] row)
+ @Override
+ public List getRow(ByteBuffer tableName, ByteBuffer row)
throws IOError {
return getRowWithColumnsTs(tableName, row, null,
HConstants.LATEST_TIMESTAMP);
}
- public List getRowWithColumns(byte[] tableName, byte[] row,
- List columns) throws IOError {
+ @Override
+ public List getRowWithColumns(ByteBuffer tableName, ByteBuffer row,
+ List columns) throws IOError {
return getRowWithColumnsTs(tableName, row, columns,
HConstants.LATEST_TIMESTAMP);
}
- public List getRowTs(byte[] tableName, byte[] row,
+ @Override
+ public List getRowTs(ByteBuffer tableName, ByteBuffer row,
long timestamp) throws IOError {
- return getRowWithColumnsTs(tableName, row, null,
- timestamp);
+ return getRowWithColumnsTs(tableName, row, null, timestamp);
}
- public List getRowWithColumnsTs(byte[] tableName, byte[] row,
- List columns, long timestamp) throws IOError {
+ @Override
+ public List getRowWithColumnsTs(ByteBuffer tableName, ByteBuffer row,
+ List columns, long timestamp) throws IOError {
try {
- HTable table = getTable(tableName);
+ HTable table = getTable(tableName.array());
if (columns == null) {
- Get get = new Get(row);
+ Get get = new Get(row.array());
get.setTimeRange(Long.MIN_VALUE, timestamp);
Result result = table.get(get);
return ThriftUtilities.rowResultFromHBase(result);
}
- byte[][] columnArr = columns.toArray(new byte[columns.size()][]);
- Get get = new Get(row);
- for(byte [] column : columnArr) {
- byte [][] famAndQf = KeyValue.parseColumn(column);
+ ByteBuffer[] columnArr = columns.toArray(new ByteBuffer[columns.size()]);
+ Get get = new Get(row.array());
+ for(ByteBuffer column : columnArr) {
+ byte [][] famAndQf = KeyValue.parseColumn(column.array());
if (famAndQf.length == 1) {
get.addFamily(famAndQf[0]);
} else {
@@ -398,17 +412,19 @@ public class ThriftServer {
}
}
- public void deleteAll(byte[] tableName, byte[] row, byte[] column)
+ @Override
+ public void deleteAll(ByteBuffer tableName, ByteBuffer row, ByteBuffer column)
throws IOError {
deleteAllTs(tableName, row, column, HConstants.LATEST_TIMESTAMP);
}
- public void deleteAllTs(byte[] tableName, byte[] row, byte[] column,
+ @Override
+ public void deleteAllTs(ByteBuffer tableName, ByteBuffer row, ByteBuffer column,
long timestamp) throws IOError {
try {
- HTable table = getTable(tableName);
- Delete delete = new Delete(row);
- byte [][] famAndQf = KeyValue.parseColumn(column);
+ HTable table = getTable(tableName.array());
+ Delete delete = new Delete(row.array());
+ byte [][] famAndQf = KeyValue.parseColumn(column.array());
if (famAndQf.length == 1) {
delete.deleteFamily(famAndQf[0], timestamp);
} else {
@@ -421,29 +437,32 @@ public class ThriftServer {
}
}
- public void deleteAllRow(byte[] tableName, byte[] row) throws IOError {
+ @Override
+ public void deleteAllRow(ByteBuffer tableName, ByteBuffer row) throws IOError {
deleteAllRowTs(tableName, row, HConstants.LATEST_TIMESTAMP);
}
- public void deleteAllRowTs(byte[] tableName, byte[] row, long timestamp)
+ @Override
+ public void deleteAllRowTs(ByteBuffer tableName, ByteBuffer row, long timestamp)
throws IOError {
try {
- HTable table = getTable(tableName);
- Delete delete = new Delete(row, timestamp, null);
+ HTable table = getTable(tableName.array());
+ Delete delete = new Delete(row.array(), timestamp, null);
table.delete(delete);
} catch (IOException e) {
throw new IOError(e.getMessage());
}
}
- public void createTable(byte[] tableName,
+ @Override
+ public void createTable(ByteBuffer tableName,
List columnFamilies) throws IOError,
IllegalArgument, AlreadyExists {
try {
- if (admin.tableExists(tableName)) {
+ if (admin.tableExists(tableName.array())) {
throw new AlreadyExists("table name already in use");
}
- HTableDescriptor desc = new HTableDescriptor(tableName);
+ HTableDescriptor desc = new HTableDescriptor(tableName.array());
for (ColumnDescriptor col : columnFamilies) {
HColumnDescriptor colDesc = ThriftUtilities.colDescFromThrift(col);
desc.addFamily(colDesc);
@@ -456,37 +475,40 @@ public class ThriftServer {
}
}
- public void deleteTable(byte[] tableName) throws IOError {
+ @Override
+ public void deleteTable(ByteBuffer tableName) throws IOError {
if (LOG.isDebugEnabled()) {
- LOG.debug("deleteTable: table=" + new String(tableName));
+ LOG.debug("deleteTable: table=" + new String(tableName.array()));
}
try {
- if (!admin.tableExists(tableName)) {
+ if (!admin.tableExists(tableName.array())) {
throw new IOError("table does not exist");
}
- admin.deleteTable(tableName);
+ admin.deleteTable(tableName.array());
} catch (IOException e) {
throw new IOError(e.getMessage());
}
}
- public void mutateRow(byte[] tableName, byte[] row,
+ @Override
+ public void mutateRow(ByteBuffer tableName, ByteBuffer row,
List mutations) throws IOError, IllegalArgument {
mutateRowTs(tableName, row, mutations, HConstants.LATEST_TIMESTAMP);
}
- public void mutateRowTs(byte[] tableName, byte[] row,
+ @Override
+ public void mutateRowTs(ByteBuffer tableName, ByteBuffer row,
List mutations, long timestamp) throws IOError, IllegalArgument {
- HTable table = null;
+ HTable table;
try {
- table = getTable(tableName);
- Put put = new Put(row, timestamp, null);
+ table = getTable(tableName.array());
+ Put put = new Put(row.array(), timestamp, null);
- Delete delete = new Delete(row);
+ Delete delete = new Delete(row.array());
// I apologize for all this mess :)
for (Mutation m : mutations) {
- byte[][] famAndQf = KeyValue.parseColumn(m.column);
+ byte[][] famAndQf = KeyValue.parseColumn(m.column.array());
if (m.isDelete) {
if (famAndQf.length == 1) {
delete.deleteFamily(famAndQf[0], timestamp);
@@ -495,9 +517,9 @@ public class ThriftServer {
}
} else {
if(famAndQf.length == 1) {
- put.add(famAndQf[0], new byte[0], m.value);
+ put.add(famAndQf[0], new byte[0], m.value.array());
} else {
- put.add(famAndQf[0], famAndQf[1], m.value);
+ put.add(famAndQf[0], famAndQf[1], m.value.array());
}
}
}
@@ -512,23 +534,25 @@ public class ThriftServer {
}
}
- public void mutateRows(byte[] tableName, List rowBatches)
+ @Override
+ public void mutateRows(ByteBuffer tableName, List rowBatches)
throws IOError, IllegalArgument, TException {
mutateRowsTs(tableName, rowBatches, HConstants.LATEST_TIMESTAMP);
}
- public void mutateRowsTs(byte[] tableName, List rowBatches, long timestamp)
+ @Override
+ public void mutateRowsTs(ByteBuffer tableName, List rowBatches, long timestamp)
throws IOError, IllegalArgument, TException {
List puts = new ArrayList();
List deletes = new ArrayList();
for (BatchMutation batch : rowBatches) {
- byte[] row = batch.row;
+ ByteBuffer row = batch.row;
List mutations = batch.mutations;
- Delete delete = new Delete(row);
- Put put = new Put(row, timestamp, null);
+ Delete delete = new Delete(row.array());
+ Put put = new Put(row.array(), timestamp, null);
for (Mutation m : mutations) {
- byte[][] famAndQf = KeyValue.parseColumn(m.column);
+ byte[][] famAndQf = KeyValue.parseColumn(m.column.array());
if (m.isDelete) {
// no qualifier, family only.
if (famAndQf.length == 1) {
@@ -538,9 +562,9 @@ public class ThriftServer {
}
} else {
if(famAndQf.length == 1) {
- put.add(famAndQf[0], new byte[0], m.value);
+ put.add(famAndQf[0], new byte[0], m.value.array());
} else {
- put.add(famAndQf[0], famAndQf[1], m.value);
+ put.add(famAndQf[0], famAndQf[1], m.value.array());
}
}
}
@@ -552,7 +576,7 @@ public class ThriftServer {
HTable table = null;
try {
- table = getTable(tableName);
+ table = getTable(tableName.array());
if (!puts.isEmpty())
table.put(puts);
for (Delete del : deletes) {
@@ -565,15 +589,16 @@ public class ThriftServer {
}
}
+ @Override
@Deprecated
- public long atomicIncrement(byte[] tableName, byte[] row, byte[] column,
+ public long atomicIncrement(ByteBuffer tableName, ByteBuffer row, ByteBuffer column,
long amount) throws IOError, IllegalArgument, TException {
- byte [][] famAndQf = KeyValue.parseColumn(column);
+ byte [][] famAndQf = KeyValue.parseColumn(column.array());
if(famAndQf.length == 1) {
- return atomicIncrement(tableName, row, famAndQf[0], new byte[0],
+ return atomicIncrement(tableName.array(), row.array(), famAndQf[0], new byte[0],
amount);
}
- return atomicIncrement(tableName, row, famAndQf[0], famAndQf[1], amount);
+ return atomicIncrement(tableName.array(), row.array(), famAndQf[0], famAndQf[1], amount);
}
public long atomicIncrement(byte [] tableName, byte [] row, byte [] family,
@@ -588,6 +613,7 @@ public class ThriftServer {
}
}
+ @Override
public void scannerClose(int id) throws IOError, IllegalArgument {
LOG.debug("scannerClose: id=" + id);
ResultScanner scanner = getScanner(id);
@@ -598,6 +624,7 @@ public class ThriftServer {
removeScanner(id);
}
+ @Override
public List scannerGetList(int id,int nbRows) throws IllegalArgument, IOError {
LOG.debug("scannerGetList: id=" + id);
ResultScanner scanner = getScanner(id);
@@ -616,17 +643,21 @@ public class ThriftServer {
}
return ThriftUtilities.rowResultFromHBase(results);
}
+
+ @Override
public List scannerGet(int id) throws IllegalArgument, IOError {
return scannerGetList(id,1);
}
- public int scannerOpen(byte[] tableName, byte[] startRow,
- List columns) throws IOError {
+
+ @Override
+ public int scannerOpen(ByteBuffer tableName, ByteBuffer startRow,
+ List columns) throws IOError {
try {
- HTable table = getTable(tableName);
- Scan scan = new Scan(startRow);
- if(columns != null && columns.size() != 0) {
- for(byte [] column : columns) {
- byte [][] famQf = KeyValue.parseColumn(column);
+ HTable table = getTable(tableName.array());
+ Scan scan = new Scan(startRow.array());
+ if(columns != null && !columns.isEmpty()) {
+ for(ByteBuffer column : columns) {
+ byte [][] famQf = KeyValue.parseColumn(column.array());
if(famQf.length == 1) {
scan.addFamily(famQf[0]);
} else {
@@ -640,14 +671,15 @@ public class ThriftServer {
}
}
- public int scannerOpenWithStop(byte[] tableName, byte[] startRow,
- byte[] stopRow, List columns) throws IOError, TException {
+ @Override
+ public int scannerOpenWithStop(ByteBuffer tableName, ByteBuffer startRow,
+ ByteBuffer stopRow, List columns) throws IOError, TException {
try {
- HTable table = getTable(tableName);
- Scan scan = new Scan(startRow, stopRow);
- if(columns != null && columns.size() != 0) {
- for(byte [] column : columns) {
- byte [][] famQf = KeyValue.parseColumn(column);
+ HTable table = getTable(tableName.array());
+ Scan scan = new Scan(startRow.array(), stopRow.array());
+ if(columns != null && !columns.isEmpty()) {
+ for(ByteBuffer column : columns) {
+ byte [][] famQf = KeyValue.parseColumn(column.array());
if(famQf.length == 1) {
scan.addFamily(famQf[0]);
} else {
@@ -662,16 +694,16 @@ public class ThriftServer {
}
@Override
- public int scannerOpenWithPrefix(byte[] tableName, byte[] startAndPrefix, List columns) throws IOError, TException {
+ public int scannerOpenWithPrefix(ByteBuffer tableName, ByteBuffer startAndPrefix, List columns) throws IOError, TException {
try {
- HTable table = getTable(tableName);
- Scan scan = new Scan(startAndPrefix);
+ HTable table = getTable(tableName.array());
+ Scan scan = new Scan(startAndPrefix.array());
Filter f = new WhileMatchFilter(
- new PrefixFilter(startAndPrefix));
+ new PrefixFilter(startAndPrefix.array()));
scan.setFilter(f);
- if(columns != null && columns.size() != 0) {
- for(byte [] column : columns) {
- byte [][] famQf = KeyValue.parseColumn(column);
+ if(columns != null && !columns.isEmpty()) {
+ for(ByteBuffer column : columns) {
+ byte [][] famQf = KeyValue.parseColumn(column.array());
if(famQf.length == 1) {
scan.addFamily(famQf[0]);
} else {
@@ -685,15 +717,16 @@ public class ThriftServer {
}
}
- public int scannerOpenTs(byte[] tableName, byte[] startRow,
- List columns, long timestamp) throws IOError, TException {
+ @Override
+ public int scannerOpenTs(ByteBuffer tableName, ByteBuffer startRow,
+ List columns, long timestamp) throws IOError, TException {
try {
- HTable table = getTable(tableName);
- Scan scan = new Scan(startRow);
+ HTable table = getTable(tableName.array());
+ Scan scan = new Scan(startRow.array());
scan.setTimeRange(Long.MIN_VALUE, timestamp);
- if(columns != null && columns.size() != 0) {
- for(byte [] column : columns) {
- byte [][] famQf = KeyValue.parseColumn(column);
+ if(columns != null && !columns.isEmpty()) {
+ for(ByteBuffer column : columns) {
+ byte [][] famQf = KeyValue.parseColumn(column.array());
if(famQf.length == 1) {
scan.addFamily(famQf[0]);
} else {
@@ -707,16 +740,17 @@ public class ThriftServer {
}
}
- public int scannerOpenWithStopTs(byte[] tableName, byte[] startRow,
- byte[] stopRow, List columns, long timestamp)
+ @Override
+ public int scannerOpenWithStopTs(ByteBuffer tableName, ByteBuffer startRow,
+ ByteBuffer stopRow, List columns, long timestamp)
throws IOError, TException {
try {
- HTable table = getTable(tableName);
- Scan scan = new Scan(startRow, stopRow);
+ HTable table = getTable(tableName.array());
+ Scan scan = new Scan(startRow.array(), stopRow.array());
scan.setTimeRange(Long.MIN_VALUE, timestamp);
- if(columns != null && columns.size() != 0) {
- for(byte [] column : columns) {
- byte [][] famQf = KeyValue.parseColumn(column);
+ if(columns != null && !columns.isEmpty()) {
+ for(ByteBuffer column : columns) {
+ byte [][] famQf = KeyValue.parseColumn(column.array());
if(famQf.length == 1) {
scan.addFamily(famQf[0]);
} else {
@@ -731,13 +765,12 @@ public class ThriftServer {
}
}
- public Map getColumnDescriptors(
- byte[] tableName) throws IOError, TException {
+ @Override
+ public Map getColumnDescriptors(ByteBuffer tableName) throws IOError, TException {
try {
- TreeMap columns =
- new TreeMap(Bytes.BYTES_COMPARATOR);
+ Map columns = new TreeMap();
- HTable table = getTable(tableName);
+ HTable table = getTable(tableName.array());
HTableDescriptor desc = table.getTableDescriptor();
for (HColumnDescriptor e : desc.getFamilies()) {
diff --git a/src/main/java/org/apache/hadoop/hbase/thrift/ThriftUtilities.java b/src/main/java/org/apache/hadoop/hbase/thrift/ThriftUtilities.java
index f319751..e927e7a 100644
--- a/src/main/java/org/apache/hadoop/hbase/thrift/ThriftUtilities.java
+++ b/src/main/java/org/apache/hadoop/hbase/thrift/ThriftUtilities.java
@@ -18,6 +18,7 @@
package org.apache.hadoop.hbase.thrift;
+import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.List;
import java.util.TreeMap;
@@ -52,10 +53,10 @@ public class ThriftUtilities {
StoreFile.BloomType bt =
BloomType.valueOf(in.bloomFilterType);
- if (in.name == null || in.name.length <= 0) {
+ if (in.name == null || in.name.array().length <= 0) {
throw new IllegalArgument("column name is empty");
}
- byte [] parsedName = KeyValue.parseColumn(in.name)[0];
+ byte [] parsedName = KeyValue.parseColumn(in.name.array())[0];
HColumnDescriptor col = new HColumnDescriptor(parsedName,
in.maxVersions, comp.getName(), in.inMemory, in.blockCacheEnabled,
in.timeToLive, bt.toString());
@@ -72,7 +73,7 @@ public class ThriftUtilities {
*/
static public ColumnDescriptor colDescFromHbase(HColumnDescriptor in) {
ColumnDescriptor col = new ColumnDescriptor();
- col.name = Bytes.add(in.getName(), KeyValue.COLUMN_FAMILY_DELIM_ARRAY);
+ col.name = ByteBuffer.wrap(Bytes.add(in.getName(), KeyValue.COLUMN_FAMILY_DELIM_ARRAY));
col.maxVersions = in.getMaxVersions();
col.compression = in.getCompression().toString();
col.inMemory = in.isInMemory();
@@ -92,7 +93,7 @@ public class ThriftUtilities {
static public List cellFromHBase(KeyValue in) {
List list = new ArrayList(1);
if (in != null) {
- list.add(new TCell(in.getValue(), in.getTimestamp()));
+ list.add(new TCell(ByteBuffer.wrap(in.getValue()), in.getTimestamp()));
}
return list;
}
@@ -108,7 +109,7 @@ public class ThriftUtilities {
if (in != null) {
list = new ArrayList(in.length);
for (int i = 0; i < in.length; i++) {
- list.add(new TCell(in[i].getValue(), in[i].getTimestamp()));
+ list.add(new TCell(ByteBuffer.wrap(in[i].getValue()), in[i].getTimestamp()));
}
} else {
list = new ArrayList(0);
@@ -132,11 +133,11 @@ public class ThriftUtilities {
continue;
}
TRowResult result = new TRowResult();
- result.row = result_.getRow();
- result.columns = new TreeMap(Bytes.BYTES_COMPARATOR);
+ result.row = ByteBuffer.wrap(result_.getRow());
+ result.columns = new TreeMap();
for(KeyValue kv : result_.sorted()) {
- result.columns.put(KeyValue.makeColumn(kv.getFamily(),
- kv.getQualifier()), new TCell(kv.getValue(), kv.getTimestamp()));
+ result.columns.put(ByteBuffer.wrap(KeyValue.makeColumn(kv.getFamily(),
+ kv.getQualifier())), new TCell(ByteBuffer.wrap(kv.getValue()), kv.getTimestamp()));
}
results.add(result);
}
diff --git a/src/main/java/org/apache/hadoop/hbase/thrift/generated/AlreadyExists.java b/src/main/java/org/apache/hadoop/hbase/thrift/generated/AlreadyExists.java
index 2bd4f77..1ecf24e 100644
--- a/src/main/java/org/apache/hadoop/hbase/thrift/generated/AlreadyExists.java
+++ b/src/main/java/org/apache/hadoop/hbase/thrift/generated/AlreadyExists.java
@@ -1,35 +1,37 @@
/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
+ * Autogenerated by Thrift
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*/
package org.apache.hadoop.hbase.thrift.generated;
import org.apache.commons.lang.builder.HashCodeBuilder;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.EnumSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import org.apache.thrift.*;
-import org.apache.thrift.meta_data.FieldMetaData;
-import org.apache.thrift.meta_data.FieldValueMetaData;
+import org.apache.thrift.async.*;
+import org.apache.thrift.meta_data.*;
+import org.apache.thrift.transport.*;
import org.apache.thrift.protocol.*;
-import java.util.*;
-
/**
* An AlreadyExists exceptions signals that a table with the specified
* name already exists
*/
-public class AlreadyExists extends Exception implements TBase, java.io.Serializable, Cloneable, Comparable {
+public class AlreadyExists extends Exception implements TBase, java.io.Serializable, Cloneable {
private static final TStruct STRUCT_DESC = new TStruct("AlreadyExists");
private static final TField MESSAGE_FIELD_DESC = new TField("message", TType.STRING, (short)1);
@@ -40,12 +42,10 @@ public class AlreadyExists extends Exception implements TBase byId = new HashMap();
private static final Map byName = new HashMap();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
- byId.put((int)field._thriftId, field);
byName.put(field.getFieldName(), field);
}
}
@@ -54,7 +54,12 @@ public class AlreadyExists extends Exception implements TBase metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
- put(_Fields.MESSAGE, new FieldMetaData("message", TFieldRequirementType.DEFAULT,
- new FieldValueMetaData(TType.STRING)));
- }});
-
+ public static final Map<_Fields, FieldMetaData> metaDataMap;
static {
+ Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class);
+ tmpMap.put(_Fields.MESSAGE, new FieldMetaData("message", TFieldRequirementType.DEFAULT,
+ new FieldValueMetaData(TType.STRING)));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
FieldMetaData.addStructMetaDataMap(AlreadyExists.class, metaDataMap);
}
@@ -125,9 +130,9 @@ public class AlreadyExists extends Exception implements TBase, java.io.Serializable, Cloneable, Comparable {
+public class BatchMutation implements TBase, java.io.Serializable, Cloneable {
private static final TStruct STRUCT_DESC = new TStruct("BatchMutation");
private static final TField ROW_FIELD_DESC = new TField("row", TType.STRING, (short)1);
private static final TField MUTATIONS_FIELD_DESC = new TField("mutations", TType.LIST, (short)2);
- public byte[] row;
+ public ByteBuffer row;
public List mutations;
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
@@ -53,12 +44,10 @@ public class BatchMutation implements TBase, java.io.Seri
ROW((short)1, "row"),
MUTATIONS((short)2, "mutations");
- private static final Map byId = new HashMap();
private static final Map byName = new HashMap();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
- byId.put((int)field._thriftId, field);
byName.put(field.getFieldName(), field);
}
}
@@ -67,7 +56,14 @@ public class BatchMutation implements TBase, java.io.Seri
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
- return byId.get(fieldId);
+ switch(fieldId) {
+ case 1: // ROW
+ return ROW;
+ case 2: // MUTATIONS
+ return MUTATIONS;
+ default:
+ return null;
+ }
}
/**
@@ -106,15 +102,15 @@ public class BatchMutation implements TBase, java.io.Seri
// isset id assignments
- public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
- put(_Fields.ROW, new FieldMetaData("row", TFieldRequirementType.DEFAULT,
- new FieldValueMetaData(TType.STRING)));
- put(_Fields.MUTATIONS, new FieldMetaData("mutations", TFieldRequirementType.DEFAULT,
- new ListMetaData(TType.LIST,
- new StructMetaData(TType.STRUCT, Mutation.class))));
- }});
-
+ public static final Map<_Fields, FieldMetaData> metaDataMap;
static {
+ Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class);
+ tmpMap.put(_Fields.ROW, new FieldMetaData("row", TFieldRequirementType.DEFAULT,
+ new FieldValueMetaData(TType.STRING , "Text")));
+ tmpMap.put(_Fields.MUTATIONS, new FieldMetaData("mutations", TFieldRequirementType.DEFAULT,
+ new ListMetaData(TType.LIST,
+ new StructMetaData(TType.STRUCT, Mutation.class))));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
FieldMetaData.addStructMetaDataMap(BatchMutation.class, metaDataMap);
}
@@ -122,7 +118,7 @@ public class BatchMutation implements TBase, java.io.Seri
}
public BatchMutation(
- byte[] row,
+ ByteBuffer row,
List mutations)
{
this();
@@ -150,16 +146,27 @@ public class BatchMutation implements TBase, java.io.Seri
return new BatchMutation(this);
}
- @Deprecated
- public BatchMutation clone() {
- return new BatchMutation(this);
+ @Override
+ public void clear() {
+ this.row = null;
+ this.mutations = null;
}
public byte[] getRow() {
- return this.row;
+ setRow(TBaseHelper.rightSize(row));
+ return row.array();
+ }
+
+ public ByteBuffer BufferForRow() {
+ return row;
}
public BatchMutation setRow(byte[] row) {
+ setRow(ByteBuffer.wrap(row));
+ return this;
+ }
+
+ public BatchMutation setRow(ByteBuffer row) {
this.row = row;
return this;
}
@@ -224,7 +231,7 @@ public class BatchMutation implements TBase, java.io.Seri
if (value == null) {
unsetRow();
} else {
- setRow((byte[])value);
+ setRow((ByteBuffer)value);
}
break;
@@ -239,10 +246,6 @@ public class BatchMutation implements TBase, java.io.Seri
}
}
- public void setFieldValue(int fieldID, Object value) {
- setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
- }
-
public Object getFieldValue(_Fields field) {
switch (field) {
case ROW:
@@ -255,12 +258,12 @@ public class BatchMutation implements TBase, java.io.Seri
throw new IllegalStateException();
}
- public Object getFieldValue(int fieldId) {
- return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
- }
-
/** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
public boolean isSet(_Fields field) {
+ if (field == null) {
+ throw new IllegalArgumentException();
+ }
+
switch (field) {
case ROW:
return isSetRow();
@@ -270,10 +273,6 @@ public class BatchMutation implements TBase, java.io.Seri
throw new IllegalStateException();
}
- public boolean isSet(int fieldID) {
- return isSet(_Fields.findByThriftIdOrThrow(fieldID));
- }
-
@Override
public boolean equals(Object that) {
if (that == null)
@@ -292,7 +291,7 @@ public class BatchMutation implements TBase, java.io.Seri
if (this_present_row || that_present_row) {
if (!(this_present_row && that_present_row))
return false;
- if (!java.util.Arrays.equals(this.row, that.row))
+ if (!this.row.equals(that.row))
return false;
}
@@ -333,67 +332,72 @@ public class BatchMutation implements TBase, java.io.Seri
int lastComparison = 0;
BatchMutation typedOther = (BatchMutation)other;
- lastComparison = Boolean.valueOf(isSetRow()).compareTo(isSetRow());
+ lastComparison = Boolean.valueOf(isSetRow()).compareTo(typedOther.isSetRow());
if (lastComparison != 0) {
return lastComparison;
}
- lastComparison = TBaseHelper.compareTo(row, typedOther.row);
- if (lastComparison != 0) {
- return lastComparison;
+ if (isSetRow()) {
+ lastComparison = TBaseHelper.compareTo(this.row, typedOther.row);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
}
- lastComparison = Boolean.valueOf(isSetMutations()).compareTo(isSetMutations());
+ lastComparison = Boolean.valueOf(isSetMutations()).compareTo(typedOther.isSetMutations());
if (lastComparison != 0) {
return lastComparison;
}
- lastComparison = TBaseHelper.compareTo(mutations, typedOther.mutations);
- if (lastComparison != 0) {
- return lastComparison;
+ if (isSetMutations()) {
+ lastComparison = TBaseHelper.compareTo(this.mutations, typedOther.mutations);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
}
return 0;
}
+ public _Fields fieldForId(int fieldId) {
+ return _Fields.findByThriftId(fieldId);
+ }
+
public void read(TProtocol iprot) throws TException {
TField field;
iprot.readStructBegin();
while (true)
{
field = iprot.readFieldBegin();
- if (field.type == TType.STOP) {
+ if (field.type == TType.STOP) {
break;
}
- _Fields fieldId = _Fields.findByThriftId(field.id);
- if (fieldId == null) {
- TProtocolUtil.skip(iprot, field.type);
- } else {
- switch (fieldId) {
- case ROW:
- if (field.type == TType.STRING) {
- this.row = iprot.readBinary();
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case MUTATIONS:
- if (field.type == TType.LIST) {
+ switch (field.id) {
+ case 1: // ROW
+ if (field.type == TType.STRING) {
+ this.row = iprot.readBinary();
+ } else {
+ TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ case 2: // MUTATIONS
+ if (field.type == TType.LIST) {
+ {
+ TList _list0 = iprot.readListBegin();
+ this.mutations = new ArrayList(_list0.size);
+ for (int _i1 = 0; _i1 < _list0.size; ++_i1)
{
- TList _list0 = iprot.readListBegin();
- this.mutations = new ArrayList(_list0.size);
- for (int _i1 = 0; _i1 < _list0.size; ++_i1)
- {
- Mutation _elem2;
- _elem2 = new Mutation();
- _elem2.read(iprot);
- this.mutations.add(_elem2);
- }
- iprot.readListEnd();
+ Mutation _elem2;
+ _elem2 = new Mutation();
+ _elem2.read(iprot);
+ this.mutations.add(_elem2);
}
- } else {
- TProtocolUtil.skip(iprot, field.type);
+ iprot.readListEnd();
}
- break;
- }
- iprot.readFieldEnd();
+ } else {
+ TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ default:
+ TProtocolUtil.skip(iprot, field.type);
}
+ iprot.readFieldEnd();
}
iprot.readStructEnd();
diff --git a/src/main/java/org/apache/hadoop/hbase/thrift/generated/ColumnDescriptor.java b/src/main/java/org/apache/hadoop/hbase/thrift/generated/ColumnDescriptor.java
index a883a59..de9b381 100644
--- a/src/main/java/org/apache/hadoop/hbase/thrift/generated/ColumnDescriptor.java
+++ b/src/main/java/org/apache/hadoop/hbase/thrift/generated/ColumnDescriptor.java
@@ -1,19 +1,7 @@
/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
+ * Autogenerated by Thrift
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*/
package org.apache.hadoop.hbase.thrift.generated;
@@ -28,12 +16,15 @@ import java.util.HashSet;
import java.util.EnumSet;
import java.util.Collections;
import java.util.BitSet;
+import java.nio.ByteBuffer;
import java.util.Arrays;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.thrift.*;
+import org.apache.thrift.async.*;
import org.apache.thrift.meta_data.*;
+import org.apache.thrift.transport.*;
import org.apache.thrift.protocol.*;
/**
@@ -41,7 +32,7 @@ import org.apache.thrift.protocol.*;
* such as the number of versions, compression settings, etc. It is
* used as input when creating a table or adding a column.
*/
-public class ColumnDescriptor implements TBase, java.io.Serializable, Cloneable, Comparable {
+public class ColumnDescriptor implements TBase, java.io.Serializable, Cloneable {
private static final TStruct STRUCT_DESC = new TStruct("ColumnDescriptor");
private static final TField NAME_FIELD_DESC = new TField("name", TType.STRING, (short)1);
@@ -54,7 +45,7 @@ public class ColumnDescriptor implements TBase, java.i
private static final TField BLOCK_CACHE_ENABLED_FIELD_DESC = new TField("blockCacheEnabled", TType.BOOL, (short)8);
private static final TField TIME_TO_LIVE_FIELD_DESC = new TField("timeToLive", TType.I32, (short)9);
- public byte[] name;
+ public ByteBuffer name;
public int maxVersions;
public String compression;
public boolean inMemory;
@@ -76,12 +67,10 @@ public class ColumnDescriptor implements TBase, java.i
BLOCK_CACHE_ENABLED((short)8, "blockCacheEnabled"),
TIME_TO_LIVE((short)9, "timeToLive");
- private static final Map byId = new HashMap();
private static final Map byName = new HashMap();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
- byId.put((int)field._thriftId, field);
byName.put(field.getFieldName(), field);
}
}
@@ -90,7 +79,28 @@ public class ColumnDescriptor implements TBase, java.i
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
- return byId.get(fieldId);
+ switch(fieldId) {
+ case 1: // NAME
+ return NAME;
+ case 2: // MAX_VERSIONS
+ return MAX_VERSIONS;
+ case 3: // COMPRESSION
+ return COMPRESSION;
+ case 4: // IN_MEMORY
+ return IN_MEMORY;
+ case 5: // BLOOM_FILTER_TYPE
+ return BLOOM_FILTER_TYPE;
+ case 6: // BLOOM_FILTER_VECTOR_SIZE
+ return BLOOM_FILTER_VECTOR_SIZE;
+ case 7: // BLOOM_FILTER_NB_HASHES
+ return BLOOM_FILTER_NB_HASHES;
+ case 8: // BLOCK_CACHE_ENABLED
+ return BLOCK_CACHE_ENABLED;
+ case 9: // TIME_TO_LIVE
+ return TIME_TO_LIVE;
+ default:
+ return null;
+ }
}
/**
@@ -136,28 +146,28 @@ public class ColumnDescriptor implements TBase, java.i
private static final int __TIMETOLIVE_ISSET_ID = 5;
private BitSet __isset_bit_vector = new BitSet(6);
- public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
- put(_Fields.NAME, new FieldMetaData("name", TFieldRequirementType.DEFAULT,
- new FieldValueMetaData(TType.STRING)));
- put(_Fields.MAX_VERSIONS, new FieldMetaData("maxVersions", TFieldRequirementType.DEFAULT,
+ public static final Map<_Fields, FieldMetaData> metaDataMap;
+ static {
+ Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class);
+ tmpMap.put(_Fields.NAME, new FieldMetaData("name", TFieldRequirementType.DEFAULT,
+ new FieldValueMetaData(TType.STRING , "Text")));
+ tmpMap.put(_Fields.MAX_VERSIONS, new FieldMetaData("maxVersions", TFieldRequirementType.DEFAULT,
new FieldValueMetaData(TType.I32)));
- put(_Fields.COMPRESSION, new FieldMetaData("compression", TFieldRequirementType.DEFAULT,
+ tmpMap.put(_Fields.COMPRESSION, new FieldMetaData("compression", TFieldRequirementType.DEFAULT,
new FieldValueMetaData(TType.STRING)));
- put(_Fields.IN_MEMORY, new FieldMetaData("inMemory", TFieldRequirementType.DEFAULT,
+ tmpMap.put(_Fields.IN_MEMORY, new FieldMetaData("inMemory", TFieldRequirementType.DEFAULT,
new FieldValueMetaData(TType.BOOL)));
- put(_Fields.BLOOM_FILTER_TYPE, new FieldMetaData("bloomFilterType", TFieldRequirementType.DEFAULT,
+ tmpMap.put(_Fields.BLOOM_FILTER_TYPE, new FieldMetaData("bloomFilterType", TFieldRequirementType.DEFAULT,
new FieldValueMetaData(TType.STRING)));
- put(_Fields.BLOOM_FILTER_VECTOR_SIZE, new FieldMetaData("bloomFilterVectorSize", TFieldRequirementType.DEFAULT,
+ tmpMap.put(_Fields.BLOOM_FILTER_VECTOR_SIZE, new FieldMetaData("bloomFilterVectorSize", TFieldRequirementType.DEFAULT,
new FieldValueMetaData(TType.I32)));
- put(_Fields.BLOOM_FILTER_NB_HASHES, new FieldMetaData("bloomFilterNbHashes", TFieldRequirementType.DEFAULT,
+ tmpMap.put(_Fields.BLOOM_FILTER_NB_HASHES, new FieldMetaData("bloomFilterNbHashes", TFieldRequirementType.DEFAULT,
new FieldValueMetaData(TType.I32)));
- put(_Fields.BLOCK_CACHE_ENABLED, new FieldMetaData("blockCacheEnabled", TFieldRequirementType.DEFAULT,
+ tmpMap.put(_Fields.BLOCK_CACHE_ENABLED, new FieldMetaData("blockCacheEnabled", TFieldRequirementType.DEFAULT,
new FieldValueMetaData(TType.BOOL)));
- put(_Fields.TIME_TO_LIVE, new FieldMetaData("timeToLive", TFieldRequirementType.DEFAULT,
+ tmpMap.put(_Fields.TIME_TO_LIVE, new FieldMetaData("timeToLive", TFieldRequirementType.DEFAULT,
new FieldValueMetaData(TType.I32)));
- }});
-
- static {
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
FieldMetaData.addStructMetaDataMap(ColumnDescriptor.class, metaDataMap);
}
@@ -181,7 +191,7 @@ public class ColumnDescriptor implements TBase, java.i
}
public ColumnDescriptor(
- byte[] name,
+ ByteBuffer name,
int maxVersions,
String compression,
boolean inMemory,
@@ -236,16 +246,42 @@ public class ColumnDescriptor implements TBase, java.i
return new ColumnDescriptor(this);
}
- @Deprecated
- public ColumnDescriptor clone() {
- return new ColumnDescriptor(this);
+ @Override
+ public void clear() {
+ this.name = null;
+ this.maxVersions = 3;
+
+ this.compression = "NONE";
+
+ this.inMemory = false;
+
+ this.bloomFilterType = "NONE";
+
+ this.bloomFilterVectorSize = 0;
+
+ this.bloomFilterNbHashes = 0;
+
+ this.blockCacheEnabled = false;
+
+ this.timeToLive = -1;
+
}
public byte[] getName() {
- return this.name;
+ setName(TBaseHelper.rightSize(name));
+ return name.array();
+ }
+
+ public ByteBuffer BufferForName() {
+ return name;
}
public ColumnDescriptor setName(byte[] name) {
+ setName(ByteBuffer.wrap(name));
+ return this;
+ }
+
+ public ColumnDescriptor setName(ByteBuffer name) {
this.name = name;
return this;
}
@@ -457,7 +493,7 @@ public class ColumnDescriptor implements TBase, java.i
if (value == null) {
unsetName();
} else {
- setName((byte[])value);
+ setName((ByteBuffer)value);
}
break;
@@ -528,10 +564,6 @@ public class ColumnDescriptor implements TBase, java.i
}
}
- public void setFieldValue(int fieldID, Object value) {
- setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
- }
-
public Object getFieldValue(_Fields field) {
switch (field) {
case NAME:
@@ -565,12 +597,12 @@ public class ColumnDescriptor implements TBase, java.i
throw new IllegalStateException();
}
- public Object getFieldValue(int fieldId) {
- return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
- }
-
/** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
public boolean isSet(_Fields field) {
+ if (field == null) {
+ throw new IllegalArgumentException();
+ }
+
switch (field) {
case NAME:
return isSetName();
@@ -594,10 +626,6 @@ public class ColumnDescriptor implements TBase, java.i
throw new IllegalStateException();
}
- public boolean isSet(int fieldID) {
- return isSet(_Fields.findByThriftIdOrThrow(fieldID));
- }
-
@Override
public boolean equals(Object that) {
if (that == null)
@@ -616,7 +644,7 @@ public class ColumnDescriptor implements TBase, java.i
if (this_present_name || that_present_name) {
if (!(this_present_name && that_present_name))
return false;
- if (!java.util.Arrays.equals(this.name, that.name))
+ if (!this.name.equals(that.name))
return false;
}
@@ -755,167 +783,186 @@ public class ColumnDescriptor implements TBase, java.i
int lastComparison = 0;
ColumnDescriptor typedOther = (ColumnDescriptor)other;
- lastComparison = Boolean.valueOf(isSetName()).compareTo(isSetName());
+ lastComparison = Boolean.valueOf(isSetName()).compareTo(typedOther.isSetName());
if (lastComparison != 0) {
return lastComparison;
}
- lastComparison = TBaseHelper.compareTo(name, typedOther.name);
- if (lastComparison != 0) {
- return lastComparison;
+ if (isSetName()) {
+ lastComparison = TBaseHelper.compareTo(this.name, typedOther.name);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
}
- lastComparison = Boolean.valueOf(isSetMaxVersions()).compareTo(isSetMaxVersions());
+ lastComparison = Boolean.valueOf(isSetMaxVersions()).compareTo(typedOther.isSetMaxVersions());
if (lastComparison != 0) {
return lastComparison;
}
- lastComparison = TBaseHelper.compareTo(maxVersions, typedOther.maxVersions);
- if (lastComparison != 0) {
- return lastComparison;
+ if (isSetMaxVersions()) {
+ lastComparison = TBaseHelper.compareTo(this.maxVersions, typedOther.maxVersions);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
}
- lastComparison = Boolean.valueOf(isSetCompression()).compareTo(isSetCompression());
+ lastComparison = Boolean.valueOf(isSetCompression()).compareTo(typedOther.isSetCompression());
if (lastComparison != 0) {
return lastComparison;
}
- lastComparison = TBaseHelper.compareTo(compression, typedOther.compression);
- if (lastComparison != 0) {
- return lastComparison;
+ if (isSetCompression()) {
+ lastComparison = TBaseHelper.compareTo(this.compression, typedOther.compression);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
}
- lastComparison = Boolean.valueOf(isSetInMemory()).compareTo(isSetInMemory());
+ lastComparison = Boolean.valueOf(isSetInMemory()).compareTo(typedOther.isSetInMemory());
if (lastComparison != 0) {
return lastComparison;
}
- lastComparison = TBaseHelper.compareTo(inMemory, typedOther.inMemory);
- if (lastComparison != 0) {
- return lastComparison;
+ if (isSetInMemory()) {
+ lastComparison = TBaseHelper.compareTo(this.inMemory, typedOther.inMemory);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
}
- lastComparison = Boolean.valueOf(isSetBloomFilterType()).compareTo(isSetBloomFilterType());
+ lastComparison = Boolean.valueOf(isSetBloomFilterType()).compareTo(typedOther.isSetBloomFilterType());
if (lastComparison != 0) {
return lastComparison;
}
- lastComparison = TBaseHelper.compareTo(bloomFilterType, typedOther.bloomFilterType);
- if (lastComparison != 0) {
- return lastComparison;
+ if (isSetBloomFilterType()) {
+ lastComparison = TBaseHelper.compareTo(this.bloomFilterType, typedOther.bloomFilterType);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
}
- lastComparison = Boolean.valueOf(isSetBloomFilterVectorSize()).compareTo(isSetBloomFilterVectorSize());
+ lastComparison = Boolean.valueOf(isSetBloomFilterVectorSize()).compareTo(typedOther.isSetBloomFilterVectorSize());
if (lastComparison != 0) {
return lastComparison;
}
- lastComparison = TBaseHelper.compareTo(bloomFilterVectorSize, typedOther.bloomFilterVectorSize);
- if (lastComparison != 0) {
- return lastComparison;
+ if (isSetBloomFilterVectorSize()) {
+ lastComparison = TBaseHelper.compareTo(this.bloomFilterVectorSize, typedOther.bloomFilterVectorSize);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
}
- lastComparison = Boolean.valueOf(isSetBloomFilterNbHashes()).compareTo(isSetBloomFilterNbHashes());
+ lastComparison = Boolean.valueOf(isSetBloomFilterNbHashes()).compareTo(typedOther.isSetBloomFilterNbHashes());
if (lastComparison != 0) {
return lastComparison;
}
- lastComparison = TBaseHelper.compareTo(bloomFilterNbHashes, typedOther.bloomFilterNbHashes);
- if (lastComparison != 0) {
- return lastComparison;
+ if (isSetBloomFilterNbHashes()) {
+ lastComparison = TBaseHelper.compareTo(this.bloomFilterNbHashes, typedOther.bloomFilterNbHashes);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
}
- lastComparison = Boolean.valueOf(isSetBlockCacheEnabled()).compareTo(isSetBlockCacheEnabled());
+ lastComparison = Boolean.valueOf(isSetBlockCacheEnabled()).compareTo(typedOther.isSetBlockCacheEnabled());
if (lastComparison != 0) {
return lastComparison;
}
- lastComparison = TBaseHelper.compareTo(blockCacheEnabled, typedOther.blockCacheEnabled);
- if (lastComparison != 0) {
- return lastComparison;
+ if (isSetBlockCacheEnabled()) {
+ lastComparison = TBaseHelper.compareTo(this.blockCacheEnabled, typedOther.blockCacheEnabled);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
}
- lastComparison = Boolean.valueOf(isSetTimeToLive()).compareTo(isSetTimeToLive());
+ lastComparison = Boolean.valueOf(isSetTimeToLive()).compareTo(typedOther.isSetTimeToLive());
if (lastComparison != 0) {
return lastComparison;
}
- lastComparison = TBaseHelper.compareTo(timeToLive, typedOther.timeToLive);
- if (lastComparison != 0) {
- return lastComparison;
+ if (isSetTimeToLive()) {
+ lastComparison = TBaseHelper.compareTo(this.timeToLive, typedOther.timeToLive);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
}
return 0;
}
+ public _Fields fieldForId(int fieldId) {
+ return _Fields.findByThriftId(fieldId);
+ }
+
public void read(TProtocol iprot) throws TException {
TField field;
iprot.readStructBegin();
while (true)
{
field = iprot.readFieldBegin();
- if (field.type == TType.STOP) {
+ if (field.type == TType.STOP) {
break;
}
- _Fields fieldId = _Fields.findByThriftId(field.id);
- if (fieldId == null) {
- TProtocolUtil.skip(iprot, field.type);
- } else {
- switch (fieldId) {
- case NAME:
- if (field.type == TType.STRING) {
- this.name = iprot.readBinary();
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case MAX_VERSIONS:
- if (field.type == TType.I32) {
- this.maxVersions = iprot.readI32();
- setMaxVersionsIsSet(true);
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case COMPRESSION:
- if (field.type == TType.STRING) {
- this.compression = iprot.readString();
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case IN_MEMORY:
- if (field.type == TType.BOOL) {
- this.inMemory = iprot.readBool();
- setInMemoryIsSet(true);
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case BLOOM_FILTER_TYPE:
- if (field.type == TType.STRING) {
- this.bloomFilterType = iprot.readString();
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case BLOOM_FILTER_VECTOR_SIZE:
- if (field.type == TType.I32) {
- this.bloomFilterVectorSize = iprot.readI32();
- setBloomFilterVectorSizeIsSet(true);
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case BLOOM_FILTER_NB_HASHES:
- if (field.type == TType.I32) {
- this.bloomFilterNbHashes = iprot.readI32();
- setBloomFilterNbHashesIsSet(true);
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case BLOCK_CACHE_ENABLED:
- if (field.type == TType.BOOL) {
- this.blockCacheEnabled = iprot.readBool();
- setBlockCacheEnabledIsSet(true);
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case TIME_TO_LIVE:
- if (field.type == TType.I32) {
- this.timeToLive = iprot.readI32();
- setTimeToLiveIsSet(true);
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- }
- iprot.readFieldEnd();
+ switch (field.id) {
+ case 1: // NAME
+ if (field.type == TType.STRING) {
+ this.name = iprot.readBinary();
+ } else {
+ TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ case 2: // MAX_VERSIONS
+ if (field.type == TType.I32) {
+ this.maxVersions = iprot.readI32();
+ setMaxVersionsIsSet(true);
+ } else {
+ TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ case 3: // COMPRESSION
+ if (field.type == TType.STRING) {
+ this.compression = iprot.readString();
+ } else {
+ TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ case 4: // IN_MEMORY
+ if (field.type == TType.BOOL) {
+ this.inMemory = iprot.readBool();
+ setInMemoryIsSet(true);
+ } else {
+ TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ case 5: // BLOOM_FILTER_TYPE
+ if (field.type == TType.STRING) {
+ this.bloomFilterType = iprot.readString();
+ } else {
+ TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ case 6: // BLOOM_FILTER_VECTOR_SIZE
+ if (field.type == TType.I32) {
+ this.bloomFilterVectorSize = iprot.readI32();
+ setBloomFilterVectorSizeIsSet(true);
+ } else {
+ TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ case 7: // BLOOM_FILTER_NB_HASHES
+ if (field.type == TType.I32) {
+ this.bloomFilterNbHashes = iprot.readI32();
+ setBloomFilterNbHashesIsSet(true);
+ } else {
+ TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ case 8: // BLOCK_CACHE_ENABLED
+ if (field.type == TType.BOOL) {
+ this.blockCacheEnabled = iprot.readBool();
+ setBlockCacheEnabledIsSet(true);
+ } else {
+ TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ case 9: // TIME_TO_LIVE
+ if (field.type == TType.I32) {
+ this.timeToLive = iprot.readI32();
+ setTimeToLiveIsSet(true);
+ } else {
+ TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ default:
+ TProtocolUtil.skip(iprot, field.type);
}
+ iprot.readFieldEnd();
}
iprot.readStructEnd();
diff --git a/src/main/java/org/apache/hadoop/hbase/thrift/generated/Hbase.java b/src/main/java/org/apache/hadoop/hbase/thrift/generated/Hbase.java
index 64cbfde..f6eda17 100644
--- a/src/main/java/org/apache/hadoop/hbase/thrift/generated/Hbase.java
+++ b/src/main/java/org/apache/hadoop/hbase/thrift/generated/Hbase.java
@@ -1,19 +1,7 @@
/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
+ * Autogenerated by Thrift
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*/
package org.apache.hadoop.hbase.thrift.generated;
@@ -28,12 +16,15 @@ import java.util.HashSet;
import java.util.EnumSet;
import java.util.Collections;
import java.util.BitSet;
+import java.nio.ByteBuffer;
import java.util.Arrays;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.thrift.*;
+import org.apache.thrift.async.*;
import org.apache.thrift.meta_data.*;
+import org.apache.thrift.transport.*;
import org.apache.thrift.protocol.*;
public class Hbase {
@@ -42,435 +33,525 @@ public class Hbase {
/**
* Brings a table on-line (enables it)
- *
+ *
* @param tableName name of the table
*/
- public void enableTable(byte[] tableName) throws IOError, TException;
+ void enableTable(ByteBuffer tableName) throws IOError, TException;
/**
* Disables a table (takes it off-line) If it is being served, the master
* will tell the servers to stop serving it.
- *
+ *
* @param tableName name of the table
*/
- public void disableTable(byte[] tableName) throws IOError, TException;
+ void disableTable(ByteBuffer tableName) throws IOError, TException;
/**
* @return true if table is on-line
- *
+ *
* @param tableName name of the table to check
*/
- public boolean isTableEnabled(byte[] tableName) throws IOError, TException;
+ boolean isTableEnabled(ByteBuffer tableName) throws IOError, TException;
- public void compact(byte[] tableNameOrRegionName) throws IOError, TException;
+ void compact(ByteBuffer tableNameOrRegionName) throws IOError, TException;
- public void majorCompact(byte[] tableNameOrRegionName) throws IOError, TException;
+ void majorCompact(ByteBuffer tableNameOrRegionName) throws IOError, TException;
/**
* List all the userspace tables.
+ *
* @return returns a list of names
*/
- public List getTableNames() throws IOError, TException;
+ List getTableNames() throws IOError, TException;
/**
* List all the column families assoicated with a table.
+ *
* @return list of column family descriptors
- *
+ *
* @param tableName table name
*/
- public Map getColumnDescriptors(byte[] tableName) throws IOError, TException;
+ Map getColumnDescriptors(ByteBuffer tableName) throws IOError, TException;
/**
* List the regions associated with a table.
+ *
* @return list of region descriptors
- *
+ *
* @param tableName table name
*/
- public List getTableRegions(byte[] tableName) throws IOError, TException;
+ List getTableRegions(ByteBuffer tableName) throws IOError, TException;
/**
* Create a table with the specified column families. The name
* field for each ColumnDescriptor must be set and must end in a
* colon (:). All other fields are optional and will get default
* values if not explicitly specified.
- *
+ *
* @throws IllegalArgument if an input parameter is invalid
+ *
* @throws AlreadyExists if the table name already exists
- *
+ *
* @param tableName name of table to create
- *
+ *
* @param columnFamilies list of column family descriptors
*/
- public void createTable(byte[] tableName, List columnFamilies) throws IOError, IllegalArgument, AlreadyExists, TException;
+ void createTable(ByteBuffer tableName, List columnFamilies) throws IOError, IllegalArgument, AlreadyExists, TException;
/**
* Deletes a table
- *
+ *
* @throws IOError if table doesn't exist on server or there was some other
* problem
- *
+ *
* @param tableName name of table to delete
*/
- public void deleteTable(byte[] tableName) throws IOError, TException;
+ void deleteTable(ByteBuffer tableName) throws IOError, TException;
/**
* Get a single TCell for the specified table, row, and column at the
* latest timestamp. Returns an empty list if no such value exists.
- *
+ *
* @return value for specified row/column
- *
+ *
* @param tableName name of table
- *
+ *
* @param row row key
- *
+ *
* @param column column name
*/
- public List get(byte[] tableName, byte[] row, byte[] column) throws IOError, TException;
+ List get(ByteBuffer tableName, ByteBuffer row, ByteBuffer column) throws IOError, TException;
/**
* Get the specified number of versions for the specified table,
* row, and column.
- *
+ *
* @return list of cells for specified row/column
- *
+ *
* @param tableName name of table
- *
+ *
* @param row row key
- *
+ *
* @param column column name
- *
+ *
* @param numVersions number of versions to retrieve
*/
- public List getVer(byte[] tableName, byte[] row, byte[] column, int numVersions) throws IOError, TException;
+ List getVer(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, int numVersions) throws IOError, TException;
/**
* Get the specified number of versions for the specified table,
* row, and column. Only versions less than or equal to the specified
* timestamp will be returned.
- *
+ *
* @return list of cells for specified row/column
- *
+ *
* @param tableName name of table
- *
+ *
* @param row row key
- *
+ *
* @param column column name
- *
+ *
* @param timestamp timestamp
- *
+ *
* @param numVersions number of versions to retrieve
*/
- public List getVerTs(byte[] tableName, byte[] row, byte[] column, long timestamp, int numVersions) throws IOError, TException;
+ List getVerTs(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, long timestamp, int numVersions) throws IOError, TException;
/**
* Get all the data for the specified table and row at the latest
* timestamp. Returns an empty list if the row does not exist.
- *
+ *
* @return TRowResult containing the row and map of columns to TCells
- *
+ *
* @param tableName name of table
- *
+ *
* @param row row key
*/
- public List getRow(byte[] tableName, byte[] row) throws IOError, TException;
+ List getRow(ByteBuffer tableName, ByteBuffer row) throws IOError, TException;
/**
* Get the specified columns for the specified table and row at the latest
* timestamp. Returns an empty list if the row does not exist.
- *
+ *
* @return TRowResult containing the row and map of columns to TCells
- *
+ *
* @param tableName name of table
- *
+ *
* @param row row key
- *
+ *
* @param columns List of columns to return, null for all columns
*/
- public List getRowWithColumns(byte[] tableName, byte[] row, List columns) throws IOError, TException;
+ List getRowWithColumns(ByteBuffer tableName, ByteBuffer row, List columns) throws IOError, TException;
/**
* Get all the data for the specified table and row at the specified
* timestamp. Returns an empty list if the row does not exist.
- *
+ *
* @return TRowResult containing the row and map of columns to TCells
- *
+ *
* @param tableName name of the table
- *
+ *
* @param row row key
- *
+ *
* @param timestamp timestamp
*/
- public List getRowTs(byte[] tableName, byte[] row, long timestamp) throws IOError, TException;
+ List getRowTs(ByteBuffer tableName, ByteBuffer row, long timestamp) throws IOError, TException;
/**
* Get the specified columns for the specified table and row at the specified
* timestamp. Returns an empty list if the row does not exist.
- *
+ *
* @return TRowResult containing the row and map of columns to TCells
- *
+ *
* @param tableName name of table
- *
+ *
* @param row row key
- *
+ *
* @param columns List of columns to return, null for all columns
- *
+ *
* @param timestamp
*/
- public List getRowWithColumnsTs(byte[] tableName, byte[] row, List columns, long timestamp) throws IOError, TException;
+ List getRowWithColumnsTs(ByteBuffer tableName, ByteBuffer row, List columns, long timestamp) throws IOError, TException;
/**
* Apply a series of mutations (updates/deletes) to a row in a
* single transaction. If an exception is thrown, then the
* transaction is aborted. Default current timestamp is used, and
* all entries will have an identical timestamp.
- *
+ *
* @param tableName name of table
- *
+ *
* @param row row key
- *
+ *
* @param mutations list of mutation commands
*/
- public void mutateRow(byte[] tableName, byte[] row, List mutations) throws IOError, IllegalArgument, TException;
+ void mutateRow(ByteBuffer tableName, ByteBuffer row, List mutations) throws IOError, IllegalArgument, TException;
/**
* Apply a series of mutations (updates/deletes) to a row in a
* single transaction. If an exception is thrown, then the
* transaction is aborted. The specified timestamp is used, and
* all entries will have an identical timestamp.
- *
+ *
* @param tableName name of table
- *
+ *
* @param row row key
- *
+ *
* @param mutations list of mutation commands
- *
+ *
* @param timestamp timestamp
*/
- public void mutateRowTs(byte[] tableName, byte[] row, List mutations, long timestamp) throws IOError, IllegalArgument, TException;
+ void mutateRowTs(ByteBuffer tableName, ByteBuffer row, List mutations, long timestamp) throws IOError, IllegalArgument, TException;
/**
* Apply a series of batches (each a series of mutations on a single row)
* in a single transaction. If an exception is thrown, then the
* transaction is aborted. Default current timestamp is used, and
* all entries will have an identical timestamp.
- *
+ *
* @param tableName name of table
- *
+ *
* @param rowBatches list of row batches
*/
- public void mutateRows(byte[] tableName, List rowBatches) throws IOError, IllegalArgument, TException;
+ void mutateRows(ByteBuffer tableName, List rowBatches) throws IOError, IllegalArgument, TException;
/**
* Apply a series of batches (each a series of mutations on a single row)
* in a single transaction. If an exception is thrown, then the
* transaction is aborted. The specified timestamp is used, and
* all entries will have an identical timestamp.
- *
+ *
* @param tableName name of table
- *
+ *
* @param rowBatches list of row batches
- *
+ *
* @param timestamp timestamp
*/
- public void mutateRowsTs(byte[] tableName, List rowBatches, long timestamp) throws IOError, IllegalArgument, TException;
+ void mutateRowsTs(ByteBuffer tableName, List rowBatches, long timestamp) throws IOError, IllegalArgument, TException;
/**
* Atomically increment the column value specified. Returns the next value post increment.
- *
+ *
* @param tableName name of table
- *
+ *
* @param row row to increment
- *
+ *
* @param column name of column
- *
+ *
* @param value amount to increment by
*/
- public long atomicIncrement(byte[] tableName, byte[] row, byte[] column, long value) throws IOError, IllegalArgument, TException;
+ long atomicIncrement(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, long value) throws IOError, IllegalArgument, TException;
/**
* Delete all cells that match the passed row and column.
- *
+ *
* @param tableName name of table
- *
+ *
* @param row Row to update
- *
+ *
* @param column name of column whose value is to be deleted
*/
- public void deleteAll(byte[] tableName, byte[] row, byte[] column) throws IOError, TException;
+ void deleteAll(ByteBuffer tableName, ByteBuffer row, ByteBuffer column) throws IOError, TException;
/**
* Delete all cells that match the passed row and column and whose
* timestamp is equal-to or older than the passed timestamp.
- *
+ *
* @param tableName name of table
- *
+ *
* @param row Row to update
- *
+ *
* @param column name of column whose value is to be deleted
- *
+ *
* @param timestamp timestamp
*/
- public void deleteAllTs(byte[] tableName, byte[] row, byte[] column, long timestamp) throws IOError, TException;
+ void deleteAllTs(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, long timestamp) throws IOError, TException;
/**
* Completely delete the row's cells.
- *
+ *
* @param tableName name of table
- *
+ *
* @param row key of the row to be completely deleted.
*/
- public void deleteAllRow(byte[] tableName, byte[] row) throws IOError, TException;
+ void deleteAllRow(ByteBuffer tableName, ByteBuffer row) throws IOError, TException;
/**
* Completely delete the row's cells marked with a timestamp
* equal-to or older than the passed timestamp.
- *
+ *
* @param tableName name of table
- *
+ *
* @param row key of the row to be completely deleted.
- *
+ *
* @param timestamp timestamp
*/
- public void deleteAllRowTs(byte[] tableName, byte[] row, long timestamp) throws IOError, TException;
+ void deleteAllRowTs(ByteBuffer tableName, ByteBuffer row, long timestamp) throws IOError, TException;
/**
* Get a scanner on the current table starting at the specified row and
* ending at the last row in the table. Return the specified columns.
- *
+ *
* @return scanner id to be used with other scanner procedures
- *
+ *
* @param tableName name of table
- *
+ *
* @param startRow Starting row in table to scan.
* Send "" (empty string) to start at the first row.
- *
+ *
* @param columns columns to scan. If column name is a column family, all
* columns of the specified column family are returned. It's also possible
* to pass a regex in the column qualifier.
*/
- public int scannerOpen(byte[] tableName, byte[] startRow, List columns) throws IOError, TException;
+ int scannerOpen(ByteBuffer tableName, ByteBuffer startRow, List columns) throws IOError, TException;
/**
* Get a scanner on the current table starting and stopping at the
* specified rows. ending at the last row in the table. Return the
* specified columns.
- *
+ *
* @return scanner id to be used with other scanner procedures
- *
+ *
* @param tableName name of table
- *
+ *
* @param startRow Starting row in table to scan.
* Send "" (empty string) to start at the first row.
- *
+ *
* @param stopRow row to stop scanning on. This row is *not* included in the
* scanner's results
- *
+ *
* @param columns columns to scan. If column name is a column family, all
* columns of the specified column family are returned. It's also possible
* to pass a regex in the column qualifier.
*/
- public int scannerOpenWithStop(byte[] tableName, byte[] startRow, byte[] stopRow, List columns) throws IOError, TException;
+ int scannerOpenWithStop(ByteBuffer tableName, ByteBuffer startRow, ByteBuffer stopRow, List columns) throws IOError, TException;
/**
* Open a scanner for a given prefix. That is all rows will have the specified
* prefix. No other rows will be returned.
- *
+ *
* @return scanner id to use with other scanner calls
- *
+ *
* @param tableName name of table
- *
+ *
* @param startAndPrefix the prefix (and thus start row) of the keys you want
- *
+ *
* @param columns the columns you want returned
*/
- public int scannerOpenWithPrefix(byte[] tableName, byte[] startAndPrefix, List columns) throws IOError, TException;
+ int scannerOpenWithPrefix(ByteBuffer tableName, ByteBuffer startAndPrefix, List columns) throws IOError, TException;
/**
* Get a scanner on the current table starting at the specified row and
* ending at the last row in the table. Return the specified columns.
* Only values with the specified timestamp are returned.
- *
+ *
* @return scanner id to be used with other scanner procedures
- *
+ *
* @param tableName name of table
- *
+ *
* @param startRow Starting row in table to scan.
* Send "" (empty string) to start at the first row.
- *
+ *
* @param columns columns to scan. If column name is a column family, all
* columns of the specified column family are returned. It's also possible
* to pass a regex in the column qualifier.
- *
+ *
* @param timestamp timestamp
*/
- public int scannerOpenTs(byte[] tableName, byte[] startRow, List columns, long timestamp) throws IOError, TException;
+ int scannerOpenTs(ByteBuffer tableName, ByteBuffer startRow, List columns, long timestamp) throws IOError, TException;
/**
* Get a scanner on the current table starting and stopping at the
* specified rows. ending at the last row in the table. Return the
* specified columns. Only values with the specified timestamp are
* returned.
- *
+ *
* @return scanner id to be used with other scanner procedures
- *
+ *
* @param tableName name of table
- *
+ *
* @param startRow Starting row in table to scan.
* Send "" (empty string) to start at the first row.
- *
+ *
* @param stopRow row to stop scanning on. This row is *not* included in the
* scanner's results
- *
+ *
* @param columns columns to scan. If column name is a column family, all
* columns of the specified column family are returned. It's also possible
* to pass a regex in the column qualifier.
- *
+ *
* @param timestamp timestamp
*/
- public int scannerOpenWithStopTs(byte[] tableName, byte[] startRow, byte[] stopRow, List columns, long timestamp) throws IOError, TException;
+ int scannerOpenWithStopTs(ByteBuffer tableName, ByteBuffer startRow, ByteBuffer stopRow, List columns, long timestamp) throws IOError, TException;
/**
* Returns the scanner's current row value and advances to the next
* row in the table. When there are no more rows in the table, or a key
* greater-than-or-equal-to the scanner's specified stopRow is reached,
* an empty list is returned.
- *
+ *
* @return a TRowResult containing the current row and a map of the columns to TCells.
+ *
* @throws IllegalArgument if ScannerID is invalid
+ *
* @throws NotFound when the scanner reaches the end
- *
+ *
* @param id id of a scanner returned by scannerOpen
*/
- public List scannerGet(int id) throws IOError, IllegalArgument, TException;
+ List scannerGet(int id) throws IOError, IllegalArgument, TException;
/**
* Returns, starting at the scanner's current row value nbRows worth of
* rows and advances to the next row in the table. When there are no more
* rows in the table, or a key greater-than-or-equal-to the scanner's
* specified stopRow is reached, an empty list is returned.
- *
+ *
* @return a TRowResult containing the current row and a map of the columns to TCells.
+ *
* @throws IllegalArgument if ScannerID is invalid
+ *
* @throws NotFound when the scanner reaches the end
- *
+ *
* @param id id of a scanner returned by scannerOpen
- *
+ *
* @param nbRows number of results to return
*/
- public List scannerGetList(int id, int nbRows) throws IOError, IllegalArgument, TException;
+ List scannerGetList(int id, int nbRows) throws IOError, IllegalArgument, TException;
/**
* Closes the server-state associated with an open scanner.
- *
+ *
* @throws IllegalArgument if ScannerID is invalid
- *
+ *
* @param id id of a scanner returned by scannerOpen
*/
- public void scannerClose(int id) throws IOError, IllegalArgument, TException;
+ void scannerClose(int id) throws IOError, IllegalArgument, TException;
+
+ }
+
+ public interface AsyncIface {
+
+ void enableTable(ByteBuffer tableName, AsyncMethodCallback resultHandler) throws TException;
+
+ void disableTable(ByteBuffer tableName, AsyncMethodCallback resultHandler) throws TException;
+
+ void isTableEnabled(ByteBuffer tableName, AsyncMethodCallback resultHandler) throws TException;
+
+ void compact(ByteBuffer tableNameOrRegionName, AsyncMethodCallback resultHandler) throws TException;
+
+ void majorCompact(ByteBuffer tableNameOrRegionName, AsyncMethodCallback resultHandler) throws TException;
+
+ void getTableNames(AsyncMethodCallback resultHandler) throws TException;
+
+ void getColumnDescriptors(ByteBuffer tableName, AsyncMethodCallback resultHandler) throws TException;
+
+ void getTableRegions(ByteBuffer tableName, AsyncMethodCallback resultHandler) throws TException;
+
+ void createTable(ByteBuffer tableName, List columnFamilies, AsyncMethodCallback resultHandler) throws TException;
+
+ void deleteTable(ByteBuffer tableName, AsyncMethodCallback resultHandler) throws TException;
+
+ void get(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, AsyncMethodCallback resultHandler) throws TException;
+
+ void getVer(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, int numVersions, AsyncMethodCallback resultHandler) throws TException;
+
+ void getVerTs(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, long timestamp, int numVersions, AsyncMethodCallback resultHandler) throws TException;
+
+ void getRow(ByteBuffer tableName, ByteBuffer row, AsyncMethodCallback resultHandler) throws TException;
+
+ void getRowWithColumns(ByteBuffer tableName, ByteBuffer row, List columns, AsyncMethodCallback resultHandler) throws TException;
+
+ void getRowTs(ByteBuffer tableName, ByteBuffer row, long timestamp, AsyncMethodCallback resultHandler) throws TException;
+
+ void getRowWithColumnsTs(ByteBuffer tableName, ByteBuffer row, List columns, long timestamp, AsyncMethodCallback resultHandler) throws TException;
+
+ void mutateRow(ByteBuffer tableName, ByteBuffer row, List mutations, AsyncMethodCallback resultHandler) throws TException;
+
+ void mutateRowTs(ByteBuffer tableName, ByteBuffer row, List mutations, long timestamp, AsyncMethodCallback resultHandler) throws TException;
+
+ void mutateRows(ByteBuffer tableName, List rowBatches, AsyncMethodCallback resultHandler) throws TException;
+
+ void mutateRowsTs(ByteBuffer tableName, List rowBatches, long timestamp, AsyncMethodCallback resultHandler) throws TException;
+
+ void atomicIncrement(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, long value, AsyncMethodCallback resultHandler) throws TException;
+
+ void deleteAll(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, AsyncMethodCallback resultHandler) throws TException;
+
+ void deleteAllTs(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, long timestamp, AsyncMethodCallback resultHandler) throws TException;
+
+ void deleteAllRow(ByteBuffer tableName, ByteBuffer row, AsyncMethodCallback resultHandler) throws TException;
+
+ void deleteAllRowTs(ByteBuffer tableName, ByteBuffer row, long timestamp, AsyncMethodCallback resultHandler) throws TException;
+
+ void scannerOpen(ByteBuffer tableName, ByteBuffer startRow, List columns, AsyncMethodCallback resultHandler) throws TException;
+
+ void scannerOpenWithStop(ByteBuffer tableName, ByteBuffer startRow, ByteBuffer stopRow, List columns, AsyncMethodCallback resultHandler) throws TException;
+
+ void scannerOpenWithPrefix(ByteBuffer tableName, ByteBuffer startAndPrefix, List columns, AsyncMethodCallback resultHandler) throws TException;
+
+ void scannerOpenTs(ByteBuffer tableName, ByteBuffer startRow, List columns, long timestamp, AsyncMethodCallback resultHandler) throws TException;
+
+ void scannerOpenWithStopTs(ByteBuffer tableName, ByteBuffer startRow, ByteBuffer stopRow, List columns, long timestamp, AsyncMethodCallback resultHandler) throws TException;
+
+ void scannerGet(int id, AsyncMethodCallback resultHandler) throws TException;
+
+ void scannerGetList(int id, int nbRows, AsyncMethodCallback resultHandler) throws TException;
+
+ void scannerClose(int id, AsyncMethodCallback resultHandler) throws TException;
}
- public static class Client implements Iface {
+ public static class Client implements TServiceClient, Iface {
+ public static class Factory implements TServiceClientFactory {
+ public Factory() {}
+ public Client getClient(TProtocol prot) {
+ return new Client(prot);
+ }
+ public Client getClient(TProtocol iprot, TProtocol oprot) {
+ return new Client(iprot, oprot);
+ }
+ }
+
public Client(TProtocol prot)
{
this(prot, prot);
@@ -497,17 +578,18 @@ public class Hbase {
return this.oprot_;
}
- public void enableTable(byte[] tableName) throws IOError, TException
+ @Override
+ public void enableTable(ByteBuffer tableName) throws IOError, TException
{
send_enableTable(tableName);
recv_enableTable();
}
- public void send_enableTable(byte[] tableName) throws TException
+ public void send_enableTable(ByteBuffer tableName) throws TException
{
- oprot_.writeMessageBegin(new TMessage("enableTable", TMessageType.CALL, seqid_));
+ oprot_.writeMessageBegin(new TMessage("enableTable", TMessageType.CALL, ++seqid_));
enableTable_args args = new enableTable_args();
- args.tableName = tableName;
+ args.setTableName(tableName);
args.write(oprot_);
oprot_.writeMessageEnd();
oprot_.getTransport().flush();
@@ -521,6 +603,9 @@ public class Hbase {
iprot_.readMessageEnd();
throw x;
}
+ if (msg.seqid != seqid_) {
+ throw new TApplicationException(TApplicationException.BAD_SEQUENCE_ID, "enableTable failed: out of sequence response");
+ }
enableTable_result result = new enableTable_result();
result.read(iprot_);
iprot_.readMessageEnd();
@@ -530,17 +615,18 @@ public class Hbase {
return;
}
- public void disableTable(byte[] tableName) throws IOError, TException
+ @Override
+ public void disableTable(ByteBuffer tableName) throws IOError, TException
{
send_disableTable(tableName);
recv_disableTable();
}
- public void send_disableTable(byte[] tableName) throws TException
+ public void send_disableTable(ByteBuffer tableName) throws TException
{
- oprot_.writeMessageBegin(new TMessage("disableTable", TMessageType.CALL, seqid_));
+ oprot_.writeMessageBegin(new TMessage("disableTable", TMessageType.CALL, ++seqid_));
disableTable_args args = new disableTable_args();
- args.tableName = tableName;
+ args.setTableName(tableName);
args.write(oprot_);
oprot_.writeMessageEnd();
oprot_.getTransport().flush();
@@ -554,6 +640,9 @@ public class Hbase {
iprot_.readMessageEnd();
throw x;
}
+ if (msg.seqid != seqid_) {
+ throw new TApplicationException(TApplicationException.BAD_SEQUENCE_ID, "disableTable failed: out of sequence response");
+ }
disableTable_result result = new disableTable_result();
result.read(iprot_);
iprot_.readMessageEnd();
@@ -563,17 +652,18 @@ public class Hbase {
return;
}
- public boolean isTableEnabled(byte[] tableName) throws IOError, TException
+ @Override
+ public boolean isTableEnabled(ByteBuffer tableName) throws IOError, TException
{
send_isTableEnabled(tableName);
return recv_isTableEnabled();
}
- public void send_isTableEnabled(byte[] tableName) throws TException
+ public void send_isTableEnabled(ByteBuffer tableName) throws TException
{
- oprot_.writeMessageBegin(new TMessage("isTableEnabled", TMessageType.CALL, seqid_));
+ oprot_.writeMessageBegin(new TMessage("isTableEnabled", TMessageType.CALL, ++seqid_));
isTableEnabled_args args = new isTableEnabled_args();
- args.tableName = tableName;
+ args.setTableName(tableName);
args.write(oprot_);
oprot_.writeMessageEnd();
oprot_.getTransport().flush();
@@ -587,6 +677,9 @@ public class Hbase {
iprot_.readMessageEnd();
throw x;
}
+ if (msg.seqid != seqid_) {
+ throw new TApplicationException(TApplicationException.BAD_SEQUENCE_ID, "isTableEnabled failed: out of sequence response");
+ }
isTableEnabled_result result = new isTableEnabled_result();
result.read(iprot_);
iprot_.readMessageEnd();
@@ -599,17 +692,18 @@ public class Hbase {
throw new TApplicationException(TApplicationException.MISSING_RESULT, "isTableEnabled failed: unknown result");
}
- public void compact(byte[] tableNameOrRegionName) throws IOError, TException
+ @Override
+ public void compact(ByteBuffer tableNameOrRegionName) throws IOError, TException
{
send_compact(tableNameOrRegionName);
recv_compact();
}
- public void send_compact(byte[] tableNameOrRegionName) throws TException
+ public void send_compact(ByteBuffer tableNameOrRegionName) throws TException
{
- oprot_.writeMessageBegin(new TMessage("compact", TMessageType.CALL, seqid_));
+ oprot_.writeMessageBegin(new TMessage("compact", TMessageType.CALL, ++seqid_));
compact_args args = new compact_args();
- args.tableNameOrRegionName = tableNameOrRegionName;
+ args.setTableNameOrRegionName(tableNameOrRegionName);
args.write(oprot_);
oprot_.writeMessageEnd();
oprot_.getTransport().flush();
@@ -623,6 +717,9 @@ public class Hbase {
iprot_.readMessageEnd();
throw x;
}
+ if (msg.seqid != seqid_) {
+ throw new TApplicationException(TApplicationException.BAD_SEQUENCE_ID, "compact failed: out of sequence response");
+ }
compact_result result = new compact_result();
result.read(iprot_);
iprot_.readMessageEnd();
@@ -632,17 +729,18 @@ public class Hbase {
return;
}
- public void majorCompact(byte[] tableNameOrRegionName) throws IOError, TException
+ @Override
+ public void majorCompact(ByteBuffer tableNameOrRegionName) throws IOError, TException
{
send_majorCompact(tableNameOrRegionName);
recv_majorCompact();
}
- public void send_majorCompact(byte[] tableNameOrRegionName) throws TException
+ public void send_majorCompact(ByteBuffer tableNameOrRegionName) throws TException
{
- oprot_.writeMessageBegin(new TMessage("majorCompact", TMessageType.CALL, seqid_));
+ oprot_.writeMessageBegin(new TMessage("majorCompact", TMessageType.CALL, ++seqid_));
majorCompact_args args = new majorCompact_args();
- args.tableNameOrRegionName = tableNameOrRegionName;
+ args.setTableNameOrRegionName(tableNameOrRegionName);
args.write(oprot_);
oprot_.writeMessageEnd();
oprot_.getTransport().flush();
@@ -656,6 +754,9 @@ public class Hbase {
iprot_.readMessageEnd();
throw x;
}
+ if (msg.seqid != seqid_) {
+ throw new TApplicationException(TApplicationException.BAD_SEQUENCE_ID, "majorCompact failed: out of sequence response");
+ }
majorCompact_result result = new majorCompact_result();
result.read(iprot_);
iprot_.readMessageEnd();
@@ -665,7 +766,8 @@ public class Hbase {
return;
}
- public List getTableNames() throws IOError, TException
+ @Override
+ public List getTableNames() throws IOError, TException
{
send_getTableNames();
return recv_getTableNames();
@@ -673,14 +775,14 @@ public class Hbase {
public void send_getTableNames() throws TException
{
- oprot_.writeMessageBegin(new TMessage("getTableNames", TMessageType.CALL, seqid_));
+ oprot_.writeMessageBegin(new TMessage("getTableNames", TMessageType.CALL, ++seqid_));
getTableNames_args args = new getTableNames_args();
args.write(oprot_);
oprot_.writeMessageEnd();
oprot_.getTransport().flush();
}
- public List recv_getTableNames() throws IOError, TException
+ public List recv_getTableNames() throws IOError, TException
{
TMessage msg = iprot_.readMessageBegin();
if (msg.type == TMessageType.EXCEPTION) {
@@ -688,6 +790,9 @@ public class Hbase {
iprot_.readMessageEnd();
throw x;
}
+ if (msg.seqid != seqid_) {
+ throw new TApplicationException(TApplicationException.BAD_SEQUENCE_ID, "getTableNames failed: out of sequence response");
+ }
getTableNames_result result = new getTableNames_result();
result.read(iprot_);
iprot_.readMessageEnd();
@@ -700,23 +805,24 @@ public class Hbase {
throw new TApplicationException(TApplicationException.MISSING_RESULT, "getTableNames failed: unknown result");
}
- public Map getColumnDescriptors(byte[] tableName) throws IOError, TException
+ @Override
+ public Map getColumnDescriptors(ByteBuffer tableName) throws IOError, TException
{
send_getColumnDescriptors(tableName);
return recv_getColumnDescriptors();
}
- public void send_getColumnDescriptors(byte[] tableName) throws TException
+ public void send_getColumnDescriptors(ByteBuffer tableName) throws TException
{
- oprot_.writeMessageBegin(new TMessage("getColumnDescriptors", TMessageType.CALL, seqid_));
+ oprot_.writeMessageBegin(new TMessage("getColumnDescriptors", TMessageType.CALL, ++seqid_));
getColumnDescriptors_args args = new getColumnDescriptors_args();
- args.tableName = tableName;
+ args.setTableName(tableName);
args.write(oprot_);
oprot_.writeMessageEnd();
oprot_.getTransport().flush();
}
- public Map recv_getColumnDescriptors() throws IOError, TException
+ public Map recv_getColumnDescriptors() throws IOError, TException
{
TMessage msg = iprot_.readMessageBegin();
if (msg.type == TMessageType.EXCEPTION) {
@@ -724,6 +830,9 @@ public class Hbase {
iprot_.readMessageEnd();
throw x;
}
+ if (msg.seqid != seqid_) {
+ throw new TApplicationException(TApplicationException.BAD_SEQUENCE_ID, "getColumnDescriptors failed: out of sequence response");
+ }
getColumnDescriptors_result result = new getColumnDescriptors_result();
result.read(iprot_);
iprot_.readMessageEnd();
@@ -736,17 +845,18 @@ public class Hbase {
throw new TApplicationException(TApplicationException.MISSING_RESULT, "getColumnDescriptors failed: unknown result");
}
- public List getTableRegions(byte[] tableName) throws IOError, TException
+ @Override
+ public List getTableRegions(ByteBuffer tableName) throws IOError, TException
{
send_getTableRegions(tableName);
return recv_getTableRegions();
}
- public void send_getTableRegions(byte[] tableName) throws TException
+ public void send_getTableRegions(ByteBuffer tableName) throws TException
{
- oprot_.writeMessageBegin(new TMessage("getTableRegions", TMessageType.CALL, seqid_));
+ oprot_.writeMessageBegin(new TMessage("getTableRegions", TMessageType.CALL, ++seqid_));
getTableRegions_args args = new getTableRegions_args();
- args.tableName = tableName;
+ args.setTableName(tableName);
args.write(oprot_);
oprot_.writeMessageEnd();
oprot_.getTransport().flush();
@@ -760,6 +870,9 @@ public class Hbase {
iprot_.readMessageEnd();
throw x;
}
+ if (msg.seqid != seqid_) {
+ throw new TApplicationException(TApplicationException.BAD_SEQUENCE_ID, "getTableRegions failed: out of sequence response");
+ }
getTableRegions_result result = new getTableRegions_result();
result.read(iprot_);
iprot_.readMessageEnd();
@@ -772,18 +885,19 @@ public class Hbase {
throw new TApplicationException(TApplicationException.MISSING_RESULT, "getTableRegions failed: unknown result");
}
- public void createTable(byte[] tableName, List columnFamilies) throws IOError, IllegalArgument, AlreadyExists, TException
+ @Override
+ public void createTable(ByteBuffer tableName, List columnFamilies) throws IOError, IllegalArgument, AlreadyExists, TException
{
send_createTable(tableName, columnFamilies);
recv_createTable();
}
- public void send_createTable(byte[] tableName, List columnFamilies) throws TException
+ public void send_createTable(ByteBuffer tableName, List columnFamilies) throws TException
{
- oprot_.writeMessageBegin(new TMessage("createTable", TMessageType.CALL, seqid_));
+ oprot_.writeMessageBegin(new TMessage("createTable", TMessageType.CALL, ++seqid_));
createTable_args args = new createTable_args();
- args.tableName = tableName;
- args.columnFamilies = columnFamilies;
+ args.setTableName(tableName);
+ args.setColumnFamilies(columnFamilies);
args.write(oprot_);
oprot_.writeMessageEnd();
oprot_.getTransport().flush();
@@ -797,6 +911,9 @@ public class Hbase {
iprot_.readMessageEnd();
throw x;
}
+ if (msg.seqid != seqid_) {
+ throw new TApplicationException(TApplicationException.BAD_SEQUENCE_ID, "createTable failed: out of sequence response");
+ }
createTable_result result = new createTable_result();
result.read(iprot_);
iprot_.readMessageEnd();
@@ -812,17 +929,18 @@ public class Hbase {
return;
}
- public void deleteTable(byte[] tableName) throws IOError, TException
+ @Override
+ public void deleteTable(ByteBuffer tableName) throws IOError, TException
{
send_deleteTable(tableName);
recv_deleteTable();
}
- public void send_deleteTable(byte[] tableName) throws TException
+ public void send_deleteTable(ByteBuffer tableName) throws TException
{
- oprot_.writeMessageBegin(new TMessage("deleteTable", TMessageType.CALL, seqid_));
+ oprot_.writeMessageBegin(new TMessage("deleteTable", TMessageType.CALL, ++seqid_));
deleteTable_args args = new deleteTable_args();
- args.tableName = tableName;
+ args.setTableName(tableName);
args.write(oprot_);
oprot_.writeMessageEnd();
oprot_.getTransport().flush();
@@ -836,6 +954,9 @@ public class Hbase {
iprot_.readMessageEnd();
throw x;
}
+ if (msg.seqid != seqid_) {
+ throw new TApplicationException(TApplicationException.BAD_SEQUENCE_ID, "deleteTable failed: out of sequence response");
+ }
deleteTable_result result = new deleteTable_result();
result.read(iprot_);
iprot_.readMessageEnd();
@@ -845,19 +966,20 @@ public class Hbase {
return;
}
- public List get(byte[] tableName, byte[] row, byte[] column) throws IOError, TException
+ @Override
+ public List get(ByteBuffer tableName, ByteBuffer row, ByteBuffer column) throws IOError, TException
{
send_get(tableName, row, column);
return recv_get();
}
- public void send_get(byte[] tableName, byte[] row, byte[] column) throws TException
+ public void send_get(ByteBuffer tableName, ByteBuffer row, ByteBuffer column) throws TException
{
- oprot_.writeMessageBegin(new TMessage("get", TMessageType.CALL, seqid_));
+ oprot_.writeMessageBegin(new TMessage("get", TMessageType.CALL, ++seqid_));
get_args args = new get_args();
- args.tableName = tableName;
- args.row = row;
- args.column = column;
+ args.setTableName(tableName);
+ args.setRow(row);
+ args.setColumn(column);
args.write(oprot_);
oprot_.writeMessageEnd();
oprot_.getTransport().flush();
@@ -871,6 +993,9 @@ public class Hbase {
iprot_.readMessageEnd();
throw x;
}
+ if (msg.seqid != seqid_) {
+ throw new TApplicationException(TApplicationException.BAD_SEQUENCE_ID, "get failed: out of sequence response");
+ }
get_result result = new get_result();
result.read(iprot_);
iprot_.readMessageEnd();
@@ -883,20 +1008,21 @@ public class Hbase {
throw new TApplicationException(TApplicationException.MISSING_RESULT, "get failed: unknown result");
}
- public List getVer(byte[] tableName, byte[] row, byte[] column, int numVersions) throws IOError, TException
+ @Override
+ public List getVer(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, int numVersions) throws IOError, TException
{
send_getVer(tableName, row, column, numVersions);
return recv_getVer();
}
- public void send_getVer(byte[] tableName, byte[] row, byte[] column, int numVersions) throws TException
+ public void send_getVer(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, int numVersions) throws TException
{
- oprot_.writeMessageBegin(new TMessage("getVer", TMessageType.CALL, seqid_));
+ oprot_.writeMessageBegin(new TMessage("getVer", TMessageType.CALL, ++seqid_));
getVer_args args = new getVer_args();
- args.tableName = tableName;
- args.row = row;
- args.column = column;
- args.numVersions = numVersions;
+ args.setTableName(tableName);
+ args.setRow(row);
+ args.setColumn(column);
+ args.setNumVersions(numVersions);
args.write(oprot_);
oprot_.writeMessageEnd();
oprot_.getTransport().flush();
@@ -910,6 +1036,9 @@ public class Hbase {
iprot_.readMessageEnd();
throw x;
}
+ if (msg.seqid != seqid_) {
+ throw new TApplicationException(TApplicationException.BAD_SEQUENCE_ID, "getVer failed: out of sequence response");
+ }
getVer_result result = new getVer_result();
result.read(iprot_);
iprot_.readMessageEnd();
@@ -922,21 +1051,22 @@ public class Hbase {
throw new TApplicationException(TApplicationException.MISSING_RESULT, "getVer failed: unknown result");
}
- public List getVerTs(byte[] tableName, byte[] row, byte[] column, long timestamp, int numVersions) throws IOError, TException
+ @Override
+ public List getVerTs(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, long timestamp, int numVersions) throws IOError, TException
{
send_getVerTs(tableName, row, column, timestamp, numVersions);
return recv_getVerTs();
}
- public void send_getVerTs(byte[] tableName, byte[] row, byte[] column, long timestamp, int numVersions) throws TException
+ public void send_getVerTs(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, long timestamp, int numVersions) throws TException
{
- oprot_.writeMessageBegin(new TMessage("getVerTs", TMessageType.CALL, seqid_));
+ oprot_.writeMessageBegin(new TMessage("getVerTs", TMessageType.CALL, ++seqid_));
getVerTs_args args = new getVerTs_args();
- args.tableName = tableName;
- args.row = row;
- args.column = column;
- args.timestamp = timestamp;
- args.numVersions = numVersions;
+ args.setTableName(tableName);
+ args.setRow(row);
+ args.setColumn(column);
+ args.setTimestamp(timestamp);
+ args.setNumVersions(numVersions);
args.write(oprot_);
oprot_.writeMessageEnd();
oprot_.getTransport().flush();
@@ -950,6 +1080,9 @@ public class Hbase {
iprot_.readMessageEnd();
throw x;
}
+ if (msg.seqid != seqid_) {
+ throw new TApplicationException(TApplicationException.BAD_SEQUENCE_ID, "getVerTs failed: out of sequence response");
+ }
getVerTs_result result = new getVerTs_result();
result.read(iprot_);
iprot_.readMessageEnd();
@@ -962,18 +1095,19 @@ public class Hbase {
throw new TApplicationException(TApplicationException.MISSING_RESULT, "getVerTs failed: unknown result");
}
- public List getRow(byte[] tableName, byte[] row) throws IOError, TException
+ @Override
+ public List getRow(ByteBuffer tableName, ByteBuffer row) throws IOError, TException
{
send_getRow(tableName, row);
return recv_getRow();
}
- public void send_getRow(byte[] tableName, byte[] row) throws TException
+ public void send_getRow(ByteBuffer tableName, ByteBuffer row) throws TException
{
- oprot_.writeMessageBegin(new TMessage("getRow", TMessageType.CALL, seqid_));
+ oprot_.writeMessageBegin(new TMessage("getRow", TMessageType.CALL, ++seqid_));
getRow_args args = new getRow_args();
- args.tableName = tableName;
- args.row = row;
+ args.setTableName(tableName);
+ args.setRow(row);
args.write(oprot_);
oprot_.writeMessageEnd();
oprot_.getTransport().flush();
@@ -987,6 +1121,9 @@ public class Hbase {
iprot_.readMessageEnd();
throw x;
}
+ if (msg.seqid != seqid_) {
+ throw new TApplicationException(TApplicationException.BAD_SEQUENCE_ID, "getRow failed: out of sequence response");
+ }
getRow_result result = new getRow_result();
result.read(iprot_);
iprot_.readMessageEnd();
@@ -999,19 +1136,20 @@ public class Hbase {
throw new TApplicationException(TApplicationException.MISSING_RESULT, "getRow failed: unknown result");
}
- public List getRowWithColumns(byte[] tableName, byte[] row, List columns) throws IOError, TException
+ @Override
+ public List getRowWithColumns(ByteBuffer tableName, ByteBuffer row, List columns) throws IOError, TException
{
send_getRowWithColumns(tableName, row, columns);
return recv_getRowWithColumns();
}
- public void send_getRowWithColumns(byte[] tableName, byte[] row, List columns) throws TException
+ public void send_getRowWithColumns(ByteBuffer tableName, ByteBuffer row, List columns) throws TException
{
- oprot_.writeMessageBegin(new TMessage("getRowWithColumns", TMessageType.CALL, seqid_));
+ oprot_.writeMessageBegin(new TMessage("getRowWithColumns", TMessageType.CALL, ++seqid_));
getRowWithColumns_args args = new getRowWithColumns_args();
- args.tableName = tableName;
- args.row = row;
- args.columns = columns;
+ args.setTableName(tableName);
+ args.setRow(row);
+ args.setColumns(columns);
args.write(oprot_);
oprot_.writeMessageEnd();
oprot_.getTransport().flush();
@@ -1025,6 +1163,9 @@ public class Hbase {
iprot_.readMessageEnd();
throw x;
}
+ if (msg.seqid != seqid_) {
+ throw new TApplicationException(TApplicationException.BAD_SEQUENCE_ID, "getRowWithColumns failed: out of sequence response");
+ }
getRowWithColumns_result result = new getRowWithColumns_result();
result.read(iprot_);
iprot_.readMessageEnd();
@@ -1037,19 +1178,20 @@ public class Hbase {
throw new TApplicationException(TApplicationException.MISSING_RESULT, "getRowWithColumns failed: unknown result");
}
- public List getRowTs(byte[] tableName, byte[] row, long timestamp) throws IOError, TException
+ @Override
+ public List getRowTs(ByteBuffer tableName, ByteBuffer row, long timestamp) throws IOError, TException
{
send_getRowTs(tableName, row, timestamp);
return recv_getRowTs();
}
- public void send_getRowTs(byte[] tableName, byte[] row, long timestamp) throws TException
+ public void send_getRowTs(ByteBuffer tableName, ByteBuffer row, long timestamp) throws TException
{
- oprot_.writeMessageBegin(new TMessage("getRowTs", TMessageType.CALL, seqid_));
+ oprot_.writeMessageBegin(new TMessage("getRowTs", TMessageType.CALL, ++seqid_));
getRowTs_args args = new getRowTs_args();
- args.tableName = tableName;
- args.row = row;
- args.timestamp = timestamp;
+ args.setTableName(tableName);
+ args.setRow(row);
+ args.setTimestamp(timestamp);
args.write(oprot_);
oprot_.writeMessageEnd();
oprot_.getTransport().flush();
@@ -1063,6 +1205,9 @@ public class Hbase {
iprot_.readMessageEnd();
throw x;
}
+ if (msg.seqid != seqid_) {
+ throw new TApplicationException(TApplicationException.BAD_SEQUENCE_ID, "getRowTs failed: out of sequence response");
+ }
getRowTs_result result = new getRowTs_result();
result.read(iprot_);
iprot_.readMessageEnd();
@@ -1075,20 +1220,21 @@ public class Hbase {
throw new TApplicationException(TApplicationException.MISSING_RESULT, "getRowTs failed: unknown result");
}
- public List getRowWithColumnsTs(byte[] tableName, byte[] row, List columns, long timestamp) throws IOError, TException
+ @Override
+ public List getRowWithColumnsTs(ByteBuffer tableName, ByteBuffer row, List columns, long timestamp) throws IOError, TException
{
send_getRowWithColumnsTs(tableName, row, columns, timestamp);
return recv_getRowWithColumnsTs();
}
- public void send_getRowWithColumnsTs(byte[] tableName, byte[] row, List columns, long timestamp) throws TException
+ public void send_getRowWithColumnsTs(ByteBuffer tableName, ByteBuffer row, List columns, long timestamp) throws TException
{
- oprot_.writeMessageBegin(new TMessage("getRowWithColumnsTs", TMessageType.CALL, seqid_));
+ oprot_.writeMessageBegin(new TMessage("getRowWithColumnsTs", TMessageType.CALL, ++seqid_));
getRowWithColumnsTs_args args = new getRowWithColumnsTs_args();
- args.tableName = tableName;
- args.row = row;
- args.columns = columns;
- args.timestamp = timestamp;
+ args.setTableName(tableName);
+ args.setRow(row);
+ args.setColumns(columns);
+ args.setTimestamp(timestamp);
args.write(oprot_);
oprot_.writeMessageEnd();
oprot_.getTransport().flush();
@@ -1102,6 +1248,9 @@ public class Hbase {
iprot_.readMessageEnd();
throw x;
}
+ if (msg.seqid != seqid_) {
+ throw new TApplicationException(TApplicationException.BAD_SEQUENCE_ID, "getRowWithColumnsTs failed: out of sequence response");
+ }
getRowWithColumnsTs_result result = new getRowWithColumnsTs_result();
result.read(iprot_);
iprot_.readMessageEnd();
@@ -1114,19 +1263,20 @@ public class Hbase {
throw new TApplicationException(TApplicationException.MISSING_RESULT, "getRowWithColumnsTs failed: unknown result");
}
- public void mutateRow(byte[] tableName, byte[] row, List