You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by al...@apache.org on 2018/12/27 14:26:23 UTC
[7/7] hbase git commit: HBASE-21650 Add DDL operation and some other
miscellaneous to thrift2
HBASE-21650 Add DDL operation and some other miscellaneous to thrift2
Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/7820ba1d
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/7820ba1d
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/7820ba1d
Branch: refs/heads/master
Commit: 7820ba1dbdba58b1002cdfde08eb21aa7a0bb6da
Parents: f5ea00f
Author: Allan Yang <al...@apache.org>
Authored: Thu Dec 27 22:25:33 2018 +0800
Committer: Allan Yang <al...@apache.org>
Committed: Thu Dec 27 22:25:33 2018 +0800
----------------------------------------------------------------------
.../hbase/thrift/generated/AlreadyExists.java | 2 +-
.../hbase/thrift/generated/BatchMutation.java | 2 +-
.../thrift/generated/ColumnDescriptor.java | 2 +-
.../hadoop/hbase/thrift/generated/Hbase.java | 2 +-
.../hadoop/hbase/thrift/generated/IOError.java | 2 +-
.../hbase/thrift/generated/IllegalArgument.java | 2 +-
.../hadoop/hbase/thrift/generated/Mutation.java | 2 +-
.../hadoop/hbase/thrift/generated/TAppend.java | 2 +-
.../hadoop/hbase/thrift/generated/TCell.java | 2 +-
.../hadoop/hbase/thrift/generated/TColumn.java | 2 +-
.../hbase/thrift/generated/TIncrement.java | 2 +-
.../hbase/thrift/generated/TRegionInfo.java | 2 +-
.../hbase/thrift/generated/TRowResult.java | 2 +-
.../hadoop/hbase/thrift/generated/TScan.java | 2 +-
.../thrift2/ThriftHBaseServiceHandler.java | 290 +
.../hadoop/hbase/thrift2/ThriftUtilities.java | 411 +-
.../thrift2/generated/NamespaceDescriptor.java | 554 +
.../hadoop/hbase/thrift2/generated/TAppend.java | 114 +-
.../hbase/thrift2/generated/TAuthorization.java | 2 +-
.../thrift2/generated/TBloomFilterType.java | 69 +
.../thrift2/generated/TCellVisibility.java | 2 +-
.../hadoop/hbase/thrift2/generated/TColumn.java | 2 +-
.../generated/TColumnFamilyDescriptor.java | 2519 +
.../thrift2/generated/TColumnIncrement.java | 2 +-
.../hbase/thrift2/generated/TColumnValue.java | 110 +-
.../generated/TCompressionAlgorithm.java | 60 +
.../thrift2/generated/TDataBlockEncoding.java | 57 +
.../hadoop/hbase/thrift2/generated/TDelete.java | 2 +-
.../hbase/thrift2/generated/TDurability.java | 3 +
.../hadoop/hbase/thrift2/generated/TGet.java | 410 +-
.../hbase/thrift2/generated/THBaseService.java | 44644 +++++++++++++----
.../hbase/thrift2/generated/THRegionInfo.java | 2 +-
.../thrift2/generated/THRegionLocation.java | 2 +-
.../hbase/thrift2/generated/TIOError.java | 2 +-
.../thrift2/generated/TIllegalArgument.java | 2 +-
.../hbase/thrift2/generated/TIncrement.java | 114 +-
.../thrift2/generated/TKeepDeletedCells.java | 63 +
.../thrift2/generated/TNamespaceDescriptor.java | 554 +
.../hadoop/hbase/thrift2/generated/TPut.java | 2 +-
.../hadoop/hbase/thrift2/generated/TResult.java | 112 +-
.../hbase/thrift2/generated/TRowMutations.java | 38 +-
.../hadoop/hbase/thrift2/generated/TScan.java | 2 +-
.../hbase/thrift2/generated/TServerName.java | 2 +-
.../thrift2/generated/TTableDescriptor.java | 843 +
.../hbase/thrift2/generated/TTableName.java | 512 +
.../hbase/thrift2/generated/TTimeRange.java | 2 +-
.../apache/hadoop/hbase/thrift2/hbase.thrift | 229 +-
.../thrift2/TestThriftHBaseServiceHandler.java | 96 +
48 files changed, 41553 insertions(+), 10303 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hbase/blob/7820ba1d/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/AlreadyExists.java
----------------------------------------------------------------------
diff --git a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/AlreadyExists.java b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/AlreadyExists.java
index 68361c1..8ec3e32 100644
--- a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/AlreadyExists.java
+++ b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/AlreadyExists.java
@@ -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");
http://git-wip-us.apache.org/repos/asf/hbase/blob/7820ba1d/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/BatchMutation.java
----------------------------------------------------------------------
diff --git a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/BatchMutation.java b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/BatchMutation.java
index a2920ea..0872223 100644
--- a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/BatchMutation.java
+++ b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/BatchMutation.java
@@ -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");
http://git-wip-us.apache.org/repos/asf/hbase/blob/7820ba1d/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/ColumnDescriptor.java
----------------------------------------------------------------------
diff --git a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/ColumnDescriptor.java b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/ColumnDescriptor.java
index 3252377..bccd48b 100644
--- a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/ColumnDescriptor.java
+++ b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/ColumnDescriptor.java
@@ -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");
http://git-wip-us.apache.org/repos/asf/hbase/blob/7820ba1d/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/Hbase.java
----------------------------------------------------------------------
diff --git a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/Hbase.java b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/Hbase.java
index f77ce14..dc4d8bc 100644
--- a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/Hbase.java
+++ b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/Hbase.java
@@ -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 {
http://git-wip-us.apache.org/repos/asf/hbase/blob/7820ba1d/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/IOError.java
----------------------------------------------------------------------
diff --git a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/IOError.java b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/IOError.java
index 558f3e1..a32b008 100644
--- a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/IOError.java
+++ b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/IOError.java
@@ -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");
http://git-wip-us.apache.org/repos/asf/hbase/blob/7820ba1d/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/IllegalArgument.java
----------------------------------------------------------------------
diff --git a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/IllegalArgument.java b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/IllegalArgument.java
index bd296cc..573c496 100644
--- a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/IllegalArgument.java
+++ b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/IllegalArgument.java
@@ -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");
http://git-wip-us.apache.org/repos/asf/hbase/blob/7820ba1d/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/Mutation.java
----------------------------------------------------------------------
diff --git a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/Mutation.java b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/Mutation.java
index 216df2d..72925b7 100644
--- a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/Mutation.java
+++ b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/Mutation.java
@@ -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");
http://git-wip-us.apache.org/repos/asf/hbase/blob/7820ba1d/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/TAppend.java
----------------------------------------------------------------------
diff --git a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/TAppend.java b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/TAppend.java
index 439d71e..a21b5f7 100644
--- a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/TAppend.java
+++ b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/TAppend.java
@@ -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");
http://git-wip-us.apache.org/repos/asf/hbase/blob/7820ba1d/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/TCell.java
----------------------------------------------------------------------
diff --git a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/TCell.java b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/TCell.java
index 37021c0..afe0af1 100644
--- a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/TCell.java
+++ b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/TCell.java
@@ -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");
http://git-wip-us.apache.org/repos/asf/hbase/blob/7820ba1d/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/TColumn.java
----------------------------------------------------------------------
diff --git a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/TColumn.java b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/TColumn.java
index 77e875d..0115bbd 100644
--- a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/TColumn.java
+++ b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/TColumn.java
@@ -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");
http://git-wip-us.apache.org/repos/asf/hbase/blob/7820ba1d/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/TIncrement.java
----------------------------------------------------------------------
diff --git a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/TIncrement.java b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/TIncrement.java
index 22b5f79..7c018f1 100644
--- a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/TIncrement.java
+++ b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/TIncrement.java
@@ -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");
http://git-wip-us.apache.org/repos/asf/hbase/blob/7820ba1d/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/TRegionInfo.java
----------------------------------------------------------------------
diff --git a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/TRegionInfo.java b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/TRegionInfo.java
index a1dab6b..ec75247 100644
--- a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/TRegionInfo.java
+++ b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/TRegionInfo.java
@@ -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");
http://git-wip-us.apache.org/repos/asf/hbase/blob/7820ba1d/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/TRowResult.java
----------------------------------------------------------------------
diff --git a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/TRowResult.java b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/TRowResult.java
index 418f503..b09a368 100644
--- a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/TRowResult.java
+++ b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/TRowResult.java
@@ -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");
http://git-wip-us.apache.org/repos/asf/hbase/blob/7820ba1d/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/TScan.java
----------------------------------------------------------------------
diff --git a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/TScan.java b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/TScan.java
index 3faadd9..97d59c7 100644
--- a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/TScan.java
+++ b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/TScan.java
@@ -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");
http://git-wip-us.apache.org/repos/asf/hbase/blob/7820ba1d/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/ThriftHBaseServiceHandler.java
----------------------------------------------------------------------
diff --git a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/ThriftHBaseServiceHandler.java b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/ThriftHBaseServiceHandler.java
index 8e3ee96..2bfeefe 100644
--- a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/ThriftHBaseServiceHandler.java
+++ b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/ThriftHBaseServiceHandler.java
@@ -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);
+ }
+ }
}
http://git-wip-us.apache.org/repos/asf/hbase/blob/7820ba1d/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/ThriftUtilities.java
----------------------------------------------------------------------
diff --git a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/ThriftUtilities.java b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/ThriftUtilities.java
index 9b42bce..63c7007 100644
--- a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/ThriftUtilities.java
+++ b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/ThriftUtilities.java
@@ -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;
+ }
+
}
http://git-wip-us.apache.org/repos/asf/hbase/blob/7820ba1d/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/generated/NamespaceDescriptor.java
----------------------------------------------------------------------
diff --git a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/generated/NamespaceDescriptor.java b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/generated/NamespaceDescriptor.java
new file mode 100644
index 0000000..3f9f512
--- /dev/null
+++ b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/generated/NamespaceDescriptor.java
@@ -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);
+ }
+ }
+ }
+
+}
+
http://git-wip-us.apache.org/repos/asf/hbase/blob/7820ba1d/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TAppend.java
----------------------------------------------------------------------
diff --git a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TAppend.java b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TAppend.java
index e0e3074..c89f67b 100644
--- a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TAppend.java
+++ b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TAppend.java
@@ -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);
+ }
}
}
http://git-wip-us.apache.org/repos/asf/hbase/blob/7820ba1d/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TAuthorization.java
----------------------------------------------------------------------
diff --git a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TAuthorization.java b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TAuthorization.java
index 6c355a6..1b168d8 100644
--- a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TAuthorization.java
+++ b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TAuthorization.java
@@ -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");