HBASE-21650 Add DDL operation and some other miscellaneous to thrift2

This commit is contained in:
Allan Yang 2018-12-27 22:25:33 +08:00
parent f5ea00f724
commit 7820ba1dbd
48 changed files with 31511 additions and 261 deletions

View File

@ -38,7 +38,7 @@ import org.slf4j.LoggerFactory;
* An AlreadyExists exceptions signals that a table with the specified
* name already exists
*/
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-25")
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2018-12-27")
public class AlreadyExists extends TException implements org.apache.thrift.TBase<AlreadyExists, AlreadyExists._Fields>, java.io.Serializable, Cloneable, Comparable<AlreadyExists> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("AlreadyExists");

View File

@ -37,7 +37,7 @@ import org.slf4j.LoggerFactory;
/**
* A BatchMutation object is used to apply a number of Mutations to a single row.
*/
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-25")
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2018-12-27")
public class BatchMutation implements org.apache.thrift.TBase<BatchMutation, BatchMutation._Fields>, java.io.Serializable, Cloneable, Comparable<BatchMutation> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("BatchMutation");

View File

@ -39,7 +39,7 @@ import org.slf4j.LoggerFactory;
* such as the number of versions, compression settings, etc. It is
* used as input when creating a table or adding a column.
*/
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-25")
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2018-12-27")
public class ColumnDescriptor implements org.apache.thrift.TBase<ColumnDescriptor, ColumnDescriptor._Fields>, java.io.Serializable, Cloneable, Comparable<ColumnDescriptor> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ColumnDescriptor");

View File

@ -34,7 +34,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-25")
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2018-12-27")
public class Hbase {
public interface Iface {

View File

@ -39,7 +39,7 @@ import org.slf4j.LoggerFactory;
* to the Hbase master or an Hbase region server. Also used to return
* more general Hbase error conditions.
*/
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-25")
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2018-12-27")
public class IOError extends TException implements org.apache.thrift.TBase<IOError, IOError._Fields>, java.io.Serializable, Cloneable, Comparable<IOError> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("IOError");

View File

@ -38,7 +38,7 @@ import org.slf4j.LoggerFactory;
* An IllegalArgument exception indicates an illegal or invalid
* argument was passed into a procedure.
*/
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-25")
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2018-12-27")
public class IllegalArgument extends TException implements org.apache.thrift.TBase<IllegalArgument, IllegalArgument._Fields>, java.io.Serializable, Cloneable, Comparable<IllegalArgument> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("IllegalArgument");

View File

@ -37,7 +37,7 @@ import org.slf4j.LoggerFactory;
/**
* A Mutation object is used to either update or delete a column-value.
*/
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-25")
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2018-12-27")
public class Mutation implements org.apache.thrift.TBase<Mutation, Mutation._Fields>, java.io.Serializable, Cloneable, Comparable<Mutation> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Mutation");

View File

@ -37,7 +37,7 @@ import org.slf4j.LoggerFactory;
/**
* An Append object is used to specify the parameters for performing the append operation.
*/
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-25")
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2018-12-27")
public class TAppend implements org.apache.thrift.TBase<TAppend, TAppend._Fields>, java.io.Serializable, Cloneable, Comparable<TAppend> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TAppend");

View File

@ -40,7 +40,7 @@ import org.slf4j.LoggerFactory;
* 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.
*/
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-25")
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2018-12-27")
public class TCell implements org.apache.thrift.TBase<TCell, TCell._Fields>, java.io.Serializable, Cloneable, Comparable<TCell> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCell");

View File

@ -37,7 +37,7 @@ import org.slf4j.LoggerFactory;
/**
* Holds column name and the cell.
*/
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-25")
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2018-12-27")
public class TColumn implements org.apache.thrift.TBase<TColumn, TColumn._Fields>, java.io.Serializable, Cloneable, Comparable<TColumn> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TColumn");

View File

@ -38,7 +38,7 @@ import org.slf4j.LoggerFactory;
* For increments that are not incrementColumnValue
* equivalents.
*/
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-25")
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2018-12-27")
public class TIncrement implements org.apache.thrift.TBase<TIncrement, TIncrement._Fields>, java.io.Serializable, Cloneable, Comparable<TIncrement> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TIncrement");

View File

@ -37,7 +37,7 @@ import org.slf4j.LoggerFactory;
/**
* A TRegionInfo contains information about an HTable region.
*/
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-25")
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2018-12-27")
public class TRegionInfo implements org.apache.thrift.TBase<TRegionInfo, TRegionInfo._Fields>, java.io.Serializable, Cloneable, Comparable<TRegionInfo> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TRegionInfo");

View File

@ -37,7 +37,7 @@ import org.slf4j.LoggerFactory;
/**
* Holds row name and then a map of columns to cells.
*/
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-25")
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2018-12-27")
public class TRowResult implements org.apache.thrift.TBase<TRowResult, TRowResult._Fields>, java.io.Serializable, Cloneable, Comparable<TRowResult> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TRowResult");

View File

@ -37,7 +37,7 @@ import org.slf4j.LoggerFactory;
/**
* A Scan object is used to specify scanner parameters when opening a scanner.
*/
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-25")
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2018-12-27")
public class TScan implements org.apache.thrift.TBase<TScan, TScan._Fields>, java.io.Serializable, Cloneable, Comparable<TScan> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TScan");

View File

@ -19,18 +19,28 @@
package org.apache.hadoop.hbase.thrift2;
import static org.apache.hadoop.hbase.thrift2.ThriftUtilities.appendFromThrift;
import static org.apache.hadoop.hbase.thrift2.ThriftUtilities.columnFamilyDescriptorFromThrift;
import static org.apache.hadoop.hbase.thrift2.ThriftUtilities.compareOpFromThrift;
import static org.apache.hadoop.hbase.thrift2.ThriftUtilities.deleteFromThrift;
import static org.apache.hadoop.hbase.thrift2.ThriftUtilities.deletesFromThrift;
import static org.apache.hadoop.hbase.thrift2.ThriftUtilities.getFromThrift;
import static org.apache.hadoop.hbase.thrift2.ThriftUtilities.getsFromThrift;
import static org.apache.hadoop.hbase.thrift2.ThriftUtilities.incrementFromThrift;
import static org.apache.hadoop.hbase.thrift2.ThriftUtilities.namespaceDescriptorFromHBase;
import static org.apache.hadoop.hbase.thrift2.ThriftUtilities.namespaceDescriptorFromThrift;
import static org.apache.hadoop.hbase.thrift2.ThriftUtilities.namespaceDescriptorsFromHBase;
import static org.apache.hadoop.hbase.thrift2.ThriftUtilities.putFromThrift;
import static org.apache.hadoop.hbase.thrift2.ThriftUtilities.putsFromThrift;
import static org.apache.hadoop.hbase.thrift2.ThriftUtilities.resultFromHBase;
import static org.apache.hadoop.hbase.thrift2.ThriftUtilities.resultsFromHBase;
import static org.apache.hadoop.hbase.thrift2.ThriftUtilities.rowMutationsFromThrift;
import static org.apache.hadoop.hbase.thrift2.ThriftUtilities.scanFromThrift;
import static org.apache.hadoop.hbase.thrift2.ThriftUtilities.splitKeyFromThrift;
import static org.apache.hadoop.hbase.thrift2.ThriftUtilities.tableDescriptorFromHBase;
import static org.apache.hadoop.hbase.thrift2.ThriftUtilities.tableDescriptorFromThrift;
import static org.apache.hadoop.hbase.thrift2.ThriftUtilities.tableDescriptorsFromHBase;
import static org.apache.hadoop.hbase.thrift2.ThriftUtilities.tableNameFromThrift;
import static org.apache.hadoop.hbase.thrift2.ThriftUtilities.tableNamesFromHBase;
import static org.apache.thrift.TBaseHelper.byteBufferToByteArray;
import java.io.IOException;
@ -45,16 +55,22 @@ import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.regex.Pattern;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.DoNotRetryIOException;
import org.apache.hadoop.hbase.HRegionLocation;
import org.apache.hadoop.hbase.NamespaceDescriptor;
import org.apache.hadoop.hbase.TableName;
import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor;
import org.apache.hadoop.hbase.client.RegionLocator;
import org.apache.hadoop.hbase.client.ResultScanner;
import org.apache.hadoop.hbase.client.Table;
import org.apache.hadoop.hbase.client.TableDescriptor;
import org.apache.hadoop.hbase.security.UserProvider;
import org.apache.hadoop.hbase.thrift.ThriftMetrics;
import org.apache.hadoop.hbase.thrift2.generated.TAppend;
import org.apache.hadoop.hbase.thrift2.generated.TColumnFamilyDescriptor;
import org.apache.hadoop.hbase.thrift2.generated.TCompareOp;
import org.apache.hadoop.hbase.thrift2.generated.TDelete;
import org.apache.hadoop.hbase.thrift2.generated.TGet;
@ -63,10 +79,13 @@ import org.apache.hadoop.hbase.thrift2.generated.THRegionLocation;
import org.apache.hadoop.hbase.thrift2.generated.TIOError;
import org.apache.hadoop.hbase.thrift2.generated.TIllegalArgument;
import org.apache.hadoop.hbase.thrift2.generated.TIncrement;
import org.apache.hadoop.hbase.thrift2.generated.TNamespaceDescriptor;
import org.apache.hadoop.hbase.thrift2.generated.TPut;
import org.apache.hadoop.hbase.thrift2.generated.TResult;
import org.apache.hadoop.hbase.thrift2.generated.TRowMutations;
import org.apache.hadoop.hbase.thrift2.generated.TScan;
import org.apache.hadoop.hbase.thrift2.generated.TTableDescriptor;
import org.apache.hadoop.hbase.thrift2.generated.TTableName;
import org.apache.hadoop.hbase.util.Bytes;
import org.apache.hadoop.hbase.util.ConnectionCache;
import org.apache.thrift.TException;
@ -570,4 +589,275 @@ public class ThriftHBaseServiceHandler implements THBaseService.Iface {
private boolean isReadOnly() {
return isReadOnly;
}
@Override
public TTableDescriptor getTableDescriptor(TTableName table) throws TIOError, TException {
try {
TableName tableName = ThriftUtilities.tableNameFromThrift(table);
TableDescriptor tableDescriptor = connectionCache.getAdmin().getDescriptor(tableName);
return tableDescriptorFromHBase(tableDescriptor);
} catch (IOException e) {
throw getTIOError(e);
}
}
@Override
public List<TTableDescriptor> getTableDescriptors(List<TTableName> tables)
throws TIOError, TException {
try {
List<TableName> tableNames = ThriftUtilities.tableNamesFromThrift(tables);
List<TableDescriptor> tableDescriptors = connectionCache.getAdmin()
.listTableDescriptors(tableNames);
return tableDescriptorsFromHBase(tableDescriptors);
} catch (IOException e) {
throw getTIOError(e);
}
}
@Override
public boolean tableExists(TTableName tTableName) throws TIOError, TException {
try {
TableName tableName = tableNameFromThrift(tTableName);
return connectionCache.getAdmin().tableExists(tableName);
} catch (IOException e) {
throw getTIOError(e);
}
}
@Override
public List<TTableDescriptor> getTableDescriptorsByPattern(String regex, boolean includeSysTables)
throws TIOError, TException {
try {
Pattern pattern = Pattern.compile(regex);
List<TableDescriptor> tableDescriptors = connectionCache.getAdmin()
.listTableDescriptors(pattern, includeSysTables);
return tableDescriptorsFromHBase(tableDescriptors);
} catch (IOException e) {
throw getTIOError(e);
}
}
@Override
public List<TTableDescriptor> getTableDescriptorsByNamespace(String name)
throws TIOError, TException {
try {
List<TableDescriptor> descriptors = connectionCache.getAdmin()
.listTableDescriptorsByNamespace(Bytes.toBytes(name));
return tableDescriptorsFromHBase(descriptors);
} catch (IOException e) {
throw getTIOError(e);
}
}
@Override
public List<TTableName> getTableNamesByPattern(String regex, boolean includeSysTables)
throws TIOError, TException {
try {
Pattern pattern = Pattern.compile(regex);
TableName[] tableNames = connectionCache.getAdmin()
.listTableNames(pattern, includeSysTables);
return tableNamesFromHBase(tableNames);
} catch (IOException e) {
throw getTIOError(e);
}
}
@Override
public List<TTableName> getTableNamesByNamespace(String name) throws TIOError, TException {
try {
TableName[] tableNames = connectionCache.getAdmin().listTableNamesByNamespace(name);
return tableNamesFromHBase(tableNames);
} catch (IOException e) {
throw getTIOError(e);
}
}
@Override
public void createTable(TTableDescriptor desc, List<ByteBuffer> splitKeys)
throws TIOError, TException {
try {
TableDescriptor descriptor = tableDescriptorFromThrift(desc);
byte[][] split = splitKeyFromThrift(splitKeys);
connectionCache.getAdmin().createTable(descriptor, split);
} catch (IOException e) {
throw getTIOError(e);
}
}
@Override
public void deleteTable(TTableName tableName) throws TIOError, TException {
try {
TableName table = tableNameFromThrift(tableName);
connectionCache.getAdmin().deleteTable(table);
} catch (IOException e) {
throw getTIOError(e);
}
}
@Override
public void truncateTable(TTableName tableName, boolean preserveSplits)
throws TIOError, TException {
try {
TableName table = tableNameFromThrift(tableName);
connectionCache.getAdmin().truncateTable(table, preserveSplits);
} catch (IOException e) {
throw getTIOError(e);
}
}
@Override
public void enableTable(TTableName tableName) throws TIOError, TException {
try {
TableName table = tableNameFromThrift(tableName);
connectionCache.getAdmin().enableTable(table);
} catch (IOException e) {
throw getTIOError(e);
}
}
@Override
public void disableTable(TTableName tableName) throws TIOError, TException {
try {
TableName table = tableNameFromThrift(tableName);
connectionCache.getAdmin().disableTable(table);
} catch (IOException e) {
throw getTIOError(e);
}
}
@Override
public boolean isTableEnabled(TTableName tableName) throws TIOError, TException {
try {
TableName table = tableNameFromThrift(tableName);
return connectionCache.getAdmin().isTableEnabled(table);
} catch (IOException e) {
throw getTIOError(e);
}
}
@Override
public boolean isTableDisabled(TTableName tableName) throws TIOError, TException {
try {
TableName table = tableNameFromThrift(tableName);
return connectionCache.getAdmin().isTableDisabled(table);
} catch (IOException e) {
throw getTIOError(e);
}
}
@Override
public boolean isTableAvailable(TTableName tableName) throws TIOError, TException {
try {
TableName table = tableNameFromThrift(tableName);
return connectionCache.getAdmin().isTableAvailable(table);
} catch (IOException e) {
throw getTIOError(e);
}
}
@Override
public boolean isTableAvailableWithSplit(TTableName tableName, List<ByteBuffer> splitKeys)
throws TIOError, TException {
try {
TableName table = tableNameFromThrift(tableName);
byte[][] split = splitKeyFromThrift(splitKeys);
return connectionCache.getAdmin().isTableAvailable(table, split);
} catch (IOException e) {
throw getTIOError(e);
}
}
@Override
public void addColumnFamily(TTableName tableName, TColumnFamilyDescriptor column)
throws TIOError, TException {
try {
TableName table = tableNameFromThrift(tableName);
ColumnFamilyDescriptor columnFamilyDescriptor = columnFamilyDescriptorFromThrift(column);
connectionCache.getAdmin().addColumnFamily(table, columnFamilyDescriptor);
} catch (IOException e) {
throw getTIOError(e);
}
}
@Override
public void deleteColumnFamily(TTableName tableName, ByteBuffer column)
throws TIOError, TException {
try {
TableName table = tableNameFromThrift(tableName);
connectionCache.getAdmin().deleteColumnFamily(table, column.array());
} catch (IOException e) {
throw getTIOError(e);
}
}
@Override
public void modifyColumnFamily(TTableName tableName, TColumnFamilyDescriptor column)
throws TIOError, TException {
try {
TableName table = tableNameFromThrift(tableName);
ColumnFamilyDescriptor columnFamilyDescriptor = columnFamilyDescriptorFromThrift(column);
connectionCache.getAdmin().modifyColumnFamily(table, columnFamilyDescriptor);
} catch (IOException e) {
throw getTIOError(e);
}
}
@Override
public void modifyTable(TTableDescriptor desc) throws TIOError, TException {
try {
TableDescriptor descriptor = tableDescriptorFromThrift(desc);
connectionCache.getAdmin().modifyTable(descriptor);
} catch (IOException e) {
throw getTIOError(e);
}
}
@Override
public void createNamespace(TNamespaceDescriptor namespaceDesc) throws TIOError, TException {
try {
NamespaceDescriptor descriptor = namespaceDescriptorFromThrift(namespaceDesc);
connectionCache.getAdmin().createNamespace(descriptor);
} catch (IOException e) {
throw getTIOError(e);
}
}
@Override
public void modifyNamespace(TNamespaceDescriptor namespaceDesc) throws TIOError, TException {
try {
NamespaceDescriptor descriptor = namespaceDescriptorFromThrift(namespaceDesc);
connectionCache.getAdmin().modifyNamespace(descriptor);
} catch (IOException e) {
throw getTIOError(e);
}
}
@Override
public void deleteNamespace(String name) throws TIOError, TException {
try {
connectionCache.getAdmin().deleteNamespace(name);
} catch (IOException e) {
throw getTIOError(e);
}
}
@Override
public TNamespaceDescriptor getNamespaceDescriptor(String name) throws TIOError, TException {
try {
NamespaceDescriptor descriptor = connectionCache.getAdmin().getNamespaceDescriptor(name);
return namespaceDescriptorFromHBase(descriptor);
} catch (IOException e) {
throw getTIOError(e);
}
}
@Override
public List<TNamespaceDescriptor> listNamespaceDescriptors() throws TIOError, TException {
try {
NamespaceDescriptor[] descriptors = connectionCache.getAdmin().listNamespaceDescriptors();
return namespaceDescriptorsFromHBase(descriptors);
} catch (IOException e) {
throw getTIOError(e);
}
}
}

View File

@ -34,9 +34,14 @@ import org.apache.hadoop.hbase.CompareOperator;
import org.apache.hadoop.hbase.HConstants;
import org.apache.hadoop.hbase.HRegionInfo;
import org.apache.hadoop.hbase.HRegionLocation;
import org.apache.hadoop.hbase.KeepDeletedCells;
import org.apache.hadoop.hbase.NamespaceDescriptor;
import org.apache.hadoop.hbase.PrivateCellUtil;
import org.apache.hadoop.hbase.ServerName;
import org.apache.hadoop.hbase.TableName;
import org.apache.hadoop.hbase.client.Append;
import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor;
import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder;
import org.apache.hadoop.hbase.client.Consistency;
import org.apache.hadoop.hbase.client.Delete;
import org.apache.hadoop.hbase.client.Durability;
@ -48,28 +53,42 @@ import org.apache.hadoop.hbase.client.Result;
import org.apache.hadoop.hbase.client.RowMutations;
import org.apache.hadoop.hbase.client.Scan;
import org.apache.hadoop.hbase.client.Scan.ReadType;
import org.apache.hadoop.hbase.client.TableDescriptor;
import org.apache.hadoop.hbase.client.TableDescriptorBuilder;
import org.apache.hadoop.hbase.filter.ParseFilter;
import org.apache.hadoop.hbase.io.compress.Compression;
import org.apache.hadoop.hbase.io.encoding.DataBlockEncoding;
import org.apache.hadoop.hbase.regionserver.BloomType;
import org.apache.hadoop.hbase.security.visibility.Authorizations;
import org.apache.hadoop.hbase.security.visibility.CellVisibility;
import org.apache.hadoop.hbase.thrift2.generated.TAppend;
import org.apache.hadoop.hbase.thrift2.generated.TBloomFilterType;
import org.apache.hadoop.hbase.thrift2.generated.TColumn;
import org.apache.hadoop.hbase.thrift2.generated.TColumnFamilyDescriptor;
import org.apache.hadoop.hbase.thrift2.generated.TColumnIncrement;
import org.apache.hadoop.hbase.thrift2.generated.TColumnValue;
import org.apache.hadoop.hbase.thrift2.generated.TCompareOp;
import org.apache.hadoop.hbase.thrift2.generated.TCompressionAlgorithm;
import org.apache.hadoop.hbase.thrift2.generated.TConsistency;
import org.apache.hadoop.hbase.thrift2.generated.TDataBlockEncoding;
import org.apache.hadoop.hbase.thrift2.generated.TDelete;
import org.apache.hadoop.hbase.thrift2.generated.TDeleteType;
import org.apache.hadoop.hbase.thrift2.generated.TDurability;
import org.apache.hadoop.hbase.thrift2.generated.TGet;
import org.apache.hadoop.hbase.thrift2.generated.THRegionInfo;
import org.apache.hadoop.hbase.thrift2.generated.THRegionLocation;
import org.apache.hadoop.hbase.thrift2.generated.TIncrement;
import org.apache.hadoop.hbase.thrift2.generated.TKeepDeletedCells;
import org.apache.hadoop.hbase.thrift2.generated.TMutation;
import org.apache.hadoop.hbase.thrift2.generated.TNamespaceDescriptor;
import org.apache.hadoop.hbase.thrift2.generated.TPut;
import org.apache.hadoop.hbase.thrift2.generated.TReadType;
import org.apache.hadoop.hbase.thrift2.generated.TResult;
import org.apache.hadoop.hbase.thrift2.generated.TRowMutations;
import org.apache.hadoop.hbase.thrift2.generated.TScan;
import org.apache.hadoop.hbase.thrift2.generated.TServerName;
import org.apache.hadoop.hbase.thrift2.generated.TTableDescriptor;
import org.apache.hadoop.hbase.thrift2.generated.TTableName;
import org.apache.hadoop.hbase.thrift2.generated.TTimeRange;
import org.apache.hadoop.hbase.util.Bytes;
import org.apache.yetus.audience.InterfaceAudience;
@ -79,6 +98,12 @@ import org.apache.hbase.thirdparty.org.apache.commons.collections4.MapUtils;
@InterfaceAudience.Private
public final class ThriftUtilities {
private final static Cell[] EMPTY_CELL_ARRAY = new Cell[]{};
private final static Result EMPTY_RESULT = Result.create(EMPTY_CELL_ARRAY);
private final static Result EMPTY_RESULT_STALE = Result.create(EMPTY_CELL_ARRAY, null, true);
private ThriftUtilities() {
throw new UnsupportedOperationException("Can't initialize class");
}
@ -129,6 +154,20 @@ public final class ThriftUtilities {
out.setReplicaId(in.getTargetReplicaId());
}
if (in.isSetCacheBlocks()) {
out.setCacheBlocks(in.isCacheBlocks());
}
if (in.isSetStoreLimit()) {
out.setMaxResultsPerColumnFamily(in.getStoreLimit());
}
if (in.isSetStoreOffset()) {
out.setRowOffsetPerColumnFamily(in.getStoreOffset());
}
if (in.isSetExistence_only()) {
out.setCheckExistenceOnly(in.isExistence_only());
}
if (!in.isSetColumns()) {
return out;
}
@ -183,6 +222,7 @@ public final class ThriftUtilities {
col.setQualifier(CellUtil.cloneQualifier(kv));
col.setTimestamp(kv.getTimestamp());
col.setValue(CellUtil.cloneValue(kv));
col.setType(kv.getType().getCode());
if (kv.getTagsLength() > 0) {
col.setTags(PrivateCellUtil.cloneTags(kv));
}
@ -191,6 +231,8 @@ public final class ThriftUtilities {
out.setColumnValues(columnValues);
out.setStale(in.isStale());
out.setPartial(in.mayHaveMoreCellsInRow());
return out;
}
@ -373,6 +415,15 @@ public final class ThriftUtilities {
return out;
}
public static TDeleteType deleteTypeFromHBase(Cell.Type type) {
switch (type) {
case Delete: return TDeleteType.DELETE_COLUMN;
case DeleteColumn: return TDeleteType.DELETE_COLUMNS;
case DeleteFamily: return TDeleteType.DELETE_FAMILY;
case DeleteFamilyVersion: return TDeleteType.DELETE_FAMILY_VERSION;
default: throw new IllegalArgumentException("Unknow delete type " + type);
} }
public static TDelete deleteFromHBase(Delete in) {
TDelete out = new TDelete(ByteBuffer.wrap(in.getRow()));
@ -382,17 +433,33 @@ public final class ThriftUtilities {
out.setTimestamp(rowTimestamp);
}
// Map<family, List<KeyValue>>
for (Map.Entry<byte[], List<org.apache.hadoop.hbase.Cell>> familyEntry:
for (Map.Entry<String, byte[]> attribute : in.getAttributesMap().entrySet()) {
out.putToAttributes(ByteBuffer.wrap(Bytes.toBytes(attribute.getKey())),
ByteBuffer.wrap(attribute.getValue()));
}
if (in.getDurability() != Durability.USE_DEFAULT) {
out.setDurability(durabilityFromHBase(in.getDurability()));
}
// Delete the whole row
if (in.getFamilyCellMap().size() == 0) {
return out;
}
TDeleteType type = null;
for (Map.Entry<byte[], List<Cell>> familyEntry:
in.getFamilyCellMap().entrySet()) {
byte[] family = familyEntry.getKey();
TColumn column = new TColumn(ByteBuffer.wrap(familyEntry.getKey()));
for (org.apache.hadoop.hbase.Cell cell: familyEntry.getValue()) {
byte[] family = CellUtil.cloneFamily(cell);
for (Cell cell: familyEntry.getValue()) {
TDeleteType cellDeleteType = deleteTypeFromHBase(cell.getType());
if (type == null) {
type = cellDeleteType;
} else if (type != cellDeleteType){
throw new RuntimeException("Only the same delete type is supported, but two delete type "
+ "is founded, one is " + type + " the other one is " + cellDeleteType);
}
byte[] qualifier = CellUtil.cloneQualifier(cell);
long timestamp = cell.getTimestamp();
if (family != null) {
column.setFamily(family);
}
column.setFamily(family);
if (qualifier != null) {
column.setQualifier(qualifier);
}
@ -403,6 +470,7 @@ public final class ThriftUtilities {
columns.add(column);
}
out.setColumns(columns);
out.setDeleteType(type);
return out;
}
@ -532,6 +600,10 @@ public final class ThriftUtilities {
out.setCellVisibility(new CellVisibility(in.getCellVisibility().getExpression()));
}
if (in.isSetReturnResults()) {
out.setReturnResults(in.isReturnResults());
}
return out;
}
@ -553,6 +625,10 @@ public final class ThriftUtilities {
out.setCellVisibility(new CellVisibility(append.getCellVisibility().getExpression()));
}
if (append.isSetReturnResults()) {
out.setReturnResults(append.isReturnResults());
}
return out;
}
@ -606,11 +682,12 @@ public final class ThriftUtilities {
private static Durability durabilityFromThrift(TDurability tDurability) {
switch (tDurability.getValue()) {
case 0: return Durability.USE_DEFAULT;
case 1: return Durability.SKIP_WAL;
case 2: return Durability.ASYNC_WAL;
case 3: return Durability.SYNC_WAL;
case 4: return Durability.FSYNC_WAL;
default: return null;
default: return Durability.USE_DEFAULT;
}
}
@ -643,4 +720,322 @@ public final class ThriftUtilities {
default: return Consistency.STRONG;
}
}
public static TableName tableNameFromThrift(TTableName tableName) {
return TableName.valueOf(tableName.getNs(), tableName.getQualifier());
}
public static List<TableName> tableNamesFromThrift(List<TTableName> tableNames) {
List<TableName> out = new ArrayList<>(tableNames.size());
for (TTableName tableName : tableNames) {
out.add(tableNameFromThrift(tableName));
}
return out;
}
public static TTableName tableNameFromHBase(TableName table) {
TTableName tableName = new TTableName();
tableName.setNs(table.getNamespace());
tableName.setQualifier(table.getQualifier());
return tableName;
}
public static List<TTableName> tableNamesFromHBase(TableName[] in) {
List<TTableName> out = new ArrayList<>(in.length);
for (TableName tableName : in) {
out.add(tableNameFromHBase(tableName));
}
return out;
}
public static byte[][] splitKeyFromThrift(List<ByteBuffer> in) {
if (in == null || in.size() == 0) {
return null;
}
byte[][] out = new byte[in.size()][];
int index = 0;
for (ByteBuffer key : in) {
out[index++] = key.array();
}
return out;
}
public static BloomType bloomFilterFromThrift(TBloomFilterType in) {
switch (in.getValue()) {
case 0: return BloomType.NONE;
case 1: return BloomType.ROW;
case 2: return BloomType.ROWCOL;
case 3: return BloomType.ROWPREFIX_FIXED_LENGTH;
case 4: return BloomType.ROWPREFIX_DELIMITED;
default: return BloomType.ROW;
}
}
public static Compression.Algorithm compressionAlgorithmFromThrift(TCompressionAlgorithm in) {
switch (in.getValue()) {
case 0: return Compression.Algorithm.LZO;
case 1: return Compression.Algorithm.GZ;
case 2: return Compression.Algorithm.NONE;
case 3: return Compression.Algorithm.SNAPPY;
case 4: return Compression.Algorithm.LZ4;
case 5: return Compression.Algorithm.BZIP2;
case 6: return Compression.Algorithm.ZSTD;
default: return Compression.Algorithm.NONE;
}
}
public static DataBlockEncoding dataBlockEncodingFromThrift(TDataBlockEncoding in) {
switch (in.getValue()) {
case 0: return DataBlockEncoding.NONE;
case 2: return DataBlockEncoding.PREFIX;
case 3: return DataBlockEncoding.DIFF;
case 4: return DataBlockEncoding.FAST_DIFF;
case 7: return DataBlockEncoding.ROW_INDEX_V1;
default: return DataBlockEncoding.NONE;
}
}
public static KeepDeletedCells keepDeletedCellsFromThrift(TKeepDeletedCells in) {
switch (in.getValue()) {
case 0: return KeepDeletedCells.FALSE;
case 1: return KeepDeletedCells.TRUE;
case 2: return KeepDeletedCells.TTL;
default: return KeepDeletedCells.FALSE;
}
}
public static ColumnFamilyDescriptor columnFamilyDescriptorFromThrift(
TColumnFamilyDescriptor in) {
ColumnFamilyDescriptorBuilder builder = ColumnFamilyDescriptorBuilder
.newBuilder(in.getName());
if (in.isSetAttributes()) {
for (Map.Entry<ByteBuffer, ByteBuffer> attribute : in.getAttributes().entrySet()) {
builder.setValue(attribute.getKey().array(), attribute.getValue().array());
}
}
if (in.isSetConfiguration()) {
for (Map.Entry<String, String> conf : in.getConfiguration().entrySet()) {
builder.setConfiguration(conf.getKey(), conf.getValue());
}
}
if (in.isSetBlockSize()) {
builder.setBlocksize(in.getBlockSize());
}
if (in.isSetBloomnFilterType()) {
builder.setBloomFilterType(bloomFilterFromThrift(in.getBloomnFilterType()));
}
if (in.isSetCompressionType()) {
builder.setCompressionType(compressionAlgorithmFromThrift(in.getCompressionType()));
}
if (in.isSetDfsReplication()) {
builder.setDFSReplication(in.getDfsReplication());
}
if (in.isSetDataBlockEncoding()) {
builder.setDataBlockEncoding(dataBlockEncodingFromThrift(in.getDataBlockEncoding()));
}
if (in.isSetKeepDeletedCells()) {
builder.setKeepDeletedCells(keepDeletedCellsFromThrift(in.getKeepDeletedCells()));
}
if (in.isSetMaxVersions()) {
builder.setMaxVersions(in.getMaxVersions());
}
if (in.isSetMinVersions()) {
builder.setMinVersions(in.getMinVersions());
}
if (in.isSetScope()) {
builder.setScope(in.getScope());
}
if (in.isSetTimeToLive()) {
builder.setTimeToLive(in.getTimeToLive());
}
if (in.isSetBlockCacheEnabled()) {
builder.setBlockCacheEnabled(in.isBlockCacheEnabled());
}
if (in.isSetCacheBloomsOnWrite()) {
builder.setCacheBloomsOnWrite(in.isCacheBloomsOnWrite());
}
if (in.isSetCacheDataOnWrite()) {
builder.setCacheDataOnWrite(in.isCacheDataOnWrite());
}
if (in.isSetCacheIndexesOnWrite()) {
builder.setCacheIndexesOnWrite(in.isCacheIndexesOnWrite());
}
if (in.isSetCompressTags()) {
builder.setCompressTags(in.isCompressTags());
}
if (in.isSetEvictBlocksOnClose()) {
builder.setEvictBlocksOnClose(in.isEvictBlocksOnClose());
}
if (in.isSetInMemory()) {
builder.setInMemory(in.isInMemory());
}
return builder.build();
}
public static NamespaceDescriptor namespaceDescriptorFromThrift(TNamespaceDescriptor in) {
NamespaceDescriptor.Builder builder = NamespaceDescriptor.create(in.getName());
if (in.isSetConfiguration()) {
for (Map.Entry<String, String> conf : in.getConfiguration().entrySet()) {
builder.addConfiguration(conf.getKey(), conf.getValue());
}
}
return builder.build();
}
public static TNamespaceDescriptor namespaceDescriptorFromHBase(NamespaceDescriptor in) {
TNamespaceDescriptor out = new TNamespaceDescriptor();
out.setName(in.getName());
for (Map.Entry<String, String> conf : in.getConfiguration().entrySet()) {
out.putToConfiguration(conf.getKey(), conf.getValue());
}
return out;
}
public static List<TNamespaceDescriptor> namespaceDescriptorsFromHBase(
NamespaceDescriptor[] in) {
List<TNamespaceDescriptor> out = new ArrayList<>(in.length);
for (NamespaceDescriptor descriptor : in) {
out.add(namespaceDescriptorFromHBase(descriptor));
}
return out;
}
public static TableDescriptor tableDescriptorFromThrift(TTableDescriptor in) {
TableDescriptorBuilder builder = TableDescriptorBuilder
.newBuilder(tableNameFromThrift(in.getTableName()));
for (TColumnFamilyDescriptor column : in.getColumns()) {
builder.setColumnFamily(columnFamilyDescriptorFromThrift(column));
}
if (in.isSetAttributes()) {
for (Map.Entry<ByteBuffer, ByteBuffer> attribute : in.getAttributes().entrySet()) {
builder.setValue(attribute.getKey().array(), attribute.getValue().array());
}
}
if (in.isSetDurability()) {
builder.setDurability(durabilityFromThrift(in.getDurability()));
}
return builder.build();
}
private static TDurability durabilityFromHBase(Durability durability) {
switch (durability) {
case USE_DEFAULT: return TDurability.USE_DEFAULT;
case SKIP_WAL: return TDurability.SKIP_WAL;
case ASYNC_WAL: return TDurability.ASYNC_WAL;
case SYNC_WAL: return TDurability.SYNC_WAL;
case FSYNC_WAL: return TDurability.FSYNC_WAL;
default: return null;
}
}
public static TTableDescriptor tableDescriptorFromHBase(TableDescriptor in) {
TTableDescriptor out = new TTableDescriptor();
out.setTableName(tableNameFromHBase(in.getTableName()));
Map<Bytes, Bytes> attributes = in.getValues();
for (Map.Entry<Bytes, Bytes> attribute : attributes.entrySet()) {
out.putToAttributes(ByteBuffer.wrap(attribute.getKey().get()),
ByteBuffer.wrap(attribute.getValue().get()));
}
for (ColumnFamilyDescriptor column : in.getColumnFamilies()) {
out.addToColumns(columnFamilyDescriptorFromHBase(column));
}
out.setDurability(durabilityFromHBase(in.getDurability()));
return out;
}
public static List<TTableDescriptor> tableDescriptorsFromHBase(List<TableDescriptor> in) {
List<TTableDescriptor> out = new ArrayList<>(in.size());
for (TableDescriptor descriptor : in) {
out.add(tableDescriptorFromHBase(descriptor));
}
return out;
}
public static List<TTableDescriptor> tableDescriptorsFromHBase(TableDescriptor[] in) {
List<TTableDescriptor> out = new ArrayList<>(in.length);
for (TableDescriptor descriptor : in) {
out.add(tableDescriptorFromHBase(descriptor));
}
return out;
}
public static TBloomFilterType bloomFilterFromHBase(BloomType in) {
switch (in) {
case NONE: return TBloomFilterType.NONE;
case ROW: return TBloomFilterType.ROW;
case ROWCOL: return TBloomFilterType.ROWCOL;
case ROWPREFIX_FIXED_LENGTH: return TBloomFilterType.ROWPREFIX_FIXED_LENGTH;
case ROWPREFIX_DELIMITED: return TBloomFilterType.ROWPREFIX_DELIMITED;
default: return TBloomFilterType.ROW;
}
}
public static TCompressionAlgorithm compressionAlgorithmFromHBase(Compression.Algorithm in) {
switch (in) {
case LZO: return TCompressionAlgorithm.LZO;
case GZ: return TCompressionAlgorithm.GZ;
case NONE: return TCompressionAlgorithm.NONE;
case SNAPPY: return TCompressionAlgorithm.SNAPPY;
case LZ4: return TCompressionAlgorithm.LZ4;
case BZIP2: return TCompressionAlgorithm.BZIP2;
case ZSTD: return TCompressionAlgorithm.ZSTD;
default: return TCompressionAlgorithm.NONE;
}
}
public static TDataBlockEncoding dataBlockEncodingFromHBase(DataBlockEncoding in) {
switch (in) {
case NONE: return TDataBlockEncoding.NONE;
case PREFIX: return TDataBlockEncoding.PREFIX;
case DIFF: return TDataBlockEncoding.DIFF;
case FAST_DIFF: return TDataBlockEncoding.FAST_DIFF;
case ROW_INDEX_V1: return TDataBlockEncoding.ROW_INDEX_V1;
default: return TDataBlockEncoding.NONE;
}
}
public static TKeepDeletedCells keepDeletedCellsFromHBase(KeepDeletedCells in) {
switch (in) {
case FALSE: return TKeepDeletedCells.FALSE;
case TRUE: return TKeepDeletedCells.TRUE;
case TTL: return TKeepDeletedCells.TTL;
default: return TKeepDeletedCells.FALSE;
}
}
public static TColumnFamilyDescriptor columnFamilyDescriptorFromHBase(
ColumnFamilyDescriptor in) {
TColumnFamilyDescriptor out = new TColumnFamilyDescriptor();
out.setName(in.getName());
for (Map.Entry<Bytes, Bytes> attribute : in.getValues().entrySet()) {
out.putToAttributes(ByteBuffer.wrap(attribute.getKey().get()),
ByteBuffer.wrap(attribute.getValue().get()));
}
for (Map.Entry<String, String> conf : in.getConfiguration().entrySet()) {
out.putToConfiguration(conf.getKey(), conf.getValue());
}
out.setBlockSize(in.getBlocksize());
out.setBloomnFilterType(bloomFilterFromHBase(in.getBloomFilterType()));
out.setCompressionType(compressionAlgorithmFromHBase(in.getCompressionType()));
out.setDfsReplication(in.getDFSReplication());
out.setDataBlockEncoding(dataBlockEncodingFromHBase(in.getDataBlockEncoding()));
out.setKeepDeletedCells(keepDeletedCellsFromHBase(in.getKeepDeletedCells()));
out.setMaxVersions(in.getMaxVersions());
out.setMinVersions(in.getMinVersions());
out.setScope(in.getScope());
out.setTimeToLive(in.getTimeToLive());
out.setBlockCacheEnabled(in.isBlockCacheEnabled());
out.setCacheBloomsOnWrite(in.isCacheBloomsOnWrite());
out.setCacheDataOnWrite(in.isCacheDataOnWrite());
out.setCacheIndexesOnWrite(in.isCacheIndexesOnWrite());
out.setCompressTags(in.isCompressTags());
out.setEvictBlocksOnClose(in.isEvictBlocksOnClose());
out.setInMemory(in.isInMemory());
return out;
}
}

View File

@ -0,0 +1,554 @@
/**
* Autogenerated by Thrift Compiler (0.9.3)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package org.apache.hadoop.hbase.thrift2.generated;
import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;
import org.apache.thrift.scheme.TupleScheme;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.EncodingUtils;
import org.apache.thrift.TException;
import org.apache.thrift.async.AsyncMethodCallback;
import org.apache.thrift.server.AbstractNonblockingServer.*;
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 javax.annotation.Generated;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2018-12-26")
public class NamespaceDescriptor implements org.apache.thrift.TBase<NamespaceDescriptor, NamespaceDescriptor._Fields>, java.io.Serializable, Cloneable, Comparable<NamespaceDescriptor> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("NamespaceDescriptor");
private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.protocol.TField CONFIGURATION_FIELD_DESC = new org.apache.thrift.protocol.TField("configuration", org.apache.thrift.protocol.TType.MAP, (short)2);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new NamespaceDescriptorStandardSchemeFactory());
schemes.put(TupleScheme.class, new NamespaceDescriptorTupleSchemeFactory());
}
public String name; // required
public Map<String,String> configuration; // optional
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
NAME((short)1, "name"),
CONFIGURATION((short)2, "configuration");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // NAME
return NAME;
case 2: // CONFIGURATION
return CONFIGURATION;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
_Fields(short thriftId, String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final _Fields optionals[] = {_Fields.CONFIGURATION};
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.CONFIGURATION, new org.apache.thrift.meta_data.FieldMetaData("configuration", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING),
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(NamespaceDescriptor.class, metaDataMap);
}
public NamespaceDescriptor() {
}
public NamespaceDescriptor(
String name)
{
this();
this.name = name;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public NamespaceDescriptor(NamespaceDescriptor other) {
if (other.isSetName()) {
this.name = other.name;
}
if (other.isSetConfiguration()) {
Map<String,String> __this__configuration = new HashMap<String,String>(other.configuration);
this.configuration = __this__configuration;
}
}
public NamespaceDescriptor deepCopy() {
return new NamespaceDescriptor(this);
}
@Override
public void clear() {
this.name = null;
this.configuration = null;
}
public String getName() {
return this.name;
}
public NamespaceDescriptor setName(String name) {
this.name = name;
return this;
}
public void unsetName() {
this.name = null;
}
/** Returns true if field name is set (has been assigned a value) and false otherwise */
public boolean isSetName() {
return this.name != null;
}
public void setNameIsSet(boolean value) {
if (!value) {
this.name = null;
}
}
public int getConfigurationSize() {
return (this.configuration == null) ? 0 : this.configuration.size();
}
public void putToConfiguration(String key, String val) {
if (this.configuration == null) {
this.configuration = new HashMap<String,String>();
}
this.configuration.put(key, val);
}
public Map<String,String> getConfiguration() {
return this.configuration;
}
public NamespaceDescriptor setConfiguration(Map<String,String> configuration) {
this.configuration = configuration;
return this;
}
public void unsetConfiguration() {
this.configuration = null;
}
/** Returns true if field configuration is set (has been assigned a value) and false otherwise */
public boolean isSetConfiguration() {
return this.configuration != null;
}
public void setConfigurationIsSet(boolean value) {
if (!value) {
this.configuration = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case NAME:
if (value == null) {
unsetName();
} else {
setName((String)value);
}
break;
case CONFIGURATION:
if (value == null) {
unsetConfiguration();
} else {
setConfiguration((Map<String,String>)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case NAME:
return getName();
case CONFIGURATION:
return getConfiguration();
}
throw new IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case NAME:
return isSetName();
case CONFIGURATION:
return isSetConfiguration();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof NamespaceDescriptor)
return this.equals((NamespaceDescriptor)that);
return false;
}
public boolean equals(NamespaceDescriptor that) {
if (that == null)
return false;
boolean this_present_name = true && this.isSetName();
boolean that_present_name = true && that.isSetName();
if (this_present_name || that_present_name) {
if (!(this_present_name && that_present_name))
return false;
if (!this.name.equals(that.name))
return false;
}
boolean this_present_configuration = true && this.isSetConfiguration();
boolean that_present_configuration = true && that.isSetConfiguration();
if (this_present_configuration || that_present_configuration) {
if (!(this_present_configuration && that_present_configuration))
return false;
if (!this.configuration.equals(that.configuration))
return false;
}
return true;
}
@Override
public int hashCode() {
List<Object> list = new ArrayList<Object>();
boolean present_name = true && (isSetName());
list.add(present_name);
if (present_name)
list.add(name);
boolean present_configuration = true && (isSetConfiguration());
list.add(present_configuration);
if (present_configuration)
list.add(configuration);
return list.hashCode();
}
@Override
public int compareTo(NamespaceDescriptor other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetName()).compareTo(other.isSetName());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetName()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, other.name);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetConfiguration()).compareTo(other.isSetConfiguration());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetConfiguration()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.configuration, other.configuration);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("NamespaceDescriptor(");
boolean first = true;
sb.append("name:");
if (this.name == null) {
sb.append("null");
} else {
sb.append(this.name);
}
first = false;
if (isSetConfiguration()) {
if (!first) sb.append(", ");
sb.append("configuration:");
if (this.configuration == null) {
sb.append("null");
} else {
sb.append(this.configuration);
}
first = false;
}
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
if (name == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'name' was not present! Struct: " + toString());
}
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class NamespaceDescriptorStandardSchemeFactory implements SchemeFactory {
public NamespaceDescriptorStandardScheme getScheme() {
return new NamespaceDescriptorStandardScheme();
}
}
private static class NamespaceDescriptorStandardScheme extends StandardScheme<NamespaceDescriptor> {
public void read(org.apache.thrift.protocol.TProtocol iprot, NamespaceDescriptor struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // NAME
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.name = iprot.readString();
struct.setNameIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // CONFIGURATION
if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
{
org.apache.thrift.protocol.TMap _map180 = iprot.readMapBegin();
struct.configuration = new HashMap<String,String>(2*_map180.size);
String _key181;
String _val182;
for (int _i183 = 0; _i183 < _map180.size; ++_i183)
{
_key181 = iprot.readString();
_val182 = iprot.readString();
struct.configuration.put(_key181, _val182);
}
iprot.readMapEnd();
}
struct.setConfigurationIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, NamespaceDescriptor struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.name != null) {
oprot.writeFieldBegin(NAME_FIELD_DESC);
oprot.writeString(struct.name);
oprot.writeFieldEnd();
}
if (struct.configuration != null) {
if (struct.isSetConfiguration()) {
oprot.writeFieldBegin(CONFIGURATION_FIELD_DESC);
{
oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.configuration.size()));
for (Map.Entry<String, String> _iter184 : struct.configuration.entrySet())
{
oprot.writeString(_iter184.getKey());
oprot.writeString(_iter184.getValue());
}
oprot.writeMapEnd();
}
oprot.writeFieldEnd();
}
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class NamespaceDescriptorTupleSchemeFactory implements SchemeFactory {
public NamespaceDescriptorTupleScheme getScheme() {
return new NamespaceDescriptorTupleScheme();
}
}
private static class NamespaceDescriptorTupleScheme extends TupleScheme<NamespaceDescriptor> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, NamespaceDescriptor struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
oprot.writeString(struct.name);
BitSet optionals = new BitSet();
if (struct.isSetConfiguration()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetConfiguration()) {
{
oprot.writeI32(struct.configuration.size());
for (Map.Entry<String, String> _iter185 : struct.configuration.entrySet())
{
oprot.writeString(_iter185.getKey());
oprot.writeString(_iter185.getValue());
}
}
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, NamespaceDescriptor struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
struct.name = iprot.readString();
struct.setNameIsSet(true);
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
{
org.apache.thrift.protocol.TMap _map186 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32());
struct.configuration = new HashMap<String,String>(2*_map186.size);
String _key187;
String _val188;
for (int _i189 = 0; _i189 < _map186.size; ++_i189)
{
_key187 = iprot.readString();
_val188 = iprot.readString();
struct.configuration.put(_key187, _val188);
}
}
struct.setConfigurationIsSet(true);
}
}
}
}

View File

@ -34,7 +34,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-25")
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2018-12-27")
public class TAppend implements org.apache.thrift.TBase<TAppend, TAppend._Fields>, java.io.Serializable, Cloneable, Comparable<TAppend> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TAppend");
@ -43,6 +43,7 @@ public class TAppend implements org.apache.thrift.TBase<TAppend, TAppend._Fields
private static final org.apache.thrift.protocol.TField ATTRIBUTES_FIELD_DESC = new org.apache.thrift.protocol.TField("attributes", org.apache.thrift.protocol.TType.MAP, (short)3);
private static final org.apache.thrift.protocol.TField DURABILITY_FIELD_DESC = new org.apache.thrift.protocol.TField("durability", org.apache.thrift.protocol.TType.I32, (short)4);
private static final org.apache.thrift.protocol.TField CELL_VISIBILITY_FIELD_DESC = new org.apache.thrift.protocol.TField("cellVisibility", org.apache.thrift.protocol.TType.STRUCT, (short)5);
private static final org.apache.thrift.protocol.TField RETURN_RESULTS_FIELD_DESC = new org.apache.thrift.protocol.TField("returnResults", org.apache.thrift.protocol.TType.BOOL, (short)6);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
@ -59,6 +60,7 @@ public class TAppend implements org.apache.thrift.TBase<TAppend, TAppend._Fields
*/
public TDurability durability; // optional
public TCellVisibility cellVisibility; // optional
public boolean returnResults; // optional
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
@ -70,7 +72,8 @@ public class TAppend implements org.apache.thrift.TBase<TAppend, TAppend._Fields
* @see TDurability
*/
DURABILITY((short)4, "durability"),
CELL_VISIBILITY((short)5, "cellVisibility");
CELL_VISIBILITY((short)5, "cellVisibility"),
RETURN_RESULTS((short)6, "returnResults");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
@ -95,6 +98,8 @@ public class TAppend implements org.apache.thrift.TBase<TAppend, TAppend._Fields
return DURABILITY;
case 5: // CELL_VISIBILITY
return CELL_VISIBILITY;
case 6: // RETURN_RESULTS
return RETURN_RESULTS;
default:
return null;
}
@ -135,7 +140,9 @@ public class TAppend implements org.apache.thrift.TBase<TAppend, TAppend._Fields
}
// isset id assignments
private static final _Fields optionals[] = {_Fields.ATTRIBUTES,_Fields.DURABILITY,_Fields.CELL_VISIBILITY};
private static final int __RETURNRESULTS_ISSET_ID = 0;
private byte __isset_bitfield = 0;
private static final _Fields optionals[] = {_Fields.ATTRIBUTES,_Fields.DURABILITY,_Fields.CELL_VISIBILITY,_Fields.RETURN_RESULTS};
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
@ -152,6 +159,8 @@ public class TAppend implements org.apache.thrift.TBase<TAppend, TAppend._Fields
new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TDurability.class)));
tmpMap.put(_Fields.CELL_VISIBILITY, new org.apache.thrift.meta_data.FieldMetaData("cellVisibility", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TCellVisibility.class)));
tmpMap.put(_Fields.RETURN_RESULTS, new org.apache.thrift.meta_data.FieldMetaData("returnResults", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TAppend.class, metaDataMap);
}
@ -172,6 +181,7 @@ public class TAppend implements org.apache.thrift.TBase<TAppend, TAppend._Fields
* Performs a deep copy on <i>other</i>.
*/
public TAppend(TAppend other) {
__isset_bitfield = other.__isset_bitfield;
if (other.isSetRow()) {
this.row = org.apache.thrift.TBaseHelper.copyBinary(other.row);
}
@ -192,6 +202,7 @@ public class TAppend implements org.apache.thrift.TBase<TAppend, TAppend._Fields
if (other.isSetCellVisibility()) {
this.cellVisibility = new TCellVisibility(other.cellVisibility);
}
this.returnResults = other.returnResults;
}
public TAppend deepCopy() {
@ -205,6 +216,8 @@ public class TAppend implements org.apache.thrift.TBase<TAppend, TAppend._Fields
this.attributes = null;
this.durability = null;
this.cellVisibility = null;
setReturnResultsIsSet(false);
this.returnResults = false;
}
public byte[] getRow() {
@ -371,6 +384,29 @@ public class TAppend implements org.apache.thrift.TBase<TAppend, TAppend._Fields
}
}
public boolean isReturnResults() {
return this.returnResults;
}
public TAppend setReturnResults(boolean returnResults) {
this.returnResults = returnResults;
setReturnResultsIsSet(true);
return this;
}
public void unsetReturnResults() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __RETURNRESULTS_ISSET_ID);
}
/** Returns true if field returnResults is set (has been assigned a value) and false otherwise */
public boolean isSetReturnResults() {
return EncodingUtils.testBit(__isset_bitfield, __RETURNRESULTS_ISSET_ID);
}
public void setReturnResultsIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __RETURNRESULTS_ISSET_ID, value);
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case ROW:
@ -413,6 +449,14 @@ public class TAppend implements org.apache.thrift.TBase<TAppend, TAppend._Fields
}
break;
case RETURN_RESULTS:
if (value == null) {
unsetReturnResults();
} else {
setReturnResults((Boolean)value);
}
break;
}
}
@ -433,6 +477,9 @@ public class TAppend implements org.apache.thrift.TBase<TAppend, TAppend._Fields
case CELL_VISIBILITY:
return getCellVisibility();
case RETURN_RESULTS:
return isReturnResults();
}
throw new IllegalStateException();
}
@ -454,6 +501,8 @@ public class TAppend implements org.apache.thrift.TBase<TAppend, TAppend._Fields
return isSetDurability();
case CELL_VISIBILITY:
return isSetCellVisibility();
case RETURN_RESULTS:
return isSetReturnResults();
}
throw new IllegalStateException();
}
@ -516,6 +565,15 @@ public class TAppend implements org.apache.thrift.TBase<TAppend, TAppend._Fields
return false;
}
boolean this_present_returnResults = true && this.isSetReturnResults();
boolean that_present_returnResults = true && that.isSetReturnResults();
if (this_present_returnResults || that_present_returnResults) {
if (!(this_present_returnResults && that_present_returnResults))
return false;
if (this.returnResults != that.returnResults)
return false;
}
return true;
}
@ -548,6 +606,11 @@ public class TAppend implements org.apache.thrift.TBase<TAppend, TAppend._Fields
if (present_cellVisibility)
list.add(cellVisibility);
boolean present_returnResults = true && (isSetReturnResults());
list.add(present_returnResults);
if (present_returnResults)
list.add(returnResults);
return list.hashCode();
}
@ -609,6 +672,16 @@ public class TAppend implements org.apache.thrift.TBase<TAppend, TAppend._Fields
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetReturnResults()).compareTo(other.isSetReturnResults());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetReturnResults()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.returnResults, other.returnResults);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
@ -674,6 +747,12 @@ public class TAppend implements org.apache.thrift.TBase<TAppend, TAppend._Fields
}
first = false;
}
if (isSetReturnResults()) {
if (!first) sb.append(", ");
sb.append("returnResults:");
sb.append(this.returnResults);
first = false;
}
sb.append(")");
return sb.toString();
}
@ -702,6 +781,8 @@ public class TAppend implements org.apache.thrift.TBase<TAppend, TAppend._Fields
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bitfield = 0;
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
@ -790,6 +871,14 @@ public class TAppend implements org.apache.thrift.TBase<TAppend, TAppend._Fields
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 6: // RETURN_RESULTS
if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
struct.returnResults = iprot.readBool();
struct.setReturnResultsIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
@ -851,6 +940,11 @@ public class TAppend implements org.apache.thrift.TBase<TAppend, TAppend._Fields
oprot.writeFieldEnd();
}
}
if (struct.isSetReturnResults()) {
oprot.writeFieldBegin(RETURN_RESULTS_FIELD_DESC);
oprot.writeBool(struct.returnResults);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
@ -886,7 +980,10 @@ public class TAppend implements org.apache.thrift.TBase<TAppend, TAppend._Fields
if (struct.isSetCellVisibility()) {
optionals.set(2);
}
oprot.writeBitSet(optionals, 3);
if (struct.isSetReturnResults()) {
optionals.set(3);
}
oprot.writeBitSet(optionals, 4);
if (struct.isSetAttributes()) {
{
oprot.writeI32(struct.attributes.size());
@ -903,6 +1000,9 @@ public class TAppend implements org.apache.thrift.TBase<TAppend, TAppend._Fields
if (struct.isSetCellVisibility()) {
struct.cellVisibility.write(oprot);
}
if (struct.isSetReturnResults()) {
oprot.writeBool(struct.returnResults);
}
}
@Override
@ -922,7 +1022,7 @@ public class TAppend implements org.apache.thrift.TBase<TAppend, TAppend._Fields
}
}
struct.setColumnsIsSet(true);
BitSet incoming = iprot.readBitSet(3);
BitSet incoming = iprot.readBitSet(4);
if (incoming.get(0)) {
{
org.apache.thrift.protocol.TMap _map102 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32());
@ -947,6 +1047,10 @@ public class TAppend implements org.apache.thrift.TBase<TAppend, TAppend._Fields
struct.cellVisibility.read(iprot);
struct.setCellVisibilityIsSet(true);
}
if (incoming.get(3)) {
struct.returnResults = iprot.readBool();
struct.setReturnResultsIsSet(true);
}
}
}

View File

@ -34,7 +34,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-25")
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2018-12-27")
public class TAuthorization implements org.apache.thrift.TBase<TAuthorization, TAuthorization._Fields>, java.io.Serializable, Cloneable, Comparable<TAuthorization> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TAuthorization");

View File

@ -0,0 +1,69 @@
/**
* Autogenerated by Thrift Compiler (0.9.3)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package org.apache.hadoop.hbase.thrift2.generated;
import java.util.Map;
import java.util.HashMap;
import org.apache.thrift.TEnum;
public enum TBloomFilterType implements org.apache.thrift.TEnum {
/**
* Bloomfilters disabled
*/
NONE(0),
/**
* Bloom enabled with Table row as Key
*/
ROW(1),
/**
* Bloom enabled with Table row &amp; column (family+qualifier) as Key
*/
ROWCOL(2),
/**
* Bloom enabled with Table row prefix as Key, specify the length of the prefix
*/
ROWPREFIX_FIXED_LENGTH(3),
/**
* Bloom enabled with Table row prefix as Key, specify the delimiter of the prefix
*/
ROWPREFIX_DELIMITED(4);
private final int value;
private TBloomFilterType(int value) {
this.value = value;
}
/**
* Get the integer value of this enum value, as defined in the Thrift IDL.
*/
public int getValue() {
return value;
}
/**
* Find a the enum type by its integer value, as defined in the Thrift IDL.
* @return null if the value is not found.
*/
public static TBloomFilterType findByValue(int value) {
switch (value) {
case 0:
return NONE;
case 1:
return ROW;
case 2:
return ROWCOL;
case 3:
return ROWPREFIX_FIXED_LENGTH;
case 4:
return ROWPREFIX_DELIMITED;
default:
return null;
}
}
}

View File

@ -34,7 +34,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-25")
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2018-12-27")
public class TCellVisibility implements org.apache.thrift.TBase<TCellVisibility, TCellVisibility._Fields>, java.io.Serializable, Cloneable, Comparable<TCellVisibility> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCellVisibility");

View File

@ -39,7 +39,7 @@ import org.slf4j.LoggerFactory;
* in a HBase table by column family and optionally
* a column qualifier and timestamp
*/
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-25")
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2018-12-27")
public class TColumn implements org.apache.thrift.TBase<TColumn, TColumn._Fields>, java.io.Serializable, Cloneable, Comparable<TColumn> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TColumn");

View File

@ -37,7 +37,7 @@ import org.slf4j.LoggerFactory;
/**
* Represents a single cell and the amount to increment it by
*/
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-25")
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2018-12-27")
public class TColumnIncrement implements org.apache.thrift.TBase<TColumnIncrement, TColumnIncrement._Fields>, java.io.Serializable, Cloneable, Comparable<TColumnIncrement> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TColumnIncrement");

View File

@ -37,7 +37,7 @@ import org.slf4j.LoggerFactory;
/**
* Represents a single cell and its value.
*/
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-25")
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2018-12-27")
public class TColumnValue implements org.apache.thrift.TBase<TColumnValue, TColumnValue._Fields>, java.io.Serializable, Cloneable, Comparable<TColumnValue> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TColumnValue");
@ -46,6 +46,7 @@ public class TColumnValue implements org.apache.thrift.TBase<TColumnValue, TColu
private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.STRING, (short)3);
private static final org.apache.thrift.protocol.TField TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("timestamp", org.apache.thrift.protocol.TType.I64, (short)4);
private static final org.apache.thrift.protocol.TField TAGS_FIELD_DESC = new org.apache.thrift.protocol.TField("tags", org.apache.thrift.protocol.TType.STRING, (short)5);
private static final org.apache.thrift.protocol.TField TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("type", org.apache.thrift.protocol.TType.BYTE, (short)6);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
@ -58,6 +59,7 @@ public class TColumnValue implements org.apache.thrift.TBase<TColumnValue, TColu
public ByteBuffer value; // required
public long timestamp; // optional
public ByteBuffer tags; // optional
public byte type; // optional
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
@ -65,7 +67,8 @@ public class TColumnValue implements org.apache.thrift.TBase<TColumnValue, TColu
QUALIFIER((short)2, "qualifier"),
VALUE((short)3, "value"),
TIMESTAMP((short)4, "timestamp"),
TAGS((short)5, "tags");
TAGS((short)5, "tags"),
TYPE((short)6, "type");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
@ -90,6 +93,8 @@ public class TColumnValue implements org.apache.thrift.TBase<TColumnValue, TColu
return TIMESTAMP;
case 5: // TAGS
return TAGS;
case 6: // TYPE
return TYPE;
default:
return null;
}
@ -131,8 +136,9 @@ public class TColumnValue implements org.apache.thrift.TBase<TColumnValue, TColu
// isset id assignments
private static final int __TIMESTAMP_ISSET_ID = 0;
private static final int __TYPE_ISSET_ID = 1;
private byte __isset_bitfield = 0;
private static final _Fields optionals[] = {_Fields.TIMESTAMP,_Fields.TAGS};
private static final _Fields optionals[] = {_Fields.TIMESTAMP,_Fields.TAGS,_Fields.TYPE};
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
@ -146,6 +152,8 @@ public class TColumnValue implements org.apache.thrift.TBase<TColumnValue, TColu
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.TAGS, new org.apache.thrift.meta_data.FieldMetaData("tags", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)));
tmpMap.put(_Fields.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BYTE)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TColumnValue.class, metaDataMap);
}
@ -182,6 +190,7 @@ public class TColumnValue implements org.apache.thrift.TBase<TColumnValue, TColu
if (other.isSetTags()) {
this.tags = org.apache.thrift.TBaseHelper.copyBinary(other.tags);
}
this.type = other.type;
}
public TColumnValue deepCopy() {
@ -196,6 +205,8 @@ public class TColumnValue implements org.apache.thrift.TBase<TColumnValue, TColu
setTimestampIsSet(false);
this.timestamp = 0;
this.tags = null;
setTypeIsSet(false);
this.type = 0;
}
public byte[] getFamily() {
@ -357,6 +368,29 @@ public class TColumnValue implements org.apache.thrift.TBase<TColumnValue, TColu
}
}
public byte getType() {
return this.type;
}
public TColumnValue setType(byte type) {
this.type = type;
setTypeIsSet(true);
return this;
}
public void unsetType() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TYPE_ISSET_ID);
}
/** Returns true if field type is set (has been assigned a value) and false otherwise */
public boolean isSetType() {
return EncodingUtils.testBit(__isset_bitfield, __TYPE_ISSET_ID);
}
public void setTypeIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TYPE_ISSET_ID, value);
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case FAMILY:
@ -399,6 +433,14 @@ public class TColumnValue implements org.apache.thrift.TBase<TColumnValue, TColu
}
break;
case TYPE:
if (value == null) {
unsetType();
} else {
setType((Byte)value);
}
break;
}
}
@ -419,6 +461,9 @@ public class TColumnValue implements org.apache.thrift.TBase<TColumnValue, TColu
case TAGS:
return getTags();
case TYPE:
return getType();
}
throw new IllegalStateException();
}
@ -440,6 +485,8 @@ public class TColumnValue implements org.apache.thrift.TBase<TColumnValue, TColu
return isSetTimestamp();
case TAGS:
return isSetTags();
case TYPE:
return isSetType();
}
throw new IllegalStateException();
}
@ -502,6 +549,15 @@ public class TColumnValue implements org.apache.thrift.TBase<TColumnValue, TColu
return false;
}
boolean this_present_type = true && this.isSetType();
boolean that_present_type = true && that.isSetType();
if (this_present_type || that_present_type) {
if (!(this_present_type && that_present_type))
return false;
if (this.type != that.type)
return false;
}
return true;
}
@ -534,6 +590,11 @@ public class TColumnValue implements org.apache.thrift.TBase<TColumnValue, TColu
if (present_tags)
list.add(tags);
boolean present_type = true && (isSetType());
list.add(present_type);
if (present_type)
list.add(type);
return list.hashCode();
}
@ -595,6 +656,16 @@ public class TColumnValue implements org.apache.thrift.TBase<TColumnValue, TColu
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetType()).compareTo(other.isSetType());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetType()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.type, other.type);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
@ -654,6 +725,12 @@ public class TColumnValue implements org.apache.thrift.TBase<TColumnValue, TColu
}
first = false;
}
if (isSetType()) {
if (!first) sb.append(", ");
sb.append("type:");
sb.append(this.type);
first = false;
}
sb.append(")");
return sb.toString();
}
@ -748,6 +825,14 @@ public class TColumnValue implements org.apache.thrift.TBase<TColumnValue, TColu
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 6: // TYPE
if (schemeField.type == org.apache.thrift.protocol.TType.BYTE) {
struct.type = iprot.readByte();
struct.setTypeIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
@ -790,6 +875,11 @@ public class TColumnValue implements org.apache.thrift.TBase<TColumnValue, TColu
oprot.writeFieldEnd();
}
}
if (struct.isSetType()) {
oprot.writeFieldBegin(TYPE_FIELD_DESC);
oprot.writeByte(struct.type);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
@ -817,13 +907,19 @@ public class TColumnValue implements org.apache.thrift.TBase<TColumnValue, TColu
if (struct.isSetTags()) {
optionals.set(1);
}
oprot.writeBitSet(optionals, 2);
if (struct.isSetType()) {
optionals.set(2);
}
oprot.writeBitSet(optionals, 3);
if (struct.isSetTimestamp()) {
oprot.writeI64(struct.timestamp);
}
if (struct.isSetTags()) {
oprot.writeBinary(struct.tags);
}
if (struct.isSetType()) {
oprot.writeByte(struct.type);
}
}
@Override
@ -835,7 +931,7 @@ public class TColumnValue implements org.apache.thrift.TBase<TColumnValue, TColu
struct.setQualifierIsSet(true);
struct.value = iprot.readBinary();
struct.setValueIsSet(true);
BitSet incoming = iprot.readBitSet(2);
BitSet incoming = iprot.readBitSet(3);
if (incoming.get(0)) {
struct.timestamp = iprot.readI64();
struct.setTimestampIsSet(true);
@ -844,6 +940,10 @@ public class TColumnValue implements org.apache.thrift.TBase<TColumnValue, TColu
struct.tags = iprot.readBinary();
struct.setTagsIsSet(true);
}
if (incoming.get(2)) {
struct.type = iprot.readByte();
struct.setTypeIsSet(true);
}
}
}

View File

@ -0,0 +1,60 @@
/**
* Autogenerated by Thrift Compiler (0.9.3)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package org.apache.hadoop.hbase.thrift2.generated;
import java.util.Map;
import java.util.HashMap;
import org.apache.thrift.TEnum;
public enum TCompressionAlgorithm implements org.apache.thrift.TEnum {
LZO(0),
GZ(1),
NONE(2),
SNAPPY(3),
LZ4(4),
BZIP2(5),
ZSTD(6);
private final int value;
private TCompressionAlgorithm(int value) {
this.value = value;
}
/**
* Get the integer value of this enum value, as defined in the Thrift IDL.
*/
public int getValue() {
return value;
}
/**
* Find a the enum type by its integer value, as defined in the Thrift IDL.
* @return null if the value is not found.
*/
public static TCompressionAlgorithm findByValue(int value) {
switch (value) {
case 0:
return LZO;
case 1:
return GZ;
case 2:
return NONE;
case 3:
return SNAPPY;
case 4:
return LZ4;
case 5:
return BZIP2;
case 6:
return ZSTD;
default:
return null;
}
}
}

View File

@ -0,0 +1,57 @@
/**
* Autogenerated by Thrift Compiler (0.9.3)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package org.apache.hadoop.hbase.thrift2.generated;
import java.util.Map;
import java.util.HashMap;
import org.apache.thrift.TEnum;
public enum TDataBlockEncoding implements org.apache.thrift.TEnum {
/**
* Disable data block encoding.
*/
NONE(0),
PREFIX(2),
DIFF(3),
FAST_DIFF(4),
ROW_INDEX_V1(7);
private final int value;
private TDataBlockEncoding(int value) {
this.value = value;
}
/**
* Get the integer value of this enum value, as defined in the Thrift IDL.
*/
public int getValue() {
return value;
}
/**
* Find a the enum type by its integer value, as defined in the Thrift IDL.
* @return null if the value is not found.
*/
public static TDataBlockEncoding findByValue(int value) {
switch (value) {
case 0:
return NONE;
case 2:
return PREFIX;
case 3:
return DIFF;
case 4:
return FAST_DIFF;
case 7:
return ROW_INDEX_V1;
default:
return null;
}
}
}

View File

@ -60,7 +60,7 @@ import org.slf4j.LoggerFactory;
* by changing the durability. If you don't provide durability, it defaults to
* column family's default setting for durability.
*/
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-25")
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2018-12-27")
public class TDelete implements org.apache.thrift.TBase<TDelete, TDelete._Fields>, java.io.Serializable, Cloneable, Comparable<TDelete> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TDelete");

View File

@ -19,6 +19,7 @@ import org.apache.thrift.TEnum;
* - FSYNC_WAL means Write the Mutation to the WAL synchronously and force the entries to disk.
*/
public enum TDurability implements org.apache.thrift.TEnum {
USE_DEFAULT(0),
SKIP_WAL(1),
ASYNC_WAL(2),
SYNC_WAL(3),
@ -43,6 +44,8 @@ public enum TDurability implements org.apache.thrift.TEnum {
*/
public static TDurability findByValue(int value) {
switch (value) {
case 0:
return USE_DEFAULT;
case 1:
return SKIP_WAL;
case 2:

View File

@ -47,7 +47,7 @@ import org.slf4j.LoggerFactory;
* If you specify a time range and a timestamp the range is ignored.
* Timestamps on TColumns are ignored.
*/
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2018-07-03")
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2018-12-27")
public class TGet implements org.apache.thrift.TBase<TGet, TGet._Fields>, java.io.Serializable, Cloneable, Comparable<TGet> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGet");
@ -61,6 +61,10 @@ public class TGet implements org.apache.thrift.TBase<TGet, TGet._Fields>, java.i
private static final org.apache.thrift.protocol.TField AUTHORIZATIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("authorizations", org.apache.thrift.protocol.TType.STRUCT, (short)8);
private static final org.apache.thrift.protocol.TField CONSISTENCY_FIELD_DESC = new org.apache.thrift.protocol.TField("consistency", org.apache.thrift.protocol.TType.I32, (short)9);
private static final org.apache.thrift.protocol.TField TARGET_REPLICA_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("targetReplicaId", org.apache.thrift.protocol.TType.I32, (short)10);
private static final org.apache.thrift.protocol.TField CACHE_BLOCKS_FIELD_DESC = new org.apache.thrift.protocol.TField("cacheBlocks", org.apache.thrift.protocol.TType.BOOL, (short)11);
private static final org.apache.thrift.protocol.TField STORE_LIMIT_FIELD_DESC = new org.apache.thrift.protocol.TField("storeLimit", org.apache.thrift.protocol.TType.I32, (short)12);
private static final org.apache.thrift.protocol.TField STORE_OFFSET_FIELD_DESC = new org.apache.thrift.protocol.TField("storeOffset", org.apache.thrift.protocol.TType.I32, (short)13);
private static final org.apache.thrift.protocol.TField EXISTENCE_ONLY_FIELD_DESC = new org.apache.thrift.protocol.TField("existence_only", org.apache.thrift.protocol.TType.BOOL, (short)14);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
@ -82,6 +86,10 @@ public class TGet implements org.apache.thrift.TBase<TGet, TGet._Fields>, java.i
*/
public TConsistency consistency; // optional
public int targetReplicaId; // optional
public boolean cacheBlocks; // optional
public int storeLimit; // optional
public int storeOffset; // optional
public boolean existence_only; // optional
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
@ -98,7 +106,11 @@ public class TGet implements org.apache.thrift.TBase<TGet, TGet._Fields>, java.i
* @see TConsistency
*/
CONSISTENCY((short)9, "consistency"),
TARGET_REPLICA_ID((short)10, "targetReplicaId");
TARGET_REPLICA_ID((short)10, "targetReplicaId"),
CACHE_BLOCKS((short)11, "cacheBlocks"),
STORE_LIMIT((short)12, "storeLimit"),
STORE_OFFSET((short)13, "storeOffset"),
EXISTENCE_ONLY((short)14, "existence_only");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
@ -133,6 +145,14 @@ public class TGet implements org.apache.thrift.TBase<TGet, TGet._Fields>, java.i
return CONSISTENCY;
case 10: // TARGET_REPLICA_ID
return TARGET_REPLICA_ID;
case 11: // CACHE_BLOCKS
return CACHE_BLOCKS;
case 12: // STORE_LIMIT
return STORE_LIMIT;
case 13: // STORE_OFFSET
return STORE_OFFSET;
case 14: // EXISTENCE_ONLY
return EXISTENCE_ONLY;
default:
return null;
}
@ -176,8 +196,12 @@ public class TGet implements org.apache.thrift.TBase<TGet, TGet._Fields>, java.i
private static final int __TIMESTAMP_ISSET_ID = 0;
private static final int __MAXVERSIONS_ISSET_ID = 1;
private static final int __TARGETREPLICAID_ISSET_ID = 2;
private static final int __CACHEBLOCKS_ISSET_ID = 3;
private static final int __STORELIMIT_ISSET_ID = 4;
private static final int __STOREOFFSET_ISSET_ID = 5;
private static final int __EXISTENCE_ONLY_ISSET_ID = 6;
private byte __isset_bitfield = 0;
private static final _Fields optionals[] = {_Fields.COLUMNS,_Fields.TIMESTAMP,_Fields.TIME_RANGE,_Fields.MAX_VERSIONS,_Fields.FILTER_STRING,_Fields.ATTRIBUTES,_Fields.AUTHORIZATIONS,_Fields.CONSISTENCY,_Fields.TARGET_REPLICA_ID};
private static final _Fields optionals[] = {_Fields.COLUMNS,_Fields.TIMESTAMP,_Fields.TIME_RANGE,_Fields.MAX_VERSIONS,_Fields.FILTER_STRING,_Fields.ATTRIBUTES,_Fields.AUTHORIZATIONS,_Fields.CONSISTENCY,_Fields.TARGET_REPLICA_ID,_Fields.CACHE_BLOCKS,_Fields.STORE_LIMIT,_Fields.STORE_OFFSET,_Fields.EXISTENCE_ONLY};
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
@ -204,6 +228,14 @@ public class TGet implements org.apache.thrift.TBase<TGet, TGet._Fields>, java.i
new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TConsistency.class)));
tmpMap.put(_Fields.TARGET_REPLICA_ID, new org.apache.thrift.meta_data.FieldMetaData("targetReplicaId", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
tmpMap.put(_Fields.CACHE_BLOCKS, new org.apache.thrift.meta_data.FieldMetaData("cacheBlocks", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
tmpMap.put(_Fields.STORE_LIMIT, new org.apache.thrift.meta_data.FieldMetaData("storeLimit", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
tmpMap.put(_Fields.STORE_OFFSET, new org.apache.thrift.meta_data.FieldMetaData("storeOffset", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
tmpMap.put(_Fields.EXISTENCE_ONLY, new org.apache.thrift.meta_data.FieldMetaData("existence_only", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGet.class, metaDataMap);
}
@ -252,6 +284,10 @@ public class TGet implements org.apache.thrift.TBase<TGet, TGet._Fields>, java.i
this.consistency = other.consistency;
}
this.targetReplicaId = other.targetReplicaId;
this.cacheBlocks = other.cacheBlocks;
this.storeLimit = other.storeLimit;
this.storeOffset = other.storeOffset;
this.existence_only = other.existence_only;
}
public TGet deepCopy() {
@ -273,6 +309,14 @@ public class TGet implements org.apache.thrift.TBase<TGet, TGet._Fields>, java.i
this.consistency = null;
setTargetReplicaIdIsSet(false);
this.targetReplicaId = 0;
setCacheBlocksIsSet(false);
this.cacheBlocks = false;
setStoreLimitIsSet(false);
this.storeLimit = 0;
setStoreOffsetIsSet(false);
this.storeOffset = 0;
setExistence_onlyIsSet(false);
this.existence_only = false;
}
public byte[] getRow() {
@ -566,6 +610,98 @@ public class TGet implements org.apache.thrift.TBase<TGet, TGet._Fields>, java.i
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TARGETREPLICAID_ISSET_ID, value);
}
public boolean isCacheBlocks() {
return this.cacheBlocks;
}
public TGet setCacheBlocks(boolean cacheBlocks) {
this.cacheBlocks = cacheBlocks;
setCacheBlocksIsSet(true);
return this;
}
public void unsetCacheBlocks() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CACHEBLOCKS_ISSET_ID);
}
/** Returns true if field cacheBlocks is set (has been assigned a value) and false otherwise */
public boolean isSetCacheBlocks() {
return EncodingUtils.testBit(__isset_bitfield, __CACHEBLOCKS_ISSET_ID);
}
public void setCacheBlocksIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CACHEBLOCKS_ISSET_ID, value);
}
public int getStoreLimit() {
return this.storeLimit;
}
public TGet setStoreLimit(int storeLimit) {
this.storeLimit = storeLimit;
setStoreLimitIsSet(true);
return this;
}
public void unsetStoreLimit() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __STORELIMIT_ISSET_ID);
}
/** Returns true if field storeLimit is set (has been assigned a value) and false otherwise */
public boolean isSetStoreLimit() {
return EncodingUtils.testBit(__isset_bitfield, __STORELIMIT_ISSET_ID);
}
public void setStoreLimitIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __STORELIMIT_ISSET_ID, value);
}
public int getStoreOffset() {
return this.storeOffset;
}
public TGet setStoreOffset(int storeOffset) {
this.storeOffset = storeOffset;
setStoreOffsetIsSet(true);
return this;
}
public void unsetStoreOffset() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __STOREOFFSET_ISSET_ID);
}
/** Returns true if field storeOffset is set (has been assigned a value) and false otherwise */
public boolean isSetStoreOffset() {
return EncodingUtils.testBit(__isset_bitfield, __STOREOFFSET_ISSET_ID);
}
public void setStoreOffsetIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __STOREOFFSET_ISSET_ID, value);
}
public boolean isExistence_only() {
return this.existence_only;
}
public TGet setExistence_only(boolean existence_only) {
this.existence_only = existence_only;
setExistence_onlyIsSet(true);
return this;
}
public void unsetExistence_only() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __EXISTENCE_ONLY_ISSET_ID);
}
/** Returns true if field existence_only is set (has been assigned a value) and false otherwise */
public boolean isSetExistence_only() {
return EncodingUtils.testBit(__isset_bitfield, __EXISTENCE_ONLY_ISSET_ID);
}
public void setExistence_onlyIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __EXISTENCE_ONLY_ISSET_ID, value);
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case ROW:
@ -648,6 +784,38 @@ public class TGet implements org.apache.thrift.TBase<TGet, TGet._Fields>, java.i
}
break;
case CACHE_BLOCKS:
if (value == null) {
unsetCacheBlocks();
} else {
setCacheBlocks((Boolean)value);
}
break;
case STORE_LIMIT:
if (value == null) {
unsetStoreLimit();
} else {
setStoreLimit((Integer)value);
}
break;
case STORE_OFFSET:
if (value == null) {
unsetStoreOffset();
} else {
setStoreOffset((Integer)value);
}
break;
case EXISTENCE_ONLY:
if (value == null) {
unsetExistence_only();
} else {
setExistence_only((Boolean)value);
}
break;
}
}
@ -683,6 +851,18 @@ public class TGet implements org.apache.thrift.TBase<TGet, TGet._Fields>, java.i
case TARGET_REPLICA_ID:
return getTargetReplicaId();
case CACHE_BLOCKS:
return isCacheBlocks();
case STORE_LIMIT:
return getStoreLimit();
case STORE_OFFSET:
return getStoreOffset();
case EXISTENCE_ONLY:
return isExistence_only();
}
throw new IllegalStateException();
}
@ -714,6 +894,14 @@ public class TGet implements org.apache.thrift.TBase<TGet, TGet._Fields>, java.i
return isSetConsistency();
case TARGET_REPLICA_ID:
return isSetTargetReplicaId();
case CACHE_BLOCKS:
return isSetCacheBlocks();
case STORE_LIMIT:
return isSetStoreLimit();
case STORE_OFFSET:
return isSetStoreOffset();
case EXISTENCE_ONLY:
return isSetExistence_only();
}
throw new IllegalStateException();
}
@ -821,6 +1009,42 @@ public class TGet implements org.apache.thrift.TBase<TGet, TGet._Fields>, java.i
return false;
}
boolean this_present_cacheBlocks = true && this.isSetCacheBlocks();
boolean that_present_cacheBlocks = true && that.isSetCacheBlocks();
if (this_present_cacheBlocks || that_present_cacheBlocks) {
if (!(this_present_cacheBlocks && that_present_cacheBlocks))
return false;
if (this.cacheBlocks != that.cacheBlocks)
return false;
}
boolean this_present_storeLimit = true && this.isSetStoreLimit();
boolean that_present_storeLimit = true && that.isSetStoreLimit();
if (this_present_storeLimit || that_present_storeLimit) {
if (!(this_present_storeLimit && that_present_storeLimit))
return false;
if (this.storeLimit != that.storeLimit)
return false;
}
boolean this_present_storeOffset = true && this.isSetStoreOffset();
boolean that_present_storeOffset = true && that.isSetStoreOffset();
if (this_present_storeOffset || that_present_storeOffset) {
if (!(this_present_storeOffset && that_present_storeOffset))
return false;
if (this.storeOffset != that.storeOffset)
return false;
}
boolean this_present_existence_only = true && this.isSetExistence_only();
boolean that_present_existence_only = true && that.isSetExistence_only();
if (this_present_existence_only || that_present_existence_only) {
if (!(this_present_existence_only && that_present_existence_only))
return false;
if (this.existence_only != that.existence_only)
return false;
}
return true;
}
@ -878,6 +1102,26 @@ public class TGet implements org.apache.thrift.TBase<TGet, TGet._Fields>, java.i
if (present_targetReplicaId)
list.add(targetReplicaId);
boolean present_cacheBlocks = true && (isSetCacheBlocks());
list.add(present_cacheBlocks);
if (present_cacheBlocks)
list.add(cacheBlocks);
boolean present_storeLimit = true && (isSetStoreLimit());
list.add(present_storeLimit);
if (present_storeLimit)
list.add(storeLimit);
boolean present_storeOffset = true && (isSetStoreOffset());
list.add(present_storeOffset);
if (present_storeOffset)
list.add(storeOffset);
boolean present_existence_only = true && (isSetExistence_only());
list.add(present_existence_only);
if (present_existence_only)
list.add(existence_only);
return list.hashCode();
}
@ -989,6 +1233,46 @@ public class TGet implements org.apache.thrift.TBase<TGet, TGet._Fields>, java.i
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetCacheBlocks()).compareTo(other.isSetCacheBlocks());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetCacheBlocks()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cacheBlocks, other.cacheBlocks);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetStoreLimit()).compareTo(other.isSetStoreLimit());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetStoreLimit()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.storeLimit, other.storeLimit);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetStoreOffset()).compareTo(other.isSetStoreOffset());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetStoreOffset()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.storeOffset, other.storeOffset);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetExistence_only()).compareTo(other.isSetExistence_only());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetExistence_only()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.existence_only, other.existence_only);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
@ -1094,6 +1378,30 @@ public class TGet implements org.apache.thrift.TBase<TGet, TGet._Fields>, java.i
sb.append(this.targetReplicaId);
first = false;
}
if (isSetCacheBlocks()) {
if (!first) sb.append(", ");
sb.append("cacheBlocks:");
sb.append(this.cacheBlocks);
first = false;
}
if (isSetStoreLimit()) {
if (!first) sb.append(", ");
sb.append("storeLimit:");
sb.append(this.storeLimit);
first = false;
}
if (isSetStoreOffset()) {
if (!first) sb.append(", ");
sb.append("storeOffset:");
sb.append(this.storeOffset);
first = false;
}
if (isSetExistence_only()) {
if (!first) sb.append(", ");
sb.append("existence_only:");
sb.append(this.existence_only);
first = false;
}
sb.append(")");
return sb.toString();
}
@ -1253,6 +1561,38 @@ public class TGet implements org.apache.thrift.TBase<TGet, TGet._Fields>, java.i
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 11: // CACHE_BLOCKS
if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
struct.cacheBlocks = iprot.readBool();
struct.setCacheBlocksIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 12: // STORE_LIMIT
if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
struct.storeLimit = iprot.readI32();
struct.setStoreLimitIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 13: // STORE_OFFSET
if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
struct.storeOffset = iprot.readI32();
struct.setStoreOffsetIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 14: // EXISTENCE_ONLY
if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
struct.existence_only = iprot.readBool();
struct.setExistence_onlyIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
@ -1345,6 +1685,26 @@ public class TGet implements org.apache.thrift.TBase<TGet, TGet._Fields>, java.i
oprot.writeI32(struct.targetReplicaId);
oprot.writeFieldEnd();
}
if (struct.isSetCacheBlocks()) {
oprot.writeFieldBegin(CACHE_BLOCKS_FIELD_DESC);
oprot.writeBool(struct.cacheBlocks);
oprot.writeFieldEnd();
}
if (struct.isSetStoreLimit()) {
oprot.writeFieldBegin(STORE_LIMIT_FIELD_DESC);
oprot.writeI32(struct.storeLimit);
oprot.writeFieldEnd();
}
if (struct.isSetStoreOffset()) {
oprot.writeFieldBegin(STORE_OFFSET_FIELD_DESC);
oprot.writeI32(struct.storeOffset);
oprot.writeFieldEnd();
}
if (struct.isSetExistence_only()) {
oprot.writeFieldBegin(EXISTENCE_ONLY_FIELD_DESC);
oprot.writeBool(struct.existence_only);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
@ -1391,7 +1751,19 @@ public class TGet implements org.apache.thrift.TBase<TGet, TGet._Fields>, java.i
if (struct.isSetTargetReplicaId()) {
optionals.set(8);
}
oprot.writeBitSet(optionals, 9);
if (struct.isSetCacheBlocks()) {
optionals.set(9);
}
if (struct.isSetStoreLimit()) {
optionals.set(10);
}
if (struct.isSetStoreOffset()) {
optionals.set(11);
}
if (struct.isSetExistence_only()) {
optionals.set(12);
}
oprot.writeBitSet(optionals, 13);
if (struct.isSetColumns()) {
{
oprot.writeI32(struct.columns.size());
@ -1432,6 +1804,18 @@ public class TGet implements org.apache.thrift.TBase<TGet, TGet._Fields>, java.i
if (struct.isSetTargetReplicaId()) {
oprot.writeI32(struct.targetReplicaId);
}
if (struct.isSetCacheBlocks()) {
oprot.writeBool(struct.cacheBlocks);
}
if (struct.isSetStoreLimit()) {
oprot.writeI32(struct.storeLimit);
}
if (struct.isSetStoreOffset()) {
oprot.writeI32(struct.storeOffset);
}
if (struct.isSetExistence_only()) {
oprot.writeBool(struct.existence_only);
}
}
@Override
@ -1439,7 +1823,7 @@ public class TGet implements org.apache.thrift.TBase<TGet, TGet._Fields>, java.i
TTupleProtocol iprot = (TTupleProtocol) prot;
struct.row = iprot.readBinary();
struct.setRowIsSet(true);
BitSet incoming = iprot.readBitSet(9);
BitSet incoming = iprot.readBitSet(13);
if (incoming.get(0)) {
{
org.apache.thrift.protocol.TList _list27 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
@ -1499,6 +1883,22 @@ public class TGet implements org.apache.thrift.TBase<TGet, TGet._Fields>, java.i
struct.targetReplicaId = iprot.readI32();
struct.setTargetReplicaIdIsSet(true);
}
if (incoming.get(9)) {
struct.cacheBlocks = iprot.readBool();
struct.setCacheBlocksIsSet(true);
}
if (incoming.get(10)) {
struct.storeLimit = iprot.readI32();
struct.setStoreLimitIsSet(true);
}
if (incoming.get(11)) {
struct.storeOffset = iprot.readI32();
struct.setStoreOffsetIsSet(true);
}
if (incoming.get(12)) {
struct.existence_only = iprot.readBool();
struct.setExistence_onlyIsSet(true);
}
}
}

View File

@ -34,7 +34,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-25")
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2018-12-27")
public class THRegionInfo implements org.apache.thrift.TBase<THRegionInfo, THRegionInfo._Fields>, java.io.Serializable, Cloneable, Comparable<THRegionInfo> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("THRegionInfo");

View File

@ -34,7 +34,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-25")
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2018-12-27")
public class THRegionLocation implements org.apache.thrift.TBase<THRegionLocation, THRegionLocation._Fields>, java.io.Serializable, Cloneable, Comparable<THRegionLocation> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("THRegionLocation");

View File

@ -39,7 +39,7 @@ import org.slf4j.LoggerFactory;
* to the HBase master or a HBase region server. Also used to return
* more general HBase error conditions.
*/
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-25")
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2018-12-27")
public class TIOError extends TException implements org.apache.thrift.TBase<TIOError, TIOError._Fields>, java.io.Serializable, Cloneable, Comparable<TIOError> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TIOError");

View File

@ -38,7 +38,7 @@ import org.slf4j.LoggerFactory;
* A TIllegalArgument exception indicates an illegal or invalid
* argument was passed into a procedure.
*/
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-25")
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2018-12-27")
public class TIllegalArgument extends TException implements org.apache.thrift.TBase<TIllegalArgument, TIllegalArgument._Fields>, java.io.Serializable, Cloneable, Comparable<TIllegalArgument> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TIllegalArgument");

View File

@ -41,7 +41,7 @@ import org.slf4j.LoggerFactory;
* by changing the durability. If you don't provide durability, it defaults to
* column family's default setting for durability.
*/
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-25")
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2018-12-27")
public class TIncrement implements org.apache.thrift.TBase<TIncrement, TIncrement._Fields>, java.io.Serializable, Cloneable, Comparable<TIncrement> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TIncrement");
@ -50,6 +50,7 @@ public class TIncrement implements org.apache.thrift.TBase<TIncrement, TIncremen
private static final org.apache.thrift.protocol.TField ATTRIBUTES_FIELD_DESC = new org.apache.thrift.protocol.TField("attributes", org.apache.thrift.protocol.TType.MAP, (short)4);
private static final org.apache.thrift.protocol.TField DURABILITY_FIELD_DESC = new org.apache.thrift.protocol.TField("durability", org.apache.thrift.protocol.TType.I32, (short)5);
private static final org.apache.thrift.protocol.TField CELL_VISIBILITY_FIELD_DESC = new org.apache.thrift.protocol.TField("cellVisibility", org.apache.thrift.protocol.TType.STRUCT, (short)6);
private static final org.apache.thrift.protocol.TField RETURN_RESULTS_FIELD_DESC = new org.apache.thrift.protocol.TField("returnResults", org.apache.thrift.protocol.TType.BOOL, (short)7);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
@ -66,6 +67,7 @@ public class TIncrement implements org.apache.thrift.TBase<TIncrement, TIncremen
*/
public TDurability durability; // optional
public TCellVisibility cellVisibility; // optional
public boolean returnResults; // optional
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
@ -77,7 +79,8 @@ public class TIncrement implements org.apache.thrift.TBase<TIncrement, TIncremen
* @see TDurability
*/
DURABILITY((short)5, "durability"),
CELL_VISIBILITY((short)6, "cellVisibility");
CELL_VISIBILITY((short)6, "cellVisibility"),
RETURN_RESULTS((short)7, "returnResults");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
@ -102,6 +105,8 @@ public class TIncrement implements org.apache.thrift.TBase<TIncrement, TIncremen
return DURABILITY;
case 6: // CELL_VISIBILITY
return CELL_VISIBILITY;
case 7: // RETURN_RESULTS
return RETURN_RESULTS;
default:
return null;
}
@ -142,7 +147,9 @@ public class TIncrement implements org.apache.thrift.TBase<TIncrement, TIncremen
}
// isset id assignments
private static final _Fields optionals[] = {_Fields.ATTRIBUTES,_Fields.DURABILITY,_Fields.CELL_VISIBILITY};
private static final int __RETURNRESULTS_ISSET_ID = 0;
private byte __isset_bitfield = 0;
private static final _Fields optionals[] = {_Fields.ATTRIBUTES,_Fields.DURABILITY,_Fields.CELL_VISIBILITY,_Fields.RETURN_RESULTS};
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
@ -159,6 +166,8 @@ public class TIncrement implements org.apache.thrift.TBase<TIncrement, TIncremen
new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TDurability.class)));
tmpMap.put(_Fields.CELL_VISIBILITY, new org.apache.thrift.meta_data.FieldMetaData("cellVisibility", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TCellVisibility.class)));
tmpMap.put(_Fields.RETURN_RESULTS, new org.apache.thrift.meta_data.FieldMetaData("returnResults", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TIncrement.class, metaDataMap);
}
@ -179,6 +188,7 @@ public class TIncrement implements org.apache.thrift.TBase<TIncrement, TIncremen
* Performs a deep copy on <i>other</i>.
*/
public TIncrement(TIncrement other) {
__isset_bitfield = other.__isset_bitfield;
if (other.isSetRow()) {
this.row = org.apache.thrift.TBaseHelper.copyBinary(other.row);
}
@ -199,6 +209,7 @@ public class TIncrement implements org.apache.thrift.TBase<TIncrement, TIncremen
if (other.isSetCellVisibility()) {
this.cellVisibility = new TCellVisibility(other.cellVisibility);
}
this.returnResults = other.returnResults;
}
public TIncrement deepCopy() {
@ -212,6 +223,8 @@ public class TIncrement implements org.apache.thrift.TBase<TIncrement, TIncremen
this.attributes = null;
this.durability = null;
this.cellVisibility = null;
setReturnResultsIsSet(false);
this.returnResults = false;
}
public byte[] getRow() {
@ -378,6 +391,29 @@ public class TIncrement implements org.apache.thrift.TBase<TIncrement, TIncremen
}
}
public boolean isReturnResults() {
return this.returnResults;
}
public TIncrement setReturnResults(boolean returnResults) {
this.returnResults = returnResults;
setReturnResultsIsSet(true);
return this;
}
public void unsetReturnResults() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __RETURNRESULTS_ISSET_ID);
}
/** Returns true if field returnResults is set (has been assigned a value) and false otherwise */
public boolean isSetReturnResults() {
return EncodingUtils.testBit(__isset_bitfield, __RETURNRESULTS_ISSET_ID);
}
public void setReturnResultsIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __RETURNRESULTS_ISSET_ID, value);
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case ROW:
@ -420,6 +456,14 @@ public class TIncrement implements org.apache.thrift.TBase<TIncrement, TIncremen
}
break;
case RETURN_RESULTS:
if (value == null) {
unsetReturnResults();
} else {
setReturnResults((Boolean)value);
}
break;
}
}
@ -440,6 +484,9 @@ public class TIncrement implements org.apache.thrift.TBase<TIncrement, TIncremen
case CELL_VISIBILITY:
return getCellVisibility();
case RETURN_RESULTS:
return isReturnResults();
}
throw new IllegalStateException();
}
@ -461,6 +508,8 @@ public class TIncrement implements org.apache.thrift.TBase<TIncrement, TIncremen
return isSetDurability();
case CELL_VISIBILITY:
return isSetCellVisibility();
case RETURN_RESULTS:
return isSetReturnResults();
}
throw new IllegalStateException();
}
@ -523,6 +572,15 @@ public class TIncrement implements org.apache.thrift.TBase<TIncrement, TIncremen
return false;
}
boolean this_present_returnResults = true && this.isSetReturnResults();
boolean that_present_returnResults = true && that.isSetReturnResults();
if (this_present_returnResults || that_present_returnResults) {
if (!(this_present_returnResults && that_present_returnResults))
return false;
if (this.returnResults != that.returnResults)
return false;
}
return true;
}
@ -555,6 +613,11 @@ public class TIncrement implements org.apache.thrift.TBase<TIncrement, TIncremen
if (present_cellVisibility)
list.add(cellVisibility);
boolean present_returnResults = true && (isSetReturnResults());
list.add(present_returnResults);
if (present_returnResults)
list.add(returnResults);
return list.hashCode();
}
@ -616,6 +679,16 @@ public class TIncrement implements org.apache.thrift.TBase<TIncrement, TIncremen
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetReturnResults()).compareTo(other.isSetReturnResults());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetReturnResults()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.returnResults, other.returnResults);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
@ -681,6 +754,12 @@ public class TIncrement implements org.apache.thrift.TBase<TIncrement, TIncremen
}
first = false;
}
if (isSetReturnResults()) {
if (!first) sb.append(", ");
sb.append("returnResults:");
sb.append(this.returnResults);
first = false;
}
sb.append(")");
return sb.toString();
}
@ -709,6 +788,8 @@ public class TIncrement implements org.apache.thrift.TBase<TIncrement, TIncremen
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bitfield = 0;
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
@ -797,6 +878,14 @@ public class TIncrement implements org.apache.thrift.TBase<TIncrement, TIncremen
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 7: // RETURN_RESULTS
if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
struct.returnResults = iprot.readBool();
struct.setReturnResultsIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
@ -858,6 +947,11 @@ public class TIncrement implements org.apache.thrift.TBase<TIncrement, TIncremen
oprot.writeFieldEnd();
}
}
if (struct.isSetReturnResults()) {
oprot.writeFieldBegin(RETURN_RESULTS_FIELD_DESC);
oprot.writeBool(struct.returnResults);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
@ -893,7 +987,10 @@ public class TIncrement implements org.apache.thrift.TBase<TIncrement, TIncremen
if (struct.isSetCellVisibility()) {
optionals.set(2);
}
oprot.writeBitSet(optionals, 3);
if (struct.isSetReturnResults()) {
optionals.set(3);
}
oprot.writeBitSet(optionals, 4);
if (struct.isSetAttributes()) {
{
oprot.writeI32(struct.attributes.size());
@ -910,6 +1007,9 @@ public class TIncrement implements org.apache.thrift.TBase<TIncrement, TIncremen
if (struct.isSetCellVisibility()) {
struct.cellVisibility.write(oprot);
}
if (struct.isSetReturnResults()) {
oprot.writeBool(struct.returnResults);
}
}
@Override
@ -929,7 +1029,7 @@ public class TIncrement implements org.apache.thrift.TBase<TIncrement, TIncremen
}
}
struct.setColumnsIsSet(true);
BitSet incoming = iprot.readBitSet(3);
BitSet incoming = iprot.readBitSet(4);
if (incoming.get(0)) {
{
org.apache.thrift.protocol.TMap _map84 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32());
@ -954,6 +1054,10 @@ public class TIncrement implements org.apache.thrift.TBase<TIncrement, TIncremen
struct.cellVisibility.read(iprot);
struct.setCellVisibilityIsSet(true);
}
if (incoming.get(3)) {
struct.returnResults = iprot.readBool();
struct.setReturnResultsIsSet(true);
}
}
}

View File

@ -0,0 +1,63 @@
/**
* Autogenerated by Thrift Compiler (0.9.3)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package org.apache.hadoop.hbase.thrift2.generated;
import java.util.Map;
import java.util.HashMap;
import org.apache.thrift.TEnum;
public enum TKeepDeletedCells implements org.apache.thrift.TEnum {
/**
* Deleted Cells are not retained.
*/
FALSE(0),
/**
* Deleted Cells are retained until they are removed by other means
* such TTL or VERSIONS.
* If no TTL is specified or no new versions of delete cells are
* written, they are retained forever.
*/
TRUE(1),
/**
* Deleted Cells are retained until the delete marker expires due to TTL.
* This is useful when TTL is combined with MIN_VERSIONS and one
* wants to keep a minimum number of versions around but at the same
* time remove deleted cells after the TTL.
*/
TTL(2);
private final int value;
private TKeepDeletedCells(int value) {
this.value = value;
}
/**
* Get the integer value of this enum value, as defined in the Thrift IDL.
*/
public int getValue() {
return value;
}
/**
* Find a the enum type by its integer value, as defined in the Thrift IDL.
* @return null if the value is not found.
*/
public static TKeepDeletedCells findByValue(int value) {
switch (value) {
case 0:
return FALSE;
case 1:
return TRUE;
case 2:
return TTL;
default:
return null;
}
}
}

View File

@ -0,0 +1,554 @@
/**
* Autogenerated by Thrift Compiler (0.9.3)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package org.apache.hadoop.hbase.thrift2.generated;
import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;
import org.apache.thrift.scheme.TupleScheme;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.EncodingUtils;
import org.apache.thrift.TException;
import org.apache.thrift.async.AsyncMethodCallback;
import org.apache.thrift.server.AbstractNonblockingServer.*;
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 javax.annotation.Generated;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2018-12-27")
public class TNamespaceDescriptor implements org.apache.thrift.TBase<TNamespaceDescriptor, TNamespaceDescriptor._Fields>, java.io.Serializable, Cloneable, Comparable<TNamespaceDescriptor> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TNamespaceDescriptor");
private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.protocol.TField CONFIGURATION_FIELD_DESC = new org.apache.thrift.protocol.TField("configuration", org.apache.thrift.protocol.TType.MAP, (short)2);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new TNamespaceDescriptorStandardSchemeFactory());
schemes.put(TupleScheme.class, new TNamespaceDescriptorTupleSchemeFactory());
}
public String name; // required
public Map<String,String> configuration; // optional
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
NAME((short)1, "name"),
CONFIGURATION((short)2, "configuration");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // NAME
return NAME;
case 2: // CONFIGURATION
return CONFIGURATION;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
_Fields(short thriftId, String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final _Fields optionals[] = {_Fields.CONFIGURATION};
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.CONFIGURATION, new org.apache.thrift.meta_data.FieldMetaData("configuration", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING),
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TNamespaceDescriptor.class, metaDataMap);
}
public TNamespaceDescriptor() {
}
public TNamespaceDescriptor(
String name)
{
this();
this.name = name;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public TNamespaceDescriptor(TNamespaceDescriptor other) {
if (other.isSetName()) {
this.name = other.name;
}
if (other.isSetConfiguration()) {
Map<String,String> __this__configuration = new HashMap<String,String>(other.configuration);
this.configuration = __this__configuration;
}
}
public TNamespaceDescriptor deepCopy() {
return new TNamespaceDescriptor(this);
}
@Override
public void clear() {
this.name = null;
this.configuration = null;
}
public String getName() {
return this.name;
}
public TNamespaceDescriptor setName(String name) {
this.name = name;
return this;
}
public void unsetName() {
this.name = null;
}
/** Returns true if field name is set (has been assigned a value) and false otherwise */
public boolean isSetName() {
return this.name != null;
}
public void setNameIsSet(boolean value) {
if (!value) {
this.name = null;
}
}
public int getConfigurationSize() {
return (this.configuration == null) ? 0 : this.configuration.size();
}
public void putToConfiguration(String key, String val) {
if (this.configuration == null) {
this.configuration = new HashMap<String,String>();
}
this.configuration.put(key, val);
}
public Map<String,String> getConfiguration() {
return this.configuration;
}
public TNamespaceDescriptor setConfiguration(Map<String,String> configuration) {
this.configuration = configuration;
return this;
}
public void unsetConfiguration() {
this.configuration = null;
}
/** Returns true if field configuration is set (has been assigned a value) and false otherwise */
public boolean isSetConfiguration() {
return this.configuration != null;
}
public void setConfigurationIsSet(boolean value) {
if (!value) {
this.configuration = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case NAME:
if (value == null) {
unsetName();
} else {
setName((String)value);
}
break;
case CONFIGURATION:
if (value == null) {
unsetConfiguration();
} else {
setConfiguration((Map<String,String>)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case NAME:
return getName();
case CONFIGURATION:
return getConfiguration();
}
throw new IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case NAME:
return isSetName();
case CONFIGURATION:
return isSetConfiguration();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof TNamespaceDescriptor)
return this.equals((TNamespaceDescriptor)that);
return false;
}
public boolean equals(TNamespaceDescriptor that) {
if (that == null)
return false;
boolean this_present_name = true && this.isSetName();
boolean that_present_name = true && that.isSetName();
if (this_present_name || that_present_name) {
if (!(this_present_name && that_present_name))
return false;
if (!this.name.equals(that.name))
return false;
}
boolean this_present_configuration = true && this.isSetConfiguration();
boolean that_present_configuration = true && that.isSetConfiguration();
if (this_present_configuration || that_present_configuration) {
if (!(this_present_configuration && that_present_configuration))
return false;
if (!this.configuration.equals(that.configuration))
return false;
}
return true;
}
@Override
public int hashCode() {
List<Object> list = new ArrayList<Object>();
boolean present_name = true && (isSetName());
list.add(present_name);
if (present_name)
list.add(name);
boolean present_configuration = true && (isSetConfiguration());
list.add(present_configuration);
if (present_configuration)
list.add(configuration);
return list.hashCode();
}
@Override
public int compareTo(TNamespaceDescriptor other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetName()).compareTo(other.isSetName());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetName()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, other.name);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetConfiguration()).compareTo(other.isSetConfiguration());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetConfiguration()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.configuration, other.configuration);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("TNamespaceDescriptor(");
boolean first = true;
sb.append("name:");
if (this.name == null) {
sb.append("null");
} else {
sb.append(this.name);
}
first = false;
if (isSetConfiguration()) {
if (!first) sb.append(", ");
sb.append("configuration:");
if (this.configuration == null) {
sb.append("null");
} else {
sb.append(this.configuration);
}
first = false;
}
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
if (name == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'name' was not present! Struct: " + toString());
}
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class TNamespaceDescriptorStandardSchemeFactory implements SchemeFactory {
public TNamespaceDescriptorStandardScheme getScheme() {
return new TNamespaceDescriptorStandardScheme();
}
}
private static class TNamespaceDescriptorStandardScheme extends StandardScheme<TNamespaceDescriptor> {
public void read(org.apache.thrift.protocol.TProtocol iprot, TNamespaceDescriptor struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // NAME
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.name = iprot.readString();
struct.setNameIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // CONFIGURATION
if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
{
org.apache.thrift.protocol.TMap _map180 = iprot.readMapBegin();
struct.configuration = new HashMap<String,String>(2*_map180.size);
String _key181;
String _val182;
for (int _i183 = 0; _i183 < _map180.size; ++_i183)
{
_key181 = iprot.readString();
_val182 = iprot.readString();
struct.configuration.put(_key181, _val182);
}
iprot.readMapEnd();
}
struct.setConfigurationIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, TNamespaceDescriptor struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.name != null) {
oprot.writeFieldBegin(NAME_FIELD_DESC);
oprot.writeString(struct.name);
oprot.writeFieldEnd();
}
if (struct.configuration != null) {
if (struct.isSetConfiguration()) {
oprot.writeFieldBegin(CONFIGURATION_FIELD_DESC);
{
oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.configuration.size()));
for (Map.Entry<String, String> _iter184 : struct.configuration.entrySet())
{
oprot.writeString(_iter184.getKey());
oprot.writeString(_iter184.getValue());
}
oprot.writeMapEnd();
}
oprot.writeFieldEnd();
}
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class TNamespaceDescriptorTupleSchemeFactory implements SchemeFactory {
public TNamespaceDescriptorTupleScheme getScheme() {
return new TNamespaceDescriptorTupleScheme();
}
}
private static class TNamespaceDescriptorTupleScheme extends TupleScheme<TNamespaceDescriptor> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, TNamespaceDescriptor struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
oprot.writeString(struct.name);
BitSet optionals = new BitSet();
if (struct.isSetConfiguration()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetConfiguration()) {
{
oprot.writeI32(struct.configuration.size());
for (Map.Entry<String, String> _iter185 : struct.configuration.entrySet())
{
oprot.writeString(_iter185.getKey());
oprot.writeString(_iter185.getValue());
}
}
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, TNamespaceDescriptor struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
struct.name = iprot.readString();
struct.setNameIsSet(true);
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
{
org.apache.thrift.protocol.TMap _map186 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32());
struct.configuration = new HashMap<String,String>(2*_map186.size);
String _key187;
String _val188;
for (int _i189 = 0; _i189 < _map186.size; ++_i189)
{
_key187 = iprot.readString();
_val188 = iprot.readString();
struct.configuration.put(_key187, _val188);
}
}
struct.setConfigurationIsSet(true);
}
}
}
}

View File

@ -46,7 +46,7 @@ import org.slf4j.LoggerFactory;
* by changing the durability. If you don't provide durability, it defaults to
* column family's default setting for durability.
*/
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-25")
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2018-12-27")
public class TPut implements org.apache.thrift.TBase<TPut, TPut._Fields>, java.io.Serializable, Cloneable, Comparable<TPut> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TPut");

View File

@ -37,13 +37,14 @@ import org.slf4j.LoggerFactory;
/**
* if no Result is found, row and columnValues will not be set.
*/
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2018-07-04")
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2018-12-27")
public class TResult implements org.apache.thrift.TBase<TResult, TResult._Fields>, java.io.Serializable, Cloneable, Comparable<TResult> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TResult");
private static final org.apache.thrift.protocol.TField ROW_FIELD_DESC = new org.apache.thrift.protocol.TField("row", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.protocol.TField COLUMN_VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("columnValues", org.apache.thrift.protocol.TType.LIST, (short)2);
private static final org.apache.thrift.protocol.TField STALE_FIELD_DESC = new org.apache.thrift.protocol.TField("stale", org.apache.thrift.protocol.TType.BOOL, (short)3);
private static final org.apache.thrift.protocol.TField PARTIAL_FIELD_DESC = new org.apache.thrift.protocol.TField("partial", org.apache.thrift.protocol.TType.BOOL, (short)4);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
@ -54,12 +55,14 @@ public class TResult implements org.apache.thrift.TBase<TResult, TResult._Fields
public ByteBuffer row; // optional
public List<TColumnValue> columnValues; // required
public boolean stale; // optional
public boolean partial; // optional
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
ROW((short)1, "row"),
COLUMN_VALUES((short)2, "columnValues"),
STALE((short)3, "stale");
STALE((short)3, "stale"),
PARTIAL((short)4, "partial");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
@ -80,6 +83,8 @@ public class TResult implements org.apache.thrift.TBase<TResult, TResult._Fields
return COLUMN_VALUES;
case 3: // STALE
return STALE;
case 4: // PARTIAL
return PARTIAL;
default:
return null;
}
@ -121,8 +126,9 @@ public class TResult implements org.apache.thrift.TBase<TResult, TResult._Fields
// isset id assignments
private static final int __STALE_ISSET_ID = 0;
private static final int __PARTIAL_ISSET_ID = 1;
private byte __isset_bitfield = 0;
private static final _Fields optionals[] = {_Fields.ROW,_Fields.STALE};
private static final _Fields optionals[] = {_Fields.ROW,_Fields.STALE,_Fields.PARTIAL};
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
@ -133,6 +139,8 @@ public class TResult implements org.apache.thrift.TBase<TResult, TResult._Fields
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TColumnValue.class))));
tmpMap.put(_Fields.STALE, new org.apache.thrift.meta_data.FieldMetaData("stale", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
tmpMap.put(_Fields.PARTIAL, new org.apache.thrift.meta_data.FieldMetaData("partial", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TResult.class, metaDataMap);
}
@ -140,6 +148,8 @@ public class TResult implements org.apache.thrift.TBase<TResult, TResult._Fields
public TResult() {
this.stale = false;
this.partial = false;
}
public TResult(
@ -165,6 +175,7 @@ public class TResult implements org.apache.thrift.TBase<TResult, TResult._Fields
this.columnValues = __this__columnValues;
}
this.stale = other.stale;
this.partial = other.partial;
}
public TResult deepCopy() {
@ -177,6 +188,8 @@ public class TResult implements org.apache.thrift.TBase<TResult, TResult._Fields
this.columnValues = null;
this.stale = false;
this.partial = false;
}
public byte[] getRow() {
@ -275,6 +288,29 @@ public class TResult implements org.apache.thrift.TBase<TResult, TResult._Fields
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __STALE_ISSET_ID, value);
}
public boolean isPartial() {
return this.partial;
}
public TResult setPartial(boolean partial) {
this.partial = partial;
setPartialIsSet(true);
return this;
}
public void unsetPartial() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PARTIAL_ISSET_ID);
}
/** Returns true if field partial is set (has been assigned a value) and false otherwise */
public boolean isSetPartial() {
return EncodingUtils.testBit(__isset_bitfield, __PARTIAL_ISSET_ID);
}
public void setPartialIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PARTIAL_ISSET_ID, value);
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case ROW:
@ -301,6 +337,14 @@ public class TResult implements org.apache.thrift.TBase<TResult, TResult._Fields
}
break;
case PARTIAL:
if (value == null) {
unsetPartial();
} else {
setPartial((Boolean)value);
}
break;
}
}
@ -315,6 +359,9 @@ public class TResult implements org.apache.thrift.TBase<TResult, TResult._Fields
case STALE:
return isStale();
case PARTIAL:
return isPartial();
}
throw new IllegalStateException();
}
@ -332,6 +379,8 @@ public class TResult implements org.apache.thrift.TBase<TResult, TResult._Fields
return isSetColumnValues();
case STALE:
return isSetStale();
case PARTIAL:
return isSetPartial();
}
throw new IllegalStateException();
}
@ -376,6 +425,15 @@ public class TResult implements org.apache.thrift.TBase<TResult, TResult._Fields
return false;
}
boolean this_present_partial = true && this.isSetPartial();
boolean that_present_partial = true && that.isSetPartial();
if (this_present_partial || that_present_partial) {
if (!(this_present_partial && that_present_partial))
return false;
if (this.partial != that.partial)
return false;
}
return true;
}
@ -398,6 +456,11 @@ public class TResult implements org.apache.thrift.TBase<TResult, TResult._Fields
if (present_stale)
list.add(stale);
boolean present_partial = true && (isSetPartial());
list.add(present_partial);
if (present_partial)
list.add(partial);
return list.hashCode();
}
@ -439,6 +502,16 @@ public class TResult implements org.apache.thrift.TBase<TResult, TResult._Fields
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetPartial()).compareTo(other.isSetPartial());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetPartial()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.partial, other.partial);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
@ -482,6 +555,12 @@ public class TResult implements org.apache.thrift.TBase<TResult, TResult._Fields
sb.append(this.stale);
first = false;
}
if (isSetPartial()) {
if (!first) sb.append(", ");
sb.append("partial:");
sb.append(this.partial);
first = false;
}
sb.append(")");
return sb.toString();
}
@ -565,6 +644,14 @@ public class TResult implements org.apache.thrift.TBase<TResult, TResult._Fields
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 4: // PARTIAL
if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
struct.partial = iprot.readBool();
struct.setPartialIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
@ -604,6 +691,11 @@ public class TResult implements org.apache.thrift.TBase<TResult, TResult._Fields
oprot.writeBool(struct.stale);
oprot.writeFieldEnd();
}
if (struct.isSetPartial()) {
oprot.writeFieldBegin(PARTIAL_FIELD_DESC);
oprot.writeBool(struct.partial);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
@ -635,13 +727,19 @@ public class TResult implements org.apache.thrift.TBase<TResult, TResult._Fields
if (struct.isSetStale()) {
optionals.set(1);
}
oprot.writeBitSet(optionals, 2);
if (struct.isSetPartial()) {
optionals.set(2);
}
oprot.writeBitSet(optionals, 3);
if (struct.isSetRow()) {
oprot.writeBinary(struct.row);
}
if (struct.isSetStale()) {
oprot.writeBool(struct.stale);
}
if (struct.isSetPartial()) {
oprot.writeBool(struct.partial);
}
}
@Override
@ -659,7 +757,7 @@ public class TResult implements org.apache.thrift.TBase<TResult, TResult._Fields
}
}
struct.setColumnValuesIsSet(true);
BitSet incoming = iprot.readBitSet(2);
BitSet incoming = iprot.readBitSet(3);
if (incoming.get(0)) {
struct.row = iprot.readBinary();
struct.setRowIsSet(true);
@ -668,6 +766,10 @@ public class TResult implements org.apache.thrift.TBase<TResult, TResult._Fields
struct.stale = iprot.readBool();
struct.setStaleIsSet(true);
}
if (incoming.get(2)) {
struct.partial = iprot.readBool();
struct.setPartialIsSet(true);
}
}
}

View File

@ -37,7 +37,7 @@ import org.slf4j.LoggerFactory;
/**
* A TRowMutations object is used to apply a number of Mutations to a single row.
*/
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-25")
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2018-12-27")
public class TRowMutations implements org.apache.thrift.TBase<TRowMutations, TRowMutations._Fields>, java.io.Serializable, Cloneable, Comparable<TRowMutations> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TRowMutations");
@ -460,14 +460,14 @@ public class TRowMutations implements org.apache.thrift.TBase<TRowMutations, TRo
case 2: // MUTATIONS
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
{
org.apache.thrift.protocol.TList _list124 = iprot.readListBegin();
struct.mutations = new ArrayList<TMutation>(_list124.size);
TMutation _elem125;
for (int _i126 = 0; _i126 < _list124.size; ++_i126)
org.apache.thrift.protocol.TList _list134 = iprot.readListBegin();
struct.mutations = new ArrayList<TMutation>(_list134.size);
TMutation _elem135;
for (int _i136 = 0; _i136 < _list134.size; ++_i136)
{
_elem125 = new TMutation();
_elem125.read(iprot);
struct.mutations.add(_elem125);
_elem135 = new TMutation();
_elem135.read(iprot);
struct.mutations.add(_elem135);
}
iprot.readListEnd();
}
@ -500,9 +500,9 @@ public class TRowMutations implements org.apache.thrift.TBase<TRowMutations, TRo
oprot.writeFieldBegin(MUTATIONS_FIELD_DESC);
{
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.mutations.size()));
for (TMutation _iter127 : struct.mutations)
for (TMutation _iter137 : struct.mutations)
{
_iter127.write(oprot);
_iter137.write(oprot);
}
oprot.writeListEnd();
}
@ -528,9 +528,9 @@ public class TRowMutations implements org.apache.thrift.TBase<TRowMutations, TRo
oprot.writeBinary(struct.row);
{
oprot.writeI32(struct.mutations.size());
for (TMutation _iter128 : struct.mutations)
for (TMutation _iter138 : struct.mutations)
{
_iter128.write(oprot);
_iter138.write(oprot);
}
}
}
@ -541,14 +541,14 @@ public class TRowMutations implements org.apache.thrift.TBase<TRowMutations, TRo
struct.row = iprot.readBinary();
struct.setRowIsSet(true);
{
org.apache.thrift.protocol.TList _list129 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
struct.mutations = new ArrayList<TMutation>(_list129.size);
TMutation _elem130;
for (int _i131 = 0; _i131 < _list129.size; ++_i131)
org.apache.thrift.protocol.TList _list139 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
struct.mutations = new ArrayList<TMutation>(_list139.size);
TMutation _elem140;
for (int _i141 = 0; _i141 < _list139.size; ++_i141)
{
_elem130 = new TMutation();
_elem130.read(iprot);
struct.mutations.add(_elem130);
_elem140 = new TMutation();
_elem140.read(iprot);
struct.mutations.add(_elem140);
}
}
struct.setMutationsIsSet(true);

View File

@ -38,7 +38,7 @@ import org.slf4j.LoggerFactory;
* Any timestamps in the columns are ignored but the colFamTimeRangeMap included, use timeRange to select by timestamp.
* Max versions defaults to 1.
*/
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2018-07-03")
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2018-12-27")
public class TScan implements org.apache.thrift.TBase<TScan, TScan._Fields>, java.io.Serializable, Cloneable, Comparable<TScan> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TScan");

View File

@ -34,7 +34,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-25")
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2018-12-27")
public class TServerName implements org.apache.thrift.TBase<TServerName, TServerName._Fields>, java.io.Serializable, Cloneable, Comparable<TServerName> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TServerName");

View File

@ -0,0 +1,843 @@
/**
* Autogenerated by Thrift Compiler (0.9.3)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package org.apache.hadoop.hbase.thrift2.generated;
import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;
import org.apache.thrift.scheme.TupleScheme;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.EncodingUtils;
import org.apache.thrift.TException;
import org.apache.thrift.async.AsyncMethodCallback;
import org.apache.thrift.server.AbstractNonblockingServer.*;
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 javax.annotation.Generated;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2018-12-27")
public class TTableDescriptor implements org.apache.thrift.TBase<TTableDescriptor, TTableDescriptor._Fields>, java.io.Serializable, Cloneable, Comparable<TTableDescriptor> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TTableDescriptor");
private static final org.apache.thrift.protocol.TField TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tableName", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final org.apache.thrift.protocol.TField COLUMNS_FIELD_DESC = new org.apache.thrift.protocol.TField("columns", org.apache.thrift.protocol.TType.LIST, (short)2);
private static final org.apache.thrift.protocol.TField ATTRIBUTES_FIELD_DESC = new org.apache.thrift.protocol.TField("attributes", org.apache.thrift.protocol.TType.MAP, (short)3);
private static final org.apache.thrift.protocol.TField DURABILITY_FIELD_DESC = new org.apache.thrift.protocol.TField("durability", org.apache.thrift.protocol.TType.I32, (short)4);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new TTableDescriptorStandardSchemeFactory());
schemes.put(TupleScheme.class, new TTableDescriptorTupleSchemeFactory());
}
public TTableName tableName; // required
public List<TColumnFamilyDescriptor> columns; // optional
public Map<ByteBuffer,ByteBuffer> attributes; // optional
/**
*
* @see TDurability
*/
public TDurability durability; // optional
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
TABLE_NAME((short)1, "tableName"),
COLUMNS((short)2, "columns"),
ATTRIBUTES((short)3, "attributes"),
/**
*
* @see TDurability
*/
DURABILITY((short)4, "durability");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // TABLE_NAME
return TABLE_NAME;
case 2: // COLUMNS
return COLUMNS;
case 3: // ATTRIBUTES
return ATTRIBUTES;
case 4: // DURABILITY
return DURABILITY;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
_Fields(short thriftId, String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final _Fields optionals[] = {_Fields.COLUMNS,_Fields.ATTRIBUTES,_Fields.DURABILITY};
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.TABLE_NAME, new org.apache.thrift.meta_data.FieldMetaData("tableName", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TTableName.class)));
tmpMap.put(_Fields.COLUMNS, new org.apache.thrift.meta_data.FieldMetaData("columns", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TColumnFamilyDescriptor.class))));
tmpMap.put(_Fields.ATTRIBUTES, new org.apache.thrift.meta_data.FieldMetaData("attributes", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true),
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))));
tmpMap.put(_Fields.DURABILITY, new org.apache.thrift.meta_data.FieldMetaData("durability", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TDurability.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TTableDescriptor.class, metaDataMap);
}
public TTableDescriptor() {
}
public TTableDescriptor(
TTableName tableName)
{
this();
this.tableName = tableName;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public TTableDescriptor(TTableDescriptor other) {
if (other.isSetTableName()) {
this.tableName = new TTableName(other.tableName);
}
if (other.isSetColumns()) {
List<TColumnFamilyDescriptor> __this__columns = new ArrayList<TColumnFamilyDescriptor>(other.columns.size());
for (TColumnFamilyDescriptor other_element : other.columns) {
__this__columns.add(new TColumnFamilyDescriptor(other_element));
}
this.columns = __this__columns;
}
if (other.isSetAttributes()) {
Map<ByteBuffer,ByteBuffer> __this__attributes = new HashMap<ByteBuffer,ByteBuffer>(other.attributes);
this.attributes = __this__attributes;
}
if (other.isSetDurability()) {
this.durability = other.durability;
}
}
public TTableDescriptor deepCopy() {
return new TTableDescriptor(this);
}
@Override
public void clear() {
this.tableName = null;
this.columns = null;
this.attributes = null;
this.durability = null;
}
public TTableName getTableName() {
return this.tableName;
}
public TTableDescriptor setTableName(TTableName tableName) {
this.tableName = tableName;
return this;
}
public void unsetTableName() {
this.tableName = null;
}
/** Returns true if field tableName is set (has been assigned a value) and false otherwise */
public boolean isSetTableName() {
return this.tableName != null;
}
public void setTableNameIsSet(boolean value) {
if (!value) {
this.tableName = null;
}
}
public int getColumnsSize() {
return (this.columns == null) ? 0 : this.columns.size();
}
public java.util.Iterator<TColumnFamilyDescriptor> getColumnsIterator() {
return (this.columns == null) ? null : this.columns.iterator();
}
public void addToColumns(TColumnFamilyDescriptor elem) {
if (this.columns == null) {
this.columns = new ArrayList<TColumnFamilyDescriptor>();
}
this.columns.add(elem);
}
public List<TColumnFamilyDescriptor> getColumns() {
return this.columns;
}
public TTableDescriptor setColumns(List<TColumnFamilyDescriptor> columns) {
this.columns = columns;
return this;
}
public void unsetColumns() {
this.columns = null;
}
/** Returns true if field columns is set (has been assigned a value) and false otherwise */
public boolean isSetColumns() {
return this.columns != null;
}
public void setColumnsIsSet(boolean value) {
if (!value) {
this.columns = null;
}
}
public int getAttributesSize() {
return (this.attributes == null) ? 0 : this.attributes.size();
}
public void putToAttributes(ByteBuffer key, ByteBuffer val) {
if (this.attributes == null) {
this.attributes = new HashMap<ByteBuffer,ByteBuffer>();
}
this.attributes.put(key, val);
}
public Map<ByteBuffer,ByteBuffer> getAttributes() {
return this.attributes;
}
public TTableDescriptor setAttributes(Map<ByteBuffer,ByteBuffer> attributes) {
this.attributes = attributes;
return this;
}
public void unsetAttributes() {
this.attributes = null;
}
/** Returns true if field attributes is set (has been assigned a value) and false otherwise */
public boolean isSetAttributes() {
return this.attributes != null;
}
public void setAttributesIsSet(boolean value) {
if (!value) {
this.attributes = null;
}
}
/**
*
* @see TDurability
*/
public TDurability getDurability() {
return this.durability;
}
/**
*
* @see TDurability
*/
public TTableDescriptor setDurability(TDurability durability) {
this.durability = durability;
return this;
}
public void unsetDurability() {
this.durability = null;
}
/** Returns true if field durability is set (has been assigned a value) and false otherwise */
public boolean isSetDurability() {
return this.durability != null;
}
public void setDurabilityIsSet(boolean value) {
if (!value) {
this.durability = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case TABLE_NAME:
if (value == null) {
unsetTableName();
} else {
setTableName((TTableName)value);
}
break;
case COLUMNS:
if (value == null) {
unsetColumns();
} else {
setColumns((List<TColumnFamilyDescriptor>)value);
}
break;
case ATTRIBUTES:
if (value == null) {
unsetAttributes();
} else {
setAttributes((Map<ByteBuffer,ByteBuffer>)value);
}
break;
case DURABILITY:
if (value == null) {
unsetDurability();
} else {
setDurability((TDurability)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case TABLE_NAME:
return getTableName();
case COLUMNS:
return getColumns();
case ATTRIBUTES:
return getAttributes();
case DURABILITY:
return getDurability();
}
throw new IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case TABLE_NAME:
return isSetTableName();
case COLUMNS:
return isSetColumns();
case ATTRIBUTES:
return isSetAttributes();
case DURABILITY:
return isSetDurability();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof TTableDescriptor)
return this.equals((TTableDescriptor)that);
return false;
}
public boolean equals(TTableDescriptor that) {
if (that == null)
return false;
boolean this_present_tableName = true && this.isSetTableName();
boolean that_present_tableName = true && that.isSetTableName();
if (this_present_tableName || that_present_tableName) {
if (!(this_present_tableName && that_present_tableName))
return false;
if (!this.tableName.equals(that.tableName))
return false;
}
boolean this_present_columns = true && this.isSetColumns();
boolean that_present_columns = true && that.isSetColumns();
if (this_present_columns || that_present_columns) {
if (!(this_present_columns && that_present_columns))
return false;
if (!this.columns.equals(that.columns))
return false;
}
boolean this_present_attributes = true && this.isSetAttributes();
boolean that_present_attributes = true && that.isSetAttributes();
if (this_present_attributes || that_present_attributes) {
if (!(this_present_attributes && that_present_attributes))
return false;
if (!this.attributes.equals(that.attributes))
return false;
}
boolean this_present_durability = true && this.isSetDurability();
boolean that_present_durability = true && that.isSetDurability();
if (this_present_durability || that_present_durability) {
if (!(this_present_durability && that_present_durability))
return false;
if (!this.durability.equals(that.durability))
return false;
}
return true;
}
@Override
public int hashCode() {
List<Object> list = new ArrayList<Object>();
boolean present_tableName = true && (isSetTableName());
list.add(present_tableName);
if (present_tableName)
list.add(tableName);
boolean present_columns = true && (isSetColumns());
list.add(present_columns);
if (present_columns)
list.add(columns);
boolean present_attributes = true && (isSetAttributes());
list.add(present_attributes);
if (present_attributes)
list.add(attributes);
boolean present_durability = true && (isSetDurability());
list.add(present_durability);
if (present_durability)
list.add(durability.getValue());
return list.hashCode();
}
@Override
public int compareTo(TTableDescriptor other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetTableName()).compareTo(other.isSetTableName());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetTableName()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tableName, other.tableName);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetColumns()).compareTo(other.isSetColumns());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetColumns()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columns, other.columns);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetAttributes()).compareTo(other.isSetAttributes());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetAttributes()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.attributes, other.attributes);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetDurability()).compareTo(other.isSetDurability());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetDurability()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.durability, other.durability);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("TTableDescriptor(");
boolean first = true;
sb.append("tableName:");
if (this.tableName == null) {
sb.append("null");
} else {
sb.append(this.tableName);
}
first = false;
if (isSetColumns()) {
if (!first) sb.append(", ");
sb.append("columns:");
if (this.columns == null) {
sb.append("null");
} else {
sb.append(this.columns);
}
first = false;
}
if (isSetAttributes()) {
if (!first) sb.append(", ");
sb.append("attributes:");
if (this.attributes == null) {
sb.append("null");
} else {
sb.append(this.attributes);
}
first = false;
}
if (isSetDurability()) {
if (!first) sb.append(", ");
sb.append("durability:");
if (this.durability == null) {
sb.append("null");
} else {
sb.append(this.durability);
}
first = false;
}
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
if (tableName == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'tableName' was not present! Struct: " + toString());
}
// check for sub-struct validity
if (tableName != null) {
tableName.validate();
}
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class TTableDescriptorStandardSchemeFactory implements SchemeFactory {
public TTableDescriptorStandardScheme getScheme() {
return new TTableDescriptorStandardScheme();
}
}
private static class TTableDescriptorStandardScheme extends StandardScheme<TTableDescriptor> {
public void read(org.apache.thrift.protocol.TProtocol iprot, TTableDescriptor struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // TABLE_NAME
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.tableName = new TTableName();
struct.tableName.read(iprot);
struct.setTableNameIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // COLUMNS
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
{
org.apache.thrift.protocol.TList _list162 = iprot.readListBegin();
struct.columns = new ArrayList<TColumnFamilyDescriptor>(_list162.size);
TColumnFamilyDescriptor _elem163;
for (int _i164 = 0; _i164 < _list162.size; ++_i164)
{
_elem163 = new TColumnFamilyDescriptor();
_elem163.read(iprot);
struct.columns.add(_elem163);
}
iprot.readListEnd();
}
struct.setColumnsIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 3: // ATTRIBUTES
if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
{
org.apache.thrift.protocol.TMap _map165 = iprot.readMapBegin();
struct.attributes = new HashMap<ByteBuffer,ByteBuffer>(2*_map165.size);
ByteBuffer _key166;
ByteBuffer _val167;
for (int _i168 = 0; _i168 < _map165.size; ++_i168)
{
_key166 = iprot.readBinary();
_val167 = iprot.readBinary();
struct.attributes.put(_key166, _val167);
}
iprot.readMapEnd();
}
struct.setAttributesIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 4: // DURABILITY
if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
struct.durability = org.apache.hadoop.hbase.thrift2.generated.TDurability.findByValue(iprot.readI32());
struct.setDurabilityIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, TTableDescriptor struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.tableName != null) {
oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC);
struct.tableName.write(oprot);
oprot.writeFieldEnd();
}
if (struct.columns != null) {
if (struct.isSetColumns()) {
oprot.writeFieldBegin(COLUMNS_FIELD_DESC);
{
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.columns.size()));
for (TColumnFamilyDescriptor _iter169 : struct.columns)
{
_iter169.write(oprot);
}
oprot.writeListEnd();
}
oprot.writeFieldEnd();
}
}
if (struct.attributes != null) {
if (struct.isSetAttributes()) {
oprot.writeFieldBegin(ATTRIBUTES_FIELD_DESC);
{
oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.attributes.size()));
for (Map.Entry<ByteBuffer, ByteBuffer> _iter170 : struct.attributes.entrySet())
{
oprot.writeBinary(_iter170.getKey());
oprot.writeBinary(_iter170.getValue());
}
oprot.writeMapEnd();
}
oprot.writeFieldEnd();
}
}
if (struct.durability != null) {
if (struct.isSetDurability()) {
oprot.writeFieldBegin(DURABILITY_FIELD_DESC);
oprot.writeI32(struct.durability.getValue());
oprot.writeFieldEnd();
}
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class TTableDescriptorTupleSchemeFactory implements SchemeFactory {
public TTableDescriptorTupleScheme getScheme() {
return new TTableDescriptorTupleScheme();
}
}
private static class TTableDescriptorTupleScheme extends TupleScheme<TTableDescriptor> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, TTableDescriptor struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
struct.tableName.write(oprot);
BitSet optionals = new BitSet();
if (struct.isSetColumns()) {
optionals.set(0);
}
if (struct.isSetAttributes()) {
optionals.set(1);
}
if (struct.isSetDurability()) {
optionals.set(2);
}
oprot.writeBitSet(optionals, 3);
if (struct.isSetColumns()) {
{
oprot.writeI32(struct.columns.size());
for (TColumnFamilyDescriptor _iter171 : struct.columns)
{
_iter171.write(oprot);
}
}
}
if (struct.isSetAttributes()) {
{
oprot.writeI32(struct.attributes.size());
for (Map.Entry<ByteBuffer, ByteBuffer> _iter172 : struct.attributes.entrySet())
{
oprot.writeBinary(_iter172.getKey());
oprot.writeBinary(_iter172.getValue());
}
}
}
if (struct.isSetDurability()) {
oprot.writeI32(struct.durability.getValue());
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, TTableDescriptor struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
struct.tableName = new TTableName();
struct.tableName.read(iprot);
struct.setTableNameIsSet(true);
BitSet incoming = iprot.readBitSet(3);
if (incoming.get(0)) {
{
org.apache.thrift.protocol.TList _list173 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
struct.columns = new ArrayList<TColumnFamilyDescriptor>(_list173.size);
TColumnFamilyDescriptor _elem174;
for (int _i175 = 0; _i175 < _list173.size; ++_i175)
{
_elem174 = new TColumnFamilyDescriptor();
_elem174.read(iprot);
struct.columns.add(_elem174);
}
}
struct.setColumnsIsSet(true);
}
if (incoming.get(1)) {
{
org.apache.thrift.protocol.TMap _map176 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32());
struct.attributes = new HashMap<ByteBuffer,ByteBuffer>(2*_map176.size);
ByteBuffer _key177;
ByteBuffer _val178;
for (int _i179 = 0; _i179 < _map176.size; ++_i179)
{
_key177 = iprot.readBinary();
_val178 = iprot.readBinary();
struct.attributes.put(_key177, _val178);
}
}
struct.setAttributesIsSet(true);
}
if (incoming.get(2)) {
struct.durability = org.apache.hadoop.hbase.thrift2.generated.TDurability.findByValue(iprot.readI32());
struct.setDurabilityIsSet(true);
}
}
}
}

View File

@ -0,0 +1,512 @@
/**
* Autogenerated by Thrift Compiler (0.9.3)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package org.apache.hadoop.hbase.thrift2.generated;
import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;
import org.apache.thrift.scheme.TupleScheme;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.EncodingUtils;
import org.apache.thrift.TException;
import org.apache.thrift.async.AsyncMethodCallback;
import org.apache.thrift.server.AbstractNonblockingServer.*;
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 javax.annotation.Generated;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2018-12-27")
public class TTableName implements org.apache.thrift.TBase<TTableName, TTableName._Fields>, java.io.Serializable, Cloneable, Comparable<TTableName> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TTableName");
private static final org.apache.thrift.protocol.TField NS_FIELD_DESC = new org.apache.thrift.protocol.TField("ns", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.protocol.TField QUALIFIER_FIELD_DESC = new org.apache.thrift.protocol.TField("qualifier", org.apache.thrift.protocol.TType.STRING, (short)2);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new TTableNameStandardSchemeFactory());
schemes.put(TupleScheme.class, new TTableNameTupleSchemeFactory());
}
public ByteBuffer ns; // required
public ByteBuffer qualifier; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
NS((short)1, "ns"),
QUALIFIER((short)2, "qualifier");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // NS
return NS;
case 2: // QUALIFIER
return QUALIFIER;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
_Fields(short thriftId, String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.NS, new org.apache.thrift.meta_data.FieldMetaData("ns", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)));
tmpMap.put(_Fields.QUALIFIER, new org.apache.thrift.meta_data.FieldMetaData("qualifier", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TTableName.class, metaDataMap);
}
public TTableName() {
}
public TTableName(
ByteBuffer ns,
ByteBuffer qualifier)
{
this();
this.ns = org.apache.thrift.TBaseHelper.copyBinary(ns);
this.qualifier = org.apache.thrift.TBaseHelper.copyBinary(qualifier);
}
/**
* Performs a deep copy on <i>other</i>.
*/
public TTableName(TTableName other) {
if (other.isSetNs()) {
this.ns = org.apache.thrift.TBaseHelper.copyBinary(other.ns);
}
if (other.isSetQualifier()) {
this.qualifier = org.apache.thrift.TBaseHelper.copyBinary(other.qualifier);
}
}
public TTableName deepCopy() {
return new TTableName(this);
}
@Override
public void clear() {
this.ns = null;
this.qualifier = null;
}
public byte[] getNs() {
setNs(org.apache.thrift.TBaseHelper.rightSize(ns));
return ns == null ? null : ns.array();
}
public ByteBuffer bufferForNs() {
return org.apache.thrift.TBaseHelper.copyBinary(ns);
}
public TTableName setNs(byte[] ns) {
this.ns = ns == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(ns, ns.length));
return this;
}
public TTableName setNs(ByteBuffer ns) {
this.ns = org.apache.thrift.TBaseHelper.copyBinary(ns);
return this;
}
public void unsetNs() {
this.ns = null;
}
/** Returns true if field ns is set (has been assigned a value) and false otherwise */
public boolean isSetNs() {
return this.ns != null;
}
public void setNsIsSet(boolean value) {
if (!value) {
this.ns = null;
}
}
public byte[] getQualifier() {
setQualifier(org.apache.thrift.TBaseHelper.rightSize(qualifier));
return qualifier == null ? null : qualifier.array();
}
public ByteBuffer bufferForQualifier() {
return org.apache.thrift.TBaseHelper.copyBinary(qualifier);
}
public TTableName setQualifier(byte[] qualifier) {
this.qualifier = qualifier == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(qualifier, qualifier.length));
return this;
}
public TTableName setQualifier(ByteBuffer qualifier) {
this.qualifier = org.apache.thrift.TBaseHelper.copyBinary(qualifier);
return this;
}
public void unsetQualifier() {
this.qualifier = null;
}
/** Returns true if field qualifier is set (has been assigned a value) and false otherwise */
public boolean isSetQualifier() {
return this.qualifier != null;
}
public void setQualifierIsSet(boolean value) {
if (!value) {
this.qualifier = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case NS:
if (value == null) {
unsetNs();
} else {
setNs((ByteBuffer)value);
}
break;
case QUALIFIER:
if (value == null) {
unsetQualifier();
} else {
setQualifier((ByteBuffer)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case NS:
return getNs();
case QUALIFIER:
return getQualifier();
}
throw new IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case NS:
return isSetNs();
case QUALIFIER:
return isSetQualifier();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof TTableName)
return this.equals((TTableName)that);
return false;
}
public boolean equals(TTableName that) {
if (that == null)
return false;
boolean this_present_ns = true && this.isSetNs();
boolean that_present_ns = true && that.isSetNs();
if (this_present_ns || that_present_ns) {
if (!(this_present_ns && that_present_ns))
return false;
if (!this.ns.equals(that.ns))
return false;
}
boolean this_present_qualifier = true && this.isSetQualifier();
boolean that_present_qualifier = true && that.isSetQualifier();
if (this_present_qualifier || that_present_qualifier) {
if (!(this_present_qualifier && that_present_qualifier))
return false;
if (!this.qualifier.equals(that.qualifier))
return false;
}
return true;
}
@Override
public int hashCode() {
List<Object> list = new ArrayList<Object>();
boolean present_ns = true && (isSetNs());
list.add(present_ns);
if (present_ns)
list.add(ns);
boolean present_qualifier = true && (isSetQualifier());
list.add(present_qualifier);
if (present_qualifier)
list.add(qualifier);
return list.hashCode();
}
@Override
public int compareTo(TTableName other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetNs()).compareTo(other.isSetNs());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetNs()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ns, other.ns);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetQualifier()).compareTo(other.isSetQualifier());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetQualifier()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.qualifier, other.qualifier);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("TTableName(");
boolean first = true;
sb.append("ns:");
if (this.ns == null) {
sb.append("null");
} else {
org.apache.thrift.TBaseHelper.toString(this.ns, sb);
}
first = false;
if (!first) sb.append(", ");
sb.append("qualifier:");
if (this.qualifier == null) {
sb.append("null");
} else {
org.apache.thrift.TBaseHelper.toString(this.qualifier, sb);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
if (ns == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'ns' was not present! Struct: " + toString());
}
if (qualifier == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'qualifier' was not present! Struct: " + toString());
}
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class TTableNameStandardSchemeFactory implements SchemeFactory {
public TTableNameStandardScheme getScheme() {
return new TTableNameStandardScheme();
}
}
private static class TTableNameStandardScheme extends StandardScheme<TTableName> {
public void read(org.apache.thrift.protocol.TProtocol iprot, TTableName struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // NS
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.ns = iprot.readBinary();
struct.setNsIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // QUALIFIER
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.qualifier = iprot.readBinary();
struct.setQualifierIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, TTableName struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.ns != null) {
oprot.writeFieldBegin(NS_FIELD_DESC);
oprot.writeBinary(struct.ns);
oprot.writeFieldEnd();
}
if (struct.qualifier != null) {
oprot.writeFieldBegin(QUALIFIER_FIELD_DESC);
oprot.writeBinary(struct.qualifier);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class TTableNameTupleSchemeFactory implements SchemeFactory {
public TTableNameTupleScheme getScheme() {
return new TTableNameTupleScheme();
}
}
private static class TTableNameTupleScheme extends TupleScheme<TTableName> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, TTableName struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
oprot.writeBinary(struct.ns);
oprot.writeBinary(struct.qualifier);
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, TTableName struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
struct.ns = iprot.readBinary();
struct.setNsIsSet(true);
struct.qualifier = iprot.readBinary();
struct.setQualifierIsSet(true);
}
}
}

View File

@ -34,7 +34,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-25")
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2018-12-27")
public class TTimeRange implements org.apache.thrift.TBase<TTimeRange, TTimeRange._Fields>, java.io.Serializable, Cloneable, Comparable<TTimeRange> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TTimeRange");

View File

@ -48,7 +48,8 @@ struct TColumnValue {
2: required binary qualifier,
3: required binary value,
4: optional i64 timestamp,
5: optional binary tags
5: optional binary tags,
6: optional byte type
}
/**
@ -67,6 +68,7 @@ struct TResult {
1: optional binary row,
2: required list<TColumnValue> columnValues,
3: optional bool stale = false
4: optional bool partial = false
}
/**
@ -90,6 +92,7 @@ enum TDeleteType {
*/
enum TDurability {
USE_DEFAULT = 0,
SKIP_WAL = 1,
ASYNC_WAL = 2,
SYNC_WAL = 3,
@ -139,6 +142,11 @@ struct TGet {
8: optional TAuthorization authorizations
9: optional TConsistency consistency
10: optional i32 targetReplicaId
11: optional bool cacheBlocks
12: optional i32 storeLimit
13: optional i32 storeOffset
14: optional bool existence_only
}
/**
@ -211,6 +219,7 @@ struct TIncrement {
4: optional map<binary, binary> attributes,
5: optional TDurability durability
6: optional TCellVisibility cellVisibility
7: optional bool returnResults
}
/*
@ -222,6 +231,7 @@ struct TAppend {
3: optional map<binary, binary> attributes,
4: optional TDurability durability
5: optional TCellVisibility cellVisibility
6: optional bool returnResults
}
enum TReadType {
@ -258,8 +268,8 @@ struct TScan {
* Atomic mutation for the specified row. It can be either Put or Delete.
*/
union TMutation {
1: TPut put,
2: TDelete deleteSingle,
1: TPut put
2: TDelete deleteSingle
}
/**
@ -305,6 +315,112 @@ enum TCompareOp {
NO_OP = 6
}
enum TBloomFilterType {
/**
* Bloomfilters disabled
*/
NONE = 0,
/**
* Bloom enabled with Table row as Key
*/
ROW = 1,
/**
* Bloom enabled with Table row &amp; column (family+qualifier) as Key
*/
ROWCOL = 2,
/**
* Bloom enabled with Table row prefix as Key, specify the length of the prefix
*/
ROWPREFIX_FIXED_LENGTH = 3,
/**
* Bloom enabled with Table row prefix as Key, specify the delimiter of the prefix
*/
ROWPREFIX_DELIMITED = 4
}
enum TCompressionAlgorithm {
LZO = 0,
GZ = 1,
NONE = 2,
SNAPPY = 3,
LZ4 = 4,
BZIP2 = 5,
ZSTD = 6
}
enum TDataBlockEncoding {
/** Disable data block encoding. */
NONE = 0,
// id 1 is reserved for the BITSET algorithm to be added later
PREFIX = 2,
DIFF = 3,
FAST_DIFF = 4,
// id 5 is reserved for the COPY_KEY algorithm for benchmarking
// COPY_KEY(5, "org.apache.hadoop.hbase.io.encoding.CopyKeyDataBlockEncoder"),
// PREFIX_TREE(6, "org.apache.hadoop.hbase.codec.prefixtree.PrefixTreeCodec"),
ROW_INDEX_V1 = 7
}
enum TKeepDeletedCells {
/** Deleted Cells are not retained. */
FALSE = 0,
/**
* Deleted Cells are retained until they are removed by other means
* such TTL or VERSIONS.
* If no TTL is specified or no new versions of delete cells are
* written, they are retained forever.
*/
TRUE = 1,
/**
* Deleted Cells are retained until the delete marker expires due to TTL.
* This is useful when TTL is combined with MIN_VERSIONS and one
* wants to keep a minimum number of versions around but at the same
* time remove deleted cells after the TTL.
*/
TTL = 2
}
struct TTableName {
1: required binary ns
2: required binary qualifier
}
struct TColumnFamilyDescriptor {
1: required binary name
2: optional map<binary, binary> attributes
3: optional map<string, string> configuration
4: optional i32 blockSize
5: optional TBloomFilterType bloomnFilterType
6: optional TCompressionAlgorithm compressionType
7: optional i16 dfsReplication
8: optional TDataBlockEncoding dataBlockEncoding
9: optional TKeepDeletedCells keepDeletedCells
10: optional i32 maxVersions
11: optional i32 minVersions
12: optional i32 scope
13: optional i32 timeToLive
14: optional bool blockCacheEnabled
15: optional bool cacheBloomsOnWrite
16: optional bool cacheDataOnWrite
17: optional bool cacheIndexesOnWrite
18: optional bool compressTags
19: optional bool evictBlocksOnClose
20: optional bool inMemory
}
struct TTableDescriptor {
1: required TTableName tableName
2: optional list<TColumnFamilyDescriptor> columns
3: optional map<binary, binary> attributes
4: optional TDurability durability
}
struct TNamespaceDescriptor {
1: required string name
2: optional map<string, string> configuration
}
//
// Exceptions
@ -644,4 +760,111 @@ service THBaseService {
/** row mutations to execute if the value matches */
7: required TRowMutations rowMutations
) throws (1: TIOError io)
TTableDescriptor getTableDescriptor(
1: required TTableName table
) throws (1: TIOError io)
list<TTableDescriptor> getTableDescriptors(
1: required list<TTableName> tables
) throws (1: TIOError io)
bool tableExists(
1: TTableName tableName
) throws (1: TIOError io)
list<TTableDescriptor> getTableDescriptorsByPattern(
1: required string regex
2: required bool includeSysTables
) throws (1: TIOError io)
list<TTableDescriptor> getTableDescriptorsByNamespace(
1: required string name
) throws (1: TIOError io)
list<TTableName> getTableNamesByPattern(
1: required string regex
2: required bool includeSysTables
) throws (1: TIOError io)
list<TTableName> getTableNamesByNamespace(
1: required string name
) throws (1: TIOError io)
void createTable(
1: required TTableDescriptor desc
2: required list<binary> splitKeys
) throws (1: TIOError io)
void deleteTable(
1: required TTableName tableName
) throws (1: TIOError io)
void truncateTable(
1: required TTableName tableName
2: required bool preserveSplits
) throws (1: TIOError io)
void enableTable(
1: required TTableName tableName
) throws (1: TIOError io)
void disableTable(
1: required TTableName tableName
) throws (1: TIOError io)
bool isTableEnabled(
1: required TTableName tableName
) throws (1: TIOError io)
bool isTableDisabled(
1: required TTableName tableName
) throws (1: TIOError io)
bool isTableAvailable(
1: required TTableName tableName
) throws (1: TIOError io)
bool isTableAvailableWithSplit(
1: required TTableName tableName
2: required list<binary> splitKeys
) throws (1: TIOError io)
void addColumnFamily(
1: required TTableName tableName
2: required TColumnFamilyDescriptor column
) throws (1: TIOError io)
void deleteColumnFamily(
1: required TTableName tableName
2: required binary column
) throws (1: TIOError io)
void modifyColumnFamily(
1: required TTableName tableName
2: required TColumnFamilyDescriptor column
) throws (1: TIOError io)
void modifyTable(
1: required TTableDescriptor desc
) throws (1: TIOError io)
void createNamespace(
1: required TNamespaceDescriptor namespaceDesc
) throws (1: TIOError io)
void modifyNamespace(
1: required TNamespaceDescriptor namespaceDesc
) throws (1: TIOError io)
void deleteNamespace(
1: required string name
) throws (1: TIOError io)
TNamespaceDescriptor getNamespaceDescriptor(
1: required string name
) throws (1: TIOError io)
list<TNamespaceDescriptor> listNamespaceDescriptors(
) throws (1: TIOError io)
}

View File

@ -60,6 +60,7 @@ import org.apache.hadoop.hbase.client.Increment;
import org.apache.hadoop.hbase.client.Put;
import org.apache.hadoop.hbase.client.Scan;
import org.apache.hadoop.hbase.client.Table;
import org.apache.hadoop.hbase.client.TableDescriptor;
import org.apache.hadoop.hbase.coprocessor.ObserverContext;
import org.apache.hadoop.hbase.coprocessor.RegionCoprocessor;
import org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment;
@ -73,10 +74,12 @@ import org.apache.hadoop.hbase.thrift.ErrorThrowingGetObserver;
import org.apache.hadoop.hbase.thrift.ThriftMetrics;
import org.apache.hadoop.hbase.thrift2.generated.TAppend;
import org.apache.hadoop.hbase.thrift2.generated.TColumn;
import org.apache.hadoop.hbase.thrift2.generated.TColumnFamilyDescriptor;
import org.apache.hadoop.hbase.thrift2.generated.TColumnIncrement;
import org.apache.hadoop.hbase.thrift2.generated.TColumnValue;
import org.apache.hadoop.hbase.thrift2.generated.TCompareOp;
import org.apache.hadoop.hbase.thrift2.generated.TConsistency;
import org.apache.hadoop.hbase.thrift2.generated.TDataBlockEncoding;
import org.apache.hadoop.hbase.thrift2.generated.TDelete;
import org.apache.hadoop.hbase.thrift2.generated.TDeleteType;
import org.apache.hadoop.hbase.thrift2.generated.TDurability;
@ -86,11 +89,14 @@ import org.apache.hadoop.hbase.thrift2.generated.TIOError;
import org.apache.hadoop.hbase.thrift2.generated.TIllegalArgument;
import org.apache.hadoop.hbase.thrift2.generated.TIncrement;
import org.apache.hadoop.hbase.thrift2.generated.TMutation;
import org.apache.hadoop.hbase.thrift2.generated.TNamespaceDescriptor;
import org.apache.hadoop.hbase.thrift2.generated.TPut;
import org.apache.hadoop.hbase.thrift2.generated.TReadType;
import org.apache.hadoop.hbase.thrift2.generated.TResult;
import org.apache.hadoop.hbase.thrift2.generated.TRowMutations;
import org.apache.hadoop.hbase.thrift2.generated.TScan;
import org.apache.hadoop.hbase.thrift2.generated.TTableDescriptor;
import org.apache.hadoop.hbase.thrift2.generated.TTableName;
import org.apache.hadoop.hbase.thrift2.generated.TTimeRange;
import org.apache.hadoop.hbase.util.Bytes;
import org.apache.thrift.TException;
@ -1592,6 +1598,96 @@ public class TestThriftHBaseServiceHandler {
assertTrue(tResult.isSetStale());
}
@Test
public void testDDLOpertions() throws Exception {
String namespace = "testDDLOpertionsNamespace";
String table = "testDDLOpertionsTable";
TTableName tTableName = new TTableName();
tTableName.setNs(Bytes.toBytes(namespace));
tTableName.setQualifier(Bytes.toBytes(table));
ThriftHBaseServiceHandler handler = createHandler();
//create name space
TNamespaceDescriptor namespaceDescriptor = new TNamespaceDescriptor();
namespaceDescriptor.setName(namespace);
namespaceDescriptor.putToConfiguration("key1", "value1");
namespaceDescriptor.putToConfiguration("key2", "value2");
handler.createNamespace(namespaceDescriptor);
//list namespace
List<TNamespaceDescriptor> namespaceDescriptors = handler.listNamespaceDescriptors();
// should have 3 namespace, default hbase and testDDLOpertionsNamespace
assertTrue(namespaceDescriptors.size() == 3);
//modify namesapce
namespaceDescriptor.putToConfiguration("kye3", "value3");
handler.modifyNamespace(namespaceDescriptor);
//get namespace
TNamespaceDescriptor namespaceDescriptorReturned = handler.getNamespaceDescriptor(namespace);
assertTrue(namespaceDescriptorReturned.getConfiguration().size() == 3);
//create table
TTableDescriptor tableDescriptor = new TTableDescriptor();
tableDescriptor.setTableName(tTableName);
TColumnFamilyDescriptor columnFamilyDescriptor1 = new TColumnFamilyDescriptor();
columnFamilyDescriptor1.setName(familyAname);
columnFamilyDescriptor1.setDataBlockEncoding(TDataBlockEncoding.DIFF);
tableDescriptor.addToColumns(columnFamilyDescriptor1);
List<ByteBuffer> splitKeys = new ArrayList<>();
splitKeys.add(ByteBuffer.wrap(Bytes.toBytes(5)));
handler.createTable(tableDescriptor, splitKeys);
//modify table
tableDescriptor.setDurability(TDurability.ASYNC_WAL);
handler.modifyTable(tableDescriptor);
//modify column family
columnFamilyDescriptor1.setInMemory(true);
handler.modifyColumnFamily(tTableName, columnFamilyDescriptor1);
//add column family
TColumnFamilyDescriptor columnFamilyDescriptor2 = new TColumnFamilyDescriptor();
columnFamilyDescriptor2.setName(familyBname);
columnFamilyDescriptor2.setDataBlockEncoding(TDataBlockEncoding.PREFIX);
handler.addColumnFamily(tTableName, columnFamilyDescriptor2);
//get table descriptor
TTableDescriptor tableDescriptorReturned = handler.getTableDescriptor(tTableName);
assertTrue(tableDescriptorReturned.getColumns().size() == 2);
assertTrue(tableDescriptorReturned.getDurability() == TDurability.ASYNC_WAL);
TColumnFamilyDescriptor columnFamilyDescriptor1Returned = tableDescriptorReturned.getColumns()
.stream().filter(desc -> Bytes.equals(desc.getName(), familyAname)).findFirst().get();
assertTrue(columnFamilyDescriptor1Returned.isInMemory() == true);
//delete column family
handler.deleteColumnFamily(tTableName, ByteBuffer.wrap(familyBname));
tableDescriptorReturned = handler.getTableDescriptor(tTableName);
assertTrue(tableDescriptorReturned.getColumns().size() == 1);
//disable table
handler.disableTable(tTableName);
assertTrue(handler.isTableDisabled(tTableName));
//enable table
handler.enableTable(tTableName);
assertTrue(handler.isTableEnabled(tTableName));
assertTrue(handler.isTableAvailable(tTableName));
//truncate table
handler.disableTable(tTableName);
handler.truncateTable(tTableName, true);
assertTrue(handler.isTableAvailable(tTableName));
//delete table
handler.disableTable(tTableName);
handler.deleteTable(tTableName);
assertFalse(handler.tableExists(tTableName));
//delete namespace
handler.deleteNamespace(namespace);
namespaceDescriptors = handler.listNamespaceDescriptors();
// should have 2 namespace, default and hbase
assertTrue(namespaceDescriptors.size() == 2);
}
@Test
public void testGetTableDescriptor() throws Exception {
ThriftHBaseServiceHandler handler = createHandler();
TTableDescriptor tableDescriptor = handler
.getTableDescriptor(ThriftUtilities.tableNameFromHBase(TableName.valueOf(tableAname)));
TableDescriptor table = ThriftUtilities.tableDescriptorFromThrift(tableDescriptor);
assertTrue(table.getTableName().equals(TableName.valueOf(tableAname)));
assertTrue(table.getColumnFamilies().length == 2);
assertTrue(table.getColumnFamily(familyAname).getMaxVersions() == 3);
assertTrue(table.getColumnFamily(familyBname).getMaxVersions() == 2);
}
public static class DelayingRegionObserver implements RegionCoprocessor, RegionObserver {
private static final Logger LOG = LoggerFactory.getLogger(DelayingRegionObserver.class);
// sleep time in msec