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 mutations) throws IOError, IllegalArgument, TException + @Override + public void mutateRow(ByteBuffer tableName, ByteBuffer row, List mutations) throws IOError, IllegalArgument, TException { send_mutateRow(tableName, row, mutations); recv_mutateRow(); } - public void send_mutateRow(byte[] tableName, byte[] row, List mutations) throws TException + public void send_mutateRow(ByteBuffer tableName, ByteBuffer row, List mutations) throws TException { - oprot_.writeMessageBegin(new TMessage("mutateRow", TMessageType.CALL, seqid_)); + oprot_.writeMessageBegin(new TMessage("mutateRow", TMessageType.CALL, ++seqid_)); mutateRow_args args = new mutateRow_args(); - args.tableName = tableName; - args.row = row; - args.mutations = mutations; + args.setTableName(tableName); + args.setRow(row); + args.setMutations(mutations); args.write(oprot_); oprot_.writeMessageEnd(); oprot_.getTransport().flush(); @@ -1140,6 +1290,9 @@ public class Hbase { iprot_.readMessageEnd(); throw x; } + if (msg.seqid != seqid_) { + throw new TApplicationException(TApplicationException.BAD_SEQUENCE_ID, "mutateRow failed: out of sequence response"); + } mutateRow_result result = new mutateRow_result(); result.read(iprot_); iprot_.readMessageEnd(); @@ -1152,20 +1305,21 @@ public class Hbase { return; } - public void mutateRowTs(byte[] tableName, byte[] row, List mutations, long timestamp) throws IOError, IllegalArgument, TException + @Override + public void mutateRowTs(ByteBuffer tableName, ByteBuffer row, List mutations, long timestamp) throws IOError, IllegalArgument, TException { send_mutateRowTs(tableName, row, mutations, timestamp); recv_mutateRowTs(); } - public void send_mutateRowTs(byte[] tableName, byte[] row, List mutations, long timestamp) throws TException + public void send_mutateRowTs(ByteBuffer tableName, ByteBuffer row, List mutations, long timestamp) throws TException { - oprot_.writeMessageBegin(new TMessage("mutateRowTs", TMessageType.CALL, seqid_)); + oprot_.writeMessageBegin(new TMessage("mutateRowTs", TMessageType.CALL, ++seqid_)); mutateRowTs_args args = new mutateRowTs_args(); - args.tableName = tableName; - args.row = row; - args.mutations = mutations; - args.timestamp = timestamp; + args.setTableName(tableName); + args.setRow(row); + args.setMutations(mutations); + args.setTimestamp(timestamp); args.write(oprot_); oprot_.writeMessageEnd(); oprot_.getTransport().flush(); @@ -1179,6 +1333,9 @@ public class Hbase { iprot_.readMessageEnd(); throw x; } + if (msg.seqid != seqid_) { + throw new TApplicationException(TApplicationException.BAD_SEQUENCE_ID, "mutateRowTs failed: out of sequence response"); + } mutateRowTs_result result = new mutateRowTs_result(); result.read(iprot_); iprot_.readMessageEnd(); @@ -1191,18 +1348,19 @@ public class Hbase { return; } - public void mutateRows(byte[] tableName, List rowBatches) throws IOError, IllegalArgument, TException + @Override + public void mutateRows(ByteBuffer tableName, List rowBatches) throws IOError, IllegalArgument, TException { send_mutateRows(tableName, rowBatches); recv_mutateRows(); } - public void send_mutateRows(byte[] tableName, List rowBatches) throws TException + public void send_mutateRows(ByteBuffer tableName, List rowBatches) throws TException { - oprot_.writeMessageBegin(new TMessage("mutateRows", TMessageType.CALL, seqid_)); + oprot_.writeMessageBegin(new TMessage("mutateRows", TMessageType.CALL, ++seqid_)); mutateRows_args args = new mutateRows_args(); - args.tableName = tableName; - args.rowBatches = rowBatches; + args.setTableName(tableName); + args.setRowBatches(rowBatches); args.write(oprot_); oprot_.writeMessageEnd(); oprot_.getTransport().flush(); @@ -1216,6 +1374,9 @@ public class Hbase { iprot_.readMessageEnd(); throw x; } + if (msg.seqid != seqid_) { + throw new TApplicationException(TApplicationException.BAD_SEQUENCE_ID, "mutateRows failed: out of sequence response"); + } mutateRows_result result = new mutateRows_result(); result.read(iprot_); iprot_.readMessageEnd(); @@ -1228,19 +1389,20 @@ public class Hbase { return; } - public void mutateRowsTs(byte[] tableName, List rowBatches, long timestamp) throws IOError, IllegalArgument, TException + @Override + public void mutateRowsTs(ByteBuffer tableName, List rowBatches, long timestamp) throws IOError, IllegalArgument, TException { send_mutateRowsTs(tableName, rowBatches, timestamp); recv_mutateRowsTs(); } - public void send_mutateRowsTs(byte[] tableName, List rowBatches, long timestamp) throws TException + public void send_mutateRowsTs(ByteBuffer tableName, List rowBatches, long timestamp) throws TException { - oprot_.writeMessageBegin(new TMessage("mutateRowsTs", TMessageType.CALL, seqid_)); + oprot_.writeMessageBegin(new TMessage("mutateRowsTs", TMessageType.CALL, ++seqid_)); mutateRowsTs_args args = new mutateRowsTs_args(); - args.tableName = tableName; - args.rowBatches = rowBatches; - args.timestamp = timestamp; + args.setTableName(tableName); + args.setRowBatches(rowBatches); + args.setTimestamp(timestamp); args.write(oprot_); oprot_.writeMessageEnd(); oprot_.getTransport().flush(); @@ -1254,6 +1416,9 @@ public class Hbase { iprot_.readMessageEnd(); throw x; } + if (msg.seqid != seqid_) { + throw new TApplicationException(TApplicationException.BAD_SEQUENCE_ID, "mutateRowsTs failed: out of sequence response"); + } mutateRowsTs_result result = new mutateRowsTs_result(); result.read(iprot_); iprot_.readMessageEnd(); @@ -1266,20 +1431,21 @@ public class Hbase { return; } - public long atomicIncrement(byte[] tableName, byte[] row, byte[] column, long value) throws IOError, IllegalArgument, TException + @Override + public long atomicIncrement(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, long value) throws IOError, IllegalArgument, TException { send_atomicIncrement(tableName, row, column, value); return recv_atomicIncrement(); } - public void send_atomicIncrement(byte[] tableName, byte[] row, byte[] column, long value) throws TException + public void send_atomicIncrement(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, long value) throws TException { - oprot_.writeMessageBegin(new TMessage("atomicIncrement", TMessageType.CALL, seqid_)); + oprot_.writeMessageBegin(new TMessage("atomicIncrement", TMessageType.CALL, ++seqid_)); atomicIncrement_args args = new atomicIncrement_args(); - args.tableName = tableName; - args.row = row; - args.column = column; - args.value = value; + args.setTableName(tableName); + args.setRow(row); + args.setColumn(column); + args.setValue(value); args.write(oprot_); oprot_.writeMessageEnd(); oprot_.getTransport().flush(); @@ -1293,6 +1459,9 @@ public class Hbase { iprot_.readMessageEnd(); throw x; } + if (msg.seqid != seqid_) { + throw new TApplicationException(TApplicationException.BAD_SEQUENCE_ID, "atomicIncrement failed: out of sequence response"); + } atomicIncrement_result result = new atomicIncrement_result(); result.read(iprot_); iprot_.readMessageEnd(); @@ -1308,19 +1477,20 @@ public class Hbase { throw new TApplicationException(TApplicationException.MISSING_RESULT, "atomicIncrement failed: unknown result"); } - public void deleteAll(byte[] tableName, byte[] row, byte[] column) throws IOError, TException + @Override + public void deleteAll(ByteBuffer tableName, ByteBuffer row, ByteBuffer column) throws IOError, TException { send_deleteAll(tableName, row, column); recv_deleteAll(); } - public void send_deleteAll(byte[] tableName, byte[] row, byte[] column) throws TException + public void send_deleteAll(ByteBuffer tableName, ByteBuffer row, ByteBuffer column) throws TException { - oprot_.writeMessageBegin(new TMessage("deleteAll", TMessageType.CALL, seqid_)); + oprot_.writeMessageBegin(new TMessage("deleteAll", TMessageType.CALL, ++seqid_)); deleteAll_args args = new deleteAll_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(); @@ -1334,6 +1504,9 @@ public class Hbase { iprot_.readMessageEnd(); throw x; } + if (msg.seqid != seqid_) { + throw new TApplicationException(TApplicationException.BAD_SEQUENCE_ID, "deleteAll failed: out of sequence response"); + } deleteAll_result result = new deleteAll_result(); result.read(iprot_); iprot_.readMessageEnd(); @@ -1343,20 +1516,21 @@ public class Hbase { return; } - public void deleteAllTs(byte[] tableName, byte[] row, byte[] column, long timestamp) throws IOError, TException + @Override + public void deleteAllTs(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, long timestamp) throws IOError, TException { send_deleteAllTs(tableName, row, column, timestamp); recv_deleteAllTs(); } - public void send_deleteAllTs(byte[] tableName, byte[] row, byte[] column, long timestamp) throws TException + public void send_deleteAllTs(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, long timestamp) throws TException { - oprot_.writeMessageBegin(new TMessage("deleteAllTs", TMessageType.CALL, seqid_)); + oprot_.writeMessageBegin(new TMessage("deleteAllTs", TMessageType.CALL, ++seqid_)); deleteAllTs_args args = new deleteAllTs_args(); - args.tableName = tableName; - args.row = row; - args.column = column; - args.timestamp = timestamp; + args.setTableName(tableName); + args.setRow(row); + args.setColumn(column); + args.setTimestamp(timestamp); args.write(oprot_); oprot_.writeMessageEnd(); oprot_.getTransport().flush(); @@ -1370,6 +1544,9 @@ public class Hbase { iprot_.readMessageEnd(); throw x; } + if (msg.seqid != seqid_) { + throw new TApplicationException(TApplicationException.BAD_SEQUENCE_ID, "deleteAllTs failed: out of sequence response"); + } deleteAllTs_result result = new deleteAllTs_result(); result.read(iprot_); iprot_.readMessageEnd(); @@ -1379,18 +1556,19 @@ public class Hbase { return; } - public void deleteAllRow(byte[] tableName, byte[] row) throws IOError, TException + @Override + public void deleteAllRow(ByteBuffer tableName, ByteBuffer row) throws IOError, TException { send_deleteAllRow(tableName, row); recv_deleteAllRow(); } - public void send_deleteAllRow(byte[] tableName, byte[] row) throws TException + public void send_deleteAllRow(ByteBuffer tableName, ByteBuffer row) throws TException { - oprot_.writeMessageBegin(new TMessage("deleteAllRow", TMessageType.CALL, seqid_)); + oprot_.writeMessageBegin(new TMessage("deleteAllRow", TMessageType.CALL, ++seqid_)); deleteAllRow_args args = new deleteAllRow_args(); - args.tableName = tableName; - args.row = row; + args.setTableName(tableName); + args.setRow(row); args.write(oprot_); oprot_.writeMessageEnd(); oprot_.getTransport().flush(); @@ -1404,6 +1582,9 @@ public class Hbase { iprot_.readMessageEnd(); throw x; } + if (msg.seqid != seqid_) { + throw new TApplicationException(TApplicationException.BAD_SEQUENCE_ID, "deleteAllRow failed: out of sequence response"); + } deleteAllRow_result result = new deleteAllRow_result(); result.read(iprot_); iprot_.readMessageEnd(); @@ -1413,19 +1594,20 @@ public class Hbase { return; } - public void deleteAllRowTs(byte[] tableName, byte[] row, long timestamp) throws IOError, TException + @Override + public void deleteAllRowTs(ByteBuffer tableName, ByteBuffer row, long timestamp) throws IOError, TException { send_deleteAllRowTs(tableName, row, timestamp); recv_deleteAllRowTs(); } - public void send_deleteAllRowTs(byte[] tableName, byte[] row, long timestamp) throws TException + public void send_deleteAllRowTs(ByteBuffer tableName, ByteBuffer row, long timestamp) throws TException { - oprot_.writeMessageBegin(new TMessage("deleteAllRowTs", TMessageType.CALL, seqid_)); + oprot_.writeMessageBegin(new TMessage("deleteAllRowTs", TMessageType.CALL, ++seqid_)); deleteAllRowTs_args args = new deleteAllRowTs_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(); @@ -1439,6 +1621,9 @@ public class Hbase { iprot_.readMessageEnd(); throw x; } + if (msg.seqid != seqid_) { + throw new TApplicationException(TApplicationException.BAD_SEQUENCE_ID, "deleteAllRowTs failed: out of sequence response"); + } deleteAllRowTs_result result = new deleteAllRowTs_result(); result.read(iprot_); iprot_.readMessageEnd(); @@ -1448,19 +1633,20 @@ public class Hbase { return; } - public int scannerOpen(byte[] tableName, byte[] startRow, List columns) throws IOError, TException + @Override + public int scannerOpen(ByteBuffer tableName, ByteBuffer startRow, List columns) throws IOError, TException { send_scannerOpen(tableName, startRow, columns); return recv_scannerOpen(); } - public void send_scannerOpen(byte[] tableName, byte[] startRow, List columns) throws TException + public void send_scannerOpen(ByteBuffer tableName, ByteBuffer startRow, List columns) throws TException { - oprot_.writeMessageBegin(new TMessage("scannerOpen", TMessageType.CALL, seqid_)); + oprot_.writeMessageBegin(new TMessage("scannerOpen", TMessageType.CALL, ++seqid_)); scannerOpen_args args = new scannerOpen_args(); - args.tableName = tableName; - args.startRow = startRow; - args.columns = columns; + args.setTableName(tableName); + args.setStartRow(startRow); + args.setColumns(columns); args.write(oprot_); oprot_.writeMessageEnd(); oprot_.getTransport().flush(); @@ -1474,6 +1660,9 @@ public class Hbase { iprot_.readMessageEnd(); throw x; } + if (msg.seqid != seqid_) { + throw new TApplicationException(TApplicationException.BAD_SEQUENCE_ID, "scannerOpen failed: out of sequence response"); + } scannerOpen_result result = new scannerOpen_result(); result.read(iprot_); iprot_.readMessageEnd(); @@ -1486,20 +1675,21 @@ public class Hbase { throw new TApplicationException(TApplicationException.MISSING_RESULT, "scannerOpen failed: unknown result"); } - 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 { send_scannerOpenWithStop(tableName, startRow, stopRow, columns); return recv_scannerOpenWithStop(); } - public void send_scannerOpenWithStop(byte[] tableName, byte[] startRow, byte[] stopRow, List columns) throws TException + public void send_scannerOpenWithStop(ByteBuffer tableName, ByteBuffer startRow, ByteBuffer stopRow, List columns) throws TException { - oprot_.writeMessageBegin(new TMessage("scannerOpenWithStop", TMessageType.CALL, seqid_)); + oprot_.writeMessageBegin(new TMessage("scannerOpenWithStop", TMessageType.CALL, ++seqid_)); scannerOpenWithStop_args args = new scannerOpenWithStop_args(); - args.tableName = tableName; - args.startRow = startRow; - args.stopRow = stopRow; - args.columns = columns; + args.setTableName(tableName); + args.setStartRow(startRow); + args.setStopRow(stopRow); + args.setColumns(columns); args.write(oprot_); oprot_.writeMessageEnd(); oprot_.getTransport().flush(); @@ -1513,6 +1703,9 @@ public class Hbase { iprot_.readMessageEnd(); throw x; } + if (msg.seqid != seqid_) { + throw new TApplicationException(TApplicationException.BAD_SEQUENCE_ID, "scannerOpenWithStop failed: out of sequence response"); + } scannerOpenWithStop_result result = new scannerOpenWithStop_result(); result.read(iprot_); iprot_.readMessageEnd(); @@ -1525,19 +1718,20 @@ public class Hbase { throw new TApplicationException(TApplicationException.MISSING_RESULT, "scannerOpenWithStop failed: unknown result"); } - public int scannerOpenWithPrefix(byte[] tableName, byte[] startAndPrefix, List columns) throws IOError, TException + @Override + public int scannerOpenWithPrefix(ByteBuffer tableName, ByteBuffer startAndPrefix, List columns) throws IOError, TException { send_scannerOpenWithPrefix(tableName, startAndPrefix, columns); return recv_scannerOpenWithPrefix(); } - public void send_scannerOpenWithPrefix(byte[] tableName, byte[] startAndPrefix, List columns) throws TException + public void send_scannerOpenWithPrefix(ByteBuffer tableName, ByteBuffer startAndPrefix, List columns) throws TException { - oprot_.writeMessageBegin(new TMessage("scannerOpenWithPrefix", TMessageType.CALL, seqid_)); + oprot_.writeMessageBegin(new TMessage("scannerOpenWithPrefix", TMessageType.CALL, ++seqid_)); scannerOpenWithPrefix_args args = new scannerOpenWithPrefix_args(); - args.tableName = tableName; - args.startAndPrefix = startAndPrefix; - args.columns = columns; + args.setTableName(tableName); + args.setStartAndPrefix(startAndPrefix); + args.setColumns(columns); args.write(oprot_); oprot_.writeMessageEnd(); oprot_.getTransport().flush(); @@ -1551,6 +1745,9 @@ public class Hbase { iprot_.readMessageEnd(); throw x; } + if (msg.seqid != seqid_) { + throw new TApplicationException(TApplicationException.BAD_SEQUENCE_ID, "scannerOpenWithPrefix failed: out of sequence response"); + } scannerOpenWithPrefix_result result = new scannerOpenWithPrefix_result(); result.read(iprot_); iprot_.readMessageEnd(); @@ -1563,20 +1760,21 @@ public class Hbase { throw new TApplicationException(TApplicationException.MISSING_RESULT, "scannerOpenWithPrefix failed: unknown result"); } - 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 { send_scannerOpenTs(tableName, startRow, columns, timestamp); return recv_scannerOpenTs(); } - public void send_scannerOpenTs(byte[] tableName, byte[] startRow, List columns, long timestamp) throws TException + public void send_scannerOpenTs(ByteBuffer tableName, ByteBuffer startRow, List columns, long timestamp) throws TException { - oprot_.writeMessageBegin(new TMessage("scannerOpenTs", TMessageType.CALL, seqid_)); + oprot_.writeMessageBegin(new TMessage("scannerOpenTs", TMessageType.CALL, ++seqid_)); scannerOpenTs_args args = new scannerOpenTs_args(); - args.tableName = tableName; - args.startRow = startRow; - args.columns = columns; - args.timestamp = timestamp; + args.setTableName(tableName); + args.setStartRow(startRow); + args.setColumns(columns); + args.setTimestamp(timestamp); args.write(oprot_); oprot_.writeMessageEnd(); oprot_.getTransport().flush(); @@ -1590,6 +1788,9 @@ public class Hbase { iprot_.readMessageEnd(); throw x; } + if (msg.seqid != seqid_) { + throw new TApplicationException(TApplicationException.BAD_SEQUENCE_ID, "scannerOpenTs failed: out of sequence response"); + } scannerOpenTs_result result = new scannerOpenTs_result(); result.read(iprot_); iprot_.readMessageEnd(); @@ -1602,21 +1803,22 @@ public class Hbase { throw new TApplicationException(TApplicationException.MISSING_RESULT, "scannerOpenTs failed: unknown result"); } - public int scannerOpenWithStopTs(byte[] tableName, byte[] startRow, byte[] stopRow, List columns, long timestamp) throws IOError, TException + @Override + public int scannerOpenWithStopTs(ByteBuffer tableName, ByteBuffer startRow, ByteBuffer stopRow, List columns, long timestamp) throws IOError, TException { send_scannerOpenWithStopTs(tableName, startRow, stopRow, columns, timestamp); return recv_scannerOpenWithStopTs(); } - public void send_scannerOpenWithStopTs(byte[] tableName, byte[] startRow, byte[] stopRow, List columns, long timestamp) throws TException + public void send_scannerOpenWithStopTs(ByteBuffer tableName, ByteBuffer startRow, ByteBuffer stopRow, List columns, long timestamp) throws TException { - oprot_.writeMessageBegin(new TMessage("scannerOpenWithStopTs", TMessageType.CALL, seqid_)); + oprot_.writeMessageBegin(new TMessage("scannerOpenWithStopTs", TMessageType.CALL, ++seqid_)); scannerOpenWithStopTs_args args = new scannerOpenWithStopTs_args(); - args.tableName = tableName; - args.startRow = startRow; - args.stopRow = stopRow; - args.columns = columns; - args.timestamp = timestamp; + args.setTableName(tableName); + args.setStartRow(startRow); + args.setStopRow(stopRow); + args.setColumns(columns); + args.setTimestamp(timestamp); args.write(oprot_); oprot_.writeMessageEnd(); oprot_.getTransport().flush(); @@ -1630,6 +1832,9 @@ public class Hbase { iprot_.readMessageEnd(); throw x; } + if (msg.seqid != seqid_) { + throw new TApplicationException(TApplicationException.BAD_SEQUENCE_ID, "scannerOpenWithStopTs failed: out of sequence response"); + } scannerOpenWithStopTs_result result = new scannerOpenWithStopTs_result(); result.read(iprot_); iprot_.readMessageEnd(); @@ -1642,6 +1847,7 @@ public class Hbase { throw new TApplicationException(TApplicationException.MISSING_RESULT, "scannerOpenWithStopTs failed: unknown result"); } + @Override public List scannerGet(int id) throws IOError, IllegalArgument, TException { send_scannerGet(id); @@ -1650,9 +1856,9 @@ public class Hbase { public void send_scannerGet(int id) throws TException { - oprot_.writeMessageBegin(new TMessage("scannerGet", TMessageType.CALL, seqid_)); + oprot_.writeMessageBegin(new TMessage("scannerGet", TMessageType.CALL, ++seqid_)); scannerGet_args args = new scannerGet_args(); - args.id = id; + args.setId(id); args.write(oprot_); oprot_.writeMessageEnd(); oprot_.getTransport().flush(); @@ -1666,6 +1872,9 @@ public class Hbase { iprot_.readMessageEnd(); throw x; } + if (msg.seqid != seqid_) { + throw new TApplicationException(TApplicationException.BAD_SEQUENCE_ID, "scannerGet failed: out of sequence response"); + } scannerGet_result result = new scannerGet_result(); result.read(iprot_); iprot_.readMessageEnd(); @@ -1681,6 +1890,7 @@ public class Hbase { throw new TApplicationException(TApplicationException.MISSING_RESULT, "scannerGet failed: unknown result"); } + @Override public List scannerGetList(int id, int nbRows) throws IOError, IllegalArgument, TException { send_scannerGetList(id, nbRows); @@ -1689,10 +1899,10 @@ public class Hbase { public void send_scannerGetList(int id, int nbRows) throws TException { - oprot_.writeMessageBegin(new TMessage("scannerGetList", TMessageType.CALL, seqid_)); + oprot_.writeMessageBegin(new TMessage("scannerGetList", TMessageType.CALL, ++seqid_)); scannerGetList_args args = new scannerGetList_args(); - args.id = id; - args.nbRows = nbRows; + args.setId(id); + args.setNbRows(nbRows); args.write(oprot_); oprot_.writeMessageEnd(); oprot_.getTransport().flush(); @@ -1706,6 +1916,9 @@ public class Hbase { iprot_.readMessageEnd(); throw x; } + if (msg.seqid != seqid_) { + throw new TApplicationException(TApplicationException.BAD_SEQUENCE_ID, "scannerGetList failed: out of sequence response"); + } scannerGetList_result result = new scannerGetList_result(); result.read(iprot_); iprot_.readMessageEnd(); @@ -1721,6 +1934,7 @@ public class Hbase { throw new TApplicationException(TApplicationException.MISSING_RESULT, "scannerGetList failed: unknown result"); } + @Override public void scannerClose(int id) throws IOError, IllegalArgument, TException { send_scannerClose(id); @@ -1729,9 +1943,9 @@ public class Hbase { public void send_scannerClose(int id) throws TException { - oprot_.writeMessageBegin(new TMessage("scannerClose", TMessageType.CALL, seqid_)); + oprot_.writeMessageBegin(new TMessage("scannerClose", TMessageType.CALL, ++seqid_)); scannerClose_args args = new scannerClose_args(); - args.id = id; + args.setId(id); args.write(oprot_); oprot_.writeMessageEnd(); oprot_.getTransport().flush(); @@ -1745,6 +1959,9 @@ public class Hbase { iprot_.readMessageEnd(); throw x; } + if (msg.seqid != seqid_) { + throw new TApplicationException(TApplicationException.BAD_SEQUENCE_ID, "scannerClose failed: out of sequence response"); + } scannerClose_result result = new scannerClose_result(); result.read(iprot_); iprot_.readMessageEnd(); @@ -1758,164 +1975,1430 @@ public class Hbase { } } - public static class Processor implements TProcessor { - private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName()); - public Processor(Iface iface) - { - iface_ = iface; - processMap_.put("enableTable", new enableTable()); - processMap_.put("disableTable", new disableTable()); - processMap_.put("isTableEnabled", new isTableEnabled()); - processMap_.put("compact", new compact()); - processMap_.put("majorCompact", new majorCompact()); - processMap_.put("getTableNames", new getTableNames()); - processMap_.put("getColumnDescriptors", new getColumnDescriptors()); - processMap_.put("getTableRegions", new getTableRegions()); - processMap_.put("createTable", new createTable()); - processMap_.put("deleteTable", new deleteTable()); - processMap_.put("get", new get()); - processMap_.put("getVer", new getVer()); - processMap_.put("getVerTs", new getVerTs()); - processMap_.put("getRow", new getRow()); - processMap_.put("getRowWithColumns", new getRowWithColumns()); - processMap_.put("getRowTs", new getRowTs()); - processMap_.put("getRowWithColumnsTs", new getRowWithColumnsTs()); - processMap_.put("mutateRow", new mutateRow()); - processMap_.put("mutateRowTs", new mutateRowTs()); - processMap_.put("mutateRows", new mutateRows()); - processMap_.put("mutateRowsTs", new mutateRowsTs()); - processMap_.put("atomicIncrement", new atomicIncrement()); - processMap_.put("deleteAll", new deleteAll()); - processMap_.put("deleteAllTs", new deleteAllTs()); - processMap_.put("deleteAllRow", new deleteAllRow()); - processMap_.put("deleteAllRowTs", new deleteAllRowTs()); - processMap_.put("scannerOpen", new scannerOpen()); - processMap_.put("scannerOpenWithStop", new scannerOpenWithStop()); - processMap_.put("scannerOpenWithPrefix", new scannerOpenWithPrefix()); - processMap_.put("scannerOpenTs", new scannerOpenTs()); - processMap_.put("scannerOpenWithStopTs", new scannerOpenWithStopTs()); - processMap_.put("scannerGet", new scannerGet()); - processMap_.put("scannerGetList", new scannerGetList()); - processMap_.put("scannerClose", new scannerClose()); + public static class AsyncClient extends TAsyncClient implements AsyncIface { + public static class Factory implements TAsyncClientFactory { + private TAsyncClientManager clientManager; + private TProtocolFactory protocolFactory; + public Factory(TAsyncClientManager clientManager, TProtocolFactory protocolFactory) { + this.clientManager = clientManager; + this.protocolFactory = protocolFactory; + } + public AsyncClient getAsyncClient(TNonblockingTransport transport) { + return new AsyncClient(protocolFactory, clientManager, transport); + } } - protected static interface ProcessFunction { - public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException; + public AsyncClient(TProtocolFactory protocolFactory, TAsyncClientManager clientManager, TNonblockingTransport transport) { + super(protocolFactory, clientManager, transport); } - private Iface iface_; - protected final HashMap processMap_ = new HashMap(); + public void enableTable(ByteBuffer tableName, AsyncMethodCallback resultHandler) throws TException { + checkReady(); + enableTable_call method_call = new enableTable_call(tableName, resultHandler, this, protocolFactory, transport); + manager.call(method_call); + } - public boolean process(TProtocol iprot, TProtocol oprot) throws TException - { - TMessage msg = iprot.readMessageBegin(); - ProcessFunction fn = processMap_.get(msg.name); - if (fn == null) { - TProtocolUtil.skip(iprot, TType.STRUCT); - iprot.readMessageEnd(); - TApplicationException x = new TApplicationException(TApplicationException.UNKNOWN_METHOD, "Invalid method name: '"+msg.name+"'"); - oprot.writeMessageBegin(new TMessage(msg.name, TMessageType.EXCEPTION, msg.seqid)); - x.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - return true; + public static class enableTable_call extends TAsyncMethodCall { + private ByteBuffer tableName; + public enableTable_call(ByteBuffer tableName, AsyncMethodCallback resultHandler, TAsyncClient client, TProtocolFactory protocolFactory, TNonblockingTransport transport) throws TException { + super(client, protocolFactory, transport, resultHandler, false); + this.tableName = tableName; } - fn.process(msg.seqid, iprot, oprot); - return true; - } - private class enableTable implements ProcessFunction { - public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException - { + public void write_args(TProtocol prot) throws TException { + prot.writeMessageBegin(new TMessage("enableTable", TMessageType.CALL, 0)); enableTable_args args = new enableTable_args(); - args.read(iprot); - iprot.readMessageEnd(); - enableTable_result result = new enableTable_result(); - try { - iface_.enableTable(args.tableName); - } catch (IOError io) { - result.io = io; - } catch (Throwable th) { - LOGGER.error("Internal error processing enableTable", th); - TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing enableTable"); - oprot.writeMessageBegin(new TMessage("enableTable", TMessageType.EXCEPTION, seqid)); - x.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - return; + args.setTableName(tableName); + args.write(prot); + prot.writeMessageEnd(); + } + + public void getResult() throws IOError, TException { + if (getState() != State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); } - oprot.writeMessageBegin(new TMessage("enableTable", TMessageType.REPLY, seqid)); - result.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); + TMemoryInputTransport memoryTransport = new TMemoryInputTransport(getFrameBuffer().array()); + TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + (new Client(prot)).recv_enableTable(); } + } + public void disableTable(ByteBuffer tableName, AsyncMethodCallback resultHandler) throws TException { + checkReady(); + disableTable_call method_call = new disableTable_call(tableName, resultHandler, this, protocolFactory, transport); + manager.call(method_call); } - private class disableTable implements ProcessFunction { - public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException - { + public static class disableTable_call extends TAsyncMethodCall { + private ByteBuffer tableName; + public disableTable_call(ByteBuffer tableName, AsyncMethodCallback resultHandler, TAsyncClient client, TProtocolFactory protocolFactory, TNonblockingTransport transport) throws TException { + super(client, protocolFactory, transport, resultHandler, false); + this.tableName = tableName; + } + + public void write_args(TProtocol prot) throws TException { + prot.writeMessageBegin(new TMessage("disableTable", TMessageType.CALL, 0)); disableTable_args args = new disableTable_args(); - args.read(iprot); - iprot.readMessageEnd(); - disableTable_result result = new disableTable_result(); - try { - iface_.disableTable(args.tableName); - } catch (IOError io) { - result.io = io; - } catch (Throwable th) { - LOGGER.error("Internal error processing disableTable", th); - TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing disableTable"); - oprot.writeMessageBegin(new TMessage("disableTable", TMessageType.EXCEPTION, seqid)); - x.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - return; + args.setTableName(tableName); + args.write(prot); + prot.writeMessageEnd(); + } + + public void getResult() throws IOError, TException { + if (getState() != State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); } - oprot.writeMessageBegin(new TMessage("disableTable", TMessageType.REPLY, seqid)); - result.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); + TMemoryInputTransport memoryTransport = new TMemoryInputTransport(getFrameBuffer().array()); + TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + (new Client(prot)).recv_disableTable(); } + } + public void isTableEnabled(ByteBuffer tableName, AsyncMethodCallback resultHandler) throws TException { + checkReady(); + isTableEnabled_call method_call = new isTableEnabled_call(tableName, resultHandler, this, protocolFactory, transport); + manager.call(method_call); } - private class isTableEnabled implements ProcessFunction { - public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException - { + public static class isTableEnabled_call extends TAsyncMethodCall { + private ByteBuffer tableName; + public isTableEnabled_call(ByteBuffer tableName, AsyncMethodCallback resultHandler, TAsyncClient client, TProtocolFactory protocolFactory, TNonblockingTransport transport) throws TException { + super(client, protocolFactory, transport, resultHandler, false); + this.tableName = tableName; + } + + public void write_args(TProtocol prot) throws TException { + prot.writeMessageBegin(new TMessage("isTableEnabled", TMessageType.CALL, 0)); isTableEnabled_args args = new isTableEnabled_args(); - args.read(iprot); - iprot.readMessageEnd(); - isTableEnabled_result result = new isTableEnabled_result(); - try { - result.success = iface_.isTableEnabled(args.tableName); - result.setSuccessIsSet(true); - } catch (IOError io) { - result.io = io; - } catch (Throwable th) { - LOGGER.error("Internal error processing isTableEnabled", th); - TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing isTableEnabled"); - oprot.writeMessageBegin(new TMessage("isTableEnabled", TMessageType.EXCEPTION, seqid)); - x.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - return; + args.setTableName(tableName); + args.write(prot); + prot.writeMessageEnd(); + } + + public boolean getResult() throws IOError, TException { + if (getState() != State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); } - oprot.writeMessageBegin(new TMessage("isTableEnabled", TMessageType.REPLY, seqid)); - result.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); + TMemoryInputTransport memoryTransport = new TMemoryInputTransport(getFrameBuffer().array()); + TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_isTableEnabled(); } + } + public void compact(ByteBuffer tableNameOrRegionName, AsyncMethodCallback resultHandler) throws TException { + checkReady(); + compact_call method_call = new compact_call(tableNameOrRegionName, resultHandler, this, protocolFactory, transport); + manager.call(method_call); } - private class compact implements ProcessFunction { - public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException - { + public static class compact_call extends TAsyncMethodCall { + private ByteBuffer tableNameOrRegionName; + public compact_call(ByteBuffer tableNameOrRegionName, AsyncMethodCallback resultHandler, TAsyncClient client, TProtocolFactory protocolFactory, TNonblockingTransport transport) throws TException { + super(client, protocolFactory, transport, resultHandler, false); + this.tableNameOrRegionName = tableNameOrRegionName; + } + + public void write_args(TProtocol prot) throws TException { + prot.writeMessageBegin(new TMessage("compact", TMessageType.CALL, 0)); compact_args args = new compact_args(); - args.read(iprot); - iprot.readMessageEnd(); - compact_result result = new compact_result(); + args.setTableNameOrRegionName(tableNameOrRegionName); + args.write(prot); + prot.writeMessageEnd(); + } + + public void getResult() throws IOError, TException { + if (getState() != State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + TMemoryInputTransport memoryTransport = new TMemoryInputTransport(getFrameBuffer().array()); + TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + (new Client(prot)).recv_compact(); + } + } + + public void majorCompact(ByteBuffer tableNameOrRegionName, AsyncMethodCallback resultHandler) throws TException { + checkReady(); + majorCompact_call method_call = new majorCompact_call(tableNameOrRegionName, resultHandler, this, protocolFactory, transport); + manager.call(method_call); + } + + public static class majorCompact_call extends TAsyncMethodCall { + private ByteBuffer tableNameOrRegionName; + public majorCompact_call(ByteBuffer tableNameOrRegionName, AsyncMethodCallback resultHandler, TAsyncClient client, TProtocolFactory protocolFactory, TNonblockingTransport transport) throws TException { + super(client, protocolFactory, transport, resultHandler, false); + this.tableNameOrRegionName = tableNameOrRegionName; + } + + public void write_args(TProtocol prot) throws TException { + prot.writeMessageBegin(new TMessage("majorCompact", TMessageType.CALL, 0)); + majorCompact_args args = new majorCompact_args(); + args.setTableNameOrRegionName(tableNameOrRegionName); + args.write(prot); + prot.writeMessageEnd(); + } + + public void getResult() throws IOError, TException { + if (getState() != State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + TMemoryInputTransport memoryTransport = new TMemoryInputTransport(getFrameBuffer().array()); + TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + (new Client(prot)).recv_majorCompact(); + } + } + + public void getTableNames(AsyncMethodCallback resultHandler) throws TException { + checkReady(); + getTableNames_call method_call = new getTableNames_call(resultHandler, this, protocolFactory, transport); + manager.call(method_call); + } + + public static class getTableNames_call extends TAsyncMethodCall { + public getTableNames_call(AsyncMethodCallback resultHandler, TAsyncClient client, TProtocolFactory protocolFactory, TNonblockingTransport transport) throws TException { + super(client, protocolFactory, transport, resultHandler, false); + } + + public void write_args(TProtocol prot) throws TException { + prot.writeMessageBegin(new TMessage("getTableNames", TMessageType.CALL, 0)); + getTableNames_args args = new getTableNames_args(); + args.write(prot); + prot.writeMessageEnd(); + } + + public List getResult() throws IOError, TException { + if (getState() != State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + TMemoryInputTransport memoryTransport = new TMemoryInputTransport(getFrameBuffer().array()); + TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_getTableNames(); + } + } + + public void getColumnDescriptors(ByteBuffer tableName, AsyncMethodCallback resultHandler) throws TException { + checkReady(); + getColumnDescriptors_call method_call = new getColumnDescriptors_call(tableName, resultHandler, this, protocolFactory, transport); + manager.call(method_call); + } + + public static class getColumnDescriptors_call extends TAsyncMethodCall { + private ByteBuffer tableName; + public getColumnDescriptors_call(ByteBuffer tableName, AsyncMethodCallback resultHandler, TAsyncClient client, TProtocolFactory protocolFactory, TNonblockingTransport transport) throws TException { + super(client, protocolFactory, transport, resultHandler, false); + this.tableName = tableName; + } + + public void write_args(TProtocol prot) throws TException { + prot.writeMessageBegin(new TMessage("getColumnDescriptors", TMessageType.CALL, 0)); + getColumnDescriptors_args args = new getColumnDescriptors_args(); + args.setTableName(tableName); + args.write(prot); + prot.writeMessageEnd(); + } + + public Map getResult() throws IOError, TException { + if (getState() != State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + TMemoryInputTransport memoryTransport = new TMemoryInputTransport(getFrameBuffer().array()); + TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_getColumnDescriptors(); + } + } + + public void getTableRegions(ByteBuffer tableName, AsyncMethodCallback resultHandler) throws TException { + checkReady(); + getTableRegions_call method_call = new getTableRegions_call(tableName, resultHandler, this, protocolFactory, transport); + manager.call(method_call); + } + + public static class getTableRegions_call extends TAsyncMethodCall { + private ByteBuffer tableName; + public getTableRegions_call(ByteBuffer tableName, AsyncMethodCallback resultHandler, TAsyncClient client, TProtocolFactory protocolFactory, TNonblockingTransport transport) throws TException { + super(client, protocolFactory, transport, resultHandler, false); + this.tableName = tableName; + } + + public void write_args(TProtocol prot) throws TException { + prot.writeMessageBegin(new TMessage("getTableRegions", TMessageType.CALL, 0)); + getTableRegions_args args = new getTableRegions_args(); + args.setTableName(tableName); + args.write(prot); + prot.writeMessageEnd(); + } + + public List getResult() throws IOError, TException { + if (getState() != State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + TMemoryInputTransport memoryTransport = new TMemoryInputTransport(getFrameBuffer().array()); + TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_getTableRegions(); + } + } + + public void createTable(ByteBuffer tableName, List columnFamilies, AsyncMethodCallback resultHandler) throws TException { + checkReady(); + createTable_call method_call = new createTable_call(tableName, columnFamilies, resultHandler, this, protocolFactory, transport); + manager.call(method_call); + } + + public static class createTable_call extends TAsyncMethodCall { + private ByteBuffer tableName; + private List columnFamilies; + public createTable_call(ByteBuffer tableName, List columnFamilies, AsyncMethodCallback resultHandler, TAsyncClient client, TProtocolFactory protocolFactory, TNonblockingTransport transport) throws TException { + super(client, protocolFactory, transport, resultHandler, false); + this.tableName = tableName; + this.columnFamilies = columnFamilies; + } + + public void write_args(TProtocol prot) throws TException { + prot.writeMessageBegin(new TMessage("createTable", TMessageType.CALL, 0)); + createTable_args args = new createTable_args(); + args.setTableName(tableName); + args.setColumnFamilies(columnFamilies); + args.write(prot); + prot.writeMessageEnd(); + } + + public void getResult() throws IOError, IllegalArgument, AlreadyExists, TException { + if (getState() != State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + TMemoryInputTransport memoryTransport = new TMemoryInputTransport(getFrameBuffer().array()); + TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + (new Client(prot)).recv_createTable(); + } + } + + public void deleteTable(ByteBuffer tableName, AsyncMethodCallback resultHandler) throws TException { + checkReady(); + deleteTable_call method_call = new deleteTable_call(tableName, resultHandler, this, protocolFactory, transport); + manager.call(method_call); + } + + public static class deleteTable_call extends TAsyncMethodCall { + private ByteBuffer tableName; + public deleteTable_call(ByteBuffer tableName, AsyncMethodCallback resultHandler, TAsyncClient client, TProtocolFactory protocolFactory, TNonblockingTransport transport) throws TException { + super(client, protocolFactory, transport, resultHandler, false); + this.tableName = tableName; + } + + public void write_args(TProtocol prot) throws TException { + prot.writeMessageBegin(new TMessage("deleteTable", TMessageType.CALL, 0)); + deleteTable_args args = new deleteTable_args(); + args.setTableName(tableName); + args.write(prot); + prot.writeMessageEnd(); + } + + public void getResult() throws IOError, TException { + if (getState() != State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + TMemoryInputTransport memoryTransport = new TMemoryInputTransport(getFrameBuffer().array()); + TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + (new Client(prot)).recv_deleteTable(); + } + } + + public void get(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, AsyncMethodCallback resultHandler) throws TException { + checkReady(); + get_call method_call = new get_call(tableName, row, column, resultHandler, this, protocolFactory, transport); + manager.call(method_call); + } + + public static class get_call extends TAsyncMethodCall { + private ByteBuffer tableName; + private ByteBuffer row; + private ByteBuffer column; + public get_call(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, AsyncMethodCallback resultHandler, TAsyncClient client, TProtocolFactory protocolFactory, TNonblockingTransport transport) throws TException { + super(client, protocolFactory, transport, resultHandler, false); + this.tableName = tableName; + this.row = row; + this.column = column; + } + + public void write_args(TProtocol prot) throws TException { + prot.writeMessageBegin(new TMessage("get", TMessageType.CALL, 0)); + get_args args = new get_args(); + args.setTableName(tableName); + args.setRow(row); + args.setColumn(column); + args.write(prot); + prot.writeMessageEnd(); + } + + public List getResult() throws IOError, TException { + if (getState() != State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + TMemoryInputTransport memoryTransport = new TMemoryInputTransport(getFrameBuffer().array()); + TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_get(); + } + } + + public void getVer(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, int numVersions, AsyncMethodCallback resultHandler) throws TException { + checkReady(); + getVer_call method_call = new getVer_call(tableName, row, column, numVersions, resultHandler, this, protocolFactory, transport); + manager.call(method_call); + } + + public static class getVer_call extends TAsyncMethodCall { + private ByteBuffer tableName; + private ByteBuffer row; + private ByteBuffer column; + private int numVersions; + public getVer_call(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, int numVersions, AsyncMethodCallback resultHandler, TAsyncClient client, TProtocolFactory protocolFactory, TNonblockingTransport transport) throws TException { + super(client, protocolFactory, transport, resultHandler, false); + this.tableName = tableName; + this.row = row; + this.column = column; + this.numVersions = numVersions; + } + + public void write_args(TProtocol prot) throws TException { + prot.writeMessageBegin(new TMessage("getVer", TMessageType.CALL, 0)); + getVer_args args = new getVer_args(); + args.setTableName(tableName); + args.setRow(row); + args.setColumn(column); + args.setNumVersions(numVersions); + args.write(prot); + prot.writeMessageEnd(); + } + + public List getResult() throws IOError, TException { + if (getState() != State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + TMemoryInputTransport memoryTransport = new TMemoryInputTransport(getFrameBuffer().array()); + TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_getVer(); + } + } + + public void getVerTs(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, long timestamp, int numVersions, AsyncMethodCallback resultHandler) throws TException { + checkReady(); + getVerTs_call method_call = new getVerTs_call(tableName, row, column, timestamp, numVersions, resultHandler, this, protocolFactory, transport); + manager.call(method_call); + } + + public static class getVerTs_call extends TAsyncMethodCall { + private ByteBuffer tableName; + private ByteBuffer row; + private ByteBuffer column; + private long timestamp; + private int numVersions; + public getVerTs_call(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, long timestamp, int numVersions, AsyncMethodCallback resultHandler, TAsyncClient client, TProtocolFactory protocolFactory, TNonblockingTransport transport) throws TException { + super(client, protocolFactory, transport, resultHandler, false); + this.tableName = tableName; + this.row = row; + this.column = column; + this.timestamp = timestamp; + this.numVersions = numVersions; + } + + public void write_args(TProtocol prot) throws TException { + prot.writeMessageBegin(new TMessage("getVerTs", TMessageType.CALL, 0)); + getVerTs_args args = new getVerTs_args(); + args.setTableName(tableName); + args.setRow(row); + args.setColumn(column); + args.setTimestamp(timestamp); + args.setNumVersions(numVersions); + args.write(prot); + prot.writeMessageEnd(); + } + + public List getResult() throws IOError, TException { + if (getState() != State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + TMemoryInputTransport memoryTransport = new TMemoryInputTransport(getFrameBuffer().array()); + TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_getVerTs(); + } + } + + public void getRow(ByteBuffer tableName, ByteBuffer row, AsyncMethodCallback resultHandler) throws TException { + checkReady(); + getRow_call method_call = new getRow_call(tableName, row, resultHandler, this, protocolFactory, transport); + manager.call(method_call); + } + + public static class getRow_call extends TAsyncMethodCall { + private ByteBuffer tableName; + private ByteBuffer row; + public getRow_call(ByteBuffer tableName, ByteBuffer row, AsyncMethodCallback resultHandler, TAsyncClient client, TProtocolFactory protocolFactory, TNonblockingTransport transport) throws TException { + super(client, protocolFactory, transport, resultHandler, false); + this.tableName = tableName; + this.row = row; + } + + public void write_args(TProtocol prot) throws TException { + prot.writeMessageBegin(new TMessage("getRow", TMessageType.CALL, 0)); + getRow_args args = new getRow_args(); + args.setTableName(tableName); + args.setRow(row); + args.write(prot); + prot.writeMessageEnd(); + } + + public List getResult() throws IOError, TException { + if (getState() != State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + TMemoryInputTransport memoryTransport = new TMemoryInputTransport(getFrameBuffer().array()); + TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_getRow(); + } + } + + public void getRowWithColumns(ByteBuffer tableName, ByteBuffer row, List columns, AsyncMethodCallback resultHandler) throws TException { + checkReady(); + getRowWithColumns_call method_call = new getRowWithColumns_call(tableName, row, columns, resultHandler, this, protocolFactory, transport); + manager.call(method_call); + } + + public static class getRowWithColumns_call extends TAsyncMethodCall { + private ByteBuffer tableName; + private ByteBuffer row; + private List columns; + public getRowWithColumns_call(ByteBuffer tableName, ByteBuffer row, List columns, AsyncMethodCallback resultHandler, TAsyncClient client, TProtocolFactory protocolFactory, TNonblockingTransport transport) throws TException { + super(client, protocolFactory, transport, resultHandler, false); + this.tableName = tableName; + this.row = row; + this.columns = columns; + } + + public void write_args(TProtocol prot) throws TException { + prot.writeMessageBegin(new TMessage("getRowWithColumns", TMessageType.CALL, 0)); + getRowWithColumns_args args = new getRowWithColumns_args(); + args.setTableName(tableName); + args.setRow(row); + args.setColumns(columns); + args.write(prot); + prot.writeMessageEnd(); + } + + public List getResult() throws IOError, TException { + if (getState() != State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + TMemoryInputTransport memoryTransport = new TMemoryInputTransport(getFrameBuffer().array()); + TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_getRowWithColumns(); + } + } + + public void getRowTs(ByteBuffer tableName, ByteBuffer row, long timestamp, AsyncMethodCallback resultHandler) throws TException { + checkReady(); + getRowTs_call method_call = new getRowTs_call(tableName, row, timestamp, resultHandler, this, protocolFactory, transport); + manager.call(method_call); + } + + public static class getRowTs_call extends TAsyncMethodCall { + private ByteBuffer tableName; + private ByteBuffer row; + private long timestamp; + public getRowTs_call(ByteBuffer tableName, ByteBuffer row, long timestamp, AsyncMethodCallback resultHandler, TAsyncClient client, TProtocolFactory protocolFactory, TNonblockingTransport transport) throws TException { + super(client, protocolFactory, transport, resultHandler, false); + this.tableName = tableName; + this.row = row; + this.timestamp = timestamp; + } + + public void write_args(TProtocol prot) throws TException { + prot.writeMessageBegin(new TMessage("getRowTs", TMessageType.CALL, 0)); + getRowTs_args args = new getRowTs_args(); + args.setTableName(tableName); + args.setRow(row); + args.setTimestamp(timestamp); + args.write(prot); + prot.writeMessageEnd(); + } + + public List getResult() throws IOError, TException { + if (getState() != State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + TMemoryInputTransport memoryTransport = new TMemoryInputTransport(getFrameBuffer().array()); + TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_getRowTs(); + } + } + + public void getRowWithColumnsTs(ByteBuffer tableName, ByteBuffer row, List columns, long timestamp, AsyncMethodCallback resultHandler) throws TException { + checkReady(); + getRowWithColumnsTs_call method_call = new getRowWithColumnsTs_call(tableName, row, columns, timestamp, resultHandler, this, protocolFactory, transport); + manager.call(method_call); + } + + public static class getRowWithColumnsTs_call extends TAsyncMethodCall { + private ByteBuffer tableName; + private ByteBuffer row; + private List columns; + private long timestamp; + public getRowWithColumnsTs_call(ByteBuffer tableName, ByteBuffer row, List columns, long timestamp, AsyncMethodCallback resultHandler, TAsyncClient client, TProtocolFactory protocolFactory, TNonblockingTransport transport) throws TException { + super(client, protocolFactory, transport, resultHandler, false); + this.tableName = tableName; + this.row = row; + this.columns = columns; + this.timestamp = timestamp; + } + + public void write_args(TProtocol prot) throws TException { + prot.writeMessageBegin(new TMessage("getRowWithColumnsTs", TMessageType.CALL, 0)); + getRowWithColumnsTs_args args = new getRowWithColumnsTs_args(); + args.setTableName(tableName); + args.setRow(row); + args.setColumns(columns); + args.setTimestamp(timestamp); + args.write(prot); + prot.writeMessageEnd(); + } + + public List getResult() throws IOError, TException { + if (getState() != State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + TMemoryInputTransport memoryTransport = new TMemoryInputTransport(getFrameBuffer().array()); + TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_getRowWithColumnsTs(); + } + } + + public void mutateRow(ByteBuffer tableName, ByteBuffer row, List mutations, AsyncMethodCallback resultHandler) throws TException { + checkReady(); + mutateRow_call method_call = new mutateRow_call(tableName, row, mutations, resultHandler, this, protocolFactory, transport); + manager.call(method_call); + } + + public static class mutateRow_call extends TAsyncMethodCall { + private ByteBuffer tableName; + private ByteBuffer row; + private List mutations; + public mutateRow_call(ByteBuffer tableName, ByteBuffer row, List mutations, AsyncMethodCallback resultHandler, TAsyncClient client, TProtocolFactory protocolFactory, TNonblockingTransport transport) throws TException { + super(client, protocolFactory, transport, resultHandler, false); + this.tableName = tableName; + this.row = row; + this.mutations = mutations; + } + + public void write_args(TProtocol prot) throws TException { + prot.writeMessageBegin(new TMessage("mutateRow", TMessageType.CALL, 0)); + mutateRow_args args = new mutateRow_args(); + args.setTableName(tableName); + args.setRow(row); + args.setMutations(mutations); + args.write(prot); + prot.writeMessageEnd(); + } + + public void getResult() throws IOError, IllegalArgument, TException { + if (getState() != State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + TMemoryInputTransport memoryTransport = new TMemoryInputTransport(getFrameBuffer().array()); + TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + (new Client(prot)).recv_mutateRow(); + } + } + + public void mutateRowTs(ByteBuffer tableName, ByteBuffer row, List mutations, long timestamp, AsyncMethodCallback resultHandler) throws TException { + checkReady(); + mutateRowTs_call method_call = new mutateRowTs_call(tableName, row, mutations, timestamp, resultHandler, this, protocolFactory, transport); + manager.call(method_call); + } + + public static class mutateRowTs_call extends TAsyncMethodCall { + private ByteBuffer tableName; + private ByteBuffer row; + private List mutations; + private long timestamp; + public mutateRowTs_call(ByteBuffer tableName, ByteBuffer row, List mutations, long timestamp, AsyncMethodCallback resultHandler, TAsyncClient client, TProtocolFactory protocolFactory, TNonblockingTransport transport) throws TException { + super(client, protocolFactory, transport, resultHandler, false); + this.tableName = tableName; + this.row = row; + this.mutations = mutations; + this.timestamp = timestamp; + } + + public void write_args(TProtocol prot) throws TException { + prot.writeMessageBegin(new TMessage("mutateRowTs", TMessageType.CALL, 0)); + mutateRowTs_args args = new mutateRowTs_args(); + args.setTableName(tableName); + args.setRow(row); + args.setMutations(mutations); + args.setTimestamp(timestamp); + args.write(prot); + prot.writeMessageEnd(); + } + + public void getResult() throws IOError, IllegalArgument, TException { + if (getState() != State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + TMemoryInputTransport memoryTransport = new TMemoryInputTransport(getFrameBuffer().array()); + TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + (new Client(prot)).recv_mutateRowTs(); + } + } + + public void mutateRows(ByteBuffer tableName, List rowBatches, AsyncMethodCallback resultHandler) throws TException { + checkReady(); + mutateRows_call method_call = new mutateRows_call(tableName, rowBatches, resultHandler, this, protocolFactory, transport); + manager.call(method_call); + } + + public static class mutateRows_call extends TAsyncMethodCall { + private ByteBuffer tableName; + private List rowBatches; + public mutateRows_call(ByteBuffer tableName, List rowBatches, AsyncMethodCallback resultHandler, TAsyncClient client, TProtocolFactory protocolFactory, TNonblockingTransport transport) throws TException { + super(client, protocolFactory, transport, resultHandler, false); + this.tableName = tableName; + this.rowBatches = rowBatches; + } + + public void write_args(TProtocol prot) throws TException { + prot.writeMessageBegin(new TMessage("mutateRows", TMessageType.CALL, 0)); + mutateRows_args args = new mutateRows_args(); + args.setTableName(tableName); + args.setRowBatches(rowBatches); + args.write(prot); + prot.writeMessageEnd(); + } + + public void getResult() throws IOError, IllegalArgument, TException { + if (getState() != State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + TMemoryInputTransport memoryTransport = new TMemoryInputTransport(getFrameBuffer().array()); + TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + (new Client(prot)).recv_mutateRows(); + } + } + + public void mutateRowsTs(ByteBuffer tableName, List rowBatches, long timestamp, AsyncMethodCallback resultHandler) throws TException { + checkReady(); + mutateRowsTs_call method_call = new mutateRowsTs_call(tableName, rowBatches, timestamp, resultHandler, this, protocolFactory, transport); + manager.call(method_call); + } + + public static class mutateRowsTs_call extends TAsyncMethodCall { + private ByteBuffer tableName; + private List rowBatches; + private long timestamp; + public mutateRowsTs_call(ByteBuffer tableName, List rowBatches, long timestamp, AsyncMethodCallback resultHandler, TAsyncClient client, TProtocolFactory protocolFactory, TNonblockingTransport transport) throws TException { + super(client, protocolFactory, transport, resultHandler, false); + this.tableName = tableName; + this.rowBatches = rowBatches; + this.timestamp = timestamp; + } + + public void write_args(TProtocol prot) throws TException { + prot.writeMessageBegin(new TMessage("mutateRowsTs", TMessageType.CALL, 0)); + mutateRowsTs_args args = new mutateRowsTs_args(); + args.setTableName(tableName); + args.setRowBatches(rowBatches); + args.setTimestamp(timestamp); + args.write(prot); + prot.writeMessageEnd(); + } + + public void getResult() throws IOError, IllegalArgument, TException { + if (getState() != State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + TMemoryInputTransport memoryTransport = new TMemoryInputTransport(getFrameBuffer().array()); + TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + (new Client(prot)).recv_mutateRowsTs(); + } + } + + public void atomicIncrement(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, long value, AsyncMethodCallback resultHandler) throws TException { + checkReady(); + atomicIncrement_call method_call = new atomicIncrement_call(tableName, row, column, value, resultHandler, this, protocolFactory, transport); + manager.call(method_call); + } + + public static class atomicIncrement_call extends TAsyncMethodCall { + private ByteBuffer tableName; + private ByteBuffer row; + private ByteBuffer column; + private long value; + public atomicIncrement_call(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, long value, AsyncMethodCallback resultHandler, TAsyncClient client, TProtocolFactory protocolFactory, TNonblockingTransport transport) throws TException { + super(client, protocolFactory, transport, resultHandler, false); + this.tableName = tableName; + this.row = row; + this.column = column; + this.value = value; + } + + public void write_args(TProtocol prot) throws TException { + prot.writeMessageBegin(new TMessage("atomicIncrement", TMessageType.CALL, 0)); + atomicIncrement_args args = new atomicIncrement_args(); + args.setTableName(tableName); + args.setRow(row); + args.setColumn(column); + args.setValue(value); + args.write(prot); + prot.writeMessageEnd(); + } + + public long getResult() throws IOError, IllegalArgument, TException { + if (getState() != State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + TMemoryInputTransport memoryTransport = new TMemoryInputTransport(getFrameBuffer().array()); + TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_atomicIncrement(); + } + } + + public void deleteAll(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, AsyncMethodCallback resultHandler) throws TException { + checkReady(); + deleteAll_call method_call = new deleteAll_call(tableName, row, column, resultHandler, this, protocolFactory, transport); + manager.call(method_call); + } + + public static class deleteAll_call extends TAsyncMethodCall { + private ByteBuffer tableName; + private ByteBuffer row; + private ByteBuffer column; + public deleteAll_call(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, AsyncMethodCallback resultHandler, TAsyncClient client, TProtocolFactory protocolFactory, TNonblockingTransport transport) throws TException { + super(client, protocolFactory, transport, resultHandler, false); + this.tableName = tableName; + this.row = row; + this.column = column; + } + + public void write_args(TProtocol prot) throws TException { + prot.writeMessageBegin(new TMessage("deleteAll", TMessageType.CALL, 0)); + deleteAll_args args = new deleteAll_args(); + args.setTableName(tableName); + args.setRow(row); + args.setColumn(column); + args.write(prot); + prot.writeMessageEnd(); + } + + public void getResult() throws IOError, TException { + if (getState() != State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + TMemoryInputTransport memoryTransport = new TMemoryInputTransport(getFrameBuffer().array()); + TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + (new Client(prot)).recv_deleteAll(); + } + } + + public void deleteAllTs(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, long timestamp, AsyncMethodCallback resultHandler) throws TException { + checkReady(); + deleteAllTs_call method_call = new deleteAllTs_call(tableName, row, column, timestamp, resultHandler, this, protocolFactory, transport); + manager.call(method_call); + } + + public static class deleteAllTs_call extends TAsyncMethodCall { + private ByteBuffer tableName; + private ByteBuffer row; + private ByteBuffer column; + private long timestamp; + public deleteAllTs_call(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, long timestamp, AsyncMethodCallback resultHandler, TAsyncClient client, TProtocolFactory protocolFactory, TNonblockingTransport transport) throws TException { + super(client, protocolFactory, transport, resultHandler, false); + this.tableName = tableName; + this.row = row; + this.column = column; + this.timestamp = timestamp; + } + + public void write_args(TProtocol prot) throws TException { + prot.writeMessageBegin(new TMessage("deleteAllTs", TMessageType.CALL, 0)); + deleteAllTs_args args = new deleteAllTs_args(); + args.setTableName(tableName); + args.setRow(row); + args.setColumn(column); + args.setTimestamp(timestamp); + args.write(prot); + prot.writeMessageEnd(); + } + + public void getResult() throws IOError, TException { + if (getState() != State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + TMemoryInputTransport memoryTransport = new TMemoryInputTransport(getFrameBuffer().array()); + TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + (new Client(prot)).recv_deleteAllTs(); + } + } + + public void deleteAllRow(ByteBuffer tableName, ByteBuffer row, AsyncMethodCallback resultHandler) throws TException { + checkReady(); + deleteAllRow_call method_call = new deleteAllRow_call(tableName, row, resultHandler, this, protocolFactory, transport); + manager.call(method_call); + } + + public static class deleteAllRow_call extends TAsyncMethodCall { + private ByteBuffer tableName; + private ByteBuffer row; + public deleteAllRow_call(ByteBuffer tableName, ByteBuffer row, AsyncMethodCallback resultHandler, TAsyncClient client, TProtocolFactory protocolFactory, TNonblockingTransport transport) throws TException { + super(client, protocolFactory, transport, resultHandler, false); + this.tableName = tableName; + this.row = row; + } + + public void write_args(TProtocol prot) throws TException { + prot.writeMessageBegin(new TMessage("deleteAllRow", TMessageType.CALL, 0)); + deleteAllRow_args args = new deleteAllRow_args(); + args.setTableName(tableName); + args.setRow(row); + args.write(prot); + prot.writeMessageEnd(); + } + + public void getResult() throws IOError, TException { + if (getState() != State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + TMemoryInputTransport memoryTransport = new TMemoryInputTransport(getFrameBuffer().array()); + TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + (new Client(prot)).recv_deleteAllRow(); + } + } + + public void deleteAllRowTs(ByteBuffer tableName, ByteBuffer row, long timestamp, AsyncMethodCallback resultHandler) throws TException { + checkReady(); + deleteAllRowTs_call method_call = new deleteAllRowTs_call(tableName, row, timestamp, resultHandler, this, protocolFactory, transport); + manager.call(method_call); + } + + public static class deleteAllRowTs_call extends TAsyncMethodCall { + private ByteBuffer tableName; + private ByteBuffer row; + private long timestamp; + public deleteAllRowTs_call(ByteBuffer tableName, ByteBuffer row, long timestamp, AsyncMethodCallback resultHandler, TAsyncClient client, TProtocolFactory protocolFactory, TNonblockingTransport transport) throws TException { + super(client, protocolFactory, transport, resultHandler, false); + this.tableName = tableName; + this.row = row; + this.timestamp = timestamp; + } + + public void write_args(TProtocol prot) throws TException { + prot.writeMessageBegin(new TMessage("deleteAllRowTs", TMessageType.CALL, 0)); + deleteAllRowTs_args args = new deleteAllRowTs_args(); + args.setTableName(tableName); + args.setRow(row); + args.setTimestamp(timestamp); + args.write(prot); + prot.writeMessageEnd(); + } + + public void getResult() throws IOError, TException { + if (getState() != State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + TMemoryInputTransport memoryTransport = new TMemoryInputTransport(getFrameBuffer().array()); + TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + (new Client(prot)).recv_deleteAllRowTs(); + } + } + + public void scannerOpen(ByteBuffer tableName, ByteBuffer startRow, List columns, AsyncMethodCallback resultHandler) throws TException { + checkReady(); + scannerOpen_call method_call = new scannerOpen_call(tableName, startRow, columns, resultHandler, this, protocolFactory, transport); + manager.call(method_call); + } + + public static class scannerOpen_call extends TAsyncMethodCall { + private ByteBuffer tableName; + private ByteBuffer startRow; + private List columns; + public scannerOpen_call(ByteBuffer tableName, ByteBuffer startRow, List columns, AsyncMethodCallback resultHandler, TAsyncClient client, TProtocolFactory protocolFactory, TNonblockingTransport transport) throws TException { + super(client, protocolFactory, transport, resultHandler, false); + this.tableName = tableName; + this.startRow = startRow; + this.columns = columns; + } + + public void write_args(TProtocol prot) throws TException { + prot.writeMessageBegin(new TMessage("scannerOpen", TMessageType.CALL, 0)); + scannerOpen_args args = new scannerOpen_args(); + args.setTableName(tableName); + args.setStartRow(startRow); + args.setColumns(columns); + args.write(prot); + prot.writeMessageEnd(); + } + + public int getResult() throws IOError, TException { + if (getState() != State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + TMemoryInputTransport memoryTransport = new TMemoryInputTransport(getFrameBuffer().array()); + TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_scannerOpen(); + } + } + + public void scannerOpenWithStop(ByteBuffer tableName, ByteBuffer startRow, ByteBuffer stopRow, List columns, AsyncMethodCallback resultHandler) throws TException { + checkReady(); + scannerOpenWithStop_call method_call = new scannerOpenWithStop_call(tableName, startRow, stopRow, columns, resultHandler, this, protocolFactory, transport); + manager.call(method_call); + } + + public static class scannerOpenWithStop_call extends TAsyncMethodCall { + private ByteBuffer tableName; + private ByteBuffer startRow; + private ByteBuffer stopRow; + private List columns; + public scannerOpenWithStop_call(ByteBuffer tableName, ByteBuffer startRow, ByteBuffer stopRow, List columns, AsyncMethodCallback resultHandler, TAsyncClient client, TProtocolFactory protocolFactory, TNonblockingTransport transport) throws TException { + super(client, protocolFactory, transport, resultHandler, false); + this.tableName = tableName; + this.startRow = startRow; + this.stopRow = stopRow; + this.columns = columns; + } + + public void write_args(TProtocol prot) throws TException { + prot.writeMessageBegin(new TMessage("scannerOpenWithStop", TMessageType.CALL, 0)); + scannerOpenWithStop_args args = new scannerOpenWithStop_args(); + args.setTableName(tableName); + args.setStartRow(startRow); + args.setStopRow(stopRow); + args.setColumns(columns); + args.write(prot); + prot.writeMessageEnd(); + } + + public int getResult() throws IOError, TException { + if (getState() != State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + TMemoryInputTransport memoryTransport = new TMemoryInputTransport(getFrameBuffer().array()); + TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_scannerOpenWithStop(); + } + } + + public void scannerOpenWithPrefix(ByteBuffer tableName, ByteBuffer startAndPrefix, List columns, AsyncMethodCallback resultHandler) throws TException { + checkReady(); + scannerOpenWithPrefix_call method_call = new scannerOpenWithPrefix_call(tableName, startAndPrefix, columns, resultHandler, this, protocolFactory, transport); + manager.call(method_call); + } + + public static class scannerOpenWithPrefix_call extends TAsyncMethodCall { + private ByteBuffer tableName; + private ByteBuffer startAndPrefix; + private List columns; + public scannerOpenWithPrefix_call(ByteBuffer tableName, ByteBuffer startAndPrefix, List columns, AsyncMethodCallback resultHandler, TAsyncClient client, TProtocolFactory protocolFactory, TNonblockingTransport transport) throws TException { + super(client, protocolFactory, transport, resultHandler, false); + this.tableName = tableName; + this.startAndPrefix = startAndPrefix; + this.columns = columns; + } + + public void write_args(TProtocol prot) throws TException { + prot.writeMessageBegin(new TMessage("scannerOpenWithPrefix", TMessageType.CALL, 0)); + scannerOpenWithPrefix_args args = new scannerOpenWithPrefix_args(); + args.setTableName(tableName); + args.setStartAndPrefix(startAndPrefix); + args.setColumns(columns); + args.write(prot); + prot.writeMessageEnd(); + } + + public int getResult() throws IOError, TException { + if (getState() != State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + TMemoryInputTransport memoryTransport = new TMemoryInputTransport(getFrameBuffer().array()); + TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_scannerOpenWithPrefix(); + } + } + + public void scannerOpenTs(ByteBuffer tableName, ByteBuffer startRow, List columns, long timestamp, AsyncMethodCallback resultHandler) throws TException { + checkReady(); + scannerOpenTs_call method_call = new scannerOpenTs_call(tableName, startRow, columns, timestamp, resultHandler, this, protocolFactory, transport); + manager.call(method_call); + } + + public static class scannerOpenTs_call extends TAsyncMethodCall { + private ByteBuffer tableName; + private ByteBuffer startRow; + private List columns; + private long timestamp; + public scannerOpenTs_call(ByteBuffer tableName, ByteBuffer startRow, List columns, long timestamp, AsyncMethodCallback resultHandler, TAsyncClient client, TProtocolFactory protocolFactory, TNonblockingTransport transport) throws TException { + super(client, protocolFactory, transport, resultHandler, false); + this.tableName = tableName; + this.startRow = startRow; + this.columns = columns; + this.timestamp = timestamp; + } + + public void write_args(TProtocol prot) throws TException { + prot.writeMessageBegin(new TMessage("scannerOpenTs", TMessageType.CALL, 0)); + scannerOpenTs_args args = new scannerOpenTs_args(); + args.setTableName(tableName); + args.setStartRow(startRow); + args.setColumns(columns); + args.setTimestamp(timestamp); + args.write(prot); + prot.writeMessageEnd(); + } + + public int getResult() throws IOError, TException { + if (getState() != State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + TMemoryInputTransport memoryTransport = new TMemoryInputTransport(getFrameBuffer().array()); + TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_scannerOpenTs(); + } + } + + public void scannerOpenWithStopTs(ByteBuffer tableName, ByteBuffer startRow, ByteBuffer stopRow, List columns, long timestamp, AsyncMethodCallback resultHandler) throws TException { + checkReady(); + scannerOpenWithStopTs_call method_call = new scannerOpenWithStopTs_call(tableName, startRow, stopRow, columns, timestamp, resultHandler, this, protocolFactory, transport); + manager.call(method_call); + } + + public static class scannerOpenWithStopTs_call extends TAsyncMethodCall { + private ByteBuffer tableName; + private ByteBuffer startRow; + private ByteBuffer stopRow; + private List columns; + private long timestamp; + public scannerOpenWithStopTs_call(ByteBuffer tableName, ByteBuffer startRow, ByteBuffer stopRow, List columns, long timestamp, AsyncMethodCallback resultHandler, TAsyncClient client, TProtocolFactory protocolFactory, TNonblockingTransport transport) throws TException { + super(client, protocolFactory, transport, resultHandler, false); + this.tableName = tableName; + this.startRow = startRow; + this.stopRow = stopRow; + this.columns = columns; + this.timestamp = timestamp; + } + + public void write_args(TProtocol prot) throws TException { + prot.writeMessageBegin(new TMessage("scannerOpenWithStopTs", TMessageType.CALL, 0)); + scannerOpenWithStopTs_args args = new scannerOpenWithStopTs_args(); + args.setTableName(tableName); + args.setStartRow(startRow); + args.setStopRow(stopRow); + args.setColumns(columns); + args.setTimestamp(timestamp); + args.write(prot); + prot.writeMessageEnd(); + } + + public int getResult() throws IOError, TException { + if (getState() != State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + TMemoryInputTransport memoryTransport = new TMemoryInputTransport(getFrameBuffer().array()); + TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_scannerOpenWithStopTs(); + } + } + + public void scannerGet(int id, AsyncMethodCallback resultHandler) throws TException { + checkReady(); + scannerGet_call method_call = new scannerGet_call(id, resultHandler, this, protocolFactory, transport); + manager.call(method_call); + } + + public static class scannerGet_call extends TAsyncMethodCall { + private int id; + public scannerGet_call(int id, AsyncMethodCallback resultHandler, TAsyncClient client, TProtocolFactory protocolFactory, TNonblockingTransport transport) throws TException { + super(client, protocolFactory, transport, resultHandler, false); + this.id = id; + } + + public void write_args(TProtocol prot) throws TException { + prot.writeMessageBegin(new TMessage("scannerGet", TMessageType.CALL, 0)); + scannerGet_args args = new scannerGet_args(); + args.setId(id); + args.write(prot); + prot.writeMessageEnd(); + } + + public List getResult() throws IOError, IllegalArgument, TException { + if (getState() != State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + TMemoryInputTransport memoryTransport = new TMemoryInputTransport(getFrameBuffer().array()); + TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_scannerGet(); + } + } + + public void scannerGetList(int id, int nbRows, AsyncMethodCallback resultHandler) throws TException { + checkReady(); + scannerGetList_call method_call = new scannerGetList_call(id, nbRows, resultHandler, this, protocolFactory, transport); + manager.call(method_call); + } + + public static class scannerGetList_call extends TAsyncMethodCall { + private int id; + private int nbRows; + public scannerGetList_call(int id, int nbRows, AsyncMethodCallback resultHandler, TAsyncClient client, TProtocolFactory protocolFactory, TNonblockingTransport transport) throws TException { + super(client, protocolFactory, transport, resultHandler, false); + this.id = id; + this.nbRows = nbRows; + } + + public void write_args(TProtocol prot) throws TException { + prot.writeMessageBegin(new TMessage("scannerGetList", TMessageType.CALL, 0)); + scannerGetList_args args = new scannerGetList_args(); + args.setId(id); + args.setNbRows(nbRows); + args.write(prot); + prot.writeMessageEnd(); + } + + public List getResult() throws IOError, IllegalArgument, TException { + if (getState() != State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + TMemoryInputTransport memoryTransport = new TMemoryInputTransport(getFrameBuffer().array()); + TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_scannerGetList(); + } + } + + public void scannerClose(int id, AsyncMethodCallback resultHandler) throws TException { + checkReady(); + scannerClose_call method_call = new scannerClose_call(id, resultHandler, this, protocolFactory, transport); + manager.call(method_call); + } + + public static class scannerClose_call extends TAsyncMethodCall { + private int id; + public scannerClose_call(int id, AsyncMethodCallback resultHandler, TAsyncClient client, TProtocolFactory protocolFactory, TNonblockingTransport transport) throws TException { + super(client, protocolFactory, transport, resultHandler, false); + this.id = id; + } + + public void write_args(TProtocol prot) throws TException { + prot.writeMessageBegin(new TMessage("scannerClose", TMessageType.CALL, 0)); + scannerClose_args args = new scannerClose_args(); + args.setId(id); + args.write(prot); + prot.writeMessageEnd(); + } + + public void getResult() throws IOError, IllegalArgument, TException { + if (getState() != State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + TMemoryInputTransport memoryTransport = new TMemoryInputTransport(getFrameBuffer().array()); + TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + (new Client(prot)).recv_scannerClose(); + } + } + + } + + public static class Processor implements TProcessor { + private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName()); + public Processor(Iface iface) + { + iface_ = iface; + processMap_.put("enableTable", new enableTable()); + processMap_.put("disableTable", new disableTable()); + processMap_.put("isTableEnabled", new isTableEnabled()); + processMap_.put("compact", new compact()); + processMap_.put("majorCompact", new majorCompact()); + processMap_.put("getTableNames", new getTableNames()); + processMap_.put("getColumnDescriptors", new getColumnDescriptors()); + processMap_.put("getTableRegions", new getTableRegions()); + processMap_.put("createTable", new createTable()); + processMap_.put("deleteTable", new deleteTable()); + processMap_.put("get", new get()); + processMap_.put("getVer", new getVer()); + processMap_.put("getVerTs", new getVerTs()); + processMap_.put("getRow", new getRow()); + processMap_.put("getRowWithColumns", new getRowWithColumns()); + processMap_.put("getRowTs", new getRowTs()); + processMap_.put("getRowWithColumnsTs", new getRowWithColumnsTs()); + processMap_.put("mutateRow", new mutateRow()); + processMap_.put("mutateRowTs", new mutateRowTs()); + processMap_.put("mutateRows", new mutateRows()); + processMap_.put("mutateRowsTs", new mutateRowsTs()); + processMap_.put("atomicIncrement", new atomicIncrement()); + processMap_.put("deleteAll", new deleteAll()); + processMap_.put("deleteAllTs", new deleteAllTs()); + processMap_.put("deleteAllRow", new deleteAllRow()); + processMap_.put("deleteAllRowTs", new deleteAllRowTs()); + processMap_.put("scannerOpen", new scannerOpen()); + processMap_.put("scannerOpenWithStop", new scannerOpenWithStop()); + processMap_.put("scannerOpenWithPrefix", new scannerOpenWithPrefix()); + processMap_.put("scannerOpenTs", new scannerOpenTs()); + processMap_.put("scannerOpenWithStopTs", new scannerOpenWithStopTs()); + processMap_.put("scannerGet", new scannerGet()); + processMap_.put("scannerGetList", new scannerGetList()); + processMap_.put("scannerClose", new scannerClose()); + } + + protected static interface ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException; + } + + private Iface iface_; + protected final HashMap processMap_ = new HashMap(); + + public boolean process(TProtocol iprot, TProtocol oprot) throws TException + { + TMessage msg = iprot.readMessageBegin(); + ProcessFunction fn = processMap_.get(msg.name); + if (fn == null) { + TProtocolUtil.skip(iprot, TType.STRUCT); + iprot.readMessageEnd(); + TApplicationException x = new TApplicationException(TApplicationException.UNKNOWN_METHOD, "Invalid method name: '"+msg.name+"'"); + oprot.writeMessageBegin(new TMessage(msg.name, TMessageType.EXCEPTION, msg.seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return true; + } + fn.process(msg.seqid, iprot, oprot); + return true; + } + + private class enableTable implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + enableTable_args args = new enableTable_args(); + try { + args.read(iprot); + } catch (TProtocolException e) { + iprot.readMessageEnd(); + TApplicationException x = new TApplicationException(TApplicationException.PROTOCOL_ERROR, e.getMessage()); + oprot.writeMessageBegin(new TMessage("enableTable", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + iprot.readMessageEnd(); + enableTable_result result = new enableTable_result(); + try { + iface_.enableTable(args.tableName); + } catch (IOError io) { + result.io = io; + } catch (Throwable th) { + LOGGER.error("Internal error processing enableTable", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing enableTable"); + oprot.writeMessageBegin(new TMessage("enableTable", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("enableTable", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + + private class disableTable implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + disableTable_args args = new disableTable_args(); + try { + args.read(iprot); + } catch (TProtocolException e) { + iprot.readMessageEnd(); + TApplicationException x = new TApplicationException(TApplicationException.PROTOCOL_ERROR, e.getMessage()); + oprot.writeMessageBegin(new TMessage("disableTable", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + iprot.readMessageEnd(); + disableTable_result result = new disableTable_result(); + try { + iface_.disableTable(args.tableName); + } catch (IOError io) { + result.io = io; + } catch (Throwable th) { + LOGGER.error("Internal error processing disableTable", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing disableTable"); + oprot.writeMessageBegin(new TMessage("disableTable", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("disableTable", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + + private class isTableEnabled implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + isTableEnabled_args args = new isTableEnabled_args(); + try { + args.read(iprot); + } catch (TProtocolException e) { + iprot.readMessageEnd(); + TApplicationException x = new TApplicationException(TApplicationException.PROTOCOL_ERROR, e.getMessage()); + oprot.writeMessageBegin(new TMessage("isTableEnabled", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + iprot.readMessageEnd(); + isTableEnabled_result result = new isTableEnabled_result(); + try { + result.success = iface_.isTableEnabled(args.tableName); + result.setSuccessIsSet(true); + } catch (IOError io) { + result.io = io; + } catch (Throwable th) { + LOGGER.error("Internal error processing isTableEnabled", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing isTableEnabled"); + oprot.writeMessageBegin(new TMessage("isTableEnabled", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("isTableEnabled", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + + private class compact implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + compact_args args = new compact_args(); + try { + args.read(iprot); + } catch (TProtocolException e) { + iprot.readMessageEnd(); + TApplicationException x = new TApplicationException(TApplicationException.PROTOCOL_ERROR, e.getMessage()); + oprot.writeMessageBegin(new TMessage("compact", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + iprot.readMessageEnd(); + compact_result result = new compact_result(); try { iface_.compact(args.tableNameOrRegionName); } catch (IOError io) { @@ -1941,7 +3424,17 @@ public class Hbase { public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { majorCompact_args args = new majorCompact_args(); - args.read(iprot); + try { + args.read(iprot); + } catch (TProtocolException e) { + iprot.readMessageEnd(); + TApplicationException x = new TApplicationException(TApplicationException.PROTOCOL_ERROR, e.getMessage()); + oprot.writeMessageBegin(new TMessage("majorCompact", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } iprot.readMessageEnd(); majorCompact_result result = new majorCompact_result(); try { @@ -1969,7 +3462,17 @@ public class Hbase { public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { getTableNames_args args = new getTableNames_args(); - args.read(iprot); + try { + args.read(iprot); + } catch (TProtocolException e) { + iprot.readMessageEnd(); + TApplicationException x = new TApplicationException(TApplicationException.PROTOCOL_ERROR, e.getMessage()); + oprot.writeMessageBegin(new TMessage("getTableNames", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } iprot.readMessageEnd(); getTableNames_result result = new getTableNames_result(); try { @@ -1997,7 +3500,17 @@ public class Hbase { public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { getColumnDescriptors_args args = new getColumnDescriptors_args(); - args.read(iprot); + try { + args.read(iprot); + } catch (TProtocolException e) { + iprot.readMessageEnd(); + TApplicationException x = new TApplicationException(TApplicationException.PROTOCOL_ERROR, e.getMessage()); + oprot.writeMessageBegin(new TMessage("getColumnDescriptors", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } iprot.readMessageEnd(); getColumnDescriptors_result result = new getColumnDescriptors_result(); try { @@ -2025,7 +3538,17 @@ public class Hbase { public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { getTableRegions_args args = new getTableRegions_args(); - args.read(iprot); + try { + args.read(iprot); + } catch (TProtocolException e) { + iprot.readMessageEnd(); + TApplicationException x = new TApplicationException(TApplicationException.PROTOCOL_ERROR, e.getMessage()); + oprot.writeMessageBegin(new TMessage("getTableRegions", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } iprot.readMessageEnd(); getTableRegions_result result = new getTableRegions_result(); try { @@ -2053,7 +3576,17 @@ public class Hbase { public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { createTable_args args = new createTable_args(); - args.read(iprot); + try { + args.read(iprot); + } catch (TProtocolException e) { + iprot.readMessageEnd(); + TApplicationException x = new TApplicationException(TApplicationException.PROTOCOL_ERROR, e.getMessage()); + oprot.writeMessageBegin(new TMessage("createTable", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } iprot.readMessageEnd(); createTable_result result = new createTable_result(); try { @@ -2085,7 +3618,17 @@ public class Hbase { public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { deleteTable_args args = new deleteTable_args(); - args.read(iprot); + try { + args.read(iprot); + } catch (TProtocolException e) { + iprot.readMessageEnd(); + TApplicationException x = new TApplicationException(TApplicationException.PROTOCOL_ERROR, e.getMessage()); + oprot.writeMessageBegin(new TMessage("deleteTable", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } iprot.readMessageEnd(); deleteTable_result result = new deleteTable_result(); try { @@ -2113,7 +3656,17 @@ public class Hbase { public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { get_args args = new get_args(); - args.read(iprot); + try { + args.read(iprot); + } catch (TProtocolException e) { + iprot.readMessageEnd(); + TApplicationException x = new TApplicationException(TApplicationException.PROTOCOL_ERROR, e.getMessage()); + oprot.writeMessageBegin(new TMessage("get", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } iprot.readMessageEnd(); get_result result = new get_result(); try { @@ -2141,7 +3694,17 @@ public class Hbase { public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { getVer_args args = new getVer_args(); - args.read(iprot); + try { + args.read(iprot); + } catch (TProtocolException e) { + iprot.readMessageEnd(); + TApplicationException x = new TApplicationException(TApplicationException.PROTOCOL_ERROR, e.getMessage()); + oprot.writeMessageBegin(new TMessage("getVer", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } iprot.readMessageEnd(); getVer_result result = new getVer_result(); try { @@ -2169,7 +3732,17 @@ public class Hbase { public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { getVerTs_args args = new getVerTs_args(); - args.read(iprot); + try { + args.read(iprot); + } catch (TProtocolException e) { + iprot.readMessageEnd(); + TApplicationException x = new TApplicationException(TApplicationException.PROTOCOL_ERROR, e.getMessage()); + oprot.writeMessageBegin(new TMessage("getVerTs", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } iprot.readMessageEnd(); getVerTs_result result = new getVerTs_result(); try { @@ -2197,7 +3770,17 @@ public class Hbase { public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { getRow_args args = new getRow_args(); - args.read(iprot); + try { + args.read(iprot); + } catch (TProtocolException e) { + iprot.readMessageEnd(); + TApplicationException x = new TApplicationException(TApplicationException.PROTOCOL_ERROR, e.getMessage()); + oprot.writeMessageBegin(new TMessage("getRow", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } iprot.readMessageEnd(); getRow_result result = new getRow_result(); try { @@ -2225,7 +3808,17 @@ public class Hbase { public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { getRowWithColumns_args args = new getRowWithColumns_args(); - args.read(iprot); + try { + args.read(iprot); + } catch (TProtocolException e) { + iprot.readMessageEnd(); + TApplicationException x = new TApplicationException(TApplicationException.PROTOCOL_ERROR, e.getMessage()); + oprot.writeMessageBegin(new TMessage("getRowWithColumns", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } iprot.readMessageEnd(); getRowWithColumns_result result = new getRowWithColumns_result(); try { @@ -2253,7 +3846,17 @@ public class Hbase { public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { getRowTs_args args = new getRowTs_args(); - args.read(iprot); + try { + args.read(iprot); + } catch (TProtocolException e) { + iprot.readMessageEnd(); + TApplicationException x = new TApplicationException(TApplicationException.PROTOCOL_ERROR, e.getMessage()); + oprot.writeMessageBegin(new TMessage("getRowTs", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } iprot.readMessageEnd(); getRowTs_result result = new getRowTs_result(); try { @@ -2281,7 +3884,17 @@ public class Hbase { public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { getRowWithColumnsTs_args args = new getRowWithColumnsTs_args(); - args.read(iprot); + try { + args.read(iprot); + } catch (TProtocolException e) { + iprot.readMessageEnd(); + TApplicationException x = new TApplicationException(TApplicationException.PROTOCOL_ERROR, e.getMessage()); + oprot.writeMessageBegin(new TMessage("getRowWithColumnsTs", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } iprot.readMessageEnd(); getRowWithColumnsTs_result result = new getRowWithColumnsTs_result(); try { @@ -2309,7 +3922,17 @@ public class Hbase { public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { mutateRow_args args = new mutateRow_args(); - args.read(iprot); + try { + args.read(iprot); + } catch (TProtocolException e) { + iprot.readMessageEnd(); + TApplicationException x = new TApplicationException(TApplicationException.PROTOCOL_ERROR, e.getMessage()); + oprot.writeMessageBegin(new TMessage("mutateRow", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } iprot.readMessageEnd(); mutateRow_result result = new mutateRow_result(); try { @@ -2339,7 +3962,17 @@ public class Hbase { public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { mutateRowTs_args args = new mutateRowTs_args(); - args.read(iprot); + try { + args.read(iprot); + } catch (TProtocolException e) { + iprot.readMessageEnd(); + TApplicationException x = new TApplicationException(TApplicationException.PROTOCOL_ERROR, e.getMessage()); + oprot.writeMessageBegin(new TMessage("mutateRowTs", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } iprot.readMessageEnd(); mutateRowTs_result result = new mutateRowTs_result(); try { @@ -2369,7 +4002,17 @@ public class Hbase { public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { mutateRows_args args = new mutateRows_args(); - args.read(iprot); + try { + args.read(iprot); + } catch (TProtocolException e) { + iprot.readMessageEnd(); + TApplicationException x = new TApplicationException(TApplicationException.PROTOCOL_ERROR, e.getMessage()); + oprot.writeMessageBegin(new TMessage("mutateRows", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } iprot.readMessageEnd(); mutateRows_result result = new mutateRows_result(); try { @@ -2399,7 +4042,17 @@ public class Hbase { public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { mutateRowsTs_args args = new mutateRowsTs_args(); - args.read(iprot); + try { + args.read(iprot); + } catch (TProtocolException e) { + iprot.readMessageEnd(); + TApplicationException x = new TApplicationException(TApplicationException.PROTOCOL_ERROR, e.getMessage()); + oprot.writeMessageBegin(new TMessage("mutateRowsTs", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } iprot.readMessageEnd(); mutateRowsTs_result result = new mutateRowsTs_result(); try { @@ -2429,7 +4082,17 @@ public class Hbase { public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { atomicIncrement_args args = new atomicIncrement_args(); - args.read(iprot); + try { + args.read(iprot); + } catch (TProtocolException e) { + iprot.readMessageEnd(); + TApplicationException x = new TApplicationException(TApplicationException.PROTOCOL_ERROR, e.getMessage()); + oprot.writeMessageBegin(new TMessage("atomicIncrement", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } iprot.readMessageEnd(); atomicIncrement_result result = new atomicIncrement_result(); try { @@ -2460,7 +4123,17 @@ public class Hbase { public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { deleteAll_args args = new deleteAll_args(); - args.read(iprot); + try { + args.read(iprot); + } catch (TProtocolException e) { + iprot.readMessageEnd(); + TApplicationException x = new TApplicationException(TApplicationException.PROTOCOL_ERROR, e.getMessage()); + oprot.writeMessageBegin(new TMessage("deleteAll", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } iprot.readMessageEnd(); deleteAll_result result = new deleteAll_result(); try { @@ -2488,7 +4161,17 @@ public class Hbase { public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { deleteAllTs_args args = new deleteAllTs_args(); - args.read(iprot); + try { + args.read(iprot); + } catch (TProtocolException e) { + iprot.readMessageEnd(); + TApplicationException x = new TApplicationException(TApplicationException.PROTOCOL_ERROR, e.getMessage()); + oprot.writeMessageBegin(new TMessage("deleteAllTs", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } iprot.readMessageEnd(); deleteAllTs_result result = new deleteAllTs_result(); try { @@ -2516,7 +4199,17 @@ public class Hbase { public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { deleteAllRow_args args = new deleteAllRow_args(); - args.read(iprot); + try { + args.read(iprot); + } catch (TProtocolException e) { + iprot.readMessageEnd(); + TApplicationException x = new TApplicationException(TApplicationException.PROTOCOL_ERROR, e.getMessage()); + oprot.writeMessageBegin(new TMessage("deleteAllRow", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } iprot.readMessageEnd(); deleteAllRow_result result = new deleteAllRow_result(); try { @@ -2544,7 +4237,17 @@ public class Hbase { public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { deleteAllRowTs_args args = new deleteAllRowTs_args(); - args.read(iprot); + try { + args.read(iprot); + } catch (TProtocolException e) { + iprot.readMessageEnd(); + TApplicationException x = new TApplicationException(TApplicationException.PROTOCOL_ERROR, e.getMessage()); + oprot.writeMessageBegin(new TMessage("deleteAllRowTs", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } iprot.readMessageEnd(); deleteAllRowTs_result result = new deleteAllRowTs_result(); try { @@ -2572,7 +4275,17 @@ public class Hbase { public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { scannerOpen_args args = new scannerOpen_args(); - args.read(iprot); + try { + args.read(iprot); + } catch (TProtocolException e) { + iprot.readMessageEnd(); + TApplicationException x = new TApplicationException(TApplicationException.PROTOCOL_ERROR, e.getMessage()); + oprot.writeMessageBegin(new TMessage("scannerOpen", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } iprot.readMessageEnd(); scannerOpen_result result = new scannerOpen_result(); try { @@ -2601,7 +4314,17 @@ public class Hbase { public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { scannerOpenWithStop_args args = new scannerOpenWithStop_args(); - args.read(iprot); + try { + args.read(iprot); + } catch (TProtocolException e) { + iprot.readMessageEnd(); + TApplicationException x = new TApplicationException(TApplicationException.PROTOCOL_ERROR, e.getMessage()); + oprot.writeMessageBegin(new TMessage("scannerOpenWithStop", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } iprot.readMessageEnd(); scannerOpenWithStop_result result = new scannerOpenWithStop_result(); try { @@ -2630,7 +4353,17 @@ public class Hbase { public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { scannerOpenWithPrefix_args args = new scannerOpenWithPrefix_args(); - args.read(iprot); + try { + args.read(iprot); + } catch (TProtocolException e) { + iprot.readMessageEnd(); + TApplicationException x = new TApplicationException(TApplicationException.PROTOCOL_ERROR, e.getMessage()); + oprot.writeMessageBegin(new TMessage("scannerOpenWithPrefix", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } iprot.readMessageEnd(); scannerOpenWithPrefix_result result = new scannerOpenWithPrefix_result(); try { @@ -2659,7 +4392,17 @@ public class Hbase { public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { scannerOpenTs_args args = new scannerOpenTs_args(); - args.read(iprot); + try { + args.read(iprot); + } catch (TProtocolException e) { + iprot.readMessageEnd(); + TApplicationException x = new TApplicationException(TApplicationException.PROTOCOL_ERROR, e.getMessage()); + oprot.writeMessageBegin(new TMessage("scannerOpenTs", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } iprot.readMessageEnd(); scannerOpenTs_result result = new scannerOpenTs_result(); try { @@ -2688,7 +4431,17 @@ public class Hbase { public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { scannerOpenWithStopTs_args args = new scannerOpenWithStopTs_args(); - args.read(iprot); + try { + args.read(iprot); + } catch (TProtocolException e) { + iprot.readMessageEnd(); + TApplicationException x = new TApplicationException(TApplicationException.PROTOCOL_ERROR, e.getMessage()); + oprot.writeMessageBegin(new TMessage("scannerOpenWithStopTs", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } iprot.readMessageEnd(); scannerOpenWithStopTs_result result = new scannerOpenWithStopTs_result(); try { @@ -2717,7 +4470,17 @@ public class Hbase { public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { scannerGet_args args = new scannerGet_args(); - args.read(iprot); + try { + args.read(iprot); + } catch (TProtocolException e) { + iprot.readMessageEnd(); + TApplicationException x = new TApplicationException(TApplicationException.PROTOCOL_ERROR, e.getMessage()); + oprot.writeMessageBegin(new TMessage("scannerGet", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } iprot.readMessageEnd(); scannerGet_result result = new scannerGet_result(); try { @@ -2747,7 +4510,17 @@ public class Hbase { public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { scannerGetList_args args = new scannerGetList_args(); - args.read(iprot); + try { + args.read(iprot); + } catch (TProtocolException e) { + iprot.readMessageEnd(); + TApplicationException x = new TApplicationException(TApplicationException.PROTOCOL_ERROR, e.getMessage()); + oprot.writeMessageBegin(new TMessage("scannerGetList", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } iprot.readMessageEnd(); scannerGetList_result result = new scannerGetList_result(); try { @@ -2777,7 +4550,17 @@ public class Hbase { public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { scannerClose_args args = new scannerClose_args(); - args.read(iprot); + try { + args.read(iprot); + } catch (TProtocolException e) { + iprot.readMessageEnd(); + TApplicationException x = new TApplicationException(TApplicationException.PROTOCOL_ERROR, e.getMessage()); + oprot.writeMessageBegin(new TMessage("scannerClose", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } iprot.readMessageEnd(); scannerClose_result result = new scannerClose_result(); try { @@ -2805,7 +4588,7 @@ public class Hbase { } - public static class enableTable_args implements TBase, java.io.Serializable, Cloneable, Comparable { + public static class enableTable_args implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("enableTable_args"); private static final TField TABLE_NAME_FIELD_DESC = new TField("tableName", TType.STRING, (short)1); @@ -2813,7 +4596,7 @@ public class Hbase { /** * name of the table */ - public byte[] tableName; + public ByteBuffer tableName; /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements TFieldIdEnum { @@ -2822,12 +4605,10 @@ public class Hbase { */ TABLE_NAME((short)1, "tableName"); - 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); } } @@ -2836,7 +4617,12 @@ public class Hbase { * 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: // TABLE_NAME + return TABLE_NAME; + default: + return null; + } } /** @@ -2875,12 +4661,12 @@ public class Hbase { // isset id assignments - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.TABLE_NAME, new FieldMetaData("tableName", 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.TABLE_NAME, new FieldMetaData("tableName", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING , "Bytes"))); + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(enableTable_args.class, metaDataMap); } @@ -2888,7 +4674,7 @@ public class Hbase { } public enableTable_args( - byte[] tableName) + ByteBuffer tableName) { this(); this.tableName = tableName; @@ -2907,22 +4693,32 @@ public class Hbase { return new enableTable_args(this); } - @Deprecated - public enableTable_args clone() { - return new enableTable_args(this); + @Override + public void clear() { + this.tableName = null; } /** * name of the table */ public byte[] getTableName() { - return this.tableName; + setTableName(TBaseHelper.rightSize(tableName)); + return tableName.array(); + } + + public ByteBuffer BufferForTableName() { + return tableName; } /** * name of the table */ public enableTable_args setTableName(byte[] tableName) { + setTableName(ByteBuffer.wrap(tableName)); + return this; + } + + public enableTable_args setTableName(ByteBuffer tableName) { this.tableName = tableName; return this; } @@ -2948,17 +4744,13 @@ public class Hbase { if (value == null) { unsetTableName(); } else { - setTableName((byte[])value); + setTableName((ByteBuffer)value); } break; } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case TABLE_NAME: @@ -2968,12 +4760,12 @@ public class Hbase { 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 TABLE_NAME: return isSetTableName(); @@ -2981,10 +4773,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -3003,7 +4791,7 @@ public class Hbase { if (this_present_tableName || that_present_tableName) { if (!(this_present_tableName && that_present_tableName)) return false; - if (!java.util.Arrays.equals(this.tableName, that.tableName)) + if (!this.tableName.equals(that.tableName)) return false; } @@ -3030,41 +4818,44 @@ public class Hbase { int lastComparison = 0; enableTable_args typedOther = (enableTable_args)other; - lastComparison = Boolean.valueOf(isSetTableName()).compareTo(isSetTableName()); + lastComparison = Boolean.valueOf(isSetTableName()).compareTo(typedOther.isSetTableName()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(tableName, typedOther.tableName); - if (lastComparison != 0) { - return lastComparison; + if (isSetTableName()) { + lastComparison = TBaseHelper.compareTo(this.tableName, typedOther.tableName); + 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 TABLE_NAME: - if (field.type == TType.STRING) { - this.tableName = iprot.readBinary(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); + switch (field.id) { + case 1: // TABLE_NAME + if (field.type == TType.STRING) { + this.tableName = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); } + iprot.readFieldEnd(); } iprot.readStructEnd(); @@ -3107,7 +4898,7 @@ public class Hbase { } - public static class enableTable_result implements TBase, java.io.Serializable, Cloneable, Comparable { + public static class enableTable_result implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("enableTable_result"); private static final TField IO_FIELD_DESC = new TField("io", TType.STRUCT, (short)1); @@ -3118,12 +4909,10 @@ public class Hbase { public enum _Fields implements TFieldIdEnum { IO((short)1, "io"); - 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); } } @@ -3132,7 +4921,12 @@ public class Hbase { * 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: // IO + return IO; + default: + return null; + } } /** @@ -3171,12 +4965,12 @@ public class Hbase { // isset id assignments - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRUCT))); - }}); - + public static final Map<_Fields, FieldMetaData> metaDataMap; static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(enableTable_result.class, metaDataMap); } @@ -3203,9 +4997,9 @@ public class Hbase { return new enableTable_result(this); } - @Deprecated - public enableTable_result clone() { - return new enableTable_result(this); + @Override + public void clear() { + this.io = null; } public IOError getIo() { @@ -3245,10 +5039,6 @@ public class Hbase { } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case IO: @@ -3258,12 +5048,12 @@ public class Hbase { 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 IO: return isSetIo(); @@ -3271,10 +5061,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -3320,42 +5106,45 @@ public class Hbase { int lastComparison = 0; enableTable_result typedOther = (enableTable_result)other; - lastComparison = Boolean.valueOf(isSetIo()).compareTo(isSetIo()); + lastComparison = Boolean.valueOf(isSetIo()).compareTo(typedOther.isSetIo()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(io, typedOther.io); - if (lastComparison != 0) { - return lastComparison; + if (isSetIo()) { + lastComparison = TBaseHelper.compareTo(this.io, typedOther.io); + 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 IO: - if (field.type == TType.STRUCT) { - this.io = new IOError(); - this.io.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); + switch (field.id) { + case 1: // IO + if (field.type == TType.STRUCT) { + this.io = new IOError(); + this.io.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); } + iprot.readFieldEnd(); } iprot.readStructEnd(); @@ -3397,7 +5186,7 @@ public class Hbase { } - public static class disableTable_args implements TBase, java.io.Serializable, Cloneable, Comparable { + public static class disableTable_args implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("disableTable_args"); private static final TField TABLE_NAME_FIELD_DESC = new TField("tableName", TType.STRING, (short)1); @@ -3405,7 +5194,7 @@ public class Hbase { /** * name of the table */ - public byte[] tableName; + public ByteBuffer tableName; /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements TFieldIdEnum { @@ -3414,12 +5203,10 @@ public class Hbase { */ TABLE_NAME((short)1, "tableName"); - 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); } } @@ -3428,7 +5215,12 @@ public class Hbase { * 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: // TABLE_NAME + return TABLE_NAME; + default: + return null; + } } /** @@ -3467,12 +5259,12 @@ public class Hbase { // isset id assignments - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.TABLE_NAME, new FieldMetaData("tableName", 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.TABLE_NAME, new FieldMetaData("tableName", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING , "Bytes"))); + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(disableTable_args.class, metaDataMap); } @@ -3480,7 +5272,7 @@ public class Hbase { } public disableTable_args( - byte[] tableName) + ByteBuffer tableName) { this(); this.tableName = tableName; @@ -3499,22 +5291,32 @@ public class Hbase { return new disableTable_args(this); } - @Deprecated - public disableTable_args clone() { - return new disableTable_args(this); + @Override + public void clear() { + this.tableName = null; } /** * name of the table */ public byte[] getTableName() { - return this.tableName; + setTableName(TBaseHelper.rightSize(tableName)); + return tableName.array(); + } + + public ByteBuffer BufferForTableName() { + return tableName; } /** * name of the table */ public disableTable_args setTableName(byte[] tableName) { + setTableName(ByteBuffer.wrap(tableName)); + return this; + } + + public disableTable_args setTableName(ByteBuffer tableName) { this.tableName = tableName; return this; } @@ -3540,17 +5342,13 @@ public class Hbase { if (value == null) { unsetTableName(); } else { - setTableName((byte[])value); + setTableName((ByteBuffer)value); } break; } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case TABLE_NAME: @@ -3560,12 +5358,12 @@ public class Hbase { 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 TABLE_NAME: return isSetTableName(); @@ -3573,10 +5371,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -3595,7 +5389,7 @@ public class Hbase { if (this_present_tableName || that_present_tableName) { if (!(this_present_tableName && that_present_tableName)) return false; - if (!java.util.Arrays.equals(this.tableName, that.tableName)) + if (!this.tableName.equals(that.tableName)) return false; } @@ -3622,41 +5416,44 @@ public class Hbase { int lastComparison = 0; disableTable_args typedOther = (disableTable_args)other; - lastComparison = Boolean.valueOf(isSetTableName()).compareTo(isSetTableName()); + lastComparison = Boolean.valueOf(isSetTableName()).compareTo(typedOther.isSetTableName()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(tableName, typedOther.tableName); - if (lastComparison != 0) { - return lastComparison; + if (isSetTableName()) { + lastComparison = TBaseHelper.compareTo(this.tableName, typedOther.tableName); + 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 TABLE_NAME: - if (field.type == TType.STRING) { - this.tableName = iprot.readBinary(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); + switch (field.id) { + case 1: // TABLE_NAME + if (field.type == TType.STRING) { + this.tableName = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); } + iprot.readFieldEnd(); } iprot.readStructEnd(); @@ -3699,7 +5496,7 @@ public class Hbase { } - public static class disableTable_result implements TBase, java.io.Serializable, Cloneable, Comparable { + public static class disableTable_result implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("disableTable_result"); private static final TField IO_FIELD_DESC = new TField("io", TType.STRUCT, (short)1); @@ -3710,12 +5507,10 @@ public class Hbase { public enum _Fields implements TFieldIdEnum { IO((short)1, "io"); - 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); } } @@ -3724,7 +5519,12 @@ public class Hbase { * 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: // IO + return IO; + default: + return null; + } } /** @@ -3763,12 +5563,12 @@ public class Hbase { // isset id assignments - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRUCT))); - }}); - + public static final Map<_Fields, FieldMetaData> metaDataMap; static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(disableTable_result.class, metaDataMap); } @@ -3795,9 +5595,9 @@ public class Hbase { return new disableTable_result(this); } - @Deprecated - public disableTable_result clone() { - return new disableTable_result(this); + @Override + public void clear() { + this.io = null; } public IOError getIo() { @@ -3837,10 +5637,6 @@ public class Hbase { } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case IO: @@ -3850,12 +5646,12 @@ public class Hbase { 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 IO: return isSetIo(); @@ -3863,10 +5659,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -3912,42 +5704,45 @@ public class Hbase { int lastComparison = 0; disableTable_result typedOther = (disableTable_result)other; - lastComparison = Boolean.valueOf(isSetIo()).compareTo(isSetIo()); + lastComparison = Boolean.valueOf(isSetIo()).compareTo(typedOther.isSetIo()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(io, typedOther.io); - if (lastComparison != 0) { - return lastComparison; + if (isSetIo()) { + lastComparison = TBaseHelper.compareTo(this.io, typedOther.io); + 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 IO: - if (field.type == TType.STRUCT) { - this.io = new IOError(); - this.io.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); + switch (field.id) { + case 1: // IO + if (field.type == TType.STRUCT) { + this.io = new IOError(); + this.io.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); } + iprot.readFieldEnd(); } iprot.readStructEnd(); @@ -3989,7 +5784,7 @@ public class Hbase { } - public static class isTableEnabled_args implements TBase, java.io.Serializable, Cloneable, Comparable { + public static class isTableEnabled_args implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("isTableEnabled_args"); private static final TField TABLE_NAME_FIELD_DESC = new TField("tableName", TType.STRING, (short)1); @@ -3997,7 +5792,7 @@ public class Hbase { /** * name of the table to check */ - public byte[] tableName; + public ByteBuffer tableName; /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements TFieldIdEnum { @@ -4006,12 +5801,10 @@ public class Hbase { */ TABLE_NAME((short)1, "tableName"); - 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); } } @@ -4020,7 +5813,12 @@ public class Hbase { * 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: // TABLE_NAME + return TABLE_NAME; + default: + return null; + } } /** @@ -4059,12 +5857,12 @@ public class Hbase { // isset id assignments - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.TABLE_NAME, new FieldMetaData("tableName", 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.TABLE_NAME, new FieldMetaData("tableName", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING , "Bytes"))); + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(isTableEnabled_args.class, metaDataMap); } @@ -4072,7 +5870,7 @@ public class Hbase { } public isTableEnabled_args( - byte[] tableName) + ByteBuffer tableName) { this(); this.tableName = tableName; @@ -4091,22 +5889,32 @@ public class Hbase { return new isTableEnabled_args(this); } - @Deprecated - public isTableEnabled_args clone() { - return new isTableEnabled_args(this); + @Override + public void clear() { + this.tableName = null; } /** * name of the table to check */ public byte[] getTableName() { - return this.tableName; + setTableName(TBaseHelper.rightSize(tableName)); + return tableName.array(); + } + + public ByteBuffer BufferForTableName() { + return tableName; } /** * name of the table to check */ public isTableEnabled_args setTableName(byte[] tableName) { + setTableName(ByteBuffer.wrap(tableName)); + return this; + } + + public isTableEnabled_args setTableName(ByteBuffer tableName) { this.tableName = tableName; return this; } @@ -4132,17 +5940,13 @@ public class Hbase { if (value == null) { unsetTableName(); } else { - setTableName((byte[])value); + setTableName((ByteBuffer)value); } break; } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case TABLE_NAME: @@ -4152,12 +5956,12 @@ public class Hbase { 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 TABLE_NAME: return isSetTableName(); @@ -4165,10 +5969,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -4187,7 +5987,7 @@ public class Hbase { if (this_present_tableName || that_present_tableName) { if (!(this_present_tableName && that_present_tableName)) return false; - if (!java.util.Arrays.equals(this.tableName, that.tableName)) + if (!this.tableName.equals(that.tableName)) return false; } @@ -4214,41 +6014,44 @@ public class Hbase { int lastComparison = 0; isTableEnabled_args typedOther = (isTableEnabled_args)other; - lastComparison = Boolean.valueOf(isSetTableName()).compareTo(isSetTableName()); + lastComparison = Boolean.valueOf(isSetTableName()).compareTo(typedOther.isSetTableName()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(tableName, typedOther.tableName); - if (lastComparison != 0) { - return lastComparison; + if (isSetTableName()) { + lastComparison = TBaseHelper.compareTo(this.tableName, typedOther.tableName); + 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 TABLE_NAME: - if (field.type == TType.STRING) { - this.tableName = iprot.readBinary(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); + switch (field.id) { + case 1: // TABLE_NAME + if (field.type == TType.STRING) { + this.tableName = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); } + iprot.readFieldEnd(); } iprot.readStructEnd(); @@ -4291,7 +6094,7 @@ public class Hbase { } - public static class isTableEnabled_result implements TBase, java.io.Serializable, Cloneable, Comparable { + public static class isTableEnabled_result implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("isTableEnabled_result"); private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.BOOL, (short)0); @@ -4305,12 +6108,10 @@ public class Hbase { SUCCESS((short)0, "success"), IO((short)1, "io"); - 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); } } @@ -4319,7 +6120,14 @@ public class Hbase { * 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 0: // SUCCESS + return SUCCESS; + case 1: // IO + return IO; + default: + return null; + } } /** @@ -4360,14 +6168,14 @@ public class Hbase { private static final int __SUCCESS_ISSET_ID = 0; private BitSet __isset_bit_vector = new BitSet(1); - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + public static final Map<_Fields, FieldMetaData> metaDataMap; + static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.BOOL))); - put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); - }}); - - static { + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(isTableEnabled_result.class, metaDataMap); } @@ -4400,9 +6208,11 @@ public class Hbase { return new isTableEnabled_result(this); } - @Deprecated - public isTableEnabled_result clone() { - return new isTableEnabled_result(this); + @Override + public void clear() { + setSuccessIsSet(false); + this.success = false; + this.io = null; } public boolean isSuccess() { @@ -4473,10 +6283,6 @@ public class Hbase { } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: @@ -4489,12 +6295,12 @@ public class Hbase { 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 SUCCESS: return isSetSuccess(); @@ -4504,10 +6310,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -4567,58 +6369,63 @@ public class Hbase { int lastComparison = 0; isTableEnabled_result typedOther = (isTableEnabled_result)other; - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess()); + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(success, typedOther.success); - if (lastComparison != 0) { - return lastComparison; + if (isSetSuccess()) { + lastComparison = TBaseHelper.compareTo(this.success, typedOther.success); + if (lastComparison != 0) { + return lastComparison; + } } - lastComparison = Boolean.valueOf(isSetIo()).compareTo(isSetIo()); + lastComparison = Boolean.valueOf(isSetIo()).compareTo(typedOther.isSetIo()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(io, typedOther.io); - if (lastComparison != 0) { - return lastComparison; + if (isSetIo()) { + lastComparison = TBaseHelper.compareTo(this.io, typedOther.io); + 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 SUCCESS: - if (field.type == TType.BOOL) { - this.success = iprot.readBool(); - setSuccessIsSet(true); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case IO: - if (field.type == TType.STRUCT) { - this.io = new IOError(); - this.io.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); - } + switch (field.id) { + case 0: // SUCCESS + if (field.type == TType.BOOL) { + this.success = iprot.readBool(); + setSuccessIsSet(true); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 1: // IO + if (field.type == TType.STRUCT) { + this.io = new IOError(); + this.io.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + } + iprot.readFieldEnd(); } iprot.readStructEnd(); @@ -4668,23 +6475,21 @@ public class Hbase { } - public static class compact_args implements TBase, java.io.Serializable, Cloneable, Comparable { + public static class compact_args implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("compact_args"); private static final TField TABLE_NAME_OR_REGION_NAME_FIELD_DESC = new TField("tableNameOrRegionName", TType.STRING, (short)1); - public byte[] tableNameOrRegionName; + public ByteBuffer tableNameOrRegionName; /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements TFieldIdEnum { TABLE_NAME_OR_REGION_NAME((short)1, "tableNameOrRegionName"); - 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); } } @@ -4693,7 +6498,12 @@ public class Hbase { * 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: // TABLE_NAME_OR_REGION_NAME + return TABLE_NAME_OR_REGION_NAME; + default: + return null; + } } /** @@ -4732,12 +6542,12 @@ public class Hbase { // isset id assignments - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.TABLE_NAME_OR_REGION_NAME, new FieldMetaData("tableNameOrRegionName", 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.TABLE_NAME_OR_REGION_NAME, new FieldMetaData("tableNameOrRegionName", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING , "Bytes"))); + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(compact_args.class, metaDataMap); } @@ -4745,7 +6555,7 @@ public class Hbase { } public compact_args( - byte[] tableNameOrRegionName) + ByteBuffer tableNameOrRegionName) { this(); this.tableNameOrRegionName = tableNameOrRegionName; @@ -4764,16 +6574,26 @@ public class Hbase { return new compact_args(this); } - @Deprecated - public compact_args clone() { - return new compact_args(this); + @Override + public void clear() { + this.tableNameOrRegionName = null; } public byte[] getTableNameOrRegionName() { - return this.tableNameOrRegionName; + setTableNameOrRegionName(TBaseHelper.rightSize(tableNameOrRegionName)); + return tableNameOrRegionName.array(); + } + + public ByteBuffer BufferForTableNameOrRegionName() { + return tableNameOrRegionName; } public compact_args setTableNameOrRegionName(byte[] tableNameOrRegionName) { + setTableNameOrRegionName(ByteBuffer.wrap(tableNameOrRegionName)); + return this; + } + + public compact_args setTableNameOrRegionName(ByteBuffer tableNameOrRegionName) { this.tableNameOrRegionName = tableNameOrRegionName; return this; } @@ -4799,17 +6619,13 @@ public class Hbase { if (value == null) { unsetTableNameOrRegionName(); } else { - setTableNameOrRegionName((byte[])value); + setTableNameOrRegionName((ByteBuffer)value); } break; } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case TABLE_NAME_OR_REGION_NAME: @@ -4819,12 +6635,12 @@ public class Hbase { 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 TABLE_NAME_OR_REGION_NAME: return isSetTableNameOrRegionName(); @@ -4832,10 +6648,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -4854,7 +6666,7 @@ public class Hbase { if (this_present_tableNameOrRegionName || that_present_tableNameOrRegionName) { if (!(this_present_tableNameOrRegionName && that_present_tableNameOrRegionName)) return false; - if (!java.util.Arrays.equals(this.tableNameOrRegionName, that.tableNameOrRegionName)) + if (!this.tableNameOrRegionName.equals(that.tableNameOrRegionName)) return false; } @@ -4881,41 +6693,44 @@ public class Hbase { int lastComparison = 0; compact_args typedOther = (compact_args)other; - lastComparison = Boolean.valueOf(isSetTableNameOrRegionName()).compareTo(isSetTableNameOrRegionName()); + lastComparison = Boolean.valueOf(isSetTableNameOrRegionName()).compareTo(typedOther.isSetTableNameOrRegionName()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(tableNameOrRegionName, typedOther.tableNameOrRegionName); - if (lastComparison != 0) { - return lastComparison; + if (isSetTableNameOrRegionName()) { + lastComparison = TBaseHelper.compareTo(this.tableNameOrRegionName, typedOther.tableNameOrRegionName); + 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 TABLE_NAME_OR_REGION_NAME: - if (field.type == TType.STRING) { - this.tableNameOrRegionName = iprot.readBinary(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); + switch (field.id) { + case 1: // TABLE_NAME_OR_REGION_NAME + if (field.type == TType.STRING) { + this.tableNameOrRegionName = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); } + iprot.readFieldEnd(); } iprot.readStructEnd(); @@ -4958,7 +6773,7 @@ public class Hbase { } - public static class compact_result implements TBase, java.io.Serializable, Cloneable, Comparable { + public static class compact_result implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("compact_result"); private static final TField IO_FIELD_DESC = new TField("io", TType.STRUCT, (short)1); @@ -4969,12 +6784,10 @@ public class Hbase { public enum _Fields implements TFieldIdEnum { IO((short)1, "io"); - 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); } } @@ -4983,7 +6796,12 @@ public class Hbase { * 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: // IO + return IO; + default: + return null; + } } /** @@ -5022,12 +6840,12 @@ public class Hbase { // isset id assignments - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRUCT))); - }}); - + public static final Map<_Fields, FieldMetaData> metaDataMap; static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(compact_result.class, metaDataMap); } @@ -5054,9 +6872,9 @@ public class Hbase { return new compact_result(this); } - @Deprecated - public compact_result clone() { - return new compact_result(this); + @Override + public void clear() { + this.io = null; } public IOError getIo() { @@ -5096,10 +6914,6 @@ public class Hbase { } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case IO: @@ -5109,12 +6923,12 @@ public class Hbase { 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 IO: return isSetIo(); @@ -5122,10 +6936,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -5171,42 +6981,45 @@ public class Hbase { int lastComparison = 0; compact_result typedOther = (compact_result)other; - lastComparison = Boolean.valueOf(isSetIo()).compareTo(isSetIo()); + lastComparison = Boolean.valueOf(isSetIo()).compareTo(typedOther.isSetIo()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(io, typedOther.io); - if (lastComparison != 0) { - return lastComparison; + if (isSetIo()) { + lastComparison = TBaseHelper.compareTo(this.io, typedOther.io); + 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 IO: - if (field.type == TType.STRUCT) { - this.io = new IOError(); - this.io.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); + switch (field.id) { + case 1: // IO + if (field.type == TType.STRUCT) { + this.io = new IOError(); + this.io.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); } + iprot.readFieldEnd(); } iprot.readStructEnd(); @@ -5248,23 +7061,21 @@ public class Hbase { } - public static class majorCompact_args implements TBase, java.io.Serializable, Cloneable, Comparable { + public static class majorCompact_args implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("majorCompact_args"); private static final TField TABLE_NAME_OR_REGION_NAME_FIELD_DESC = new TField("tableNameOrRegionName", TType.STRING, (short)1); - public byte[] tableNameOrRegionName; + public ByteBuffer tableNameOrRegionName; /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements TFieldIdEnum { TABLE_NAME_OR_REGION_NAME((short)1, "tableNameOrRegionName"); - 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); } } @@ -5273,7 +7084,12 @@ public class Hbase { * 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: // TABLE_NAME_OR_REGION_NAME + return TABLE_NAME_OR_REGION_NAME; + default: + return null; + } } /** @@ -5312,12 +7128,12 @@ public class Hbase { // isset id assignments - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.TABLE_NAME_OR_REGION_NAME, new FieldMetaData("tableNameOrRegionName", 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.TABLE_NAME_OR_REGION_NAME, new FieldMetaData("tableNameOrRegionName", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING , "Bytes"))); + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(majorCompact_args.class, metaDataMap); } @@ -5325,7 +7141,7 @@ public class Hbase { } public majorCompact_args( - byte[] tableNameOrRegionName) + ByteBuffer tableNameOrRegionName) { this(); this.tableNameOrRegionName = tableNameOrRegionName; @@ -5344,16 +7160,26 @@ public class Hbase { return new majorCompact_args(this); } - @Deprecated - public majorCompact_args clone() { - return new majorCompact_args(this); + @Override + public void clear() { + this.tableNameOrRegionName = null; } public byte[] getTableNameOrRegionName() { - return this.tableNameOrRegionName; + setTableNameOrRegionName(TBaseHelper.rightSize(tableNameOrRegionName)); + return tableNameOrRegionName.array(); + } + + public ByteBuffer BufferForTableNameOrRegionName() { + return tableNameOrRegionName; } public majorCompact_args setTableNameOrRegionName(byte[] tableNameOrRegionName) { + setTableNameOrRegionName(ByteBuffer.wrap(tableNameOrRegionName)); + return this; + } + + public majorCompact_args setTableNameOrRegionName(ByteBuffer tableNameOrRegionName) { this.tableNameOrRegionName = tableNameOrRegionName; return this; } @@ -5379,17 +7205,13 @@ public class Hbase { if (value == null) { unsetTableNameOrRegionName(); } else { - setTableNameOrRegionName((byte[])value); + setTableNameOrRegionName((ByteBuffer)value); } break; } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case TABLE_NAME_OR_REGION_NAME: @@ -5399,12 +7221,12 @@ public class Hbase { 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 TABLE_NAME_OR_REGION_NAME: return isSetTableNameOrRegionName(); @@ -5412,10 +7234,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -5434,7 +7252,7 @@ public class Hbase { if (this_present_tableNameOrRegionName || that_present_tableNameOrRegionName) { if (!(this_present_tableNameOrRegionName && that_present_tableNameOrRegionName)) return false; - if (!java.util.Arrays.equals(this.tableNameOrRegionName, that.tableNameOrRegionName)) + if (!this.tableNameOrRegionName.equals(that.tableNameOrRegionName)) return false; } @@ -5461,41 +7279,44 @@ public class Hbase { int lastComparison = 0; majorCompact_args typedOther = (majorCompact_args)other; - lastComparison = Boolean.valueOf(isSetTableNameOrRegionName()).compareTo(isSetTableNameOrRegionName()); + lastComparison = Boolean.valueOf(isSetTableNameOrRegionName()).compareTo(typedOther.isSetTableNameOrRegionName()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(tableNameOrRegionName, typedOther.tableNameOrRegionName); - if (lastComparison != 0) { - return lastComparison; + if (isSetTableNameOrRegionName()) { + lastComparison = TBaseHelper.compareTo(this.tableNameOrRegionName, typedOther.tableNameOrRegionName); + 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 TABLE_NAME_OR_REGION_NAME: - if (field.type == TType.STRING) { - this.tableNameOrRegionName = iprot.readBinary(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); + switch (field.id) { + case 1: // TABLE_NAME_OR_REGION_NAME + if (field.type == TType.STRING) { + this.tableNameOrRegionName = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); } + iprot.readFieldEnd(); } iprot.readStructEnd(); @@ -5538,7 +7359,7 @@ public class Hbase { } - public static class majorCompact_result implements TBase, java.io.Serializable, Cloneable, Comparable { + public static class majorCompact_result implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("majorCompact_result"); private static final TField IO_FIELD_DESC = new TField("io", TType.STRUCT, (short)1); @@ -5549,12 +7370,10 @@ public class Hbase { public enum _Fields implements TFieldIdEnum { IO((short)1, "io"); - 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); } } @@ -5563,7 +7382,12 @@ public class Hbase { * 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: // IO + return IO; + default: + return null; + } } /** @@ -5602,12 +7426,12 @@ public class Hbase { // isset id assignments - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRUCT))); - }}); - + public static final Map<_Fields, FieldMetaData> metaDataMap; static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(majorCompact_result.class, metaDataMap); } @@ -5634,9 +7458,9 @@ public class Hbase { return new majorCompact_result(this); } - @Deprecated - public majorCompact_result clone() { - return new majorCompact_result(this); + @Override + public void clear() { + this.io = null; } public IOError getIo() { @@ -5676,10 +7500,6 @@ public class Hbase { } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case IO: @@ -5689,12 +7509,12 @@ public class Hbase { 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 IO: return isSetIo(); @@ -5702,10 +7522,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -5751,42 +7567,45 @@ public class Hbase { int lastComparison = 0; majorCompact_result typedOther = (majorCompact_result)other; - lastComparison = Boolean.valueOf(isSetIo()).compareTo(isSetIo()); + lastComparison = Boolean.valueOf(isSetIo()).compareTo(typedOther.isSetIo()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(io, typedOther.io); - if (lastComparison != 0) { - return lastComparison; + if (isSetIo()) { + lastComparison = TBaseHelper.compareTo(this.io, typedOther.io); + 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 IO: - if (field.type == TType.STRUCT) { - this.io = new IOError(); - this.io.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); + switch (field.id) { + case 1: // IO + if (field.type == TType.STRUCT) { + this.io = new IOError(); + this.io.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); } + iprot.readFieldEnd(); } iprot.readStructEnd(); @@ -5828,7 +7647,7 @@ public class Hbase { } - public static class getTableNames_args implements TBase, java.io.Serializable, Cloneable, Comparable { + public static class getTableNames_args implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("getTableNames_args"); @@ -5837,12 +7656,10 @@ public class Hbase { public enum _Fields implements TFieldIdEnum { ; - 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); } } @@ -5851,7 +7668,10 @@ public class Hbase { * 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) { + default: + return null; + } } /** @@ -5887,10 +7707,10 @@ public class Hbase { return _fieldName; } } - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - }}); - + public static final Map<_Fields, FieldMetaData> metaDataMap; static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(getTableNames_args.class, metaDataMap); } @@ -5907,9 +7727,8 @@ public class Hbase { return new getTableNames_args(this); } - @Deprecated - public getTableNames_args clone() { - return new getTableNames_args(this); + @Override + public void clear() { } public void setFieldValue(_Fields field, Object value) { @@ -5917,31 +7736,23 @@ public class Hbase { } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { } 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) { } throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -5976,23 +7787,24 @@ public class Hbase { 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) { - } - iprot.readFieldEnd(); + switch (field.id) { + default: + TProtocolUtil.skip(iprot, field.type); } + iprot.readFieldEnd(); } iprot.readStructEnd(); @@ -6023,13 +7835,13 @@ public class Hbase { } - public static class getTableNames_result implements TBase, java.io.Serializable, Cloneable, Comparable { + public static class getTableNames_result implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("getTableNames_result"); private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0); private static final TField IO_FIELD_DESC = new TField("io", TType.STRUCT, (short)1); - public List success; + public List success; public IOError io; /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -6037,12 +7849,10 @@ public class Hbase { SUCCESS((short)0, "success"), IO((short)1, "io"); - 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); } } @@ -6051,7 +7861,14 @@ public class Hbase { * 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 0: // SUCCESS + return SUCCESS; + case 1: // IO + return IO; + default: + return null; + } } /** @@ -6090,15 +7907,15 @@ public class Hbase { // isset id assignments - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new ListMetaData(TType.LIST, - new FieldValueMetaData(TType.STRING)))); - put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRUCT))); - }}); - + public static final Map<_Fields, FieldMetaData> metaDataMap; static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + new ListMetaData(TType.LIST, + new FieldValueMetaData(TType.STRING , "Text")))); + tmpMap.put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(getTableNames_result.class, metaDataMap); } @@ -6106,7 +7923,7 @@ public class Hbase { } public getTableNames_result( - List success, + List success, IOError io) { this(); @@ -6119,8 +7936,8 @@ public class Hbase { */ public getTableNames_result(getTableNames_result other) { if (other.isSetSuccess()) { - List __this__success = new ArrayList(); - for (byte[] other_element : other.success) { + List __this__success = new ArrayList(); + for (ByteBuffer other_element : other.success) { __this__success.add(other_element); } this.success = __this__success; @@ -6134,31 +7951,32 @@ public class Hbase { return new getTableNames_result(this); } - @Deprecated - public getTableNames_result clone() { - return new getTableNames_result(this); + @Override + public void clear() { + this.success = null; + this.io = null; } public int getSuccessSize() { return (this.success == null) ? 0 : this.success.size(); } - public java.util.Iterator getSuccessIterator() { + public java.util.Iterator getSuccessIterator() { return (this.success == null) ? null : this.success.iterator(); } - public void addToSuccess(byte[] elem) { + public void addToSuccess(ByteBuffer elem) { if (this.success == null) { - this.success = new ArrayList(); + this.success = new ArrayList(); } this.success.add(elem); } - public List getSuccess() { + public List getSuccess() { return this.success; } - public getTableNames_result setSuccess(List success) { + public getTableNames_result setSuccess(List success) { this.success = success; return this; } @@ -6208,7 +8026,7 @@ public class Hbase { if (value == null) { unsetSuccess(); } else { - setSuccess((List)value); + setSuccess((List)value); } break; @@ -6223,10 +8041,6 @@ public class Hbase { } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: @@ -6239,12 +8053,12 @@ public class Hbase { 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 SUCCESS: return isSetSuccess(); @@ -6254,10 +8068,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -6317,67 +8127,72 @@ public class Hbase { int lastComparison = 0; getTableNames_result typedOther = (getTableNames_result)other; - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess()); + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(success, typedOther.success); - if (lastComparison != 0) { - return lastComparison; + if (isSetSuccess()) { + lastComparison = TBaseHelper.compareTo(this.success, typedOther.success); + if (lastComparison != 0) { + return lastComparison; + } } - lastComparison = Boolean.valueOf(isSetIo()).compareTo(isSetIo()); + lastComparison = Boolean.valueOf(isSetIo()).compareTo(typedOther.isSetIo()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(io, typedOther.io); - if (lastComparison != 0) { - return lastComparison; + if (isSetIo()) { + lastComparison = TBaseHelper.compareTo(this.io, typedOther.io); + 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 SUCCESS: - if (field.type == TType.LIST) { + switch (field.id) { + case 0: // SUCCESS + if (field.type == TType.LIST) { + { + TList _list9 = iprot.readListBegin(); + this.success = new ArrayList(_list9.size); + for (int _i10 = 0; _i10 < _list9.size; ++_i10) { - TList _list9 = iprot.readListBegin(); - this.success = new ArrayList(_list9.size); - for (int _i10 = 0; _i10 < _list9.size; ++_i10) - { - byte[] _elem11; - _elem11 = iprot.readBinary(); - this.success.add(_elem11); - } - iprot.readListEnd(); + ByteBuffer _elem11; + _elem11 = iprot.readBinary(); + this.success.add(_elem11); } - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case IO: - if (field.type == TType.STRUCT) { - this.io = new IOError(); - this.io.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); + iprot.readListEnd(); } - break; - } - iprot.readFieldEnd(); - } + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 1: // IO + if (field.type == TType.STRUCT) { + this.io = new IOError(); + this.io.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + } + iprot.readFieldEnd(); } iprot.readStructEnd(); @@ -6392,7 +8207,7 @@ public class Hbase { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRING, this.success.size())); - for (byte[] _iter12 : this.success) + for (ByteBuffer _iter12 : this.success) { oprot.writeBinary(_iter12); } @@ -6438,7 +8253,7 @@ public class Hbase { } - public static class getColumnDescriptors_args implements TBase, java.io.Serializable, Cloneable, Comparable { + public static class getColumnDescriptors_args implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("getColumnDescriptors_args"); private static final TField TABLE_NAME_FIELD_DESC = new TField("tableName", TType.STRING, (short)1); @@ -6446,7 +8261,7 @@ public class Hbase { /** * table name */ - public byte[] tableName; + public ByteBuffer tableName; /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements TFieldIdEnum { @@ -6455,12 +8270,10 @@ public class Hbase { */ TABLE_NAME((short)1, "tableName"); - 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); } } @@ -6469,7 +8282,12 @@ public class Hbase { * 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: // TABLE_NAME + return TABLE_NAME; + default: + return null; + } } /** @@ -6508,12 +8326,12 @@ public class Hbase { // isset id assignments - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.TABLE_NAME, new FieldMetaData("tableName", 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.TABLE_NAME, new FieldMetaData("tableName", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING , "Text"))); + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(getColumnDescriptors_args.class, metaDataMap); } @@ -6521,7 +8339,7 @@ public class Hbase { } public getColumnDescriptors_args( - byte[] tableName) + ByteBuffer tableName) { this(); this.tableName = tableName; @@ -6540,22 +8358,32 @@ public class Hbase { return new getColumnDescriptors_args(this); } - @Deprecated - public getColumnDescriptors_args clone() { - return new getColumnDescriptors_args(this); + @Override + public void clear() { + this.tableName = null; } /** * table name */ public byte[] getTableName() { - return this.tableName; + setTableName(TBaseHelper.rightSize(tableName)); + return tableName.array(); + } + + public ByteBuffer BufferForTableName() { + return tableName; } /** * table name */ public getColumnDescriptors_args setTableName(byte[] tableName) { + setTableName(ByteBuffer.wrap(tableName)); + return this; + } + + public getColumnDescriptors_args setTableName(ByteBuffer tableName) { this.tableName = tableName; return this; } @@ -6581,17 +8409,13 @@ public class Hbase { if (value == null) { unsetTableName(); } else { - setTableName((byte[])value); + setTableName((ByteBuffer)value); } break; } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case TABLE_NAME: @@ -6601,12 +8425,12 @@ public class Hbase { 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 TABLE_NAME: return isSetTableName(); @@ -6614,10 +8438,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -6636,7 +8456,7 @@ public class Hbase { if (this_present_tableName || that_present_tableName) { if (!(this_present_tableName && that_present_tableName)) return false; - if (!java.util.Arrays.equals(this.tableName, that.tableName)) + if (!this.tableName.equals(that.tableName)) return false; } @@ -6663,41 +8483,44 @@ public class Hbase { int lastComparison = 0; getColumnDescriptors_args typedOther = (getColumnDescriptors_args)other; - lastComparison = Boolean.valueOf(isSetTableName()).compareTo(isSetTableName()); + lastComparison = Boolean.valueOf(isSetTableName()).compareTo(typedOther.isSetTableName()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(tableName, typedOther.tableName); - if (lastComparison != 0) { - return lastComparison; + if (isSetTableName()) { + lastComparison = TBaseHelper.compareTo(this.tableName, typedOther.tableName); + 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 TABLE_NAME: - if (field.type == TType.STRING) { - this.tableName = iprot.readBinary(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); + switch (field.id) { + case 1: // TABLE_NAME + if (field.type == TType.STRING) { + this.tableName = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); } + iprot.readFieldEnd(); } iprot.readStructEnd(); @@ -6740,13 +8563,13 @@ public class Hbase { } - public static class getColumnDescriptors_result implements TBase, java.io.Serializable, Cloneable { + public static class getColumnDescriptors_result implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("getColumnDescriptors_result"); private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.MAP, (short)0); private static final TField IO_FIELD_DESC = new TField("io", TType.STRUCT, (short)1); - public Map success; + public Map success; public IOError io; /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -6754,12 +8577,10 @@ public class Hbase { SUCCESS((short)0, "success"), IO((short)1, "io"); - 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); } } @@ -6768,7 +8589,14 @@ public class Hbase { * 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 0: // SUCCESS + return SUCCESS; + case 1: // IO + return IO; + default: + return null; + } } /** @@ -6807,16 +8635,16 @@ public class Hbase { // isset id assignments - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new MapMetaData(TType.MAP, - 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.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + new MapMetaData(TType.MAP, + new FieldValueMetaData(TType.STRING , "Text"), new StructMetaData(TType.STRUCT, ColumnDescriptor.class)))); - put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); - }}); - - static { + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(getColumnDescriptors_result.class, metaDataMap); } @@ -6824,7 +8652,7 @@ public class Hbase { } public getColumnDescriptors_result( - Map success, + Map success, IOError io) { this(); @@ -6837,13 +8665,13 @@ public class Hbase { */ public getColumnDescriptors_result(getColumnDescriptors_result other) { if (other.isSetSuccess()) { - Map __this__success = new HashMap(); - for (Map.Entry other_element : other.success.entrySet()) { + Map __this__success = new HashMap(); + for (Map.Entry other_element : other.success.entrySet()) { - byte[] other_element_key = other_element.getKey(); + ByteBuffer other_element_key = other_element.getKey(); ColumnDescriptor other_element_value = other_element.getValue(); - byte[] __this__success_copy_key = other_element_key; + ByteBuffer __this__success_copy_key = other_element_key; ColumnDescriptor __this__success_copy_value = new ColumnDescriptor(other_element_value); @@ -6860,27 +8688,28 @@ public class Hbase { return new getColumnDescriptors_result(this); } - @Deprecated - public getColumnDescriptors_result clone() { - return new getColumnDescriptors_result(this); + @Override + public void clear() { + this.success = null; + this.io = null; } public int getSuccessSize() { return (this.success == null) ? 0 : this.success.size(); } - public void putToSuccess(byte[] key, ColumnDescriptor val) { + public void putToSuccess(ByteBuffer key, ColumnDescriptor val) { if (this.success == null) { - this.success = new HashMap(); + this.success = new HashMap(); } this.success.put(key, val); } - public Map getSuccess() { + public Map getSuccess() { return this.success; } - public getColumnDescriptors_result setSuccess(Map success) { + public getColumnDescriptors_result setSuccess(Map success) { this.success = success; return this; } @@ -6930,7 +8759,7 @@ public class Hbase { if (value == null) { unsetSuccess(); } else { - setSuccess((Map)value); + setSuccess((Map)value); } break; @@ -6945,10 +8774,6 @@ public class Hbase { } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: @@ -6961,12 +8786,12 @@ public class Hbase { 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 SUCCESS: return isSetSuccess(); @@ -6976,10 +8801,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -7031,51 +8852,83 @@ public class Hbase { return builder.toHashCode(); } + public int compareTo(getColumnDescriptors_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + getColumnDescriptors_result typedOther = (getColumnDescriptors_result)other; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = TBaseHelper.compareTo(this.success, typedOther.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIo()).compareTo(typedOther.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = TBaseHelper.compareTo(this.io, typedOther.io); + 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 SUCCESS: - if (field.type == TType.MAP) { + switch (field.id) { + case 0: // SUCCESS + if (field.type == TType.MAP) { + { + TMap _map13 = iprot.readMapBegin(); + this.success = new HashMap(2*_map13.size); + for (int _i14 = 0; _i14 < _map13.size; ++_i14) { - TMap _map13 = iprot.readMapBegin(); - this.success = new HashMap(2*_map13.size); - for (int _i14 = 0; _i14 < _map13.size; ++_i14) - { - byte[] _key15; - ColumnDescriptor _val16; - _key15 = iprot.readBinary(); - _val16 = new ColumnDescriptor(); - _val16.read(iprot); - this.success.put(_key15, _val16); - } - iprot.readMapEnd(); + ByteBuffer _key15; + ColumnDescriptor _val16; + _key15 = iprot.readBinary(); + _val16 = new ColumnDescriptor(); + _val16.read(iprot); + this.success.put(_key15, _val16); } - } else { - TProtocolUtil.skip(iprot, field.type); + iprot.readMapEnd(); } - break; - case IO: - if (field.type == TType.STRUCT) { - this.io = new IOError(); - this.io.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); - } + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 1: // IO + if (field.type == TType.STRUCT) { + this.io = new IOError(); + this.io.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + } + iprot.readFieldEnd(); } iprot.readStructEnd(); @@ -7090,7 +8943,7 @@ public class Hbase { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeMapBegin(new TMap(TType.STRING, TType.STRUCT, this.success.size())); - for (Map.Entry _iter17 : this.success.entrySet()) + for (Map.Entry _iter17 : this.success.entrySet()) { oprot.writeBinary(_iter17.getKey()); _iter17.getValue().write(oprot); @@ -7137,7 +8990,7 @@ public class Hbase { } - public static class getTableRegions_args implements TBase, java.io.Serializable, Cloneable, Comparable { + public static class getTableRegions_args implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("getTableRegions_args"); private static final TField TABLE_NAME_FIELD_DESC = new TField("tableName", TType.STRING, (short)1); @@ -7145,7 +8998,7 @@ public class Hbase { /** * table name */ - public byte[] tableName; + public ByteBuffer tableName; /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements TFieldIdEnum { @@ -7154,12 +9007,10 @@ public class Hbase { */ TABLE_NAME((short)1, "tableName"); - 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); } } @@ -7168,7 +9019,12 @@ public class Hbase { * 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: // TABLE_NAME + return TABLE_NAME; + default: + return null; + } } /** @@ -7207,12 +9063,12 @@ public class Hbase { // isset id assignments - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.TABLE_NAME, new FieldMetaData("tableName", 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.TABLE_NAME, new FieldMetaData("tableName", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING , "Text"))); + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(getTableRegions_args.class, metaDataMap); } @@ -7220,7 +9076,7 @@ public class Hbase { } public getTableRegions_args( - byte[] tableName) + ByteBuffer tableName) { this(); this.tableName = tableName; @@ -7239,22 +9095,32 @@ public class Hbase { return new getTableRegions_args(this); } - @Deprecated - public getTableRegions_args clone() { - return new getTableRegions_args(this); + @Override + public void clear() { + this.tableName = null; } /** * table name */ public byte[] getTableName() { - return this.tableName; + setTableName(TBaseHelper.rightSize(tableName)); + return tableName.array(); + } + + public ByteBuffer BufferForTableName() { + return tableName; } /** * table name */ public getTableRegions_args setTableName(byte[] tableName) { + setTableName(ByteBuffer.wrap(tableName)); + return this; + } + + public getTableRegions_args setTableName(ByteBuffer tableName) { this.tableName = tableName; return this; } @@ -7280,17 +9146,13 @@ public class Hbase { if (value == null) { unsetTableName(); } else { - setTableName((byte[])value); + setTableName((ByteBuffer)value); } break; } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case TABLE_NAME: @@ -7300,12 +9162,12 @@ public class Hbase { 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 TABLE_NAME: return isSetTableName(); @@ -7313,10 +9175,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -7335,7 +9193,7 @@ public class Hbase { if (this_present_tableName || that_present_tableName) { if (!(this_present_tableName && that_present_tableName)) return false; - if (!java.util.Arrays.equals(this.tableName, that.tableName)) + if (!this.tableName.equals(that.tableName)) return false; } @@ -7362,41 +9220,44 @@ public class Hbase { int lastComparison = 0; getTableRegions_args typedOther = (getTableRegions_args)other; - lastComparison = Boolean.valueOf(isSetTableName()).compareTo(isSetTableName()); + lastComparison = Boolean.valueOf(isSetTableName()).compareTo(typedOther.isSetTableName()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(tableName, typedOther.tableName); - if (lastComparison != 0) { - return lastComparison; + if (isSetTableName()) { + lastComparison = TBaseHelper.compareTo(this.tableName, typedOther.tableName); + 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 TABLE_NAME: - if (field.type == TType.STRING) { - this.tableName = iprot.readBinary(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); + switch (field.id) { + case 1: // TABLE_NAME + if (field.type == TType.STRING) { + this.tableName = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); } + iprot.readFieldEnd(); } iprot.readStructEnd(); @@ -7439,7 +9300,7 @@ public class Hbase { } - public static class getTableRegions_result implements TBase, java.io.Serializable, Cloneable, Comparable { + public static class getTableRegions_result implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("getTableRegions_result"); private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0); @@ -7453,12 +9314,10 @@ public class Hbase { SUCCESS((short)0, "success"), IO((short)1, "io"); - 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); } } @@ -7467,7 +9326,14 @@ public class Hbase { * 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 0: // SUCCESS + return SUCCESS; + case 1: // IO + return IO; + default: + return null; + } } /** @@ -7506,15 +9372,15 @@ public class Hbase { // isset id assignments - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new ListMetaData(TType.LIST, + public static final Map<_Fields, FieldMetaData> metaDataMap; + static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + new ListMetaData(TType.LIST, new StructMetaData(TType.STRUCT, TRegionInfo.class)))); - put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); - }}); - - static { + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(getTableRegions_result.class, metaDataMap); } @@ -7550,9 +9416,10 @@ public class Hbase { return new getTableRegions_result(this); } - @Deprecated - public getTableRegions_result clone() { - return new getTableRegions_result(this); + @Override + public void clear() { + this.success = null; + this.io = null; } public int getSuccessSize() { @@ -7639,10 +9506,6 @@ public class Hbase { } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: @@ -7655,12 +9518,12 @@ public class Hbase { 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 SUCCESS: return isSetSuccess(); @@ -7670,10 +9533,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -7733,68 +9592,73 @@ public class Hbase { int lastComparison = 0; getTableRegions_result typedOther = (getTableRegions_result)other; - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess()); + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(success, typedOther.success); - if (lastComparison != 0) { - return lastComparison; + if (isSetSuccess()) { + lastComparison = TBaseHelper.compareTo(this.success, typedOther.success); + if (lastComparison != 0) { + return lastComparison; + } } - lastComparison = Boolean.valueOf(isSetIo()).compareTo(isSetIo()); + lastComparison = Boolean.valueOf(isSetIo()).compareTo(typedOther.isSetIo()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(io, typedOther.io); - if (lastComparison != 0) { - return lastComparison; + if (isSetIo()) { + lastComparison = TBaseHelper.compareTo(this.io, typedOther.io); + 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 SUCCESS: - if (field.type == TType.LIST) { + switch (field.id) { + case 0: // SUCCESS + if (field.type == TType.LIST) { + { + TList _list18 = iprot.readListBegin(); + this.success = new ArrayList(_list18.size); + for (int _i19 = 0; _i19 < _list18.size; ++_i19) { - TList _list18 = iprot.readListBegin(); - this.success = new ArrayList(_list18.size); - for (int _i19 = 0; _i19 < _list18.size; ++_i19) - { - TRegionInfo _elem20; - _elem20 = new TRegionInfo(); - _elem20.read(iprot); - this.success.add(_elem20); - } - iprot.readListEnd(); + TRegionInfo _elem20; + _elem20 = new TRegionInfo(); + _elem20.read(iprot); + this.success.add(_elem20); } - } else { - TProtocolUtil.skip(iprot, field.type); + iprot.readListEnd(); } - break; - case IO: - if (field.type == TType.STRUCT) { - this.io = new IOError(); - this.io.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); - } + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 1: // IO + if (field.type == TType.STRUCT) { + this.io = new IOError(); + this.io.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + } + iprot.readFieldEnd(); } iprot.readStructEnd(); @@ -7855,7 +9719,7 @@ public class Hbase { } - public static class createTable_args implements TBase, java.io.Serializable, Cloneable, Comparable { + public static class createTable_args implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("createTable_args"); private static final TField TABLE_NAME_FIELD_DESC = new TField("tableName", TType.STRING, (short)1); @@ -7864,7 +9728,7 @@ public class Hbase { /** * name of table to create */ - public byte[] tableName; + public ByteBuffer tableName; /** * list of column family descriptors */ @@ -7881,12 +9745,10 @@ public class Hbase { */ COLUMN_FAMILIES((short)2, "columnFamilies"); - 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); } } @@ -7895,7 +9757,14 @@ public class Hbase { * 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: // TABLE_NAME + return TABLE_NAME; + case 2: // COLUMN_FAMILIES + return COLUMN_FAMILIES; + default: + return null; + } } /** @@ -7934,15 +9803,15 @@ public class Hbase { // isset id assignments - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.TABLE_NAME, new FieldMetaData("tableName", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(_Fields.COLUMN_FAMILIES, new FieldMetaData("columnFamilies", TFieldRequirementType.DEFAULT, - new ListMetaData(TType.LIST, - new StructMetaData(TType.STRUCT, ColumnDescriptor.class)))); - }}); - + public static final Map<_Fields, FieldMetaData> metaDataMap; static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.TABLE_NAME, new FieldMetaData("tableName", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING , "Text"))); + tmpMap.put(_Fields.COLUMN_FAMILIES, new FieldMetaData("columnFamilies", TFieldRequirementType.DEFAULT, + new ListMetaData(TType.LIST, + new StructMetaData(TType.STRUCT, ColumnDescriptor.class)))); + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(createTable_args.class, metaDataMap); } @@ -7950,7 +9819,7 @@ public class Hbase { } public createTable_args( - byte[] tableName, + ByteBuffer tableName, List columnFamilies) { this(); @@ -7978,22 +9847,33 @@ public class Hbase { return new createTable_args(this); } - @Deprecated - public createTable_args clone() { - return new createTable_args(this); + @Override + public void clear() { + this.tableName = null; + this.columnFamilies = null; } /** * name of table to create */ public byte[] getTableName() { - return this.tableName; + setTableName(TBaseHelper.rightSize(tableName)); + return tableName.array(); + } + + public ByteBuffer BufferForTableName() { + return tableName; } /** * name of table to create */ public createTable_args setTableName(byte[] tableName) { + setTableName(ByteBuffer.wrap(tableName)); + return this; + } + + public createTable_args setTableName(ByteBuffer tableName) { this.tableName = tableName; return this; } @@ -8064,7 +9944,7 @@ public class Hbase { if (value == null) { unsetTableName(); } else { - setTableName((byte[])value); + setTableName((ByteBuffer)value); } break; @@ -8079,10 +9959,6 @@ public class Hbase { } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case TABLE_NAME: @@ -8095,12 +9971,12 @@ public class Hbase { 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 TABLE_NAME: return isSetTableName(); @@ -8110,10 +9986,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -8132,7 +10004,7 @@ public class Hbase { if (this_present_tableName || that_present_tableName) { if (!(this_present_tableName && that_present_tableName)) return false; - if (!java.util.Arrays.equals(this.tableName, that.tableName)) + if (!this.tableName.equals(that.tableName)) return false; } @@ -8173,67 +10045,72 @@ public class Hbase { int lastComparison = 0; createTable_args typedOther = (createTable_args)other; - lastComparison = Boolean.valueOf(isSetTableName()).compareTo(isSetTableName()); + lastComparison = Boolean.valueOf(isSetTableName()).compareTo(typedOther.isSetTableName()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(tableName, typedOther.tableName); - if (lastComparison != 0) { - return lastComparison; + if (isSetTableName()) { + lastComparison = TBaseHelper.compareTo(this.tableName, typedOther.tableName); + if (lastComparison != 0) { + return lastComparison; + } } - lastComparison = Boolean.valueOf(isSetColumnFamilies()).compareTo(isSetColumnFamilies()); + lastComparison = Boolean.valueOf(isSetColumnFamilies()).compareTo(typedOther.isSetColumnFamilies()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(columnFamilies, typedOther.columnFamilies); - if (lastComparison != 0) { - return lastComparison; + if (isSetColumnFamilies()) { + lastComparison = TBaseHelper.compareTo(this.columnFamilies, typedOther.columnFamilies); + 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 TABLE_NAME: - if (field.type == TType.STRING) { - this.tableName = iprot.readBinary(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case COLUMN_FAMILIES: - if (field.type == TType.LIST) { + switch (field.id) { + case 1: // TABLE_NAME + if (field.type == TType.STRING) { + this.tableName = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 2: // COLUMN_FAMILIES + if (field.type == TType.LIST) { + { + TList _list22 = iprot.readListBegin(); + this.columnFamilies = new ArrayList(_list22.size); + for (int _i23 = 0; _i23 < _list22.size; ++_i23) { - TList _list22 = iprot.readListBegin(); - this.columnFamilies = new ArrayList(_list22.size); - for (int _i23 = 0; _i23 < _list22.size; ++_i23) - { - ColumnDescriptor _elem24; - _elem24 = new ColumnDescriptor(); - _elem24.read(iprot); - this.columnFamilies.add(_elem24); - } - iprot.readListEnd(); + ColumnDescriptor _elem24; + _elem24 = new ColumnDescriptor(); + _elem24.read(iprot); + this.columnFamilies.add(_elem24); } - } 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(); @@ -8296,7 +10173,7 @@ public class Hbase { } - public static class createTable_result implements TBase, java.io.Serializable, Cloneable, Comparable { + public static class createTable_result implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("createTable_result"); private static final TField IO_FIELD_DESC = new TField("io", TType.STRUCT, (short)1); @@ -8313,12 +10190,10 @@ public class Hbase { IA((short)2, "ia"), EXIST((short)3, "exist"); - 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); } } @@ -8327,7 +10202,16 @@ public class Hbase { * 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: // IO + return IO; + case 2: // IA + return IA; + case 3: // EXIST + return EXIST; + default: + return null; + } } /** @@ -8366,16 +10250,16 @@ public class Hbase { // isset id assignments - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, + public static final Map<_Fields, FieldMetaData> metaDataMap; + static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); - put(_Fields.IA, new FieldMetaData("ia", TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.IA, new FieldMetaData("ia", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); - put(_Fields.EXIST, new FieldMetaData("exist", TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.EXIST, new FieldMetaData("exist", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); - }}); - - static { + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(createTable_result.class, metaDataMap); } @@ -8412,9 +10296,11 @@ public class Hbase { return new createTable_result(this); } - @Deprecated - public createTable_result clone() { - return new createTable_result(this); + @Override + public void clear() { + this.io = null; + this.ia = null; + this.exist = null; } public IOError getIo() { @@ -8518,10 +10404,6 @@ public class Hbase { } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case IO: @@ -8537,12 +10419,12 @@ public class Hbase { 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 IO: return isSetIo(); @@ -8554,10 +10436,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -8631,74 +10509,81 @@ public class Hbase { int lastComparison = 0; createTable_result typedOther = (createTable_result)other; - lastComparison = Boolean.valueOf(isSetIo()).compareTo(isSetIo()); + lastComparison = Boolean.valueOf(isSetIo()).compareTo(typedOther.isSetIo()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(io, typedOther.io); - if (lastComparison != 0) { - return lastComparison; + if (isSetIo()) { + lastComparison = TBaseHelper.compareTo(this.io, typedOther.io); + if (lastComparison != 0) { + return lastComparison; + } } - lastComparison = Boolean.valueOf(isSetIa()).compareTo(isSetIa()); + lastComparison = Boolean.valueOf(isSetIa()).compareTo(typedOther.isSetIa()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(ia, typedOther.ia); - if (lastComparison != 0) { - return lastComparison; + if (isSetIa()) { + lastComparison = TBaseHelper.compareTo(this.ia, typedOther.ia); + if (lastComparison != 0) { + return lastComparison; + } } - lastComparison = Boolean.valueOf(isSetExist()).compareTo(isSetExist()); + lastComparison = Boolean.valueOf(isSetExist()).compareTo(typedOther.isSetExist()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(exist, typedOther.exist); - if (lastComparison != 0) { - return lastComparison; + if (isSetExist()) { + lastComparison = TBaseHelper.compareTo(this.exist, typedOther.exist); + 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 IO: - if (field.type == TType.STRUCT) { - this.io = new IOError(); - this.io.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case IA: - if (field.type == TType.STRUCT) { - this.ia = new IllegalArgument(); - this.ia.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case EXIST: - if (field.type == TType.STRUCT) { - this.exist = new AlreadyExists(); - this.exist.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); - } + switch (field.id) { + case 1: // IO + if (field.type == TType.STRUCT) { + this.io = new IOError(); + this.io.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 2: // IA + if (field.type == TType.STRUCT) { + this.ia = new IllegalArgument(); + this.ia.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 3: // EXIST + if (field.type == TType.STRUCT) { + this.exist = new AlreadyExists(); + this.exist.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + } + iprot.readFieldEnd(); } iprot.readStructEnd(); @@ -8764,7 +10649,7 @@ public class Hbase { } - public static class deleteTable_args implements TBase, java.io.Serializable, Cloneable, Comparable { + public static class deleteTable_args implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("deleteTable_args"); private static final TField TABLE_NAME_FIELD_DESC = new TField("tableName", TType.STRING, (short)1); @@ -8772,7 +10657,7 @@ public class Hbase { /** * name of table to delete */ - public byte[] tableName; + public ByteBuffer tableName; /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements TFieldIdEnum { @@ -8781,12 +10666,10 @@ public class Hbase { */ TABLE_NAME((short)1, "tableName"); - 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); } } @@ -8795,7 +10678,12 @@ public class Hbase { * 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: // TABLE_NAME + return TABLE_NAME; + default: + return null; + } } /** @@ -8834,12 +10722,12 @@ public class Hbase { // isset id assignments - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.TABLE_NAME, new FieldMetaData("tableName", 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.TABLE_NAME, new FieldMetaData("tableName", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING , "Text"))); + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(deleteTable_args.class, metaDataMap); } @@ -8847,7 +10735,7 @@ public class Hbase { } public deleteTable_args( - byte[] tableName) + ByteBuffer tableName) { this(); this.tableName = tableName; @@ -8866,22 +10754,32 @@ public class Hbase { return new deleteTable_args(this); } - @Deprecated - public deleteTable_args clone() { - return new deleteTable_args(this); + @Override + public void clear() { + this.tableName = null; } /** * name of table to delete */ public byte[] getTableName() { - return this.tableName; + setTableName(TBaseHelper.rightSize(tableName)); + return tableName.array(); + } + + public ByteBuffer BufferForTableName() { + return tableName; } /** * name of table to delete */ public deleteTable_args setTableName(byte[] tableName) { + setTableName(ByteBuffer.wrap(tableName)); + return this; + } + + public deleteTable_args setTableName(ByteBuffer tableName) { this.tableName = tableName; return this; } @@ -8907,17 +10805,13 @@ public class Hbase { if (value == null) { unsetTableName(); } else { - setTableName((byte[])value); + setTableName((ByteBuffer)value); } break; } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case TABLE_NAME: @@ -8927,12 +10821,12 @@ public class Hbase { 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 TABLE_NAME: return isSetTableName(); @@ -8940,10 +10834,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -8962,7 +10852,7 @@ public class Hbase { if (this_present_tableName || that_present_tableName) { if (!(this_present_tableName && that_present_tableName)) return false; - if (!java.util.Arrays.equals(this.tableName, that.tableName)) + if (!this.tableName.equals(that.tableName)) return false; } @@ -8989,41 +10879,44 @@ public class Hbase { int lastComparison = 0; deleteTable_args typedOther = (deleteTable_args)other; - lastComparison = Boolean.valueOf(isSetTableName()).compareTo(isSetTableName()); + lastComparison = Boolean.valueOf(isSetTableName()).compareTo(typedOther.isSetTableName()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(tableName, typedOther.tableName); - if (lastComparison != 0) { - return lastComparison; + if (isSetTableName()) { + lastComparison = TBaseHelper.compareTo(this.tableName, typedOther.tableName); + 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 TABLE_NAME: - if (field.type == TType.STRING) { - this.tableName = iprot.readBinary(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); + switch (field.id) { + case 1: // TABLE_NAME + if (field.type == TType.STRING) { + this.tableName = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); } + iprot.readFieldEnd(); } iprot.readStructEnd(); @@ -9066,7 +10959,7 @@ public class Hbase { } - public static class deleteTable_result implements TBase, java.io.Serializable, Cloneable, Comparable { + public static class deleteTable_result implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("deleteTable_result"); private static final TField IO_FIELD_DESC = new TField("io", TType.STRUCT, (short)1); @@ -9077,12 +10970,10 @@ public class Hbase { public enum _Fields implements TFieldIdEnum { IO((short)1, "io"); - 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); } } @@ -9091,7 +10982,12 @@ public class Hbase { * 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: // IO + return IO; + default: + return null; + } } /** @@ -9130,12 +11026,12 @@ public class Hbase { // isset id assignments - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRUCT))); - }}); - + public static final Map<_Fields, FieldMetaData> metaDataMap; static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(deleteTable_result.class, metaDataMap); } @@ -9162,9 +11058,9 @@ public class Hbase { return new deleteTable_result(this); } - @Deprecated - public deleteTable_result clone() { - return new deleteTable_result(this); + @Override + public void clear() { + this.io = null; } public IOError getIo() { @@ -9204,10 +11100,6 @@ public class Hbase { } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case IO: @@ -9217,12 +11109,12 @@ public class Hbase { 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 IO: return isSetIo(); @@ -9230,10 +11122,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -9279,42 +11167,45 @@ public class Hbase { int lastComparison = 0; deleteTable_result typedOther = (deleteTable_result)other; - lastComparison = Boolean.valueOf(isSetIo()).compareTo(isSetIo()); + lastComparison = Boolean.valueOf(isSetIo()).compareTo(typedOther.isSetIo()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(io, typedOther.io); - if (lastComparison != 0) { - return lastComparison; + if (isSetIo()) { + lastComparison = TBaseHelper.compareTo(this.io, typedOther.io); + 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 IO: - if (field.type == TType.STRUCT) { - this.io = new IOError(); - this.io.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); + switch (field.id) { + case 1: // IO + if (field.type == TType.STRUCT) { + this.io = new IOError(); + this.io.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); } + iprot.readFieldEnd(); } iprot.readStructEnd(); @@ -9356,7 +11247,7 @@ public class Hbase { } - public static class get_args implements TBase, java.io.Serializable, Cloneable, Comparable { + public static class get_args implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("get_args"); private static final TField TABLE_NAME_FIELD_DESC = new TField("tableName", TType.STRING, (short)1); @@ -9366,15 +11257,15 @@ public class Hbase { /** * name of table */ - public byte[] tableName; + public ByteBuffer tableName; /** * row key */ - public byte[] row; + public ByteBuffer row; /** * column name */ - public byte[] column; + public ByteBuffer column; /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements TFieldIdEnum { @@ -9391,12 +11282,10 @@ public class Hbase { */ COLUMN((short)3, "column"); - 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); } } @@ -9405,7 +11294,16 @@ public class Hbase { * 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: // TABLE_NAME + return TABLE_NAME; + case 2: // ROW + return ROW; + case 3: // COLUMN + return COLUMN; + default: + return null; + } } /** @@ -9444,16 +11342,16 @@ public class Hbase { // isset id assignments - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.TABLE_NAME, new FieldMetaData("tableName", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(_Fields.ROW, new FieldMetaData("row", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(_Fields.COLUMN, new FieldMetaData("column", 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.TABLE_NAME, new FieldMetaData("tableName", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING , "Text"))); + tmpMap.put(_Fields.ROW, new FieldMetaData("row", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING , "Text"))); + tmpMap.put(_Fields.COLUMN, new FieldMetaData("column", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING , "Text"))); + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(get_args.class, metaDataMap); } @@ -9461,9 +11359,9 @@ public class Hbase { } public get_args( - byte[] tableName, - byte[] row, - byte[] column) + ByteBuffer tableName, + ByteBuffer row, + ByteBuffer column) { this(); this.tableName = tableName; @@ -9490,22 +11388,34 @@ public class Hbase { return new get_args(this); } - @Deprecated - public get_args clone() { - return new get_args(this); + @Override + public void clear() { + this.tableName = null; + this.row = null; + this.column = null; } /** * name of table */ public byte[] getTableName() { - return this.tableName; + setTableName(TBaseHelper.rightSize(tableName)); + return tableName.array(); + } + + public ByteBuffer BufferForTableName() { + return tableName; } /** * name of table */ public get_args setTableName(byte[] tableName) { + setTableName(ByteBuffer.wrap(tableName)); + return this; + } + + public get_args setTableName(ByteBuffer tableName) { this.tableName = tableName; return this; } @@ -9529,13 +11439,23 @@ public class Hbase { * row key */ public byte[] getRow() { - return this.row; + setRow(TBaseHelper.rightSize(row)); + return row.array(); + } + + public ByteBuffer BufferForRow() { + return row; } /** * row key */ public get_args setRow(byte[] row) { + setRow(ByteBuffer.wrap(row)); + return this; + } + + public get_args setRow(ByteBuffer row) { this.row = row; return this; } @@ -9559,13 +11479,23 @@ public class Hbase { * column name */ public byte[] getColumn() { - return this.column; + setColumn(TBaseHelper.rightSize(column)); + return column.array(); + } + + public ByteBuffer BufferForColumn() { + return column; } /** * column name */ public get_args setColumn(byte[] column) { + setColumn(ByteBuffer.wrap(column)); + return this; + } + + public get_args setColumn(ByteBuffer column) { this.column = column; return this; } @@ -9591,7 +11521,7 @@ public class Hbase { if (value == null) { unsetTableName(); } else { - setTableName((byte[])value); + setTableName((ByteBuffer)value); } break; @@ -9599,7 +11529,7 @@ public class Hbase { if (value == null) { unsetRow(); } else { - setRow((byte[])value); + setRow((ByteBuffer)value); } break; @@ -9607,17 +11537,13 @@ public class Hbase { if (value == null) { unsetColumn(); } else { - setColumn((byte[])value); + setColumn((ByteBuffer)value); } break; } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case TABLE_NAME: @@ -9633,12 +11559,12 @@ public class Hbase { 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 TABLE_NAME: return isSetTableName(); @@ -9650,10 +11576,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -9672,7 +11594,7 @@ public class Hbase { if (this_present_tableName || that_present_tableName) { if (!(this_present_tableName && that_present_tableName)) return false; - if (!java.util.Arrays.equals(this.tableName, that.tableName)) + if (!this.tableName.equals(that.tableName)) return false; } @@ -9681,7 +11603,7 @@ public class Hbase { 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; } @@ -9690,7 +11612,7 @@ public class Hbase { if (this_present_column || that_present_column) { if (!(this_present_column && that_present_column)) return false; - if (!java.util.Arrays.equals(this.column, that.column)) + if (!this.column.equals(that.column)) return false; } @@ -9727,71 +11649,78 @@ public class Hbase { int lastComparison = 0; get_args typedOther = (get_args)other; - lastComparison = Boolean.valueOf(isSetTableName()).compareTo(isSetTableName()); + lastComparison = Boolean.valueOf(isSetTableName()).compareTo(typedOther.isSetTableName()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(tableName, typedOther.tableName); - if (lastComparison != 0) { - return lastComparison; + if (isSetTableName()) { + lastComparison = TBaseHelper.compareTo(this.tableName, typedOther.tableName); + if (lastComparison != 0) { + return lastComparison; + } } - 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(isSetColumn()).compareTo(isSetColumn()); + lastComparison = Boolean.valueOf(isSetColumn()).compareTo(typedOther.isSetColumn()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(column, typedOther.column); - if (lastComparison != 0) { - return lastComparison; + if (isSetColumn()) { + lastComparison = TBaseHelper.compareTo(this.column, typedOther.column); + 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 TABLE_NAME: - if (field.type == TType.STRING) { - this.tableName = iprot.readBinary(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case ROW: - if (field.type == TType.STRING) { - this.row = iprot.readBinary(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case COLUMN: - if (field.type == TType.STRING) { - this.column = iprot.readBinary(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); - } + switch (field.id) { + case 1: // TABLE_NAME + if (field.type == TType.STRING) { + this.tableName = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 2: // ROW + if (field.type == TType.STRING) { + this.row = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 3: // COLUMN + if (field.type == TType.STRING) { + this.column = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + } + iprot.readFieldEnd(); } iprot.readStructEnd(); @@ -9860,7 +11789,7 @@ public class Hbase { } - public static class get_result implements TBase, java.io.Serializable, Cloneable, Comparable { + public static class get_result implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("get_result"); private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0); @@ -9874,12 +11803,10 @@ public class Hbase { SUCCESS((short)0, "success"), IO((short)1, "io"); - 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); } } @@ -9888,7 +11815,14 @@ public class Hbase { * 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 0: // SUCCESS + return SUCCESS; + case 1: // IO + return IO; + default: + return null; + } } /** @@ -9927,15 +11861,15 @@ public class Hbase { // isset id assignments - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new ListMetaData(TType.LIST, + public static final Map<_Fields, FieldMetaData> metaDataMap; + static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + new ListMetaData(TType.LIST, new StructMetaData(TType.STRUCT, TCell.class)))); - put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); - }}); - - static { + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(get_result.class, metaDataMap); } @@ -9971,9 +11905,10 @@ public class Hbase { return new get_result(this); } - @Deprecated - public get_result clone() { - return new get_result(this); + @Override + public void clear() { + this.success = null; + this.io = null; } public int getSuccessSize() { @@ -10060,10 +11995,6 @@ public class Hbase { } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: @@ -10076,12 +12007,12 @@ public class Hbase { 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 SUCCESS: return isSetSuccess(); @@ -10091,10 +12022,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -10154,68 +12081,73 @@ public class Hbase { int lastComparison = 0; get_result typedOther = (get_result)other; - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess()); + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(success, typedOther.success); - if (lastComparison != 0) { - return lastComparison; + if (isSetSuccess()) { + lastComparison = TBaseHelper.compareTo(this.success, typedOther.success); + if (lastComparison != 0) { + return lastComparison; + } } - lastComparison = Boolean.valueOf(isSetIo()).compareTo(isSetIo()); + lastComparison = Boolean.valueOf(isSetIo()).compareTo(typedOther.isSetIo()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(io, typedOther.io); - if (lastComparison != 0) { - return lastComparison; + if (isSetIo()) { + lastComparison = TBaseHelper.compareTo(this.io, typedOther.io); + 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 SUCCESS: - if (field.type == TType.LIST) { + switch (field.id) { + case 0: // SUCCESS + if (field.type == TType.LIST) { + { + TList _list26 = iprot.readListBegin(); + this.success = new ArrayList(_list26.size); + for (int _i27 = 0; _i27 < _list26.size; ++_i27) { - TList _list26 = iprot.readListBegin(); - this.success = new ArrayList(_list26.size); - for (int _i27 = 0; _i27 < _list26.size; ++_i27) - { - TCell _elem28; - _elem28 = new TCell(); - _elem28.read(iprot); - this.success.add(_elem28); - } - iprot.readListEnd(); + TCell _elem28; + _elem28 = new TCell(); + _elem28.read(iprot); + this.success.add(_elem28); } - } else { - TProtocolUtil.skip(iprot, field.type); + iprot.readListEnd(); } - break; - case IO: - if (field.type == TType.STRUCT) { - this.io = new IOError(); - this.io.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); - } + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 1: // IO + if (field.type == TType.STRUCT) { + this.io = new IOError(); + this.io.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + } + iprot.readFieldEnd(); } iprot.readStructEnd(); @@ -10276,7 +12208,7 @@ public class Hbase { } - public static class getVer_args implements TBase, java.io.Serializable, Cloneable, Comparable { + public static class getVer_args implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("getVer_args"); private static final TField TABLE_NAME_FIELD_DESC = new TField("tableName", TType.STRING, (short)1); @@ -10287,15 +12219,15 @@ public class Hbase { /** * name of table */ - public byte[] tableName; + public ByteBuffer tableName; /** * row key */ - public byte[] row; + public ByteBuffer row; /** * column name */ - public byte[] column; + public ByteBuffer column; /** * number of versions to retrieve */ @@ -10320,12 +12252,10 @@ public class Hbase { */ NUM_VERSIONS((short)4, "numVersions"); - 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); } } @@ -10334,7 +12264,18 @@ public class Hbase { * 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: // TABLE_NAME + return TABLE_NAME; + case 2: // ROW + return ROW; + case 3: // COLUMN + return COLUMN; + case 4: // NUM_VERSIONS + return NUM_VERSIONS; + default: + return null; + } } /** @@ -10375,18 +12316,18 @@ public class Hbase { private static final int __NUMVERSIONS_ISSET_ID = 0; private BitSet __isset_bit_vector = new BitSet(1); - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.TABLE_NAME, new FieldMetaData("tableName", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(_Fields.ROW, new FieldMetaData("row", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(_Fields.COLUMN, new FieldMetaData("column", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(_Fields.NUM_VERSIONS, new FieldMetaData("numVersions", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.I32))); - }}); - + public static final Map<_Fields, FieldMetaData> metaDataMap; static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.TABLE_NAME, new FieldMetaData("tableName", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING , "Text"))); + tmpMap.put(_Fields.ROW, new FieldMetaData("row", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING , "Text"))); + tmpMap.put(_Fields.COLUMN, new FieldMetaData("column", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING , "Text"))); + tmpMap.put(_Fields.NUM_VERSIONS, new FieldMetaData("numVersions", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.I32))); + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(getVer_args.class, metaDataMap); } @@ -10394,9 +12335,9 @@ public class Hbase { } public getVer_args( - byte[] tableName, - byte[] row, - byte[] column, + ByteBuffer tableName, + ByteBuffer row, + ByteBuffer column, int numVersions) { this(); @@ -10429,22 +12370,36 @@ public class Hbase { return new getVer_args(this); } - @Deprecated - public getVer_args clone() { - return new getVer_args(this); + @Override + public void clear() { + this.tableName = null; + this.row = null; + this.column = null; + setNumVersionsIsSet(false); + this.numVersions = 0; } /** * name of table */ public byte[] getTableName() { - return this.tableName; + setTableName(TBaseHelper.rightSize(tableName)); + return tableName.array(); + } + + public ByteBuffer BufferForTableName() { + return tableName; } /** * name of table */ public getVer_args setTableName(byte[] tableName) { + setTableName(ByteBuffer.wrap(tableName)); + return this; + } + + public getVer_args setTableName(ByteBuffer tableName) { this.tableName = tableName; return this; } @@ -10468,13 +12423,23 @@ public class Hbase { * row key */ public byte[] getRow() { - return this.row; + setRow(TBaseHelper.rightSize(row)); + return row.array(); + } + + public ByteBuffer BufferForRow() { + return row; } /** * row key */ public getVer_args setRow(byte[] row) { + setRow(ByteBuffer.wrap(row)); + return this; + } + + public getVer_args setRow(ByteBuffer row) { this.row = row; return this; } @@ -10498,13 +12463,23 @@ public class Hbase { * column name */ public byte[] getColumn() { - return this.column; + setColumn(TBaseHelper.rightSize(column)); + return column.array(); + } + + public ByteBuffer BufferForColumn() { + return column; } /** * column name */ public getVer_args setColumn(byte[] column) { + setColumn(ByteBuffer.wrap(column)); + return this; + } + + public getVer_args setColumn(ByteBuffer column) { this.column = column; return this; } @@ -10559,7 +12534,7 @@ public class Hbase { if (value == null) { unsetTableName(); } else { - setTableName((byte[])value); + setTableName((ByteBuffer)value); } break; @@ -10567,7 +12542,7 @@ public class Hbase { if (value == null) { unsetRow(); } else { - setRow((byte[])value); + setRow((ByteBuffer)value); } break; @@ -10575,7 +12550,7 @@ public class Hbase { if (value == null) { unsetColumn(); } else { - setColumn((byte[])value); + setColumn((ByteBuffer)value); } break; @@ -10590,10 +12565,6 @@ public class Hbase { } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case TABLE_NAME: @@ -10612,12 +12583,12 @@ public class Hbase { 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 TABLE_NAME: return isSetTableName(); @@ -10631,10 +12602,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -10653,7 +12620,7 @@ public class Hbase { if (this_present_tableName || that_present_tableName) { if (!(this_present_tableName && that_present_tableName)) return false; - if (!java.util.Arrays.equals(this.tableName, that.tableName)) + if (!this.tableName.equals(that.tableName)) return false; } @@ -10662,7 +12629,7 @@ public class Hbase { 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; } @@ -10671,7 +12638,7 @@ public class Hbase { if (this_present_column || that_present_column) { if (!(this_present_column && that_present_column)) return false; - if (!java.util.Arrays.equals(this.column, that.column)) + if (!this.column.equals(that.column)) return false; } @@ -10722,87 +12689,96 @@ public class Hbase { int lastComparison = 0; getVer_args typedOther = (getVer_args)other; - lastComparison = Boolean.valueOf(isSetTableName()).compareTo(isSetTableName()); + lastComparison = Boolean.valueOf(isSetTableName()).compareTo(typedOther.isSetTableName()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(tableName, typedOther.tableName); - if (lastComparison != 0) { - return lastComparison; + if (isSetTableName()) { + lastComparison = TBaseHelper.compareTo(this.tableName, typedOther.tableName); + if (lastComparison != 0) { + return lastComparison; + } } - 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(isSetColumn()).compareTo(isSetColumn()); + lastComparison = Boolean.valueOf(isSetColumn()).compareTo(typedOther.isSetColumn()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(column, typedOther.column); - if (lastComparison != 0) { - return lastComparison; + if (isSetColumn()) { + lastComparison = TBaseHelper.compareTo(this.column, typedOther.column); + if (lastComparison != 0) { + return lastComparison; + } } - lastComparison = Boolean.valueOf(isSetNumVersions()).compareTo(isSetNumVersions()); + lastComparison = Boolean.valueOf(isSetNumVersions()).compareTo(typedOther.isSetNumVersions()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(numVersions, typedOther.numVersions); - if (lastComparison != 0) { - return lastComparison; + if (isSetNumVersions()) { + lastComparison = TBaseHelper.compareTo(this.numVersions, typedOther.numVersions); + 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 TABLE_NAME: - if (field.type == TType.STRING) { - this.tableName = iprot.readBinary(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case ROW: - if (field.type == TType.STRING) { - this.row = iprot.readBinary(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case COLUMN: - if (field.type == TType.STRING) { - this.column = iprot.readBinary(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case NUM_VERSIONS: - if (field.type == TType.I32) { - this.numVersions = iprot.readI32(); - setNumVersionsIsSet(true); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); - } + switch (field.id) { + case 1: // TABLE_NAME + if (field.type == TType.STRING) { + this.tableName = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 2: // ROW + if (field.type == TType.STRING) { + this.row = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 3: // COLUMN + if (field.type == TType.STRING) { + this.column = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 4: // NUM_VERSIONS + if (field.type == TType.I32) { + this.numVersions = iprot.readI32(); + setNumVersionsIsSet(true); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + } + iprot.readFieldEnd(); } iprot.readStructEnd(); @@ -10878,7 +12854,7 @@ public class Hbase { } - public static class getVer_result implements TBase, java.io.Serializable, Cloneable, Comparable { + public static class getVer_result implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("getVer_result"); private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0); @@ -10892,12 +12868,10 @@ public class Hbase { SUCCESS((short)0, "success"), IO((short)1, "io"); - 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); } } @@ -10906,7 +12880,14 @@ public class Hbase { * 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 0: // SUCCESS + return SUCCESS; + case 1: // IO + return IO; + default: + return null; + } } /** @@ -10945,15 +12926,15 @@ public class Hbase { // isset id assignments - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new ListMetaData(TType.LIST, + public static final Map<_Fields, FieldMetaData> metaDataMap; + static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + new ListMetaData(TType.LIST, new StructMetaData(TType.STRUCT, TCell.class)))); - put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); - }}); - - static { + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(getVer_result.class, metaDataMap); } @@ -10989,9 +12970,10 @@ public class Hbase { return new getVer_result(this); } - @Deprecated - public getVer_result clone() { - return new getVer_result(this); + @Override + public void clear() { + this.success = null; + this.io = null; } public int getSuccessSize() { @@ -11078,10 +13060,6 @@ public class Hbase { } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: @@ -11094,12 +13072,12 @@ public class Hbase { 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 SUCCESS: return isSetSuccess(); @@ -11109,10 +13087,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -11172,68 +13146,73 @@ public class Hbase { int lastComparison = 0; getVer_result typedOther = (getVer_result)other; - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess()); + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(success, typedOther.success); - if (lastComparison != 0) { - return lastComparison; + if (isSetSuccess()) { + lastComparison = TBaseHelper.compareTo(this.success, typedOther.success); + if (lastComparison != 0) { + return lastComparison; + } } - lastComparison = Boolean.valueOf(isSetIo()).compareTo(isSetIo()); + lastComparison = Boolean.valueOf(isSetIo()).compareTo(typedOther.isSetIo()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(io, typedOther.io); - if (lastComparison != 0) { - return lastComparison; + if (isSetIo()) { + lastComparison = TBaseHelper.compareTo(this.io, typedOther.io); + 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 SUCCESS: - if (field.type == TType.LIST) { + switch (field.id) { + case 0: // SUCCESS + if (field.type == TType.LIST) { + { + TList _list30 = iprot.readListBegin(); + this.success = new ArrayList(_list30.size); + for (int _i31 = 0; _i31 < _list30.size; ++_i31) { - TList _list30 = iprot.readListBegin(); - this.success = new ArrayList(_list30.size); - for (int _i31 = 0; _i31 < _list30.size; ++_i31) - { - TCell _elem32; - _elem32 = new TCell(); - _elem32.read(iprot); - this.success.add(_elem32); - } - iprot.readListEnd(); + TCell _elem32; + _elem32 = new TCell(); + _elem32.read(iprot); + this.success.add(_elem32); } - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case IO: - if (field.type == TType.STRUCT) { - this.io = new IOError(); - this.io.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); + iprot.readListEnd(); } - break; - } - iprot.readFieldEnd(); - } + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 1: // IO + if (field.type == TType.STRUCT) { + this.io = new IOError(); + this.io.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + } + iprot.readFieldEnd(); } iprot.readStructEnd(); @@ -11294,7 +13273,7 @@ public class Hbase { } - public static class getVerTs_args implements TBase, java.io.Serializable, Cloneable, Comparable { + public static class getVerTs_args implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("getVerTs_args"); private static final TField TABLE_NAME_FIELD_DESC = new TField("tableName", TType.STRING, (short)1); @@ -11306,15 +13285,15 @@ public class Hbase { /** * name of table */ - public byte[] tableName; + public ByteBuffer tableName; /** * row key */ - public byte[] row; + public ByteBuffer row; /** * column name */ - public byte[] column; + public ByteBuffer column; /** * timestamp */ @@ -11347,12 +13326,10 @@ public class Hbase { */ NUM_VERSIONS((short)5, "numVersions"); - 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); } } @@ -11361,7 +13338,20 @@ public class Hbase { * 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: // TABLE_NAME + return TABLE_NAME; + case 2: // ROW + return ROW; + case 3: // COLUMN + return COLUMN; + case 4: // TIMESTAMP + return TIMESTAMP; + case 5: // NUM_VERSIONS + return NUM_VERSIONS; + default: + return null; + } } /** @@ -11403,20 +13393,20 @@ public class Hbase { private static final int __NUMVERSIONS_ISSET_ID = 1; private BitSet __isset_bit_vector = new BitSet(2); - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.TABLE_NAME, new FieldMetaData("tableName", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(_Fields.ROW, new FieldMetaData("row", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(_Fields.COLUMN, new FieldMetaData("column", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(_Fields.TIMESTAMP, new FieldMetaData("timestamp", TFieldRequirementType.DEFAULT, + public static final Map<_Fields, FieldMetaData> metaDataMap; + static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.TABLE_NAME, new FieldMetaData("tableName", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING , "Text"))); + tmpMap.put(_Fields.ROW, new FieldMetaData("row", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING , "Text"))); + tmpMap.put(_Fields.COLUMN, new FieldMetaData("column", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING , "Text"))); + tmpMap.put(_Fields.TIMESTAMP, new FieldMetaData("timestamp", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.I64))); - put(_Fields.NUM_VERSIONS, new FieldMetaData("numVersions", TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.NUM_VERSIONS, new FieldMetaData("numVersions", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.I32))); - }}); - - static { + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(getVerTs_args.class, metaDataMap); } @@ -11424,9 +13414,9 @@ public class Hbase { } public getVerTs_args( - byte[] tableName, - byte[] row, - byte[] column, + ByteBuffer tableName, + ByteBuffer row, + ByteBuffer column, long timestamp, int numVersions) { @@ -11463,22 +13453,38 @@ public class Hbase { return new getVerTs_args(this); } - @Deprecated - public getVerTs_args clone() { - return new getVerTs_args(this); + @Override + public void clear() { + this.tableName = null; + this.row = null; + this.column = null; + setTimestampIsSet(false); + this.timestamp = 0; + setNumVersionsIsSet(false); + this.numVersions = 0; } /** * name of table */ public byte[] getTableName() { - return this.tableName; + setTableName(TBaseHelper.rightSize(tableName)); + return tableName.array(); + } + + public ByteBuffer BufferForTableName() { + return tableName; } /** * name of table */ public getVerTs_args setTableName(byte[] tableName) { + setTableName(ByteBuffer.wrap(tableName)); + return this; + } + + public getVerTs_args setTableName(ByteBuffer tableName) { this.tableName = tableName; return this; } @@ -11502,13 +13508,23 @@ public class Hbase { * row key */ public byte[] getRow() { - return this.row; + setRow(TBaseHelper.rightSize(row)); + return row.array(); + } + + public ByteBuffer BufferForRow() { + return row; } /** * row key */ public getVerTs_args setRow(byte[] row) { + setRow(ByteBuffer.wrap(row)); + return this; + } + + public getVerTs_args setRow(ByteBuffer row) { this.row = row; return this; } @@ -11532,13 +13548,23 @@ public class Hbase { * column name */ public byte[] getColumn() { - return this.column; + setColumn(TBaseHelper.rightSize(column)); + return column.array(); + } + + public ByteBuffer BufferForColumn() { + return column; } /** * column name */ public getVerTs_args setColumn(byte[] column) { + setColumn(ByteBuffer.wrap(column)); + return this; + } + + public getVerTs_args setColumn(ByteBuffer column) { this.column = column; return this; } @@ -11622,7 +13648,7 @@ public class Hbase { if (value == null) { unsetTableName(); } else { - setTableName((byte[])value); + setTableName((ByteBuffer)value); } break; @@ -11630,7 +13656,7 @@ public class Hbase { if (value == null) { unsetRow(); } else { - setRow((byte[])value); + setRow((ByteBuffer)value); } break; @@ -11638,7 +13664,7 @@ public class Hbase { if (value == null) { unsetColumn(); } else { - setColumn((byte[])value); + setColumn((ByteBuffer)value); } break; @@ -11661,10 +13687,6 @@ public class Hbase { } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case TABLE_NAME: @@ -11686,12 +13708,12 @@ public class Hbase { 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 TABLE_NAME: return isSetTableName(); @@ -11707,10 +13729,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -11729,7 +13747,7 @@ public class Hbase { if (this_present_tableName || that_present_tableName) { if (!(this_present_tableName && that_present_tableName)) return false; - if (!java.util.Arrays.equals(this.tableName, that.tableName)) + if (!this.tableName.equals(that.tableName)) return false; } @@ -11738,7 +13756,7 @@ public class Hbase { 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; } @@ -11747,7 +13765,7 @@ public class Hbase { if (this_present_column || that_present_column) { if (!(this_present_column && that_present_column)) return false; - if (!java.util.Arrays.equals(this.column, that.column)) + if (!this.column.equals(that.column)) return false; } @@ -11812,103 +13830,114 @@ public class Hbase { int lastComparison = 0; getVerTs_args typedOther = (getVerTs_args)other; - lastComparison = Boolean.valueOf(isSetTableName()).compareTo(isSetTableName()); + lastComparison = Boolean.valueOf(isSetTableName()).compareTo(typedOther.isSetTableName()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(tableName, typedOther.tableName); - if (lastComparison != 0) { - return lastComparison; + if (isSetTableName()) { + lastComparison = TBaseHelper.compareTo(this.tableName, typedOther.tableName); + if (lastComparison != 0) { + return lastComparison; + } } - 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(isSetColumn()).compareTo(isSetColumn()); + lastComparison = Boolean.valueOf(isSetColumn()).compareTo(typedOther.isSetColumn()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(column, typedOther.column); - if (lastComparison != 0) { - return lastComparison; + if (isSetColumn()) { + lastComparison = TBaseHelper.compareTo(this.column, typedOther.column); + if (lastComparison != 0) { + return lastComparison; + } } - lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(isSetTimestamp()); + lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(typedOther.isSetTimestamp()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(timestamp, typedOther.timestamp); - if (lastComparison != 0) { - return lastComparison; + if (isSetTimestamp()) { + lastComparison = TBaseHelper.compareTo(this.timestamp, typedOther.timestamp); + if (lastComparison != 0) { + return lastComparison; + } } - lastComparison = Boolean.valueOf(isSetNumVersions()).compareTo(isSetNumVersions()); + lastComparison = Boolean.valueOf(isSetNumVersions()).compareTo(typedOther.isSetNumVersions()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(numVersions, typedOther.numVersions); - if (lastComparison != 0) { - return lastComparison; + if (isSetNumVersions()) { + lastComparison = TBaseHelper.compareTo(this.numVersions, typedOther.numVersions); + 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 TABLE_NAME: - if (field.type == TType.STRING) { - this.tableName = iprot.readBinary(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case ROW: - if (field.type == TType.STRING) { - this.row = iprot.readBinary(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case COLUMN: - if (field.type == TType.STRING) { - this.column = iprot.readBinary(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case TIMESTAMP: - if (field.type == TType.I64) { - this.timestamp = iprot.readI64(); - setTimestampIsSet(true); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case NUM_VERSIONS: - if (field.type == TType.I32) { - this.numVersions = iprot.readI32(); - setNumVersionsIsSet(true); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); - } + switch (field.id) { + case 1: // TABLE_NAME + if (field.type == TType.STRING) { + this.tableName = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 2: // ROW + if (field.type == TType.STRING) { + this.row = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 3: // COLUMN + if (field.type == TType.STRING) { + this.column = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 4: // TIMESTAMP + if (field.type == TType.I64) { + this.timestamp = iprot.readI64(); + setTimestampIsSet(true); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 5: // NUM_VERSIONS + if (field.type == TType.I32) { + this.numVersions = iprot.readI32(); + setNumVersionsIsSet(true); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + } + iprot.readFieldEnd(); } iprot.readStructEnd(); @@ -11991,7 +14020,7 @@ public class Hbase { } - public static class getVerTs_result implements TBase, java.io.Serializable, Cloneable, Comparable { + public static class getVerTs_result implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("getVerTs_result"); private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0); @@ -12005,12 +14034,10 @@ public class Hbase { SUCCESS((short)0, "success"), IO((short)1, "io"); - 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); } } @@ -12019,7 +14046,14 @@ public class Hbase { * 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 0: // SUCCESS + return SUCCESS; + case 1: // IO + return IO; + default: + return null; + } } /** @@ -12058,15 +14092,15 @@ public class Hbase { // isset id assignments - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new ListMetaData(TType.LIST, + public static final Map<_Fields, FieldMetaData> metaDataMap; + static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + new ListMetaData(TType.LIST, new StructMetaData(TType.STRUCT, TCell.class)))); - put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); - }}); - - static { + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(getVerTs_result.class, metaDataMap); } @@ -12102,9 +14136,10 @@ public class Hbase { return new getVerTs_result(this); } - @Deprecated - public getVerTs_result clone() { - return new getVerTs_result(this); + @Override + public void clear() { + this.success = null; + this.io = null; } public int getSuccessSize() { @@ -12191,10 +14226,6 @@ public class Hbase { } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: @@ -12207,12 +14238,12 @@ public class Hbase { 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 SUCCESS: return isSetSuccess(); @@ -12222,10 +14253,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -12285,68 +14312,73 @@ public class Hbase { int lastComparison = 0; getVerTs_result typedOther = (getVerTs_result)other; - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess()); + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(success, typedOther.success); - if (lastComparison != 0) { - return lastComparison; + if (isSetSuccess()) { + lastComparison = TBaseHelper.compareTo(this.success, typedOther.success); + if (lastComparison != 0) { + return lastComparison; + } } - lastComparison = Boolean.valueOf(isSetIo()).compareTo(isSetIo()); + lastComparison = Boolean.valueOf(isSetIo()).compareTo(typedOther.isSetIo()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(io, typedOther.io); - if (lastComparison != 0) { - return lastComparison; + if (isSetIo()) { + lastComparison = TBaseHelper.compareTo(this.io, typedOther.io); + 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 SUCCESS: - if (field.type == TType.LIST) { + switch (field.id) { + case 0: // SUCCESS + if (field.type == TType.LIST) { + { + TList _list34 = iprot.readListBegin(); + this.success = new ArrayList(_list34.size); + for (int _i35 = 0; _i35 < _list34.size; ++_i35) { - TList _list34 = iprot.readListBegin(); - this.success = new ArrayList(_list34.size); - for (int _i35 = 0; _i35 < _list34.size; ++_i35) - { - TCell _elem36; - _elem36 = new TCell(); - _elem36.read(iprot); - this.success.add(_elem36); - } - iprot.readListEnd(); + TCell _elem36; + _elem36 = new TCell(); + _elem36.read(iprot); + this.success.add(_elem36); } - } else { - TProtocolUtil.skip(iprot, field.type); + iprot.readListEnd(); } - break; - case IO: - if (field.type == TType.STRUCT) { - this.io = new IOError(); - this.io.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); - } + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 1: // IO + if (field.type == TType.STRUCT) { + this.io = new IOError(); + this.io.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + } + iprot.readFieldEnd(); } iprot.readStructEnd(); @@ -12407,7 +14439,7 @@ public class Hbase { } - public static class getRow_args implements TBase, java.io.Serializable, Cloneable, Comparable { + public static class getRow_args implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("getRow_args"); private static final TField TABLE_NAME_FIELD_DESC = new TField("tableName", TType.STRING, (short)1); @@ -12416,11 +14448,11 @@ public class Hbase { /** * name of table */ - public byte[] tableName; + public ByteBuffer tableName; /** * row key */ - public byte[] row; + public ByteBuffer row; /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements TFieldIdEnum { @@ -12433,12 +14465,10 @@ public class Hbase { */ ROW((short)2, "row"); - 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); } } @@ -12447,7 +14477,14 @@ public class Hbase { * 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: // TABLE_NAME + return TABLE_NAME; + case 2: // ROW + return ROW; + default: + return null; + } } /** @@ -12486,14 +14523,14 @@ public class Hbase { // isset id assignments - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.TABLE_NAME, new FieldMetaData("tableName", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(_Fields.ROW, new FieldMetaData("row", 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.TABLE_NAME, new FieldMetaData("tableName", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING , "Text"))); + tmpMap.put(_Fields.ROW, new FieldMetaData("row", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING , "Text"))); + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(getRow_args.class, metaDataMap); } @@ -12501,8 +14538,8 @@ public class Hbase { } public getRow_args( - byte[] tableName, - byte[] row) + ByteBuffer tableName, + ByteBuffer row) { this(); this.tableName = tableName; @@ -12525,22 +14562,33 @@ public class Hbase { return new getRow_args(this); } - @Deprecated - public getRow_args clone() { - return new getRow_args(this); + @Override + public void clear() { + this.tableName = null; + this.row = null; } /** * name of table */ public byte[] getTableName() { - return this.tableName; + setTableName(TBaseHelper.rightSize(tableName)); + return tableName.array(); + } + + public ByteBuffer BufferForTableName() { + return tableName; } /** * name of table */ public getRow_args setTableName(byte[] tableName) { + setTableName(ByteBuffer.wrap(tableName)); + return this; + } + + public getRow_args setTableName(ByteBuffer tableName) { this.tableName = tableName; return this; } @@ -12564,13 +14612,23 @@ public class Hbase { * row key */ public byte[] getRow() { - return this.row; + setRow(TBaseHelper.rightSize(row)); + return row.array(); + } + + public ByteBuffer BufferForRow() { + return row; } /** * row key */ public getRow_args setRow(byte[] row) { + setRow(ByteBuffer.wrap(row)); + return this; + } + + public getRow_args setRow(ByteBuffer row) { this.row = row; return this; } @@ -12596,7 +14654,7 @@ public class Hbase { if (value == null) { unsetTableName(); } else { - setTableName((byte[])value); + setTableName((ByteBuffer)value); } break; @@ -12604,17 +14662,13 @@ public class Hbase { if (value == null) { unsetRow(); } else { - setRow((byte[])value); + setRow((ByteBuffer)value); } break; } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case TABLE_NAME: @@ -12627,12 +14681,12 @@ public class Hbase { 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 TABLE_NAME: return isSetTableName(); @@ -12642,10 +14696,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -12664,7 +14714,7 @@ public class Hbase { if (this_present_tableName || that_present_tableName) { if (!(this_present_tableName && that_present_tableName)) return false; - if (!java.util.Arrays.equals(this.tableName, that.tableName)) + if (!this.tableName.equals(that.tableName)) return false; } @@ -12673,7 +14723,7 @@ public class Hbase { 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; } @@ -12705,56 +14755,61 @@ public class Hbase { int lastComparison = 0; getRow_args typedOther = (getRow_args)other; - lastComparison = Boolean.valueOf(isSetTableName()).compareTo(isSetTableName()); + lastComparison = Boolean.valueOf(isSetTableName()).compareTo(typedOther.isSetTableName()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(tableName, typedOther.tableName); - if (lastComparison != 0) { - return lastComparison; + if (isSetTableName()) { + lastComparison = TBaseHelper.compareTo(this.tableName, typedOther.tableName); + if (lastComparison != 0) { + return lastComparison; + } } - 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; + } } 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 TABLE_NAME: - if (field.type == TType.STRING) { - this.tableName = iprot.readBinary(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case ROW: - if (field.type == TType.STRING) { - this.row = iprot.readBinary(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); - } + switch (field.id) { + case 1: // TABLE_NAME + if (field.type == TType.STRING) { + this.tableName = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 2: // ROW + if (field.type == TType.STRING) { + this.row = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + } + iprot.readFieldEnd(); } iprot.readStructEnd(); @@ -12810,7 +14865,7 @@ public class Hbase { } - public static class getRow_result implements TBase, java.io.Serializable, Cloneable { + public static class getRow_result implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("getRow_result"); private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0); @@ -12824,12 +14879,10 @@ public class Hbase { SUCCESS((short)0, "success"), IO((short)1, "io"); - 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); } } @@ -12838,7 +14891,14 @@ public class Hbase { * 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 0: // SUCCESS + return SUCCESS; + case 1: // IO + return IO; + default: + return null; + } } /** @@ -12877,15 +14937,15 @@ public class Hbase { // isset id assignments - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new ListMetaData(TType.LIST, + public static final Map<_Fields, FieldMetaData> metaDataMap; + static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + new ListMetaData(TType.LIST, new StructMetaData(TType.STRUCT, TRowResult.class)))); - put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); - }}); - - static { + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(getRow_result.class, metaDataMap); } @@ -12921,9 +14981,10 @@ public class Hbase { return new getRow_result(this); } - @Deprecated - public getRow_result clone() { - return new getRow_result(this); + @Override + public void clear() { + this.success = null; + this.io = null; } public int getSuccessSize() { @@ -13010,10 +15071,6 @@ public class Hbase { } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: @@ -13026,12 +15083,12 @@ public class Hbase { 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 SUCCESS: return isSetSuccess(); @@ -13041,10 +15098,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -13096,49 +15149,81 @@ public class Hbase { return builder.toHashCode(); } + public int compareTo(getRow_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + getRow_result typedOther = (getRow_result)other; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = TBaseHelper.compareTo(this.success, typedOther.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIo()).compareTo(typedOther.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = TBaseHelper.compareTo(this.io, typedOther.io); + 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 SUCCESS: - if (field.type == TType.LIST) { + switch (field.id) { + case 0: // SUCCESS + if (field.type == TType.LIST) { + { + TList _list38 = iprot.readListBegin(); + this.success = new ArrayList(_list38.size); + for (int _i39 = 0; _i39 < _list38.size; ++_i39) { - TList _list38 = iprot.readListBegin(); - this.success = new ArrayList(_list38.size); - for (int _i39 = 0; _i39 < _list38.size; ++_i39) - { - TRowResult _elem40; - _elem40 = new TRowResult(); - _elem40.read(iprot); - this.success.add(_elem40); - } - iprot.readListEnd(); + TRowResult _elem40; + _elem40 = new TRowResult(); + _elem40.read(iprot); + this.success.add(_elem40); } - } else { - TProtocolUtil.skip(iprot, field.type); + iprot.readListEnd(); } - break; - case IO: - if (field.type == TType.STRUCT) { - this.io = new IOError(); - this.io.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); - } + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 1: // IO + if (field.type == TType.STRUCT) { + this.io = new IOError(); + this.io.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + } + iprot.readFieldEnd(); } iprot.readStructEnd(); @@ -13199,7 +15284,7 @@ public class Hbase { } - public static class getRowWithColumns_args implements TBase, java.io.Serializable, Cloneable, Comparable { + public static class getRowWithColumns_args implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("getRowWithColumns_args"); private static final TField TABLE_NAME_FIELD_DESC = new TField("tableName", TType.STRING, (short)1); @@ -13209,15 +15294,15 @@ public class Hbase { /** * name of table */ - public byte[] tableName; + public ByteBuffer tableName; /** * row key */ - public byte[] row; + public ByteBuffer row; /** * List of columns to return, null for all columns */ - public List columns; + public List columns; /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements TFieldIdEnum { @@ -13234,12 +15319,10 @@ public class Hbase { */ COLUMNS((short)3, "columns"); - 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); } } @@ -13248,7 +15331,16 @@ public class Hbase { * 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: // TABLE_NAME + return TABLE_NAME; + case 2: // ROW + return ROW; + case 3: // COLUMNS + return COLUMNS; + default: + return null; + } } /** @@ -13287,17 +15379,17 @@ public class Hbase { // isset id assignments - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.TABLE_NAME, new FieldMetaData("tableName", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(_Fields.ROW, new FieldMetaData("row", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(_Fields.COLUMNS, new FieldMetaData("columns", TFieldRequirementType.DEFAULT, - new ListMetaData(TType.LIST, - 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.TABLE_NAME, new FieldMetaData("tableName", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING , "Text"))); + tmpMap.put(_Fields.ROW, new FieldMetaData("row", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING , "Text"))); + tmpMap.put(_Fields.COLUMNS, new FieldMetaData("columns", TFieldRequirementType.DEFAULT, + new ListMetaData(TType.LIST, + new FieldValueMetaData(TType.STRING , "Text")))); + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(getRowWithColumns_args.class, metaDataMap); } @@ -13305,9 +15397,9 @@ public class Hbase { } public getRowWithColumns_args( - byte[] tableName, - byte[] row, - List columns) + ByteBuffer tableName, + ByteBuffer row, + List columns) { this(); this.tableName = tableName; @@ -13326,8 +15418,8 @@ public class Hbase { this.row = other.row; } if (other.isSetColumns()) { - List __this__columns = new ArrayList(); - for (byte[] other_element : other.columns) { + List __this__columns = new ArrayList(); + for (ByteBuffer other_element : other.columns) { __this__columns.add(other_element); } this.columns = __this__columns; @@ -13338,22 +15430,34 @@ public class Hbase { return new getRowWithColumns_args(this); } - @Deprecated - public getRowWithColumns_args clone() { - return new getRowWithColumns_args(this); + @Override + public void clear() { + this.tableName = null; + this.row = null; + this.columns = null; } /** * name of table */ public byte[] getTableName() { - return this.tableName; + setTableName(TBaseHelper.rightSize(tableName)); + return tableName.array(); + } + + public ByteBuffer BufferForTableName() { + return tableName; } /** * name of table */ public getRowWithColumns_args setTableName(byte[] tableName) { + setTableName(ByteBuffer.wrap(tableName)); + return this; + } + + public getRowWithColumns_args setTableName(ByteBuffer tableName) { this.tableName = tableName; return this; } @@ -13377,13 +15481,23 @@ public class Hbase { * row key */ public byte[] getRow() { - return this.row; + setRow(TBaseHelper.rightSize(row)); + return row.array(); + } + + public ByteBuffer BufferForRow() { + return row; } /** * row key */ public getRowWithColumns_args setRow(byte[] row) { + setRow(ByteBuffer.wrap(row)); + return this; + } + + public getRowWithColumns_args setRow(ByteBuffer row) { this.row = row; return this; } @@ -13407,13 +15521,13 @@ public class Hbase { return (this.columns == null) ? 0 : this.columns.size(); } - public java.util.Iterator getColumnsIterator() { + public java.util.Iterator getColumnsIterator() { return (this.columns == null) ? null : this.columns.iterator(); } - public void addToColumns(byte[] elem) { + public void addToColumns(ByteBuffer elem) { if (this.columns == null) { - this.columns = new ArrayList(); + this.columns = new ArrayList(); } this.columns.add(elem); } @@ -13421,14 +15535,14 @@ public class Hbase { /** * List of columns to return, null for all columns */ - public List getColumns() { + public List getColumns() { return this.columns; } /** * List of columns to return, null for all columns */ - public getRowWithColumns_args setColumns(List columns) { + public getRowWithColumns_args setColumns(List columns) { this.columns = columns; return this; } @@ -13454,7 +15568,7 @@ public class Hbase { if (value == null) { unsetTableName(); } else { - setTableName((byte[])value); + setTableName((ByteBuffer)value); } break; @@ -13462,7 +15576,7 @@ public class Hbase { if (value == null) { unsetRow(); } else { - setRow((byte[])value); + setRow((ByteBuffer)value); } break; @@ -13470,17 +15584,13 @@ public class Hbase { if (value == null) { unsetColumns(); } else { - setColumns((List)value); + setColumns((List)value); } break; } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case TABLE_NAME: @@ -13496,12 +15606,12 @@ public class Hbase { 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 TABLE_NAME: return isSetTableName(); @@ -13513,10 +15623,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -13535,7 +15641,7 @@ public class Hbase { if (this_present_tableName || that_present_tableName) { if (!(this_present_tableName && that_present_tableName)) return false; - if (!java.util.Arrays.equals(this.tableName, that.tableName)) + if (!this.tableName.equals(that.tableName)) return false; } @@ -13544,7 +15650,7 @@ public class Hbase { 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; } @@ -13590,81 +15696,88 @@ public class Hbase { int lastComparison = 0; getRowWithColumns_args typedOther = (getRowWithColumns_args)other; - lastComparison = Boolean.valueOf(isSetTableName()).compareTo(isSetTableName()); + lastComparison = Boolean.valueOf(isSetTableName()).compareTo(typedOther.isSetTableName()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(tableName, typedOther.tableName); - if (lastComparison != 0) { - return lastComparison; + if (isSetTableName()) { + lastComparison = TBaseHelper.compareTo(this.tableName, typedOther.tableName); + if (lastComparison != 0) { + return lastComparison; + } } - 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(isSetColumns()).compareTo(isSetColumns()); + lastComparison = Boolean.valueOf(isSetColumns()).compareTo(typedOther.isSetColumns()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(columns, typedOther.columns); - if (lastComparison != 0) { - return lastComparison; + if (isSetColumns()) { + lastComparison = TBaseHelper.compareTo(this.columns, typedOther.columns); + 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 TABLE_NAME: - if (field.type == TType.STRING) { - this.tableName = iprot.readBinary(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case ROW: - if (field.type == TType.STRING) { - this.row = iprot.readBinary(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case COLUMNS: - if (field.type == TType.LIST) { + switch (field.id) { + case 1: // TABLE_NAME + if (field.type == TType.STRING) { + this.tableName = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 2: // ROW + if (field.type == TType.STRING) { + this.row = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 3: // COLUMNS + if (field.type == TType.LIST) { + { + TList _list42 = iprot.readListBegin(); + this.columns = new ArrayList(_list42.size); + for (int _i43 = 0; _i43 < _list42.size; ++_i43) { - TList _list42 = iprot.readListBegin(); - this.columns = new ArrayList(_list42.size); - for (int _i43 = 0; _i43 < _list42.size; ++_i43) - { - byte[] _elem44; - _elem44 = iprot.readBinary(); - this.columns.add(_elem44); - } - iprot.readListEnd(); + ByteBuffer _elem44; + _elem44 = iprot.readBinary(); + this.columns.add(_elem44); } - } 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(); @@ -13690,7 +15803,7 @@ public class Hbase { oprot.writeFieldBegin(COLUMNS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRING, this.columns.size())); - for (byte[] _iter45 : this.columns) + for (ByteBuffer _iter45 : this.columns) { oprot.writeBinary(_iter45); } @@ -13740,7 +15853,7 @@ public class Hbase { } - public static class getRowWithColumns_result implements TBase, java.io.Serializable, Cloneable { + public static class getRowWithColumns_result implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("getRowWithColumns_result"); private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0); @@ -13754,12 +15867,10 @@ public class Hbase { SUCCESS((short)0, "success"), IO((short)1, "io"); - 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); } } @@ -13768,7 +15879,14 @@ public class Hbase { * 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 0: // SUCCESS + return SUCCESS; + case 1: // IO + return IO; + default: + return null; + } } /** @@ -13807,15 +15925,15 @@ public class Hbase { // isset id assignments - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new ListMetaData(TType.LIST, + public static final Map<_Fields, FieldMetaData> metaDataMap; + static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + new ListMetaData(TType.LIST, new StructMetaData(TType.STRUCT, TRowResult.class)))); - put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); - }}); - - static { + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(getRowWithColumns_result.class, metaDataMap); } @@ -13851,9 +15969,10 @@ public class Hbase { return new getRowWithColumns_result(this); } - @Deprecated - public getRowWithColumns_result clone() { - return new getRowWithColumns_result(this); + @Override + public void clear() { + this.success = null; + this.io = null; } public int getSuccessSize() { @@ -13940,10 +16059,6 @@ public class Hbase { } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: @@ -13956,12 +16071,12 @@ public class Hbase { 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 SUCCESS: return isSetSuccess(); @@ -13971,10 +16086,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -14026,49 +16137,81 @@ public class Hbase { return builder.toHashCode(); } + public int compareTo(getRowWithColumns_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + getRowWithColumns_result typedOther = (getRowWithColumns_result)other; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = TBaseHelper.compareTo(this.success, typedOther.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIo()).compareTo(typedOther.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = TBaseHelper.compareTo(this.io, typedOther.io); + 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 SUCCESS: - if (field.type == TType.LIST) { + switch (field.id) { + case 0: // SUCCESS + if (field.type == TType.LIST) { + { + TList _list46 = iprot.readListBegin(); + this.success = new ArrayList(_list46.size); + for (int _i47 = 0; _i47 < _list46.size; ++_i47) { - TList _list46 = iprot.readListBegin(); - this.success = new ArrayList(_list46.size); - for (int _i47 = 0; _i47 < _list46.size; ++_i47) - { - TRowResult _elem48; - _elem48 = new TRowResult(); - _elem48.read(iprot); - this.success.add(_elem48); - } - iprot.readListEnd(); + TRowResult _elem48; + _elem48 = new TRowResult(); + _elem48.read(iprot); + this.success.add(_elem48); } - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case IO: - if (field.type == TType.STRUCT) { - this.io = new IOError(); - this.io.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); + iprot.readListEnd(); } - break; - } - iprot.readFieldEnd(); - } + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 1: // IO + if (field.type == TType.STRUCT) { + this.io = new IOError(); + this.io.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + } + iprot.readFieldEnd(); } iprot.readStructEnd(); @@ -14129,7 +16272,7 @@ public class Hbase { } - public static class getRowTs_args implements TBase, java.io.Serializable, Cloneable, Comparable { + public static class getRowTs_args implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("getRowTs_args"); private static final TField TABLE_NAME_FIELD_DESC = new TField("tableName", TType.STRING, (short)1); @@ -14139,11 +16282,11 @@ public class Hbase { /** * name of the table */ - public byte[] tableName; + public ByteBuffer tableName; /** * row key */ - public byte[] row; + public ByteBuffer row; /** * timestamp */ @@ -14164,12 +16307,10 @@ public class Hbase { */ TIMESTAMP((short)3, "timestamp"); - 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); } } @@ -14178,7 +16319,16 @@ public class Hbase { * 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: // TABLE_NAME + return TABLE_NAME; + case 2: // ROW + return ROW; + case 3: // TIMESTAMP + return TIMESTAMP; + default: + return null; + } } /** @@ -14219,16 +16369,16 @@ public class Hbase { private static final int __TIMESTAMP_ISSET_ID = 0; private BitSet __isset_bit_vector = new BitSet(1); - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.TABLE_NAME, new FieldMetaData("tableName", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(_Fields.ROW, new FieldMetaData("row", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(_Fields.TIMESTAMP, new FieldMetaData("timestamp", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.I64))); - }}); - + public static final Map<_Fields, FieldMetaData> metaDataMap; static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.TABLE_NAME, new FieldMetaData("tableName", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING , "Text"))); + tmpMap.put(_Fields.ROW, new FieldMetaData("row", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING , "Text"))); + tmpMap.put(_Fields.TIMESTAMP, new FieldMetaData("timestamp", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.I64))); + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(getRowTs_args.class, metaDataMap); } @@ -14236,8 +16386,8 @@ public class Hbase { } public getRowTs_args( - byte[] tableName, - byte[] row, + ByteBuffer tableName, + ByteBuffer row, long timestamp) { this(); @@ -14266,22 +16416,35 @@ public class Hbase { return new getRowTs_args(this); } - @Deprecated - public getRowTs_args clone() { - return new getRowTs_args(this); + @Override + public void clear() { + this.tableName = null; + this.row = null; + setTimestampIsSet(false); + this.timestamp = 0; } /** * name of the table */ public byte[] getTableName() { - return this.tableName; + setTableName(TBaseHelper.rightSize(tableName)); + return tableName.array(); + } + + public ByteBuffer BufferForTableName() { + return tableName; } /** * name of the table */ public getRowTs_args setTableName(byte[] tableName) { + setTableName(ByteBuffer.wrap(tableName)); + return this; + } + + public getRowTs_args setTableName(ByteBuffer tableName) { this.tableName = tableName; return this; } @@ -14305,13 +16468,23 @@ public class Hbase { * row key */ public byte[] getRow() { - return this.row; + setRow(TBaseHelper.rightSize(row)); + return row.array(); + } + + public ByteBuffer BufferForRow() { + return row; } /** * row key */ public getRowTs_args setRow(byte[] row) { + setRow(ByteBuffer.wrap(row)); + return this; + } + + public getRowTs_args setRow(ByteBuffer row) { this.row = row; return this; } @@ -14366,7 +16539,7 @@ public class Hbase { if (value == null) { unsetTableName(); } else { - setTableName((byte[])value); + setTableName((ByteBuffer)value); } break; @@ -14374,7 +16547,7 @@ public class Hbase { if (value == null) { unsetRow(); } else { - setRow((byte[])value); + setRow((ByteBuffer)value); } break; @@ -14389,10 +16562,6 @@ public class Hbase { } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case TABLE_NAME: @@ -14408,12 +16577,12 @@ public class Hbase { 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 TABLE_NAME: return isSetTableName(); @@ -14425,10 +16594,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -14447,7 +16612,7 @@ public class Hbase { if (this_present_tableName || that_present_tableName) { if (!(this_present_tableName && that_present_tableName)) return false; - if (!java.util.Arrays.equals(this.tableName, that.tableName)) + if (!this.tableName.equals(that.tableName)) return false; } @@ -14456,7 +16621,7 @@ public class Hbase { 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; } @@ -14502,72 +16667,79 @@ public class Hbase { int lastComparison = 0; getRowTs_args typedOther = (getRowTs_args)other; - lastComparison = Boolean.valueOf(isSetTableName()).compareTo(isSetTableName()); + lastComparison = Boolean.valueOf(isSetTableName()).compareTo(typedOther.isSetTableName()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(tableName, typedOther.tableName); - if (lastComparison != 0) { - return lastComparison; + if (isSetTableName()) { + lastComparison = TBaseHelper.compareTo(this.tableName, typedOther.tableName); + if (lastComparison != 0) { + return lastComparison; + } } - 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(isSetTimestamp()).compareTo(isSetTimestamp()); + lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(typedOther.isSetTimestamp()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(timestamp, typedOther.timestamp); - if (lastComparison != 0) { - return lastComparison; + if (isSetTimestamp()) { + lastComparison = TBaseHelper.compareTo(this.timestamp, typedOther.timestamp); + 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 TABLE_NAME: - if (field.type == TType.STRING) { - this.tableName = iprot.readBinary(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case ROW: - if (field.type == TType.STRING) { - this.row = iprot.readBinary(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case TIMESTAMP: - if (field.type == TType.I64) { - this.timestamp = iprot.readI64(); - setTimestampIsSet(true); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); - } + switch (field.id) { + case 1: // TABLE_NAME + if (field.type == TType.STRING) { + this.tableName = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 2: // ROW + if (field.type == TType.STRING) { + this.row = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 3: // TIMESTAMP + if (field.type == TType.I64) { + this.timestamp = iprot.readI64(); + setTimestampIsSet(true); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + } + iprot.readFieldEnd(); } iprot.readStructEnd(); @@ -14630,7 +16802,7 @@ public class Hbase { } - public static class getRowTs_result implements TBase, java.io.Serializable, Cloneable { + public static class getRowTs_result implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("getRowTs_result"); private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0); @@ -14644,12 +16816,10 @@ public class Hbase { SUCCESS((short)0, "success"), IO((short)1, "io"); - 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); } } @@ -14658,7 +16828,14 @@ public class Hbase { * 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 0: // SUCCESS + return SUCCESS; + case 1: // IO + return IO; + default: + return null; + } } /** @@ -14697,15 +16874,15 @@ public class Hbase { // isset id assignments - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new ListMetaData(TType.LIST, + public static final Map<_Fields, FieldMetaData> metaDataMap; + static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + new ListMetaData(TType.LIST, new StructMetaData(TType.STRUCT, TRowResult.class)))); - put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); - }}); - - static { + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(getRowTs_result.class, metaDataMap); } @@ -14741,9 +16918,10 @@ public class Hbase { return new getRowTs_result(this); } - @Deprecated - public getRowTs_result clone() { - return new getRowTs_result(this); + @Override + public void clear() { + this.success = null; + this.io = null; } public int getSuccessSize() { @@ -14830,10 +17008,6 @@ public class Hbase { } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: @@ -14846,12 +17020,12 @@ public class Hbase { 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 SUCCESS: return isSetSuccess(); @@ -14861,10 +17035,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -14916,49 +17086,81 @@ public class Hbase { return builder.toHashCode(); } + public int compareTo(getRowTs_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + getRowTs_result typedOther = (getRowTs_result)other; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = TBaseHelper.compareTo(this.success, typedOther.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIo()).compareTo(typedOther.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = TBaseHelper.compareTo(this.io, typedOther.io); + 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 SUCCESS: - if (field.type == TType.LIST) { + switch (field.id) { + case 0: // SUCCESS + if (field.type == TType.LIST) { + { + TList _list50 = iprot.readListBegin(); + this.success = new ArrayList(_list50.size); + for (int _i51 = 0; _i51 < _list50.size; ++_i51) { - TList _list50 = iprot.readListBegin(); - this.success = new ArrayList(_list50.size); - for (int _i51 = 0; _i51 < _list50.size; ++_i51) - { - TRowResult _elem52; - _elem52 = new TRowResult(); - _elem52.read(iprot); - this.success.add(_elem52); - } - iprot.readListEnd(); + TRowResult _elem52; + _elem52 = new TRowResult(); + _elem52.read(iprot); + this.success.add(_elem52); } - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case IO: - if (field.type == TType.STRUCT) { - this.io = new IOError(); - this.io.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); + iprot.readListEnd(); } - break; - } - iprot.readFieldEnd(); - } + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 1: // IO + if (field.type == TType.STRUCT) { + this.io = new IOError(); + this.io.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + } + iprot.readFieldEnd(); } iprot.readStructEnd(); @@ -15019,7 +17221,7 @@ public class Hbase { } - public static class getRowWithColumnsTs_args implements TBase, java.io.Serializable, Cloneable, Comparable { + public static class getRowWithColumnsTs_args implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("getRowWithColumnsTs_args"); private static final TField TABLE_NAME_FIELD_DESC = new TField("tableName", TType.STRING, (short)1); @@ -15030,15 +17232,15 @@ public class Hbase { /** * name of table */ - public byte[] tableName; + public ByteBuffer tableName; /** * row key */ - public byte[] row; + public ByteBuffer row; /** * List of columns to return, null for all columns */ - public List columns; + public List columns; public long timestamp; /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -15057,12 +17259,10 @@ public class Hbase { COLUMNS((short)3, "columns"), TIMESTAMP((short)4, "timestamp"); - 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); } } @@ -15071,7 +17271,18 @@ public class Hbase { * 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: // TABLE_NAME + return TABLE_NAME; + case 2: // ROW + return ROW; + case 3: // COLUMNS + return COLUMNS; + case 4: // TIMESTAMP + return TIMESTAMP; + default: + return null; + } } /** @@ -15112,19 +17323,19 @@ public class Hbase { private static final int __TIMESTAMP_ISSET_ID = 0; private BitSet __isset_bit_vector = new BitSet(1); - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.TABLE_NAME, new FieldMetaData("tableName", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(_Fields.ROW, new FieldMetaData("row", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(_Fields.COLUMNS, new FieldMetaData("columns", TFieldRequirementType.DEFAULT, - new ListMetaData(TType.LIST, - new FieldValueMetaData(TType.STRING)))); - put(_Fields.TIMESTAMP, new FieldMetaData("timestamp", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.I64))); - }}); - + public static final Map<_Fields, FieldMetaData> metaDataMap; static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.TABLE_NAME, new FieldMetaData("tableName", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING , "Text"))); + tmpMap.put(_Fields.ROW, new FieldMetaData("row", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING , "Text"))); + tmpMap.put(_Fields.COLUMNS, new FieldMetaData("columns", TFieldRequirementType.DEFAULT, + new ListMetaData(TType.LIST, + new FieldValueMetaData(TType.STRING , "Text")))); + tmpMap.put(_Fields.TIMESTAMP, new FieldMetaData("timestamp", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.I64))); + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(getRowWithColumnsTs_args.class, metaDataMap); } @@ -15132,9 +17343,9 @@ public class Hbase { } public getRowWithColumnsTs_args( - byte[] tableName, - byte[] row, - List columns, + ByteBuffer tableName, + ByteBuffer row, + List columns, long timestamp) { this(); @@ -15158,8 +17369,8 @@ public class Hbase { this.row = other.row; } if (other.isSetColumns()) { - List __this__columns = new ArrayList(); - for (byte[] other_element : other.columns) { + List __this__columns = new ArrayList(); + for (ByteBuffer other_element : other.columns) { __this__columns.add(other_element); } this.columns = __this__columns; @@ -15171,22 +17382,36 @@ public class Hbase { return new getRowWithColumnsTs_args(this); } - @Deprecated - public getRowWithColumnsTs_args clone() { - return new getRowWithColumnsTs_args(this); + @Override + public void clear() { + this.tableName = null; + this.row = null; + this.columns = null; + setTimestampIsSet(false); + this.timestamp = 0; } /** * name of table */ public byte[] getTableName() { - return this.tableName; + setTableName(TBaseHelper.rightSize(tableName)); + return tableName.array(); + } + + public ByteBuffer BufferForTableName() { + return tableName; } /** * name of table */ public getRowWithColumnsTs_args setTableName(byte[] tableName) { + setTableName(ByteBuffer.wrap(tableName)); + return this; + } + + public getRowWithColumnsTs_args setTableName(ByteBuffer tableName) { this.tableName = tableName; return this; } @@ -15210,13 +17435,23 @@ public class Hbase { * row key */ public byte[] getRow() { - return this.row; + setRow(TBaseHelper.rightSize(row)); + return row.array(); + } + + public ByteBuffer BufferForRow() { + return row; } /** * row key */ public getRowWithColumnsTs_args setRow(byte[] row) { + setRow(ByteBuffer.wrap(row)); + return this; + } + + public getRowWithColumnsTs_args setRow(ByteBuffer row) { this.row = row; return this; } @@ -15240,13 +17475,13 @@ public class Hbase { return (this.columns == null) ? 0 : this.columns.size(); } - public java.util.Iterator getColumnsIterator() { + public java.util.Iterator getColumnsIterator() { return (this.columns == null) ? null : this.columns.iterator(); } - public void addToColumns(byte[] elem) { + public void addToColumns(ByteBuffer elem) { if (this.columns == null) { - this.columns = new ArrayList(); + this.columns = new ArrayList(); } this.columns.add(elem); } @@ -15254,14 +17489,14 @@ public class Hbase { /** * List of columns to return, null for all columns */ - public List getColumns() { + public List getColumns() { return this.columns; } /** * List of columns to return, null for all columns */ - public getRowWithColumnsTs_args setColumns(List columns) { + public getRowWithColumnsTs_args setColumns(List columns) { this.columns = columns; return this; } @@ -15310,7 +17545,7 @@ public class Hbase { if (value == null) { unsetTableName(); } else { - setTableName((byte[])value); + setTableName((ByteBuffer)value); } break; @@ -15318,7 +17553,7 @@ public class Hbase { if (value == null) { unsetRow(); } else { - setRow((byte[])value); + setRow((ByteBuffer)value); } break; @@ -15326,7 +17561,7 @@ public class Hbase { if (value == null) { unsetColumns(); } else { - setColumns((List)value); + setColumns((List)value); } break; @@ -15341,10 +17576,6 @@ public class Hbase { } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case TABLE_NAME: @@ -15363,12 +17594,12 @@ public class Hbase { 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 TABLE_NAME: return isSetTableName(); @@ -15382,10 +17613,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -15404,7 +17631,7 @@ public class Hbase { if (this_present_tableName || that_present_tableName) { if (!(this_present_tableName && that_present_tableName)) return false; - if (!java.util.Arrays.equals(this.tableName, that.tableName)) + if (!this.tableName.equals(that.tableName)) return false; } @@ -15413,7 +17640,7 @@ public class Hbase { 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; } @@ -15473,97 +17700,106 @@ public class Hbase { int lastComparison = 0; getRowWithColumnsTs_args typedOther = (getRowWithColumnsTs_args)other; - lastComparison = Boolean.valueOf(isSetTableName()).compareTo(isSetTableName()); + lastComparison = Boolean.valueOf(isSetTableName()).compareTo(typedOther.isSetTableName()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(tableName, typedOther.tableName); - if (lastComparison != 0) { - return lastComparison; + if (isSetTableName()) { + lastComparison = TBaseHelper.compareTo(this.tableName, typedOther.tableName); + if (lastComparison != 0) { + return lastComparison; + } } - 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(isSetColumns()).compareTo(isSetColumns()); + lastComparison = Boolean.valueOf(isSetColumns()).compareTo(typedOther.isSetColumns()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(columns, typedOther.columns); - if (lastComparison != 0) { - return lastComparison; + if (isSetColumns()) { + lastComparison = TBaseHelper.compareTo(this.columns, typedOther.columns); + if (lastComparison != 0) { + return lastComparison; + } } - lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(isSetTimestamp()); + lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(typedOther.isSetTimestamp()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(timestamp, typedOther.timestamp); - if (lastComparison != 0) { - return lastComparison; + if (isSetTimestamp()) { + lastComparison = TBaseHelper.compareTo(this.timestamp, typedOther.timestamp); + 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 TABLE_NAME: - if (field.type == TType.STRING) { - this.tableName = iprot.readBinary(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case ROW: - if (field.type == TType.STRING) { - this.row = iprot.readBinary(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case COLUMNS: - if (field.type == TType.LIST) { + switch (field.id) { + case 1: // TABLE_NAME + if (field.type == TType.STRING) { + this.tableName = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 2: // ROW + if (field.type == TType.STRING) { + this.row = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 3: // COLUMNS + if (field.type == TType.LIST) { + { + TList _list54 = iprot.readListBegin(); + this.columns = new ArrayList(_list54.size); + for (int _i55 = 0; _i55 < _list54.size; ++_i55) { - TList _list54 = iprot.readListBegin(); - this.columns = new ArrayList(_list54.size); - for (int _i55 = 0; _i55 < _list54.size; ++_i55) - { - byte[] _elem56; - _elem56 = iprot.readBinary(); - this.columns.add(_elem56); - } - iprot.readListEnd(); + ByteBuffer _elem56; + _elem56 = iprot.readBinary(); + this.columns.add(_elem56); } - } else { - TProtocolUtil.skip(iprot, field.type); + iprot.readListEnd(); } - break; - case TIMESTAMP: - if (field.type == TType.I64) { - this.timestamp = iprot.readI64(); - setTimestampIsSet(true); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); - } + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 4: // TIMESTAMP + if (field.type == TType.I64) { + this.timestamp = iprot.readI64(); + setTimestampIsSet(true); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + } + iprot.readFieldEnd(); } iprot.readStructEnd(); @@ -15589,7 +17825,7 @@ public class Hbase { oprot.writeFieldBegin(COLUMNS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRING, this.columns.size())); - for (byte[] _iter57 : this.columns) + for (ByteBuffer _iter57 : this.columns) { oprot.writeBinary(_iter57); } @@ -15646,7 +17882,7 @@ public class Hbase { } - public static class getRowWithColumnsTs_result implements TBase, java.io.Serializable, Cloneable { + public static class getRowWithColumnsTs_result implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("getRowWithColumnsTs_result"); private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0); @@ -15660,12 +17896,10 @@ public class Hbase { SUCCESS((short)0, "success"), IO((short)1, "io"); - 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); } } @@ -15674,7 +17908,14 @@ public class Hbase { * 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 0: // SUCCESS + return SUCCESS; + case 1: // IO + return IO; + default: + return null; + } } /** @@ -15713,15 +17954,15 @@ public class Hbase { // isset id assignments - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new ListMetaData(TType.LIST, + public static final Map<_Fields, FieldMetaData> metaDataMap; + static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + new ListMetaData(TType.LIST, new StructMetaData(TType.STRUCT, TRowResult.class)))); - put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); - }}); - - static { + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(getRowWithColumnsTs_result.class, metaDataMap); } @@ -15757,9 +17998,10 @@ public class Hbase { return new getRowWithColumnsTs_result(this); } - @Deprecated - public getRowWithColumnsTs_result clone() { - return new getRowWithColumnsTs_result(this); + @Override + public void clear() { + this.success = null; + this.io = null; } public int getSuccessSize() { @@ -15846,10 +18088,6 @@ public class Hbase { } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: @@ -15862,12 +18100,12 @@ public class Hbase { 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 SUCCESS: return isSetSuccess(); @@ -15877,10 +18115,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -15932,49 +18166,81 @@ public class Hbase { return builder.toHashCode(); } + public int compareTo(getRowWithColumnsTs_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + getRowWithColumnsTs_result typedOther = (getRowWithColumnsTs_result)other; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = TBaseHelper.compareTo(this.success, typedOther.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIo()).compareTo(typedOther.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = TBaseHelper.compareTo(this.io, typedOther.io); + 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 SUCCESS: - if (field.type == TType.LIST) { + switch (field.id) { + case 0: // SUCCESS + if (field.type == TType.LIST) { + { + TList _list58 = iprot.readListBegin(); + this.success = new ArrayList(_list58.size); + for (int _i59 = 0; _i59 < _list58.size; ++_i59) { - TList _list58 = iprot.readListBegin(); - this.success = new ArrayList(_list58.size); - for (int _i59 = 0; _i59 < _list58.size; ++_i59) - { - TRowResult _elem60; - _elem60 = new TRowResult(); - _elem60.read(iprot); - this.success.add(_elem60); - } - iprot.readListEnd(); + TRowResult _elem60; + _elem60 = new TRowResult(); + _elem60.read(iprot); + this.success.add(_elem60); } - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case IO: - if (field.type == TType.STRUCT) { - this.io = new IOError(); - this.io.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); + iprot.readListEnd(); } - break; - } - iprot.readFieldEnd(); - } + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 1: // IO + if (field.type == TType.STRUCT) { + this.io = new IOError(); + this.io.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + } + iprot.readFieldEnd(); } iprot.readStructEnd(); @@ -16035,7 +18301,7 @@ public class Hbase { } - public static class mutateRow_args implements TBase, java.io.Serializable, Cloneable, Comparable { + public static class mutateRow_args implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("mutateRow_args"); private static final TField TABLE_NAME_FIELD_DESC = new TField("tableName", TType.STRING, (short)1); @@ -16045,11 +18311,11 @@ public class Hbase { /** * name of table */ - public byte[] tableName; + public ByteBuffer tableName; /** * row key */ - public byte[] row; + public ByteBuffer row; /** * list of mutation commands */ @@ -16070,12 +18336,10 @@ public class Hbase { */ MUTATIONS((short)3, "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); } } @@ -16084,7 +18348,16 @@ public class Hbase { * 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: // TABLE_NAME + return TABLE_NAME; + case 2: // ROW + return ROW; + case 3: // MUTATIONS + return MUTATIONS; + default: + return null; + } } /** @@ -16123,17 +18396,17 @@ public class Hbase { // isset id assignments - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.TABLE_NAME, new FieldMetaData("tableName", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - 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.TABLE_NAME, new FieldMetaData("tableName", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING , "Text"))); + 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(mutateRow_args.class, metaDataMap); } @@ -16141,8 +18414,8 @@ public class Hbase { } public mutateRow_args( - byte[] tableName, - byte[] row, + ByteBuffer tableName, + ByteBuffer row, List mutations) { this(); @@ -16174,22 +18447,34 @@ public class Hbase { return new mutateRow_args(this); } - @Deprecated - public mutateRow_args clone() { - return new mutateRow_args(this); + @Override + public void clear() { + this.tableName = null; + this.row = null; + this.mutations = null; } /** * name of table */ public byte[] getTableName() { - return this.tableName; + setTableName(TBaseHelper.rightSize(tableName)); + return tableName.array(); + } + + public ByteBuffer BufferForTableName() { + return tableName; } /** * name of table */ public mutateRow_args setTableName(byte[] tableName) { + setTableName(ByteBuffer.wrap(tableName)); + return this; + } + + public mutateRow_args setTableName(ByteBuffer tableName) { this.tableName = tableName; return this; } @@ -16213,13 +18498,23 @@ public class Hbase { * row key */ public byte[] getRow() { - return this.row; + setRow(TBaseHelper.rightSize(row)); + return row.array(); + } + + public ByteBuffer BufferForRow() { + return row; } /** * row key */ public mutateRow_args setRow(byte[] row) { + setRow(ByteBuffer.wrap(row)); + return this; + } + + public mutateRow_args setRow(ByteBuffer row) { this.row = row; return this; } @@ -16290,7 +18585,7 @@ public class Hbase { if (value == null) { unsetTableName(); } else { - setTableName((byte[])value); + setTableName((ByteBuffer)value); } break; @@ -16298,7 +18593,7 @@ public class Hbase { if (value == null) { unsetRow(); } else { - setRow((byte[])value); + setRow((ByteBuffer)value); } break; @@ -16313,10 +18608,6 @@ public class Hbase { } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case TABLE_NAME: @@ -16332,12 +18623,12 @@ public class Hbase { 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 TABLE_NAME: return isSetTableName(); @@ -16349,10 +18640,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -16371,7 +18658,7 @@ public class Hbase { if (this_present_tableName || that_present_tableName) { if (!(this_present_tableName && that_present_tableName)) return false; - if (!java.util.Arrays.equals(this.tableName, that.tableName)) + if (!this.tableName.equals(that.tableName)) return false; } @@ -16380,7 +18667,7 @@ public class Hbase { 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; } @@ -16426,82 +18713,89 @@ public class Hbase { int lastComparison = 0; mutateRow_args typedOther = (mutateRow_args)other; - lastComparison = Boolean.valueOf(isSetTableName()).compareTo(isSetTableName()); + lastComparison = Boolean.valueOf(isSetTableName()).compareTo(typedOther.isSetTableName()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(tableName, typedOther.tableName); - if (lastComparison != 0) { - return lastComparison; + if (isSetTableName()) { + lastComparison = TBaseHelper.compareTo(this.tableName, typedOther.tableName); + if (lastComparison != 0) { + return lastComparison; + } } - 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 TABLE_NAME: - if (field.type == TType.STRING) { - this.tableName = iprot.readBinary(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - 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: // TABLE_NAME + if (field.type == TType.STRING) { + this.tableName = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 2: // ROW + if (field.type == TType.STRING) { + this.row = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 3: // MUTATIONS + if (field.type == TType.LIST) { + { + TList _list62 = iprot.readListBegin(); + this.mutations = new ArrayList(_list62.size); + for (int _i63 = 0; _i63 < _list62.size; ++_i63) { - TList _list62 = iprot.readListBegin(); - this.mutations = new ArrayList(_list62.size); - for (int _i63 = 0; _i63 < _list62.size; ++_i63) - { - Mutation _elem64; - _elem64 = new Mutation(); - _elem64.read(iprot); - this.mutations.add(_elem64); - } - iprot.readListEnd(); + Mutation _elem64; + _elem64 = new Mutation(); + _elem64.read(iprot); + this.mutations.add(_elem64); } - } 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(); @@ -16577,7 +18871,7 @@ public class Hbase { } - public static class mutateRow_result implements TBase, java.io.Serializable, Cloneable, Comparable { + public static class mutateRow_result implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("mutateRow_result"); private static final TField IO_FIELD_DESC = new TField("io", TType.STRUCT, (short)1); @@ -16591,12 +18885,10 @@ public class Hbase { IO((short)1, "io"), IA((short)2, "ia"); - 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); } } @@ -16605,7 +18897,14 @@ public class Hbase { * 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: // IO + return IO; + case 2: // IA + return IA; + default: + return null; + } } /** @@ -16644,14 +18943,14 @@ public class Hbase { // isset id assignments - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, + public static final Map<_Fields, FieldMetaData> metaDataMap; + static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); - put(_Fields.IA, new FieldMetaData("ia", TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.IA, new FieldMetaData("ia", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); - }}); - - static { + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(mutateRow_result.class, metaDataMap); } @@ -16683,9 +18982,10 @@ public class Hbase { return new mutateRow_result(this); } - @Deprecated - public mutateRow_result clone() { - return new mutateRow_result(this); + @Override + public void clear() { + this.io = null; + this.ia = null; } public IOError getIo() { @@ -16757,10 +19057,6 @@ public class Hbase { } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case IO: @@ -16773,12 +19069,12 @@ public class Hbase { 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 IO: return isSetIo(); @@ -16788,10 +19084,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -16851,58 +19143,63 @@ public class Hbase { int lastComparison = 0; mutateRow_result typedOther = (mutateRow_result)other; - lastComparison = Boolean.valueOf(isSetIo()).compareTo(isSetIo()); + lastComparison = Boolean.valueOf(isSetIo()).compareTo(typedOther.isSetIo()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(io, typedOther.io); - if (lastComparison != 0) { - return lastComparison; + if (isSetIo()) { + lastComparison = TBaseHelper.compareTo(this.io, typedOther.io); + if (lastComparison != 0) { + return lastComparison; + } } - lastComparison = Boolean.valueOf(isSetIa()).compareTo(isSetIa()); + lastComparison = Boolean.valueOf(isSetIa()).compareTo(typedOther.isSetIa()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(ia, typedOther.ia); - if (lastComparison != 0) { - return lastComparison; + if (isSetIa()) { + lastComparison = TBaseHelper.compareTo(this.ia, typedOther.ia); + 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 IO: - if (field.type == TType.STRUCT) { - this.io = new IOError(); - this.io.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case IA: - if (field.type == TType.STRUCT) { - this.ia = new IllegalArgument(); - this.ia.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); - } + switch (field.id) { + case 1: // IO + if (field.type == TType.STRUCT) { + this.io = new IOError(); + this.io.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 2: // IA + if (field.type == TType.STRUCT) { + this.ia = new IllegalArgument(); + this.ia.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + } + iprot.readFieldEnd(); } iprot.readStructEnd(); @@ -16956,7 +19253,7 @@ public class Hbase { } - public static class mutateRowTs_args implements TBase, java.io.Serializable, Cloneable, Comparable { + public static class mutateRowTs_args implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("mutateRowTs_args"); private static final TField TABLE_NAME_FIELD_DESC = new TField("tableName", TType.STRING, (short)1); @@ -16967,11 +19264,11 @@ public class Hbase { /** * name of table */ - public byte[] tableName; + public ByteBuffer tableName; /** * row key */ - public byte[] row; + public ByteBuffer row; /** * list of mutation commands */ @@ -17000,12 +19297,10 @@ public class Hbase { */ TIMESTAMP((short)4, "timestamp"); - 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); } } @@ -17014,7 +19309,18 @@ public class Hbase { * 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: // TABLE_NAME + return TABLE_NAME; + case 2: // ROW + return ROW; + case 3: // MUTATIONS + return MUTATIONS; + case 4: // TIMESTAMP + return TIMESTAMP; + default: + return null; + } } /** @@ -17055,19 +19361,19 @@ public class Hbase { private static final int __TIMESTAMP_ISSET_ID = 0; private BitSet __isset_bit_vector = new BitSet(1); - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.TABLE_NAME, new FieldMetaData("tableName", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(_Fields.ROW, new FieldMetaData("row", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(_Fields.MUTATIONS, new FieldMetaData("mutations", TFieldRequirementType.DEFAULT, - new ListMetaData(TType.LIST, + public static final Map<_Fields, FieldMetaData> metaDataMap; + static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.TABLE_NAME, new FieldMetaData("tableName", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING , "Text"))); + 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)))); - put(_Fields.TIMESTAMP, new FieldMetaData("timestamp", TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.TIMESTAMP, new FieldMetaData("timestamp", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.I64))); - }}); - - static { + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(mutateRowTs_args.class, metaDataMap); } @@ -17075,8 +19381,8 @@ public class Hbase { } public mutateRowTs_args( - byte[] tableName, - byte[] row, + ByteBuffer tableName, + ByteBuffer row, List mutations, long timestamp) { @@ -17114,22 +19420,36 @@ public class Hbase { return new mutateRowTs_args(this); } - @Deprecated - public mutateRowTs_args clone() { - return new mutateRowTs_args(this); + @Override + public void clear() { + this.tableName = null; + this.row = null; + this.mutations = null; + setTimestampIsSet(false); + this.timestamp = 0; } /** * name of table */ public byte[] getTableName() { - return this.tableName; + setTableName(TBaseHelper.rightSize(tableName)); + return tableName.array(); + } + + public ByteBuffer BufferForTableName() { + return tableName; } /** * name of table */ public mutateRowTs_args setTableName(byte[] tableName) { + setTableName(ByteBuffer.wrap(tableName)); + return this; + } + + public mutateRowTs_args setTableName(ByteBuffer tableName) { this.tableName = tableName; return this; } @@ -17153,13 +19473,23 @@ public class Hbase { * row key */ public byte[] getRow() { - return this.row; + setRow(TBaseHelper.rightSize(row)); + return row.array(); + } + + public ByteBuffer BufferForRow() { + return row; } /** * row key */ public mutateRowTs_args setRow(byte[] row) { + setRow(ByteBuffer.wrap(row)); + return this; + } + + public mutateRowTs_args setRow(ByteBuffer row) { this.row = row; return this; } @@ -17259,7 +19589,7 @@ public class Hbase { if (value == null) { unsetTableName(); } else { - setTableName((byte[])value); + setTableName((ByteBuffer)value); } break; @@ -17267,7 +19597,7 @@ public class Hbase { if (value == null) { unsetRow(); } else { - setRow((byte[])value); + setRow((ByteBuffer)value); } break; @@ -17290,10 +19620,6 @@ public class Hbase { } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case TABLE_NAME: @@ -17312,12 +19638,12 @@ public class Hbase { 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 TABLE_NAME: return isSetTableName(); @@ -17331,10 +19657,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -17353,7 +19675,7 @@ public class Hbase { if (this_present_tableName || that_present_tableName) { if (!(this_present_tableName && that_present_tableName)) return false; - if (!java.util.Arrays.equals(this.tableName, that.tableName)) + if (!this.tableName.equals(that.tableName)) return false; } @@ -17362,7 +19684,7 @@ public class Hbase { 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; } @@ -17422,98 +19744,107 @@ public class Hbase { int lastComparison = 0; mutateRowTs_args typedOther = (mutateRowTs_args)other; - lastComparison = Boolean.valueOf(isSetTableName()).compareTo(isSetTableName()); + lastComparison = Boolean.valueOf(isSetTableName()).compareTo(typedOther.isSetTableName()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(tableName, typedOther.tableName); - if (lastComparison != 0) { - return lastComparison; + if (isSetTableName()) { + lastComparison = TBaseHelper.compareTo(this.tableName, typedOther.tableName); + if (lastComparison != 0) { + return lastComparison; + } } - 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; + } } - lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(isSetTimestamp()); + lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(typedOther.isSetTimestamp()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(timestamp, typedOther.timestamp); - if (lastComparison != 0) { - return lastComparison; + if (isSetTimestamp()) { + lastComparison = TBaseHelper.compareTo(this.timestamp, typedOther.timestamp); + 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 TABLE_NAME: - if (field.type == TType.STRING) { - this.tableName = iprot.readBinary(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - 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: // TABLE_NAME + if (field.type == TType.STRING) { + this.tableName = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 2: // ROW + if (field.type == TType.STRING) { + this.row = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 3: // MUTATIONS + if (field.type == TType.LIST) { + { + TList _list66 = iprot.readListBegin(); + this.mutations = new ArrayList(_list66.size); + for (int _i67 = 0; _i67 < _list66.size; ++_i67) { - TList _list66 = iprot.readListBegin(); - this.mutations = new ArrayList(_list66.size); - for (int _i67 = 0; _i67 < _list66.size; ++_i67) - { - Mutation _elem68; - _elem68 = new Mutation(); - _elem68.read(iprot); - this.mutations.add(_elem68); - } - iprot.readListEnd(); + Mutation _elem68; + _elem68 = new Mutation(); + _elem68.read(iprot); + this.mutations.add(_elem68); } - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case TIMESTAMP: - if (field.type == TType.I64) { - this.timestamp = iprot.readI64(); - setTimestampIsSet(true); - } else { - TProtocolUtil.skip(iprot, field.type); + iprot.readListEnd(); } - break; - } - iprot.readFieldEnd(); - } + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 4: // TIMESTAMP + if (field.type == TType.I64) { + this.timestamp = iprot.readI64(); + setTimestampIsSet(true); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + } + iprot.readFieldEnd(); } iprot.readStructEnd(); @@ -17596,7 +19927,7 @@ public class Hbase { } - public static class mutateRowTs_result implements TBase, java.io.Serializable, Cloneable, Comparable { + public static class mutateRowTs_result implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("mutateRowTs_result"); private static final TField IO_FIELD_DESC = new TField("io", TType.STRUCT, (short)1); @@ -17610,12 +19941,10 @@ public class Hbase { IO((short)1, "io"), IA((short)2, "ia"); - 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); } } @@ -17624,7 +19953,14 @@ public class Hbase { * 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: // IO + return IO; + case 2: // IA + return IA; + default: + return null; + } } /** @@ -17663,14 +19999,14 @@ public class Hbase { // isset id assignments - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, + public static final Map<_Fields, FieldMetaData> metaDataMap; + static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); - put(_Fields.IA, new FieldMetaData("ia", TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.IA, new FieldMetaData("ia", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); - }}); - - static { + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(mutateRowTs_result.class, metaDataMap); } @@ -17702,9 +20038,10 @@ public class Hbase { return new mutateRowTs_result(this); } - @Deprecated - public mutateRowTs_result clone() { - return new mutateRowTs_result(this); + @Override + public void clear() { + this.io = null; + this.ia = null; } public IOError getIo() { @@ -17776,10 +20113,6 @@ public class Hbase { } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case IO: @@ -17792,12 +20125,12 @@ public class Hbase { 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 IO: return isSetIo(); @@ -17807,10 +20140,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -17870,58 +20199,63 @@ public class Hbase { int lastComparison = 0; mutateRowTs_result typedOther = (mutateRowTs_result)other; - lastComparison = Boolean.valueOf(isSetIo()).compareTo(isSetIo()); + lastComparison = Boolean.valueOf(isSetIo()).compareTo(typedOther.isSetIo()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(io, typedOther.io); - if (lastComparison != 0) { - return lastComparison; + if (isSetIo()) { + lastComparison = TBaseHelper.compareTo(this.io, typedOther.io); + if (lastComparison != 0) { + return lastComparison; + } } - lastComparison = Boolean.valueOf(isSetIa()).compareTo(isSetIa()); + lastComparison = Boolean.valueOf(isSetIa()).compareTo(typedOther.isSetIa()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(ia, typedOther.ia); - if (lastComparison != 0) { - return lastComparison; + if (isSetIa()) { + lastComparison = TBaseHelper.compareTo(this.ia, typedOther.ia); + 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 IO: - if (field.type == TType.STRUCT) { - this.io = new IOError(); - this.io.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case IA: - if (field.type == TType.STRUCT) { - this.ia = new IllegalArgument(); - this.ia.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); - } + switch (field.id) { + case 1: // IO + if (field.type == TType.STRUCT) { + this.io = new IOError(); + this.io.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 2: // IA + if (field.type == TType.STRUCT) { + this.ia = new IllegalArgument(); + this.ia.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + } + iprot.readFieldEnd(); } iprot.readStructEnd(); @@ -17975,7 +20309,7 @@ public class Hbase { } - public static class mutateRows_args implements TBase, java.io.Serializable, Cloneable, Comparable { + public static class mutateRows_args implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("mutateRows_args"); private static final TField TABLE_NAME_FIELD_DESC = new TField("tableName", TType.STRING, (short)1); @@ -17984,7 +20318,7 @@ public class Hbase { /** * name of table */ - public byte[] tableName; + public ByteBuffer tableName; /** * list of row batches */ @@ -18001,12 +20335,10 @@ public class Hbase { */ ROW_BATCHES((short)2, "rowBatches"); - 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); } } @@ -18015,7 +20347,14 @@ public class Hbase { * 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: // TABLE_NAME + return TABLE_NAME; + case 2: // ROW_BATCHES + return ROW_BATCHES; + default: + return null; + } } /** @@ -18054,15 +20393,15 @@ public class Hbase { // isset id assignments - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.TABLE_NAME, new FieldMetaData("tableName", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(_Fields.ROW_BATCHES, new FieldMetaData("rowBatches", TFieldRequirementType.DEFAULT, - new ListMetaData(TType.LIST, - new StructMetaData(TType.STRUCT, BatchMutation.class)))); - }}); - + public static final Map<_Fields, FieldMetaData> metaDataMap; static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.TABLE_NAME, new FieldMetaData("tableName", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING , "Text"))); + tmpMap.put(_Fields.ROW_BATCHES, new FieldMetaData("rowBatches", TFieldRequirementType.DEFAULT, + new ListMetaData(TType.LIST, + new StructMetaData(TType.STRUCT, BatchMutation.class)))); + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(mutateRows_args.class, metaDataMap); } @@ -18070,7 +20409,7 @@ public class Hbase { } public mutateRows_args( - byte[] tableName, + ByteBuffer tableName, List rowBatches) { this(); @@ -18098,22 +20437,33 @@ public class Hbase { return new mutateRows_args(this); } - @Deprecated - public mutateRows_args clone() { - return new mutateRows_args(this); + @Override + public void clear() { + this.tableName = null; + this.rowBatches = null; } /** * name of table */ public byte[] getTableName() { - return this.tableName; + setTableName(TBaseHelper.rightSize(tableName)); + return tableName.array(); + } + + public ByteBuffer BufferForTableName() { + return tableName; } /** * name of table */ public mutateRows_args setTableName(byte[] tableName) { + setTableName(ByteBuffer.wrap(tableName)); + return this; + } + + public mutateRows_args setTableName(ByteBuffer tableName) { this.tableName = tableName; return this; } @@ -18184,7 +20534,7 @@ public class Hbase { if (value == null) { unsetTableName(); } else { - setTableName((byte[])value); + setTableName((ByteBuffer)value); } break; @@ -18199,10 +20549,6 @@ public class Hbase { } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case TABLE_NAME: @@ -18215,12 +20561,12 @@ public class Hbase { 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 TABLE_NAME: return isSetTableName(); @@ -18230,10 +20576,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -18252,7 +20594,7 @@ public class Hbase { if (this_present_tableName || that_present_tableName) { if (!(this_present_tableName && that_present_tableName)) return false; - if (!java.util.Arrays.equals(this.tableName, that.tableName)) + if (!this.tableName.equals(that.tableName)) return false; } @@ -18293,67 +20635,72 @@ public class Hbase { int lastComparison = 0; mutateRows_args typedOther = (mutateRows_args)other; - lastComparison = Boolean.valueOf(isSetTableName()).compareTo(isSetTableName()); + lastComparison = Boolean.valueOf(isSetTableName()).compareTo(typedOther.isSetTableName()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(tableName, typedOther.tableName); - if (lastComparison != 0) { - return lastComparison; + if (isSetTableName()) { + lastComparison = TBaseHelper.compareTo(this.tableName, typedOther.tableName); + if (lastComparison != 0) { + return lastComparison; + } } - lastComparison = Boolean.valueOf(isSetRowBatches()).compareTo(isSetRowBatches()); + lastComparison = Boolean.valueOf(isSetRowBatches()).compareTo(typedOther.isSetRowBatches()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(rowBatches, typedOther.rowBatches); - if (lastComparison != 0) { - return lastComparison; + if (isSetRowBatches()) { + lastComparison = TBaseHelper.compareTo(this.rowBatches, typedOther.rowBatches); + 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 TABLE_NAME: - if (field.type == TType.STRING) { - this.tableName = iprot.readBinary(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case ROW_BATCHES: - if (field.type == TType.LIST) { + switch (field.id) { + case 1: // TABLE_NAME + if (field.type == TType.STRING) { + this.tableName = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 2: // ROW_BATCHES + if (field.type == TType.LIST) { + { + TList _list70 = iprot.readListBegin(); + this.rowBatches = new ArrayList(_list70.size); + for (int _i71 = 0; _i71 < _list70.size; ++_i71) { - TList _list70 = iprot.readListBegin(); - this.rowBatches = new ArrayList(_list70.size); - for (int _i71 = 0; _i71 < _list70.size; ++_i71) - { - BatchMutation _elem72; - _elem72 = new BatchMutation(); - _elem72.read(iprot); - this.rowBatches.add(_elem72); - } - iprot.readListEnd(); + BatchMutation _elem72; + _elem72 = new BatchMutation(); + _elem72.read(iprot); + this.rowBatches.add(_elem72); } - } 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(); @@ -18416,7 +20763,7 @@ public class Hbase { } - public static class mutateRows_result implements TBase, java.io.Serializable, Cloneable, Comparable { + public static class mutateRows_result implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("mutateRows_result"); private static final TField IO_FIELD_DESC = new TField("io", TType.STRUCT, (short)1); @@ -18430,12 +20777,10 @@ public class Hbase { IO((short)1, "io"), IA((short)2, "ia"); - 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); } } @@ -18444,7 +20789,14 @@ public class Hbase { * 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: // IO + return IO; + case 2: // IA + return IA; + default: + return null; + } } /** @@ -18483,14 +20835,14 @@ public class Hbase { // isset id assignments - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRUCT))); - put(_Fields.IA, new FieldMetaData("ia", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRUCT))); - }}); - + public static final Map<_Fields, FieldMetaData> metaDataMap; static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + tmpMap.put(_Fields.IA, new FieldMetaData("ia", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(mutateRows_result.class, metaDataMap); } @@ -18522,9 +20874,10 @@ public class Hbase { return new mutateRows_result(this); } - @Deprecated - public mutateRows_result clone() { - return new mutateRows_result(this); + @Override + public void clear() { + this.io = null; + this.ia = null; } public IOError getIo() { @@ -18596,10 +20949,6 @@ public class Hbase { } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case IO: @@ -18612,12 +20961,12 @@ public class Hbase { 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 IO: return isSetIo(); @@ -18627,10 +20976,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -18690,58 +21035,63 @@ public class Hbase { int lastComparison = 0; mutateRows_result typedOther = (mutateRows_result)other; - lastComparison = Boolean.valueOf(isSetIo()).compareTo(isSetIo()); + lastComparison = Boolean.valueOf(isSetIo()).compareTo(typedOther.isSetIo()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(io, typedOther.io); - if (lastComparison != 0) { - return lastComparison; + if (isSetIo()) { + lastComparison = TBaseHelper.compareTo(this.io, typedOther.io); + if (lastComparison != 0) { + return lastComparison; + } } - lastComparison = Boolean.valueOf(isSetIa()).compareTo(isSetIa()); + lastComparison = Boolean.valueOf(isSetIa()).compareTo(typedOther.isSetIa()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(ia, typedOther.ia); - if (lastComparison != 0) { - return lastComparison; + if (isSetIa()) { + lastComparison = TBaseHelper.compareTo(this.ia, typedOther.ia); + 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 IO: - if (field.type == TType.STRUCT) { - this.io = new IOError(); - this.io.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case IA: - if (field.type == TType.STRUCT) { - this.ia = new IllegalArgument(); - this.ia.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); - } + switch (field.id) { + case 1: // IO + if (field.type == TType.STRUCT) { + this.io = new IOError(); + this.io.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 2: // IA + if (field.type == TType.STRUCT) { + this.ia = new IllegalArgument(); + this.ia.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + } + iprot.readFieldEnd(); } iprot.readStructEnd(); @@ -18795,7 +21145,7 @@ public class Hbase { } - public static class mutateRowsTs_args implements TBase, java.io.Serializable, Cloneable, Comparable { + public static class mutateRowsTs_args implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("mutateRowsTs_args"); private static final TField TABLE_NAME_FIELD_DESC = new TField("tableName", TType.STRING, (short)1); @@ -18805,7 +21155,7 @@ public class Hbase { /** * name of table */ - public byte[] tableName; + public ByteBuffer tableName; /** * list of row batches */ @@ -18830,12 +21180,10 @@ public class Hbase { */ TIMESTAMP((short)3, "timestamp"); - 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); } } @@ -18844,7 +21192,16 @@ public class Hbase { * 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: // TABLE_NAME + return TABLE_NAME; + case 2: // ROW_BATCHES + return ROW_BATCHES; + case 3: // TIMESTAMP + return TIMESTAMP; + default: + return null; + } } /** @@ -18885,17 +21242,17 @@ public class Hbase { private static final int __TIMESTAMP_ISSET_ID = 0; private BitSet __isset_bit_vector = new BitSet(1); - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.TABLE_NAME, new FieldMetaData("tableName", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(_Fields.ROW_BATCHES, new FieldMetaData("rowBatches", TFieldRequirementType.DEFAULT, - new ListMetaData(TType.LIST, + public static final Map<_Fields, FieldMetaData> metaDataMap; + static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.TABLE_NAME, new FieldMetaData("tableName", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING , "Text"))); + tmpMap.put(_Fields.ROW_BATCHES, new FieldMetaData("rowBatches", TFieldRequirementType.DEFAULT, + new ListMetaData(TType.LIST, new StructMetaData(TType.STRUCT, BatchMutation.class)))); - put(_Fields.TIMESTAMP, new FieldMetaData("timestamp", TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.TIMESTAMP, new FieldMetaData("timestamp", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.I64))); - }}); - - static { + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(mutateRowsTs_args.class, metaDataMap); } @@ -18903,7 +21260,7 @@ public class Hbase { } public mutateRowsTs_args( - byte[] tableName, + ByteBuffer tableName, List rowBatches, long timestamp) { @@ -18937,22 +21294,35 @@ public class Hbase { return new mutateRowsTs_args(this); } - @Deprecated - public mutateRowsTs_args clone() { - return new mutateRowsTs_args(this); + @Override + public void clear() { + this.tableName = null; + this.rowBatches = null; + setTimestampIsSet(false); + this.timestamp = 0; } /** * name of table */ public byte[] getTableName() { - return this.tableName; + setTableName(TBaseHelper.rightSize(tableName)); + return tableName.array(); + } + + public ByteBuffer BufferForTableName() { + return tableName; } /** * name of table */ public mutateRowsTs_args setTableName(byte[] tableName) { + setTableName(ByteBuffer.wrap(tableName)); + return this; + } + + public mutateRowsTs_args setTableName(ByteBuffer tableName) { this.tableName = tableName; return this; } @@ -19052,7 +21422,7 @@ public class Hbase { if (value == null) { unsetTableName(); } else { - setTableName((byte[])value); + setTableName((ByteBuffer)value); } break; @@ -19075,10 +21445,6 @@ public class Hbase { } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case TABLE_NAME: @@ -19094,12 +21460,12 @@ public class Hbase { 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 TABLE_NAME: return isSetTableName(); @@ -19111,10 +21477,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -19133,7 +21495,7 @@ public class Hbase { if (this_present_tableName || that_present_tableName) { if (!(this_present_tableName && that_present_tableName)) return false; - if (!java.util.Arrays.equals(this.tableName, that.tableName)) + if (!this.tableName.equals(that.tableName)) return false; } @@ -19188,83 +21550,90 @@ public class Hbase { int lastComparison = 0; mutateRowsTs_args typedOther = (mutateRowsTs_args)other; - lastComparison = Boolean.valueOf(isSetTableName()).compareTo(isSetTableName()); + lastComparison = Boolean.valueOf(isSetTableName()).compareTo(typedOther.isSetTableName()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(tableName, typedOther.tableName); - if (lastComparison != 0) { - return lastComparison; + if (isSetTableName()) { + lastComparison = TBaseHelper.compareTo(this.tableName, typedOther.tableName); + if (lastComparison != 0) { + return lastComparison; + } } - lastComparison = Boolean.valueOf(isSetRowBatches()).compareTo(isSetRowBatches()); + lastComparison = Boolean.valueOf(isSetRowBatches()).compareTo(typedOther.isSetRowBatches()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(rowBatches, typedOther.rowBatches); - if (lastComparison != 0) { - return lastComparison; + if (isSetRowBatches()) { + lastComparison = TBaseHelper.compareTo(this.rowBatches, typedOther.rowBatches); + if (lastComparison != 0) { + return lastComparison; + } } - lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(isSetTimestamp()); + lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(typedOther.isSetTimestamp()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(timestamp, typedOther.timestamp); - if (lastComparison != 0) { - return lastComparison; + if (isSetTimestamp()) { + lastComparison = TBaseHelper.compareTo(this.timestamp, typedOther.timestamp); + 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 TABLE_NAME: - if (field.type == TType.STRING) { - this.tableName = iprot.readBinary(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case ROW_BATCHES: - if (field.type == TType.LIST) { + switch (field.id) { + case 1: // TABLE_NAME + if (field.type == TType.STRING) { + this.tableName = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 2: // ROW_BATCHES + if (field.type == TType.LIST) { + { + TList _list74 = iprot.readListBegin(); + this.rowBatches = new ArrayList(_list74.size); + for (int _i75 = 0; _i75 < _list74.size; ++_i75) { - TList _list74 = iprot.readListBegin(); - this.rowBatches = new ArrayList(_list74.size); - for (int _i75 = 0; _i75 < _list74.size; ++_i75) - { - BatchMutation _elem76; - _elem76 = new BatchMutation(); - _elem76.read(iprot); - this.rowBatches.add(_elem76); - } - iprot.readListEnd(); + BatchMutation _elem76; + _elem76 = new BatchMutation(); + _elem76.read(iprot); + this.rowBatches.add(_elem76); } - } else { - TProtocolUtil.skip(iprot, field.type); + iprot.readListEnd(); } - break; - case TIMESTAMP: - if (field.type == TType.I64) { - this.timestamp = iprot.readI64(); - setTimestampIsSet(true); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); - } + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 3: // TIMESTAMP + if (field.type == TType.I64) { + this.timestamp = iprot.readI64(); + setTimestampIsSet(true); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + } + iprot.readFieldEnd(); } iprot.readStructEnd(); @@ -19334,7 +21703,7 @@ public class Hbase { } - public static class mutateRowsTs_result implements TBase, java.io.Serializable, Cloneable, Comparable { + public static class mutateRowsTs_result implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("mutateRowsTs_result"); private static final TField IO_FIELD_DESC = new TField("io", TType.STRUCT, (short)1); @@ -19348,12 +21717,10 @@ public class Hbase { IO((short)1, "io"), IA((short)2, "ia"); - 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); } } @@ -19362,7 +21729,14 @@ public class Hbase { * 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: // IO + return IO; + case 2: // IA + return IA; + default: + return null; + } } /** @@ -19401,14 +21775,14 @@ public class Hbase { // isset id assignments - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, + public static final Map<_Fields, FieldMetaData> metaDataMap; + static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); - put(_Fields.IA, new FieldMetaData("ia", TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.IA, new FieldMetaData("ia", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); - }}); - - static { + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(mutateRowsTs_result.class, metaDataMap); } @@ -19440,9 +21814,10 @@ public class Hbase { return new mutateRowsTs_result(this); } - @Deprecated - public mutateRowsTs_result clone() { - return new mutateRowsTs_result(this); + @Override + public void clear() { + this.io = null; + this.ia = null; } public IOError getIo() { @@ -19514,10 +21889,6 @@ public class Hbase { } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case IO: @@ -19530,12 +21901,12 @@ public class Hbase { 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 IO: return isSetIo(); @@ -19545,10 +21916,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -19608,58 +21975,63 @@ public class Hbase { int lastComparison = 0; mutateRowsTs_result typedOther = (mutateRowsTs_result)other; - lastComparison = Boolean.valueOf(isSetIo()).compareTo(isSetIo()); + lastComparison = Boolean.valueOf(isSetIo()).compareTo(typedOther.isSetIo()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(io, typedOther.io); - if (lastComparison != 0) { - return lastComparison; + if (isSetIo()) { + lastComparison = TBaseHelper.compareTo(this.io, typedOther.io); + if (lastComparison != 0) { + return lastComparison; + } } - lastComparison = Boolean.valueOf(isSetIa()).compareTo(isSetIa()); + lastComparison = Boolean.valueOf(isSetIa()).compareTo(typedOther.isSetIa()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(ia, typedOther.ia); - if (lastComparison != 0) { - return lastComparison; + if (isSetIa()) { + lastComparison = TBaseHelper.compareTo(this.ia, typedOther.ia); + 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 IO: - if (field.type == TType.STRUCT) { - this.io = new IOError(); - this.io.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case IA: - if (field.type == TType.STRUCT) { - this.ia = new IllegalArgument(); - this.ia.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); - } + switch (field.id) { + case 1: // IO + if (field.type == TType.STRUCT) { + this.io = new IOError(); + this.io.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 2: // IA + if (field.type == TType.STRUCT) { + this.ia = new IllegalArgument(); + this.ia.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + } + iprot.readFieldEnd(); } iprot.readStructEnd(); @@ -19713,7 +22085,7 @@ public class Hbase { } - public static class atomicIncrement_args implements TBase, java.io.Serializable, Cloneable, Comparable { + public static class atomicIncrement_args implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("atomicIncrement_args"); private static final TField TABLE_NAME_FIELD_DESC = new TField("tableName", TType.STRING, (short)1); @@ -19724,15 +22096,15 @@ public class Hbase { /** * name of table */ - public byte[] tableName; + public ByteBuffer tableName; /** * row to increment */ - public byte[] row; + public ByteBuffer row; /** * name of column */ - public byte[] column; + public ByteBuffer column; /** * amount to increment by */ @@ -19757,12 +22129,10 @@ public class Hbase { */ VALUE((short)4, "value"); - 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); } } @@ -19771,7 +22141,18 @@ public class Hbase { * 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: // TABLE_NAME + return TABLE_NAME; + case 2: // ROW + return ROW; + case 3: // COLUMN + return COLUMN; + case 4: // VALUE + return VALUE; + default: + return null; + } } /** @@ -19812,18 +22193,18 @@ public class Hbase { private static final int __VALUE_ISSET_ID = 0; private BitSet __isset_bit_vector = new BitSet(1); - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.TABLE_NAME, new FieldMetaData("tableName", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(_Fields.ROW, new FieldMetaData("row", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(_Fields.COLUMN, new FieldMetaData("column", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(_Fields.VALUE, new FieldMetaData("value", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.I64))); - }}); - + public static final Map<_Fields, FieldMetaData> metaDataMap; static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.TABLE_NAME, new FieldMetaData("tableName", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING , "Text"))); + tmpMap.put(_Fields.ROW, new FieldMetaData("row", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING , "Text"))); + tmpMap.put(_Fields.COLUMN, new FieldMetaData("column", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING , "Text"))); + tmpMap.put(_Fields.VALUE, new FieldMetaData("value", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.I64))); + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(atomicIncrement_args.class, metaDataMap); } @@ -19831,9 +22212,9 @@ public class Hbase { } public atomicIncrement_args( - byte[] tableName, - byte[] row, - byte[] column, + ByteBuffer tableName, + ByteBuffer row, + ByteBuffer column, long value) { this(); @@ -19866,22 +22247,36 @@ public class Hbase { return new atomicIncrement_args(this); } - @Deprecated - public atomicIncrement_args clone() { - return new atomicIncrement_args(this); + @Override + public void clear() { + this.tableName = null; + this.row = null; + this.column = null; + setValueIsSet(false); + this.value = 0; } /** * name of table */ public byte[] getTableName() { - return this.tableName; + setTableName(TBaseHelper.rightSize(tableName)); + return tableName.array(); + } + + public ByteBuffer BufferForTableName() { + return tableName; } /** * name of table */ public atomicIncrement_args setTableName(byte[] tableName) { + setTableName(ByteBuffer.wrap(tableName)); + return this; + } + + public atomicIncrement_args setTableName(ByteBuffer tableName) { this.tableName = tableName; return this; } @@ -19905,13 +22300,23 @@ public class Hbase { * row to increment */ public byte[] getRow() { - return this.row; + setRow(TBaseHelper.rightSize(row)); + return row.array(); + } + + public ByteBuffer BufferForRow() { + return row; } /** * row to increment */ public atomicIncrement_args setRow(byte[] row) { + setRow(ByteBuffer.wrap(row)); + return this; + } + + public atomicIncrement_args setRow(ByteBuffer row) { this.row = row; return this; } @@ -19935,13 +22340,23 @@ public class Hbase { * name of column */ public byte[] getColumn() { - return this.column; + setColumn(TBaseHelper.rightSize(column)); + return column.array(); + } + + public ByteBuffer BufferForColumn() { + return column; } /** * name of column */ public atomicIncrement_args setColumn(byte[] column) { + setColumn(ByteBuffer.wrap(column)); + return this; + } + + public atomicIncrement_args setColumn(ByteBuffer column) { this.column = column; return this; } @@ -19996,7 +22411,7 @@ public class Hbase { if (value == null) { unsetTableName(); } else { - setTableName((byte[])value); + setTableName((ByteBuffer)value); } break; @@ -20004,7 +22419,7 @@ public class Hbase { if (value == null) { unsetRow(); } else { - setRow((byte[])value); + setRow((ByteBuffer)value); } break; @@ -20012,7 +22427,7 @@ public class Hbase { if (value == null) { unsetColumn(); } else { - setColumn((byte[])value); + setColumn((ByteBuffer)value); } break; @@ -20027,10 +22442,6 @@ public class Hbase { } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case TABLE_NAME: @@ -20049,12 +22460,12 @@ public class Hbase { 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 TABLE_NAME: return isSetTableName(); @@ -20068,10 +22479,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -20090,7 +22497,7 @@ public class Hbase { if (this_present_tableName || that_present_tableName) { if (!(this_present_tableName && that_present_tableName)) return false; - if (!java.util.Arrays.equals(this.tableName, that.tableName)) + if (!this.tableName.equals(that.tableName)) return false; } @@ -20099,7 +22506,7 @@ public class Hbase { 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; } @@ -20108,7 +22515,7 @@ public class Hbase { if (this_present_column || that_present_column) { if (!(this_present_column && that_present_column)) return false; - if (!java.util.Arrays.equals(this.column, that.column)) + if (!this.column.equals(that.column)) return false; } @@ -20159,87 +22566,96 @@ public class Hbase { int lastComparison = 0; atomicIncrement_args typedOther = (atomicIncrement_args)other; - lastComparison = Boolean.valueOf(isSetTableName()).compareTo(isSetTableName()); + lastComparison = Boolean.valueOf(isSetTableName()).compareTo(typedOther.isSetTableName()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(tableName, typedOther.tableName); - if (lastComparison != 0) { - return lastComparison; + if (isSetTableName()) { + lastComparison = TBaseHelper.compareTo(this.tableName, typedOther.tableName); + if (lastComparison != 0) { + return lastComparison; + } } - 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(isSetColumn()).compareTo(isSetColumn()); + lastComparison = Boolean.valueOf(isSetColumn()).compareTo(typedOther.isSetColumn()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(column, typedOther.column); - if (lastComparison != 0) { - return lastComparison; + if (isSetColumn()) { + lastComparison = TBaseHelper.compareTo(this.column, typedOther.column); + if (lastComparison != 0) { + return lastComparison; + } } - lastComparison = Boolean.valueOf(isSetValue()).compareTo(isSetValue()); + lastComparison = Boolean.valueOf(isSetValue()).compareTo(typedOther.isSetValue()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(value, typedOther.value); - if (lastComparison != 0) { - return lastComparison; + if (isSetValue()) { + lastComparison = TBaseHelper.compareTo(this.value, typedOther.value); + 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 TABLE_NAME: - if (field.type == TType.STRING) { - this.tableName = iprot.readBinary(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case ROW: - if (field.type == TType.STRING) { - this.row = iprot.readBinary(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case COLUMN: - if (field.type == TType.STRING) { - this.column = iprot.readBinary(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case VALUE: - if (field.type == TType.I64) { - this.value = iprot.readI64(); - setValueIsSet(true); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); - } + switch (field.id) { + case 1: // TABLE_NAME + if (field.type == TType.STRING) { + this.tableName = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 2: // ROW + if (field.type == TType.STRING) { + this.row = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 3: // COLUMN + if (field.type == TType.STRING) { + this.column = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 4: // VALUE + if (field.type == TType.I64) { + this.value = iprot.readI64(); + setValueIsSet(true); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + } + iprot.readFieldEnd(); } iprot.readStructEnd(); @@ -20315,7 +22731,7 @@ public class Hbase { } - public static class atomicIncrement_result implements TBase, java.io.Serializable, Cloneable, Comparable { + public static class atomicIncrement_result implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("atomicIncrement_result"); private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.I64, (short)0); @@ -20332,12 +22748,10 @@ public class Hbase { IO((short)1, "io"), IA((short)2, "ia"); - 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); } } @@ -20346,7 +22760,16 @@ public class Hbase { * 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 0: // SUCCESS + return SUCCESS; + case 1: // IO + return IO; + case 2: // IA + return IA; + default: + return null; + } } /** @@ -20387,16 +22810,16 @@ public class Hbase { private static final int __SUCCESS_ISSET_ID = 0; private BitSet __isset_bit_vector = new BitSet(1); - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + public static final Map<_Fields, FieldMetaData> metaDataMap; + static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.I64))); - put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); - put(_Fields.IA, new FieldMetaData("ia", TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.IA, new FieldMetaData("ia", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); - }}); - - static { + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(atomicIncrement_result.class, metaDataMap); } @@ -20434,9 +22857,12 @@ public class Hbase { return new atomicIncrement_result(this); } - @Deprecated - public atomicIncrement_result clone() { - return new atomicIncrement_result(this); + @Override + public void clear() { + setSuccessIsSet(false); + this.success = 0; + this.io = null; + this.ia = null; } public long getSuccess() { @@ -20539,10 +22965,6 @@ public class Hbase { } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: @@ -20558,12 +22980,12 @@ public class Hbase { 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 SUCCESS: return isSetSuccess(); @@ -20575,10 +22997,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -20652,74 +23070,81 @@ public class Hbase { int lastComparison = 0; atomicIncrement_result typedOther = (atomicIncrement_result)other; - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess()); + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(success, typedOther.success); - if (lastComparison != 0) { - return lastComparison; + if (isSetSuccess()) { + lastComparison = TBaseHelper.compareTo(this.success, typedOther.success); + if (lastComparison != 0) { + return lastComparison; + } } - lastComparison = Boolean.valueOf(isSetIo()).compareTo(isSetIo()); + lastComparison = Boolean.valueOf(isSetIo()).compareTo(typedOther.isSetIo()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(io, typedOther.io); - if (lastComparison != 0) { - return lastComparison; + if (isSetIo()) { + lastComparison = TBaseHelper.compareTo(this.io, typedOther.io); + if (lastComparison != 0) { + return lastComparison; + } } - lastComparison = Boolean.valueOf(isSetIa()).compareTo(isSetIa()); + lastComparison = Boolean.valueOf(isSetIa()).compareTo(typedOther.isSetIa()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(ia, typedOther.ia); - if (lastComparison != 0) { - return lastComparison; + if (isSetIa()) { + lastComparison = TBaseHelper.compareTo(this.ia, typedOther.ia); + 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 SUCCESS: - if (field.type == TType.I64) { - this.success = iprot.readI64(); - setSuccessIsSet(true); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case IO: - if (field.type == TType.STRUCT) { - this.io = new IOError(); - this.io.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case IA: - if (field.type == TType.STRUCT) { - this.ia = new IllegalArgument(); - this.ia.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); - } + switch (field.id) { + case 0: // SUCCESS + if (field.type == TType.I64) { + this.success = iprot.readI64(); + setSuccessIsSet(true); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 1: // IO + if (field.type == TType.STRUCT) { + this.io = new IOError(); + this.io.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 2: // IA + if (field.type == TType.STRUCT) { + this.ia = new IllegalArgument(); + this.ia.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + } + iprot.readFieldEnd(); } iprot.readStructEnd(); @@ -20781,7 +23206,7 @@ public class Hbase { } - public static class deleteAll_args implements TBase, java.io.Serializable, Cloneable, Comparable { + public static class deleteAll_args implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("deleteAll_args"); private static final TField TABLE_NAME_FIELD_DESC = new TField("tableName", TType.STRING, (short)1); @@ -20791,15 +23216,15 @@ public class Hbase { /** * name of table */ - public byte[] tableName; + public ByteBuffer tableName; /** * Row to update */ - public byte[] row; + public ByteBuffer row; /** * name of column whose value is to be deleted */ - public byte[] column; + public ByteBuffer column; /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements TFieldIdEnum { @@ -20816,12 +23241,10 @@ public class Hbase { */ COLUMN((short)3, "column"); - 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); } } @@ -20830,7 +23253,16 @@ public class Hbase { * 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: // TABLE_NAME + return TABLE_NAME; + case 2: // ROW + return ROW; + case 3: // COLUMN + return COLUMN; + default: + return null; + } } /** @@ -20869,16 +23301,16 @@ public class Hbase { // isset id assignments - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.TABLE_NAME, new FieldMetaData("tableName", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(_Fields.ROW, new FieldMetaData("row", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(_Fields.COLUMN, new FieldMetaData("column", 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.TABLE_NAME, new FieldMetaData("tableName", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING , "Text"))); + tmpMap.put(_Fields.ROW, new FieldMetaData("row", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING , "Text"))); + tmpMap.put(_Fields.COLUMN, new FieldMetaData("column", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING , "Text"))); + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(deleteAll_args.class, metaDataMap); } @@ -20886,9 +23318,9 @@ public class Hbase { } public deleteAll_args( - byte[] tableName, - byte[] row, - byte[] column) + ByteBuffer tableName, + ByteBuffer row, + ByteBuffer column) { this(); this.tableName = tableName; @@ -20915,22 +23347,34 @@ public class Hbase { return new deleteAll_args(this); } - @Deprecated - public deleteAll_args clone() { - return new deleteAll_args(this); + @Override + public void clear() { + this.tableName = null; + this.row = null; + this.column = null; } /** * name of table */ public byte[] getTableName() { - return this.tableName; + setTableName(TBaseHelper.rightSize(tableName)); + return tableName.array(); + } + + public ByteBuffer BufferForTableName() { + return tableName; } /** * name of table */ public deleteAll_args setTableName(byte[] tableName) { + setTableName(ByteBuffer.wrap(tableName)); + return this; + } + + public deleteAll_args setTableName(ByteBuffer tableName) { this.tableName = tableName; return this; } @@ -20954,13 +23398,23 @@ public class Hbase { * Row to update */ public byte[] getRow() { - return this.row; + setRow(TBaseHelper.rightSize(row)); + return row.array(); + } + + public ByteBuffer BufferForRow() { + return row; } /** * Row to update */ public deleteAll_args setRow(byte[] row) { + setRow(ByteBuffer.wrap(row)); + return this; + } + + public deleteAll_args setRow(ByteBuffer row) { this.row = row; return this; } @@ -20984,13 +23438,23 @@ public class Hbase { * name of column whose value is to be deleted */ public byte[] getColumn() { - return this.column; + setColumn(TBaseHelper.rightSize(column)); + return column.array(); + } + + public ByteBuffer BufferForColumn() { + return column; } /** * name of column whose value is to be deleted */ public deleteAll_args setColumn(byte[] column) { + setColumn(ByteBuffer.wrap(column)); + return this; + } + + public deleteAll_args setColumn(ByteBuffer column) { this.column = column; return this; } @@ -21016,7 +23480,7 @@ public class Hbase { if (value == null) { unsetTableName(); } else { - setTableName((byte[])value); + setTableName((ByteBuffer)value); } break; @@ -21024,7 +23488,7 @@ public class Hbase { if (value == null) { unsetRow(); } else { - setRow((byte[])value); + setRow((ByteBuffer)value); } break; @@ -21032,17 +23496,13 @@ public class Hbase { if (value == null) { unsetColumn(); } else { - setColumn((byte[])value); + setColumn((ByteBuffer)value); } break; } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case TABLE_NAME: @@ -21058,12 +23518,12 @@ public class Hbase { 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 TABLE_NAME: return isSetTableName(); @@ -21075,10 +23535,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -21097,7 +23553,7 @@ public class Hbase { if (this_present_tableName || that_present_tableName) { if (!(this_present_tableName && that_present_tableName)) return false; - if (!java.util.Arrays.equals(this.tableName, that.tableName)) + if (!this.tableName.equals(that.tableName)) return false; } @@ -21106,7 +23562,7 @@ public class Hbase { 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; } @@ -21115,7 +23571,7 @@ public class Hbase { if (this_present_column || that_present_column) { if (!(this_present_column && that_present_column)) return false; - if (!java.util.Arrays.equals(this.column, that.column)) + if (!this.column.equals(that.column)) return false; } @@ -21152,71 +23608,78 @@ public class Hbase { int lastComparison = 0; deleteAll_args typedOther = (deleteAll_args)other; - lastComparison = Boolean.valueOf(isSetTableName()).compareTo(isSetTableName()); + lastComparison = Boolean.valueOf(isSetTableName()).compareTo(typedOther.isSetTableName()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(tableName, typedOther.tableName); - if (lastComparison != 0) { - return lastComparison; + if (isSetTableName()) { + lastComparison = TBaseHelper.compareTo(this.tableName, typedOther.tableName); + if (lastComparison != 0) { + return lastComparison; + } } - 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(isSetColumn()).compareTo(isSetColumn()); + lastComparison = Boolean.valueOf(isSetColumn()).compareTo(typedOther.isSetColumn()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(column, typedOther.column); - if (lastComparison != 0) { - return lastComparison; + if (isSetColumn()) { + lastComparison = TBaseHelper.compareTo(this.column, typedOther.column); + 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 TABLE_NAME: - if (field.type == TType.STRING) { - this.tableName = iprot.readBinary(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case ROW: - if (field.type == TType.STRING) { - this.row = iprot.readBinary(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case COLUMN: - if (field.type == TType.STRING) { - this.column = iprot.readBinary(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); - } + switch (field.id) { + case 1: // TABLE_NAME + if (field.type == TType.STRING) { + this.tableName = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 2: // ROW + if (field.type == TType.STRING) { + this.row = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 3: // COLUMN + if (field.type == TType.STRING) { + this.column = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + } + iprot.readFieldEnd(); } iprot.readStructEnd(); @@ -21285,7 +23748,7 @@ public class Hbase { } - public static class deleteAll_result implements TBase, java.io.Serializable, Cloneable, Comparable { + public static class deleteAll_result implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("deleteAll_result"); private static final TField IO_FIELD_DESC = new TField("io", TType.STRUCT, (short)1); @@ -21296,12 +23759,10 @@ public class Hbase { public enum _Fields implements TFieldIdEnum { IO((short)1, "io"); - 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); } } @@ -21310,7 +23771,12 @@ public class Hbase { * 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: // IO + return IO; + default: + return null; + } } /** @@ -21349,12 +23815,12 @@ public class Hbase { // isset id assignments - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRUCT))); - }}); - + public static final Map<_Fields, FieldMetaData> metaDataMap; static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(deleteAll_result.class, metaDataMap); } @@ -21381,9 +23847,9 @@ public class Hbase { return new deleteAll_result(this); } - @Deprecated - public deleteAll_result clone() { - return new deleteAll_result(this); + @Override + public void clear() { + this.io = null; } public IOError getIo() { @@ -21423,10 +23889,6 @@ public class Hbase { } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case IO: @@ -21436,12 +23898,12 @@ public class Hbase { 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 IO: return isSetIo(); @@ -21449,10 +23911,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -21498,42 +23956,45 @@ public class Hbase { int lastComparison = 0; deleteAll_result typedOther = (deleteAll_result)other; - lastComparison = Boolean.valueOf(isSetIo()).compareTo(isSetIo()); + lastComparison = Boolean.valueOf(isSetIo()).compareTo(typedOther.isSetIo()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(io, typedOther.io); - if (lastComparison != 0) { - return lastComparison; + if (isSetIo()) { + lastComparison = TBaseHelper.compareTo(this.io, typedOther.io); + 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 IO: - if (field.type == TType.STRUCT) { - this.io = new IOError(); - this.io.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); + switch (field.id) { + case 1: // IO + if (field.type == TType.STRUCT) { + this.io = new IOError(); + this.io.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); } + iprot.readFieldEnd(); } iprot.readStructEnd(); @@ -21575,7 +24036,7 @@ public class Hbase { } - public static class deleteAllTs_args implements TBase, java.io.Serializable, Cloneable, Comparable { + public static class deleteAllTs_args implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("deleteAllTs_args"); private static final TField TABLE_NAME_FIELD_DESC = new TField("tableName", TType.STRING, (short)1); @@ -21586,15 +24047,15 @@ public class Hbase { /** * name of table */ - public byte[] tableName; + public ByteBuffer tableName; /** * Row to update */ - public byte[] row; + public ByteBuffer row; /** * name of column whose value is to be deleted */ - public byte[] column; + public ByteBuffer column; /** * timestamp */ @@ -21619,12 +24080,10 @@ public class Hbase { */ TIMESTAMP((short)4, "timestamp"); - 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); } } @@ -21633,7 +24092,18 @@ public class Hbase { * 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: // TABLE_NAME + return TABLE_NAME; + case 2: // ROW + return ROW; + case 3: // COLUMN + return COLUMN; + case 4: // TIMESTAMP + return TIMESTAMP; + default: + return null; + } } /** @@ -21674,18 +24144,18 @@ public class Hbase { private static final int __TIMESTAMP_ISSET_ID = 0; private BitSet __isset_bit_vector = new BitSet(1); - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.TABLE_NAME, new FieldMetaData("tableName", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(_Fields.ROW, new FieldMetaData("row", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(_Fields.COLUMN, new FieldMetaData("column", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(_Fields.TIMESTAMP, new FieldMetaData("timestamp", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.I64))); - }}); - + public static final Map<_Fields, FieldMetaData> metaDataMap; static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.TABLE_NAME, new FieldMetaData("tableName", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING , "Text"))); + tmpMap.put(_Fields.ROW, new FieldMetaData("row", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING , "Text"))); + tmpMap.put(_Fields.COLUMN, new FieldMetaData("column", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING , "Text"))); + tmpMap.put(_Fields.TIMESTAMP, new FieldMetaData("timestamp", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.I64))); + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(deleteAllTs_args.class, metaDataMap); } @@ -21693,9 +24163,9 @@ public class Hbase { } public deleteAllTs_args( - byte[] tableName, - byte[] row, - byte[] column, + ByteBuffer tableName, + ByteBuffer row, + ByteBuffer column, long timestamp) { this(); @@ -21728,22 +24198,36 @@ public class Hbase { return new deleteAllTs_args(this); } - @Deprecated - public deleteAllTs_args clone() { - return new deleteAllTs_args(this); + @Override + public void clear() { + this.tableName = null; + this.row = null; + this.column = null; + setTimestampIsSet(false); + this.timestamp = 0; } /** * name of table */ public byte[] getTableName() { - return this.tableName; + setTableName(TBaseHelper.rightSize(tableName)); + return tableName.array(); + } + + public ByteBuffer BufferForTableName() { + return tableName; } /** * name of table */ public deleteAllTs_args setTableName(byte[] tableName) { + setTableName(ByteBuffer.wrap(tableName)); + return this; + } + + public deleteAllTs_args setTableName(ByteBuffer tableName) { this.tableName = tableName; return this; } @@ -21767,13 +24251,23 @@ public class Hbase { * Row to update */ public byte[] getRow() { - return this.row; + setRow(TBaseHelper.rightSize(row)); + return row.array(); + } + + public ByteBuffer BufferForRow() { + return row; } /** * Row to update */ public deleteAllTs_args setRow(byte[] row) { + setRow(ByteBuffer.wrap(row)); + return this; + } + + public deleteAllTs_args setRow(ByteBuffer row) { this.row = row; return this; } @@ -21797,13 +24291,23 @@ public class Hbase { * name of column whose value is to be deleted */ public byte[] getColumn() { - return this.column; + setColumn(TBaseHelper.rightSize(column)); + return column.array(); + } + + public ByteBuffer BufferForColumn() { + return column; } /** * name of column whose value is to be deleted */ public deleteAllTs_args setColumn(byte[] column) { + setColumn(ByteBuffer.wrap(column)); + return this; + } + + public deleteAllTs_args setColumn(ByteBuffer column) { this.column = column; return this; } @@ -21858,7 +24362,7 @@ public class Hbase { if (value == null) { unsetTableName(); } else { - setTableName((byte[])value); + setTableName((ByteBuffer)value); } break; @@ -21866,7 +24370,7 @@ public class Hbase { if (value == null) { unsetRow(); } else { - setRow((byte[])value); + setRow((ByteBuffer)value); } break; @@ -21874,7 +24378,7 @@ public class Hbase { if (value == null) { unsetColumn(); } else { - setColumn((byte[])value); + setColumn((ByteBuffer)value); } break; @@ -21889,10 +24393,6 @@ public class Hbase { } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case TABLE_NAME: @@ -21911,12 +24411,12 @@ public class Hbase { 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 TABLE_NAME: return isSetTableName(); @@ -21930,10 +24430,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -21952,7 +24448,7 @@ public class Hbase { if (this_present_tableName || that_present_tableName) { if (!(this_present_tableName && that_present_tableName)) return false; - if (!java.util.Arrays.equals(this.tableName, that.tableName)) + if (!this.tableName.equals(that.tableName)) return false; } @@ -21961,7 +24457,7 @@ public class Hbase { 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; } @@ -21970,7 +24466,7 @@ public class Hbase { if (this_present_column || that_present_column) { if (!(this_present_column && that_present_column)) return false; - if (!java.util.Arrays.equals(this.column, that.column)) + if (!this.column.equals(that.column)) return false; } @@ -22021,87 +24517,96 @@ public class Hbase { int lastComparison = 0; deleteAllTs_args typedOther = (deleteAllTs_args)other; - lastComparison = Boolean.valueOf(isSetTableName()).compareTo(isSetTableName()); + lastComparison = Boolean.valueOf(isSetTableName()).compareTo(typedOther.isSetTableName()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(tableName, typedOther.tableName); - if (lastComparison != 0) { - return lastComparison; + if (isSetTableName()) { + lastComparison = TBaseHelper.compareTo(this.tableName, typedOther.tableName); + if (lastComparison != 0) { + return lastComparison; + } } - 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(isSetColumn()).compareTo(isSetColumn()); + lastComparison = Boolean.valueOf(isSetColumn()).compareTo(typedOther.isSetColumn()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(column, typedOther.column); - if (lastComparison != 0) { - return lastComparison; + if (isSetColumn()) { + lastComparison = TBaseHelper.compareTo(this.column, typedOther.column); + if (lastComparison != 0) { + return lastComparison; + } } - lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(isSetTimestamp()); + lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(typedOther.isSetTimestamp()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(timestamp, typedOther.timestamp); - if (lastComparison != 0) { - return lastComparison; + if (isSetTimestamp()) { + lastComparison = TBaseHelper.compareTo(this.timestamp, typedOther.timestamp); + 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 TABLE_NAME: - if (field.type == TType.STRING) { - this.tableName = iprot.readBinary(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case ROW: - if (field.type == TType.STRING) { - this.row = iprot.readBinary(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case COLUMN: - if (field.type == TType.STRING) { - this.column = iprot.readBinary(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case TIMESTAMP: - if (field.type == TType.I64) { - this.timestamp = iprot.readI64(); - setTimestampIsSet(true); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); - } + switch (field.id) { + case 1: // TABLE_NAME + if (field.type == TType.STRING) { + this.tableName = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 2: // ROW + if (field.type == TType.STRING) { + this.row = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 3: // COLUMN + if (field.type == TType.STRING) { + this.column = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 4: // TIMESTAMP + if (field.type == TType.I64) { + this.timestamp = iprot.readI64(); + setTimestampIsSet(true); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + } + iprot.readFieldEnd(); } iprot.readStructEnd(); @@ -22177,7 +24682,7 @@ public class Hbase { } - public static class deleteAllTs_result implements TBase, java.io.Serializable, Cloneable, Comparable { + public static class deleteAllTs_result implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("deleteAllTs_result"); private static final TField IO_FIELD_DESC = new TField("io", TType.STRUCT, (short)1); @@ -22188,12 +24693,10 @@ public class Hbase { public enum _Fields implements TFieldIdEnum { IO((short)1, "io"); - 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); } } @@ -22202,7 +24705,12 @@ public class Hbase { * 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: // IO + return IO; + default: + return null; + } } /** @@ -22241,12 +24749,12 @@ public class Hbase { // isset id assignments - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRUCT))); - }}); - + public static final Map<_Fields, FieldMetaData> metaDataMap; static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(deleteAllTs_result.class, metaDataMap); } @@ -22273,9 +24781,9 @@ public class Hbase { return new deleteAllTs_result(this); } - @Deprecated - public deleteAllTs_result clone() { - return new deleteAllTs_result(this); + @Override + public void clear() { + this.io = null; } public IOError getIo() { @@ -22315,10 +24823,6 @@ public class Hbase { } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case IO: @@ -22328,12 +24832,12 @@ public class Hbase { 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 IO: return isSetIo(); @@ -22341,10 +24845,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -22390,42 +24890,45 @@ public class Hbase { int lastComparison = 0; deleteAllTs_result typedOther = (deleteAllTs_result)other; - lastComparison = Boolean.valueOf(isSetIo()).compareTo(isSetIo()); + lastComparison = Boolean.valueOf(isSetIo()).compareTo(typedOther.isSetIo()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(io, typedOther.io); - if (lastComparison != 0) { - return lastComparison; + if (isSetIo()) { + lastComparison = TBaseHelper.compareTo(this.io, typedOther.io); + 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 IO: - if (field.type == TType.STRUCT) { - this.io = new IOError(); - this.io.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); + switch (field.id) { + case 1: // IO + if (field.type == TType.STRUCT) { + this.io = new IOError(); + this.io.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); } + iprot.readFieldEnd(); } iprot.readStructEnd(); @@ -22467,7 +24970,7 @@ public class Hbase { } - public static class deleteAllRow_args implements TBase, java.io.Serializable, Cloneable, Comparable { + public static class deleteAllRow_args implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("deleteAllRow_args"); private static final TField TABLE_NAME_FIELD_DESC = new TField("tableName", TType.STRING, (short)1); @@ -22476,11 +24979,11 @@ public class Hbase { /** * name of table */ - public byte[] tableName; + public ByteBuffer tableName; /** * key of the row to be completely deleted. */ - public byte[] row; + public ByteBuffer row; /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements TFieldIdEnum { @@ -22493,12 +24996,10 @@ public class Hbase { */ ROW((short)2, "row"); - 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); } } @@ -22507,7 +25008,14 @@ public class Hbase { * 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: // TABLE_NAME + return TABLE_NAME; + case 2: // ROW + return ROW; + default: + return null; + } } /** @@ -22546,14 +25054,14 @@ public class Hbase { // isset id assignments - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.TABLE_NAME, new FieldMetaData("tableName", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(_Fields.ROW, new FieldMetaData("row", 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.TABLE_NAME, new FieldMetaData("tableName", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING , "Text"))); + tmpMap.put(_Fields.ROW, new FieldMetaData("row", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING , "Text"))); + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(deleteAllRow_args.class, metaDataMap); } @@ -22561,8 +25069,8 @@ public class Hbase { } public deleteAllRow_args( - byte[] tableName, - byte[] row) + ByteBuffer tableName, + ByteBuffer row) { this(); this.tableName = tableName; @@ -22585,22 +25093,33 @@ public class Hbase { return new deleteAllRow_args(this); } - @Deprecated - public deleteAllRow_args clone() { - return new deleteAllRow_args(this); + @Override + public void clear() { + this.tableName = null; + this.row = null; } /** * name of table */ public byte[] getTableName() { - return this.tableName; + setTableName(TBaseHelper.rightSize(tableName)); + return tableName.array(); + } + + public ByteBuffer BufferForTableName() { + return tableName; } /** * name of table */ public deleteAllRow_args setTableName(byte[] tableName) { + setTableName(ByteBuffer.wrap(tableName)); + return this; + } + + public deleteAllRow_args setTableName(ByteBuffer tableName) { this.tableName = tableName; return this; } @@ -22624,13 +25143,23 @@ public class Hbase { * key of the row to be completely deleted. */ public byte[] getRow() { - return this.row; + setRow(TBaseHelper.rightSize(row)); + return row.array(); + } + + public ByteBuffer BufferForRow() { + return row; } /** * key of the row to be completely deleted. */ public deleteAllRow_args setRow(byte[] row) { + setRow(ByteBuffer.wrap(row)); + return this; + } + + public deleteAllRow_args setRow(ByteBuffer row) { this.row = row; return this; } @@ -22656,7 +25185,7 @@ public class Hbase { if (value == null) { unsetTableName(); } else { - setTableName((byte[])value); + setTableName((ByteBuffer)value); } break; @@ -22664,17 +25193,13 @@ public class Hbase { if (value == null) { unsetRow(); } else { - setRow((byte[])value); + setRow((ByteBuffer)value); } break; } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case TABLE_NAME: @@ -22687,12 +25212,12 @@ public class Hbase { 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 TABLE_NAME: return isSetTableName(); @@ -22702,10 +25227,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -22724,7 +25245,7 @@ public class Hbase { if (this_present_tableName || that_present_tableName) { if (!(this_present_tableName && that_present_tableName)) return false; - if (!java.util.Arrays.equals(this.tableName, that.tableName)) + if (!this.tableName.equals(that.tableName)) return false; } @@ -22733,7 +25254,7 @@ public class Hbase { 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; } @@ -22765,56 +25286,61 @@ public class Hbase { int lastComparison = 0; deleteAllRow_args typedOther = (deleteAllRow_args)other; - lastComparison = Boolean.valueOf(isSetTableName()).compareTo(isSetTableName()); + lastComparison = Boolean.valueOf(isSetTableName()).compareTo(typedOther.isSetTableName()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(tableName, typedOther.tableName); - if (lastComparison != 0) { - return lastComparison; + if (isSetTableName()) { + lastComparison = TBaseHelper.compareTo(this.tableName, typedOther.tableName); + if (lastComparison != 0) { + return lastComparison; + } } - 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; + } } 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 TABLE_NAME: - if (field.type == TType.STRING) { - this.tableName = iprot.readBinary(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case ROW: - if (field.type == TType.STRING) { - this.row = iprot.readBinary(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); - } + switch (field.id) { + case 1: // TABLE_NAME + if (field.type == TType.STRING) { + this.tableName = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 2: // ROW + if (field.type == TType.STRING) { + this.row = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + } + iprot.readFieldEnd(); } iprot.readStructEnd(); @@ -22870,7 +25396,7 @@ public class Hbase { } - public static class deleteAllRow_result implements TBase, java.io.Serializable, Cloneable, Comparable { + public static class deleteAllRow_result implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("deleteAllRow_result"); private static final TField IO_FIELD_DESC = new TField("io", TType.STRUCT, (short)1); @@ -22881,12 +25407,10 @@ public class Hbase { public enum _Fields implements TFieldIdEnum { IO((short)1, "io"); - 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); } } @@ -22895,7 +25419,12 @@ public class Hbase { * 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: // IO + return IO; + default: + return null; + } } /** @@ -22934,12 +25463,12 @@ public class Hbase { // isset id assignments - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRUCT))); - }}); - + public static final Map<_Fields, FieldMetaData> metaDataMap; static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(deleteAllRow_result.class, metaDataMap); } @@ -22966,9 +25495,9 @@ public class Hbase { return new deleteAllRow_result(this); } - @Deprecated - public deleteAllRow_result clone() { - return new deleteAllRow_result(this); + @Override + public void clear() { + this.io = null; } public IOError getIo() { @@ -23008,10 +25537,6 @@ public class Hbase { } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case IO: @@ -23021,12 +25546,12 @@ public class Hbase { 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 IO: return isSetIo(); @@ -23034,10 +25559,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -23083,42 +25604,45 @@ public class Hbase { int lastComparison = 0; deleteAllRow_result typedOther = (deleteAllRow_result)other; - lastComparison = Boolean.valueOf(isSetIo()).compareTo(isSetIo()); + lastComparison = Boolean.valueOf(isSetIo()).compareTo(typedOther.isSetIo()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(io, typedOther.io); - if (lastComparison != 0) { - return lastComparison; + if (isSetIo()) { + lastComparison = TBaseHelper.compareTo(this.io, typedOther.io); + 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 IO: - if (field.type == TType.STRUCT) { - this.io = new IOError(); - this.io.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); + switch (field.id) { + case 1: // IO + if (field.type == TType.STRUCT) { + this.io = new IOError(); + this.io.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); } + iprot.readFieldEnd(); } iprot.readStructEnd(); @@ -23160,7 +25684,7 @@ public class Hbase { } - public static class deleteAllRowTs_args implements TBase, java.io.Serializable, Cloneable, Comparable { + public static class deleteAllRowTs_args implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("deleteAllRowTs_args"); private static final TField TABLE_NAME_FIELD_DESC = new TField("tableName", TType.STRING, (short)1); @@ -23170,11 +25694,11 @@ public class Hbase { /** * name of table */ - public byte[] tableName; + public ByteBuffer tableName; /** * key of the row to be completely deleted. */ - public byte[] row; + public ByteBuffer row; /** * timestamp */ @@ -23195,12 +25719,10 @@ public class Hbase { */ TIMESTAMP((short)3, "timestamp"); - 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); } } @@ -23209,7 +25731,16 @@ public class Hbase { * 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: // TABLE_NAME + return TABLE_NAME; + case 2: // ROW + return ROW; + case 3: // TIMESTAMP + return TIMESTAMP; + default: + return null; + } } /** @@ -23250,16 +25781,16 @@ public class Hbase { private static final int __TIMESTAMP_ISSET_ID = 0; private BitSet __isset_bit_vector = new BitSet(1); - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.TABLE_NAME, new FieldMetaData("tableName", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(_Fields.ROW, new FieldMetaData("row", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(_Fields.TIMESTAMP, new FieldMetaData("timestamp", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.I64))); - }}); - + public static final Map<_Fields, FieldMetaData> metaDataMap; static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.TABLE_NAME, new FieldMetaData("tableName", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING , "Text"))); + tmpMap.put(_Fields.ROW, new FieldMetaData("row", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING , "Text"))); + tmpMap.put(_Fields.TIMESTAMP, new FieldMetaData("timestamp", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.I64))); + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(deleteAllRowTs_args.class, metaDataMap); } @@ -23267,8 +25798,8 @@ public class Hbase { } public deleteAllRowTs_args( - byte[] tableName, - byte[] row, + ByteBuffer tableName, + ByteBuffer row, long timestamp) { this(); @@ -23297,22 +25828,35 @@ public class Hbase { return new deleteAllRowTs_args(this); } - @Deprecated - public deleteAllRowTs_args clone() { - return new deleteAllRowTs_args(this); + @Override + public void clear() { + this.tableName = null; + this.row = null; + setTimestampIsSet(false); + this.timestamp = 0; } /** * name of table */ public byte[] getTableName() { - return this.tableName; + setTableName(TBaseHelper.rightSize(tableName)); + return tableName.array(); + } + + public ByteBuffer BufferForTableName() { + return tableName; } /** * name of table */ public deleteAllRowTs_args setTableName(byte[] tableName) { + setTableName(ByteBuffer.wrap(tableName)); + return this; + } + + public deleteAllRowTs_args setTableName(ByteBuffer tableName) { this.tableName = tableName; return this; } @@ -23336,13 +25880,23 @@ public class Hbase { * key of the row to be completely deleted. */ public byte[] getRow() { - return this.row; + setRow(TBaseHelper.rightSize(row)); + return row.array(); + } + + public ByteBuffer BufferForRow() { + return row; } /** * key of the row to be completely deleted. */ public deleteAllRowTs_args setRow(byte[] row) { + setRow(ByteBuffer.wrap(row)); + return this; + } + + public deleteAllRowTs_args setRow(ByteBuffer row) { this.row = row; return this; } @@ -23397,7 +25951,7 @@ public class Hbase { if (value == null) { unsetTableName(); } else { - setTableName((byte[])value); + setTableName((ByteBuffer)value); } break; @@ -23405,7 +25959,7 @@ public class Hbase { if (value == null) { unsetRow(); } else { - setRow((byte[])value); + setRow((ByteBuffer)value); } break; @@ -23420,10 +25974,6 @@ public class Hbase { } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case TABLE_NAME: @@ -23439,12 +25989,12 @@ public class Hbase { 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 TABLE_NAME: return isSetTableName(); @@ -23456,10 +26006,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -23478,7 +26024,7 @@ public class Hbase { if (this_present_tableName || that_present_tableName) { if (!(this_present_tableName && that_present_tableName)) return false; - if (!java.util.Arrays.equals(this.tableName, that.tableName)) + if (!this.tableName.equals(that.tableName)) return false; } @@ -23487,7 +26033,7 @@ public class Hbase { 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; } @@ -23533,72 +26079,79 @@ public class Hbase { int lastComparison = 0; deleteAllRowTs_args typedOther = (deleteAllRowTs_args)other; - lastComparison = Boolean.valueOf(isSetTableName()).compareTo(isSetTableName()); + lastComparison = Boolean.valueOf(isSetTableName()).compareTo(typedOther.isSetTableName()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(tableName, typedOther.tableName); - if (lastComparison != 0) { - return lastComparison; + if (isSetTableName()) { + lastComparison = TBaseHelper.compareTo(this.tableName, typedOther.tableName); + if (lastComparison != 0) { + return lastComparison; + } } - 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(isSetTimestamp()).compareTo(isSetTimestamp()); + lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(typedOther.isSetTimestamp()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(timestamp, typedOther.timestamp); - if (lastComparison != 0) { - return lastComparison; + if (isSetTimestamp()) { + lastComparison = TBaseHelper.compareTo(this.timestamp, typedOther.timestamp); + 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 TABLE_NAME: - if (field.type == TType.STRING) { - this.tableName = iprot.readBinary(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case ROW: - if (field.type == TType.STRING) { - this.row = iprot.readBinary(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case TIMESTAMP: - if (field.type == TType.I64) { - this.timestamp = iprot.readI64(); - setTimestampIsSet(true); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); - } + switch (field.id) { + case 1: // TABLE_NAME + if (field.type == TType.STRING) { + this.tableName = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 2: // ROW + if (field.type == TType.STRING) { + this.row = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 3: // TIMESTAMP + if (field.type == TType.I64) { + this.timestamp = iprot.readI64(); + setTimestampIsSet(true); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + } + iprot.readFieldEnd(); } iprot.readStructEnd(); @@ -23661,7 +26214,7 @@ public class Hbase { } - public static class deleteAllRowTs_result implements TBase, java.io.Serializable, Cloneable, Comparable { + public static class deleteAllRowTs_result implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("deleteAllRowTs_result"); private static final TField IO_FIELD_DESC = new TField("io", TType.STRUCT, (short)1); @@ -23672,12 +26225,10 @@ public class Hbase { public enum _Fields implements TFieldIdEnum { IO((short)1, "io"); - 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); } } @@ -23686,7 +26237,12 @@ public class Hbase { * 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: // IO + return IO; + default: + return null; + } } /** @@ -23725,12 +26281,12 @@ public class Hbase { // isset id assignments - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRUCT))); - }}); - + public static final Map<_Fields, FieldMetaData> metaDataMap; static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(deleteAllRowTs_result.class, metaDataMap); } @@ -23757,9 +26313,9 @@ public class Hbase { return new deleteAllRowTs_result(this); } - @Deprecated - public deleteAllRowTs_result clone() { - return new deleteAllRowTs_result(this); + @Override + public void clear() { + this.io = null; } public IOError getIo() { @@ -23799,10 +26355,6 @@ public class Hbase { } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case IO: @@ -23812,12 +26364,12 @@ public class Hbase { 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 IO: return isSetIo(); @@ -23825,10 +26377,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -23874,42 +26422,45 @@ public class Hbase { int lastComparison = 0; deleteAllRowTs_result typedOther = (deleteAllRowTs_result)other; - lastComparison = Boolean.valueOf(isSetIo()).compareTo(isSetIo()); + lastComparison = Boolean.valueOf(isSetIo()).compareTo(typedOther.isSetIo()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(io, typedOther.io); - if (lastComparison != 0) { - return lastComparison; + if (isSetIo()) { + lastComparison = TBaseHelper.compareTo(this.io, typedOther.io); + 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 IO: - if (field.type == TType.STRUCT) { - this.io = new IOError(); - this.io.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); + switch (field.id) { + case 1: // IO + if (field.type == TType.STRUCT) { + this.io = new IOError(); + this.io.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); } + iprot.readFieldEnd(); } iprot.readStructEnd(); @@ -23951,7 +26502,7 @@ public class Hbase { } - public static class scannerOpen_args implements TBase, java.io.Serializable, Cloneable, Comparable { + public static class scannerOpen_args implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("scannerOpen_args"); private static final TField TABLE_NAME_FIELD_DESC = new TField("tableName", TType.STRING, (short)1); @@ -23961,18 +26512,18 @@ public class Hbase { /** * name of table */ - public byte[] tableName; + public ByteBuffer tableName; /** * Starting row in table to scan. * Send "" (empty string) to start at the first row. */ - public byte[] startRow; + public ByteBuffer startRow; /** * 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 List columns; + public List columns; /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements TFieldIdEnum { @@ -23992,12 +26543,10 @@ public class Hbase { */ COLUMNS((short)3, "columns"); - 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); } } @@ -24006,7 +26555,16 @@ public class Hbase { * 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: // TABLE_NAME + return TABLE_NAME; + case 2: // START_ROW + return START_ROW; + case 3: // COLUMNS + return COLUMNS; + default: + return null; + } } /** @@ -24045,17 +26603,17 @@ public class Hbase { // isset id assignments - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.TABLE_NAME, new FieldMetaData("tableName", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(_Fields.START_ROW, new FieldMetaData("startRow", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(_Fields.COLUMNS, new FieldMetaData("columns", TFieldRequirementType.DEFAULT, - new ListMetaData(TType.LIST, - 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.TABLE_NAME, new FieldMetaData("tableName", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING , "Text"))); + tmpMap.put(_Fields.START_ROW, new FieldMetaData("startRow", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING , "Text"))); + tmpMap.put(_Fields.COLUMNS, new FieldMetaData("columns", TFieldRequirementType.DEFAULT, + new ListMetaData(TType.LIST, + new FieldValueMetaData(TType.STRING , "Text")))); + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(scannerOpen_args.class, metaDataMap); } @@ -24063,9 +26621,9 @@ public class Hbase { } public scannerOpen_args( - byte[] tableName, - byte[] startRow, - List columns) + ByteBuffer tableName, + ByteBuffer startRow, + List columns) { this(); this.tableName = tableName; @@ -24084,8 +26642,8 @@ public class Hbase { this.startRow = other.startRow; } if (other.isSetColumns()) { - List __this__columns = new ArrayList(); - for (byte[] other_element : other.columns) { + List __this__columns = new ArrayList(); + for (ByteBuffer other_element : other.columns) { __this__columns.add(other_element); } this.columns = __this__columns; @@ -24096,22 +26654,34 @@ public class Hbase { return new scannerOpen_args(this); } - @Deprecated - public scannerOpen_args clone() { - return new scannerOpen_args(this); + @Override + public void clear() { + this.tableName = null; + this.startRow = null; + this.columns = null; } /** * name of table */ public byte[] getTableName() { - return this.tableName; + setTableName(TBaseHelper.rightSize(tableName)); + return tableName.array(); + } + + public ByteBuffer BufferForTableName() { + return tableName; } /** * name of table */ public scannerOpen_args setTableName(byte[] tableName) { + setTableName(ByteBuffer.wrap(tableName)); + return this; + } + + public scannerOpen_args setTableName(ByteBuffer tableName) { this.tableName = tableName; return this; } @@ -24136,7 +26706,12 @@ public class Hbase { * Send "" (empty string) to start at the first row. */ public byte[] getStartRow() { - return this.startRow; + setStartRow(TBaseHelper.rightSize(startRow)); + return startRow.array(); + } + + public ByteBuffer BufferForStartRow() { + return startRow; } /** @@ -24144,6 +26719,11 @@ public class Hbase { * Send "" (empty string) to start at the first row. */ public scannerOpen_args setStartRow(byte[] startRow) { + setStartRow(ByteBuffer.wrap(startRow)); + return this; + } + + public scannerOpen_args setStartRow(ByteBuffer startRow) { this.startRow = startRow; return this; } @@ -24167,13 +26747,13 @@ public class Hbase { return (this.columns == null) ? 0 : this.columns.size(); } - public java.util.Iterator getColumnsIterator() { + public java.util.Iterator getColumnsIterator() { return (this.columns == null) ? null : this.columns.iterator(); } - public void addToColumns(byte[] elem) { + public void addToColumns(ByteBuffer elem) { if (this.columns == null) { - this.columns = new ArrayList(); + this.columns = new ArrayList(); } this.columns.add(elem); } @@ -24183,7 +26763,7 @@ public class Hbase { * columns of the specified column family are returned. It's also possible * to pass a regex in the column qualifier. */ - public List getColumns() { + public List getColumns() { return this.columns; } @@ -24192,7 +26772,7 @@ public class Hbase { * columns of the specified column family are returned. It's also possible * to pass a regex in the column qualifier. */ - public scannerOpen_args setColumns(List columns) { + public scannerOpen_args setColumns(List columns) { this.columns = columns; return this; } @@ -24218,7 +26798,7 @@ public class Hbase { if (value == null) { unsetTableName(); } else { - setTableName((byte[])value); + setTableName((ByteBuffer)value); } break; @@ -24226,7 +26806,7 @@ public class Hbase { if (value == null) { unsetStartRow(); } else { - setStartRow((byte[])value); + setStartRow((ByteBuffer)value); } break; @@ -24234,17 +26814,13 @@ public class Hbase { if (value == null) { unsetColumns(); } else { - setColumns((List)value); + setColumns((List)value); } break; } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case TABLE_NAME: @@ -24260,12 +26836,12 @@ public class Hbase { 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 TABLE_NAME: return isSetTableName(); @@ -24277,10 +26853,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -24299,7 +26871,7 @@ public class Hbase { if (this_present_tableName || that_present_tableName) { if (!(this_present_tableName && that_present_tableName)) return false; - if (!java.util.Arrays.equals(this.tableName, that.tableName)) + if (!this.tableName.equals(that.tableName)) return false; } @@ -24308,7 +26880,7 @@ public class Hbase { if (this_present_startRow || that_present_startRow) { if (!(this_present_startRow && that_present_startRow)) return false; - if (!java.util.Arrays.equals(this.startRow, that.startRow)) + if (!this.startRow.equals(that.startRow)) return false; } @@ -24354,81 +26926,88 @@ public class Hbase { int lastComparison = 0; scannerOpen_args typedOther = (scannerOpen_args)other; - lastComparison = Boolean.valueOf(isSetTableName()).compareTo(isSetTableName()); + lastComparison = Boolean.valueOf(isSetTableName()).compareTo(typedOther.isSetTableName()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(tableName, typedOther.tableName); - if (lastComparison != 0) { - return lastComparison; + if (isSetTableName()) { + lastComparison = TBaseHelper.compareTo(this.tableName, typedOther.tableName); + if (lastComparison != 0) { + return lastComparison; + } } - lastComparison = Boolean.valueOf(isSetStartRow()).compareTo(isSetStartRow()); + lastComparison = Boolean.valueOf(isSetStartRow()).compareTo(typedOther.isSetStartRow()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(startRow, typedOther.startRow); - if (lastComparison != 0) { - return lastComparison; + if (isSetStartRow()) { + lastComparison = TBaseHelper.compareTo(this.startRow, typedOther.startRow); + if (lastComparison != 0) { + return lastComparison; + } } - lastComparison = Boolean.valueOf(isSetColumns()).compareTo(isSetColumns()); + lastComparison = Boolean.valueOf(isSetColumns()).compareTo(typedOther.isSetColumns()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(columns, typedOther.columns); - if (lastComparison != 0) { - return lastComparison; + if (isSetColumns()) { + lastComparison = TBaseHelper.compareTo(this.columns, typedOther.columns); + 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 TABLE_NAME: - if (field.type == TType.STRING) { - this.tableName = iprot.readBinary(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case START_ROW: - if (field.type == TType.STRING) { - this.startRow = iprot.readBinary(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case COLUMNS: - if (field.type == TType.LIST) { + switch (field.id) { + case 1: // TABLE_NAME + if (field.type == TType.STRING) { + this.tableName = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 2: // START_ROW + if (field.type == TType.STRING) { + this.startRow = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 3: // COLUMNS + if (field.type == TType.LIST) { + { + TList _list78 = iprot.readListBegin(); + this.columns = new ArrayList(_list78.size); + for (int _i79 = 0; _i79 < _list78.size; ++_i79) { - TList _list78 = iprot.readListBegin(); - this.columns = new ArrayList(_list78.size); - for (int _i79 = 0; _i79 < _list78.size; ++_i79) - { - byte[] _elem80; - _elem80 = iprot.readBinary(); - this.columns.add(_elem80); - } - iprot.readListEnd(); + ByteBuffer _elem80; + _elem80 = iprot.readBinary(); + this.columns.add(_elem80); } - } 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(); @@ -24454,7 +27033,7 @@ public class Hbase { oprot.writeFieldBegin(COLUMNS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRING, this.columns.size())); - for (byte[] _iter81 : this.columns) + for (ByteBuffer _iter81 : this.columns) { oprot.writeBinary(_iter81); } @@ -24504,7 +27083,7 @@ public class Hbase { } - public static class scannerOpen_result implements TBase, java.io.Serializable, Cloneable, Comparable { + public static class scannerOpen_result implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("scannerOpen_result"); private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.I32, (short)0); @@ -24518,12 +27097,10 @@ public class Hbase { SUCCESS((short)0, "success"), IO((short)1, "io"); - 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); } } @@ -24532,7 +27109,14 @@ public class Hbase { * 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 0: // SUCCESS + return SUCCESS; + case 1: // IO + return IO; + default: + return null; + } } /** @@ -24573,14 +27157,14 @@ public class Hbase { private static final int __SUCCESS_ISSET_ID = 0; private BitSet __isset_bit_vector = new BitSet(1); - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.I32))); - put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRUCT))); - }}); - + public static final Map<_Fields, FieldMetaData> metaDataMap; static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.I32 , "ScannerID"))); + tmpMap.put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(scannerOpen_result.class, metaDataMap); } @@ -24613,9 +27197,11 @@ public class Hbase { return new scannerOpen_result(this); } - @Deprecated - public scannerOpen_result clone() { - return new scannerOpen_result(this); + @Override + public void clear() { + setSuccessIsSet(false); + this.success = 0; + this.io = null; } public int getSuccess() { @@ -24686,10 +27272,6 @@ public class Hbase { } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: @@ -24702,12 +27284,12 @@ public class Hbase { 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 SUCCESS: return isSetSuccess(); @@ -24717,10 +27299,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -24780,58 +27358,63 @@ public class Hbase { int lastComparison = 0; scannerOpen_result typedOther = (scannerOpen_result)other; - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess()); + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(success, typedOther.success); - if (lastComparison != 0) { - return lastComparison; + if (isSetSuccess()) { + lastComparison = TBaseHelper.compareTo(this.success, typedOther.success); + if (lastComparison != 0) { + return lastComparison; + } } - lastComparison = Boolean.valueOf(isSetIo()).compareTo(isSetIo()); + lastComparison = Boolean.valueOf(isSetIo()).compareTo(typedOther.isSetIo()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(io, typedOther.io); - if (lastComparison != 0) { - return lastComparison; + if (isSetIo()) { + lastComparison = TBaseHelper.compareTo(this.io, typedOther.io); + 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 SUCCESS: - if (field.type == TType.I32) { - this.success = iprot.readI32(); - setSuccessIsSet(true); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case IO: - if (field.type == TType.STRUCT) { - this.io = new IOError(); - this.io.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); - } + switch (field.id) { + case 0: // SUCCESS + if (field.type == TType.I32) { + this.success = iprot.readI32(); + setSuccessIsSet(true); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 1: // IO + if (field.type == TType.STRUCT) { + this.io = new IOError(); + this.io.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + } + iprot.readFieldEnd(); } iprot.readStructEnd(); @@ -24881,7 +27464,7 @@ public class Hbase { } - public static class scannerOpenWithStop_args implements TBase, java.io.Serializable, Cloneable, Comparable { + public static class scannerOpenWithStop_args implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("scannerOpenWithStop_args"); private static final TField TABLE_NAME_FIELD_DESC = new TField("tableName", TType.STRING, (short)1); @@ -24892,23 +27475,23 @@ public class Hbase { /** * name of table */ - public byte[] tableName; + public ByteBuffer tableName; /** * Starting row in table to scan. * Send "" (empty string) to start at the first row. */ - public byte[] startRow; + public ByteBuffer startRow; /** * row to stop scanning on. This row is *not* included in the * scanner's results */ - public byte[] stopRow; + public ByteBuffer stopRow; /** * 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 List columns; + public List columns; /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements TFieldIdEnum { @@ -24933,12 +27516,10 @@ public class Hbase { */ COLUMNS((short)4, "columns"); - 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); } } @@ -24947,7 +27528,18 @@ public class Hbase { * 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: // TABLE_NAME + return TABLE_NAME; + case 2: // START_ROW + return START_ROW; + case 3: // STOP_ROW + return STOP_ROW; + case 4: // COLUMNS + return COLUMNS; + default: + return null; + } } /** @@ -24986,19 +27578,19 @@ public class Hbase { // isset id assignments - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.TABLE_NAME, new FieldMetaData("tableName", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(_Fields.START_ROW, new FieldMetaData("startRow", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(_Fields.STOP_ROW, new FieldMetaData("stopRow", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(_Fields.COLUMNS, new FieldMetaData("columns", TFieldRequirementType.DEFAULT, - new ListMetaData(TType.LIST, - 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.TABLE_NAME, new FieldMetaData("tableName", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING , "Text"))); + tmpMap.put(_Fields.START_ROW, new FieldMetaData("startRow", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING , "Text"))); + tmpMap.put(_Fields.STOP_ROW, new FieldMetaData("stopRow", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING , "Text"))); + tmpMap.put(_Fields.COLUMNS, new FieldMetaData("columns", TFieldRequirementType.DEFAULT, + new ListMetaData(TType.LIST, + new FieldValueMetaData(TType.STRING , "Text")))); + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(scannerOpenWithStop_args.class, metaDataMap); } @@ -25006,10 +27598,10 @@ public class Hbase { } public scannerOpenWithStop_args( - byte[] tableName, - byte[] startRow, - byte[] stopRow, - List columns) + ByteBuffer tableName, + ByteBuffer startRow, + ByteBuffer stopRow, + List columns) { this(); this.tableName = tableName; @@ -25032,8 +27624,8 @@ public class Hbase { this.stopRow = other.stopRow; } if (other.isSetColumns()) { - List __this__columns = new ArrayList(); - for (byte[] other_element : other.columns) { + List __this__columns = new ArrayList(); + for (ByteBuffer other_element : other.columns) { __this__columns.add(other_element); } this.columns = __this__columns; @@ -25044,22 +27636,35 @@ public class Hbase { return new scannerOpenWithStop_args(this); } - @Deprecated - public scannerOpenWithStop_args clone() { - return new scannerOpenWithStop_args(this); + @Override + public void clear() { + this.tableName = null; + this.startRow = null; + this.stopRow = null; + this.columns = null; } /** * name of table */ public byte[] getTableName() { - return this.tableName; + setTableName(TBaseHelper.rightSize(tableName)); + return tableName.array(); + } + + public ByteBuffer BufferForTableName() { + return tableName; } /** * name of table */ public scannerOpenWithStop_args setTableName(byte[] tableName) { + setTableName(ByteBuffer.wrap(tableName)); + return this; + } + + public scannerOpenWithStop_args setTableName(ByteBuffer tableName) { this.tableName = tableName; return this; } @@ -25084,7 +27689,12 @@ public class Hbase { * Send "" (empty string) to start at the first row. */ public byte[] getStartRow() { - return this.startRow; + setStartRow(TBaseHelper.rightSize(startRow)); + return startRow.array(); + } + + public ByteBuffer BufferForStartRow() { + return startRow; } /** @@ -25092,6 +27702,11 @@ public class Hbase { * Send "" (empty string) to start at the first row. */ public scannerOpenWithStop_args setStartRow(byte[] startRow) { + setStartRow(ByteBuffer.wrap(startRow)); + return this; + } + + public scannerOpenWithStop_args setStartRow(ByteBuffer startRow) { this.startRow = startRow; return this; } @@ -25116,7 +27731,12 @@ public class Hbase { * scanner's results */ public byte[] getStopRow() { - return this.stopRow; + setStopRow(TBaseHelper.rightSize(stopRow)); + return stopRow.array(); + } + + public ByteBuffer BufferForStopRow() { + return stopRow; } /** @@ -25124,6 +27744,11 @@ public class Hbase { * scanner's results */ public scannerOpenWithStop_args setStopRow(byte[] stopRow) { + setStopRow(ByteBuffer.wrap(stopRow)); + return this; + } + + public scannerOpenWithStop_args setStopRow(ByteBuffer stopRow) { this.stopRow = stopRow; return this; } @@ -25147,13 +27772,13 @@ public class Hbase { return (this.columns == null) ? 0 : this.columns.size(); } - public java.util.Iterator getColumnsIterator() { + public java.util.Iterator getColumnsIterator() { return (this.columns == null) ? null : this.columns.iterator(); } - public void addToColumns(byte[] elem) { + public void addToColumns(ByteBuffer elem) { if (this.columns == null) { - this.columns = new ArrayList(); + this.columns = new ArrayList(); } this.columns.add(elem); } @@ -25163,7 +27788,7 @@ public class Hbase { * columns of the specified column family are returned. It's also possible * to pass a regex in the column qualifier. */ - public List getColumns() { + public List getColumns() { return this.columns; } @@ -25172,7 +27797,7 @@ public class Hbase { * columns of the specified column family are returned. It's also possible * to pass a regex in the column qualifier. */ - public scannerOpenWithStop_args setColumns(List columns) { + public scannerOpenWithStop_args setColumns(List columns) { this.columns = columns; return this; } @@ -25198,7 +27823,7 @@ public class Hbase { if (value == null) { unsetTableName(); } else { - setTableName((byte[])value); + setTableName((ByteBuffer)value); } break; @@ -25206,7 +27831,7 @@ public class Hbase { if (value == null) { unsetStartRow(); } else { - setStartRow((byte[])value); + setStartRow((ByteBuffer)value); } break; @@ -25214,7 +27839,7 @@ public class Hbase { if (value == null) { unsetStopRow(); } else { - setStopRow((byte[])value); + setStopRow((ByteBuffer)value); } break; @@ -25222,17 +27847,13 @@ public class Hbase { if (value == null) { unsetColumns(); } else { - setColumns((List)value); + setColumns((List)value); } break; } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case TABLE_NAME: @@ -25251,12 +27872,12 @@ public class Hbase { 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 TABLE_NAME: return isSetTableName(); @@ -25270,10 +27891,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -25292,7 +27909,7 @@ public class Hbase { if (this_present_tableName || that_present_tableName) { if (!(this_present_tableName && that_present_tableName)) return false; - if (!java.util.Arrays.equals(this.tableName, that.tableName)) + if (!this.tableName.equals(that.tableName)) return false; } @@ -25301,7 +27918,7 @@ public class Hbase { if (this_present_startRow || that_present_startRow) { if (!(this_present_startRow && that_present_startRow)) return false; - if (!java.util.Arrays.equals(this.startRow, that.startRow)) + if (!this.startRow.equals(that.startRow)) return false; } @@ -25310,7 +27927,7 @@ public class Hbase { if (this_present_stopRow || that_present_stopRow) { if (!(this_present_stopRow && that_present_stopRow)) return false; - if (!java.util.Arrays.equals(this.stopRow, that.stopRow)) + if (!this.stopRow.equals(that.stopRow)) return false; } @@ -25361,96 +27978,105 @@ public class Hbase { int lastComparison = 0; scannerOpenWithStop_args typedOther = (scannerOpenWithStop_args)other; - lastComparison = Boolean.valueOf(isSetTableName()).compareTo(isSetTableName()); + lastComparison = Boolean.valueOf(isSetTableName()).compareTo(typedOther.isSetTableName()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(tableName, typedOther.tableName); - if (lastComparison != 0) { - return lastComparison; + if (isSetTableName()) { + lastComparison = TBaseHelper.compareTo(this.tableName, typedOther.tableName); + if (lastComparison != 0) { + return lastComparison; + } } - lastComparison = Boolean.valueOf(isSetStartRow()).compareTo(isSetStartRow()); + lastComparison = Boolean.valueOf(isSetStartRow()).compareTo(typedOther.isSetStartRow()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(startRow, typedOther.startRow); - if (lastComparison != 0) { - return lastComparison; + if (isSetStartRow()) { + lastComparison = TBaseHelper.compareTo(this.startRow, typedOther.startRow); + if (lastComparison != 0) { + return lastComparison; + } } - lastComparison = Boolean.valueOf(isSetStopRow()).compareTo(isSetStopRow()); + lastComparison = Boolean.valueOf(isSetStopRow()).compareTo(typedOther.isSetStopRow()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(stopRow, typedOther.stopRow); - if (lastComparison != 0) { - return lastComparison; + if (isSetStopRow()) { + lastComparison = TBaseHelper.compareTo(this.stopRow, typedOther.stopRow); + if (lastComparison != 0) { + return lastComparison; + } } - lastComparison = Boolean.valueOf(isSetColumns()).compareTo(isSetColumns()); + lastComparison = Boolean.valueOf(isSetColumns()).compareTo(typedOther.isSetColumns()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(columns, typedOther.columns); - if (lastComparison != 0) { - return lastComparison; + if (isSetColumns()) { + lastComparison = TBaseHelper.compareTo(this.columns, typedOther.columns); + 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 TABLE_NAME: - if (field.type == TType.STRING) { - this.tableName = iprot.readBinary(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case START_ROW: - if (field.type == TType.STRING) { - this.startRow = iprot.readBinary(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case STOP_ROW: - if (field.type == TType.STRING) { - this.stopRow = iprot.readBinary(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case COLUMNS: - if (field.type == TType.LIST) { + switch (field.id) { + case 1: // TABLE_NAME + if (field.type == TType.STRING) { + this.tableName = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 2: // START_ROW + if (field.type == TType.STRING) { + this.startRow = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 3: // STOP_ROW + if (field.type == TType.STRING) { + this.stopRow = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 4: // COLUMNS + if (field.type == TType.LIST) { + { + TList _list82 = iprot.readListBegin(); + this.columns = new ArrayList(_list82.size); + for (int _i83 = 0; _i83 < _list82.size; ++_i83) { - TList _list82 = iprot.readListBegin(); - this.columns = new ArrayList(_list82.size); - for (int _i83 = 0; _i83 < _list82.size; ++_i83) - { - byte[] _elem84; - _elem84 = iprot.readBinary(); - this.columns.add(_elem84); - } - iprot.readListEnd(); + ByteBuffer _elem84; + _elem84 = iprot.readBinary(); + this.columns.add(_elem84); } - } 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(); @@ -25481,7 +28107,7 @@ public class Hbase { oprot.writeFieldBegin(COLUMNS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRING, this.columns.size())); - for (byte[] _iter85 : this.columns) + for (ByteBuffer _iter85 : this.columns) { oprot.writeBinary(_iter85); } @@ -25539,7 +28165,7 @@ public class Hbase { } - public static class scannerOpenWithStop_result implements TBase, java.io.Serializable, Cloneable, Comparable { + public static class scannerOpenWithStop_result implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("scannerOpenWithStop_result"); private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.I32, (short)0); @@ -25553,12 +28179,10 @@ public class Hbase { SUCCESS((short)0, "success"), IO((short)1, "io"); - 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); } } @@ -25567,7 +28191,14 @@ public class Hbase { * 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 0: // SUCCESS + return SUCCESS; + case 1: // IO + return IO; + default: + return null; + } } /** @@ -25608,14 +28239,14 @@ public class Hbase { private static final int __SUCCESS_ISSET_ID = 0; private BitSet __isset_bit_vector = new BitSet(1); - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.I32))); - put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRUCT))); - }}); - + public static final Map<_Fields, FieldMetaData> metaDataMap; static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.I32 , "ScannerID"))); + tmpMap.put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(scannerOpenWithStop_result.class, metaDataMap); } @@ -25648,9 +28279,11 @@ public class Hbase { return new scannerOpenWithStop_result(this); } - @Deprecated - public scannerOpenWithStop_result clone() { - return new scannerOpenWithStop_result(this); + @Override + public void clear() { + setSuccessIsSet(false); + this.success = 0; + this.io = null; } public int getSuccess() { @@ -25721,10 +28354,6 @@ public class Hbase { } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: @@ -25737,12 +28366,12 @@ public class Hbase { 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 SUCCESS: return isSetSuccess(); @@ -25752,10 +28381,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -25815,58 +28440,63 @@ public class Hbase { int lastComparison = 0; scannerOpenWithStop_result typedOther = (scannerOpenWithStop_result)other; - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess()); + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(success, typedOther.success); - if (lastComparison != 0) { - return lastComparison; + if (isSetSuccess()) { + lastComparison = TBaseHelper.compareTo(this.success, typedOther.success); + if (lastComparison != 0) { + return lastComparison; + } } - lastComparison = Boolean.valueOf(isSetIo()).compareTo(isSetIo()); + lastComparison = Boolean.valueOf(isSetIo()).compareTo(typedOther.isSetIo()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(io, typedOther.io); - if (lastComparison != 0) { - return lastComparison; + if (isSetIo()) { + lastComparison = TBaseHelper.compareTo(this.io, typedOther.io); + 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 SUCCESS: - if (field.type == TType.I32) { - this.success = iprot.readI32(); - setSuccessIsSet(true); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case IO: - if (field.type == TType.STRUCT) { - this.io = new IOError(); - this.io.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); - } + switch (field.id) { + case 0: // SUCCESS + if (field.type == TType.I32) { + this.success = iprot.readI32(); + setSuccessIsSet(true); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 1: // IO + if (field.type == TType.STRUCT) { + this.io = new IOError(); + this.io.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + } + iprot.readFieldEnd(); } iprot.readStructEnd(); @@ -25916,7 +28546,7 @@ public class Hbase { } - public static class scannerOpenWithPrefix_args implements TBase, java.io.Serializable, Cloneable, Comparable { + public static class scannerOpenWithPrefix_args implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("scannerOpenWithPrefix_args"); private static final TField TABLE_NAME_FIELD_DESC = new TField("tableName", TType.STRING, (short)1); @@ -25926,15 +28556,15 @@ public class Hbase { /** * name of table */ - public byte[] tableName; + public ByteBuffer tableName; /** * the prefix (and thus start row) of the keys you want */ - public byte[] startAndPrefix; + public ByteBuffer startAndPrefix; /** * the columns you want returned */ - public List columns; + public List columns; /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements TFieldIdEnum { @@ -25951,12 +28581,10 @@ public class Hbase { */ COLUMNS((short)3, "columns"); - 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); } } @@ -25965,7 +28593,16 @@ public class Hbase { * 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: // TABLE_NAME + return TABLE_NAME; + case 2: // START_AND_PREFIX + return START_AND_PREFIX; + case 3: // COLUMNS + return COLUMNS; + default: + return null; + } } /** @@ -26004,17 +28641,17 @@ public class Hbase { // isset id assignments - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.TABLE_NAME, new FieldMetaData("tableName", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(_Fields.START_AND_PREFIX, new FieldMetaData("startAndPrefix", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(_Fields.COLUMNS, new FieldMetaData("columns", TFieldRequirementType.DEFAULT, - new ListMetaData(TType.LIST, - 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.TABLE_NAME, new FieldMetaData("tableName", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING , "Text"))); + tmpMap.put(_Fields.START_AND_PREFIX, new FieldMetaData("startAndPrefix", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING , "Text"))); + tmpMap.put(_Fields.COLUMNS, new FieldMetaData("columns", TFieldRequirementType.DEFAULT, + new ListMetaData(TType.LIST, + new FieldValueMetaData(TType.STRING , "Text")))); + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(scannerOpenWithPrefix_args.class, metaDataMap); } @@ -26022,9 +28659,9 @@ public class Hbase { } public scannerOpenWithPrefix_args( - byte[] tableName, - byte[] startAndPrefix, - List columns) + ByteBuffer tableName, + ByteBuffer startAndPrefix, + List columns) { this(); this.tableName = tableName; @@ -26043,8 +28680,8 @@ public class Hbase { this.startAndPrefix = other.startAndPrefix; } if (other.isSetColumns()) { - List __this__columns = new ArrayList(); - for (byte[] other_element : other.columns) { + List __this__columns = new ArrayList(); + for (ByteBuffer other_element : other.columns) { __this__columns.add(other_element); } this.columns = __this__columns; @@ -26055,22 +28692,34 @@ public class Hbase { return new scannerOpenWithPrefix_args(this); } - @Deprecated - public scannerOpenWithPrefix_args clone() { - return new scannerOpenWithPrefix_args(this); + @Override + public void clear() { + this.tableName = null; + this.startAndPrefix = null; + this.columns = null; } /** * name of table */ public byte[] getTableName() { - return this.tableName; + setTableName(TBaseHelper.rightSize(tableName)); + return tableName.array(); + } + + public ByteBuffer BufferForTableName() { + return tableName; } /** * name of table */ public scannerOpenWithPrefix_args setTableName(byte[] tableName) { + setTableName(ByteBuffer.wrap(tableName)); + return this; + } + + public scannerOpenWithPrefix_args setTableName(ByteBuffer tableName) { this.tableName = tableName; return this; } @@ -26094,13 +28743,23 @@ public class Hbase { * the prefix (and thus start row) of the keys you want */ public byte[] getStartAndPrefix() { - return this.startAndPrefix; + setStartAndPrefix(TBaseHelper.rightSize(startAndPrefix)); + return startAndPrefix.array(); + } + + public ByteBuffer BufferForStartAndPrefix() { + return startAndPrefix; } /** * the prefix (and thus start row) of the keys you want */ public scannerOpenWithPrefix_args setStartAndPrefix(byte[] startAndPrefix) { + setStartAndPrefix(ByteBuffer.wrap(startAndPrefix)); + return this; + } + + public scannerOpenWithPrefix_args setStartAndPrefix(ByteBuffer startAndPrefix) { this.startAndPrefix = startAndPrefix; return this; } @@ -26124,13 +28783,13 @@ public class Hbase { return (this.columns == null) ? 0 : this.columns.size(); } - public java.util.Iterator getColumnsIterator() { + public java.util.Iterator getColumnsIterator() { return (this.columns == null) ? null : this.columns.iterator(); } - public void addToColumns(byte[] elem) { + public void addToColumns(ByteBuffer elem) { if (this.columns == null) { - this.columns = new ArrayList(); + this.columns = new ArrayList(); } this.columns.add(elem); } @@ -26138,14 +28797,14 @@ public class Hbase { /** * the columns you want returned */ - public List getColumns() { + public List getColumns() { return this.columns; } /** * the columns you want returned */ - public scannerOpenWithPrefix_args setColumns(List columns) { + public scannerOpenWithPrefix_args setColumns(List columns) { this.columns = columns; return this; } @@ -26171,7 +28830,7 @@ public class Hbase { if (value == null) { unsetTableName(); } else { - setTableName((byte[])value); + setTableName((ByteBuffer)value); } break; @@ -26179,7 +28838,7 @@ public class Hbase { if (value == null) { unsetStartAndPrefix(); } else { - setStartAndPrefix((byte[])value); + setStartAndPrefix((ByteBuffer)value); } break; @@ -26187,17 +28846,13 @@ public class Hbase { if (value == null) { unsetColumns(); } else { - setColumns((List)value); + setColumns((List)value); } break; } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case TABLE_NAME: @@ -26213,12 +28868,12 @@ public class Hbase { 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 TABLE_NAME: return isSetTableName(); @@ -26230,10 +28885,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -26252,7 +28903,7 @@ public class Hbase { if (this_present_tableName || that_present_tableName) { if (!(this_present_tableName && that_present_tableName)) return false; - if (!java.util.Arrays.equals(this.tableName, that.tableName)) + if (!this.tableName.equals(that.tableName)) return false; } @@ -26261,7 +28912,7 @@ public class Hbase { if (this_present_startAndPrefix || that_present_startAndPrefix) { if (!(this_present_startAndPrefix && that_present_startAndPrefix)) return false; - if (!java.util.Arrays.equals(this.startAndPrefix, that.startAndPrefix)) + if (!this.startAndPrefix.equals(that.startAndPrefix)) return false; } @@ -26307,81 +28958,88 @@ public class Hbase { int lastComparison = 0; scannerOpenWithPrefix_args typedOther = (scannerOpenWithPrefix_args)other; - lastComparison = Boolean.valueOf(isSetTableName()).compareTo(isSetTableName()); + lastComparison = Boolean.valueOf(isSetTableName()).compareTo(typedOther.isSetTableName()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(tableName, typedOther.tableName); - if (lastComparison != 0) { - return lastComparison; + if (isSetTableName()) { + lastComparison = TBaseHelper.compareTo(this.tableName, typedOther.tableName); + if (lastComparison != 0) { + return lastComparison; + } } - lastComparison = Boolean.valueOf(isSetStartAndPrefix()).compareTo(isSetStartAndPrefix()); + lastComparison = Boolean.valueOf(isSetStartAndPrefix()).compareTo(typedOther.isSetStartAndPrefix()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(startAndPrefix, typedOther.startAndPrefix); - if (lastComparison != 0) { - return lastComparison; + if (isSetStartAndPrefix()) { + lastComparison = TBaseHelper.compareTo(this.startAndPrefix, typedOther.startAndPrefix); + if (lastComparison != 0) { + return lastComparison; + } } - lastComparison = Boolean.valueOf(isSetColumns()).compareTo(isSetColumns()); + lastComparison = Boolean.valueOf(isSetColumns()).compareTo(typedOther.isSetColumns()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(columns, typedOther.columns); - if (lastComparison != 0) { - return lastComparison; + if (isSetColumns()) { + lastComparison = TBaseHelper.compareTo(this.columns, typedOther.columns); + 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 TABLE_NAME: - if (field.type == TType.STRING) { - this.tableName = iprot.readBinary(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case START_AND_PREFIX: - if (field.type == TType.STRING) { - this.startAndPrefix = iprot.readBinary(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case COLUMNS: - if (field.type == TType.LIST) { + switch (field.id) { + case 1: // TABLE_NAME + if (field.type == TType.STRING) { + this.tableName = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 2: // START_AND_PREFIX + if (field.type == TType.STRING) { + this.startAndPrefix = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 3: // COLUMNS + if (field.type == TType.LIST) { + { + TList _list86 = iprot.readListBegin(); + this.columns = new ArrayList(_list86.size); + for (int _i87 = 0; _i87 < _list86.size; ++_i87) { - TList _list86 = iprot.readListBegin(); - this.columns = new ArrayList(_list86.size); - for (int _i87 = 0; _i87 < _list86.size; ++_i87) - { - byte[] _elem88; - _elem88 = iprot.readBinary(); - this.columns.add(_elem88); - } - iprot.readListEnd(); + ByteBuffer _elem88; + _elem88 = iprot.readBinary(); + this.columns.add(_elem88); } - } 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(); @@ -26407,7 +29065,7 @@ public class Hbase { oprot.writeFieldBegin(COLUMNS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRING, this.columns.size())); - for (byte[] _iter89 : this.columns) + for (ByteBuffer _iter89 : this.columns) { oprot.writeBinary(_iter89); } @@ -26457,7 +29115,7 @@ public class Hbase { } - public static class scannerOpenWithPrefix_result implements TBase, java.io.Serializable, Cloneable, Comparable { + public static class scannerOpenWithPrefix_result implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("scannerOpenWithPrefix_result"); private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.I32, (short)0); @@ -26471,12 +29129,10 @@ public class Hbase { SUCCESS((short)0, "success"), IO((short)1, "io"); - 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); } } @@ -26485,7 +29141,14 @@ public class Hbase { * 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 0: // SUCCESS + return SUCCESS; + case 1: // IO + return IO; + default: + return null; + } } /** @@ -26526,14 +29189,14 @@ public class Hbase { private static final int __SUCCESS_ISSET_ID = 0; private BitSet __isset_bit_vector = new BitSet(1); - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.I32))); - put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRUCT))); - }}); - + public static final Map<_Fields, FieldMetaData> metaDataMap; static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.I32 , "ScannerID"))); + tmpMap.put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(scannerOpenWithPrefix_result.class, metaDataMap); } @@ -26566,9 +29229,11 @@ public class Hbase { return new scannerOpenWithPrefix_result(this); } - @Deprecated - public scannerOpenWithPrefix_result clone() { - return new scannerOpenWithPrefix_result(this); + @Override + public void clear() { + setSuccessIsSet(false); + this.success = 0; + this.io = null; } public int getSuccess() { @@ -26639,10 +29304,6 @@ public class Hbase { } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: @@ -26655,12 +29316,12 @@ public class Hbase { 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 SUCCESS: return isSetSuccess(); @@ -26670,10 +29331,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -26733,58 +29390,63 @@ public class Hbase { int lastComparison = 0; scannerOpenWithPrefix_result typedOther = (scannerOpenWithPrefix_result)other; - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess()); + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(success, typedOther.success); - if (lastComparison != 0) { - return lastComparison; + if (isSetSuccess()) { + lastComparison = TBaseHelper.compareTo(this.success, typedOther.success); + if (lastComparison != 0) { + return lastComparison; + } } - lastComparison = Boolean.valueOf(isSetIo()).compareTo(isSetIo()); + lastComparison = Boolean.valueOf(isSetIo()).compareTo(typedOther.isSetIo()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(io, typedOther.io); - if (lastComparison != 0) { - return lastComparison; + if (isSetIo()) { + lastComparison = TBaseHelper.compareTo(this.io, typedOther.io); + 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 SUCCESS: - if (field.type == TType.I32) { - this.success = iprot.readI32(); - setSuccessIsSet(true); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case IO: - if (field.type == TType.STRUCT) { - this.io = new IOError(); - this.io.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); - } + switch (field.id) { + case 0: // SUCCESS + if (field.type == TType.I32) { + this.success = iprot.readI32(); + setSuccessIsSet(true); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 1: // IO + if (field.type == TType.STRUCT) { + this.io = new IOError(); + this.io.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + } + iprot.readFieldEnd(); } iprot.readStructEnd(); @@ -26834,7 +29496,7 @@ public class Hbase { } - public static class scannerOpenTs_args implements TBase, java.io.Serializable, Cloneable, Comparable { + public static class scannerOpenTs_args implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("scannerOpenTs_args"); private static final TField TABLE_NAME_FIELD_DESC = new TField("tableName", TType.STRING, (short)1); @@ -26845,18 +29507,18 @@ public class Hbase { /** * name of table */ - public byte[] tableName; + public ByteBuffer tableName; /** * Starting row in table to scan. * Send "" (empty string) to start at the first row. */ - public byte[] startRow; + public ByteBuffer startRow; /** * 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 List columns; + public List columns; /** * timestamp */ @@ -26884,12 +29546,10 @@ public class Hbase { */ TIMESTAMP((short)4, "timestamp"); - 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); } } @@ -26898,7 +29558,18 @@ public class Hbase { * 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: // TABLE_NAME + return TABLE_NAME; + case 2: // START_ROW + return START_ROW; + case 3: // COLUMNS + return COLUMNS; + case 4: // TIMESTAMP + return TIMESTAMP; + default: + return null; + } } /** @@ -26939,19 +29610,19 @@ public class Hbase { private static final int __TIMESTAMP_ISSET_ID = 0; private BitSet __isset_bit_vector = new BitSet(1); - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.TABLE_NAME, new FieldMetaData("tableName", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(_Fields.START_ROW, new FieldMetaData("startRow", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(_Fields.COLUMNS, new FieldMetaData("columns", TFieldRequirementType.DEFAULT, - new ListMetaData(TType.LIST, - new FieldValueMetaData(TType.STRING)))); - put(_Fields.TIMESTAMP, new FieldMetaData("timestamp", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.I64))); - }}); - + public static final Map<_Fields, FieldMetaData> metaDataMap; static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.TABLE_NAME, new FieldMetaData("tableName", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING , "Text"))); + tmpMap.put(_Fields.START_ROW, new FieldMetaData("startRow", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING , "Text"))); + tmpMap.put(_Fields.COLUMNS, new FieldMetaData("columns", TFieldRequirementType.DEFAULT, + new ListMetaData(TType.LIST, + new FieldValueMetaData(TType.STRING , "Text")))); + tmpMap.put(_Fields.TIMESTAMP, new FieldMetaData("timestamp", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.I64))); + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(scannerOpenTs_args.class, metaDataMap); } @@ -26959,9 +29630,9 @@ public class Hbase { } public scannerOpenTs_args( - byte[] tableName, - byte[] startRow, - List columns, + ByteBuffer tableName, + ByteBuffer startRow, + List columns, long timestamp) { this(); @@ -26985,8 +29656,8 @@ public class Hbase { this.startRow = other.startRow; } if (other.isSetColumns()) { - List __this__columns = new ArrayList(); - for (byte[] other_element : other.columns) { + List __this__columns = new ArrayList(); + for (ByteBuffer other_element : other.columns) { __this__columns.add(other_element); } this.columns = __this__columns; @@ -26998,22 +29669,36 @@ public class Hbase { return new scannerOpenTs_args(this); } - @Deprecated - public scannerOpenTs_args clone() { - return new scannerOpenTs_args(this); + @Override + public void clear() { + this.tableName = null; + this.startRow = null; + this.columns = null; + setTimestampIsSet(false); + this.timestamp = 0; } /** * name of table */ public byte[] getTableName() { - return this.tableName; + setTableName(TBaseHelper.rightSize(tableName)); + return tableName.array(); + } + + public ByteBuffer BufferForTableName() { + return tableName; } /** * name of table */ public scannerOpenTs_args setTableName(byte[] tableName) { + setTableName(ByteBuffer.wrap(tableName)); + return this; + } + + public scannerOpenTs_args setTableName(ByteBuffer tableName) { this.tableName = tableName; return this; } @@ -27038,7 +29723,12 @@ public class Hbase { * Send "" (empty string) to start at the first row. */ public byte[] getStartRow() { - return this.startRow; + setStartRow(TBaseHelper.rightSize(startRow)); + return startRow.array(); + } + + public ByteBuffer BufferForStartRow() { + return startRow; } /** @@ -27046,6 +29736,11 @@ public class Hbase { * Send "" (empty string) to start at the first row. */ public scannerOpenTs_args setStartRow(byte[] startRow) { + setStartRow(ByteBuffer.wrap(startRow)); + return this; + } + + public scannerOpenTs_args setStartRow(ByteBuffer startRow) { this.startRow = startRow; return this; } @@ -27069,13 +29764,13 @@ public class Hbase { return (this.columns == null) ? 0 : this.columns.size(); } - public java.util.Iterator getColumnsIterator() { + public java.util.Iterator getColumnsIterator() { return (this.columns == null) ? null : this.columns.iterator(); } - public void addToColumns(byte[] elem) { + public void addToColumns(ByteBuffer elem) { if (this.columns == null) { - this.columns = new ArrayList(); + this.columns = new ArrayList(); } this.columns.add(elem); } @@ -27085,7 +29780,7 @@ public class Hbase { * columns of the specified column family are returned. It's also possible * to pass a regex in the column qualifier. */ - public List getColumns() { + public List getColumns() { return this.columns; } @@ -27094,7 +29789,7 @@ public class Hbase { * columns of the specified column family are returned. It's also possible * to pass a regex in the column qualifier. */ - public scannerOpenTs_args setColumns(List columns) { + public scannerOpenTs_args setColumns(List columns) { this.columns = columns; return this; } @@ -27149,7 +29844,7 @@ public class Hbase { if (value == null) { unsetTableName(); } else { - setTableName((byte[])value); + setTableName((ByteBuffer)value); } break; @@ -27157,7 +29852,7 @@ public class Hbase { if (value == null) { unsetStartRow(); } else { - setStartRow((byte[])value); + setStartRow((ByteBuffer)value); } break; @@ -27165,7 +29860,7 @@ public class Hbase { if (value == null) { unsetColumns(); } else { - setColumns((List)value); + setColumns((List)value); } break; @@ -27180,10 +29875,6 @@ public class Hbase { } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case TABLE_NAME: @@ -27202,12 +29893,12 @@ public class Hbase { 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 TABLE_NAME: return isSetTableName(); @@ -27221,10 +29912,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -27243,7 +29930,7 @@ public class Hbase { if (this_present_tableName || that_present_tableName) { if (!(this_present_tableName && that_present_tableName)) return false; - if (!java.util.Arrays.equals(this.tableName, that.tableName)) + if (!this.tableName.equals(that.tableName)) return false; } @@ -27252,7 +29939,7 @@ public class Hbase { if (this_present_startRow || that_present_startRow) { if (!(this_present_startRow && that_present_startRow)) return false; - if (!java.util.Arrays.equals(this.startRow, that.startRow)) + if (!this.startRow.equals(that.startRow)) return false; } @@ -27312,97 +29999,106 @@ public class Hbase { int lastComparison = 0; scannerOpenTs_args typedOther = (scannerOpenTs_args)other; - lastComparison = Boolean.valueOf(isSetTableName()).compareTo(isSetTableName()); + lastComparison = Boolean.valueOf(isSetTableName()).compareTo(typedOther.isSetTableName()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(tableName, typedOther.tableName); - if (lastComparison != 0) { - return lastComparison; + if (isSetTableName()) { + lastComparison = TBaseHelper.compareTo(this.tableName, typedOther.tableName); + if (lastComparison != 0) { + return lastComparison; + } } - lastComparison = Boolean.valueOf(isSetStartRow()).compareTo(isSetStartRow()); + lastComparison = Boolean.valueOf(isSetStartRow()).compareTo(typedOther.isSetStartRow()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(startRow, typedOther.startRow); - if (lastComparison != 0) { - return lastComparison; + if (isSetStartRow()) { + lastComparison = TBaseHelper.compareTo(this.startRow, typedOther.startRow); + if (lastComparison != 0) { + return lastComparison; + } } - lastComparison = Boolean.valueOf(isSetColumns()).compareTo(isSetColumns()); + lastComparison = Boolean.valueOf(isSetColumns()).compareTo(typedOther.isSetColumns()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(columns, typedOther.columns); - if (lastComparison != 0) { - return lastComparison; + if (isSetColumns()) { + lastComparison = TBaseHelper.compareTo(this.columns, typedOther.columns); + if (lastComparison != 0) { + return lastComparison; + } } - lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(isSetTimestamp()); + lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(typedOther.isSetTimestamp()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(timestamp, typedOther.timestamp); - if (lastComparison != 0) { - return lastComparison; + if (isSetTimestamp()) { + lastComparison = TBaseHelper.compareTo(this.timestamp, typedOther.timestamp); + 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 TABLE_NAME: - if (field.type == TType.STRING) { - this.tableName = iprot.readBinary(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case START_ROW: - if (field.type == TType.STRING) { - this.startRow = iprot.readBinary(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case COLUMNS: - if (field.type == TType.LIST) { + switch (field.id) { + case 1: // TABLE_NAME + if (field.type == TType.STRING) { + this.tableName = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 2: // START_ROW + if (field.type == TType.STRING) { + this.startRow = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 3: // COLUMNS + if (field.type == TType.LIST) { + { + TList _list90 = iprot.readListBegin(); + this.columns = new ArrayList(_list90.size); + for (int _i91 = 0; _i91 < _list90.size; ++_i91) { - TList _list90 = iprot.readListBegin(); - this.columns = new ArrayList(_list90.size); - for (int _i91 = 0; _i91 < _list90.size; ++_i91) - { - byte[] _elem92; - _elem92 = iprot.readBinary(); - this.columns.add(_elem92); - } - iprot.readListEnd(); + ByteBuffer _elem92; + _elem92 = iprot.readBinary(); + this.columns.add(_elem92); } - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case TIMESTAMP: - if (field.type == TType.I64) { - this.timestamp = iprot.readI64(); - setTimestampIsSet(true); - } else { - TProtocolUtil.skip(iprot, field.type); + iprot.readListEnd(); } - break; - } - iprot.readFieldEnd(); - } + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 4: // TIMESTAMP + if (field.type == TType.I64) { + this.timestamp = iprot.readI64(); + setTimestampIsSet(true); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + } + iprot.readFieldEnd(); } iprot.readStructEnd(); @@ -27428,7 +30124,7 @@ public class Hbase { oprot.writeFieldBegin(COLUMNS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRING, this.columns.size())); - for (byte[] _iter93 : this.columns) + for (ByteBuffer _iter93 : this.columns) { oprot.writeBinary(_iter93); } @@ -27485,7 +30181,7 @@ public class Hbase { } - public static class scannerOpenTs_result implements TBase, java.io.Serializable, Cloneable, Comparable { + public static class scannerOpenTs_result implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("scannerOpenTs_result"); private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.I32, (short)0); @@ -27499,12 +30195,10 @@ public class Hbase { SUCCESS((short)0, "success"), IO((short)1, "io"); - 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); } } @@ -27513,7 +30207,14 @@ public class Hbase { * 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 0: // SUCCESS + return SUCCESS; + case 1: // IO + return IO; + default: + return null; + } } /** @@ -27554,14 +30255,14 @@ public class Hbase { private static final int __SUCCESS_ISSET_ID = 0; private BitSet __isset_bit_vector = new BitSet(1); - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.I32))); - put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRUCT))); - }}); - + public static final Map<_Fields, FieldMetaData> metaDataMap; static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.I32 , "ScannerID"))); + tmpMap.put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(scannerOpenTs_result.class, metaDataMap); } @@ -27594,9 +30295,11 @@ public class Hbase { return new scannerOpenTs_result(this); } - @Deprecated - public scannerOpenTs_result clone() { - return new scannerOpenTs_result(this); + @Override + public void clear() { + setSuccessIsSet(false); + this.success = 0; + this.io = null; } public int getSuccess() { @@ -27667,10 +30370,6 @@ public class Hbase { } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: @@ -27683,12 +30382,12 @@ public class Hbase { 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 SUCCESS: return isSetSuccess(); @@ -27698,10 +30397,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -27761,58 +30456,63 @@ public class Hbase { int lastComparison = 0; scannerOpenTs_result typedOther = (scannerOpenTs_result)other; - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess()); + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(success, typedOther.success); - if (lastComparison != 0) { - return lastComparison; + if (isSetSuccess()) { + lastComparison = TBaseHelper.compareTo(this.success, typedOther.success); + if (lastComparison != 0) { + return lastComparison; + } } - lastComparison = Boolean.valueOf(isSetIo()).compareTo(isSetIo()); + lastComparison = Boolean.valueOf(isSetIo()).compareTo(typedOther.isSetIo()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(io, typedOther.io); - if (lastComparison != 0) { - return lastComparison; + if (isSetIo()) { + lastComparison = TBaseHelper.compareTo(this.io, typedOther.io); + 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 SUCCESS: - if (field.type == TType.I32) { - this.success = iprot.readI32(); - setSuccessIsSet(true); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case IO: - if (field.type == TType.STRUCT) { - this.io = new IOError(); - this.io.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); - } + switch (field.id) { + case 0: // SUCCESS + if (field.type == TType.I32) { + this.success = iprot.readI32(); + setSuccessIsSet(true); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 1: // IO + if (field.type == TType.STRUCT) { + this.io = new IOError(); + this.io.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + } + iprot.readFieldEnd(); } iprot.readStructEnd(); @@ -27862,7 +30562,7 @@ public class Hbase { } - public static class scannerOpenWithStopTs_args implements TBase, java.io.Serializable, Cloneable, Comparable { + public static class scannerOpenWithStopTs_args implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("scannerOpenWithStopTs_args"); private static final TField TABLE_NAME_FIELD_DESC = new TField("tableName", TType.STRING, (short)1); @@ -27874,23 +30574,23 @@ public class Hbase { /** * name of table */ - public byte[] tableName; + public ByteBuffer tableName; /** * Starting row in table to scan. * Send "" (empty string) to start at the first row. */ - public byte[] startRow; + public ByteBuffer startRow; /** * row to stop scanning on. This row is *not* included in the * scanner's results */ - public byte[] stopRow; + public ByteBuffer stopRow; /** * 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 List columns; + public List columns; /** * timestamp */ @@ -27923,12 +30623,10 @@ public class Hbase { */ TIMESTAMP((short)5, "timestamp"); - 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); } } @@ -27937,7 +30635,20 @@ public class Hbase { * 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: // TABLE_NAME + return TABLE_NAME; + case 2: // START_ROW + return START_ROW; + case 3: // STOP_ROW + return STOP_ROW; + case 4: // COLUMNS + return COLUMNS; + case 5: // TIMESTAMP + return TIMESTAMP; + default: + return null; + } } /** @@ -27978,21 +30689,21 @@ public class Hbase { private static final int __TIMESTAMP_ISSET_ID = 0; private BitSet __isset_bit_vector = new BitSet(1); - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.TABLE_NAME, new FieldMetaData("tableName", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(_Fields.START_ROW, new FieldMetaData("startRow", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(_Fields.STOP_ROW, new FieldMetaData("stopRow", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(_Fields.COLUMNS, new FieldMetaData("columns", TFieldRequirementType.DEFAULT, - new ListMetaData(TType.LIST, - new FieldValueMetaData(TType.STRING)))); - put(_Fields.TIMESTAMP, new FieldMetaData("timestamp", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.I64))); - }}); - + public static final Map<_Fields, FieldMetaData> metaDataMap; static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.TABLE_NAME, new FieldMetaData("tableName", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING , "Text"))); + tmpMap.put(_Fields.START_ROW, new FieldMetaData("startRow", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING , "Text"))); + tmpMap.put(_Fields.STOP_ROW, new FieldMetaData("stopRow", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING , "Text"))); + tmpMap.put(_Fields.COLUMNS, new FieldMetaData("columns", TFieldRequirementType.DEFAULT, + new ListMetaData(TType.LIST, + new FieldValueMetaData(TType.STRING , "Text")))); + tmpMap.put(_Fields.TIMESTAMP, new FieldMetaData("timestamp", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.I64))); + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(scannerOpenWithStopTs_args.class, metaDataMap); } @@ -28000,10 +30711,10 @@ public class Hbase { } public scannerOpenWithStopTs_args( - byte[] tableName, - byte[] startRow, - byte[] stopRow, - List columns, + ByteBuffer tableName, + ByteBuffer startRow, + ByteBuffer stopRow, + List columns, long timestamp) { this(); @@ -28031,8 +30742,8 @@ public class Hbase { this.stopRow = other.stopRow; } if (other.isSetColumns()) { - List __this__columns = new ArrayList(); - for (byte[] other_element : other.columns) { + List __this__columns = new ArrayList(); + for (ByteBuffer other_element : other.columns) { __this__columns.add(other_element); } this.columns = __this__columns; @@ -28044,22 +30755,37 @@ public class Hbase { return new scannerOpenWithStopTs_args(this); } - @Deprecated - public scannerOpenWithStopTs_args clone() { - return new scannerOpenWithStopTs_args(this); + @Override + public void clear() { + this.tableName = null; + this.startRow = null; + this.stopRow = null; + this.columns = null; + setTimestampIsSet(false); + this.timestamp = 0; } /** * name of table */ public byte[] getTableName() { - return this.tableName; + setTableName(TBaseHelper.rightSize(tableName)); + return tableName.array(); + } + + public ByteBuffer BufferForTableName() { + return tableName; } /** * name of table */ public scannerOpenWithStopTs_args setTableName(byte[] tableName) { + setTableName(ByteBuffer.wrap(tableName)); + return this; + } + + public scannerOpenWithStopTs_args setTableName(ByteBuffer tableName) { this.tableName = tableName; return this; } @@ -28084,7 +30810,12 @@ public class Hbase { * Send "" (empty string) to start at the first row. */ public byte[] getStartRow() { - return this.startRow; + setStartRow(TBaseHelper.rightSize(startRow)); + return startRow.array(); + } + + public ByteBuffer BufferForStartRow() { + return startRow; } /** @@ -28092,6 +30823,11 @@ public class Hbase { * Send "" (empty string) to start at the first row. */ public scannerOpenWithStopTs_args setStartRow(byte[] startRow) { + setStartRow(ByteBuffer.wrap(startRow)); + return this; + } + + public scannerOpenWithStopTs_args setStartRow(ByteBuffer startRow) { this.startRow = startRow; return this; } @@ -28116,7 +30852,12 @@ public class Hbase { * scanner's results */ public byte[] getStopRow() { - return this.stopRow; + setStopRow(TBaseHelper.rightSize(stopRow)); + return stopRow.array(); + } + + public ByteBuffer BufferForStopRow() { + return stopRow; } /** @@ -28124,6 +30865,11 @@ public class Hbase { * scanner's results */ public scannerOpenWithStopTs_args setStopRow(byte[] stopRow) { + setStopRow(ByteBuffer.wrap(stopRow)); + return this; + } + + public scannerOpenWithStopTs_args setStopRow(ByteBuffer stopRow) { this.stopRow = stopRow; return this; } @@ -28147,13 +30893,13 @@ public class Hbase { return (this.columns == null) ? 0 : this.columns.size(); } - public java.util.Iterator getColumnsIterator() { + public java.util.Iterator getColumnsIterator() { return (this.columns == null) ? null : this.columns.iterator(); } - public void addToColumns(byte[] elem) { + public void addToColumns(ByteBuffer elem) { if (this.columns == null) { - this.columns = new ArrayList(); + this.columns = new ArrayList(); } this.columns.add(elem); } @@ -28163,7 +30909,7 @@ public class Hbase { * columns of the specified column family are returned. It's also possible * to pass a regex in the column qualifier. */ - public List getColumns() { + public List getColumns() { return this.columns; } @@ -28172,7 +30918,7 @@ public class Hbase { * columns of the specified column family are returned. It's also possible * to pass a regex in the column qualifier. */ - public scannerOpenWithStopTs_args setColumns(List columns) { + public scannerOpenWithStopTs_args setColumns(List columns) { this.columns = columns; return this; } @@ -28227,7 +30973,7 @@ public class Hbase { if (value == null) { unsetTableName(); } else { - setTableName((byte[])value); + setTableName((ByteBuffer)value); } break; @@ -28235,7 +30981,7 @@ public class Hbase { if (value == null) { unsetStartRow(); } else { - setStartRow((byte[])value); + setStartRow((ByteBuffer)value); } break; @@ -28243,7 +30989,7 @@ public class Hbase { if (value == null) { unsetStopRow(); } else { - setStopRow((byte[])value); + setStopRow((ByteBuffer)value); } break; @@ -28251,7 +30997,7 @@ public class Hbase { if (value == null) { unsetColumns(); } else { - setColumns((List)value); + setColumns((List)value); } break; @@ -28266,10 +31012,6 @@ public class Hbase { } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case TABLE_NAME: @@ -28291,12 +31033,12 @@ public class Hbase { 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 TABLE_NAME: return isSetTableName(); @@ -28312,10 +31054,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -28334,7 +31072,7 @@ public class Hbase { if (this_present_tableName || that_present_tableName) { if (!(this_present_tableName && that_present_tableName)) return false; - if (!java.util.Arrays.equals(this.tableName, that.tableName)) + if (!this.tableName.equals(that.tableName)) return false; } @@ -28343,7 +31081,7 @@ public class Hbase { if (this_present_startRow || that_present_startRow) { if (!(this_present_startRow && that_present_startRow)) return false; - if (!java.util.Arrays.equals(this.startRow, that.startRow)) + if (!this.startRow.equals(that.startRow)) return false; } @@ -28352,7 +31090,7 @@ public class Hbase { if (this_present_stopRow || that_present_stopRow) { if (!(this_present_stopRow && that_present_stopRow)) return false; - if (!java.util.Arrays.equals(this.stopRow, that.stopRow)) + if (!this.stopRow.equals(that.stopRow)) return false; } @@ -28417,112 +31155,123 @@ public class Hbase { int lastComparison = 0; scannerOpenWithStopTs_args typedOther = (scannerOpenWithStopTs_args)other; - lastComparison = Boolean.valueOf(isSetTableName()).compareTo(isSetTableName()); + lastComparison = Boolean.valueOf(isSetTableName()).compareTo(typedOther.isSetTableName()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(tableName, typedOther.tableName); - if (lastComparison != 0) { - return lastComparison; + if (isSetTableName()) { + lastComparison = TBaseHelper.compareTo(this.tableName, typedOther.tableName); + if (lastComparison != 0) { + return lastComparison; + } } - lastComparison = Boolean.valueOf(isSetStartRow()).compareTo(isSetStartRow()); + lastComparison = Boolean.valueOf(isSetStartRow()).compareTo(typedOther.isSetStartRow()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(startRow, typedOther.startRow); - if (lastComparison != 0) { - return lastComparison; + if (isSetStartRow()) { + lastComparison = TBaseHelper.compareTo(this.startRow, typedOther.startRow); + if (lastComparison != 0) { + return lastComparison; + } } - lastComparison = Boolean.valueOf(isSetStopRow()).compareTo(isSetStopRow()); + lastComparison = Boolean.valueOf(isSetStopRow()).compareTo(typedOther.isSetStopRow()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(stopRow, typedOther.stopRow); - if (lastComparison != 0) { - return lastComparison; + if (isSetStopRow()) { + lastComparison = TBaseHelper.compareTo(this.stopRow, typedOther.stopRow); + if (lastComparison != 0) { + return lastComparison; + } } - lastComparison = Boolean.valueOf(isSetColumns()).compareTo(isSetColumns()); + lastComparison = Boolean.valueOf(isSetColumns()).compareTo(typedOther.isSetColumns()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(columns, typedOther.columns); - if (lastComparison != 0) { - return lastComparison; + if (isSetColumns()) { + lastComparison = TBaseHelper.compareTo(this.columns, typedOther.columns); + if (lastComparison != 0) { + return lastComparison; + } } - lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(isSetTimestamp()); + lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(typedOther.isSetTimestamp()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(timestamp, typedOther.timestamp); - if (lastComparison != 0) { - return lastComparison; + if (isSetTimestamp()) { + lastComparison = TBaseHelper.compareTo(this.timestamp, typedOther.timestamp); + 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 TABLE_NAME: - if (field.type == TType.STRING) { - this.tableName = iprot.readBinary(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case START_ROW: - if (field.type == TType.STRING) { - this.startRow = iprot.readBinary(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case STOP_ROW: - if (field.type == TType.STRING) { - this.stopRow = iprot.readBinary(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case COLUMNS: - if (field.type == TType.LIST) { + switch (field.id) { + case 1: // TABLE_NAME + if (field.type == TType.STRING) { + this.tableName = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 2: // START_ROW + if (field.type == TType.STRING) { + this.startRow = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 3: // STOP_ROW + if (field.type == TType.STRING) { + this.stopRow = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 4: // COLUMNS + if (field.type == TType.LIST) { + { + TList _list94 = iprot.readListBegin(); + this.columns = new ArrayList(_list94.size); + for (int _i95 = 0; _i95 < _list94.size; ++_i95) { - TList _list94 = iprot.readListBegin(); - this.columns = new ArrayList(_list94.size); - for (int _i95 = 0; _i95 < _list94.size; ++_i95) - { - byte[] _elem96; - _elem96 = iprot.readBinary(); - this.columns.add(_elem96); - } - iprot.readListEnd(); + ByteBuffer _elem96; + _elem96 = iprot.readBinary(); + this.columns.add(_elem96); } - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case TIMESTAMP: - if (field.type == TType.I64) { - this.timestamp = iprot.readI64(); - setTimestampIsSet(true); - } else { - TProtocolUtil.skip(iprot, field.type); + iprot.readListEnd(); } - break; - } - iprot.readFieldEnd(); - } + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 5: // TIMESTAMP + if (field.type == TType.I64) { + this.timestamp = iprot.readI64(); + setTimestampIsSet(true); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + } + iprot.readFieldEnd(); } iprot.readStructEnd(); @@ -28553,7 +31302,7 @@ public class Hbase { oprot.writeFieldBegin(COLUMNS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRING, this.columns.size())); - for (byte[] _iter97 : this.columns) + for (ByteBuffer _iter97 : this.columns) { oprot.writeBinary(_iter97); } @@ -28618,7 +31367,7 @@ public class Hbase { } - public static class scannerOpenWithStopTs_result implements TBase, java.io.Serializable, Cloneable, Comparable { + public static class scannerOpenWithStopTs_result implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("scannerOpenWithStopTs_result"); private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.I32, (short)0); @@ -28632,12 +31381,10 @@ public class Hbase { SUCCESS((short)0, "success"), IO((short)1, "io"); - 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); } } @@ -28646,7 +31393,14 @@ public class Hbase { * 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 0: // SUCCESS + return SUCCESS; + case 1: // IO + return IO; + default: + return null; + } } /** @@ -28687,14 +31441,14 @@ public class Hbase { private static final int __SUCCESS_ISSET_ID = 0; private BitSet __isset_bit_vector = new BitSet(1); - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.I32))); - put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRUCT))); - }}); - + public static final Map<_Fields, FieldMetaData> metaDataMap; static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.I32 , "ScannerID"))); + tmpMap.put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(scannerOpenWithStopTs_result.class, metaDataMap); } @@ -28727,9 +31481,11 @@ public class Hbase { return new scannerOpenWithStopTs_result(this); } - @Deprecated - public scannerOpenWithStopTs_result clone() { - return new scannerOpenWithStopTs_result(this); + @Override + public void clear() { + setSuccessIsSet(false); + this.success = 0; + this.io = null; } public int getSuccess() { @@ -28800,10 +31556,6 @@ public class Hbase { } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: @@ -28816,12 +31568,12 @@ public class Hbase { 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 SUCCESS: return isSetSuccess(); @@ -28831,10 +31583,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -28894,58 +31642,63 @@ public class Hbase { int lastComparison = 0; scannerOpenWithStopTs_result typedOther = (scannerOpenWithStopTs_result)other; - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess()); + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(success, typedOther.success); - if (lastComparison != 0) { - return lastComparison; + if (isSetSuccess()) { + lastComparison = TBaseHelper.compareTo(this.success, typedOther.success); + if (lastComparison != 0) { + return lastComparison; + } } - lastComparison = Boolean.valueOf(isSetIo()).compareTo(isSetIo()); + lastComparison = Boolean.valueOf(isSetIo()).compareTo(typedOther.isSetIo()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(io, typedOther.io); - if (lastComparison != 0) { - return lastComparison; + if (isSetIo()) { + lastComparison = TBaseHelper.compareTo(this.io, typedOther.io); + 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 SUCCESS: - if (field.type == TType.I32) { - this.success = iprot.readI32(); - setSuccessIsSet(true); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case IO: - if (field.type == TType.STRUCT) { - this.io = new IOError(); - this.io.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); - } + switch (field.id) { + case 0: // SUCCESS + if (field.type == TType.I32) { + this.success = iprot.readI32(); + setSuccessIsSet(true); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 1: // IO + if (field.type == TType.STRUCT) { + this.io = new IOError(); + this.io.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + } + iprot.readFieldEnd(); } iprot.readStructEnd(); @@ -28995,7 +31748,7 @@ public class Hbase { } - public static class scannerGet_args implements TBase, java.io.Serializable, Cloneable, Comparable { + public static class scannerGet_args implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("scannerGet_args"); private static final TField ID_FIELD_DESC = new TField("id", TType.I32, (short)1); @@ -29012,12 +31765,10 @@ public class Hbase { */ ID((short)1, "id"); - 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); } } @@ -29026,7 +31777,12 @@ public class Hbase { * 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: // ID + return ID; + default: + return null; + } } /** @@ -29067,12 +31823,12 @@ public class Hbase { private static final int __ID_ISSET_ID = 0; private BitSet __isset_bit_vector = new BitSet(1); - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.I32))); - }}); - + public static final Map<_Fields, FieldMetaData> metaDataMap; static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.I32 , "ScannerID"))); + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(scannerGet_args.class, metaDataMap); } @@ -29100,9 +31856,10 @@ public class Hbase { return new scannerGet_args(this); } - @Deprecated - public scannerGet_args clone() { - return new scannerGet_args(this); + @Override + public void clear() { + setIdIsSet(false); + this.id = 0; } /** @@ -29147,10 +31904,6 @@ public class Hbase { } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case ID: @@ -29160,12 +31913,12 @@ public class Hbase { 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 ID: return isSetId(); @@ -29173,10 +31926,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -29222,42 +31971,45 @@ public class Hbase { int lastComparison = 0; scannerGet_args typedOther = (scannerGet_args)other; - lastComparison = Boolean.valueOf(isSetId()).compareTo(isSetId()); + lastComparison = Boolean.valueOf(isSetId()).compareTo(typedOther.isSetId()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(id, typedOther.id); - if (lastComparison != 0) { - return lastComparison; + if (isSetId()) { + lastComparison = TBaseHelper.compareTo(this.id, typedOther.id); + 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 ID: - if (field.type == TType.I32) { - this.id = iprot.readI32(); - setIdIsSet(true); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); + switch (field.id) { + case 1: // ID + if (field.type == TType.I32) { + this.id = iprot.readI32(); + setIdIsSet(true); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); } + iprot.readFieldEnd(); } iprot.readStructEnd(); @@ -29294,7 +32046,7 @@ public class Hbase { } - public static class scannerGet_result implements TBase, java.io.Serializable, Cloneable { + public static class scannerGet_result implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("scannerGet_result"); private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0); @@ -29311,12 +32063,10 @@ public class Hbase { IO((short)1, "io"), IA((short)2, "ia"); - 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); } } @@ -29325,7 +32075,16 @@ public class Hbase { * 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 0: // SUCCESS + return SUCCESS; + case 1: // IO + return IO; + case 2: // IA + return IA; + default: + return null; + } } /** @@ -29364,17 +32123,17 @@ public class Hbase { // isset id assignments - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new ListMetaData(TType.LIST, + public static final Map<_Fields, FieldMetaData> metaDataMap; + static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + new ListMetaData(TType.LIST, new StructMetaData(TType.STRUCT, TRowResult.class)))); - put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); - put(_Fields.IA, new FieldMetaData("ia", TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.IA, new FieldMetaData("ia", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); - }}); - - static { + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(scannerGet_result.class, metaDataMap); } @@ -29415,9 +32174,11 @@ public class Hbase { return new scannerGet_result(this); } - @Deprecated - public scannerGet_result clone() { - return new scannerGet_result(this); + @Override + public void clear() { + this.success = null; + this.io = null; + this.ia = null; } public int getSuccessSize() { @@ -29536,10 +32297,6 @@ public class Hbase { } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: @@ -29555,12 +32312,12 @@ public class Hbase { 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 SUCCESS: return isSetSuccess(); @@ -29572,10 +32329,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -29641,57 +32394,99 @@ public class Hbase { return builder.toHashCode(); } + public int compareTo(scannerGet_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + scannerGet_result typedOther = (scannerGet_result)other; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = TBaseHelper.compareTo(this.success, typedOther.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIo()).compareTo(typedOther.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = TBaseHelper.compareTo(this.io, typedOther.io); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIa()).compareTo(typedOther.isSetIa()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIa()) { + lastComparison = TBaseHelper.compareTo(this.ia, typedOther.ia); + 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 SUCCESS: - if (field.type == TType.LIST) { + switch (field.id) { + case 0: // SUCCESS + if (field.type == TType.LIST) { + { + TList _list98 = iprot.readListBegin(); + this.success = new ArrayList(_list98.size); + for (int _i99 = 0; _i99 < _list98.size; ++_i99) { - TList _list98 = iprot.readListBegin(); - this.success = new ArrayList(_list98.size); - for (int _i99 = 0; _i99 < _list98.size; ++_i99) - { - TRowResult _elem100; - _elem100 = new TRowResult(); - _elem100.read(iprot); - this.success.add(_elem100); - } - iprot.readListEnd(); + TRowResult _elem100; + _elem100 = new TRowResult(); + _elem100.read(iprot); + this.success.add(_elem100); } - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case IO: - if (field.type == TType.STRUCT) { - this.io = new IOError(); - this.io.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case IA: - if (field.type == TType.STRUCT) { - this.ia = new IllegalArgument(); - this.ia.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); + iprot.readListEnd(); } - break; - } - iprot.readFieldEnd(); - } + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 1: // IO + if (field.type == TType.STRUCT) { + this.io = new IOError(); + this.io.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 2: // IA + if (field.type == TType.STRUCT) { + this.ia = new IllegalArgument(); + this.ia.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + } + iprot.readFieldEnd(); } iprot.readStructEnd(); @@ -29764,7 +32559,7 @@ public class Hbase { } - public static class scannerGetList_args implements TBase, java.io.Serializable, Cloneable, Comparable { + public static class scannerGetList_args implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("scannerGetList_args"); private static final TField ID_FIELD_DESC = new TField("id", TType.I32, (short)1); @@ -29790,12 +32585,10 @@ public class Hbase { */ NB_ROWS((short)2, "nbRows"); - 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); } } @@ -29804,7 +32597,14 @@ public class Hbase { * 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: // ID + return ID; + case 2: // NB_ROWS + return NB_ROWS; + default: + return null; + } } /** @@ -29846,14 +32646,14 @@ public class Hbase { private static final int __NBROWS_ISSET_ID = 1; private BitSet __isset_bit_vector = new BitSet(2); - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.I32))); - put(_Fields.NB_ROWS, new FieldMetaData("nbRows", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.I32))); - }}); - + public static final Map<_Fields, FieldMetaData> metaDataMap; static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.I32 , "ScannerID"))); + tmpMap.put(_Fields.NB_ROWS, new FieldMetaData("nbRows", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.I32))); + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(scannerGetList_args.class, metaDataMap); } @@ -29885,9 +32685,12 @@ public class Hbase { return new scannerGetList_args(this); } - @Deprecated - public scannerGetList_args clone() { - return new scannerGetList_args(this); + @Override + public void clear() { + setIdIsSet(false); + this.id = 0; + setNbRowsIsSet(false); + this.nbRows = 0; } /** @@ -29969,10 +32772,6 @@ public class Hbase { } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case ID: @@ -29985,12 +32784,12 @@ public class Hbase { 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 ID: return isSetId(); @@ -30000,10 +32799,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -30063,58 +32858,63 @@ public class Hbase { int lastComparison = 0; scannerGetList_args typedOther = (scannerGetList_args)other; - lastComparison = Boolean.valueOf(isSetId()).compareTo(isSetId()); + lastComparison = Boolean.valueOf(isSetId()).compareTo(typedOther.isSetId()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(id, typedOther.id); - if (lastComparison != 0) { - return lastComparison; + if (isSetId()) { + lastComparison = TBaseHelper.compareTo(this.id, typedOther.id); + if (lastComparison != 0) { + return lastComparison; + } } - lastComparison = Boolean.valueOf(isSetNbRows()).compareTo(isSetNbRows()); + lastComparison = Boolean.valueOf(isSetNbRows()).compareTo(typedOther.isSetNbRows()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(nbRows, typedOther.nbRows); - if (lastComparison != 0) { - return lastComparison; + if (isSetNbRows()) { + lastComparison = TBaseHelper.compareTo(this.nbRows, typedOther.nbRows); + 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 ID: - if (field.type == TType.I32) { - this.id = iprot.readI32(); - setIdIsSet(true); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case NB_ROWS: - if (field.type == TType.I32) { - this.nbRows = iprot.readI32(); - setNbRowsIsSet(true); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); - } + switch (field.id) { + case 1: // ID + if (field.type == TType.I32) { + this.id = iprot.readI32(); + setIdIsSet(true); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 2: // NB_ROWS + if (field.type == TType.I32) { + this.nbRows = iprot.readI32(); + setNbRowsIsSet(true); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + } + iprot.readFieldEnd(); } iprot.readStructEnd(); @@ -30158,7 +32958,7 @@ public class Hbase { } - public static class scannerGetList_result implements TBase, java.io.Serializable, Cloneable { + public static class scannerGetList_result implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("scannerGetList_result"); private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0); @@ -30175,12 +32975,10 @@ public class Hbase { IO((short)1, "io"), IA((short)2, "ia"); - 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); } } @@ -30189,7 +32987,16 @@ public class Hbase { * 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 0: // SUCCESS + return SUCCESS; + case 1: // IO + return IO; + case 2: // IA + return IA; + default: + return null; + } } /** @@ -30228,17 +33035,17 @@ public class Hbase { // isset id assignments - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new ListMetaData(TType.LIST, + public static final Map<_Fields, FieldMetaData> metaDataMap; + static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + new ListMetaData(TType.LIST, new StructMetaData(TType.STRUCT, TRowResult.class)))); - put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); - put(_Fields.IA, new FieldMetaData("ia", TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.IA, new FieldMetaData("ia", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); - }}); - - static { + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(scannerGetList_result.class, metaDataMap); } @@ -30279,9 +33086,11 @@ public class Hbase { return new scannerGetList_result(this); } - @Deprecated - public scannerGetList_result clone() { - return new scannerGetList_result(this); + @Override + public void clear() { + this.success = null; + this.io = null; + this.ia = null; } public int getSuccessSize() { @@ -30400,10 +33209,6 @@ public class Hbase { } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: @@ -30419,12 +33224,12 @@ public class Hbase { 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 SUCCESS: return isSetSuccess(); @@ -30436,10 +33241,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -30505,57 +33306,99 @@ public class Hbase { return builder.toHashCode(); } + public int compareTo(scannerGetList_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + scannerGetList_result typedOther = (scannerGetList_result)other; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = TBaseHelper.compareTo(this.success, typedOther.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIo()).compareTo(typedOther.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = TBaseHelper.compareTo(this.io, typedOther.io); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIa()).compareTo(typedOther.isSetIa()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIa()) { + lastComparison = TBaseHelper.compareTo(this.ia, typedOther.ia); + 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 SUCCESS: - if (field.type == TType.LIST) { + switch (field.id) { + case 0: // SUCCESS + if (field.type == TType.LIST) { + { + TList _list102 = iprot.readListBegin(); + this.success = new ArrayList(_list102.size); + for (int _i103 = 0; _i103 < _list102.size; ++_i103) { - TList _list102 = iprot.readListBegin(); - this.success = new ArrayList(_list102.size); - for (int _i103 = 0; _i103 < _list102.size; ++_i103) - { - TRowResult _elem104; - _elem104 = new TRowResult(); - _elem104.read(iprot); - this.success.add(_elem104); - } - iprot.readListEnd(); + TRowResult _elem104; + _elem104 = new TRowResult(); + _elem104.read(iprot); + this.success.add(_elem104); } - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case IO: - if (field.type == TType.STRUCT) { - this.io = new IOError(); - this.io.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case IA: - if (field.type == TType.STRUCT) { - this.ia = new IllegalArgument(); - this.ia.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); + iprot.readListEnd(); } - break; - } - iprot.readFieldEnd(); - } + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 1: // IO + if (field.type == TType.STRUCT) { + this.io = new IOError(); + this.io.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 2: // IA + if (field.type == TType.STRUCT) { + this.ia = new IllegalArgument(); + this.ia.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + } + iprot.readFieldEnd(); } iprot.readStructEnd(); @@ -30628,7 +33471,7 @@ public class Hbase { } - public static class scannerClose_args implements TBase, java.io.Serializable, Cloneable, Comparable { + public static class scannerClose_args implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("scannerClose_args"); private static final TField ID_FIELD_DESC = new TField("id", TType.I32, (short)1); @@ -30645,12 +33488,10 @@ public class Hbase { */ ID((short)1, "id"); - 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); } } @@ -30659,7 +33500,12 @@ public class Hbase { * 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: // ID + return ID; + default: + return null; + } } /** @@ -30700,12 +33546,12 @@ public class Hbase { private static final int __ID_ISSET_ID = 0; private BitSet __isset_bit_vector = new BitSet(1); - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.I32))); - }}); - + public static final Map<_Fields, FieldMetaData> metaDataMap; static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.I32 , "ScannerID"))); + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(scannerClose_args.class, metaDataMap); } @@ -30733,9 +33579,10 @@ public class Hbase { return new scannerClose_args(this); } - @Deprecated - public scannerClose_args clone() { - return new scannerClose_args(this); + @Override + public void clear() { + setIdIsSet(false); + this.id = 0; } /** @@ -30780,10 +33627,6 @@ public class Hbase { } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case ID: @@ -30793,12 +33636,12 @@ public class Hbase { 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 ID: return isSetId(); @@ -30806,10 +33649,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -30855,42 +33694,45 @@ public class Hbase { int lastComparison = 0; scannerClose_args typedOther = (scannerClose_args)other; - lastComparison = Boolean.valueOf(isSetId()).compareTo(isSetId()); + lastComparison = Boolean.valueOf(isSetId()).compareTo(typedOther.isSetId()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(id, typedOther.id); - if (lastComparison != 0) { - return lastComparison; + if (isSetId()) { + lastComparison = TBaseHelper.compareTo(this.id, typedOther.id); + 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 ID: - if (field.type == TType.I32) { - this.id = iprot.readI32(); - setIdIsSet(true); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); + switch (field.id) { + case 1: // ID + if (field.type == TType.I32) { + this.id = iprot.readI32(); + setIdIsSet(true); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); } + iprot.readFieldEnd(); } iprot.readStructEnd(); @@ -30927,7 +33769,7 @@ public class Hbase { } - public static class scannerClose_result implements TBase, java.io.Serializable, Cloneable, Comparable { + public static class scannerClose_result implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("scannerClose_result"); private static final TField IO_FIELD_DESC = new TField("io", TType.STRUCT, (short)1); @@ -30941,12 +33783,10 @@ public class Hbase { IO((short)1, "io"), IA((short)2, "ia"); - 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); } } @@ -30955,7 +33795,14 @@ public class Hbase { * 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: // IO + return IO; + case 2: // IA + return IA; + default: + return null; + } } /** @@ -30994,14 +33841,14 @@ public class Hbase { // isset id assignments - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, + public static final Map<_Fields, FieldMetaData> metaDataMap; + static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); - put(_Fields.IA, new FieldMetaData("ia", TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.IA, new FieldMetaData("ia", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); - }}); - - static { + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(scannerClose_result.class, metaDataMap); } @@ -31033,9 +33880,10 @@ public class Hbase { return new scannerClose_result(this); } - @Deprecated - public scannerClose_result clone() { - return new scannerClose_result(this); + @Override + public void clear() { + this.io = null; + this.ia = null; } public IOError getIo() { @@ -31107,10 +33955,6 @@ public class Hbase { } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case IO: @@ -31123,12 +33967,12 @@ public class Hbase { 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 IO: return isSetIo(); @@ -31138,10 +33982,6 @@ public class Hbase { throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -31201,58 +34041,63 @@ public class Hbase { int lastComparison = 0; scannerClose_result typedOther = (scannerClose_result)other; - lastComparison = Boolean.valueOf(isSetIo()).compareTo(isSetIo()); + lastComparison = Boolean.valueOf(isSetIo()).compareTo(typedOther.isSetIo()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(io, typedOther.io); - if (lastComparison != 0) { - return lastComparison; + if (isSetIo()) { + lastComparison = TBaseHelper.compareTo(this.io, typedOther.io); + if (lastComparison != 0) { + return lastComparison; + } } - lastComparison = Boolean.valueOf(isSetIa()).compareTo(isSetIa()); + lastComparison = Boolean.valueOf(isSetIa()).compareTo(typedOther.isSetIa()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(ia, typedOther.ia); - if (lastComparison != 0) { - return lastComparison; + if (isSetIa()) { + lastComparison = TBaseHelper.compareTo(this.ia, typedOther.ia); + 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 IO: - if (field.type == TType.STRUCT) { - this.io = new IOError(); - this.io.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case IA: - if (field.type == TType.STRUCT) { - this.ia = new IllegalArgument(); - this.ia.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); - } + switch (field.id) { + case 1: // IO + if (field.type == TType.STRUCT) { + this.io = new IOError(); + this.io.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 2: // IA + if (field.type == TType.STRUCT) { + this.ia = new IllegalArgument(); + this.ia.read(iprot); + } 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/IOError.java b/src/main/java/org/apache/hadoop/hbase/thrift/generated/IOError.java index d2bfa10..02aa2aa 100644 --- a/src/main/java/org/apache/hadoop/hbase/thrift/generated/IOError.java +++ b/src/main/java/org/apache/hadoop/hbase/thrift/generated/IOError.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.*; * to the Hbase master or an Hbase region server. Also used to return * more general Hbase error conditions. */ -public class IOError extends Exception implements TBase, java.io.Serializable, Cloneable, Comparable { +public class IOError extends Exception implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("IOError"); private static final TField MESSAGE_FIELD_DESC = new TField("message", TType.STRING, (short)1); @@ -52,12 +43,10 @@ public class IOError extends Exception implements TBase, java.i public enum _Fields implements TFieldIdEnum { MESSAGE((short)1, "message"); - 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); } } @@ -66,7 +55,12 @@ public class IOError extends Exception 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: // MESSAGE + return MESSAGE; + default: + return null; + } } /** @@ -105,12 +99,12 @@ public class IOError extends Exception implements TBase, java.i // isset id assignments - public static final Map<_Fields, FieldMetaData> 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(IOError.class, metaDataMap); } @@ -137,9 +131,9 @@ public class IOError extends Exception implements TBase, java.i return new IOError(this); } - @Deprecated - public IOError clone() { - return new IOError(this); + @Override + public void clear() { + this.message = null; } public String getMessage() { @@ -179,10 +173,6 @@ public class IOError extends Exception implements TBase, java.i } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case MESSAGE: @@ -192,12 +182,12 @@ public class IOError extends Exception 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 MESSAGE: return isSetMessage(); @@ -205,10 +195,6 @@ public class IOError extends Exception 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) @@ -254,41 +240,44 @@ public class IOError extends Exception implements TBase, java.i int lastComparison = 0; IOError typedOther = (IOError)other; - lastComparison = Boolean.valueOf(isSetMessage()).compareTo(isSetMessage()); + lastComparison = Boolean.valueOf(isSetMessage()).compareTo(typedOther.isSetMessage()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(message, typedOther.message); - if (lastComparison != 0) { - return lastComparison; + if (isSetMessage()) { + lastComparison = TBaseHelper.compareTo(this.message, typedOther.message); + 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 MESSAGE: - if (field.type == TType.STRING) { - this.message = iprot.readString(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); + switch (field.id) { + case 1: // MESSAGE + if (field.type == TType.STRING) { + this.message = iprot.readString(); + } 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/IllegalArgument.java b/src/main/java/org/apache/hadoop/hbase/thrift/generated/IllegalArgument.java index 6eb2700..4329dbc 100644 --- a/src/main/java/org/apache/hadoop/hbase/thrift/generated/IllegalArgument.java +++ b/src/main/java/org/apache/hadoop/hbase/thrift/generated/IllegalArgument.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,19 +16,22 @@ 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.*; /** * An IllegalArgument exception indicates an illegal or invalid * argument was passed into a procedure. */ -public class IllegalArgument extends Exception implements TBase, java.io.Serializable, Cloneable, Comparable { +public class IllegalArgument extends Exception implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("IllegalArgument"); private static final TField MESSAGE_FIELD_DESC = new TField("message", TType.STRING, (short)1); @@ -51,12 +42,10 @@ public class IllegalArgument 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); } } @@ -65,7 +54,12 @@ public class IllegalArgument 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(IllegalArgument.class, metaDataMap); } @@ -136,9 +130,9 @@ public class IllegalArgument extends Exception implements TBase, java.io.Serializable, Cloneable, Comparable { +public class Mutation implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("Mutation"); private static final TField IS_DELETE_FIELD_DESC = new TField("isDelete", TType.BOOL, (short)1); @@ -47,8 +38,8 @@ public class Mutation implements TBase, java.io.Serializable, private static final TField VALUE_FIELD_DESC = new TField("value", TType.STRING, (short)3); public boolean isDelete; - public byte[] column; - public byte[] value; + public ByteBuffer column; + public ByteBuffer value; /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements TFieldIdEnum { @@ -56,12 +47,10 @@ public class Mutation implements TBase, java.io.Serializable, COLUMN((short)2, "column"), VALUE((short)3, "value"); - 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); } } @@ -70,7 +59,16 @@ public class Mutation implements TBase, java.io.Serializable, * 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: // IS_DELETE + return IS_DELETE; + case 2: // COLUMN + return COLUMN; + case 3: // VALUE + return VALUE; + default: + return null; + } } /** @@ -111,16 +109,16 @@ public class Mutation implements TBase, java.io.Serializable, private static final int __ISDELETE_ISSET_ID = 0; private BitSet __isset_bit_vector = new BitSet(1); - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.IS_DELETE, new FieldMetaData("isDelete", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.BOOL))); - put(_Fields.COLUMN, new FieldMetaData("column", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(_Fields.VALUE, new FieldMetaData("value", 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.IS_DELETE, new FieldMetaData("isDelete", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.BOOL))); + tmpMap.put(_Fields.COLUMN, new FieldMetaData("column", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING , "Text"))); + tmpMap.put(_Fields.VALUE, new FieldMetaData("value", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING , "Text"))); + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(Mutation.class, metaDataMap); } @@ -131,8 +129,8 @@ public class Mutation implements TBase, java.io.Serializable, public Mutation( boolean isDelete, - byte[] column, - byte[] value) + ByteBuffer column, + ByteBuffer value) { this(); this.isDelete = isDelete; @@ -160,9 +158,12 @@ public class Mutation implements TBase, java.io.Serializable, return new Mutation(this); } - @Deprecated - public Mutation clone() { - return new Mutation(this); + @Override + public void clear() { + this.isDelete = false; + + this.column = null; + this.value = null; } public boolean isIsDelete() { @@ -189,10 +190,20 @@ public class Mutation implements TBase, java.io.Serializable, } public byte[] getColumn() { - return this.column; + setColumn(TBaseHelper.rightSize(column)); + return column.array(); + } + + public ByteBuffer BufferForColumn() { + return column; } public Mutation setColumn(byte[] column) { + setColumn(ByteBuffer.wrap(column)); + return this; + } + + public Mutation setColumn(ByteBuffer column) { this.column = column; return this; } @@ -213,10 +224,20 @@ public class Mutation implements TBase, java.io.Serializable, } public byte[] getValue() { - return this.value; + setValue(TBaseHelper.rightSize(value)); + return value.array(); + } + + public ByteBuffer BufferForValue() { + return value; } public Mutation setValue(byte[] value) { + setValue(ByteBuffer.wrap(value)); + return this; + } + + public Mutation setValue(ByteBuffer value) { this.value = value; return this; } @@ -250,7 +271,7 @@ public class Mutation implements TBase, java.io.Serializable, if (value == null) { unsetColumn(); } else { - setColumn((byte[])value); + setColumn((ByteBuffer)value); } break; @@ -258,17 +279,13 @@ public class Mutation implements TBase, java.io.Serializable, if (value == null) { unsetValue(); } else { - setValue((byte[])value); + setValue((ByteBuffer)value); } break; } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case IS_DELETE: @@ -284,12 +301,12 @@ public class Mutation implements TBase, java.io.Serializable, 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 IS_DELETE: return isSetIsDelete(); @@ -301,10 +318,6 @@ public class Mutation implements TBase, java.io.Serializable, throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -332,7 +345,7 @@ public class Mutation implements TBase, java.io.Serializable, if (this_present_column || that_present_column) { if (!(this_present_column && that_present_column)) return false; - if (!java.util.Arrays.equals(this.column, that.column)) + if (!this.column.equals(that.column)) return false; } @@ -341,7 +354,7 @@ public class Mutation implements TBase, java.io.Serializable, if (this_present_value || that_present_value) { if (!(this_present_value && that_present_value)) return false; - if (!java.util.Arrays.equals(this.value, that.value)) + if (!this.value.equals(that.value)) return false; } @@ -378,72 +391,79 @@ public class Mutation implements TBase, java.io.Serializable, int lastComparison = 0; Mutation typedOther = (Mutation)other; - lastComparison = Boolean.valueOf(isSetIsDelete()).compareTo(isSetIsDelete()); + lastComparison = Boolean.valueOf(isSetIsDelete()).compareTo(typedOther.isSetIsDelete()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(isDelete, typedOther.isDelete); - if (lastComparison != 0) { - return lastComparison; + if (isSetIsDelete()) { + lastComparison = TBaseHelper.compareTo(this.isDelete, typedOther.isDelete); + if (lastComparison != 0) { + return lastComparison; + } } - lastComparison = Boolean.valueOf(isSetColumn()).compareTo(isSetColumn()); + lastComparison = Boolean.valueOf(isSetColumn()).compareTo(typedOther.isSetColumn()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(column, typedOther.column); - if (lastComparison != 0) { - return lastComparison; + if (isSetColumn()) { + lastComparison = TBaseHelper.compareTo(this.column, typedOther.column); + if (lastComparison != 0) { + return lastComparison; + } } - lastComparison = Boolean.valueOf(isSetValue()).compareTo(isSetValue()); + lastComparison = Boolean.valueOf(isSetValue()).compareTo(typedOther.isSetValue()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(value, typedOther.value); - if (lastComparison != 0) { - return lastComparison; + if (isSetValue()) { + lastComparison = TBaseHelper.compareTo(this.value, typedOther.value); + 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 IS_DELETE: - if (field.type == TType.BOOL) { - this.isDelete = iprot.readBool(); - setIsDeleteIsSet(true); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case COLUMN: - if (field.type == TType.STRING) { - this.column = iprot.readBinary(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case VALUE: - if (field.type == TType.STRING) { - this.value = iprot.readBinary(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); + switch (field.id) { + case 1: // IS_DELETE + if (field.type == TType.BOOL) { + this.isDelete = iprot.readBool(); + setIsDeleteIsSet(true); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 2: // COLUMN + if (field.type == TType.STRING) { + this.column = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 3: // VALUE + if (field.type == TType.STRING) { + this.value = iprot.readBinary(); + } 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/TCell.java b/src/main/java/org/apache/hadoop/hbase/thrift/generated/TCell.java index ed021d3..8af6e5b 100644 --- a/src/main/java/org/apache/hadoop/hbase/thrift/generated/TCell.java +++ b/src/main/java/org/apache/hadoop/hbase/thrift/generated/TCell.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.*; /** @@ -42,13 +33,13 @@ import org.apache.thrift.protocol.*; * the timestamp of a cell to a first-class value, making it easy to take * note of temporal data. Cell is used all the way from HStore up to HTable. */ -public class TCell implements TBase, java.io.Serializable, Cloneable, Comparable { +public class TCell implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("TCell"); private static final TField VALUE_FIELD_DESC = new TField("value", TType.STRING, (short)1); private static final TField TIMESTAMP_FIELD_DESC = new TField("timestamp", TType.I64, (short)2); - public byte[] value; + public ByteBuffer value; public long timestamp; /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -56,12 +47,10 @@ public class TCell implements TBase, java.io.Serializable, Clonea VALUE((short)1, "value"), TIMESTAMP((short)2, "timestamp"); - 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); } } @@ -70,7 +59,14 @@ public class TCell implements TBase, java.io.Serializable, Clonea * 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: // VALUE + return VALUE; + case 2: // TIMESTAMP + return TIMESTAMP; + default: + return null; + } } /** @@ -111,14 +107,14 @@ public class TCell implements TBase, java.io.Serializable, Clonea private static final int __TIMESTAMP_ISSET_ID = 0; private BitSet __isset_bit_vector = new BitSet(1); - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.VALUE, new FieldMetaData("value", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(_Fields.TIMESTAMP, new FieldMetaData("timestamp", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.I64))); - }}); - + public static final Map<_Fields, FieldMetaData> metaDataMap; static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.VALUE, new FieldMetaData("value", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING , "Bytes"))); + tmpMap.put(_Fields.TIMESTAMP, new FieldMetaData("timestamp", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.I64))); + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(TCell.class, metaDataMap); } @@ -126,7 +122,7 @@ public class TCell implements TBase, java.io.Serializable, Clonea } public TCell( - byte[] value, + ByteBuffer value, long timestamp) { this(); @@ -151,16 +147,28 @@ public class TCell implements TBase, java.io.Serializable, Clonea return new TCell(this); } - @Deprecated - public TCell clone() { - return new TCell(this); + @Override + public void clear() { + this.value = null; + setTimestampIsSet(false); + this.timestamp = 0; } public byte[] getValue() { - return this.value; + setValue(TBaseHelper.rightSize(value)); + return value.array(); + } + + public ByteBuffer BufferForValue() { + return value; } public TCell setValue(byte[] value) { + setValue(ByteBuffer.wrap(value)); + return this; + } + + public TCell setValue(ByteBuffer value) { this.value = value; return this; } @@ -209,7 +217,7 @@ public class TCell implements TBase, java.io.Serializable, Clonea if (value == null) { unsetValue(); } else { - setValue((byte[])value); + setValue((ByteBuffer)value); } break; @@ -224,10 +232,6 @@ public class TCell implements TBase, java.io.Serializable, Clonea } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case VALUE: @@ -240,12 +244,12 @@ public class TCell implements TBase, java.io.Serializable, Clonea 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 VALUE: return isSetValue(); @@ -255,10 +259,6 @@ public class TCell implements TBase, java.io.Serializable, Clonea throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -277,7 +277,7 @@ public class TCell implements TBase, java.io.Serializable, Clonea if (this_present_value || that_present_value) { if (!(this_present_value && that_present_value)) return false; - if (!java.util.Arrays.equals(this.value, that.value)) + if (!this.value.equals(that.value)) return false; } @@ -318,57 +318,62 @@ public class TCell implements TBase, java.io.Serializable, Clonea int lastComparison = 0; TCell typedOther = (TCell)other; - lastComparison = Boolean.valueOf(isSetValue()).compareTo(isSetValue()); + lastComparison = Boolean.valueOf(isSetValue()).compareTo(typedOther.isSetValue()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(value, typedOther.value); - if (lastComparison != 0) { - return lastComparison; + if (isSetValue()) { + lastComparison = TBaseHelper.compareTo(this.value, typedOther.value); + if (lastComparison != 0) { + return lastComparison; + } } - lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(isSetTimestamp()); + lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(typedOther.isSetTimestamp()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(timestamp, typedOther.timestamp); - if (lastComparison != 0) { - return lastComparison; + if (isSetTimestamp()) { + lastComparison = TBaseHelper.compareTo(this.timestamp, typedOther.timestamp); + 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 VALUE: - if (field.type == TType.STRING) { - this.value = iprot.readBinary(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case TIMESTAMP: - if (field.type == TType.I64) { - this.timestamp = iprot.readI64(); - setTimestampIsSet(true); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); + switch (field.id) { + case 1: // VALUE + if (field.type == TType.STRING) { + this.value = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 2: // TIMESTAMP + if (field.type == TType.I64) { + this.timestamp = iprot.readI64(); + setTimestampIsSet(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/TRegionInfo.java b/src/main/java/org/apache/hadoop/hbase/thrift/generated/TRegionInfo.java index a397431..23edbc7 100644 --- a/src/main/java/org/apache/hadoop/hbase/thrift/generated/TRegionInfo.java +++ b/src/main/java/org/apache/hadoop/hbase/thrift/generated/TRegionInfo.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,18 +16,21 @@ 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.*; /** * A TRegionInfo contains information about an HTable region. */ -public class TRegionInfo implements TBase, java.io.Serializable, Cloneable, Comparable { +public class TRegionInfo implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("TRegionInfo"); private static final TField START_KEY_FIELD_DESC = new TField("startKey", TType.STRING, (short)1); @@ -48,10 +39,10 @@ public class TRegionInfo implements TBase, java.io.Serializ private static final TField NAME_FIELD_DESC = new TField("name", TType.STRING, (short)4); private static final TField VERSION_FIELD_DESC = new TField("version", TType.BYTE, (short)5); - public byte[] startKey; - public byte[] endKey; + public ByteBuffer startKey; + public ByteBuffer endKey; public long id; - public byte[] name; + public ByteBuffer name; public byte version; /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -62,12 +53,10 @@ public class TRegionInfo implements TBase, java.io.Serializ NAME((short)4, "name"), VERSION((short)5, "version"); - 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); } } @@ -76,7 +65,20 @@ public class TRegionInfo implements TBase, java.io.Serializ * 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: // START_KEY + return START_KEY; + case 2: // END_KEY + return END_KEY; + case 3: // ID + return ID; + case 4: // NAME + return NAME; + case 5: // VERSION + return VERSION; + default: + return null; + } } /** @@ -118,20 +120,20 @@ public class TRegionInfo implements TBase, java.io.Serializ private static final int __VERSION_ISSET_ID = 1; private BitSet __isset_bit_vector = new BitSet(2); - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.START_KEY, new FieldMetaData("startKey", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(_Fields.END_KEY, new FieldMetaData("endKey", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(_Fields.ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT, + public static final Map<_Fields, FieldMetaData> metaDataMap; + static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.START_KEY, new FieldMetaData("startKey", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING , "Text"))); + tmpMap.put(_Fields.END_KEY, new FieldMetaData("endKey", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING , "Text"))); + tmpMap.put(_Fields.ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.I64))); - put(_Fields.NAME, new FieldMetaData("name", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(_Fields.VERSION, new FieldMetaData("version", TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.NAME, new FieldMetaData("name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING , "Text"))); + tmpMap.put(_Fields.VERSION, new FieldMetaData("version", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.BYTE))); - }}); - - static { + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(TRegionInfo.class, metaDataMap); } @@ -139,10 +141,10 @@ public class TRegionInfo implements TBase, java.io.Serializ } public TRegionInfo( - byte[] startKey, - byte[] endKey, + ByteBuffer startKey, + ByteBuffer endKey, long id, - byte[] name, + ByteBuffer name, byte version) { this(); @@ -178,16 +180,32 @@ public class TRegionInfo implements TBase, java.io.Serializ return new TRegionInfo(this); } - @Deprecated - public TRegionInfo clone() { - return new TRegionInfo(this); + @Override + public void clear() { + this.startKey = null; + this.endKey = null; + setIdIsSet(false); + this.id = 0; + this.name = null; + setVersionIsSet(false); + this.version = 0; } public byte[] getStartKey() { - return this.startKey; + setStartKey(TBaseHelper.rightSize(startKey)); + return startKey.array(); + } + + public ByteBuffer BufferForStartKey() { + return startKey; } public TRegionInfo setStartKey(byte[] startKey) { + setStartKey(ByteBuffer.wrap(startKey)); + return this; + } + + public TRegionInfo setStartKey(ByteBuffer startKey) { this.startKey = startKey; return this; } @@ -208,10 +226,20 @@ public class TRegionInfo implements TBase, java.io.Serializ } public byte[] getEndKey() { - return this.endKey; + setEndKey(TBaseHelper.rightSize(endKey)); + return endKey.array(); + } + + public ByteBuffer BufferForEndKey() { + return endKey; } public TRegionInfo setEndKey(byte[] endKey) { + setEndKey(ByteBuffer.wrap(endKey)); + return this; + } + + public TRegionInfo setEndKey(ByteBuffer endKey) { this.endKey = endKey; return this; } @@ -255,10 +283,20 @@ public class TRegionInfo implements TBase, java.io.Serializ } public byte[] getName() { - return this.name; + setName(TBaseHelper.rightSize(name)); + return name.array(); + } + + public ByteBuffer BufferForName() { + return name; } public TRegionInfo setName(byte[] name) { + setName(ByteBuffer.wrap(name)); + return this; + } + + public TRegionInfo setName(ByteBuffer name) { this.name = name; return this; } @@ -307,7 +345,7 @@ public class TRegionInfo implements TBase, java.io.Serializ if (value == null) { unsetStartKey(); } else { - setStartKey((byte[])value); + setStartKey((ByteBuffer)value); } break; @@ -315,7 +353,7 @@ public class TRegionInfo implements TBase, java.io.Serializ if (value == null) { unsetEndKey(); } else { - setEndKey((byte[])value); + setEndKey((ByteBuffer)value); } break; @@ -331,7 +369,7 @@ public class TRegionInfo implements TBase, java.io.Serializ if (value == null) { unsetName(); } else { - setName((byte[])value); + setName((ByteBuffer)value); } break; @@ -346,10 +384,6 @@ public class TRegionInfo implements TBase, java.io.Serializ } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case START_KEY: @@ -371,12 +405,12 @@ public class TRegionInfo implements TBase, java.io.Serializ 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 START_KEY: return isSetStartKey(); @@ -392,10 +426,6 @@ public class TRegionInfo implements TBase, java.io.Serializ throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -414,7 +444,7 @@ public class TRegionInfo implements TBase, java.io.Serializ if (this_present_startKey || that_present_startKey) { if (!(this_present_startKey && that_present_startKey)) return false; - if (!java.util.Arrays.equals(this.startKey, that.startKey)) + if (!this.startKey.equals(that.startKey)) return false; } @@ -423,7 +453,7 @@ public class TRegionInfo implements TBase, java.io.Serializ if (this_present_endKey || that_present_endKey) { if (!(this_present_endKey && that_present_endKey)) return false; - if (!java.util.Arrays.equals(this.endKey, that.endKey)) + if (!this.endKey.equals(that.endKey)) return false; } @@ -441,7 +471,7 @@ public class TRegionInfo implements TBase, java.io.Serializ 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; } @@ -497,103 +527,114 @@ public class TRegionInfo implements TBase, java.io.Serializ int lastComparison = 0; TRegionInfo typedOther = (TRegionInfo)other; - lastComparison = Boolean.valueOf(isSetStartKey()).compareTo(isSetStartKey()); + lastComparison = Boolean.valueOf(isSetStartKey()).compareTo(typedOther.isSetStartKey()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(startKey, typedOther.startKey); - if (lastComparison != 0) { - return lastComparison; + if (isSetStartKey()) { + lastComparison = TBaseHelper.compareTo(this.startKey, typedOther.startKey); + if (lastComparison != 0) { + return lastComparison; + } } - lastComparison = Boolean.valueOf(isSetEndKey()).compareTo(isSetEndKey()); + lastComparison = Boolean.valueOf(isSetEndKey()).compareTo(typedOther.isSetEndKey()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(endKey, typedOther.endKey); - if (lastComparison != 0) { - return lastComparison; + if (isSetEndKey()) { + lastComparison = TBaseHelper.compareTo(this.endKey, typedOther.endKey); + if (lastComparison != 0) { + return lastComparison; + } } - lastComparison = Boolean.valueOf(isSetId()).compareTo(isSetId()); + lastComparison = Boolean.valueOf(isSetId()).compareTo(typedOther.isSetId()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(id, typedOther.id); - if (lastComparison != 0) { - return lastComparison; + if (isSetId()) { + lastComparison = TBaseHelper.compareTo(this.id, typedOther.id); + if (lastComparison != 0) { + return lastComparison; + } } - 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(isSetVersion()).compareTo(isSetVersion()); + lastComparison = Boolean.valueOf(isSetVersion()).compareTo(typedOther.isSetVersion()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(version, typedOther.version); - if (lastComparison != 0) { - return lastComparison; + if (isSetVersion()) { + lastComparison = TBaseHelper.compareTo(this.version, typedOther.version); + 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 START_KEY: - if (field.type == TType.STRING) { - this.startKey = iprot.readBinary(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case END_KEY: - if (field.type == TType.STRING) { - this.endKey = iprot.readBinary(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case ID: - if (field.type == TType.I64) { - this.id = iprot.readI64(); - setIdIsSet(true); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case NAME: - if (field.type == TType.STRING) { - this.name = iprot.readBinary(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case VERSION: - if (field.type == TType.BYTE) { - this.version = iprot.readByte(); - setVersionIsSet(true); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); + switch (field.id) { + case 1: // START_KEY + if (field.type == TType.STRING) { + this.startKey = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 2: // END_KEY + if (field.type == TType.STRING) { + this.endKey = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 3: // ID + if (field.type == TType.I64) { + this.id = iprot.readI64(); + setIdIsSet(true); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 4: // NAME + if (field.type == TType.STRING) { + this.name = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 5: // VERSION + if (field.type == TType.BYTE) { + this.version = iprot.readByte(); + setVersionIsSet(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/TRowResult.java b/src/main/java/org/apache/hadoop/hbase/thrift/generated/TRowResult.java index 39d0f9b..df8f4e9 100644 --- a/src/main/java/org/apache/hadoop/hbase/thrift/generated/TRowResult.java +++ b/src/main/java/org/apache/hadoop/hbase/thrift/generated/TRowResult.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,37 +16,38 @@ 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.*; /** * Holds row name and then a map of columns to cells. */ -public class TRowResult implements TBase, java.io.Serializable, Cloneable { +public class TRowResult implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("TRowResult"); private static final TField ROW_FIELD_DESC = new TField("row", TType.STRING, (short)1); private static final TField COLUMNS_FIELD_DESC = new TField("columns", TType.MAP, (short)2); - public byte[] row; - public Map columns; + public ByteBuffer row; + public Map columns; /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements TFieldIdEnum { ROW((short)1, "row"), COLUMNS((short)2, "columns"); - 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 TRowResult implements TBase, java.io.Serializab * 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: // COLUMNS + return COLUMNS; + default: + return null; + } } /** @@ -106,16 +102,16 @@ public class TRowResult implements TBase, java.io.Serializab // 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.COLUMNS, new FieldMetaData("columns", TFieldRequirementType.DEFAULT, - new MapMetaData(TType.MAP, - new FieldValueMetaData(TType.STRING), - new StructMetaData(TType.STRUCT, TCell.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.COLUMNS, new FieldMetaData("columns", TFieldRequirementType.DEFAULT, + new MapMetaData(TType.MAP, + new FieldValueMetaData(TType.STRING , "Text"), + new StructMetaData(TType.STRUCT, TCell.class)))); + metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(TRowResult.class, metaDataMap); } @@ -123,8 +119,8 @@ public class TRowResult implements TBase, java.io.Serializab } public TRowResult( - byte[] row, - Map columns) + ByteBuffer row, + Map columns) { this(); this.row = row; @@ -139,13 +135,13 @@ public class TRowResult implements TBase, java.io.Serializab this.row = other.row; } if (other.isSetColumns()) { - Map __this__columns = new HashMap(); - for (Map.Entry other_element : other.columns.entrySet()) { + Map __this__columns = new HashMap(); + for (Map.Entry other_element : other.columns.entrySet()) { - byte[] other_element_key = other_element.getKey(); + ByteBuffer other_element_key = other_element.getKey(); TCell other_element_value = other_element.getValue(); - byte[] __this__columns_copy_key = other_element_key; + ByteBuffer __this__columns_copy_key = other_element_key; TCell __this__columns_copy_value = new TCell(other_element_value); @@ -159,16 +155,27 @@ public class TRowResult implements TBase, java.io.Serializab return new TRowResult(this); } - @Deprecated - public TRowResult clone() { - return new TRowResult(this); + @Override + public void clear() { + this.row = null; + this.columns = null; } public byte[] getRow() { - return this.row; + setRow(TBaseHelper.rightSize(row)); + return row.array(); + } + + public ByteBuffer BufferForRow() { + return row; } public TRowResult setRow(byte[] row) { + setRow(ByteBuffer.wrap(row)); + return this; + } + + public TRowResult setRow(ByteBuffer row) { this.row = row; return this; } @@ -192,18 +199,18 @@ public class TRowResult implements TBase, java.io.Serializab return (this.columns == null) ? 0 : this.columns.size(); } - public void putToColumns(byte[] key, TCell val) { + public void putToColumns(ByteBuffer key, TCell val) { if (this.columns == null) { - this.columns = new HashMap(); + this.columns = new HashMap(); } this.columns.put(key, val); } - public Map getColumns() { + public Map getColumns() { return this.columns; } - public TRowResult setColumns(Map columns) { + public TRowResult setColumns(Map columns) { this.columns = columns; return this; } @@ -229,7 +236,7 @@ public class TRowResult implements TBase, java.io.Serializab if (value == null) { unsetRow(); } else { - setRow((byte[])value); + setRow((ByteBuffer)value); } break; @@ -237,17 +244,13 @@ public class TRowResult implements TBase, java.io.Serializab if (value == null) { unsetColumns(); } else { - setColumns((Map)value); + setColumns((Map)value); } break; } } - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - public Object getFieldValue(_Fields field) { switch (field) { case ROW: @@ -260,12 +263,12 @@ public class TRowResult implements TBase, java.io.Serializab 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(); @@ -275,10 +278,6 @@ public class TRowResult implements TBase, java.io.Serializab throw new IllegalStateException(); } - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - @Override public boolean equals(Object that) { if (that == null) @@ -297,7 +296,7 @@ public class TRowResult implements TBase, java.io.Serializab 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; } @@ -330,50 +329,82 @@ public class TRowResult implements TBase, java.io.Serializab return builder.toHashCode(); } + public int compareTo(TRowResult other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + TRowResult typedOther = (TRowResult)other; + + lastComparison = Boolean.valueOf(isSetRow()).compareTo(typedOther.isSetRow()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRow()) { + lastComparison = TBaseHelper.compareTo(this.row, typedOther.row); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetColumns()).compareTo(typedOther.isSetColumns()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetColumns()) { + lastComparison = TBaseHelper.compareTo(this.columns, typedOther.columns); + 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 COLUMNS: - if (field.type == TType.MAP) { + switch (field.id) { + case 1: // ROW + if (field.type == TType.STRING) { + this.row = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 2: // COLUMNS + if (field.type == TType.MAP) { + { + TMap _map4 = iprot.readMapBegin(); + this.columns = new HashMap(2*_map4.size); + for (int _i5 = 0; _i5 < _map4.size; ++_i5) { - TMap _map4 = iprot.readMapBegin(); - this.columns = new HashMap(2*_map4.size); - for (int _i5 = 0; _i5 < _map4.size; ++_i5) - { - byte[] _key6; - TCell _val7; - _key6 = iprot.readBinary(); - _val7 = new TCell(); - _val7.read(iprot); - this.columns.put(_key6, _val7); - } - iprot.readMapEnd(); + ByteBuffer _key6; + TCell _val7; + _key6 = iprot.readBinary(); + _val7 = new TCell(); + _val7.read(iprot); + this.columns.put(_key6, _val7); } - } else { - TProtocolUtil.skip(iprot, field.type); + iprot.readMapEnd(); } - break; - } - iprot.readFieldEnd(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); } + iprot.readFieldEnd(); } iprot.readStructEnd(); @@ -394,7 +425,7 @@ public class TRowResult implements TBase, java.io.Serializab oprot.writeFieldBegin(COLUMNS_FIELD_DESC); { oprot.writeMapBegin(new TMap(TType.STRING, TType.STRUCT, this.columns.size())); - for (Map.Entry _iter8 : this.columns.entrySet()) + for (Map.Entry _iter8 : this.columns.entrySet()) { oprot.writeBinary(_iter8.getKey()); _iter8.getValue().write(oprot); diff --git a/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftServer.java b/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftServer.java index edd1740..06e4611 100644 --- a/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftServer.java +++ b/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftServer.java @@ -19,6 +19,7 @@ */ package org.apache.hadoop.hbase.thrift; +import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.List; @@ -37,16 +38,16 @@ import org.apache.hadoop.hbase.util.Bytes; public class TestThriftServer extends HBaseClusterTestCase { // Static names for tables, columns, rows, and values - private static byte[] tableAname = Bytes.toBytes("tableA"); - private static byte[] tableBname = Bytes.toBytes("tableB"); - private static byte[] columnAname = Bytes.toBytes("columnA:"); - private static byte[] columnBname = Bytes.toBytes("columnB:"); - private static byte[] rowAname = Bytes.toBytes("rowA"); - private static byte[] rowBname = Bytes.toBytes("rowB"); - private static byte[] valueAname = Bytes.toBytes("valueA"); - private static byte[] valueBname = Bytes.toBytes("valueB"); - private static byte[] valueCname = Bytes.toBytes("valueC"); - private static byte[] valueDname = Bytes.toBytes("valueD"); + private static ByteBuffer tableAname = ByteBuffer.wrap(Bytes.toBytes("tableA")); + private static ByteBuffer tableBname = ByteBuffer.wrap(Bytes.toBytes("tableB")); + private static ByteBuffer columnAname = ByteBuffer.wrap(Bytes.toBytes("columnA:")); + private static ByteBuffer columnBname = ByteBuffer.wrap(Bytes.toBytes("columnB:")); + private static ByteBuffer rowAname = ByteBuffer.wrap(Bytes.toBytes("rowA")); + private static ByteBuffer rowBname = ByteBuffer.wrap(Bytes.toBytes("rowB")); + private static ByteBuffer valueAname = ByteBuffer.wrap(Bytes.toBytes("valueA")); + private static ByteBuffer valueBname = ByteBuffer.wrap(Bytes.toBytes("valueB")); + private static ByteBuffer valueCname = ByteBuffer.wrap(Bytes.toBytes("valueC")); + private static ByteBuffer valueDname = ByteBuffer.wrap(Bytes.toBytes("valueD")); /** * Runs all of the tests under a single JUnit test method. We @@ -113,12 +114,10 @@ public class TestThriftServer extends HBaseClusterTestCase { handler.mutateRow(tableAname, rowAname, getMutations()); // Assert that the changes were made - assertTrue(Bytes.equals(valueAname, - handler.get(tableAname, rowAname, columnAname).get(0).value)); + assertEquals(valueAname, handler.get(tableAname, rowAname, columnAname).get(0).value); TRowResult rowResult1 = handler.getRow(tableAname, rowAname).get(0); - assertTrue(Bytes.equals(rowAname, rowResult1.row)); - assertTrue(Bytes.equals(valueBname, - rowResult1.columns.get(columnBname).value)); + assertEquals(rowAname, rowResult1.row); + assertEquals(valueBname, rowResult1.columns.get(columnBname).value); // Apply a few BatchMutations for rowA and rowB // rowAmutations.add(new Mutation(true, columnAname, null)); @@ -133,16 +132,16 @@ public class TestThriftServer extends HBaseClusterTestCase { // Assert that changes were made to rowA List cells = handler.get(tableAname, rowAname, columnAname); assertFalse(cells.size() > 0); - assertTrue(Bytes.equals(valueCname, handler.get(tableAname, rowAname, columnBname).get(0).value)); + assertEquals(valueCname, handler.get(tableAname, rowAname, columnBname).get(0).value); List versions = handler.getVer(tableAname, rowAname, columnBname, MAXVERSIONS); - assertTrue(Bytes.equals(valueCname, versions.get(0).value)); - assertTrue(Bytes.equals(valueBname, versions.get(1).value)); + assertEquals(valueCname, versions.get(0).value); + assertEquals(valueBname, versions.get(1).value); // Assert that changes were made to rowB TRowResult rowResult2 = handler.getRow(tableAname, rowBname).get(0); - assertTrue(Bytes.equals(rowBname, rowResult2.row)); - assertTrue(Bytes.equals(valueCname, rowResult2.columns.get(columnAname).value)); - assertTrue(Bytes.equals(valueDname, rowResult2.columns.get(columnBname).value)); + assertEquals(rowBname, rowResult2.row); + assertEquals(valueCname, rowResult2.columns.get(columnAname).value); + assertEquals(valueDname, rowResult2.columns.get(columnBname).value); // Apply some deletes handler.deleteAll(tableAname, rowAname, columnBname); @@ -198,21 +197,21 @@ public class TestThriftServer extends HBaseClusterTestCase { TRowResult rowResult2 = handler.getRowTs(tableAname, rowAname, time2).get(0); // columnA was completely deleted //assertTrue(Bytes.equals(rowResult1.columns.get(columnAname).value, valueAname)); - assertTrue(Bytes.equals(rowResult1.columns.get(columnBname).value, valueBname)); - assertTrue(Bytes.equals(rowResult2.columns.get(columnBname).value, valueCname)); + assertEquals(rowResult1.columns.get(columnBname).value, valueBname); + assertEquals(rowResult2.columns.get(columnBname).value, valueCname); // ColumnAname has been deleted, and will never be visible even with a getRowTs() assertFalse(rowResult2.columns.containsKey(columnAname)); - List columns = new ArrayList(); + List columns = new ArrayList(); columns.add(columnBname); rowResult1 = handler.getRowWithColumns(tableAname, rowAname, columns).get(0); - assertTrue(Bytes.equals(rowResult1.columns.get(columnBname).value, valueCname)); + assertEquals(rowResult1.columns.get(columnBname).value, valueCname); assertFalse(rowResult1.columns.containsKey(columnAname)); rowResult1 = handler.getRowWithColumnsTs(tableAname, rowAname, columns, time1).get(0); - assertTrue(Bytes.equals(rowResult1.columns.get(columnBname).value, valueBname)); + assertEquals(rowResult1.columns.get(columnBname).value, valueBname); assertFalse(rowResult1.columns.containsKey(columnAname)); // Apply some timestamped deletes @@ -229,7 +228,7 @@ public class TestThriftServer extends HBaseClusterTestCase { assertEquals(1, size); // should be available.... - assertTrue(Bytes.equals(handler.get(tableAname, rowAname, columnBname).get(0).value, valueCname)); + assertEquals(handler.get(tableAname, rowAname, columnBname).get(0).value, valueCname); assertEquals(0, handler.getRow(tableAname, rowBname).size()); @@ -266,27 +265,27 @@ public class TestThriftServer extends HBaseClusterTestCase { // Test a scanner on all rows and all columns, no timestamp int scanner1 = handler.scannerOpen(tableAname, rowAname, getColumnList(true, true)); TRowResult rowResult1a = handler.scannerGet(scanner1).get(0); - assertTrue(Bytes.equals(rowResult1a.row, rowAname)); + assertEquals(rowResult1a.row, rowAname); // This used to be '1'. I don't know why when we are asking for two columns // and when the mutations above would seem to add two columns to the row. // -- St.Ack 05/12/2009 - assertEquals(rowResult1a.columns.size(), 1); - assertTrue(Bytes.equals(rowResult1a.columns.get(columnBname).value, valueCname)); + assertEquals(1, rowResult1a.columns.size()); + assertEquals(rowResult1a.columns.get(columnBname).value, valueCname); TRowResult rowResult1b = handler.scannerGet(scanner1).get(0); - assertTrue(Bytes.equals(rowResult1b.row, rowBname)); - assertEquals(rowResult1b.columns.size(), 2); - assertTrue(Bytes.equals(rowResult1b.columns.get(columnAname).value, valueCname)); - assertTrue(Bytes.equals(rowResult1b.columns.get(columnBname).value, valueDname)); + assertEquals(rowResult1b.row, rowBname); + assertEquals(2, rowResult1b.columns.size()); + assertEquals(rowResult1b.columns.get(columnAname).value, valueCname); + assertEquals(rowResult1b.columns.get(columnBname).value, valueDname); closeScanner(scanner1, handler); // Test a scanner on all rows and all columns, with timestamp int scanner2 = handler.scannerOpenTs(tableAname, rowAname, getColumnList(true, true), time1); TRowResult rowResult2a = handler.scannerGet(scanner2).get(0); - assertEquals(rowResult2a.columns.size(), 1); + assertEquals(1, rowResult2a.columns.size()); // column A deleted, does not exist. //assertTrue(Bytes.equals(rowResult2a.columns.get(columnAname).value, valueAname)); - assertTrue(Bytes.equals(rowResult2a.columns.get(columnBname).value, valueBname)); + assertEquals(rowResult2a.columns.get(columnBname).value, valueBname); closeScanner(scanner2, handler); // Test a scanner on the first row and first column only, no timestamp @@ -299,7 +298,7 @@ public class TestThriftServer extends HBaseClusterTestCase { getColumnList(false, true), time1); TRowResult rowResult4a = handler.scannerGet(scanner4).get(0); assertEquals(rowResult4a.columns.size(), 1); - assertTrue(Bytes.equals(rowResult4a.columns.get(columnBname).value, valueBname)); + assertEquals(rowResult4a.columns.get(columnBname).value, valueBname); // Teardown handler.disableTable(tableAname); @@ -333,8 +332,8 @@ public class TestThriftServer extends HBaseClusterTestCase { * @param includeB whether or not to include columnB * @return a List of column names for use in retrieving a scanner */ - private List getColumnList(boolean includeA, boolean includeB) { - List columnList = new ArrayList(); + private List getColumnList(boolean includeA, boolean includeB) { + List columnList = new ArrayList(); if (includeA) columnList.add(columnAname); if (includeB) columnList.add(columnBname); return columnList;