From 83cf44cd3f19c841ac53889d09454ed5247ce591 Mon Sep 17 00:00:00 2001 From: Enis Soztutar Date: Thu, 22 Sep 2016 12:06:11 -0700 Subject: [PATCH] HBASE-16604 Scanner retries on IOException can cause the scans to miss data --- .../hadoop/hbase/UnknownScannerException.java | 4 + .../hadoop/hbase/client/ClientScanner.java | 4 +- .../hadoop/hbase/client/ScannerCallable.java | 26 +- .../exceptions/ScannerResetException.java | 50 + .../hbase/ipc/MetricsHBaseServerSource.java | 2 + .../ipc/MetricsHBaseServerSourceImpl.java | 8 + .../hadoop/hbase/ipc/MetricsHBaseServer.java | 3 + .../hbase/regionserver/RSRpcServices.java | 76 +- .../hadoop/hbase/HBaseTestingUtility.java | 27 +- .../hbase/client/TestFromClientSide.java | 75 +- .../client/TestTableSnapshotScanner.java | 2 +- .../TableSnapshotInputFormatTestBase.java | 2 +- .../TestMultithreadedTableMapper.java | 3 +- .../hbase/mapreduce/TestTableMapReduce.java | 5 +- .../mapreduce/TestTableMapReduceBase.java | 2 +- .../DelegatingKeyValueScanner.java | 114 + .../thrift/HThreadedSelectorServerArgs.java" | 97 + .../thrift/HbaseHandlerMetricsProxy.java" | 82 + .../thrift/HttpAuthenticationException.java" | 42 + .../hbase/thrift/IncrementCoalescer.java" | 372 + .../thrift/IncrementCoalescerMBean.java" | 49 + .../thrift/TBoundedThreadPoolServer.java" | 311 + .../hbase/thrift/ThriftHttpServlet.java" | 226 + .../hadoop/hbase/thrift/ThriftMetrics.java" | 90 + .../hadoop/hbase/thrift/ThriftServer.java" | 245 + .../hbase/thrift/ThriftServerRunner.java" | 1887 + .../hadoop/hbase/thrift/ThriftUtilities.java" | 235 + .../thrift/generated/AlreadyExists.java" | 402 + .../thrift/generated/BatchMutation.java" | 570 + .../thrift/generated/ColumnDescriptor.java" | 1239 + .../hadoop/hbase/thrift/generated/Hbase.java" | 58585 ++++++++++++++++ .../hbase/thrift/generated/IOError.java" | 403 + .../thrift/generated/IllegalArgument.java" | 402 + .../hbase/thrift/generated/Mutation.java" | 732 + .../hbase/thrift/generated/TAppend.java" | 840 + .../hadoop/hbase/thrift/generated/TCell.java" | 517 + .../hbase/thrift/generated/TColumn.java" | 521 + .../hbase/thrift/generated/TIncrement.java" | 745 + .../hbase/thrift/generated/TRegionInfo.java" | 1057 + .../hbase/thrift/generated/TRowResult.java" | 745 + .../hadoop/hbase/thrift/generated/TScan.java" | 1406 + .../thrift2/ThriftHBaseServiceHandler.java" | 487 + .../hadoop/hbase/thrift2/ThriftServer.java" | 555 + .../hbase/thrift2/ThriftUtilities.java" | 552 + .../hbase/thrift2/generated/TAppend.java" | 954 + .../thrift2/generated/TAuthorization.java" | 445 + .../thrift2/generated/TCellVisibility.java" | 396 + .../hbase/thrift2/generated/TColumn.java" | 631 + .../thrift2/generated/TColumnIncrement.java" | 625 + .../thrift2/generated/TColumnValue.java" | 851 + .../hbase/thrift2/generated/TCompareOp.java" | 64 + .../hbase/thrift2/generated/TDelete.java" | 1104 + .../hbase/thrift2/generated/TDeleteType.java" | 50 + .../hbase/thrift2/generated/TDurability.java" | 58 + .../hadoop/hbase/thrift2/generated/TGet.java" | 1283 + .../thrift2/generated/THBaseService.java" | 23215 ++++++ .../thrift2/generated/THRegionInfo.java" | 1039 + .../thrift2/generated/THRegionLocation.java" | 502 + .../hbase/thrift2/generated/TIOError.java" | 401 + .../thrift2/generated/TIllegalArgument.java" | 400 + .../hbase/thrift2/generated/TIncrement.java" | 961 + .../hbase/thrift2/generated/TMutation.java" | 373 + .../hadoop/hbase/thrift2/generated/TPut.java" | 1070 + .../hbase/thrift2/generated/TResult.java" | 569 + .../thrift2/generated/TRowMutations.java" | 559 + .../hbase/thrift2/generated/TScan.java" | 1694 + .../hbase/thrift2/generated/TServerName.java" | 599 + .../hbase/thrift2/generated/TTimeRange.java" | 486 + .../apache/hadoop/hbase/thrift2/package.html" | 103 + 69 files changed, 112176 insertions(+), 53 deletions(-) create mode 100644 hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/ScannerResetException.java create mode 100644 hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/DelegatingKeyValueScanner.java create mode 100644 "hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/HThreadedSelectorServerArgs.java" create mode 100644 "hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/HbaseHandlerMetricsProxy.java" create mode 100644 "hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/HttpAuthenticationException.java" create mode 100644 "hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/IncrementCoalescer.java" create mode 100644 "hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/IncrementCoalescerMBean.java" create mode 100644 "hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/TBoundedThreadPoolServer.java" create mode 100644 "hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/ThriftHttpServlet.java" create mode 100644 "hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/ThriftMetrics.java" create mode 100644 "hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/ThriftServer.java" create mode 100644 "hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java" create mode 100644 "hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/ThriftUtilities.java" create mode 100644 "hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/generated/AlreadyExists.java" create mode 100644 "hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/generated/BatchMutation.java" create mode 100644 "hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/generated/ColumnDescriptor.java" create mode 100644 "hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/generated/Hbase.java" create mode 100644 "hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/generated/IOError.java" create mode 100644 "hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/generated/IllegalArgument.java" create mode 100644 "hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/generated/Mutation.java" create mode 100644 "hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/generated/TAppend.java" create mode 100644 "hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/generated/TCell.java" create mode 100644 "hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/generated/TColumn.java" create mode 100644 "hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/generated/TIncrement.java" create mode 100644 "hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/generated/TRegionInfo.java" create mode 100644 "hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/generated/TRowResult.java" create mode 100644 "hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/generated/TScan.java" create mode 100644 "hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/ThriftHBaseServiceHandler.java" create mode 100644 "hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/ThriftServer.java" create mode 100644 "hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/ThriftUtilities.java" create mode 100644 "hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TAppend.java" create mode 100644 "hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TAuthorization.java" create mode 100644 "hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TCellVisibility.java" create mode 100644 "hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TColumn.java" create mode 100644 "hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TColumnIncrement.java" create mode 100644 "hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TColumnValue.java" create mode 100644 "hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TCompareOp.java" create mode 100644 "hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TDelete.java" create mode 100644 "hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TDeleteType.java" create mode 100644 "hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TDurability.java" create mode 100644 "hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TGet.java" create mode 100644 "hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/THBaseService.java" create mode 100644 "hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/THRegionInfo.java" create mode 100644 "hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/THRegionLocation.java" create mode 100644 "hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TIOError.java" create mode 100644 "hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TIllegalArgument.java" create mode 100644 "hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TIncrement.java" create mode 100644 "hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TMutation.java" create mode 100644 "hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TPut.java" create mode 100644 "hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TResult.java" create mode 100644 "hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TRowMutations.java" create mode 100644 "hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TScan.java" create mode 100644 "hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TServerName.java" create mode 100644 "hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TTimeRange.java" create mode 100644 "hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/package.html" diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/UnknownScannerException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/UnknownScannerException.java index b951221bc21..3e7b22d8025 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/UnknownScannerException.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/UnknownScannerException.java @@ -45,4 +45,8 @@ public class UnknownScannerException extends DoNotRetryIOException { public UnknownScannerException(String s) { super(s); } + + public UnknownScannerException(String s, Exception e) { + super(s, e); + } } diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ClientScanner.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ClientScanner.java index 3e676c719ff..de8bfcca75b 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ClientScanner.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ClientScanner.java @@ -33,6 +33,7 @@ import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.UnknownScannerException; import org.apache.hadoop.hbase.classification.InterfaceAudience; import org.apache.hadoop.hbase.exceptions.OutOfOrderScannerNextException; +import org.apache.hadoop.hbase.exceptions.ScannerResetException; import org.apache.hadoop.hbase.ipc.RpcControllerFactory; import org.apache.hadoop.hbase.protobuf.ProtobufUtil; import org.apache.hadoop.hbase.protobuf.generated.MapReduceProtos; @@ -428,7 +429,8 @@ public abstract class ClientScanner extends AbstractClientScanner { if ((cause != null && cause instanceof NotServingRegionException) || (cause != null && cause instanceof RegionServerStoppedException) || e instanceof OutOfOrderScannerNextException || - e instanceof UnknownScannerException ) { + e instanceof UnknownScannerException || + e instanceof ScannerResetException) { // Pass. It is easier writing the if loop test as list of what is allowed rather than // as a list of what is not allowed... so if in here, it means we do not throw. } else { diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ScannerCallable.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ScannerCallable.java index adf11537ef2..8345aa1261f 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ScannerCallable.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ScannerCallable.java @@ -40,7 +40,7 @@ import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.UnknownScannerException; import org.apache.hadoop.hbase.classification.InterfaceAudience; import org.apache.hadoop.hbase.client.metrics.ScanMetrics; -import org.apache.hadoop.hbase.ipc.HBaseRpcController; +import org.apache.hadoop.hbase.exceptions.ScannerResetException; import org.apache.hadoop.hbase.ipc.RpcControllerFactory; import org.apache.hadoop.hbase.protobuf.ProtobufUtil; import org.apache.hadoop.hbase.protobuf.RequestConverter; @@ -102,7 +102,7 @@ public class ScannerCallable extends RegionServerCallable { * @param scan the scan to execute * @param scanMetrics the ScanMetrics to used, if it is null, ScannerCallable won't collect * metrics - * @param rpcControllerFactory factory to use when creating + * @param rpcControllerFactory factory to use when creating * {@link com.google.protobuf.RpcController} */ public ScannerCallable(ClusterConnection connection, TableName tableName, Scan scan, @@ -174,6 +174,7 @@ public class ScannerCallable extends RegionServerCallable { } } + @Override protected Result [] rpcCall() throws Exception { if (Thread.interrupted()) { throw new InterruptedIOException(); @@ -245,14 +246,19 @@ public class ScannerCallable extends RegionServerCallable { if (e instanceof RemoteException) { ioe = ((RemoteException) e).unwrapRemoteException(); } - if (logScannerActivity && (ioe instanceof UnknownScannerException)) { - try { - HRegionLocation location = - getConnection().relocateRegion(getTableName(), scan.getStartRow()); - LOG.info("Scanner=" + scannerId + " expired, current region location is " + - location.toString()); - } catch (Throwable t) { - LOG.info("Failed to relocate region", t); + if (logScannerActivity) { + if (ioe instanceof UnknownScannerException) { + try { + HRegionLocation location = + getConnection().relocateRegion(getTableName(), scan.getStartRow()); + LOG.info("Scanner=" + scannerId + " expired, current region location is " + + location.toString()); + } catch (Throwable t) { + LOG.info("Failed to relocate region", t); + } + } else if (ioe instanceof ScannerResetException) { + LOG.info("Scanner=" + scannerId + " has received an exception, and the server " + + "asked us to reset the scanner state.", ioe); } } // The below convertion of exceptions into DoNotRetryExceptions is a little strange. diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/ScannerResetException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/ScannerResetException.java new file mode 100644 index 00000000000..7689eb104f5 --- /dev/null +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/ScannerResetException.java @@ -0,0 +1,50 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.hbase.exceptions; + +import org.apache.hadoop.hbase.DoNotRetryIOException; +import org.apache.hadoop.hbase.classification.InterfaceAudience; +import org.apache.hadoop.hbase.classification.InterfaceStability; + +/** + * Thrown when the server side has received an Exception, and asks the Client to reset the scanner + * state by closing the current region scanner, and reopening from the start of last seen row. + */ +@InterfaceAudience.Public +@InterfaceStability.Stable +public class ScannerResetException extends DoNotRetryIOException { + private static final long serialVersionUID = -5649728171144849619L; + + /** constructor */ + public ScannerResetException() { + super(); + } + + /** + * Constructor + * @param s message + */ + public ScannerResetException(String s) { + super(s); + } + + public ScannerResetException(String s, Exception e) { + super(s, e); + } +} diff --git a/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServerSource.java b/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServerSource.java index ffbe6fe9baf..cf9c6c7d57c 100644 --- a/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServerSource.java +++ b/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServerSource.java @@ -79,6 +79,7 @@ public interface MetricsHBaseServerSource extends BaseSource { String EXCEPTIONS_OOO_NAME="exceptions.OutOfOrderScannerNextException"; String EXCEPTIONS_BUSY_NAME="exceptions.RegionTooBusyException"; String EXCEPTIONS_UNKNOWN_NAME="exceptions.UnknownScannerException"; + String EXCEPTIONS_SCANNER_RESET_NAME="exceptions.ScannerResetException"; String EXCEPTIONS_SANITY_NAME="exceptions.FailedSanityCheckException"; String EXCEPTIONS_MOVED_NAME="exceptions.RegionMovedException"; String EXCEPTIONS_NSRE_NAME="exceptions.NotServingRegionException"; @@ -108,6 +109,7 @@ public interface MetricsHBaseServerSource extends BaseSource { void movedRegionException(); void notServingRegionException(); void unknownScannerException(); + void scannerResetException(); void tooBusyException(); void multiActionTooLargeException(); void callQueueTooBigException(); diff --git a/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServerSourceImpl.java b/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServerSourceImpl.java index fafa9d00735..d372b1b6ad6 100644 --- a/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServerSourceImpl.java +++ b/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServerSourceImpl.java @@ -45,6 +45,7 @@ public class MetricsHBaseServerSourceImpl extends BaseSourceImpl private final MutableFastCounter exceptionsOOO; private final MutableFastCounter exceptionsBusy; private final MutableFastCounter exceptionsUnknown; + private final MutableFastCounter exceptionsScannerReset; private final MutableFastCounter exceptionsSanity; private final MutableFastCounter exceptionsNSRE; private final MutableFastCounter exceptionsMoved; @@ -78,6 +79,8 @@ public class MetricsHBaseServerSourceImpl extends BaseSourceImpl .newCounter(EXCEPTIONS_BUSY_NAME, EXCEPTIONS_TYPE_DESC, 0L); this.exceptionsUnknown = this.getMetricsRegistry() .newCounter(EXCEPTIONS_UNKNOWN_NAME, EXCEPTIONS_TYPE_DESC, 0L); + this.exceptionsScannerReset = this.getMetricsRegistry() + .newCounter(EXCEPTIONS_SCANNER_RESET_NAME, EXCEPTIONS_TYPE_DESC, 0L); this.exceptionsSanity = this.getMetricsRegistry() .newCounter(EXCEPTIONS_SANITY_NAME, EXCEPTIONS_TYPE_DESC, 0L); this.exceptionsMoved = this.getMetricsRegistry() @@ -161,6 +164,11 @@ public class MetricsHBaseServerSourceImpl extends BaseSourceImpl exceptionsUnknown.incr(); } + @Override + public void scannerResetException() { + exceptionsScannerReset.incr(); + } + @Override public void tooBusyException() { exceptionsBusy.incr(); diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServer.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServer.java index 838bdf6cd78..fe03d4f4211 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServer.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServer.java @@ -29,6 +29,7 @@ import org.apache.hadoop.hbase.CompatibilitySingletonFactory; import org.apache.hadoop.hbase.exceptions.FailedSanityCheckException; import org.apache.hadoop.hbase.exceptions.OutOfOrderScannerNextException; import org.apache.hadoop.hbase.exceptions.RegionMovedException; +import org.apache.hadoop.hbase.exceptions.ScannerResetException; @InterfaceAudience.Private public class MetricsHBaseServer { @@ -103,6 +104,8 @@ public class MetricsHBaseServer { source.tooBusyException(); } else if (throwable instanceof UnknownScannerException) { source.unknownScannerException(); + } else if (throwable instanceof ScannerResetException) { + source.scannerResetException(); } else if (throwable instanceof RegionMovedException) { source.movedRegionException(); } else if (throwable instanceof NotServingRegionException) { diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java index 6f92f9d0a8b..5ba8afdccb2 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java @@ -82,6 +82,7 @@ import org.apache.hadoop.hbase.conf.ConfigurationObserver; import org.apache.hadoop.hbase.exceptions.FailedSanityCheckException; import org.apache.hadoop.hbase.exceptions.MergeRegionException; import org.apache.hadoop.hbase.exceptions.OutOfOrderScannerNextException; +import org.apache.hadoop.hbase.exceptions.ScannerResetException; import org.apache.hadoop.hbase.filter.ByteArrayComparable; import org.apache.hadoop.hbase.filter.CompareFilter.CompareOp; import org.apache.hadoop.hbase.ipc.HBaseRPCErrorHandler; @@ -2901,13 +2902,22 @@ public class RSRpcServices implements HBaseRPCErrorHandler, isClientCellBlockSupport(context)); } } catch (IOException e) { - // if we have an exception on scanner next and we are using the callSeq - // we should rollback because the client will retry with the same callSeq - // and get an OutOfOrderScannerNextException if we don't do so. - if (rsh != null && request.hasNextCallSeq()) { - rsh.rollbackNextCallSeq(); + // The scanner state might be left in a dirty state, so we will tell the Client to + // fail this RPC and close the scanner while opening up another one from the start of + // row that the client has last seen. + closeScanner(region, scanner, scannerName, context); + + // We closed the scanner already. Instead of throwing the IOException, and client + // retrying with the same scannerId only to get USE on the next RPC, we directly throw + // a special exception to save an RPC. + if (VersionInfoUtil.hasMinimumVersion(context.getClientVersionInfo(), 1, 4)) { + // 1.4.0+ clients know how to handle + throw new ScannerResetException("Scanner is closed on the server-side", e); + } else { + // older clients do not know about SRE. Just throw USE, which they will handle + throw new UnknownScannerException("Throwing UnknownScannerException to reset the client" + + " scanner state for clients older than 1.3.", e); } - throw e; } finally { if (context != null) { context.setCallBack(rsh.shippedCallback); @@ -2926,29 +2936,8 @@ public class RSRpcServices implements HBaseRPCErrorHandler, if (!moreResults || closeScanner) { ttl = 0; moreResults = false; - if (region != null && region.getCoprocessorHost() != null) { - if (region.getCoprocessorHost().preScannerClose(scanner)) { - return builder.build(); // bypass - } - } - rsh = scanners.remove(scannerName); - if (rsh != null) { - if (context != null) { - context.setCallBack(rsh.closeCallBack); - } else { - rsh.s.close(); - } - try { - regionServer.leases.cancelLease(scannerName); - } catch (LeaseException le) { - // No problem, ignore - if (LOG.isTraceEnabled()) { - LOG.trace("Un-able to cancel lease of scanner. It could already be closed."); - } - } - if (region != null && region.getCoprocessorHost() != null) { - region.getCoprocessorHost().postScannerClose(scanner); - } + if (closeScanner(region, scanner, scannerName, context)) { + return builder.build(); // bypass } } @@ -2980,6 +2969,35 @@ public class RSRpcServices implements HBaseRPCErrorHandler, } } + private boolean closeScanner(Region region, RegionScanner scanner, String scannerName, + RpcCallContext context) throws IOException { + if (region != null && region.getCoprocessorHost() != null) { + if (region.getCoprocessorHost().preScannerClose(scanner)) { + return true; // bypass + } + } + RegionScannerHolder rsh = scanners.remove(scannerName); + if (rsh != null) { + if (context != null) { + context.setCallBack(rsh.closeCallBack); + } else { + rsh.s.close(); + } + try { + regionServer.leases.cancelLease(scannerName); + } catch (LeaseException le) { + // No problem, ignore + if (LOG.isTraceEnabled()) { + LOG.trace("Un-able to cancel lease of scanner. It could already be closed."); + } + } + if (region != null && region.getCoprocessorHost() != null) { + region.getCoprocessorHost().postScannerClose(scanner); + } + } + return false; + } + @Override public CoprocessorServiceResponse execRegionServerService(RpcController controller, CoprocessorServiceRequest request) throws ServiceException { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java index 8335f4f5140..7f533400f80 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java @@ -1414,12 +1414,8 @@ public class HBaseTestingUtility extends HBaseCommonTestingUtility { public Table createTable(TableName tableName, byte[][] families, int numVersions, byte[] startKey, byte[] endKey, int numRegions) throws IOException{ - HTableDescriptor desc = new HTableDescriptor(tableName); - for (byte[] family : families) { - HColumnDescriptor hcd = new HColumnDescriptor(family) - .setMaxVersions(numVersions); - desc.addFamily(hcd); - } + HTableDescriptor desc = createTableDescriptor(tableName, families, numVersions); + getAdmin().createTable(desc, startKey, endKey, numRegions); // HBaseAdmin only waits for regions to appear in hbase:meta we // should wait until they are assigned @@ -1782,6 +1778,22 @@ public class HBaseTestingUtility extends HBaseCommonTestingUtility { MAXVERSIONS, HConstants.FOREVER, HColumnDescriptor.DEFAULT_KEEP_DELETED); } + public HTableDescriptor createTableDescriptor(final TableName tableName, + byte[] family) { + return createTableDescriptor(tableName, new byte[][] {family}, 1); + } + + public HTableDescriptor createTableDescriptor(final TableName tableName, + byte[][] families, int maxVersions) { + HTableDescriptor desc = new HTableDescriptor(tableName); + for (byte[] family : families) { + HColumnDescriptor hcd = new HColumnDescriptor(family) + .setMaxVersions(maxVersions); + desc.addFamily(hcd); + } + return desc; + } + /** * Create an HRegion that writes to the local tmp dirs * @param desc @@ -1999,7 +2011,7 @@ public class HBaseTestingUtility extends HBaseCommonTestingUtility { put.setDurability(writeToWAL ? Durability.USE_DEFAULT : Durability.SKIP_WAL); for (int i = 0; i < f.length; i++) { byte[] value1 = value != null ? value : row; - put.addColumn(f[i], null, value1); + put.addColumn(f[i], f[i], value1); } puts.add(put); } @@ -3541,6 +3553,7 @@ public class HBaseTestingUtility extends HBaseCommonTestingUtility { public PortAllocator(Random random) { this.random = random; this.portChecker = new AvailablePortChecker() { + @Override public boolean available(int port) { try { ServerSocket sock = new ServerSocket(port); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide.java index f46562540e8..33a53156b3a 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide.java @@ -26,7 +26,6 @@ import static org.junit.Assert.assertNull; import static org.junit.Assert.assertSame; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; - import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; @@ -37,10 +36,12 @@ import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.NavigableMap; +import java.util.NavigableSet; import java.util.UUID; import java.util.concurrent.Callable; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; +import java.util.concurrent.atomic.AtomicLong; import java.util.concurrent.atomic.AtomicReference; import org.apache.commons.lang.ArrayUtils; @@ -63,8 +64,11 @@ import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.Waiter; import org.apache.hadoop.hbase.client.metrics.ScanMetrics; +import org.apache.hadoop.hbase.coprocessor.BaseRegionObserver; import org.apache.hadoop.hbase.coprocessor.CoprocessorHost; import org.apache.hadoop.hbase.coprocessor.MultiRowMutationEndpoint; +import org.apache.hadoop.hbase.coprocessor.ObserverContext; +import org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment; import org.apache.hadoop.hbase.filter.BinaryComparator; import org.apache.hadoop.hbase.filter.CompareFilter; import org.apache.hadoop.hbase.filter.CompareFilter.CompareOp; @@ -91,10 +95,14 @@ import org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto; import org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto.MutationType; import org.apache.hadoop.hbase.protobuf.generated.MultiRowMutationProtos.MultiRowMutationService; import org.apache.hadoop.hbase.protobuf.generated.MultiRowMutationProtos.MutateRowsRequest; +import org.apache.hadoop.hbase.regionserver.DelegatingKeyValueScanner; import org.apache.hadoop.hbase.regionserver.HRegionServer; +import org.apache.hadoop.hbase.regionserver.KeyValueScanner; import org.apache.hadoop.hbase.regionserver.NoSuchColumnFamilyException; import org.apache.hadoop.hbase.regionserver.Region; +import org.apache.hadoop.hbase.regionserver.ScanInfo; import org.apache.hadoop.hbase.regionserver.Store; +import org.apache.hadoop.hbase.regionserver.StoreScanner; import org.apache.hadoop.hbase.testclassification.ClientTests; import org.apache.hadoop.hbase.testclassification.LargeTests; import org.apache.hadoop.hbase.util.Bytes; @@ -536,6 +544,71 @@ public class TestFromClientSide { assertEquals(rowCount - endKeyCount, countGreater); } + /** + * This is a coprocessor to inject a test failure so that a store scanner.reseek() call will + * fail with an IOException() on the first call. + */ + public static class ExceptionInReseekRegionObserver extends BaseRegionObserver { + static AtomicLong reqCount = new AtomicLong(0); + class MyStoreScanner extends StoreScanner { + public MyStoreScanner(Store store, ScanInfo scanInfo, Scan scan, NavigableSet columns, + long readPt) throws IOException { + super(store, scanInfo, scan, columns, readPt); + } + + @Override + protected List selectScannersFrom( + List allScanners) { + List scanners = super.selectScannersFrom(allScanners); + List newScanners = new ArrayList<>(scanners.size()); + for (KeyValueScanner scanner : scanners) { + newScanners.add(new DelegatingKeyValueScanner(scanner) { + @Override + public boolean reseek(Cell key) throws IOException { + if (reqCount.incrementAndGet() == 1) { + throw new IOException("Injected exception"); + } + return super.reseek(key); + } + }); + } + return newScanners; + } + } + + @Override + public KeyValueScanner preStoreScannerOpen(ObserverContext c, + Store store, Scan scan, NavigableSet targetCols, KeyValueScanner s, + final long readPt) throws IOException { + return new MyStoreScanner(store, store.getScanInfo(), scan, targetCols, readPt); + } + } + + /** + * Tests the case where a Scan can throw an IOException in the middle of the seek / reseek + * leaving the server side RegionScanner to be in dirty state. The client has to ensure that the + * ClientScanner does not get an exception and also sees all the data. + * @throws IOException + * @throws InterruptedException + */ + @Test + public void testClientScannerIsResetWhenScanThrowsIOException() + throws IOException, InterruptedException { + TEST_UTIL.getConfiguration().setBoolean("hbase.client.log.scanner.activity", true); + TableName name = TableName.valueOf("testClientScannerIsResetWhenScanThrowsIOException"); + + HTableDescriptor htd = TEST_UTIL.createTableDescriptor(name, FAMILY); + htd.addCoprocessor(ExceptionInReseekRegionObserver.class.getName()); + TEST_UTIL.getAdmin().createTable(htd); + try (Table t = TEST_UTIL.getConnection().getTable(name)) { + int rowCount = TEST_UTIL.loadTable(t, FAMILY, false); + TEST_UTIL.getAdmin().flush(name); + int actualRowCount = countRows(t, new Scan().addColumn(FAMILY, FAMILY)); + assertEquals(rowCount, actualRowCount); + } + assertTrue(ExceptionInReseekRegionObserver.reqCount.get() > 0); + } + /* * @param key * @return Scan with RowFilter that does LESS than passed key. diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestTableSnapshotScanner.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestTableSnapshotScanner.java index 0f0baffc0eb..8b9428fe85a 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestTableSnapshotScanner.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestTableSnapshotScanner.java @@ -184,7 +184,7 @@ public class TestTableSnapshotScanner { } for (int j = 0; j < FAMILIES.length; j++) { - byte[] actual = result.getValue(FAMILIES[j], null); + byte[] actual = result.getValue(FAMILIES[j], FAMILIES[j]); Assert.assertArrayEquals("Row in snapshot does not match, expected:" + Bytes.toString(row) + " ,actual:" + Bytes.toString(actual), row, actual); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TableSnapshotInputFormatTestBase.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TableSnapshotInputFormatTestBase.java index 26e58975621..66d290a43d2 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TableSnapshotInputFormatTestBase.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TableSnapshotInputFormatTestBase.java @@ -181,7 +181,7 @@ public abstract class TableSnapshotInputFormatTestBase { } for (int j = 0; j < FAMILIES.length; j++) { - byte[] actual = result.getValue(FAMILIES[j], null); + byte[] actual = result.getValue(FAMILIES[j], FAMILIES[j]); Assert.assertArrayEquals("Row in snapshot does not match, expected:" + Bytes.toString(row) + " ,actual:" + Bytes.toString(actual), row, actual); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestMultithreadedTableMapper.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestMultithreadedTableMapper.java index 5110ef79b3e..694a359a5a3 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestMultithreadedTableMapper.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestMultithreadedTableMapper.java @@ -97,6 +97,7 @@ public class TestMultithreadedTableMapper { * @param context * @throws IOException */ + @Override public void map(ImmutableBytesWritable key, Result value, Context context) throws IOException, InterruptedException { @@ -110,7 +111,7 @@ public class TestMultithreadedTableMapper { Bytes.toString(INPUT_FAMILY) + "'."); } // Get the original value and reverse it - String originalValue = Bytes.toString(value.getValue(INPUT_FAMILY, null)); + String originalValue = Bytes.toString(value.getValue(INPUT_FAMILY, INPUT_FAMILY)); StringBuilder newValue = new StringBuilder(originalValue); newValue.reverse(); // Now set the value to be collected diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableMapReduce.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableMapReduce.java index fa5b9a48f40..690e776077a 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableMapReduce.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableMapReduce.java @@ -57,6 +57,7 @@ import org.junit.experimental.categories.Category; public class TestTableMapReduce extends TestTableMapReduceBase { private static final Log LOG = LogFactory.getLog(TestTableMapReduce.class); + @Override protected Log getLog() { return LOG; } /** @@ -72,6 +73,7 @@ public class TestTableMapReduce extends TestTableMapReduceBase { * @param context * @throws IOException */ + @Override public void map(ImmutableBytesWritable key, Result value, Context context) throws IOException, InterruptedException { @@ -86,7 +88,7 @@ public class TestTableMapReduce extends TestTableMapReduceBase { } // Get the original value and reverse it - String originalValue = Bytes.toString(value.getValue(INPUT_FAMILY, null)); + String originalValue = Bytes.toString(value.getValue(INPUT_FAMILY, INPUT_FAMILY)); StringBuilder newValue = new StringBuilder(originalValue); newValue.reverse(); // Now set the value to be collected @@ -96,6 +98,7 @@ public class TestTableMapReduce extends TestTableMapReduceBase { } } + @Override protected void runTestOnTable(Table table) throws IOException { Job job = null; try { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableMapReduceBase.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableMapReduceBase.java index e78bf4f9e6e..27bf0637ecb 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableMapReduceBase.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableMapReduceBase.java @@ -126,7 +126,7 @@ public abstract class TestTableMapReduceBase { // Get the original value and reverse it - String originalValue = Bytes.toString(value.getValue(INPUT_FAMILY, null)); + String originalValue = Bytes.toString(value.getValue(INPUT_FAMILY, INPUT_FAMILY)); StringBuilder newValue = new StringBuilder(originalValue); newValue.reverse(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/DelegatingKeyValueScanner.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/DelegatingKeyValueScanner.java new file mode 100644 index 00000000000..51a2a978f80 --- /dev/null +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/DelegatingKeyValueScanner.java @@ -0,0 +1,114 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.hbase.regionserver; + +import java.io.IOException; + +import org.apache.hadoop.hbase.Cell; +import org.apache.hadoop.hbase.client.Scan; +import org.apache.hadoop.hbase.regionserver.KeyValueScanner; +import org.apache.hadoop.hbase.regionserver.Store; + +public class DelegatingKeyValueScanner implements KeyValueScanner { + protected KeyValueScanner delegate; + + public DelegatingKeyValueScanner(KeyValueScanner delegate) { + this.delegate = delegate; + } + + @Override + public void shipped() throws IOException { + delegate.shipped(); + } + + @Override + public Cell peek() { + return delegate.peek(); + } + + @Override + public Cell next() throws IOException { + return delegate.next(); + } + + @Override + public boolean seek(Cell key) throws IOException { + return delegate.seek(key); + } + + @Override + public boolean reseek(Cell key) throws IOException { + return delegate.reseek(key); + } + + @Override + public long getScannerOrder() { + return delegate.getScannerOrder(); + } + + @Override + public void close() { + delegate.close(); + } + + @Override + public boolean shouldUseScanner(Scan scan, Store store, long oldestUnexpiredTS) { + return delegate.shouldUseScanner(scan, store, oldestUnexpiredTS); + } + + @Override + public boolean requestSeek(Cell kv, boolean forward, boolean useBloom) throws IOException { + return delegate.requestSeek(kv, forward, useBloom); + } + + @Override + public boolean realSeekDone() { + return delegate.realSeekDone(); + } + + @Override + public void enforceSeek() throws IOException { + delegate.enforceSeek(); + } + + @Override + public boolean isFileScanner() { + return delegate.isFileScanner(); + } + + @Override + public boolean backwardSeek(Cell key) throws IOException { + return delegate.backwardSeek(key); + } + + @Override + public boolean seekToPreviousRow(Cell key) throws IOException { + return delegate.seekToPreviousRow(key); + } + + @Override + public boolean seekToLastRow() throws IOException { + return delegate.seekToLastRow(); + } + + @Override + public Cell getNextIndexedKey() { + return delegate.getNextIndexedKey(); + } +} \ No newline at end of file diff --git "a/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/HThreadedSelectorServerArgs.java" "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/HThreadedSelectorServerArgs.java" new file mode 100644 index 00000000000..da33cc0a92c --- /dev/null +++ "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/HThreadedSelectorServerArgs.java" @@ -0,0 +1,97 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.hadoop.hbase.thrift; + +import java.util.Locale; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.hadoop.hbase.classification.InterfaceAudience; +import org.apache.hadoop.conf.Configuration; +import org.apache.thrift.server.TThreadedSelectorServer; +import org.apache.thrift.transport.TNonblockingServerTransport; + +/** + * A TThreadedSelectorServer.Args that reads hadoop configuration + */ +@InterfaceAudience.Private +public class HThreadedSelectorServerArgs extends TThreadedSelectorServer.Args { + private static final Log LOG = LogFactory.getLog(TThreadedSelectorServer.class); + + /** + * Number of selector threads for reading and writing socket + */ + public static final String SELECTOR_THREADS_CONF_KEY = + "hbase.thrift.selector.threads"; + + /** + * Number fo threads for processing the thrift calls + */ + public static final String WORKER_THREADS_CONF_KEY = + "hbase.thrift.worker.threads"; + + /** + * Time to wait for server to stop gracefully + */ + public static final String STOP_TIMEOUT_CONF_KEY = + "hbase.thrift.stop.timeout.seconds"; + + /** + * Maximum number of accepted elements per selector + */ + public static final String ACCEPT_QUEUE_SIZE_PER_THREAD_CONF_KEY = + "hbase.thrift.accept.queue.size.per.selector"; + + /** + * The strategy for handling new accepted connections. + */ + public static final String ACCEPT_POLICY_CONF_KEY = + "hbase.thrift.accept.policy"; + + public HThreadedSelectorServerArgs( + TNonblockingServerTransport transport, Configuration conf) { + super(transport); + readConf(conf); + } + + private void readConf(Configuration conf) { + int selectorThreads = conf.getInt( + SELECTOR_THREADS_CONF_KEY, getSelectorThreads()); + int workerThreads = conf.getInt( + WORKER_THREADS_CONF_KEY, getWorkerThreads()); + int stopTimeoutVal = conf.getInt( + STOP_TIMEOUT_CONF_KEY, getStopTimeoutVal()); + int acceptQueueSizePerThread = conf.getInt( + ACCEPT_QUEUE_SIZE_PER_THREAD_CONF_KEY, getAcceptQueueSizePerThread()); + AcceptPolicy acceptPolicy = AcceptPolicy.valueOf(conf.get( + ACCEPT_POLICY_CONF_KEY, getAcceptPolicy().toString()).toUpperCase(Locale.ROOT)); + + super.selectorThreads(selectorThreads) + .workerThreads(workerThreads) + .stopTimeoutVal(stopTimeoutVal) + .acceptQueueSizePerThread(acceptQueueSizePerThread) + .acceptPolicy(acceptPolicy); + + LOG.info("Read configuration selectorThreads:" + selectorThreads + + " workerThreads:" + workerThreads + + " stopTimeoutVal:" + stopTimeoutVal + "sec" + + " acceptQueueSizePerThread:" + acceptQueueSizePerThread + + " acceptPolicy:" + acceptPolicy); + } +} diff --git "a/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/HbaseHandlerMetricsProxy.java" "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/HbaseHandlerMetricsProxy.java" new file mode 100644 index 00000000000..51a0444a620 --- /dev/null +++ "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/HbaseHandlerMetricsProxy.java" @@ -0,0 +1,82 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.hbase.thrift; + +import java.lang.reflect.InvocationHandler; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.lang.reflect.Proxy; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.hadoop.hbase.classification.InterfaceAudience; +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hbase.thrift.generated.Hbase; + + +/** + * Converts a Hbase.Iface using InvocationHandler so that it reports process + * time of each call to ThriftMetrics. + */ +@InterfaceAudience.Private +public class HbaseHandlerMetricsProxy implements InvocationHandler { + + private static final Log LOG = LogFactory.getLog( + HbaseHandlerMetricsProxy.class); + + private final Hbase.Iface handler; + private final ThriftMetrics metrics; + + public static Hbase.Iface newInstance(Hbase.Iface handler, + ThriftMetrics metrics, + Configuration conf) { + return (Hbase.Iface) Proxy.newProxyInstance( + handler.getClass().getClassLoader(), + new Class[]{Hbase.Iface.class}, + new HbaseHandlerMetricsProxy(handler, metrics, conf)); + } + + private HbaseHandlerMetricsProxy( + Hbase.Iface handler, ThriftMetrics metrics, Configuration conf) { + this.handler = handler; + this.metrics = metrics; + } + + @Override + public Object invoke(Object proxy, Method m, Object[] args) + throws Throwable { + Object result; + try { + long start = now(); + result = m.invoke(handler, args); + long processTime = now() - start; + metrics.incMethodTime(m.getName(), processTime); + } catch (InvocationTargetException e) { + throw e.getTargetException(); + } catch (Exception e) { + throw new RuntimeException( + "unexpected invocation exception: " + e.getMessage()); + } + return result; + } + + private static long now() { + return System.nanoTime(); + } +} diff --git "a/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/HttpAuthenticationException.java" "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/HttpAuthenticationException.java" new file mode 100644 index 00000000000..48eedc153b5 --- /dev/null +++ "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/HttpAuthenticationException.java" @@ -0,0 +1,42 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.hadoop.hbase.thrift; + +public class HttpAuthenticationException extends Exception { + private static final long serialVersionUID = 0; + /** + * @param cause original exception + */ + public HttpAuthenticationException(Throwable cause) { + super(cause); + } + /** + * @param msg exception message + */ + public HttpAuthenticationException(String msg) { + super(msg); + } + /** + * @param msg exception message + * @param cause original exception + */ + public HttpAuthenticationException(String msg, Throwable cause) { + super(msg, cause); + } +} \ No newline at end of file diff --git "a/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/IncrementCoalescer.java" "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/IncrementCoalescer.java" new file mode 100644 index 00000000000..e937f2db740 --- /dev/null +++ "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/IncrementCoalescer.java" @@ -0,0 +1,372 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.hbase.thrift; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.Set; +import java.util.concurrent.Callable; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.ThreadFactory; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicLong; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.hadoop.hbase.KeyValue; +import org.apache.hadoop.hbase.client.Table; +import org.apache.hadoop.hbase.thrift.ThriftServerRunner.HBaseHandler; +import org.apache.hadoop.hbase.thrift.generated.TIncrement; +import org.apache.hadoop.hbase.util.Bytes; +import org.apache.hadoop.hbase.util.Threads; +import org.apache.hadoop.metrics.util.MBeanUtil; +import org.apache.thrift.TException; + +/** + * This class will coalesce increments from a thift server if + * hbase.regionserver.thrift.coalesceIncrement is set to true. Turning this + * config to true will cause the thrift server to queue increments into an + * instance of this class. The thread pool associated with this class will drain + * the coalesced increments as the thread is able. This can cause data loss if the + * thrift server dies or is shut down before everything in the queue is drained. + * + */ +public class IncrementCoalescer implements IncrementCoalescerMBean { + + /** + * Used to identify a cell that will be incremented. + * + */ + static class FullyQualifiedRow { + private byte[] table; + private byte[] rowKey; + private byte[] family; + private byte[] qualifier; + + public FullyQualifiedRow(byte[] table, byte[] rowKey, byte[] fam, byte[] qual) { + super(); + this.table = table; + this.rowKey = rowKey; + this.family = fam; + this.qualifier = qual; + } + + public byte[] getTable() { + return table; + } + + public void setTable(byte[] table) { + this.table = table; + } + + public byte[] getRowKey() { + return rowKey; + } + + public void setRowKey(byte[] rowKey) { + this.rowKey = rowKey; + } + + public byte[] getFamily() { + return family; + } + + public void setFamily(byte[] fam) { + this.family = fam; + } + + public byte[] getQualifier() { + return qualifier; + } + + public void setQualifier(byte[] qual) { + this.qualifier = qual; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + Arrays.hashCode(family); + result = prime * result + Arrays.hashCode(qualifier); + result = prime * result + Arrays.hashCode(rowKey); + result = prime * result + Arrays.hashCode(table); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) return true; + if (obj == null) return false; + if (getClass() != obj.getClass()) return false; + FullyQualifiedRow other = (FullyQualifiedRow) obj; + if (!Arrays.equals(family, other.family)) return false; + if (!Arrays.equals(qualifier, other.qualifier)) return false; + if (!Arrays.equals(rowKey, other.rowKey)) return false; + if (!Arrays.equals(table, other.table)) return false; + return true; + } + + } + + static class DaemonThreadFactory implements ThreadFactory { + static final AtomicInteger poolNumber = new AtomicInteger(1); + final ThreadGroup group; + final AtomicInteger threadNumber = new AtomicInteger(1); + final String namePrefix; + + DaemonThreadFactory() { + SecurityManager s = System.getSecurityManager(); + group = (s != null) ? s.getThreadGroup() : Thread.currentThread().getThreadGroup(); + namePrefix = "ICV-" + poolNumber.getAndIncrement() + "-thread-"; + } + + public Thread newThread(Runnable r) { + Thread t = new Thread(group, r, namePrefix + threadNumber.getAndIncrement(), 0); + if (!t.isDaemon()) t.setDaemon(true); + if (t.getPriority() != Thread.NORM_PRIORITY) t.setPriority(Thread.NORM_PRIORITY); + return t; + } + } + + private final AtomicLong failedIncrements = new AtomicLong(); + private final AtomicLong successfulCoalescings = new AtomicLong(); + private final AtomicLong totalIncrements = new AtomicLong(); + private final ConcurrentMap countersMap = + new ConcurrentHashMap(100000, 0.75f, 1500); + private final ThreadPoolExecutor pool; + private final HBaseHandler handler; + + private int maxQueueSize = 500000; + private static final int CORE_POOL_SIZE = 1; + + private static final Log LOG = LogFactory.getLog(FullyQualifiedRow.class); + + @SuppressWarnings("deprecation") + public IncrementCoalescer(HBaseHandler hand) { + this.handler = hand; + LinkedBlockingQueue queue = new LinkedBlockingQueue(); + pool = + new ThreadPoolExecutor(CORE_POOL_SIZE, CORE_POOL_SIZE, 50, TimeUnit.MILLISECONDS, queue, + Threads.newDaemonThreadFactory("IncrementCoalescer")); + + MBeanUtil.registerMBean("thrift", "Thrift", this); + } + + public boolean queueIncrement(TIncrement inc) throws TException { + if (!canQueue()) { + failedIncrements.incrementAndGet(); + return false; + } + return internalQueueTincrement(inc); + } + + public boolean queueIncrements(List incs) throws TException { + if (!canQueue()) { + failedIncrements.incrementAndGet(); + return false; + } + + for (TIncrement tinc : incs) { + internalQueueTincrement(tinc); + } + return true; + + } + + private boolean internalQueueTincrement(TIncrement inc) throws TException { + byte[][] famAndQf = KeyValue.parseColumn(inc.getColumn()); + if (famAndQf.length != 2) return false; + + return internalQueueIncrement(inc.getTable(), inc.getRow(), famAndQf[0], famAndQf[1], + inc.getAmmount()); + } + + private boolean internalQueueIncrement(byte[] tableName, byte[] rowKey, byte[] fam, + byte[] qual, long ammount) throws TException { + int countersMapSize = countersMap.size(); + + + //Make sure that the number of threads is scaled. + dynamicallySetCoreSize(countersMapSize); + + totalIncrements.incrementAndGet(); + + FullyQualifiedRow key = new FullyQualifiedRow(tableName, rowKey, fam, qual); + + long currentAmount = ammount; + // Spin until able to insert the value back without collisions + while (true) { + Long value = countersMap.remove(key); + if (value == null) { + // There was nothing there, create a new value + value = Long.valueOf(currentAmount); + } else { + value += currentAmount; + successfulCoalescings.incrementAndGet(); + } + // Try to put the value, only if there was none + Long oldValue = countersMap.putIfAbsent(key, value); + if (oldValue == null) { + // We were able to put it in, we're done + break; + } + // Someone else was able to put a value in, so let's remember our + // current value (plus what we picked up) and retry to add it in + currentAmount = value; + } + + // We limit the size of the queue simply because all we need is a + // notification that something needs to be incremented. No need + // for millions of callables that mean the same thing. + if (pool.getQueue().size() <= 1000) { + // queue it up + Callable callable = createIncCallable(); + pool.submit(callable); + } + + return true; + } + + public boolean canQueue() { + return countersMap.size() < maxQueueSize; + } + + private Callable createIncCallable() { + return new Callable() { + @Override + public Integer call() throws Exception { + int failures = 0; + Set keys = countersMap.keySet(); + for (FullyQualifiedRow row : keys) { + Long counter = countersMap.remove(row); + if (counter == null) { + continue; + } + Table table = null; + try { + table = handler.getTable(row.getTable()); + if (failures > 2) { + throw new IOException("Auto-Fail rest of ICVs"); + } + table.incrementColumnValue(row.getRowKey(), row.getFamily(), row.getQualifier(), + counter); + } catch (IOException e) { + // log failure of increment + failures++; + LOG.error("FAILED_ICV: " + Bytes.toString(row.getTable()) + ", " + + Bytes.toStringBinary(row.getRowKey()) + ", " + + Bytes.toStringBinary(row.getFamily()) + ", " + + Bytes.toStringBinary(row.getQualifier()) + ", " + counter, e); + } finally{ + if(table != null){ + table.close(); + } + } + } + return failures; + } + }; + } + + /** + * This method samples the incoming requests and, if selected, will check if + * the corePoolSize should be changed. + * @param countersMapSize + */ + private void dynamicallySetCoreSize(int countersMapSize) { + // Here we are using countersMapSize as a random number, meaning this + // could be a Random object + if (countersMapSize % 10 != 0) { + return; + } + double currentRatio = (double) countersMapSize / (double) maxQueueSize; + int newValue = 1; + if (currentRatio < 0.1) { + // it's 1 + } else if (currentRatio < 0.3) { + newValue = 2; + } else if (currentRatio < 0.5) { + newValue = 4; + } else if (currentRatio < 0.7) { + newValue = 8; + } else if (currentRatio < 0.9) { + newValue = 14; + } else { + newValue = 22; + } + if (pool.getCorePoolSize() != newValue) { + pool.setCorePoolSize(newValue); + } + } + + // MBean get/set methods + public int getQueueSize() { + return pool.getQueue().size(); + } + public int getMaxQueueSize() { + return this.maxQueueSize; + } + public void setMaxQueueSize(int newSize) { + this.maxQueueSize = newSize; + } + + public long getPoolCompletedTaskCount() { + return pool.getCompletedTaskCount(); + } + public long getPoolTaskCount() { + return pool.getTaskCount(); + } + public int getPoolLargestPoolSize() { + return pool.getLargestPoolSize(); + } + public int getCorePoolSize() { + return pool.getCorePoolSize(); + } + public void setCorePoolSize(int newCoreSize) { + pool.setCorePoolSize(newCoreSize); + } + public int getMaxPoolSize() { + return pool.getMaximumPoolSize(); + } + public void setMaxPoolSize(int newMaxSize) { + pool.setMaximumPoolSize(newMaxSize); + } + public long getFailedIncrements() { + return failedIncrements.get(); + } + + public long getSuccessfulCoalescings() { + return successfulCoalescings.get(); + } + + public long getTotalIncrements() { + return totalIncrements.get(); + } + + public long getCountersMapSize() { + return countersMap.size(); + } + +} diff --git "a/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/IncrementCoalescerMBean.java" "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/IncrementCoalescerMBean.java" new file mode 100644 index 00000000000..604fa97e3a4 --- /dev/null +++ "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/IncrementCoalescerMBean.java" @@ -0,0 +1,49 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.hbase.thrift; + +public interface IncrementCoalescerMBean { + int getQueueSize(); + + int getMaxQueueSize(); + + void setMaxQueueSize(int newSize); + + long getPoolCompletedTaskCount(); + + long getPoolTaskCount(); + + int getPoolLargestPoolSize(); + + int getCorePoolSize(); + + void setCorePoolSize(int newCoreSize); + + int getMaxPoolSize(); + + void setMaxPoolSize(int newMaxSize); + + long getFailedIncrements(); + + long getSuccessfulCoalescings(); + + long getTotalIncrements(); + + long getCountersMapSize(); +} diff --git "a/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/TBoundedThreadPoolServer.java" "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/TBoundedThreadPoolServer.java" new file mode 100644 index 00000000000..1b8ebc9fbae --- /dev/null +++ "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/TBoundedThreadPoolServer.java" @@ -0,0 +1,311 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.hbase.thrift; + +import java.util.concurrent.ExecutorService; +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.RejectedExecutionException; +import java.util.concurrent.SynchronousQueue; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.TimeUnit; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.hadoop.hbase.classification.InterfaceAudience; +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hbase.thrift.CallQueue.Call; +import org.apache.hadoop.hbase.util.Threads; +import org.apache.thrift.TException; +import org.apache.thrift.TProcessor; +import org.apache.thrift.protocol.TProtocol; +import org.apache.thrift.server.TServer; +import org.apache.thrift.server.TThreadPoolServer; +import org.apache.thrift.transport.TServerTransport; +import org.apache.thrift.transport.TSocket; +import org.apache.thrift.transport.TTransport; +import org.apache.thrift.transport.TTransportException; + +import com.google.common.util.concurrent.ThreadFactoryBuilder; + +/** + * A bounded thread pool server customized for HBase. + */ +@InterfaceAudience.Private +public class TBoundedThreadPoolServer extends TServer { + + private static final String QUEUE_FULL_MSG = + "Queue is full, closing connection"; + + /** + * The "core size" of the thread pool. New threads are created on every + * connection until this many threads are created. + */ + public static final String MIN_WORKER_THREADS_CONF_KEY = + "hbase.thrift.minWorkerThreads"; + + /** + * This default core pool size should be enough for many test scenarios. We + * want to override this with a much larger number (e.g. at least 200) for a + * large-scale production setup. + */ + public static final int DEFAULT_MIN_WORKER_THREADS = 16; + + /** + * The maximum size of the thread pool. When the pending request queue + * overflows, new threads are created until their number reaches this number. + * After that, the server starts dropping connections. + */ + public static final String MAX_WORKER_THREADS_CONF_KEY = + "hbase.thrift.maxWorkerThreads"; + + public static final int DEFAULT_MAX_WORKER_THREADS = 1000; + + /** + * The maximum number of pending connections waiting in the queue. If there + * are no idle threads in the pool, the server queues requests. Only when + * the queue overflows, new threads are added, up to + * hbase.thrift.maxQueuedRequests threads. + */ + public static final String MAX_QUEUED_REQUESTS_CONF_KEY = + "hbase.thrift.maxQueuedRequests"; + + public static final int DEFAULT_MAX_QUEUED_REQUESTS = 1000; + + /** + * Default amount of time in seconds to keep a thread alive. Worker threads + * are stopped after being idle for this long. + */ + public static final String THREAD_KEEP_ALIVE_TIME_SEC_CONF_KEY = + "hbase.thrift.threadKeepAliveTimeSec"; + + private static final int DEFAULT_THREAD_KEEP_ALIVE_TIME_SEC = 60; + + /** + * Time to wait after interrupting all worker threads. This is after a clean + * shutdown has been attempted. + */ + public static final int TIME_TO_WAIT_AFTER_SHUTDOWN_MS = 5000; + + private static final Log LOG = LogFactory.getLog( + TBoundedThreadPoolServer.class.getName()); + + private final CallQueue callQueue; + + public static class Args extends TThreadPoolServer.Args { + int maxQueuedRequests; + int threadKeepAliveTimeSec; + + public Args(TServerTransport transport, Configuration conf) { + super(transport); + minWorkerThreads = conf.getInt(MIN_WORKER_THREADS_CONF_KEY, + DEFAULT_MIN_WORKER_THREADS); + maxWorkerThreads = conf.getInt(MAX_WORKER_THREADS_CONF_KEY, + DEFAULT_MAX_WORKER_THREADS); + maxQueuedRequests = conf.getInt(MAX_QUEUED_REQUESTS_CONF_KEY, + DEFAULT_MAX_QUEUED_REQUESTS); + threadKeepAliveTimeSec = conf.getInt(THREAD_KEEP_ALIVE_TIME_SEC_CONF_KEY, + DEFAULT_THREAD_KEEP_ALIVE_TIME_SEC); + } + + @Override + public String toString() { + return "min worker threads=" + minWorkerThreads + + ", max worker threads=" + maxWorkerThreads + + ", max queued requests=" + maxQueuedRequests; + } + } + + /** Executor service for handling client connections */ + private ThreadPoolExecutor executorService; + + /** Flag for stopping the server */ + private volatile boolean stopped; + + private Args serverOptions; + + public TBoundedThreadPoolServer(Args options, ThriftMetrics metrics) { + super(options); + + int minWorkerThreads = options.minWorkerThreads; + int maxWorkerThreads = options.maxWorkerThreads; + if (options.maxQueuedRequests > 0) { + this.callQueue = new CallQueue( + new LinkedBlockingQueue(options.maxQueuedRequests), metrics); + minWorkerThreads = maxWorkerThreads; + } else { + this.callQueue = new CallQueue(new SynchronousQueue(), metrics); + } + + ThreadFactoryBuilder tfb = new ThreadFactoryBuilder(); + tfb.setDaemon(true); + tfb.setNameFormat("thrift-worker-%d"); + executorService = + new ThreadPoolExecutor(minWorkerThreads, + maxWorkerThreads, options.threadKeepAliveTimeSec, + TimeUnit.SECONDS, this.callQueue, tfb.build()); + executorService.allowCoreThreadTimeOut(true); + serverOptions = options; + } + + public void serve() { + try { + serverTransport_.listen(); + } catch (TTransportException ttx) { + LOG.error("Error occurred during listening.", ttx); + return; + } + + Runtime.getRuntime().addShutdownHook( + new Thread(getClass().getSimpleName() + "-shutdown-hook") { + @Override + public void run() { + TBoundedThreadPoolServer.this.stop(); + } + }); + + stopped = false; + while (!stopped && !Thread.interrupted()) { + TTransport client = null; + try { + client = serverTransport_.accept(); + } catch (TTransportException ttx) { + if (!stopped) { + LOG.warn("Transport error when accepting message", ttx); + continue; + } else { + // The server has been stopped + break; + } + } + + ClientConnnection command = new ClientConnnection(client); + try { + executorService.execute(command); + } catch (RejectedExecutionException rex) { + if (client.getClass() == TSocket.class) { + // We expect the client to be TSocket. + LOG.warn(QUEUE_FULL_MSG + " from " + + ((TSocket) client).getSocket().getRemoteSocketAddress()); + } else { + LOG.warn(QUEUE_FULL_MSG, rex); + } + client.close(); + } + } + + shutdownServer(); + } + + /** + * Loop until {@link ExecutorService#awaitTermination} finally does return + * without an interrupted exception. If we don't do this, then we'll shut + * down prematurely. We want to let the executor service clear its task + * queue, closing client sockets appropriately. + */ + private void shutdownServer() { + executorService.shutdown(); + + long msLeftToWait = + serverOptions.stopTimeoutUnit.toMillis(serverOptions.stopTimeoutVal); + long timeMillis = System.currentTimeMillis(); + + LOG.info("Waiting for up to " + msLeftToWait + " ms to finish processing" + + " pending requests"); + boolean interrupted = false; + while (msLeftToWait >= 0) { + try { + executorService.awaitTermination(msLeftToWait, TimeUnit.MILLISECONDS); + break; + } catch (InterruptedException ix) { + long timePassed = System.currentTimeMillis() - timeMillis; + msLeftToWait -= timePassed; + timeMillis += timePassed; + interrupted = true; + } + } + + LOG.info("Interrupting all worker threads and waiting for " + + TIME_TO_WAIT_AFTER_SHUTDOWN_MS + " ms longer"); + + // This will interrupt all the threads, even those running a task. + executorService.shutdownNow(); + Threads.sleepWithoutInterrupt(TIME_TO_WAIT_AFTER_SHUTDOWN_MS); + + // Preserve the interrupted status. + if (interrupted) { + Thread.currentThread().interrupt(); + } + LOG.info("Thrift server shutdown complete"); + } + + @Override + public void stop() { + stopped = true; + serverTransport_.interrupt(); + } + + private class ClientConnnection implements Runnable { + + private TTransport client; + + /** + * Default constructor. + * + * @param client Transport to process + */ + private ClientConnnection(TTransport client) { + this.client = client; + } + + /** + * Loops on processing a client forever + */ + public void run() { + TProcessor processor = null; + TTransport inputTransport = null; + TTransport outputTransport = null; + TProtocol inputProtocol = null; + TProtocol outputProtocol = null; + try { + processor = processorFactory_.getProcessor(client); + inputTransport = inputTransportFactory_.getTransport(client); + outputTransport = outputTransportFactory_.getTransport(client); + inputProtocol = inputProtocolFactory_.getProtocol(inputTransport); + outputProtocol = outputProtocolFactory_.getProtocol(outputTransport); + // we check stopped_ first to make sure we're not supposed to be shutting + // down. this is necessary for graceful shutdown. + while (!stopped && processor.process(inputProtocol, outputProtocol)) {} + } catch (TTransportException ttx) { + // Assume the client died and continue silently + } catch (TException tx) { + LOG.error("Thrift error occurred during processing of message.", tx); + } catch (Exception x) { + LOG.error("Error occurred during processing of message.", x); + } + + if (inputTransport != null) { + inputTransport.close(); + } + + if (outputTransport != null) { + outputTransport.close(); + } + } + } +} diff --git "a/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/ThriftHttpServlet.java" "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/ThriftHttpServlet.java" new file mode 100644 index 00000000000..28aa0e14090 --- /dev/null +++ "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/ThriftHttpServlet.java" @@ -0,0 +1,226 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.hbase.thrift; + +import java.io.IOException; +import java.security.PrivilegedExceptionAction; + +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hbase.classification.InterfaceAudience; +import org.apache.hadoop.hbase.security.SecurityUtil; +import org.apache.hadoop.hbase.util.Base64; +import org.apache.hadoop.security.UserGroupInformation; +import org.apache.hadoop.security.authorize.AuthorizationException; +import org.apache.hadoop.security.authorize.ProxyUsers; +import org.apache.thrift.TProcessor; +import org.apache.thrift.protocol.TProtocolFactory; +import org.apache.thrift.server.TServlet; +import org.ietf.jgss.GSSContext; +import org.ietf.jgss.GSSCredential; +import org.ietf.jgss.GSSException; +import org.ietf.jgss.GSSManager; +import org.ietf.jgss.GSSName; +import org.ietf.jgss.Oid; + +/** + * Thrift Http Servlet is used for performing Kerberos authentication if security is enabled and + * also used for setting the user specified in "doAs" parameter. + */ +@InterfaceAudience.Private +public class ThriftHttpServlet extends TServlet { + private static final long serialVersionUID = 1L; + private static final Log LOG = LogFactory.getLog(ThriftHttpServlet.class.getName()); + private transient final UserGroupInformation realUser; + private transient final Configuration conf; + private final boolean securityEnabled; + private final boolean doAsEnabled; + private transient ThriftServerRunner.HBaseHandler hbaseHandler; + private String outToken; + + // HTTP Header related constants. + public static final String WWW_AUTHENTICATE = "WWW-Authenticate"; + public static final String AUTHORIZATION = "Authorization"; + public static final String NEGOTIATE = "Negotiate"; + + public ThriftHttpServlet(TProcessor processor, TProtocolFactory protocolFactory, + UserGroupInformation realUser, Configuration conf, ThriftServerRunner.HBaseHandler + hbaseHandler, boolean securityEnabled, boolean doAsEnabled) { + super(processor, protocolFactory); + this.realUser = realUser; + this.conf = conf; + this.hbaseHandler = hbaseHandler; + this.securityEnabled = securityEnabled; + this.doAsEnabled = doAsEnabled; + } + + @Override + protected void doPost(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + String effectiveUser = request.getRemoteUser(); + if (securityEnabled) { + try { + // As Thrift HTTP transport doesn't support SPNEGO yet (THRIFT-889), + // Kerberos authentication is being done at servlet level. + effectiveUser = doKerberosAuth(request); + // It is standard for client applications expect this header. + // Please see http://tools.ietf.org/html/rfc4559 for more details. + response.addHeader(WWW_AUTHENTICATE, NEGOTIATE + " " + outToken); + } catch (HttpAuthenticationException e) { + LOG.error("Kerberos Authentication failed", e); + // Send a 401 to the client + response.setStatus(HttpServletResponse.SC_UNAUTHORIZED); + response.addHeader(WWW_AUTHENTICATE, NEGOTIATE); + response.getWriter().println("Authentication Error: " + e.getMessage()); + return; + } + } + String doAsUserFromQuery = request.getHeader("doAs"); + if(effectiveUser == null) { + effectiveUser = realUser.getShortUserName(); + } + if (doAsUserFromQuery != null) { + if (!doAsEnabled) { + throw new ServletException("Support for proxyuser is not configured"); + } + // The authenticated remote user is attempting to perform 'doAs' proxy user. + UserGroupInformation remoteUser = UserGroupInformation.createRemoteUser(effectiveUser); + // create and attempt to authorize a proxy user (the client is attempting + // to do proxy user) + UserGroupInformation ugi = UserGroupInformation.createProxyUser(doAsUserFromQuery, + remoteUser); + // validate the proxy user authorization + try { + ProxyUsers.authorize(ugi, request.getRemoteAddr(), conf); + } catch (AuthorizationException e) { + throw new ServletException(e.getMessage()); + } + effectiveUser = doAsUserFromQuery; + } + hbaseHandler.setEffectiveUser(effectiveUser); + super.doPost(request, response); + } + + /** + * Do the GSS-API kerberos authentication. + * We already have a logged in subject in the form of serviceUGI, + * which GSS-API will extract information from. + */ + private String doKerberosAuth(HttpServletRequest request) + throws HttpAuthenticationException { + HttpKerberosServerAction action = new HttpKerberosServerAction(request, realUser); + try { + String principal = realUser.doAs(action); + outToken = action.outToken; + return principal; + } catch (Exception e) { + LOG.error("Failed to perform authentication"); + throw new HttpAuthenticationException(e); + } + } + + + private static class HttpKerberosServerAction implements PrivilegedExceptionAction { + HttpServletRequest request; + UserGroupInformation serviceUGI; + String outToken = null; + HttpKerberosServerAction(HttpServletRequest request, UserGroupInformation serviceUGI) { + this.request = request; + this.serviceUGI = serviceUGI; + } + + @Override + public String run() throws HttpAuthenticationException { + // Get own Kerberos credentials for accepting connection + GSSManager manager = GSSManager.getInstance(); + GSSContext gssContext = null; + String serverPrincipal = SecurityUtil.getPrincipalWithoutRealm(serviceUGI.getUserName()); + try { + // This Oid for Kerberos GSS-API mechanism. + Oid kerberosMechOid = new Oid("1.2.840.113554.1.2.2"); + // Oid for SPNego GSS-API mechanism. + Oid spnegoMechOid = new Oid("1.3.6.1.5.5.2"); + // Oid for kerberos principal name + Oid krb5PrincipalOid = new Oid("1.2.840.113554.1.2.2.1"); + // GSS name for server + GSSName serverName = manager.createName(serverPrincipal, krb5PrincipalOid); + // GSS credentials for server + GSSCredential serverCreds = manager.createCredential(serverName, + GSSCredential.DEFAULT_LIFETIME, + new Oid[]{kerberosMechOid, spnegoMechOid}, + GSSCredential.ACCEPT_ONLY); + // Create a GSS context + gssContext = manager.createContext(serverCreds); + // Get service ticket from the authorization header + String serviceTicketBase64 = getAuthHeader(request); + byte[] inToken = Base64.decode(serviceTicketBase64); + byte[] res = gssContext.acceptSecContext(inToken, 0, inToken.length); + if(res != null) { + outToken = Base64.encodeBytes(res).replace("\n", ""); + } + // Authenticate or deny based on its context completion + if (!gssContext.isEstablished()) { + throw new HttpAuthenticationException("Kerberos authentication failed: " + + "unable to establish context with the service ticket " + + "provided by the client."); + } + return SecurityUtil.getUserFromPrincipal(gssContext.getSrcName().toString()); + } catch (GSSException e) { + throw new HttpAuthenticationException("Kerberos authentication failed: ", e); + } finally { + if (gssContext != null) { + try { + gssContext.dispose(); + } catch (GSSException e) { + LOG.warn("Error while disposing GSS Context", e); + } + } + } + } + + /** + * Returns the base64 encoded auth header payload + * + * @throws HttpAuthenticationException if a remote or network exception occurs + */ + private String getAuthHeader(HttpServletRequest request) + throws HttpAuthenticationException { + String authHeader = request.getHeader(AUTHORIZATION); + // Each http request must have an Authorization header + if (authHeader == null || authHeader.isEmpty()) { + throw new HttpAuthenticationException("Authorization header received " + + "from the client is empty."); + } + String authHeaderBase64String; + int beginIndex = (NEGOTIATE + " ").length(); + authHeaderBase64String = authHeader.substring(beginIndex); + // Authorization header must have a payload + if (authHeaderBase64String == null || authHeaderBase64String.isEmpty()) { + throw new HttpAuthenticationException("Authorization header received " + + "from the client does not contain any data."); + } + return authHeaderBase64String; + } + } +} diff --git "a/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/ThriftMetrics.java" "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/ThriftMetrics.java" new file mode 100644 index 00000000000..883bbdccffc --- /dev/null +++ "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/ThriftMetrics.java" @@ -0,0 +1,90 @@ +/* + * Copyright The Apache Software Foundation + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with this + * work for additional information regarding copyright ownership. The ASF + * licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +package org.apache.hadoop.hbase.thrift; + +import org.apache.hadoop.hbase.classification.InterfaceAudience; +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hbase.CompatibilitySingletonFactory; + +/** + * This class is for maintaining the various statistics of thrift server + * and publishing them through the metrics interfaces. + */ +@InterfaceAudience.Private +public class ThriftMetrics { + + + public enum ThriftServerType { + ONE, + TWO + } + + public MetricsThriftServerSource getSource() { + return source; + } + + public void setSource(MetricsThriftServerSource source) { + this.source = source; + } + + private MetricsThriftServerSource source; + private final long slowResponseTime; + public static final String SLOW_RESPONSE_NANO_SEC = + "hbase.thrift.slow.response.nano.second"; + public static final long DEFAULT_SLOW_RESPONSE_NANO_SEC = 10 * 1000 * 1000; + + + public ThriftMetrics(Configuration conf, ThriftServerType t) { + slowResponseTime = conf.getLong( SLOW_RESPONSE_NANO_SEC, DEFAULT_SLOW_RESPONSE_NANO_SEC); + + if (t == ThriftServerType.ONE) { + source = CompatibilitySingletonFactory.getInstance(MetricsThriftServerSourceFactory.class).createThriftOneSource(); + } else if (t == ThriftServerType.TWO) { + source = CompatibilitySingletonFactory.getInstance(MetricsThriftServerSourceFactory.class).createThriftTwoSource(); + } + + } + + public void incTimeInQueue(long time) { + source.incTimeInQueue(time); + } + + public void setCallQueueLen(int len) { + source.setCallQueueLen(len); + } + + public void incNumRowKeysInBatchGet(int diff) { + source.incNumRowKeysInBatchGet(diff); + } + + public void incNumRowKeysInBatchMutate(int diff) { + source.incNumRowKeysInBatchMutate(diff); + } + + public void incMethodTime(String name, long time) { + source.incMethodTime(name, time); + // inc general processTime + source.incCall(time); + if (time > slowResponseTime) { + source.incSlowCall(time); + } + } + +} diff --git "a/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/ThriftServer.java" "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/ThriftServer.java" new file mode 100644 index 00000000000..560f788a050 --- /dev/null +++ "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/ThriftServer.java" @@ -0,0 +1,245 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.hbase.thrift; + +import java.util.Arrays; +import java.util.List; + +import org.apache.commons.cli.CommandLine; +import org.apache.commons.cli.CommandLineParser; +import org.apache.commons.cli.HelpFormatter; +import org.apache.commons.cli.Options; +import org.apache.commons.cli.PosixParser; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hbase.HBaseConfiguration; +import org.apache.hadoop.hbase.HBaseInterfaceAudience; +import org.apache.hadoop.hbase.classification.InterfaceAudience; +import org.apache.hadoop.hbase.http.InfoServer; +import org.apache.hadoop.hbase.thrift.ThriftServerRunner.ImplType; +import org.apache.hadoop.hbase.util.VersionInfo; +import org.apache.hadoop.util.Shell.ExitCodeException; + +/** + * ThriftServer- this class starts up a Thrift server which implements the + * Hbase API specified in the Hbase.thrift IDL file. The server runs in an + * independent process. + */ +@InterfaceAudience.LimitedPrivate(HBaseInterfaceAudience.TOOLS) +public class ThriftServer { + + private static final Log LOG = LogFactory.getLog(ThriftServer.class); + + private static final String MIN_WORKERS_OPTION = "minWorkers"; + private static final String MAX_WORKERS_OPTION = "workers"; + private static final String MAX_QUEUE_SIZE_OPTION = "queue"; + private static final String KEEP_ALIVE_SEC_OPTION = "keepAliveSec"; + static final String BIND_OPTION = "bind"; + static final String COMPACT_OPTION = "compact"; + static final String FRAMED_OPTION = "framed"; + static final String PORT_OPTION = "port"; + + private static final String DEFAULT_BIND_ADDR = "0.0.0.0"; + private static final int DEFAULT_LISTEN_PORT = 9090; + + private Configuration conf; + ThriftServerRunner serverRunner; + + private InfoServer infoServer; + + private static final String READ_TIMEOUT_OPTION = "readTimeout"; + + // + // Main program and support routines + // + + public ThriftServer(Configuration conf) { + this.conf = HBaseConfiguration.create(conf); + } + + private static void printUsageAndExit(Options options, int exitCode) + throws ExitCodeException { + HelpFormatter formatter = new HelpFormatter(); + formatter.printHelp("Thrift", null, options, + "To start the Thrift server run 'bin/hbase-daemon.sh start thrift'\n" + + "To shutdown the thrift server run 'bin/hbase-daemon.sh stop " + + "thrift' or send a kill signal to the thrift server pid", + true); + throw new ExitCodeException(exitCode, ""); + } + + /** + * Start up or shuts down the Thrift server, depending on the arguments. + * @param args + */ + void doMain(final String[] args) throws Exception { + processOptions(args); + + serverRunner = new ThriftServerRunner(conf); + + // Put up info server. + int port = conf.getInt("hbase.thrift.info.port", 9095); + if (port >= 0) { + conf.setLong("startcode", System.currentTimeMillis()); + String a = conf.get("hbase.thrift.info.bindAddress", "0.0.0.0"); + infoServer = new InfoServer("thrift", a, port, false, conf); + infoServer.setAttribute("hbase.conf", conf); + infoServer.start(); + } + serverRunner.run(); + } + + /** + * Parse the command line options to set parameters the conf. + */ + private void processOptions(final String[] args) throws Exception { + Options options = new Options(); + options.addOption("b", BIND_OPTION, true, "Address to bind " + + "the Thrift server to. [default: " + DEFAULT_BIND_ADDR + "]"); + options.addOption("p", PORT_OPTION, true, "Port to bind to [default: " + + DEFAULT_LISTEN_PORT + "]"); + options.addOption("f", FRAMED_OPTION, false, "Use framed transport"); + options.addOption("c", COMPACT_OPTION, false, "Use the compact protocol"); + options.addOption("h", "help", false, "Print help information"); + options.addOption(null, "infoport", true, "Port for web UI"); + + options.addOption("m", MIN_WORKERS_OPTION, true, + "The minimum number of worker threads for " + + ImplType.THREAD_POOL.simpleClassName()); + + options.addOption("w", MAX_WORKERS_OPTION, true, + "The maximum number of worker threads for " + + ImplType.THREAD_POOL.simpleClassName()); + + options.addOption("q", MAX_QUEUE_SIZE_OPTION, true, + "The maximum number of queued requests in " + + ImplType.THREAD_POOL.simpleClassName()); + + options.addOption("k", KEEP_ALIVE_SEC_OPTION, true, + "The amount of time in secods to keep a thread alive when idle in " + + ImplType.THREAD_POOL.simpleClassName()); + + options.addOption("t", READ_TIMEOUT_OPTION, true, + "Amount of time in milliseconds before a server thread will timeout " + + "waiting for client to send data on a connected socket. Currently, " + + "only applies to TBoundedThreadPoolServer"); + + options.addOptionGroup(ImplType.createOptionGroup()); + + CommandLineParser parser = new PosixParser(); + CommandLine cmd = parser.parse(options, args); + + // This is so complicated to please both bin/hbase and bin/hbase-daemon. + // hbase-daemon provides "start" and "stop" arguments + // hbase should print the help if no argument is provided + List commandLine = Arrays.asList(args); + boolean stop = commandLine.contains("stop"); + boolean start = commandLine.contains("start"); + boolean invalidStartStop = (start && stop) || (!start && !stop); + if (cmd.hasOption("help") || invalidStartStop) { + if (invalidStartStop) { + LOG.error("Exactly one of 'start' and 'stop' has to be specified"); + } + printUsageAndExit(options, 1); + } + + // Get port to bind to + try { + if (cmd.hasOption(PORT_OPTION)) { + int listenPort = Integer.parseInt(cmd.getOptionValue(PORT_OPTION)); + conf.setInt(ThriftServerRunner.PORT_CONF_KEY, listenPort); + } + } catch (NumberFormatException e) { + LOG.error("Could not parse the value provided for the port option", e); + printUsageAndExit(options, -1); + } + + // check for user-defined info server port setting, if so override the conf + try { + if (cmd.hasOption("infoport")) { + String val = cmd.getOptionValue("infoport"); + conf.setInt("hbase.thrift.info.port", Integer.parseInt(val)); + LOG.debug("Web UI port set to " + val); + } + } catch (NumberFormatException e) { + LOG.error("Could not parse the value provided for the infoport option", e); + printUsageAndExit(options, -1); + } + + // Make optional changes to the configuration based on command-line options + optionToConf(cmd, MIN_WORKERS_OPTION, + conf, TBoundedThreadPoolServer.MIN_WORKER_THREADS_CONF_KEY); + optionToConf(cmd, MAX_WORKERS_OPTION, + conf, TBoundedThreadPoolServer.MAX_WORKER_THREADS_CONF_KEY); + optionToConf(cmd, MAX_QUEUE_SIZE_OPTION, + conf, TBoundedThreadPoolServer.MAX_QUEUED_REQUESTS_CONF_KEY); + optionToConf(cmd, KEEP_ALIVE_SEC_OPTION, + conf, TBoundedThreadPoolServer.THREAD_KEEP_ALIVE_TIME_SEC_CONF_KEY); + optionToConf(cmd, READ_TIMEOUT_OPTION, conf, + ThriftServerRunner.THRIFT_SERVER_SOCKET_READ_TIMEOUT_KEY); + + // Set general thrift server options + boolean compact = cmd.hasOption(COMPACT_OPTION) || + conf.getBoolean(ThriftServerRunner.COMPACT_CONF_KEY, false); + conf.setBoolean(ThriftServerRunner.COMPACT_CONF_KEY, compact); + boolean framed = cmd.hasOption(FRAMED_OPTION) || + conf.getBoolean(ThriftServerRunner.FRAMED_CONF_KEY, false); + conf.setBoolean(ThriftServerRunner.FRAMED_CONF_KEY, framed); + if (cmd.hasOption(BIND_OPTION)) { + conf.set(ThriftServerRunner.BIND_CONF_KEY, cmd.getOptionValue(BIND_OPTION)); + } + + ImplType.setServerImpl(cmd, conf); + } + + public void stop() { + if (this.infoServer != null) { + LOG.info("Stopping infoServer"); + try { + this.infoServer.stop(); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + serverRunner.shutdown(); + } + + private static void optionToConf(CommandLine cmd, String option, + Configuration conf, String destConfKey) { + if (cmd.hasOption(option)) { + String value = cmd.getOptionValue(option); + LOG.info("Set configuration key:" + destConfKey + " value:" + value); + conf.set(destConfKey, value); + } + } + + /** + * @param args + * @throws Exception + */ + public static void main(String [] args) throws Exception { + VersionInfo.logVersion(); + try { + new ThriftServer(HBaseConfiguration.create()).doMain(args); + } catch (ExitCodeException ex) { + System.exit(ex.getExitCode()); + } + } +} diff --git "a/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java" "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java" new file mode 100644 index 00000000000..b82fa378d28 --- /dev/null +++ "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java" @@ -0,0 +1,1887 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.hbase.thrift; + +import static org.apache.hadoop.hbase.util.Bytes.getBytes; + +import java.io.IOException; +import java.net.InetAddress; +import java.net.InetSocketAddress; +import java.net.UnknownHostException; +import java.nio.ByteBuffer; +import java.security.PrivilegedAction; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.TreeMap; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.TimeUnit; + +import javax.security.auth.callback.Callback; +import javax.security.auth.callback.UnsupportedCallbackException; +import javax.security.sasl.AuthorizeCallback; +import javax.security.sasl.Sasl; +import javax.security.sasl.SaslServer; + +import org.apache.commons.cli.CommandLine; +import org.apache.commons.cli.Option; +import org.apache.commons.cli.OptionGroup; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hbase.HBaseConfiguration; +import org.apache.hadoop.hbase.HColumnDescriptor; +import org.apache.hadoop.hbase.HConstants; +import org.apache.hadoop.hbase.HRegionInfo; +import org.apache.hadoop.hbase.HRegionLocation; +import org.apache.hadoop.hbase.HTableDescriptor; +import org.apache.hadoop.hbase.KeyValue; +import org.apache.hadoop.hbase.MetaTableAccessor; +import org.apache.hadoop.hbase.ServerName; +import org.apache.hadoop.hbase.TableName; +import org.apache.hadoop.hbase.TableNotFoundException; +import org.apache.hadoop.hbase.classification.InterfaceAudience; +import org.apache.hadoop.hbase.client.Admin; +import org.apache.hadoop.hbase.client.Append; +import org.apache.hadoop.hbase.client.Delete; +import org.apache.hadoop.hbase.client.Durability; +import org.apache.hadoop.hbase.client.Get; +import org.apache.hadoop.hbase.client.Increment; +import org.apache.hadoop.hbase.client.OperationWithAttributes; +import org.apache.hadoop.hbase.client.Put; +import org.apache.hadoop.hbase.client.RegionLocator; +import org.apache.hadoop.hbase.client.Result; +import org.apache.hadoop.hbase.client.ResultScanner; +import org.apache.hadoop.hbase.client.Scan; +import org.apache.hadoop.hbase.client.Table; +import org.apache.hadoop.hbase.filter.Filter; +import org.apache.hadoop.hbase.filter.ParseFilter; +import org.apache.hadoop.hbase.filter.PrefixFilter; +import org.apache.hadoop.hbase.filter.WhileMatchFilter; +import org.apache.hadoop.hbase.security.SecurityUtil; +import org.apache.hadoop.hbase.security.UserProvider; +import org.apache.hadoop.hbase.thrift.CallQueue.Call; +import org.apache.hadoop.hbase.thrift.generated.AlreadyExists; +import org.apache.hadoop.hbase.thrift.generated.BatchMutation; +import org.apache.hadoop.hbase.thrift.generated.ColumnDescriptor; +import org.apache.hadoop.hbase.thrift.generated.Hbase; +import org.apache.hadoop.hbase.thrift.generated.IOError; +import org.apache.hadoop.hbase.thrift.generated.IllegalArgument; +import org.apache.hadoop.hbase.thrift.generated.Mutation; +import org.apache.hadoop.hbase.thrift.generated.TAppend; +import org.apache.hadoop.hbase.thrift.generated.TCell; +import org.apache.hadoop.hbase.thrift.generated.TIncrement; +import org.apache.hadoop.hbase.thrift.generated.TRegionInfo; +import org.apache.hadoop.hbase.thrift.generated.TRowResult; +import org.apache.hadoop.hbase.thrift.generated.TScan; +import org.apache.hadoop.hbase.util.Bytes; +import org.apache.hadoop.hbase.util.ConnectionCache; +import org.apache.hadoop.hbase.util.DNS; +import org.apache.hadoop.hbase.util.JvmPauseMonitor; +import org.apache.hadoop.hbase.util.Strings; +import org.apache.hadoop.security.SaslRpcServer.SaslGssCallbackHandler; +import org.apache.hadoop.security.UserGroupInformation; +import org.apache.hadoop.security.authorize.ProxyUsers; +import org.apache.thrift.TException; +import org.apache.thrift.TProcessor; +import org.apache.thrift.protocol.TBinaryProtocol; +import org.apache.thrift.protocol.TCompactProtocol; +import org.apache.thrift.protocol.TProtocol; +import org.apache.thrift.protocol.TProtocolFactory; +import org.apache.thrift.server.THsHaServer; +import org.apache.thrift.server.TNonblockingServer; +import org.apache.thrift.server.TServer; +import org.apache.thrift.server.TServlet; +import org.apache.thrift.server.TThreadedSelectorServer; +import org.apache.thrift.transport.TFramedTransport; +import org.apache.thrift.transport.TNonblockingServerSocket; +import org.apache.thrift.transport.TNonblockingServerTransport; +import org.apache.thrift.transport.TSaslServerTransport; +import org.apache.thrift.transport.TServerSocket; +import org.apache.thrift.transport.TServerTransport; +import org.apache.thrift.transport.TTransportFactory; +import org.mortbay.jetty.Connector; +import org.mortbay.jetty.Server; +import org.mortbay.jetty.nio.SelectChannelConnector; +import org.mortbay.jetty.security.SslSelectChannelConnector; +import org.mortbay.jetty.servlet.Context; +import org.mortbay.jetty.servlet.ServletHolder; +import org.mortbay.thread.QueuedThreadPool; + +import com.google.common.base.Joiner; +import com.google.common.base.Throwables; +import com.google.common.util.concurrent.ThreadFactoryBuilder; + +/** + * ThriftServerRunner - this class starts up a Thrift server which implements + * the Hbase API specified in the Hbase.thrift IDL file. + */ +@InterfaceAudience.Private +public class ThriftServerRunner implements Runnable { + + private static final Log LOG = LogFactory.getLog(ThriftServerRunner.class); + + static final String SERVER_TYPE_CONF_KEY = + "hbase.regionserver.thrift.server.type"; + + static final String BIND_CONF_KEY = "hbase.regionserver.thrift.ipaddress"; + static final String COMPACT_CONF_KEY = "hbase.regionserver.thrift.compact"; + static final String FRAMED_CONF_KEY = "hbase.regionserver.thrift.framed"; + static final String MAX_FRAME_SIZE_CONF_KEY = "hbase.regionserver.thrift.framed.max_frame_size_in_mb"; + static final String PORT_CONF_KEY = "hbase.regionserver.thrift.port"; + static final String COALESCE_INC_KEY = "hbase.regionserver.thrift.coalesceIncrement"; + static final String USE_HTTP_CONF_KEY = "hbase.regionserver.thrift.http"; + static final String HTTP_MIN_THREADS = "hbase.thrift.http_threads.min"; + static final String HTTP_MAX_THREADS = "hbase.thrift.http_threads.max"; + + static final String THRIFT_SSL_ENABLED = "hbase.thrift.ssl.enabled"; + static final String THRIFT_SSL_KEYSTORE_STORE = "hbase.thrift.ssl.keystore.store"; + static final String THRIFT_SSL_KEYSTORE_PASSWORD = "hbase.thrift.ssl.keystore.password"; + static final String THRIFT_SSL_KEYSTORE_KEYPASSWORD = "hbase.thrift.ssl.keystore.keypassword"; + + /** + * Amount of time in milliseconds before a server thread will timeout + * waiting for client to send data on a connected socket. Currently, + * applies only to TBoundedThreadPoolServer + */ + public static final String THRIFT_SERVER_SOCKET_READ_TIMEOUT_KEY = + "hbase.thrift.server.socket.read.timeout"; + public static final int THRIFT_SERVER_SOCKET_READ_TIMEOUT_DEFAULT = 60000; + + + /** + * Thrift quality of protection configuration key. Valid values can be: + * auth-conf: authentication, integrity and confidentiality checking + * auth-int: authentication and integrity checking + * auth: authentication only + * + * This is used to authenticate the callers and support impersonation. + * The thrift server and the HBase cluster must run in secure mode. + */ + static final String THRIFT_QOP_KEY = "hbase.thrift.security.qop"; + static final String BACKLOG_CONF_KEY = "hbase.regionserver.thrift.backlog"; + + private static final String DEFAULT_BIND_ADDR = "0.0.0.0"; + public static final int DEFAULT_LISTEN_PORT = 9090; + public static final int HREGION_VERSION = 1; + static final String THRIFT_SUPPORT_PROXYUSER = "hbase.thrift.support.proxyuser"; + private final int listenPort; + + private Configuration conf; + volatile TServer tserver; + volatile Server httpServer; + private final Hbase.Iface handler; + private final ThriftMetrics metrics; + private final HBaseHandler hbaseHandler; + private final UserGroupInformation realUser; + + private final String qop; + private String host; + + private final boolean securityEnabled; + private final boolean doAsEnabled; + + private final JvmPauseMonitor pauseMonitor; + + /** An enum of server implementation selections */ + enum ImplType { + HS_HA("hsha", true, THsHaServer.class, true), + NONBLOCKING("nonblocking", true, TNonblockingServer.class, true), + THREAD_POOL("threadpool", false, TBoundedThreadPoolServer.class, true), + THREADED_SELECTOR( + "threadedselector", true, TThreadedSelectorServer.class, true); + + public static final ImplType DEFAULT = THREAD_POOL; + + final String option; + final boolean isAlwaysFramed; + final Class serverClass; + final boolean canSpecifyBindIP; + + ImplType(String option, boolean isAlwaysFramed, + Class serverClass, boolean canSpecifyBindIP) { + this.option = option; + this.isAlwaysFramed = isAlwaysFramed; + this.serverClass = serverClass; + this.canSpecifyBindIP = canSpecifyBindIP; + } + + /** + * @return -option so we can get the list of options from + * {@link #values()} + */ + @Override + public String toString() { + return "-" + option; + } + + String getDescription() { + StringBuilder sb = new StringBuilder("Use the " + + serverClass.getSimpleName()); + if (isAlwaysFramed) { + sb.append(" This implies the framed transport."); + } + if (this == DEFAULT) { + sb.append("This is the default."); + } + return sb.toString(); + } + + static OptionGroup createOptionGroup() { + OptionGroup group = new OptionGroup(); + for (ImplType t : values()) { + group.addOption(new Option(t.option, t.getDescription())); + } + return group; + } + + static ImplType getServerImpl(Configuration conf) { + String confType = conf.get(SERVER_TYPE_CONF_KEY, THREAD_POOL.option); + for (ImplType t : values()) { + if (confType.equals(t.option)) { + return t; + } + } + throw new AssertionError("Unknown server ImplType.option:" + confType); + } + + static void setServerImpl(CommandLine cmd, Configuration conf) { + ImplType chosenType = null; + int numChosen = 0; + for (ImplType t : values()) { + if (cmd.hasOption(t.option)) { + chosenType = t; + ++numChosen; + } + } + if (numChosen < 1) { + LOG.info("Using default thrift server type"); + chosenType = DEFAULT; + } else if (numChosen > 1) { + throw new AssertionError("Exactly one option out of " + + Arrays.toString(values()) + " has to be specified"); + } + LOG.info("Using thrift server type " + chosenType.option); + conf.set(SERVER_TYPE_CONF_KEY, chosenType.option); + } + + public String simpleClassName() { + return serverClass.getSimpleName(); + } + + public static List serversThatCannotSpecifyBindIP() { + List l = new ArrayList(); + for (ImplType t : values()) { + if (!t.canSpecifyBindIP) { + l.add(t.simpleClassName()); + } + } + return l; + } + + } + + public ThriftServerRunner(Configuration conf) throws IOException { + UserProvider userProvider = UserProvider.instantiate(conf); + // login the server principal (if using secure Hadoop) + securityEnabled = userProvider.isHadoopSecurityEnabled() + && userProvider.isHBaseSecurityEnabled(); + if (securityEnabled) { + host = Strings.domainNamePointerToHostName(DNS.getDefaultHost( + conf.get("hbase.thrift.dns.interface", "default"), + conf.get("hbase.thrift.dns.nameserver", "default"))); + userProvider.login("hbase.thrift.keytab.file", + "hbase.thrift.kerberos.principal", host); + } + this.conf = HBaseConfiguration.create(conf); + this.listenPort = conf.getInt(PORT_CONF_KEY, DEFAULT_LISTEN_PORT); + this.metrics = new ThriftMetrics(conf, ThriftMetrics.ThriftServerType.ONE); + this.pauseMonitor = new JvmPauseMonitor(conf, this.metrics.getSource()); + this.hbaseHandler = new HBaseHandler(conf, userProvider); + this.hbaseHandler.initMetrics(metrics); + this.handler = HbaseHandlerMetricsProxy.newInstance( + hbaseHandler, metrics, conf); + this.realUser = userProvider.getCurrent().getUGI(); + qop = conf.get(THRIFT_QOP_KEY); + doAsEnabled = conf.getBoolean(THRIFT_SUPPORT_PROXYUSER, false); + if (qop != null) { + if (!qop.equals("auth") && !qop.equals("auth-int") + && !qop.equals("auth-conf")) { + throw new IOException("Invalid " + THRIFT_QOP_KEY + ": " + qop + + ", it must be 'auth', 'auth-int', or 'auth-conf'"); + } + if (!securityEnabled) { + throw new IOException("Thrift server must" + + " run in secure mode to support authentication"); + } + } + } + + /* + * Runs the Thrift server + */ + @Override + public void run() { + realUser.doAs(new PrivilegedAction() { + @Override + public Object run() { + try { + pauseMonitor.start(); + if (conf.getBoolean(USE_HTTP_CONF_KEY, false)) { + setupHTTPServer(); + httpServer.start(); + httpServer.join(); + } else { + setupServer(); + tserver.serve(); + } + } catch (Exception e) { + LOG.fatal("Cannot run ThriftServer", e); + // Crash the process if the ThriftServer is not running + System.exit(-1); + } + return null; + } + }); + + } + + public void shutdown() { + if (pauseMonitor != null) { + pauseMonitor.stop(); + } + if (tserver != null) { + tserver.stop(); + tserver = null; + } + if (httpServer != null) { + try { + httpServer.stop(); + httpServer = null; + } catch (Exception e) { + LOG.error("Problem encountered in shutting down HTTP server " + e.getCause()); + } + httpServer = null; + } + } + + private void setupHTTPServer() throws IOException { + TProtocolFactory protocolFactory = new TBinaryProtocol.Factory(); + TProcessor processor = new Hbase.Processor(handler); + TServlet thriftHttpServlet = new ThriftHttpServlet(processor, protocolFactory, realUser, + conf, hbaseHandler, securityEnabled, doAsEnabled); + + httpServer = new Server(); + // Context handler + Context context = new Context(httpServer, "/", Context.SESSIONS); + context.setContextPath("/"); + String httpPath = "/*"; + httpServer.setHandler(context); + context.addServlet(new ServletHolder(thriftHttpServlet), httpPath); + + // set up Jetty and run the embedded server + Connector connector = new SelectChannelConnector(); + if(conf.getBoolean(THRIFT_SSL_ENABLED, false)) { + SslSelectChannelConnector sslConnector = new SslSelectChannelConnector(); + String keystore = conf.get(THRIFT_SSL_KEYSTORE_STORE); + String password = HBaseConfiguration.getPassword(conf, + THRIFT_SSL_KEYSTORE_PASSWORD, null); + String keyPassword = HBaseConfiguration.getPassword(conf, + THRIFT_SSL_KEYSTORE_KEYPASSWORD, password); + sslConnector.setKeystore(keystore); + sslConnector.setPassword(password); + sslConnector.setKeyPassword(keyPassword); + connector = sslConnector; + } + String host = getBindAddress(conf).getHostAddress(); + connector.setPort(listenPort); + connector.setHost(host); + connector.setHeaderBufferSize(1024 * 64); + httpServer.addConnector(connector); + + if (doAsEnabled) { + ProxyUsers.refreshSuperUserGroupsConfiguration(conf); + } + + // Set the default max thread number to 100 to limit + // the number of concurrent requests so that Thrfit HTTP server doesn't OOM easily. + // Jetty set the default max thread number to 250, if we don't set it. + // + // Our default min thread number 2 is the same as that used by Jetty. + int minThreads = conf.getInt(HTTP_MIN_THREADS, 2); + int maxThreads = conf.getInt(HTTP_MAX_THREADS, 100); + QueuedThreadPool threadPool = new QueuedThreadPool(maxThreads); + threadPool.setMinThreads(minThreads); + httpServer.setThreadPool(threadPool); + + httpServer.setSendServerVersion(false); + httpServer.setSendDateHeader(false); + httpServer.setStopAtShutdown(true); + + LOG.info("Starting Thrift HTTP Server on " + Integer.toString(listenPort)); + } + + /** + * Setting up the thrift TServer + */ + private void setupServer() throws Exception { + // Construct correct ProtocolFactory + TProtocolFactory protocolFactory; + if (conf.getBoolean(COMPACT_CONF_KEY, false)) { + LOG.debug("Using compact protocol"); + protocolFactory = new TCompactProtocol.Factory(); + } else { + LOG.debug("Using binary protocol"); + protocolFactory = new TBinaryProtocol.Factory(); + } + + final TProcessor p = new Hbase.Processor(handler); + ImplType implType = ImplType.getServerImpl(conf); + TProcessor processor = p; + + // Construct correct TransportFactory + TTransportFactory transportFactory; + if (conf.getBoolean(FRAMED_CONF_KEY, false) || implType.isAlwaysFramed) { + if (qop != null) { + throw new RuntimeException("Thrift server authentication" + + " doesn't work with framed transport yet"); + } + transportFactory = new TFramedTransport.Factory( + conf.getInt(MAX_FRAME_SIZE_CONF_KEY, 2) * 1024 * 1024); + LOG.debug("Using framed transport"); + } else if (qop == null) { + transportFactory = new TTransportFactory(); + } else { + // Extract the name from the principal + String name = SecurityUtil.getUserFromPrincipal( + conf.get("hbase.thrift.kerberos.principal")); + Map saslProperties = new HashMap(); + saslProperties.put(Sasl.QOP, qop); + TSaslServerTransport.Factory saslFactory = new TSaslServerTransport.Factory(); + saslFactory.addServerDefinition("GSSAPI", name, host, saslProperties, + new SaslGssCallbackHandler() { + @Override + public void handle(Callback[] callbacks) + throws UnsupportedCallbackException { + AuthorizeCallback ac = null; + for (Callback callback : callbacks) { + if (callback instanceof AuthorizeCallback) { + ac = (AuthorizeCallback) callback; + } else { + throw new UnsupportedCallbackException(callback, + "Unrecognized SASL GSSAPI Callback"); + } + } + if (ac != null) { + String authid = ac.getAuthenticationID(); + String authzid = ac.getAuthorizationID(); + if (!authid.equals(authzid)) { + ac.setAuthorized(false); + } else { + ac.setAuthorized(true); + String userName = SecurityUtil.getUserFromPrincipal(authzid); + LOG.info("Effective user: " + userName); + ac.setAuthorizedID(userName); + } + } + } + }); + transportFactory = saslFactory; + + // Create a processor wrapper, to get the caller + processor = new TProcessor() { + @Override + public boolean process(TProtocol inProt, + TProtocol outProt) throws TException { + TSaslServerTransport saslServerTransport = + (TSaslServerTransport)inProt.getTransport(); + SaslServer saslServer = saslServerTransport.getSaslServer(); + String principal = saslServer.getAuthorizationID(); + hbaseHandler.setEffectiveUser(principal); + return p.process(inProt, outProt); + } + }; + } + + if (conf.get(BIND_CONF_KEY) != null && !implType.canSpecifyBindIP) { + LOG.error("Server types " + Joiner.on(", ").join( + ImplType.serversThatCannotSpecifyBindIP()) + " don't support IP " + + "address binding at the moment. See " + + "https://issues.apache.org/jira/browse/HBASE-2155 for details."); + throw new RuntimeException( + "-" + BIND_CONF_KEY + " not supported with " + implType); + } + + // Thrift's implementation uses '0' as a placeholder for 'use the default.' + int backlog = conf.getInt(BACKLOG_CONF_KEY, 0); + + if (implType == ImplType.HS_HA || implType == ImplType.NONBLOCKING || + implType == ImplType.THREADED_SELECTOR) { + InetAddress listenAddress = getBindAddress(conf); + TNonblockingServerTransport serverTransport = new TNonblockingServerSocket( + new InetSocketAddress(listenAddress, listenPort)); + + if (implType == ImplType.NONBLOCKING) { + TNonblockingServer.Args serverArgs = + new TNonblockingServer.Args(serverTransport); + serverArgs.processor(processor) + .transportFactory(transportFactory) + .protocolFactory(protocolFactory); + tserver = new TNonblockingServer(serverArgs); + } else if (implType == ImplType.HS_HA) { + THsHaServer.Args serverArgs = new THsHaServer.Args(serverTransport); + CallQueue callQueue = + new CallQueue(new LinkedBlockingQueue(), metrics); + ExecutorService executorService = createExecutor( + callQueue, serverArgs.getMaxWorkerThreads(), serverArgs.getMaxWorkerThreads()); + serverArgs.executorService(executorService) + .processor(processor) + .transportFactory(transportFactory) + .protocolFactory(protocolFactory); + tserver = new THsHaServer(serverArgs); + } else { // THREADED_SELECTOR + TThreadedSelectorServer.Args serverArgs = + new HThreadedSelectorServerArgs(serverTransport, conf); + CallQueue callQueue = + new CallQueue(new LinkedBlockingQueue(), metrics); + ExecutorService executorService = createExecutor( + callQueue, serverArgs.getWorkerThreads(), serverArgs.getWorkerThreads()); + serverArgs.executorService(executorService) + .processor(processor) + .transportFactory(transportFactory) + .protocolFactory(protocolFactory); + tserver = new TThreadedSelectorServer(serverArgs); + } + LOG.info("starting HBase " + implType.simpleClassName() + + " server on " + Integer.toString(listenPort)); + } else if (implType == ImplType.THREAD_POOL) { + // Thread pool server. Get the IP address to bind to. + InetAddress listenAddress = getBindAddress(conf); + int readTimeout = conf.getInt(THRIFT_SERVER_SOCKET_READ_TIMEOUT_KEY, + THRIFT_SERVER_SOCKET_READ_TIMEOUT_DEFAULT); + TServerTransport serverTransport = new TServerSocket( + new TServerSocket.ServerSocketTransportArgs(). + bindAddr(new InetSocketAddress(listenAddress, listenPort)). + backlog(backlog). + clientTimeout(readTimeout)); + + TBoundedThreadPoolServer.Args serverArgs = + new TBoundedThreadPoolServer.Args(serverTransport, conf); + serverArgs.processor(processor) + .transportFactory(transportFactory) + .protocolFactory(protocolFactory); + LOG.info("starting " + ImplType.THREAD_POOL.simpleClassName() + " on " + + listenAddress + ":" + Integer.toString(listenPort) + + " with readTimeout " + readTimeout + "ms; " + serverArgs); + TBoundedThreadPoolServer tserver = + new TBoundedThreadPoolServer(serverArgs, metrics); + this.tserver = tserver; + } else { + throw new AssertionError("Unsupported Thrift server implementation: " + + implType.simpleClassName()); + } + + // A sanity check that we instantiated the right type of server. + if (tserver.getClass() != implType.serverClass) { + throw new AssertionError("Expected to create Thrift server class " + + implType.serverClass.getName() + " but got " + + tserver.getClass().getName()); + } + + + + registerFilters(conf); + } + + ExecutorService createExecutor(BlockingQueue callQueue, + int minWorkers, int maxWorkers) { + ThreadFactoryBuilder tfb = new ThreadFactoryBuilder(); + tfb.setDaemon(true); + tfb.setNameFormat("thrift-worker-%d"); + ThreadPoolExecutor threadPool = new ThreadPoolExecutor(minWorkers, maxWorkers, + Long.MAX_VALUE, TimeUnit.SECONDS, callQueue, tfb.build()); + threadPool.allowCoreThreadTimeOut(true); + return threadPool; + } + + private InetAddress getBindAddress(Configuration conf) + throws UnknownHostException { + String bindAddressStr = conf.get(BIND_CONF_KEY, DEFAULT_BIND_ADDR); + return InetAddress.getByName(bindAddressStr); + } + + protected static class ResultScannerWrapper { + + private final ResultScanner scanner; + private final boolean sortColumns; + public ResultScannerWrapper(ResultScanner resultScanner, + boolean sortResultColumns) { + scanner = resultScanner; + sortColumns = sortResultColumns; + } + + public ResultScanner getScanner() { + return scanner; + } + + public boolean isColumnSorted() { + return sortColumns; + } + } + + /** + * The HBaseHandler is a glue object that connects Thrift RPC calls to the + * HBase client API primarily defined in the Admin and Table objects. + */ + public static class HBaseHandler implements Hbase.Iface { + protected Configuration conf; + protected static final Log LOG = LogFactory.getLog(HBaseHandler.class); + + // nextScannerId and scannerMap are used to manage scanner state + protected int nextScannerId = 0; + protected HashMap scannerMap = null; + private ThriftMetrics metrics = null; + + private final ConnectionCache connectionCache; + IncrementCoalescer coalescer = null; + + static final String CLEANUP_INTERVAL = "hbase.thrift.connection.cleanup-interval"; + static final String MAX_IDLETIME = "hbase.thrift.connection.max-idletime"; + + /** + * Returns a list of all the column families for a given Table. + * + * @param table + * @throws IOException + */ + byte[][] getAllColumns(Table table) throws IOException { + HColumnDescriptor[] cds = table.getTableDescriptor().getColumnFamilies(); + byte[][] columns = new byte[cds.length][]; + for (int i = 0; i < cds.length; i++) { + columns[i] = Bytes.add(cds[i].getName(), + KeyValue.COLUMN_FAMILY_DELIM_ARRAY); + } + return columns; + } + + /** + * Creates and returns a Table instance from a given table name. + * + * @param tableName + * name of table + * @return Table object + * @throws IOException + */ + public Table getTable(final byte[] tableName) throws + IOException { + String table = Bytes.toString(tableName); + return connectionCache.getTable(table); + } + + public Table getTable(final ByteBuffer tableName) throws IOException { + return getTable(getBytes(tableName)); + } + + /** + * Assigns a unique ID to the scanner and adds the mapping to an internal + * hash-map. + * + * @param scanner + * @return integer scanner id + */ + protected synchronized int addScanner(ResultScanner scanner,boolean sortColumns) { + int id = nextScannerId++; + ResultScannerWrapper resultScannerWrapper = new ResultScannerWrapper(scanner, sortColumns); + scannerMap.put(id, resultScannerWrapper); + return id; + } + + /** + * Returns the scanner associated with the specified ID. + * + * @param id + * @return a Scanner, or null if ID was invalid. + */ + protected synchronized ResultScannerWrapper getScanner(int id) { + return scannerMap.get(id); + } + + /** + * Removes the scanner associated with the specified ID from the internal + * id->scanner hash-map. + * + * @param id + * @return a Scanner, or null if ID was invalid. + */ + protected synchronized ResultScannerWrapper removeScanner(int id) { + return scannerMap.remove(id); + } + + protected HBaseHandler(final Configuration c, + final UserProvider userProvider) throws IOException { + this.conf = c; + scannerMap = new HashMap(); + this.coalescer = new IncrementCoalescer(this); + + int cleanInterval = conf.getInt(CLEANUP_INTERVAL, 10 * 1000); + int maxIdleTime = conf.getInt(MAX_IDLETIME, 10 * 60 * 1000); + connectionCache = new ConnectionCache( + conf, userProvider, cleanInterval, maxIdleTime); + } + + /** + * Obtain HBaseAdmin. Creates the instance if it is not already created. + */ + private Admin getAdmin() throws IOException { + return connectionCache.getAdmin(); + } + + void setEffectiveUser(String effectiveUser) { + connectionCache.setEffectiveUser(effectiveUser); + } + + @Override + public void enableTable(ByteBuffer tableName) throws IOError { + try{ + getAdmin().enableTable(getTableName(tableName)); + } catch (IOException e) { + LOG.warn(e.getMessage(), e); + throw new IOError(Throwables.getStackTraceAsString(e)); + } + } + + @Override + public void disableTable(ByteBuffer tableName) throws IOError{ + try{ + getAdmin().disableTable(getTableName(tableName)); + } catch (IOException e) { + LOG.warn(e.getMessage(), e); + throw new IOError(Throwables.getStackTraceAsString(e)); + } + } + + @Override + public boolean isTableEnabled(ByteBuffer tableName) throws IOError { + try { + return this.connectionCache.getAdmin().isTableEnabled(getTableName(tableName)); + } catch (IOException e) { + LOG.warn(e.getMessage(), e); + throw new IOError(Throwables.getStackTraceAsString(e)); + } + } + + // ThriftServerRunner.compact should be deprecated and replaced with methods specific to + // table and region. + @Override + public void compact(ByteBuffer tableNameOrRegionName) throws IOError { + try { + try { + getAdmin().compactRegion(getBytes(tableNameOrRegionName)); + } catch (IllegalArgumentException e) { + // Invalid region, try table + getAdmin().compact(TableName.valueOf(getBytes(tableNameOrRegionName))); + } + } catch (IOException e) { + LOG.warn(e.getMessage(), e); + throw new IOError(Throwables.getStackTraceAsString(e)); + } + } + + // ThriftServerRunner.majorCompact should be deprecated and replaced with methods specific + // to table and region. + @Override + public void majorCompact(ByteBuffer tableNameOrRegionName) throws IOError { + try { + try { + getAdmin().compactRegion(getBytes(tableNameOrRegionName)); + } catch (IllegalArgumentException e) { + // Invalid region, try table + getAdmin().compact(TableName.valueOf(getBytes(tableNameOrRegionName))); + } + } catch (IOException e) { + LOG.warn(e.getMessage(), e); + throw new IOError(Throwables.getStackTraceAsString(e)); + } + } + + @Override + public List getTableNames() throws IOError { + try { + TableName[] tableNames = this.getAdmin().listTableNames(); + ArrayList list = new ArrayList(tableNames.length); + for (int i = 0; i < tableNames.length; i++) { + list.add(ByteBuffer.wrap(tableNames[i].getName())); + } + return list; + } catch (IOException e) { + LOG.warn(e.getMessage(), e); + throw new IOError(Throwables.getStackTraceAsString(e)); + } + } + + /** + * @return the list of regions in the given table, or an empty list if the table does not exist + */ + @Override + public List getTableRegions(ByteBuffer tableName) + throws IOError { + try (RegionLocator locator = connectionCache.getRegionLocator(getBytes(tableName))) { + List regionLocations = locator.getAllRegionLocations(); + List results = new ArrayList(); + for (HRegionLocation regionLocation : regionLocations) { + HRegionInfo info = regionLocation.getRegionInfo(); + ServerName serverName = regionLocation.getServerName(); + TRegionInfo region = new TRegionInfo(); + region.serverName = ByteBuffer.wrap( + Bytes.toBytes(serverName.getHostname())); + region.port = serverName.getPort(); + region.startKey = ByteBuffer.wrap(info.getStartKey()); + region.endKey = ByteBuffer.wrap(info.getEndKey()); + region.id = info.getRegionId(); + region.name = ByteBuffer.wrap(info.getRegionName()); + region.version = HREGION_VERSION; // HRegion now not versioned, PB encoding used + results.add(region); + } + return results; + } catch (TableNotFoundException e) { + // Return empty list for non-existing table + return Collections.emptyList(); + } catch (IOException e){ + LOG.warn(e.getMessage(), e); + throw new IOError(Throwables.getStackTraceAsString(e)); + } + } + + @Override + public List get( + ByteBuffer tableName, ByteBuffer row, ByteBuffer column, + Map attributes) + throws IOError { + byte [][] famAndQf = KeyValue.parseColumn(getBytes(column)); + if (famAndQf.length == 1) { + return get(tableName, row, famAndQf[0], null, attributes); + } + if (famAndQf.length == 2) { + return get(tableName, row, famAndQf[0], famAndQf[1], attributes); + } + throw new IllegalArgumentException("Invalid familyAndQualifier provided."); + } + + /** + * Note: this internal interface is slightly different from public APIs in regard to handling + * of the qualifier. Here we differ from the public Java API in that null != byte[0]. Rather, + * we respect qual == null as a request for the entire column family. The caller ( + * {@link #get(ByteBuffer, ByteBuffer, ByteBuffer, Map)}) interface IS consistent in that the + * column is parse like normal. + */ + protected List get(ByteBuffer tableName, + ByteBuffer row, + byte[] family, + byte[] qualifier, + Map attributes) throws IOError { + Table table = null; + try { + table = getTable(tableName); + Get get = new Get(getBytes(row)); + addAttributes(get, attributes); + if (qualifier == null) { + get.addFamily(family); + } else { + get.addColumn(family, qualifier); + } + Result result = table.get(get); + return ThriftUtilities.cellFromHBase(result.rawCells()); + } catch (IOException e) { + LOG.warn(e.getMessage(), e); + throw new IOError(Throwables.getStackTraceAsString(e)); + } finally { + closeTable(table); + } + } + + @Override + public List getVer(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, + int numVersions, Map attributes) throws IOError { + byte [][] famAndQf = KeyValue.parseColumn(getBytes(column)); + if(famAndQf.length == 1) { + return getVer(tableName, row, famAndQf[0], null, numVersions, attributes); + } + if (famAndQf.length == 2) { + return getVer(tableName, row, famAndQf[0], famAndQf[1], numVersions, attributes); + } + throw new IllegalArgumentException("Invalid familyAndQualifier provided."); + + } + + /** + * Note: this public interface is slightly different from public Java APIs in regard to + * handling of the qualifier. Here we differ from the public Java API in that null != byte[0]. + * Rather, we respect qual == null as a request for the entire column family. If you want to + * access the entire column family, use + * {@link #getVer(ByteBuffer, ByteBuffer, ByteBuffer, int, Map)} with a {@code column} value + * that lacks a {@code ':'}. + */ + public List getVer(ByteBuffer tableName, ByteBuffer row, byte[] family, + byte[] qualifier, int numVersions, Map attributes) throws IOError { + + Table table = null; + try { + table = getTable(tableName); + Get get = new Get(getBytes(row)); + addAttributes(get, attributes); + if (null == qualifier) { + get.addFamily(family); + } else { + get.addColumn(family, qualifier); + } + get.setMaxVersions(numVersions); + Result result = table.get(get); + return ThriftUtilities.cellFromHBase(result.rawCells()); + } catch (IOException e) { + LOG.warn(e.getMessage(), e); + throw new IOError(Throwables.getStackTraceAsString(e)); + } finally{ + closeTable(table); + } + } + + @Override + public List getVerTs(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, + long timestamp, int numVersions, Map attributes) throws IOError { + byte [][] famAndQf = KeyValue.parseColumn(getBytes(column)); + if (famAndQf.length == 1) { + return getVerTs(tableName, row, famAndQf[0], null, timestamp, numVersions, attributes); + } + if (famAndQf.length == 2) { + return getVerTs(tableName, row, famAndQf[0], famAndQf[1], timestamp, numVersions, + attributes); + } + throw new IllegalArgumentException("Invalid familyAndQualifier provided."); + } + + /** + * Note: this internal interface is slightly different from public APIs in regard to handling + * of the qualifier. Here we differ from the public Java API in that null != byte[0]. Rather, + * we respect qual == null as a request for the entire column family. The caller ( + * {@link #getVerTs(ByteBuffer, ByteBuffer, ByteBuffer, long, int, Map)}) interface IS + * consistent in that the column is parse like normal. + */ + protected List getVerTs(ByteBuffer tableName, ByteBuffer row, byte[] family, + byte[] qualifier, long timestamp, int numVersions, Map attributes) + throws IOError { + + Table table = null; + try { + table = getTable(tableName); + Get get = new Get(getBytes(row)); + addAttributes(get, attributes); + if (null == qualifier) { + get.addFamily(family); + } else { + get.addColumn(family, qualifier); + } + get.setTimeRange(0, timestamp); + get.setMaxVersions(numVersions); + Result result = table.get(get); + return ThriftUtilities.cellFromHBase(result.rawCells()); + } catch (IOException e) { + LOG.warn(e.getMessage(), e); + throw new IOError(Throwables.getStackTraceAsString(e)); + } finally{ + closeTable(table); + } + } + + @Override + public List getRow(ByteBuffer tableName, ByteBuffer row, + Map attributes) throws IOError { + return getRowWithColumnsTs(tableName, row, null, + HConstants.LATEST_TIMESTAMP, + attributes); + } + + @Override + public List getRowWithColumns(ByteBuffer tableName, + ByteBuffer row, + List columns, + Map attributes) throws IOError { + return getRowWithColumnsTs(tableName, row, columns, + HConstants.LATEST_TIMESTAMP, + attributes); + } + + @Override + public List getRowTs(ByteBuffer tableName, ByteBuffer row, + long timestamp, Map attributes) throws IOError { + return getRowWithColumnsTs(tableName, row, null, + timestamp, attributes); + } + + @Override + public List getRowWithColumnsTs( + ByteBuffer tableName, ByteBuffer row, List columns, + long timestamp, Map attributes) throws IOError { + + Table table = null; + try { + table = getTable(tableName); + if (columns == null) { + Get get = new Get(getBytes(row)); + addAttributes(get, attributes); + get.setTimeRange(0, timestamp); + Result result = table.get(get); + return ThriftUtilities.rowResultFromHBase(result); + } + Get get = new Get(getBytes(row)); + addAttributes(get, attributes); + for(ByteBuffer column : columns) { + byte [][] famAndQf = KeyValue.parseColumn(getBytes(column)); + if (famAndQf.length == 1) { + get.addFamily(famAndQf[0]); + } else { + get.addColumn(famAndQf[0], famAndQf[1]); + } + } + get.setTimeRange(0, timestamp); + Result result = table.get(get); + return ThriftUtilities.rowResultFromHBase(result); + } catch (IOException e) { + LOG.warn(e.getMessage(), e); + throw new IOError(Throwables.getStackTraceAsString(e)); + } finally{ + closeTable(table); + } + } + + @Override + public List getRows(ByteBuffer tableName, + List rows, + Map attributes) + throws IOError { + return getRowsWithColumnsTs(tableName, rows, null, + HConstants.LATEST_TIMESTAMP, + attributes); + } + + @Override + public List getRowsWithColumns(ByteBuffer tableName, + List rows, + List columns, + Map attributes) throws IOError { + return getRowsWithColumnsTs(tableName, rows, columns, + HConstants.LATEST_TIMESTAMP, + attributes); + } + + @Override + public List getRowsTs(ByteBuffer tableName, + List rows, + long timestamp, + Map attributes) throws IOError { + return getRowsWithColumnsTs(tableName, rows, null, + timestamp, attributes); + } + + @Override + public List getRowsWithColumnsTs(ByteBuffer tableName, + List rows, + List columns, long timestamp, + Map attributes) throws IOError { + + Table table= null; + try { + List gets = new ArrayList(rows.size()); + table = getTable(tableName); + if (metrics != null) { + metrics.incNumRowKeysInBatchGet(rows.size()); + } + for (ByteBuffer row : rows) { + Get get = new Get(getBytes(row)); + addAttributes(get, attributes); + if (columns != null) { + + for(ByteBuffer column : columns) { + byte [][] famAndQf = KeyValue.parseColumn(getBytes(column)); + if (famAndQf.length == 1) { + get.addFamily(famAndQf[0]); + } else { + get.addColumn(famAndQf[0], famAndQf[1]); + } + } + } + get.setTimeRange(0, timestamp); + gets.add(get); + } + Result[] result = table.get(gets); + return ThriftUtilities.rowResultFromHBase(result); + } catch (IOException e) { + LOG.warn(e.getMessage(), e); + throw new IOError(Throwables.getStackTraceAsString(e)); + } finally{ + closeTable(table); + } + } + + @Override + public void deleteAll( + ByteBuffer tableName, ByteBuffer row, ByteBuffer column, + Map attributes) + throws IOError { + deleteAllTs(tableName, row, column, HConstants.LATEST_TIMESTAMP, + attributes); + } + + @Override + public void deleteAllTs(ByteBuffer tableName, + ByteBuffer row, + ByteBuffer column, + long timestamp, Map attributes) throws IOError { + Table table = null; + try { + table = getTable(tableName); + Delete delete = new Delete(getBytes(row)); + addAttributes(delete, attributes); + byte [][] famAndQf = KeyValue.parseColumn(getBytes(column)); + if (famAndQf.length == 1) { + delete.addFamily(famAndQf[0], timestamp); + } else { + delete.addColumns(famAndQf[0], famAndQf[1], timestamp); + } + table.delete(delete); + + } catch (IOException e) { + LOG.warn(e.getMessage(), e); + throw new IOError(Throwables.getStackTraceAsString(e)); + } finally { + closeTable(table); + } + } + + @Override + public void deleteAllRow( + ByteBuffer tableName, ByteBuffer row, + Map attributes) throws IOError { + deleteAllRowTs(tableName, row, HConstants.LATEST_TIMESTAMP, attributes); + } + + @Override + public void deleteAllRowTs( + ByteBuffer tableName, ByteBuffer row, long timestamp, + Map attributes) throws IOError { + Table table = null; + try { + table = getTable(tableName); + Delete delete = new Delete(getBytes(row), timestamp); + addAttributes(delete, attributes); + table.delete(delete); + } catch (IOException e) { + LOG.warn(e.getMessage(), e); + throw new IOError(Throwables.getStackTraceAsString(e)); + } finally { + closeTable(table); + } + } + + @Override + public void createTable(ByteBuffer in_tableName, + List columnFamilies) throws IOError, + IllegalArgument, AlreadyExists { + TableName tableName = getTableName(in_tableName); + try { + if (getAdmin().tableExists(tableName)) { + throw new AlreadyExists("table name already in use"); + } + HTableDescriptor desc = new HTableDescriptor(tableName); + for (ColumnDescriptor col : columnFamilies) { + HColumnDescriptor colDesc = ThriftUtilities.colDescFromThrift(col); + desc.addFamily(colDesc); + } + getAdmin().createTable(desc); + } catch (IOException e) { + LOG.warn(e.getMessage(), e); + throw new IOError(Throwables.getStackTraceAsString(e)); + } catch (IllegalArgumentException e) { + LOG.warn(e.getMessage(), e); + throw new IllegalArgument(Throwables.getStackTraceAsString(e)); + } + } + + private static TableName getTableName(ByteBuffer buffer) { + return TableName.valueOf(getBytes(buffer)); + } + + @Override + public void deleteTable(ByteBuffer in_tableName) throws IOError { + TableName tableName = getTableName(in_tableName); + if (LOG.isDebugEnabled()) { + LOG.debug("deleteTable: table=" + tableName); + } + try { + if (!getAdmin().tableExists(tableName)) { + throw new IOException("table does not exist"); + } + getAdmin().deleteTable(tableName); + } catch (IOException e) { + LOG.warn(e.getMessage(), e); + throw new IOError(Throwables.getStackTraceAsString(e)); + } + } + + @Override + public void mutateRow(ByteBuffer tableName, ByteBuffer row, + List mutations, Map attributes) + throws IOError, IllegalArgument { + mutateRowTs(tableName, row, mutations, HConstants.LATEST_TIMESTAMP, + attributes); + } + + @Override + public void mutateRowTs(ByteBuffer tableName, ByteBuffer row, + List mutations, long timestamp, + Map attributes) + throws IOError, IllegalArgument { + Table table = null; + try { + table = getTable(tableName); + Put put = new Put(getBytes(row), timestamp); + addAttributes(put, attributes); + + Delete delete = new Delete(getBytes(row)); + addAttributes(delete, attributes); + if (metrics != null) { + metrics.incNumRowKeysInBatchMutate(mutations.size()); + } + + // I apologize for all this mess :) + for (Mutation m : mutations) { + byte[][] famAndQf = KeyValue.parseColumn(getBytes(m.column)); + if (m.isDelete) { + if (famAndQf.length == 1) { + delete.addFamily(famAndQf[0], timestamp); + } else { + delete.addColumns(famAndQf[0], famAndQf[1], timestamp); + } + delete.setDurability(m.writeToWAL ? Durability.SYNC_WAL + : Durability.SKIP_WAL); + } else { + if(famAndQf.length == 1) { + LOG.warn("No column qualifier specified. Delete is the only mutation supported " + + "over the whole column family."); + } else { + put.addImmutable(famAndQf[0], famAndQf[1], + m.value != null ? getBytes(m.value) + : HConstants.EMPTY_BYTE_ARRAY); + } + put.setDurability(m.writeToWAL ? Durability.SYNC_WAL : Durability.SKIP_WAL); + } + } + if (!delete.isEmpty()) + table.delete(delete); + if (!put.isEmpty()) + table.put(put); + } catch (IOException e) { + LOG.warn(e.getMessage(), e); + throw new IOError(Throwables.getStackTraceAsString(e)); + } catch (IllegalArgumentException e) { + LOG.warn(e.getMessage(), e); + throw new IllegalArgument(Throwables.getStackTraceAsString(e)); + } finally{ + closeTable(table); + } + } + + @Override + public void mutateRows(ByteBuffer tableName, List rowBatches, + Map attributes) + throws IOError, IllegalArgument, TException { + mutateRowsTs(tableName, rowBatches, HConstants.LATEST_TIMESTAMP, attributes); + } + + @Override + public void mutateRowsTs( + ByteBuffer tableName, List rowBatches, long timestamp, + Map attributes) + throws IOError, IllegalArgument, TException { + List puts = new ArrayList(); + List deletes = new ArrayList(); + + for (BatchMutation batch : rowBatches) { + byte[] row = getBytes(batch.row); + List mutations = batch.mutations; + Delete delete = new Delete(row); + addAttributes(delete, attributes); + Put put = new Put(row, timestamp); + addAttributes(put, attributes); + for (Mutation m : mutations) { + byte[][] famAndQf = KeyValue.parseColumn(getBytes(m.column)); + if (m.isDelete) { + // no qualifier, family only. + if (famAndQf.length == 1) { + delete.addFamily(famAndQf[0], timestamp); + } else { + delete.addColumns(famAndQf[0], famAndQf[1], timestamp); + } + delete.setDurability(m.writeToWAL ? Durability.SYNC_WAL + : Durability.SKIP_WAL); + } else { + if (famAndQf.length == 1) { + LOG.warn("No column qualifier specified. Delete is the only mutation supported " + + "over the whole column family."); + } + if (famAndQf.length == 2) { + put.addImmutable(famAndQf[0], famAndQf[1], + m.value != null ? getBytes(m.value) + : HConstants.EMPTY_BYTE_ARRAY); + } else { + throw new IllegalArgumentException("Invalid famAndQf provided."); + } + put.setDurability(m.writeToWAL ? Durability.SYNC_WAL : Durability.SKIP_WAL); + } + } + if (!delete.isEmpty()) + deletes.add(delete); + if (!put.isEmpty()) + puts.add(put); + } + + Table table = null; + try { + table = getTable(tableName); + if (!puts.isEmpty()) + table.put(puts); + if (!deletes.isEmpty()) + table.delete(deletes); + + } catch (IOException e) { + LOG.warn(e.getMessage(), e); + throw new IOError(Throwables.getStackTraceAsString(e)); + } catch (IllegalArgumentException e) { + LOG.warn(e.getMessage(), e); + throw new IllegalArgument(Throwables.getStackTraceAsString(e)); + } finally{ + closeTable(table); + } + } + + @Override + public long atomicIncrement( + ByteBuffer tableName, ByteBuffer row, ByteBuffer column, long amount) + throws IOError, IllegalArgument, TException { + byte [][] famAndQf = KeyValue.parseColumn(getBytes(column)); + if(famAndQf.length == 1) { + return atomicIncrement(tableName, row, famAndQf[0], HConstants.EMPTY_BYTE_ARRAY, amount); + } + return atomicIncrement(tableName, row, famAndQf[0], famAndQf[1], amount); + } + + protected long atomicIncrement(ByteBuffer tableName, ByteBuffer row, + byte [] family, byte [] qualifier, long amount) + throws IOError, IllegalArgument, TException { + Table table = null; + try { + table = getTable(tableName); + return table.incrementColumnValue( + getBytes(row), family, qualifier, amount); + } catch (IOException e) { + LOG.warn(e.getMessage(), e); + throw new IOError(Throwables.getStackTraceAsString(e)); + } finally { + closeTable(table); + } + } + + @Override + public void scannerClose(int id) throws IOError, IllegalArgument { + LOG.debug("scannerClose: id=" + id); + ResultScannerWrapper resultScannerWrapper = getScanner(id); + if (resultScannerWrapper == null) { + String message = "scanner ID is invalid"; + LOG.warn(message); + throw new IllegalArgument("scanner ID is invalid"); + } + resultScannerWrapper.getScanner().close(); + removeScanner(id); + } + + @Override + public List scannerGetList(int id,int nbRows) + throws IllegalArgument, IOError { + LOG.debug("scannerGetList: id=" + id); + ResultScannerWrapper resultScannerWrapper = getScanner(id); + if (null == resultScannerWrapper) { + String message = "scanner ID is invalid"; + LOG.warn(message); + throw new IllegalArgument("scanner ID is invalid"); + } + + Result [] results = null; + try { + results = resultScannerWrapper.getScanner().next(nbRows); + if (null == results) { + return new ArrayList(); + } + } catch (IOException e) { + LOG.warn(e.getMessage(), e); + throw new IOError(Throwables.getStackTraceAsString(e)); + } + return ThriftUtilities.rowResultFromHBase(results, resultScannerWrapper.isColumnSorted()); + } + + @Override + public List scannerGet(int id) throws IllegalArgument, IOError { + return scannerGetList(id,1); + } + + @Override + public int scannerOpenWithScan(ByteBuffer tableName, TScan tScan, + Map attributes) + throws IOError { + + Table table = null; + try { + table = getTable(tableName); + Scan scan = new Scan(); + addAttributes(scan, attributes); + if (tScan.isSetStartRow()) { + scan.setStartRow(tScan.getStartRow()); + } + if (tScan.isSetStopRow()) { + scan.setStopRow(tScan.getStopRow()); + } + if (tScan.isSetTimestamp()) { + scan.setTimeRange(0, tScan.getTimestamp()); + } + if (tScan.isSetCaching()) { + scan.setCaching(tScan.getCaching()); + } + if (tScan.isSetBatchSize()) { + scan.setBatch(tScan.getBatchSize()); + } + if (tScan.isSetColumns() && tScan.getColumns().size() != 0) { + for(ByteBuffer column : tScan.getColumns()) { + byte [][] famQf = KeyValue.parseColumn(getBytes(column)); + if(famQf.length == 1) { + scan.addFamily(famQf[0]); + } else { + scan.addColumn(famQf[0], famQf[1]); + } + } + } + if (tScan.isSetFilterString()) { + ParseFilter parseFilter = new ParseFilter(); + scan.setFilter( + parseFilter.parseFilterString(tScan.getFilterString())); + } + if (tScan.isSetReversed()) { + scan.setReversed(tScan.isReversed()); + } + if (tScan.isSetCacheBlocks()) { + scan.setCacheBlocks(tScan.isCacheBlocks()); + } + return addScanner(table.getScanner(scan), tScan.sortColumns); + } catch (IOException e) { + LOG.warn(e.getMessage(), e); + throw new IOError(Throwables.getStackTraceAsString(e)); + } finally{ + closeTable(table); + } + } + + @Override + public int scannerOpen(ByteBuffer tableName, ByteBuffer startRow, + List columns, + Map attributes) throws IOError { + + Table table = null; + try { + table = getTable(tableName); + Scan scan = new Scan(getBytes(startRow)); + addAttributes(scan, attributes); + if(columns != null && columns.size() != 0) { + for(ByteBuffer column : columns) { + byte [][] famQf = KeyValue.parseColumn(getBytes(column)); + if(famQf.length == 1) { + scan.addFamily(famQf[0]); + } else { + scan.addColumn(famQf[0], famQf[1]); + } + } + } + return addScanner(table.getScanner(scan), false); + } catch (IOException e) { + LOG.warn(e.getMessage(), e); + throw new IOError(Throwables.getStackTraceAsString(e)); + } finally{ + closeTable(table); + } + } + + @Override + public int scannerOpenWithStop(ByteBuffer tableName, ByteBuffer startRow, + ByteBuffer stopRow, List columns, + Map attributes) + throws IOError, TException { + + Table table = null; + try { + table = getTable(tableName); + Scan scan = new Scan(getBytes(startRow), getBytes(stopRow)); + addAttributes(scan, attributes); + if(columns != null && columns.size() != 0) { + for(ByteBuffer column : columns) { + byte [][] famQf = KeyValue.parseColumn(getBytes(column)); + if(famQf.length == 1) { + scan.addFamily(famQf[0]); + } else { + scan.addColumn(famQf[0], famQf[1]); + } + } + } + return addScanner(table.getScanner(scan), false); + } catch (IOException e) { + LOG.warn(e.getMessage(), e); + throw new IOError(Throwables.getStackTraceAsString(e)); + } finally{ + closeTable(table); + } + } + + @Override + public int scannerOpenWithPrefix(ByteBuffer tableName, + ByteBuffer startAndPrefix, + List columns, + Map attributes) + throws IOError, TException { + + Table table = null; + try { + table = getTable(tableName); + Scan scan = new Scan(getBytes(startAndPrefix)); + addAttributes(scan, attributes); + Filter f = new WhileMatchFilter( + new PrefixFilter(getBytes(startAndPrefix))); + scan.setFilter(f); + if (columns != null && columns.size() != 0) { + for(ByteBuffer column : columns) { + byte [][] famQf = KeyValue.parseColumn(getBytes(column)); + if(famQf.length == 1) { + scan.addFamily(famQf[0]); + } else { + scan.addColumn(famQf[0], famQf[1]); + } + } + } + return addScanner(table.getScanner(scan), false); + } catch (IOException e) { + LOG.warn(e.getMessage(), e); + throw new IOError(Throwables.getStackTraceAsString(e)); + } finally{ + closeTable(table); + } + } + + @Override + public int scannerOpenTs(ByteBuffer tableName, ByteBuffer startRow, + List columns, long timestamp, + Map attributes) throws IOError, TException { + + Table table = null; + try { + table = getTable(tableName); + Scan scan = new Scan(getBytes(startRow)); + addAttributes(scan, attributes); + scan.setTimeRange(0, timestamp); + if (columns != null && columns.size() != 0) { + for (ByteBuffer column : columns) { + byte [][] famQf = KeyValue.parseColumn(getBytes(column)); + if(famQf.length == 1) { + scan.addFamily(famQf[0]); + } else { + scan.addColumn(famQf[0], famQf[1]); + } + } + } + return addScanner(table.getScanner(scan), false); + } catch (IOException e) { + LOG.warn(e.getMessage(), e); + throw new IOError(Throwables.getStackTraceAsString(e)); + } finally{ + closeTable(table); + } + } + + @Override + public int scannerOpenWithStopTs(ByteBuffer tableName, ByteBuffer startRow, + ByteBuffer stopRow, List columns, long timestamp, + Map attributes) + throws IOError, TException { + + Table table = null; + try { + table = getTable(tableName); + Scan scan = new Scan(getBytes(startRow), getBytes(stopRow)); + addAttributes(scan, attributes); + scan.setTimeRange(0, timestamp); + if (columns != null && columns.size() != 0) { + for (ByteBuffer column : columns) { + byte [][] famQf = KeyValue.parseColumn(getBytes(column)); + if(famQf.length == 1) { + scan.addFamily(famQf[0]); + } else { + scan.addColumn(famQf[0], famQf[1]); + } + } + } + scan.setTimeRange(0, timestamp); + return addScanner(table.getScanner(scan), false); + } catch (IOException e) { + LOG.warn(e.getMessage(), e); + throw new IOError(Throwables.getStackTraceAsString(e)); + } finally{ + closeTable(table); + } + } + + @Override + public Map getColumnDescriptors( + ByteBuffer tableName) throws IOError, TException { + + Table table = null; + try { + TreeMap columns = + new TreeMap(); + + table = getTable(tableName); + HTableDescriptor desc = table.getTableDescriptor(); + + for (HColumnDescriptor e : desc.getFamilies()) { + ColumnDescriptor col = ThriftUtilities.colDescFromHbase(e); + columns.put(col.name, col); + } + return columns; + } catch (IOException e) { + LOG.warn(e.getMessage(), e); + throw new IOError(Throwables.getStackTraceAsString(e)); + } finally { + closeTable(table); + } + } + + private void closeTable(Table table) throws IOError + { + try{ + if(table != null){ + table.close(); + } + } catch (IOException e){ + LOG.error(e.getMessage(), e); + throw new IOError(Throwables.getStackTraceAsString(e)); + } + } + + @Override + public TRegionInfo getRegionInfo(ByteBuffer searchRow) throws IOError { + try { + byte[] row = getBytes(searchRow); + Result startRowResult = getReverseScanResult(TableName.META_TABLE_NAME.getName(), row, + HConstants.CATALOG_FAMILY); + + if (startRowResult == null) { + throw new IOException("Cannot find row in "+ TableName.META_TABLE_NAME+", row=" + + Bytes.toStringBinary(row)); + } + + // find region start and end keys + HRegionInfo regionInfo = MetaTableAccessor.getHRegionInfo(startRowResult); + if (regionInfo == null) { + throw new IOException("HRegionInfo REGIONINFO was null or " + + " empty in Meta for row=" + + Bytes.toStringBinary(row)); + } + TRegionInfo region = new TRegionInfo(); + region.setStartKey(regionInfo.getStartKey()); + region.setEndKey(regionInfo.getEndKey()); + region.id = regionInfo.getRegionId(); + region.setName(regionInfo.getRegionName()); + region.version = HREGION_VERSION; // version not used anymore, PB encoding used. + + // find region assignment to server + ServerName serverName = MetaTableAccessor.getServerName(startRowResult, 0); + if (serverName != null) { + region.setServerName(Bytes.toBytes(serverName.getHostname())); + region.port = serverName.getPort(); + } + return region; + } catch (IOException e) { + LOG.warn(e.getMessage(), e); + throw new IOError(Throwables.getStackTraceAsString(e)); + } + } + + private Result getReverseScanResult(byte[] tableName, byte[] row, byte[] family) + throws IOException { + Scan scan = new Scan(row); + scan.setReversed(true); + scan.addFamily(family); + scan.setStartRow(row); + Table table = getTable(tableName); + try (ResultScanner scanner = table.getScanner(scan)) { + return scanner.next(); + } finally{ + if(table != null){ + table.close(); + } + } + } + + private void initMetrics(ThriftMetrics metrics) { + this.metrics = metrics; + } + + @Override + public void increment(TIncrement tincrement) throws IOError, TException { + + if (tincrement.getRow().length == 0 || tincrement.getTable().length == 0) { + throw new TException("Must supply a table and a row key; can't increment"); + } + + if (conf.getBoolean(COALESCE_INC_KEY, false)) { + this.coalescer.queueIncrement(tincrement); + return; + } + + Table table = null; + try { + table = getTable(tincrement.getTable()); + Increment inc = ThriftUtilities.incrementFromThrift(tincrement); + table.increment(inc); + } catch (IOException e) { + LOG.warn(e.getMessage(), e); + throw new IOError(Throwables.getStackTraceAsString(e)); + } finally{ + closeTable(table); + } + } + + @Override + public void incrementRows(List tincrements) throws IOError, TException { + if (conf.getBoolean(COALESCE_INC_KEY, false)) { + this.coalescer.queueIncrements(tincrements); + return; + } + for (TIncrement tinc : tincrements) { + increment(tinc); + } + } + + @Override + public List append(TAppend tappend) throws IOError, TException { + if (tappend.getRow().length == 0 || tappend.getTable().length == 0) { + throw new TException("Must supply a table and a row key; can't append"); + } + + Table table = null; + try { + table = getTable(tappend.getTable()); + Append append = ThriftUtilities.appendFromThrift(tappend); + Result result = table.append(append); + return ThriftUtilities.cellFromHBase(result.rawCells()); + } catch (IOException e) { + LOG.warn(e.getMessage(), e); + throw new IOError(Throwables.getStackTraceAsString(e)); + } finally{ + closeTable(table); + } + } + + @Override + public boolean checkAndPut(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, + ByteBuffer value, Mutation mput, Map attributes) throws IOError, + IllegalArgument, TException { + Put put; + try { + put = new Put(getBytes(row), HConstants.LATEST_TIMESTAMP); + addAttributes(put, attributes); + + byte[][] famAndQf = KeyValue.parseColumn(getBytes(mput.column)); + + put.addImmutable(famAndQf[0], famAndQf[1], mput.value != null ? getBytes(mput.value) + : HConstants.EMPTY_BYTE_ARRAY); + + put.setDurability(mput.writeToWAL ? Durability.SYNC_WAL : Durability.SKIP_WAL); + } catch (IllegalArgumentException e) { + LOG.warn(e.getMessage(), e); + throw new IllegalArgument(Throwables.getStackTraceAsString(e)); + } + + Table table = null; + try { + table = getTable(tableName); + byte[][] famAndQf = KeyValue.parseColumn(getBytes(column)); + return table.checkAndPut(getBytes(row), famAndQf[0], famAndQf[1], + value != null ? getBytes(value) : HConstants.EMPTY_BYTE_ARRAY, put); + } catch (IOException e) { + LOG.warn(e.getMessage(), e); + throw new IOError(Throwables.getStackTraceAsString(e)); + } catch (IllegalArgumentException e) { + LOG.warn(e.getMessage(), e); + throw new IllegalArgument(Throwables.getStackTraceAsString(e)); + } finally { + closeTable(table); + } + } + } + + + + /** + * Adds all the attributes into the Operation object + */ + private static void addAttributes(OperationWithAttributes op, + Map attributes) { + if (attributes == null || attributes.size() == 0) { + return; + } + for (Map.Entry entry : attributes.entrySet()) { + String name = Bytes.toStringBinary(getBytes(entry.getKey())); + byte[] value = getBytes(entry.getValue()); + op.setAttribute(name, value); + } + } + + public static void registerFilters(Configuration conf) { + String[] filters = conf.getStrings("hbase.thrift.filters"); + if(filters != null) { + for(String filterClass: filters) { + String[] filterPart = filterClass.split(":"); + if(filterPart.length != 2) { + LOG.warn("Invalid filter specification " + filterClass + " - skipping"); + } else { + ParseFilter.registerFilter(filterPart[0], filterPart[1]); + } + } + } + } +} diff --git "a/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/ThriftUtilities.java" "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/ThriftUtilities.java" new file mode 100644 index 00000000000..9a3eb581760 --- /dev/null +++ "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/ThriftUtilities.java" @@ -0,0 +1,235 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.hbase.thrift; + +import static org.apache.hadoop.hbase.util.Bytes.getBytes; + +import java.nio.ByteBuffer; +import java.util.ArrayList; +import java.util.List; +import java.util.Locale; +import java.util.TreeMap; + +import org.apache.hadoop.hbase.classification.InterfaceAudience; +import org.apache.hadoop.hbase.Cell; +import org.apache.hadoop.hbase.CellUtil; +import org.apache.hadoop.hbase.HColumnDescriptor; +import org.apache.hadoop.hbase.KeyValue; +import org.apache.hadoop.hbase.client.Append; +import org.apache.hadoop.hbase.client.Increment; +import org.apache.hadoop.hbase.client.Result; +import org.apache.hadoop.hbase.io.compress.Compression; +import org.apache.hadoop.hbase.regionserver.BloomType; +import org.apache.hadoop.hbase.thrift.generated.ColumnDescriptor; +import org.apache.hadoop.hbase.thrift.generated.IllegalArgument; +import org.apache.hadoop.hbase.thrift.generated.TAppend; +import org.apache.hadoop.hbase.thrift.generated.TCell; +import org.apache.hadoop.hbase.thrift.generated.TColumn; +import org.apache.hadoop.hbase.thrift.generated.TIncrement; +import org.apache.hadoop.hbase.thrift.generated.TRowResult; +import org.apache.hadoop.hbase.util.Bytes; + +@InterfaceAudience.Private +public class ThriftUtilities { + + /** + * This utility method creates a new Hbase HColumnDescriptor object based on a + * Thrift ColumnDescriptor "struct". + * + * @param in + * Thrift ColumnDescriptor object + * @return HColumnDescriptor + * @throws IllegalArgument + */ + static public HColumnDescriptor colDescFromThrift(ColumnDescriptor in) + throws IllegalArgument { + Compression.Algorithm comp = + Compression.getCompressionAlgorithmByName(in.compression.toLowerCase(Locale.ROOT)); + BloomType bt = + BloomType.valueOf(in.bloomFilterType); + + if (in.name == null || !in.name.hasRemaining()) { + throw new IllegalArgument("column name is empty"); + } + byte [] parsedName = KeyValue.parseColumn(Bytes.getBytes(in.name))[0]; + HColumnDescriptor col = new HColumnDescriptor(parsedName) + .setMaxVersions(in.maxVersions) + .setCompressionType(comp) + .setInMemory(in.inMemory) + .setBlockCacheEnabled(in.blockCacheEnabled) + .setTimeToLive(in.timeToLive > 0 ? in.timeToLive : Integer.MAX_VALUE) + .setBloomFilterType(bt); + return col; + } + + /** + * This utility method creates a new Thrift ColumnDescriptor "struct" based on + * an Hbase HColumnDescriptor object. + * + * @param in + * Hbase HColumnDescriptor object + * @return Thrift ColumnDescriptor + */ + static public ColumnDescriptor colDescFromHbase(HColumnDescriptor in) { + ColumnDescriptor col = new ColumnDescriptor(); + col.name = ByteBuffer.wrap(Bytes.add(in.getName(), KeyValue.COLUMN_FAMILY_DELIM_ARRAY)); + col.maxVersions = in.getMaxVersions(); + col.compression = in.getCompressionType().toString(); + col.inMemory = in.isInMemory(); + col.blockCacheEnabled = in.isBlockCacheEnabled(); + col.bloomFilterType = in.getBloomFilterType().toString(); + col.timeToLive = in.getTimeToLive(); + return col; + } + + /** + * This utility method creates a list of Thrift TCell "struct" based on + * an Hbase Cell object. The empty list is returned if the input is null. + * + * @param in + * Hbase Cell object + * @return Thrift TCell array + */ + static public List cellFromHBase(Cell in) { + List list = new ArrayList(1); + if (in != null) { + list.add(new TCell(ByteBuffer.wrap(CellUtil.cloneValue(in)), in.getTimestamp())); + } + return list; + } + + /** + * This utility method creates a list of Thrift TCell "struct" based on + * an Hbase Cell array. The empty list is returned if the input is null. + * @param in Hbase Cell array + * @return Thrift TCell array + */ + static public List cellFromHBase(Cell[] in) { + List list = null; + if (in != null) { + list = new ArrayList(in.length); + for (int i = 0; i < in.length; i++) { + list.add(new TCell(ByteBuffer.wrap(CellUtil.cloneValue(in[i])), in[i].getTimestamp())); + } + } else { + list = new ArrayList(0); + } + return list; + } + + /** + * This utility method creates a list of Thrift TRowResult "struct" based on + * an Hbase RowResult object. The empty list is returned if the input is + * null. + * + * @param in + * Hbase RowResult object + * @param sortColumns + * This boolean dictates if row data is returned in a sorted order + * sortColumns = True will set TRowResult's sortedColumns member + * which is an ArrayList of TColumn struct + * sortColumns = False will set TRowResult's columns member which is + * a map of columnName and TCell struct + * @return Thrift TRowResult array + */ + static public List rowResultFromHBase(Result[] in, boolean sortColumns) { + List results = new ArrayList(); + for ( Result result_ : in) { + if(result_ == null || result_.isEmpty()) { + continue; + } + TRowResult result = new TRowResult(); + result.row = ByteBuffer.wrap(result_.getRow()); + if (sortColumns) { + result.sortedColumns = new ArrayList(); + for (Cell kv : result_.rawCells()) { + result.sortedColumns.add(new TColumn( + ByteBuffer.wrap(KeyValue.makeColumn(CellUtil.cloneFamily(kv), + CellUtil.cloneQualifier(kv))), + new TCell(ByteBuffer.wrap(CellUtil.cloneValue(kv)), kv.getTimestamp()))); + } + } else { + result.columns = new TreeMap(); + for (Cell kv : result_.rawCells()) { + result.columns.put( + ByteBuffer.wrap(KeyValue.makeColumn(CellUtil.cloneFamily(kv), + CellUtil.cloneQualifier(kv))), + new TCell(ByteBuffer.wrap(CellUtil.cloneValue(kv)), kv.getTimestamp())); + } + } + results.add(result); + } + return results; + } + + /** + * This utility method creates a list of Thrift TRowResult "struct" based on + * an array of Hbase RowResult objects. The empty list is returned if the input is + * null. + * + * @param in + * Array of Hbase RowResult objects + * @return Thrift TRowResult array + */ + static public List rowResultFromHBase(Result[] in) { + return rowResultFromHBase(in, false); + } + + static public List rowResultFromHBase(Result in) { + Result [] result = { in }; + return rowResultFromHBase(result); + } + + /** + * From a {@link TIncrement} create an {@link Increment}. + * @param tincrement the Thrift version of an increment + * @return an increment that the {@link TIncrement} represented. + */ + public static Increment incrementFromThrift(TIncrement tincrement) { + Increment inc = new Increment(tincrement.getRow()); + byte[][] famAndQf = KeyValue.parseColumn(tincrement.getColumn()); + if (famAndQf.length != 2) return null; + inc.addColumn(famAndQf[0], famAndQf[1], tincrement.getAmmount()); + return inc; + } + + /** + * From a {@link TAppend} create an {@link Append}. + * @param tappend the Thrift version of an append. + * @return an increment that the {@link TAppend} represented. + */ + public static Append appendFromThrift(TAppend tappend) { + Append append = new Append(tappend.getRow()); + List columns = tappend.getColumns(); + List values = tappend.getValues(); + + if (columns.size() != values.size()) { + throw new IllegalArgumentException( + "Sizes of columns and values in tappend object are not matching"); + } + + int length = columns.size(); + + for (int i = 0; i < length; i++) { + byte[][] famAndQf = KeyValue.parseColumn(getBytes(columns.get(i))); + append.add(famAndQf[0], famAndQf[1], getBytes(values.get(i))); + } + return append; + } +} diff --git "a/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/generated/AlreadyExists.java" "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/generated/AlreadyExists.java" new file mode 100644 index 00000000000..68361c114f1 --- /dev/null +++ "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/generated/AlreadyExists.java" @@ -0,0 +1,402 @@ +/** + * 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.thrift.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"}) +/** + * 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") +public class AlreadyExists extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("AlreadyExists"); + + private static final org.apache.thrift.protocol.TField MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("message", org.apache.thrift.protocol.TType.STRING, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new AlreadyExistsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new AlreadyExistsTupleSchemeFactory()); + } + + public String message; // 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 { + MESSAGE((short)1, "message"); + + private static final Map byName = new HashMap(); + + 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: // MESSAGE + return MESSAGE; + 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.MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("message", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(AlreadyExists.class, metaDataMap); + } + + public AlreadyExists() { + } + + public AlreadyExists( + String message) + { + this(); + this.message = message; + } + + /** + * Performs a deep copy on other. + */ + public AlreadyExists(AlreadyExists other) { + if (other.isSetMessage()) { + this.message = other.message; + } + } + + public AlreadyExists deepCopy() { + return new AlreadyExists(this); + } + + @Override + public void clear() { + this.message = null; + } + + public String getMessage() { + return this.message; + } + + public AlreadyExists setMessage(String message) { + this.message = message; + return this; + } + + public void unsetMessage() { + this.message = null; + } + + /** Returns true if field message is set (has been assigned a value) and false otherwise */ + public boolean isSetMessage() { + return this.message != null; + } + + public void setMessageIsSet(boolean value) { + if (!value) { + this.message = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case MESSAGE: + if (value == null) { + unsetMessage(); + } else { + setMessage((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case MESSAGE: + return getMessage(); + + } + 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 MESSAGE: + return isSetMessage(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof AlreadyExists) + return this.equals((AlreadyExists)that); + return false; + } + + public boolean equals(AlreadyExists that) { + if (that == null) + return false; + + boolean this_present_message = true && this.isSetMessage(); + boolean that_present_message = true && that.isSetMessage(); + if (this_present_message || that_present_message) { + if (!(this_present_message && that_present_message)) + return false; + if (!this.message.equals(that.message)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_message = true && (isSetMessage()); + list.add(present_message); + if (present_message) + list.add(message); + + return list.hashCode(); + } + + @Override + public int compareTo(AlreadyExists other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetMessage()).compareTo(other.isSetMessage()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetMessage()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.message, other.message); + 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("AlreadyExists("); + boolean first = true; + + sb.append("message:"); + if (this.message == null) { + sb.append("null"); + } else { + sb.append(this.message); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 AlreadyExistsStandardSchemeFactory implements SchemeFactory { + public AlreadyExistsStandardScheme getScheme() { + return new AlreadyExistsStandardScheme(); + } + } + + private static class AlreadyExistsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, AlreadyExists 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: // MESSAGE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.message = iprot.readString(); + struct.setMessageIsSet(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, AlreadyExists struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.message != null) { + oprot.writeFieldBegin(MESSAGE_FIELD_DESC); + oprot.writeString(struct.message); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class AlreadyExistsTupleSchemeFactory implements SchemeFactory { + public AlreadyExistsTupleScheme getScheme() { + return new AlreadyExistsTupleScheme(); + } + } + + private static class AlreadyExistsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, AlreadyExists struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetMessage()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetMessage()) { + oprot.writeString(struct.message); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, AlreadyExists struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.message = iprot.readString(); + struct.setMessageIsSet(true); + } + } + } + +} + diff --git "a/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/generated/BatchMutation.java" "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/generated/BatchMutation.java" new file mode 100644 index 00000000000..a2920eac02f --- /dev/null +++ "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/generated/BatchMutation.java" @@ -0,0 +1,570 @@ +/** + * 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.thrift.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"}) +/** + * 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") +public class BatchMutation implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("BatchMutation"); + + 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 MUTATIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("mutations", org.apache.thrift.protocol.TType.LIST, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new BatchMutationStandardSchemeFactory()); + schemes.put(TupleScheme.class, new BatchMutationTupleSchemeFactory()); + } + + public ByteBuffer row; // required + public List mutations; // 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 { + ROW((short)1, "row"), + MUTATIONS((short)2, "mutations"); + + private static final Map byName = new HashMap(); + + 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: // ROW + return ROW; + case 2: // MUTATIONS + return MUTATIONS; + 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.ROW, new org.apache.thrift.meta_data.FieldMetaData("row", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.MUTATIONS, new org.apache.thrift.meta_data.FieldMetaData("mutations", org.apache.thrift.TFieldRequirementType.DEFAULT, + 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, Mutation.class)))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(BatchMutation.class, metaDataMap); + } + + public BatchMutation() { + } + + public BatchMutation( + ByteBuffer row, + List mutations) + { + this(); + this.row = org.apache.thrift.TBaseHelper.copyBinary(row); + this.mutations = mutations; + } + + /** + * Performs a deep copy on other. + */ + public BatchMutation(BatchMutation other) { + if (other.isSetRow()) { + this.row = other.row; + } + if (other.isSetMutations()) { + List __this__mutations = new ArrayList(other.mutations.size()); + for (Mutation other_element : other.mutations) { + __this__mutations.add(new Mutation(other_element)); + } + this.mutations = __this__mutations; + } + } + + public BatchMutation deepCopy() { + return new BatchMutation(this); + } + + @Override + public void clear() { + this.row = null; + this.mutations = null; + } + + public byte[] getRow() { + setRow(org.apache.thrift.TBaseHelper.rightSize(row)); + return row == null ? null : row.array(); + } + + public ByteBuffer bufferForRow() { + return org.apache.thrift.TBaseHelper.copyBinary(row); + } + + public BatchMutation setRow(byte[] row) { + this.row = row == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(row, row.length)); + return this; + } + + public BatchMutation setRow(ByteBuffer row) { + this.row = org.apache.thrift.TBaseHelper.copyBinary(row); + return this; + } + + public void unsetRow() { + this.row = null; + } + + /** Returns true if field row is set (has been assigned a value) and false otherwise */ + public boolean isSetRow() { + return this.row != null; + } + + public void setRowIsSet(boolean value) { + if (!value) { + this.row = null; + } + } + + public int getMutationsSize() { + return (this.mutations == null) ? 0 : this.mutations.size(); + } + + public java.util.Iterator getMutationsIterator() { + return (this.mutations == null) ? null : this.mutations.iterator(); + } + + public void addToMutations(Mutation elem) { + if (this.mutations == null) { + this.mutations = new ArrayList(); + } + this.mutations.add(elem); + } + + public List getMutations() { + return this.mutations; + } + + public BatchMutation setMutations(List mutations) { + this.mutations = mutations; + return this; + } + + public void unsetMutations() { + this.mutations = null; + } + + /** Returns true if field mutations is set (has been assigned a value) and false otherwise */ + public boolean isSetMutations() { + return this.mutations != null; + } + + public void setMutationsIsSet(boolean value) { + if (!value) { + this.mutations = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case ROW: + if (value == null) { + unsetRow(); + } else { + setRow((ByteBuffer)value); + } + break; + + case MUTATIONS: + if (value == null) { + unsetMutations(); + } else { + setMutations((List)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case ROW: + return getRow(); + + case MUTATIONS: + return getMutations(); + + } + 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 ROW: + return isSetRow(); + case MUTATIONS: + return isSetMutations(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof BatchMutation) + return this.equals((BatchMutation)that); + return false; + } + + public boolean equals(BatchMutation that) { + if (that == null) + return false; + + boolean this_present_row = true && this.isSetRow(); + boolean that_present_row = true && that.isSetRow(); + if (this_present_row || that_present_row) { + if (!(this_present_row && that_present_row)) + return false; + if (!this.row.equals(that.row)) + return false; + } + + boolean this_present_mutations = true && this.isSetMutations(); + boolean that_present_mutations = true && that.isSetMutations(); + if (this_present_mutations || that_present_mutations) { + if (!(this_present_mutations && that_present_mutations)) + return false; + if (!this.mutations.equals(that.mutations)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_row = true && (isSetRow()); + list.add(present_row); + if (present_row) + list.add(row); + + boolean present_mutations = true && (isSetMutations()); + list.add(present_mutations); + if (present_mutations) + list.add(mutations); + + return list.hashCode(); + } + + @Override + public int compareTo(BatchMutation other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetRow()).compareTo(other.isSetRow()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRow()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.row, other.row); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetMutations()).compareTo(other.isSetMutations()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetMutations()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.mutations, other.mutations); + 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("BatchMutation("); + boolean first = true; + + sb.append("row:"); + if (this.row == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.row, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("mutations:"); + if (this.mutations == null) { + sb.append("null"); + } else { + sb.append(this.mutations); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 BatchMutationStandardSchemeFactory implements SchemeFactory { + public BatchMutationStandardScheme getScheme() { + return new BatchMutationStandardScheme(); + } + } + + private static class BatchMutationStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, BatchMutation 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: // ROW + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.row = iprot.readBinary(); + struct.setRowIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // MUTATIONS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list0 = iprot.readListBegin(); + struct.mutations = new ArrayList(_list0.size); + Mutation _elem1; + for (int _i2 = 0; _i2 < _list0.size; ++_i2) + { + _elem1 = new Mutation(); + _elem1.read(iprot); + struct.mutations.add(_elem1); + } + iprot.readListEnd(); + } + struct.setMutationsIsSet(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, BatchMutation struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.row != null) { + oprot.writeFieldBegin(ROW_FIELD_DESC); + oprot.writeBinary(struct.row); + oprot.writeFieldEnd(); + } + if (struct.mutations != null) { + oprot.writeFieldBegin(MUTATIONS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.mutations.size())); + for (Mutation _iter3 : struct.mutations) + { + _iter3.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class BatchMutationTupleSchemeFactory implements SchemeFactory { + public BatchMutationTupleScheme getScheme() { + return new BatchMutationTupleScheme(); + } + } + + private static class BatchMutationTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, BatchMutation struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetRow()) { + optionals.set(0); + } + if (struct.isSetMutations()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetRow()) { + oprot.writeBinary(struct.row); + } + if (struct.isSetMutations()) { + { + oprot.writeI32(struct.mutations.size()); + for (Mutation _iter4 : struct.mutations) + { + _iter4.write(oprot); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, BatchMutation struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.row = iprot.readBinary(); + struct.setRowIsSet(true); + } + if (incoming.get(1)) { + { + org.apache.thrift.protocol.TList _list5 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.mutations = new ArrayList(_list5.size); + Mutation _elem6; + for (int _i7 = 0; _i7 < _list5.size; ++_i7) + { + _elem6 = new Mutation(); + _elem6.read(iprot); + struct.mutations.add(_elem6); + } + } + struct.setMutationsIsSet(true); + } + } + } + +} + diff --git "a/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/generated/ColumnDescriptor.java" "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/generated/ColumnDescriptor.java" new file mode 100644 index 00000000000..32523774a17 --- /dev/null +++ "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/generated/ColumnDescriptor.java" @@ -0,0 +1,1239 @@ +/** + * 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.thrift.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"}) +/** + * An HColumnDescriptor contains information about a column family + * 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") +public class ColumnDescriptor implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ColumnDescriptor"); + + 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 MAX_VERSIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("maxVersions", org.apache.thrift.protocol.TType.I32, (short)2); + private static final org.apache.thrift.protocol.TField COMPRESSION_FIELD_DESC = new org.apache.thrift.protocol.TField("compression", org.apache.thrift.protocol.TType.STRING, (short)3); + private static final org.apache.thrift.protocol.TField IN_MEMORY_FIELD_DESC = new org.apache.thrift.protocol.TField("inMemory", org.apache.thrift.protocol.TType.BOOL, (short)4); + private static final org.apache.thrift.protocol.TField BLOOM_FILTER_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("bloomFilterType", org.apache.thrift.protocol.TType.STRING, (short)5); + private static final org.apache.thrift.protocol.TField BLOOM_FILTER_VECTOR_SIZE_FIELD_DESC = new org.apache.thrift.protocol.TField("bloomFilterVectorSize", org.apache.thrift.protocol.TType.I32, (short)6); + private static final org.apache.thrift.protocol.TField BLOOM_FILTER_NB_HASHES_FIELD_DESC = new org.apache.thrift.protocol.TField("bloomFilterNbHashes", org.apache.thrift.protocol.TType.I32, (short)7); + private static final org.apache.thrift.protocol.TField BLOCK_CACHE_ENABLED_FIELD_DESC = new org.apache.thrift.protocol.TField("blockCacheEnabled", org.apache.thrift.protocol.TType.BOOL, (short)8); + private static final org.apache.thrift.protocol.TField TIME_TO_LIVE_FIELD_DESC = new org.apache.thrift.protocol.TField("timeToLive", org.apache.thrift.protocol.TType.I32, (short)9); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new ColumnDescriptorStandardSchemeFactory()); + schemes.put(TupleScheme.class, new ColumnDescriptorTupleSchemeFactory()); + } + + public ByteBuffer name; // required + public int maxVersions; // required + public String compression; // required + public boolean inMemory; // required + public String bloomFilterType; // required + public int bloomFilterVectorSize; // required + public int bloomFilterNbHashes; // required + public boolean blockCacheEnabled; // required + public int timeToLive; // 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 { + NAME((short)1, "name"), + MAX_VERSIONS((short)2, "maxVersions"), + COMPRESSION((short)3, "compression"), + IN_MEMORY((short)4, "inMemory"), + BLOOM_FILTER_TYPE((short)5, "bloomFilterType"), + BLOOM_FILTER_VECTOR_SIZE((short)6, "bloomFilterVectorSize"), + BLOOM_FILTER_NB_HASHES((short)7, "bloomFilterNbHashes"), + BLOCK_CACHE_ENABLED((short)8, "blockCacheEnabled"), + TIME_TO_LIVE((short)9, "timeToLive"); + + private static final Map byName = new HashMap(); + + 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: // MAX_VERSIONS + return MAX_VERSIONS; + case 3: // COMPRESSION + return COMPRESSION; + case 4: // IN_MEMORY + return IN_MEMORY; + case 5: // BLOOM_FILTER_TYPE + return BLOOM_FILTER_TYPE; + case 6: // BLOOM_FILTER_VECTOR_SIZE + return BLOOM_FILTER_VECTOR_SIZE; + case 7: // BLOOM_FILTER_NB_HASHES + return BLOOM_FILTER_NB_HASHES; + case 8: // BLOCK_CACHE_ENABLED + return BLOCK_CACHE_ENABLED; + case 9: // TIME_TO_LIVE + return TIME_TO_LIVE; + default: + return null; + } + } + + /** + * 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 int __MAXVERSIONS_ISSET_ID = 0; + private static final int __INMEMORY_ISSET_ID = 1; + private static final int __BLOOMFILTERVECTORSIZE_ISSET_ID = 2; + private static final int __BLOOMFILTERNBHASHES_ISSET_ID = 3; + private static final int __BLOCKCACHEENABLED_ISSET_ID = 4; + private static final int __TIMETOLIVE_ISSET_ID = 5; + private byte __isset_bitfield = 0; + 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.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.MAX_VERSIONS, new org.apache.thrift.meta_data.FieldMetaData("maxVersions", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.COMPRESSION, new org.apache.thrift.meta_data.FieldMetaData("compression", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.IN_MEMORY, new org.apache.thrift.meta_data.FieldMetaData("inMemory", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + tmpMap.put(_Fields.BLOOM_FILTER_TYPE, new org.apache.thrift.meta_data.FieldMetaData("bloomFilterType", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.BLOOM_FILTER_VECTOR_SIZE, new org.apache.thrift.meta_data.FieldMetaData("bloomFilterVectorSize", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.BLOOM_FILTER_NB_HASHES, new org.apache.thrift.meta_data.FieldMetaData("bloomFilterNbHashes", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.BLOCK_CACHE_ENABLED, new org.apache.thrift.meta_data.FieldMetaData("blockCacheEnabled", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + tmpMap.put(_Fields.TIME_TO_LIVE, new org.apache.thrift.meta_data.FieldMetaData("timeToLive", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ColumnDescriptor.class, metaDataMap); + } + + public ColumnDescriptor() { + this.maxVersions = 3; + + this.compression = "NONE"; + + this.inMemory = false; + + this.bloomFilterType = "NONE"; + + this.bloomFilterVectorSize = 0; + + this.bloomFilterNbHashes = 0; + + this.blockCacheEnabled = false; + + this.timeToLive = 2147483647; + + } + + public ColumnDescriptor( + ByteBuffer name, + int maxVersions, + String compression, + boolean inMemory, + String bloomFilterType, + int bloomFilterVectorSize, + int bloomFilterNbHashes, + boolean blockCacheEnabled, + int timeToLive) + { + this(); + this.name = org.apache.thrift.TBaseHelper.copyBinary(name); + this.maxVersions = maxVersions; + setMaxVersionsIsSet(true); + this.compression = compression; + this.inMemory = inMemory; + setInMemoryIsSet(true); + this.bloomFilterType = bloomFilterType; + this.bloomFilterVectorSize = bloomFilterVectorSize; + setBloomFilterVectorSizeIsSet(true); + this.bloomFilterNbHashes = bloomFilterNbHashes; + setBloomFilterNbHashesIsSet(true); + this.blockCacheEnabled = blockCacheEnabled; + setBlockCacheEnabledIsSet(true); + this.timeToLive = timeToLive; + setTimeToLiveIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public ColumnDescriptor(ColumnDescriptor other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetName()) { + this.name = other.name; + } + this.maxVersions = other.maxVersions; + if (other.isSetCompression()) { + this.compression = other.compression; + } + this.inMemory = other.inMemory; + if (other.isSetBloomFilterType()) { + this.bloomFilterType = other.bloomFilterType; + } + this.bloomFilterVectorSize = other.bloomFilterVectorSize; + this.bloomFilterNbHashes = other.bloomFilterNbHashes; + this.blockCacheEnabled = other.blockCacheEnabled; + this.timeToLive = other.timeToLive; + } + + public ColumnDescriptor deepCopy() { + return new ColumnDescriptor(this); + } + + @Override + public void clear() { + this.name = null; + this.maxVersions = 3; + + this.compression = "NONE"; + + this.inMemory = false; + + this.bloomFilterType = "NONE"; + + this.bloomFilterVectorSize = 0; + + this.bloomFilterNbHashes = 0; + + this.blockCacheEnabled = false; + + this.timeToLive = 2147483647; + + } + + public byte[] getName() { + setName(org.apache.thrift.TBaseHelper.rightSize(name)); + return name == null ? null : name.array(); + } + + public ByteBuffer bufferForName() { + return org.apache.thrift.TBaseHelper.copyBinary(name); + } + + public ColumnDescriptor setName(byte[] name) { + this.name = name == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(name, name.length)); + return this; + } + + public ColumnDescriptor setName(ByteBuffer name) { + this.name = org.apache.thrift.TBaseHelper.copyBinary(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 getMaxVersions() { + return this.maxVersions; + } + + public ColumnDescriptor setMaxVersions(int maxVersions) { + this.maxVersions = maxVersions; + setMaxVersionsIsSet(true); + return this; + } + + public void unsetMaxVersions() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MAXVERSIONS_ISSET_ID); + } + + /** Returns true if field maxVersions is set (has been assigned a value) and false otherwise */ + public boolean isSetMaxVersions() { + return EncodingUtils.testBit(__isset_bitfield, __MAXVERSIONS_ISSET_ID); + } + + public void setMaxVersionsIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MAXVERSIONS_ISSET_ID, value); + } + + public String getCompression() { + return this.compression; + } + + public ColumnDescriptor setCompression(String compression) { + this.compression = compression; + return this; + } + + public void unsetCompression() { + this.compression = null; + } + + /** Returns true if field compression is set (has been assigned a value) and false otherwise */ + public boolean isSetCompression() { + return this.compression != null; + } + + public void setCompressionIsSet(boolean value) { + if (!value) { + this.compression = null; + } + } + + public boolean isInMemory() { + return this.inMemory; + } + + public ColumnDescriptor setInMemory(boolean inMemory) { + this.inMemory = inMemory; + setInMemoryIsSet(true); + return this; + } + + public void unsetInMemory() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __INMEMORY_ISSET_ID); + } + + /** Returns true if field inMemory is set (has been assigned a value) and false otherwise */ + public boolean isSetInMemory() { + return EncodingUtils.testBit(__isset_bitfield, __INMEMORY_ISSET_ID); + } + + public void setInMemoryIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __INMEMORY_ISSET_ID, value); + } + + public String getBloomFilterType() { + return this.bloomFilterType; + } + + public ColumnDescriptor setBloomFilterType(String bloomFilterType) { + this.bloomFilterType = bloomFilterType; + return this; + } + + public void unsetBloomFilterType() { + this.bloomFilterType = null; + } + + /** Returns true if field bloomFilterType is set (has been assigned a value) and false otherwise */ + public boolean isSetBloomFilterType() { + return this.bloomFilterType != null; + } + + public void setBloomFilterTypeIsSet(boolean value) { + if (!value) { + this.bloomFilterType = null; + } + } + + public int getBloomFilterVectorSize() { + return this.bloomFilterVectorSize; + } + + public ColumnDescriptor setBloomFilterVectorSize(int bloomFilterVectorSize) { + this.bloomFilterVectorSize = bloomFilterVectorSize; + setBloomFilterVectorSizeIsSet(true); + return this; + } + + public void unsetBloomFilterVectorSize() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __BLOOMFILTERVECTORSIZE_ISSET_ID); + } + + /** Returns true if field bloomFilterVectorSize is set (has been assigned a value) and false otherwise */ + public boolean isSetBloomFilterVectorSize() { + return EncodingUtils.testBit(__isset_bitfield, __BLOOMFILTERVECTORSIZE_ISSET_ID); + } + + public void setBloomFilterVectorSizeIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __BLOOMFILTERVECTORSIZE_ISSET_ID, value); + } + + public int getBloomFilterNbHashes() { + return this.bloomFilterNbHashes; + } + + public ColumnDescriptor setBloomFilterNbHashes(int bloomFilterNbHashes) { + this.bloomFilterNbHashes = bloomFilterNbHashes; + setBloomFilterNbHashesIsSet(true); + return this; + } + + public void unsetBloomFilterNbHashes() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __BLOOMFILTERNBHASHES_ISSET_ID); + } + + /** Returns true if field bloomFilterNbHashes is set (has been assigned a value) and false otherwise */ + public boolean isSetBloomFilterNbHashes() { + return EncodingUtils.testBit(__isset_bitfield, __BLOOMFILTERNBHASHES_ISSET_ID); + } + + public void setBloomFilterNbHashesIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __BLOOMFILTERNBHASHES_ISSET_ID, value); + } + + public boolean isBlockCacheEnabled() { + return this.blockCacheEnabled; + } + + public ColumnDescriptor setBlockCacheEnabled(boolean blockCacheEnabled) { + this.blockCacheEnabled = blockCacheEnabled; + setBlockCacheEnabledIsSet(true); + return this; + } + + public void unsetBlockCacheEnabled() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __BLOCKCACHEENABLED_ISSET_ID); + } + + /** Returns true if field blockCacheEnabled is set (has been assigned a value) and false otherwise */ + public boolean isSetBlockCacheEnabled() { + return EncodingUtils.testBit(__isset_bitfield, __BLOCKCACHEENABLED_ISSET_ID); + } + + public void setBlockCacheEnabledIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __BLOCKCACHEENABLED_ISSET_ID, value); + } + + public int getTimeToLive() { + return this.timeToLive; + } + + public ColumnDescriptor setTimeToLive(int timeToLive) { + this.timeToLive = timeToLive; + setTimeToLiveIsSet(true); + return this; + } + + public void unsetTimeToLive() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TIMETOLIVE_ISSET_ID); + } + + /** Returns true if field timeToLive is set (has been assigned a value) and false otherwise */ + public boolean isSetTimeToLive() { + return EncodingUtils.testBit(__isset_bitfield, __TIMETOLIVE_ISSET_ID); + } + + public void setTimeToLiveIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TIMETOLIVE_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case NAME: + if (value == null) { + unsetName(); + } else { + setName((ByteBuffer)value); + } + break; + + case MAX_VERSIONS: + if (value == null) { + unsetMaxVersions(); + } else { + setMaxVersions((Integer)value); + } + break; + + case COMPRESSION: + if (value == null) { + unsetCompression(); + } else { + setCompression((String)value); + } + break; + + case IN_MEMORY: + if (value == null) { + unsetInMemory(); + } else { + setInMemory((Boolean)value); + } + break; + + case BLOOM_FILTER_TYPE: + if (value == null) { + unsetBloomFilterType(); + } else { + setBloomFilterType((String)value); + } + break; + + case BLOOM_FILTER_VECTOR_SIZE: + if (value == null) { + unsetBloomFilterVectorSize(); + } else { + setBloomFilterVectorSize((Integer)value); + } + break; + + case BLOOM_FILTER_NB_HASHES: + if (value == null) { + unsetBloomFilterNbHashes(); + } else { + setBloomFilterNbHashes((Integer)value); + } + break; + + case BLOCK_CACHE_ENABLED: + if (value == null) { + unsetBlockCacheEnabled(); + } else { + setBlockCacheEnabled((Boolean)value); + } + break; + + case TIME_TO_LIVE: + if (value == null) { + unsetTimeToLive(); + } else { + setTimeToLive((Integer)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case NAME: + return getName(); + + case MAX_VERSIONS: + return getMaxVersions(); + + case COMPRESSION: + return getCompression(); + + case IN_MEMORY: + return isInMemory(); + + case BLOOM_FILTER_TYPE: + return getBloomFilterType(); + + case BLOOM_FILTER_VECTOR_SIZE: + return getBloomFilterVectorSize(); + + case BLOOM_FILTER_NB_HASHES: + return getBloomFilterNbHashes(); + + case BLOCK_CACHE_ENABLED: + return isBlockCacheEnabled(); + + case TIME_TO_LIVE: + return getTimeToLive(); + + } + 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 MAX_VERSIONS: + return isSetMaxVersions(); + case COMPRESSION: + return isSetCompression(); + case IN_MEMORY: + return isSetInMemory(); + case BLOOM_FILTER_TYPE: + return isSetBloomFilterType(); + case BLOOM_FILTER_VECTOR_SIZE: + return isSetBloomFilterVectorSize(); + case BLOOM_FILTER_NB_HASHES: + return isSetBloomFilterNbHashes(); + case BLOCK_CACHE_ENABLED: + return isSetBlockCacheEnabled(); + case TIME_TO_LIVE: + return isSetTimeToLive(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof ColumnDescriptor) + return this.equals((ColumnDescriptor)that); + return false; + } + + public boolean equals(ColumnDescriptor 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_maxVersions = true; + boolean that_present_maxVersions = true; + if (this_present_maxVersions || that_present_maxVersions) { + if (!(this_present_maxVersions && that_present_maxVersions)) + return false; + if (this.maxVersions != that.maxVersions) + return false; + } + + boolean this_present_compression = true && this.isSetCompression(); + boolean that_present_compression = true && that.isSetCompression(); + if (this_present_compression || that_present_compression) { + if (!(this_present_compression && that_present_compression)) + return false; + if (!this.compression.equals(that.compression)) + return false; + } + + boolean this_present_inMemory = true; + boolean that_present_inMemory = true; + if (this_present_inMemory || that_present_inMemory) { + if (!(this_present_inMemory && that_present_inMemory)) + return false; + if (this.inMemory != that.inMemory) + return false; + } + + boolean this_present_bloomFilterType = true && this.isSetBloomFilterType(); + boolean that_present_bloomFilterType = true && that.isSetBloomFilterType(); + if (this_present_bloomFilterType || that_present_bloomFilterType) { + if (!(this_present_bloomFilterType && that_present_bloomFilterType)) + return false; + if (!this.bloomFilterType.equals(that.bloomFilterType)) + return false; + } + + boolean this_present_bloomFilterVectorSize = true; + boolean that_present_bloomFilterVectorSize = true; + if (this_present_bloomFilterVectorSize || that_present_bloomFilterVectorSize) { + if (!(this_present_bloomFilterVectorSize && that_present_bloomFilterVectorSize)) + return false; + if (this.bloomFilterVectorSize != that.bloomFilterVectorSize) + return false; + } + + boolean this_present_bloomFilterNbHashes = true; + boolean that_present_bloomFilterNbHashes = true; + if (this_present_bloomFilterNbHashes || that_present_bloomFilterNbHashes) { + if (!(this_present_bloomFilterNbHashes && that_present_bloomFilterNbHashes)) + return false; + if (this.bloomFilterNbHashes != that.bloomFilterNbHashes) + return false; + } + + boolean this_present_blockCacheEnabled = true; + boolean that_present_blockCacheEnabled = true; + if (this_present_blockCacheEnabled || that_present_blockCacheEnabled) { + if (!(this_present_blockCacheEnabled && that_present_blockCacheEnabled)) + return false; + if (this.blockCacheEnabled != that.blockCacheEnabled) + return false; + } + + boolean this_present_timeToLive = true; + boolean that_present_timeToLive = true; + if (this_present_timeToLive || that_present_timeToLive) { + if (!(this_present_timeToLive && that_present_timeToLive)) + return false; + if (this.timeToLive != that.timeToLive) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_name = true && (isSetName()); + list.add(present_name); + if (present_name) + list.add(name); + + boolean present_maxVersions = true; + list.add(present_maxVersions); + if (present_maxVersions) + list.add(maxVersions); + + boolean present_compression = true && (isSetCompression()); + list.add(present_compression); + if (present_compression) + list.add(compression); + + boolean present_inMemory = true; + list.add(present_inMemory); + if (present_inMemory) + list.add(inMemory); + + boolean present_bloomFilterType = true && (isSetBloomFilterType()); + list.add(present_bloomFilterType); + if (present_bloomFilterType) + list.add(bloomFilterType); + + boolean present_bloomFilterVectorSize = true; + list.add(present_bloomFilterVectorSize); + if (present_bloomFilterVectorSize) + list.add(bloomFilterVectorSize); + + boolean present_bloomFilterNbHashes = true; + list.add(present_bloomFilterNbHashes); + if (present_bloomFilterNbHashes) + list.add(bloomFilterNbHashes); + + boolean present_blockCacheEnabled = true; + list.add(present_blockCacheEnabled); + if (present_blockCacheEnabled) + list.add(blockCacheEnabled); + + boolean present_timeToLive = true; + list.add(present_timeToLive); + if (present_timeToLive) + list.add(timeToLive); + + return list.hashCode(); + } + + @Override + public int compareTo(ColumnDescriptor 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(isSetMaxVersions()).compareTo(other.isSetMaxVersions()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetMaxVersions()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.maxVersions, other.maxVersions); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetCompression()).compareTo(other.isSetCompression()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetCompression()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.compression, other.compression); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetInMemory()).compareTo(other.isSetInMemory()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetInMemory()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.inMemory, other.inMemory); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetBloomFilterType()).compareTo(other.isSetBloomFilterType()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetBloomFilterType()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.bloomFilterType, other.bloomFilterType); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetBloomFilterVectorSize()).compareTo(other.isSetBloomFilterVectorSize()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetBloomFilterVectorSize()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.bloomFilterVectorSize, other.bloomFilterVectorSize); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetBloomFilterNbHashes()).compareTo(other.isSetBloomFilterNbHashes()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetBloomFilterNbHashes()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.bloomFilterNbHashes, other.bloomFilterNbHashes); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetBlockCacheEnabled()).compareTo(other.isSetBlockCacheEnabled()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetBlockCacheEnabled()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.blockCacheEnabled, other.blockCacheEnabled); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetTimeToLive()).compareTo(other.isSetTimeToLive()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTimeToLive()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timeToLive, other.timeToLive); + 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("ColumnDescriptor("); + boolean first = true; + + sb.append("name:"); + if (this.name == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.name, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("maxVersions:"); + sb.append(this.maxVersions); + first = false; + if (!first) sb.append(", "); + sb.append("compression:"); + if (this.compression == null) { + sb.append("null"); + } else { + sb.append(this.compression); + } + first = false; + if (!first) sb.append(", "); + sb.append("inMemory:"); + sb.append(this.inMemory); + first = false; + if (!first) sb.append(", "); + sb.append("bloomFilterType:"); + if (this.bloomFilterType == null) { + sb.append("null"); + } else { + sb.append(this.bloomFilterType); + } + first = false; + if (!first) sb.append(", "); + sb.append("bloomFilterVectorSize:"); + sb.append(this.bloomFilterVectorSize); + first = false; + if (!first) sb.append(", "); + sb.append("bloomFilterNbHashes:"); + sb.append(this.bloomFilterNbHashes); + first = false; + if (!first) sb.append(", "); + sb.append("blockCacheEnabled:"); + sb.append(this.blockCacheEnabled); + first = false; + if (!first) sb.append(", "); + sb.append("timeToLive:"); + sb.append(this.timeToLive); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 { + // 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); + } + } + + private static class ColumnDescriptorStandardSchemeFactory implements SchemeFactory { + public ColumnDescriptorStandardScheme getScheme() { + return new ColumnDescriptorStandardScheme(); + } + } + + private static class ColumnDescriptorStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, ColumnDescriptor 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.readBinary(); + struct.setNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // MAX_VERSIONS + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.maxVersions = iprot.readI32(); + struct.setMaxVersionsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // COMPRESSION + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.compression = iprot.readString(); + struct.setCompressionIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // IN_MEMORY + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.inMemory = iprot.readBool(); + struct.setInMemoryIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // BLOOM_FILTER_TYPE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.bloomFilterType = iprot.readString(); + struct.setBloomFilterTypeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 6: // BLOOM_FILTER_VECTOR_SIZE + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.bloomFilterVectorSize = iprot.readI32(); + struct.setBloomFilterVectorSizeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 7: // BLOOM_FILTER_NB_HASHES + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.bloomFilterNbHashes = iprot.readI32(); + struct.setBloomFilterNbHashesIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 8: // BLOCK_CACHE_ENABLED + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.blockCacheEnabled = iprot.readBool(); + struct.setBlockCacheEnabledIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 9: // TIME_TO_LIVE + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.timeToLive = iprot.readI32(); + struct.setTimeToLiveIsSet(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, ColumnDescriptor struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.name != null) { + oprot.writeFieldBegin(NAME_FIELD_DESC); + oprot.writeBinary(struct.name); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(MAX_VERSIONS_FIELD_DESC); + oprot.writeI32(struct.maxVersions); + oprot.writeFieldEnd(); + if (struct.compression != null) { + oprot.writeFieldBegin(COMPRESSION_FIELD_DESC); + oprot.writeString(struct.compression); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(IN_MEMORY_FIELD_DESC); + oprot.writeBool(struct.inMemory); + oprot.writeFieldEnd(); + if (struct.bloomFilterType != null) { + oprot.writeFieldBegin(BLOOM_FILTER_TYPE_FIELD_DESC); + oprot.writeString(struct.bloomFilterType); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(BLOOM_FILTER_VECTOR_SIZE_FIELD_DESC); + oprot.writeI32(struct.bloomFilterVectorSize); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(BLOOM_FILTER_NB_HASHES_FIELD_DESC); + oprot.writeI32(struct.bloomFilterNbHashes); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(BLOCK_CACHE_ENABLED_FIELD_DESC); + oprot.writeBool(struct.blockCacheEnabled); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(TIME_TO_LIVE_FIELD_DESC); + oprot.writeI32(struct.timeToLive); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class ColumnDescriptorTupleSchemeFactory implements SchemeFactory { + public ColumnDescriptorTupleScheme getScheme() { + return new ColumnDescriptorTupleScheme(); + } + } + + private static class ColumnDescriptorTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, ColumnDescriptor struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetName()) { + optionals.set(0); + } + if (struct.isSetMaxVersions()) { + optionals.set(1); + } + if (struct.isSetCompression()) { + optionals.set(2); + } + if (struct.isSetInMemory()) { + optionals.set(3); + } + if (struct.isSetBloomFilterType()) { + optionals.set(4); + } + if (struct.isSetBloomFilterVectorSize()) { + optionals.set(5); + } + if (struct.isSetBloomFilterNbHashes()) { + optionals.set(6); + } + if (struct.isSetBlockCacheEnabled()) { + optionals.set(7); + } + if (struct.isSetTimeToLive()) { + optionals.set(8); + } + oprot.writeBitSet(optionals, 9); + if (struct.isSetName()) { + oprot.writeBinary(struct.name); + } + if (struct.isSetMaxVersions()) { + oprot.writeI32(struct.maxVersions); + } + if (struct.isSetCompression()) { + oprot.writeString(struct.compression); + } + if (struct.isSetInMemory()) { + oprot.writeBool(struct.inMemory); + } + if (struct.isSetBloomFilterType()) { + oprot.writeString(struct.bloomFilterType); + } + if (struct.isSetBloomFilterVectorSize()) { + oprot.writeI32(struct.bloomFilterVectorSize); + } + if (struct.isSetBloomFilterNbHashes()) { + oprot.writeI32(struct.bloomFilterNbHashes); + } + if (struct.isSetBlockCacheEnabled()) { + oprot.writeBool(struct.blockCacheEnabled); + } + if (struct.isSetTimeToLive()) { + oprot.writeI32(struct.timeToLive); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, ColumnDescriptor struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(9); + if (incoming.get(0)) { + struct.name = iprot.readBinary(); + struct.setNameIsSet(true); + } + if (incoming.get(1)) { + struct.maxVersions = iprot.readI32(); + struct.setMaxVersionsIsSet(true); + } + if (incoming.get(2)) { + struct.compression = iprot.readString(); + struct.setCompressionIsSet(true); + } + if (incoming.get(3)) { + struct.inMemory = iprot.readBool(); + struct.setInMemoryIsSet(true); + } + if (incoming.get(4)) { + struct.bloomFilterType = iprot.readString(); + struct.setBloomFilterTypeIsSet(true); + } + if (incoming.get(5)) { + struct.bloomFilterVectorSize = iprot.readI32(); + struct.setBloomFilterVectorSizeIsSet(true); + } + if (incoming.get(6)) { + struct.bloomFilterNbHashes = iprot.readI32(); + struct.setBloomFilterNbHashesIsSet(true); + } + if (incoming.get(7)) { + struct.blockCacheEnabled = iprot.readBool(); + struct.setBlockCacheEnabledIsSet(true); + } + if (incoming.get(8)) { + struct.timeToLive = iprot.readI32(); + struct.setTimeToLiveIsSet(true); + } + } + } + +} + diff --git "a/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/generated/Hbase.java" "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/generated/Hbase.java" new file mode 100644 index 00000000000..f77ce143f2f --- /dev/null +++ "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/generated/Hbase.java" @@ -0,0 +1,58585 @@ +/** + * 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.thrift.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 = "2016-05-25") +public class Hbase { + + public interface Iface { + + /** + * Brings a table on-line (enables it) + * + * @param tableName name of the table + */ + public void enableTable(ByteBuffer tableName) throws IOError, org.apache.thrift.TException; + + /** + * Disables a table (takes it off-line) If it is being served, the master + * will tell the servers to stop serving it. + * + * @param tableName name of the table + */ + public void disableTable(ByteBuffer tableName) throws IOError, org.apache.thrift.TException; + + /** + * @return true if table is on-line + * + * @param tableName name of the table to check + */ + public boolean isTableEnabled(ByteBuffer tableName) throws IOError, org.apache.thrift.TException; + + public void compact(ByteBuffer tableNameOrRegionName) throws IOError, org.apache.thrift.TException; + + public void majorCompact(ByteBuffer tableNameOrRegionName) throws IOError, org.apache.thrift.TException; + + /** + * List all the userspace tables. + * + * @return returns a list of names + */ + public List getTableNames() throws IOError, org.apache.thrift.TException; + + /** + * List all the column families assoicated with a table. + * + * @return list of column family descriptors + * + * @param tableName table name + */ + public Map getColumnDescriptors(ByteBuffer tableName) throws IOError, org.apache.thrift.TException; + + /** + * List the regions associated with a table. + * + * @return list of region descriptors + * + * @param tableName table name + */ + public List getTableRegions(ByteBuffer tableName) throws IOError, org.apache.thrift.TException; + + /** + * Create a table with the specified column families. The name + * field for each ColumnDescriptor must be set and must end in a + * colon (:). All other fields are optional and will get default + * values if not explicitly specified. + * + * @throws IllegalArgument if an input parameter is invalid + * + * @throws AlreadyExists if the table name already exists + * + * @param tableName name of table to create + * + * @param columnFamilies list of column family descriptors + */ + public void createTable(ByteBuffer tableName, List columnFamilies) throws IOError, IllegalArgument, AlreadyExists, org.apache.thrift.TException; + + /** + * Deletes a table + * + * @throws IOError if table doesn't exist on server or there was some other + * problem + * + * @param tableName name of table to delete + */ + public void deleteTable(ByteBuffer tableName) throws IOError, org.apache.thrift.TException; + + /** + * Get a single TCell for the specified table, row, and column at the + * latest timestamp. Returns an empty list if no such value exists. + * + * @return value for specified row/column + * + * @param tableName name of table + * + * @param row row key + * + * @param column column name + * + * @param attributes Get attributes + */ + public List get(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, Map attributes) throws IOError, org.apache.thrift.TException; + + /** + * Get the specified number of versions for the specified table, + * row, and column. + * + * @return list of cells for specified row/column + * + * @param tableName name of table + * + * @param row row key + * + * @param column column name + * + * @param numVersions number of versions to retrieve + * + * @param attributes Get attributes + */ + public List getVer(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, int numVersions, Map attributes) throws IOError, org.apache.thrift.TException; + + /** + * Get the specified number of versions for the specified table, + * row, and column. Only versions less than or equal to the specified + * timestamp will be returned. + * + * @return list of cells for specified row/column + * + * @param tableName name of table + * + * @param row row key + * + * @param column column name + * + * @param timestamp timestamp + * + * @param numVersions number of versions to retrieve + * + * @param attributes Get attributes + */ + public List getVerTs(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, long timestamp, int numVersions, Map attributes) throws IOError, org.apache.thrift.TException; + + /** + * Get all the data for the specified table and row at the latest + * timestamp. Returns an empty list if the row does not exist. + * + * @return TRowResult containing the row and map of columns to TCells + * + * @param tableName name of table + * + * @param row row key + * + * @param attributes Get attributes + */ + public List getRow(ByteBuffer tableName, ByteBuffer row, Map attributes) throws IOError, org.apache.thrift.TException; + + /** + * Get the specified columns for the specified table and row at the latest + * timestamp. Returns an empty list if the row does not exist. + * + * @return TRowResult containing the row and map of columns to TCells + * + * @param tableName name of table + * + * @param row row key + * + * @param columns List of columns to return, null for all columns + * + * @param attributes Get attributes + */ + public List getRowWithColumns(ByteBuffer tableName, ByteBuffer row, List columns, Map attributes) throws IOError, org.apache.thrift.TException; + + /** + * Get all the data for the specified table and row at the specified + * timestamp. Returns an empty list if the row does not exist. + * + * @return TRowResult containing the row and map of columns to TCells + * + * @param tableName name of the table + * + * @param row row key + * + * @param timestamp timestamp + * + * @param attributes Get attributes + */ + public List getRowTs(ByteBuffer tableName, ByteBuffer row, long timestamp, Map attributes) throws IOError, org.apache.thrift.TException; + + /** + * Get the specified columns for the specified table and row at the specified + * timestamp. Returns an empty list if the row does not exist. + * + * @return TRowResult containing the row and map of columns to TCells + * + * @param tableName name of table + * + * @param row row key + * + * @param columns List of columns to return, null for all columns + * + * @param timestamp + * @param attributes Get attributes + */ + public List getRowWithColumnsTs(ByteBuffer tableName, ByteBuffer row, List columns, long timestamp, Map attributes) throws IOError, org.apache.thrift.TException; + + /** + * Get all the data for the specified table and rows at the latest + * timestamp. Returns an empty list if no rows exist. + * + * @return TRowResult containing the rows and map of columns to TCells + * + * @param tableName name of table + * + * @param rows row keys + * + * @param attributes Get attributes + */ + public List getRows(ByteBuffer tableName, List rows, Map attributes) throws IOError, org.apache.thrift.TException; + + /** + * Get the specified columns for the specified table and rows at the latest + * timestamp. Returns an empty list if no rows exist. + * + * @return TRowResult containing the rows and map of columns to TCells + * + * @param tableName name of table + * + * @param rows row keys + * + * @param columns List of columns to return, null for all columns + * + * @param attributes Get attributes + */ + public List getRowsWithColumns(ByteBuffer tableName, List rows, List columns, Map attributes) throws IOError, org.apache.thrift.TException; + + /** + * Get all the data for the specified table and rows at the specified + * timestamp. Returns an empty list if no rows exist. + * + * @return TRowResult containing the rows and map of columns to TCells + * + * @param tableName name of the table + * + * @param rows row keys + * + * @param timestamp timestamp + * + * @param attributes Get attributes + */ + public List getRowsTs(ByteBuffer tableName, List rows, long timestamp, Map attributes) throws IOError, org.apache.thrift.TException; + + /** + * Get the specified columns for the specified table and rows at the specified + * timestamp. Returns an empty list if no rows exist. + * + * @return TRowResult containing the rows and map of columns to TCells + * + * @param tableName name of table + * + * @param rows row keys + * + * @param columns List of columns to return, null for all columns + * + * @param timestamp + * @param attributes Get attributes + */ + public List getRowsWithColumnsTs(ByteBuffer tableName, List rows, List columns, long timestamp, Map attributes) throws IOError, org.apache.thrift.TException; + + /** + * Apply a series of mutations (updates/deletes) to a row in a + * single transaction. If an exception is thrown, then the + * transaction is aborted. Default current timestamp is used, and + * all entries will have an identical timestamp. + * + * @param tableName name of table + * + * @param row row key + * + * @param mutations list of mutation commands + * + * @param attributes Mutation attributes + */ + public void mutateRow(ByteBuffer tableName, ByteBuffer row, List mutations, Map attributes) throws IOError, IllegalArgument, org.apache.thrift.TException; + + /** + * Apply a series of mutations (updates/deletes) to a row in a + * single transaction. If an exception is thrown, then the + * transaction is aborted. The specified timestamp is used, and + * all entries will have an identical timestamp. + * + * @param tableName name of table + * + * @param row row key + * + * @param mutations list of mutation commands + * + * @param timestamp timestamp + * + * @param attributes Mutation attributes + */ + public void mutateRowTs(ByteBuffer tableName, ByteBuffer row, List mutations, long timestamp, Map attributes) throws IOError, IllegalArgument, org.apache.thrift.TException; + + /** + * Apply a series of batches (each a series of mutations on a single row) + * in a single transaction. If an exception is thrown, then the + * transaction is aborted. Default current timestamp is used, and + * all entries will have an identical timestamp. + * + * @param tableName name of table + * + * @param rowBatches list of row batches + * + * @param attributes Mutation attributes + */ + public void mutateRows(ByteBuffer tableName, List rowBatches, Map attributes) throws IOError, IllegalArgument, org.apache.thrift.TException; + + /** + * Apply a series of batches (each a series of mutations on a single row) + * in a single transaction. If an exception is thrown, then the + * transaction is aborted. The specified timestamp is used, and + * all entries will have an identical timestamp. + * + * @param tableName name of table + * + * @param rowBatches list of row batches + * + * @param timestamp timestamp + * + * @param attributes Mutation attributes + */ + public void mutateRowsTs(ByteBuffer tableName, List rowBatches, long timestamp, Map attributes) throws IOError, IllegalArgument, org.apache.thrift.TException; + + /** + * Atomically increment the column value specified. Returns the next value post increment. + * + * @param tableName name of table + * + * @param row row to increment + * + * @param column name of column + * + * @param value amount to increment by + */ + public long atomicIncrement(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, long value) throws IOError, IllegalArgument, org.apache.thrift.TException; + + /** + * Delete all cells that match the passed row and column. + * + * @param tableName name of table + * + * @param row Row to update + * + * @param column name of column whose value is to be deleted + * + * @param attributes Delete attributes + */ + public void deleteAll(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, Map attributes) throws IOError, org.apache.thrift.TException; + + /** + * Delete all cells that match the passed row and column and whose + * timestamp is equal-to or older than the passed timestamp. + * + * @param tableName name of table + * + * @param row Row to update + * + * @param column name of column whose value is to be deleted + * + * @param timestamp timestamp + * + * @param attributes Delete attributes + */ + public void deleteAllTs(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, long timestamp, Map attributes) throws IOError, org.apache.thrift.TException; + + /** + * Completely delete the row's cells. + * + * @param tableName name of table + * + * @param row key of the row to be completely deleted. + * + * @param attributes Delete attributes + */ + public void deleteAllRow(ByteBuffer tableName, ByteBuffer row, Map attributes) throws IOError, org.apache.thrift.TException; + + /** + * Increment a cell by the ammount. + * Increments can be applied async if hbase.regionserver.thrift.coalesceIncrement is set to true. + * False is the default. Turn to true if you need the extra performance and can accept some + * data loss if a thrift server dies with increments still in the queue. + * + * @param increment The single increment to apply + */ + public void increment(TIncrement increment) throws IOError, org.apache.thrift.TException; + + public void incrementRows(List increments) throws IOError, org.apache.thrift.TException; + + /** + * Completely delete the row's cells marked with a timestamp + * equal-to or older than the passed timestamp. + * + * @param tableName name of table + * + * @param row key of the row to be completely deleted. + * + * @param timestamp timestamp + * + * @param attributes Delete attributes + */ + public void deleteAllRowTs(ByteBuffer tableName, ByteBuffer row, long timestamp, Map attributes) throws IOError, org.apache.thrift.TException; + + /** + * Get a scanner on the current table, using the Scan instance + * for the scan parameters. + * + * @param tableName name of table + * + * @param scan Scan instance + * + * @param attributes Scan attributes + */ + public int scannerOpenWithScan(ByteBuffer tableName, TScan scan, Map attributes) throws IOError, org.apache.thrift.TException; + + /** + * Get a scanner on the current table starting at the specified row and + * ending at the last row in the table. Return the specified columns. + * + * @return scanner id to be used with other scanner procedures + * + * @param tableName name of table + * + * @param startRow Starting row in table to scan. + * Send "" (empty string) to start at the first row. + * + * @param columns columns to scan. If column name is a column family, all + * columns of the specified column family are returned. It's also possible + * to pass a regex in the column qualifier. + * + * @param attributes Scan attributes + */ + public int scannerOpen(ByteBuffer tableName, ByteBuffer startRow, List columns, Map attributes) throws IOError, org.apache.thrift.TException; + + /** + * Get a scanner on the current table starting and stopping at the + * specified rows. ending at the last row in the table. Return the + * specified columns. + * + * @return scanner id to be used with other scanner procedures + * + * @param tableName name of table + * + * @param startRow Starting row in table to scan. + * Send "" (empty string) to start at the first row. + * + * @param stopRow row to stop scanning on. This row is *not* included in the + * scanner's results + * + * @param columns columns to scan. If column name is a column family, all + * columns of the specified column family are returned. It's also possible + * to pass a regex in the column qualifier. + * + * @param attributes Scan attributes + */ + public int scannerOpenWithStop(ByteBuffer tableName, ByteBuffer startRow, ByteBuffer stopRow, List columns, Map attributes) throws IOError, org.apache.thrift.TException; + + /** + * Open a scanner for a given prefix. That is all rows will have the specified + * prefix. No other rows will be returned. + * + * @return scanner id to use with other scanner calls + * + * @param tableName name of table + * + * @param startAndPrefix the prefix (and thus start row) of the keys you want + * + * @param columns the columns you want returned + * + * @param attributes Scan attributes + */ + public int scannerOpenWithPrefix(ByteBuffer tableName, ByteBuffer startAndPrefix, List columns, Map attributes) throws IOError, org.apache.thrift.TException; + + /** + * Get a scanner on the current table starting at the specified row and + * ending at the last row in the table. Return the specified columns. + * Only values with the specified timestamp are returned. + * + * @return scanner id to be used with other scanner procedures + * + * @param tableName name of table + * + * @param startRow Starting row in table to scan. + * Send "" (empty string) to start at the first row. + * + * @param columns columns to scan. If column name is a column family, all + * columns of the specified column family are returned. It's also possible + * to pass a regex in the column qualifier. + * + * @param timestamp timestamp + * + * @param attributes Scan attributes + */ + public int scannerOpenTs(ByteBuffer tableName, ByteBuffer startRow, List columns, long timestamp, Map attributes) throws IOError, org.apache.thrift.TException; + + /** + * Get a scanner on the current table starting and stopping at the + * specified rows. ending at the last row in the table. Return the + * specified columns. Only values with the specified timestamp are + * returned. + * + * @return scanner id to be used with other scanner procedures + * + * @param tableName name of table + * + * @param startRow Starting row in table to scan. + * Send "" (empty string) to start at the first row. + * + * @param stopRow row to stop scanning on. This row is *not* included in the + * scanner's results + * + * @param columns columns to scan. If column name is a column family, all + * columns of the specified column family are returned. It's also possible + * to pass a regex in the column qualifier. + * + * @param timestamp timestamp + * + * @param attributes Scan attributes + */ + public int scannerOpenWithStopTs(ByteBuffer tableName, ByteBuffer startRow, ByteBuffer stopRow, List columns, long timestamp, Map attributes) throws IOError, org.apache.thrift.TException; + + /** + * Returns the scanner's current row value and advances to the next + * row in the table. When there are no more rows in the table, or a key + * greater-than-or-equal-to the scanner's specified stopRow is reached, + * an empty list is returned. + * + * @return a TRowResult containing the current row and a map of the columns to TCells. + * + * @throws IllegalArgument if ScannerID is invalid + * + * @throws NotFound when the scanner reaches the end + * + * @param id id of a scanner returned by scannerOpen + */ + public List scannerGet(int id) throws IOError, IllegalArgument, org.apache.thrift.TException; + + /** + * Returns, starting at the scanner's current row value nbRows worth of + * rows and advances to the next row in the table. When there are no more + * rows in the table, or a key greater-than-or-equal-to the scanner's + * specified stopRow is reached, an empty list is returned. + * + * @return a TRowResult containing the current row and a map of the columns to TCells. + * + * @throws IllegalArgument if ScannerID is invalid + * + * @throws NotFound when the scanner reaches the end + * + * @param id id of a scanner returned by scannerOpen + * + * @param nbRows number of results to return + */ + public List scannerGetList(int id, int nbRows) throws IOError, IllegalArgument, org.apache.thrift.TException; + + /** + * Closes the server-state associated with an open scanner. + * + * @throws IllegalArgument if ScannerID is invalid + * + * @param id id of a scanner returned by scannerOpen + */ + public void scannerClose(int id) throws IOError, IllegalArgument, org.apache.thrift.TException; + + /** + * Get the regininfo for the specified row. It scans + * the metatable to find region's start and end keys. + * + * @return value for specified row/column + * + * @param row row key + */ + public TRegionInfo getRegionInfo(ByteBuffer row) throws IOError, org.apache.thrift.TException; + + /** + * Appends values to one or more columns within a single row. + * + * @return values of columns after the append operation. + * + * @param append The single append operation to apply + */ + public List append(TAppend append) throws IOError, org.apache.thrift.TException; + + /** + * Atomically checks if a row/family/qualifier value matches the expected + * value. If it does, it adds the corresponding mutation operation for put. + * + * @return true if the new put was executed, false otherwise + * + * @param tableName name of table + * + * @param row row key + * + * @param column column name + * + * @param value the expected value for the column parameter, if not + * provided the check is for the non-existence of the + * column in question + * + * @param mput mutation for the put + * + * @param attributes Mutation attributes + */ + public boolean checkAndPut(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, ByteBuffer value, Mutation mput, Map attributes) throws IOError, IllegalArgument, org.apache.thrift.TException; + + } + + public interface AsyncIface { + + public void enableTable(ByteBuffer tableName, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void disableTable(ByteBuffer tableName, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void isTableEnabled(ByteBuffer tableName, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void compact(ByteBuffer tableNameOrRegionName, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void majorCompact(ByteBuffer tableNameOrRegionName, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void getTableNames(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void getColumnDescriptors(ByteBuffer tableName, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void getTableRegions(ByteBuffer tableName, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void createTable(ByteBuffer tableName, List columnFamilies, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void deleteTable(ByteBuffer tableName, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void get(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void getVer(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, int numVersions, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void getVerTs(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, long timestamp, int numVersions, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void getRow(ByteBuffer tableName, ByteBuffer row, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void getRowWithColumns(ByteBuffer tableName, ByteBuffer row, List columns, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void getRowTs(ByteBuffer tableName, ByteBuffer row, long timestamp, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void getRowWithColumnsTs(ByteBuffer tableName, ByteBuffer row, List columns, long timestamp, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void getRows(ByteBuffer tableName, List rows, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void getRowsWithColumns(ByteBuffer tableName, List rows, List columns, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void getRowsTs(ByteBuffer tableName, List rows, long timestamp, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void getRowsWithColumnsTs(ByteBuffer tableName, List rows, List columns, long timestamp, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void mutateRow(ByteBuffer tableName, ByteBuffer row, List mutations, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void mutateRowTs(ByteBuffer tableName, ByteBuffer row, List mutations, long timestamp, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void mutateRows(ByteBuffer tableName, List rowBatches, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void mutateRowsTs(ByteBuffer tableName, List rowBatches, long timestamp, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void atomicIncrement(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, long value, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void deleteAll(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void deleteAllTs(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, long timestamp, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void deleteAllRow(ByteBuffer tableName, ByteBuffer row, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void increment(TIncrement increment, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void incrementRows(List increments, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void deleteAllRowTs(ByteBuffer tableName, ByteBuffer row, long timestamp, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void scannerOpenWithScan(ByteBuffer tableName, TScan scan, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void scannerOpen(ByteBuffer tableName, ByteBuffer startRow, List columns, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void scannerOpenWithStop(ByteBuffer tableName, ByteBuffer startRow, ByteBuffer stopRow, List columns, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void scannerOpenWithPrefix(ByteBuffer tableName, ByteBuffer startAndPrefix, List columns, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void scannerOpenTs(ByteBuffer tableName, ByteBuffer startRow, List columns, long timestamp, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void scannerOpenWithStopTs(ByteBuffer tableName, ByteBuffer startRow, ByteBuffer stopRow, List columns, long timestamp, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void scannerGet(int id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void scannerGetList(int id, int nbRows, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void scannerClose(int id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void getRegionInfo(ByteBuffer row, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void append(TAppend append, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void checkAndPut(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, ByteBuffer value, Mutation mput, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + } + + public static class Client extends org.apache.thrift.TServiceClient implements Iface { + public static class Factory implements org.apache.thrift.TServiceClientFactory { + public Factory() {} + public Client getClient(org.apache.thrift.protocol.TProtocol prot) { + return new Client(prot); + } + public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { + return new Client(iprot, oprot); + } + } + + public Client(org.apache.thrift.protocol.TProtocol prot) + { + super(prot, prot); + } + + public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { + super(iprot, oprot); + } + + public void enableTable(ByteBuffer tableName) throws IOError, org.apache.thrift.TException + { + send_enableTable(tableName); + recv_enableTable(); + } + + public void send_enableTable(ByteBuffer tableName) throws org.apache.thrift.TException + { + enableTable_args args = new enableTable_args(); + args.setTableName(tableName); + sendBase("enableTable", args); + } + + public void recv_enableTable() throws IOError, org.apache.thrift.TException + { + enableTable_result result = new enableTable_result(); + receiveBase(result, "enableTable"); + if (result.io != null) { + throw result.io; + } + return; + } + + public void disableTable(ByteBuffer tableName) throws IOError, org.apache.thrift.TException + { + send_disableTable(tableName); + recv_disableTable(); + } + + public void send_disableTable(ByteBuffer tableName) throws org.apache.thrift.TException + { + disableTable_args args = new disableTable_args(); + args.setTableName(tableName); + sendBase("disableTable", args); + } + + public void recv_disableTable() throws IOError, org.apache.thrift.TException + { + disableTable_result result = new disableTable_result(); + receiveBase(result, "disableTable"); + if (result.io != null) { + throw result.io; + } + return; + } + + public boolean isTableEnabled(ByteBuffer tableName) throws IOError, org.apache.thrift.TException + { + send_isTableEnabled(tableName); + return recv_isTableEnabled(); + } + + public void send_isTableEnabled(ByteBuffer tableName) throws org.apache.thrift.TException + { + isTableEnabled_args args = new isTableEnabled_args(); + args.setTableName(tableName); + sendBase("isTableEnabled", args); + } + + public boolean recv_isTableEnabled() throws IOError, org.apache.thrift.TException + { + isTableEnabled_result result = new isTableEnabled_result(); + receiveBase(result, "isTableEnabled"); + if (result.isSetSuccess()) { + return result.success; + } + if (result.io != null) { + throw result.io; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "isTableEnabled failed: unknown result"); + } + + public void compact(ByteBuffer tableNameOrRegionName) throws IOError, org.apache.thrift.TException + { + send_compact(tableNameOrRegionName); + recv_compact(); + } + + public void send_compact(ByteBuffer tableNameOrRegionName) throws org.apache.thrift.TException + { + compact_args args = new compact_args(); + args.setTableNameOrRegionName(tableNameOrRegionName); + sendBase("compact", args); + } + + public void recv_compact() throws IOError, org.apache.thrift.TException + { + compact_result result = new compact_result(); + receiveBase(result, "compact"); + if (result.io != null) { + throw result.io; + } + return; + } + + public void majorCompact(ByteBuffer tableNameOrRegionName) throws IOError, org.apache.thrift.TException + { + send_majorCompact(tableNameOrRegionName); + recv_majorCompact(); + } + + public void send_majorCompact(ByteBuffer tableNameOrRegionName) throws org.apache.thrift.TException + { + majorCompact_args args = new majorCompact_args(); + args.setTableNameOrRegionName(tableNameOrRegionName); + sendBase("majorCompact", args); + } + + public void recv_majorCompact() throws IOError, org.apache.thrift.TException + { + majorCompact_result result = new majorCompact_result(); + receiveBase(result, "majorCompact"); + if (result.io != null) { + throw result.io; + } + return; + } + + public List getTableNames() throws IOError, org.apache.thrift.TException + { + send_getTableNames(); + return recv_getTableNames(); + } + + public void send_getTableNames() throws org.apache.thrift.TException + { + getTableNames_args args = new getTableNames_args(); + sendBase("getTableNames", args); + } + + public List recv_getTableNames() throws IOError, org.apache.thrift.TException + { + getTableNames_result result = new getTableNames_result(); + receiveBase(result, "getTableNames"); + if (result.isSetSuccess()) { + return result.success; + } + if (result.io != null) { + throw result.io; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getTableNames failed: unknown result"); + } + + public Map getColumnDescriptors(ByteBuffer tableName) throws IOError, org.apache.thrift.TException + { + send_getColumnDescriptors(tableName); + return recv_getColumnDescriptors(); + } + + public void send_getColumnDescriptors(ByteBuffer tableName) throws org.apache.thrift.TException + { + getColumnDescriptors_args args = new getColumnDescriptors_args(); + args.setTableName(tableName); + sendBase("getColumnDescriptors", args); + } + + public Map recv_getColumnDescriptors() throws IOError, org.apache.thrift.TException + { + getColumnDescriptors_result result = new getColumnDescriptors_result(); + receiveBase(result, "getColumnDescriptors"); + if (result.isSetSuccess()) { + return result.success; + } + if (result.io != null) { + throw result.io; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getColumnDescriptors failed: unknown result"); + } + + public List getTableRegions(ByteBuffer tableName) throws IOError, org.apache.thrift.TException + { + send_getTableRegions(tableName); + return recv_getTableRegions(); + } + + public void send_getTableRegions(ByteBuffer tableName) throws org.apache.thrift.TException + { + getTableRegions_args args = new getTableRegions_args(); + args.setTableName(tableName); + sendBase("getTableRegions", args); + } + + public List recv_getTableRegions() throws IOError, org.apache.thrift.TException + { + getTableRegions_result result = new getTableRegions_result(); + receiveBase(result, "getTableRegions"); + if (result.isSetSuccess()) { + return result.success; + } + if (result.io != null) { + throw result.io; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getTableRegions failed: unknown result"); + } + + public void createTable(ByteBuffer tableName, List columnFamilies) throws IOError, IllegalArgument, AlreadyExists, org.apache.thrift.TException + { + send_createTable(tableName, columnFamilies); + recv_createTable(); + } + + public void send_createTable(ByteBuffer tableName, List columnFamilies) throws org.apache.thrift.TException + { + createTable_args args = new createTable_args(); + args.setTableName(tableName); + args.setColumnFamilies(columnFamilies); + sendBase("createTable", args); + } + + public void recv_createTable() throws IOError, IllegalArgument, AlreadyExists, org.apache.thrift.TException + { + createTable_result result = new createTable_result(); + receiveBase(result, "createTable"); + if (result.io != null) { + throw result.io; + } + if (result.ia != null) { + throw result.ia; + } + if (result.exist != null) { + throw result.exist; + } + return; + } + + public void deleteTable(ByteBuffer tableName) throws IOError, org.apache.thrift.TException + { + send_deleteTable(tableName); + recv_deleteTable(); + } + + public void send_deleteTable(ByteBuffer tableName) throws org.apache.thrift.TException + { + deleteTable_args args = new deleteTable_args(); + args.setTableName(tableName); + sendBase("deleteTable", args); + } + + public void recv_deleteTable() throws IOError, org.apache.thrift.TException + { + deleteTable_result result = new deleteTable_result(); + receiveBase(result, "deleteTable"); + if (result.io != null) { + throw result.io; + } + return; + } + + public List get(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, Map attributes) throws IOError, org.apache.thrift.TException + { + send_get(tableName, row, column, attributes); + return recv_get(); + } + + public void send_get(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, Map attributes) throws org.apache.thrift.TException + { + get_args args = new get_args(); + args.setTableName(tableName); + args.setRow(row); + args.setColumn(column); + args.setAttributes(attributes); + sendBase("get", args); + } + + public List recv_get() throws IOError, org.apache.thrift.TException + { + get_result result = new get_result(); + receiveBase(result, "get"); + if (result.isSetSuccess()) { + return result.success; + } + if (result.io != null) { + throw result.io; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "get failed: unknown result"); + } + + public List getVer(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, int numVersions, Map attributes) throws IOError, org.apache.thrift.TException + { + send_getVer(tableName, row, column, numVersions, attributes); + return recv_getVer(); + } + + public void send_getVer(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, int numVersions, Map attributes) throws org.apache.thrift.TException + { + getVer_args args = new getVer_args(); + args.setTableName(tableName); + args.setRow(row); + args.setColumn(column); + args.setNumVersions(numVersions); + args.setAttributes(attributes); + sendBase("getVer", args); + } + + public List recv_getVer() throws IOError, org.apache.thrift.TException + { + getVer_result result = new getVer_result(); + receiveBase(result, "getVer"); + if (result.isSetSuccess()) { + return result.success; + } + if (result.io != null) { + throw result.io; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getVer failed: unknown result"); + } + + public List getVerTs(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, long timestamp, int numVersions, Map attributes) throws IOError, org.apache.thrift.TException + { + send_getVerTs(tableName, row, column, timestamp, numVersions, attributes); + return recv_getVerTs(); + } + + public void send_getVerTs(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, long timestamp, int numVersions, Map attributes) throws org.apache.thrift.TException + { + getVerTs_args args = new getVerTs_args(); + args.setTableName(tableName); + args.setRow(row); + args.setColumn(column); + args.setTimestamp(timestamp); + args.setNumVersions(numVersions); + args.setAttributes(attributes); + sendBase("getVerTs", args); + } + + public List recv_getVerTs() throws IOError, org.apache.thrift.TException + { + getVerTs_result result = new getVerTs_result(); + receiveBase(result, "getVerTs"); + if (result.isSetSuccess()) { + return result.success; + } + if (result.io != null) { + throw result.io; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getVerTs failed: unknown result"); + } + + public List getRow(ByteBuffer tableName, ByteBuffer row, Map attributes) throws IOError, org.apache.thrift.TException + { + send_getRow(tableName, row, attributes); + return recv_getRow(); + } + + public void send_getRow(ByteBuffer tableName, ByteBuffer row, Map attributes) throws org.apache.thrift.TException + { + getRow_args args = new getRow_args(); + args.setTableName(tableName); + args.setRow(row); + args.setAttributes(attributes); + sendBase("getRow", args); + } + + public List recv_getRow() throws IOError, org.apache.thrift.TException + { + getRow_result result = new getRow_result(); + receiveBase(result, "getRow"); + if (result.isSetSuccess()) { + return result.success; + } + if (result.io != null) { + throw result.io; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getRow failed: unknown result"); + } + + public List getRowWithColumns(ByteBuffer tableName, ByteBuffer row, List columns, Map attributes) throws IOError, org.apache.thrift.TException + { + send_getRowWithColumns(tableName, row, columns, attributes); + return recv_getRowWithColumns(); + } + + public void send_getRowWithColumns(ByteBuffer tableName, ByteBuffer row, List columns, Map attributes) throws org.apache.thrift.TException + { + getRowWithColumns_args args = new getRowWithColumns_args(); + args.setTableName(tableName); + args.setRow(row); + args.setColumns(columns); + args.setAttributes(attributes); + sendBase("getRowWithColumns", args); + } + + public List recv_getRowWithColumns() throws IOError, org.apache.thrift.TException + { + getRowWithColumns_result result = new getRowWithColumns_result(); + receiveBase(result, "getRowWithColumns"); + if (result.isSetSuccess()) { + return result.success; + } + if (result.io != null) { + throw result.io; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getRowWithColumns failed: unknown result"); + } + + public List getRowTs(ByteBuffer tableName, ByteBuffer row, long timestamp, Map attributes) throws IOError, org.apache.thrift.TException + { + send_getRowTs(tableName, row, timestamp, attributes); + return recv_getRowTs(); + } + + public void send_getRowTs(ByteBuffer tableName, ByteBuffer row, long timestamp, Map attributes) throws org.apache.thrift.TException + { + getRowTs_args args = new getRowTs_args(); + args.setTableName(tableName); + args.setRow(row); + args.setTimestamp(timestamp); + args.setAttributes(attributes); + sendBase("getRowTs", args); + } + + public List recv_getRowTs() throws IOError, org.apache.thrift.TException + { + getRowTs_result result = new getRowTs_result(); + receiveBase(result, "getRowTs"); + if (result.isSetSuccess()) { + return result.success; + } + if (result.io != null) { + throw result.io; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getRowTs failed: unknown result"); + } + + public List getRowWithColumnsTs(ByteBuffer tableName, ByteBuffer row, List columns, long timestamp, Map attributes) throws IOError, org.apache.thrift.TException + { + send_getRowWithColumnsTs(tableName, row, columns, timestamp, attributes); + return recv_getRowWithColumnsTs(); + } + + public void send_getRowWithColumnsTs(ByteBuffer tableName, ByteBuffer row, List columns, long timestamp, Map attributes) throws org.apache.thrift.TException + { + getRowWithColumnsTs_args args = new getRowWithColumnsTs_args(); + args.setTableName(tableName); + args.setRow(row); + args.setColumns(columns); + args.setTimestamp(timestamp); + args.setAttributes(attributes); + sendBase("getRowWithColumnsTs", args); + } + + public List recv_getRowWithColumnsTs() throws IOError, org.apache.thrift.TException + { + getRowWithColumnsTs_result result = new getRowWithColumnsTs_result(); + receiveBase(result, "getRowWithColumnsTs"); + if (result.isSetSuccess()) { + return result.success; + } + if (result.io != null) { + throw result.io; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getRowWithColumnsTs failed: unknown result"); + } + + public List getRows(ByteBuffer tableName, List rows, Map attributes) throws IOError, org.apache.thrift.TException + { + send_getRows(tableName, rows, attributes); + return recv_getRows(); + } + + public void send_getRows(ByteBuffer tableName, List rows, Map attributes) throws org.apache.thrift.TException + { + getRows_args args = new getRows_args(); + args.setTableName(tableName); + args.setRows(rows); + args.setAttributes(attributes); + sendBase("getRows", args); + } + + public List recv_getRows() throws IOError, org.apache.thrift.TException + { + getRows_result result = new getRows_result(); + receiveBase(result, "getRows"); + if (result.isSetSuccess()) { + return result.success; + } + if (result.io != null) { + throw result.io; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getRows failed: unknown result"); + } + + public List getRowsWithColumns(ByteBuffer tableName, List rows, List columns, Map attributes) throws IOError, org.apache.thrift.TException + { + send_getRowsWithColumns(tableName, rows, columns, attributes); + return recv_getRowsWithColumns(); + } + + public void send_getRowsWithColumns(ByteBuffer tableName, List rows, List columns, Map attributes) throws org.apache.thrift.TException + { + getRowsWithColumns_args args = new getRowsWithColumns_args(); + args.setTableName(tableName); + args.setRows(rows); + args.setColumns(columns); + args.setAttributes(attributes); + sendBase("getRowsWithColumns", args); + } + + public List recv_getRowsWithColumns() throws IOError, org.apache.thrift.TException + { + getRowsWithColumns_result result = new getRowsWithColumns_result(); + receiveBase(result, "getRowsWithColumns"); + if (result.isSetSuccess()) { + return result.success; + } + if (result.io != null) { + throw result.io; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getRowsWithColumns failed: unknown result"); + } + + public List getRowsTs(ByteBuffer tableName, List rows, long timestamp, Map attributes) throws IOError, org.apache.thrift.TException + { + send_getRowsTs(tableName, rows, timestamp, attributes); + return recv_getRowsTs(); + } + + public void send_getRowsTs(ByteBuffer tableName, List rows, long timestamp, Map attributes) throws org.apache.thrift.TException + { + getRowsTs_args args = new getRowsTs_args(); + args.setTableName(tableName); + args.setRows(rows); + args.setTimestamp(timestamp); + args.setAttributes(attributes); + sendBase("getRowsTs", args); + } + + public List recv_getRowsTs() throws IOError, org.apache.thrift.TException + { + getRowsTs_result result = new getRowsTs_result(); + receiveBase(result, "getRowsTs"); + if (result.isSetSuccess()) { + return result.success; + } + if (result.io != null) { + throw result.io; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getRowsTs failed: unknown result"); + } + + public List getRowsWithColumnsTs(ByteBuffer tableName, List rows, List columns, long timestamp, Map attributes) throws IOError, org.apache.thrift.TException + { + send_getRowsWithColumnsTs(tableName, rows, columns, timestamp, attributes); + return recv_getRowsWithColumnsTs(); + } + + public void send_getRowsWithColumnsTs(ByteBuffer tableName, List rows, List columns, long timestamp, Map attributes) throws org.apache.thrift.TException + { + getRowsWithColumnsTs_args args = new getRowsWithColumnsTs_args(); + args.setTableName(tableName); + args.setRows(rows); + args.setColumns(columns); + args.setTimestamp(timestamp); + args.setAttributes(attributes); + sendBase("getRowsWithColumnsTs", args); + } + + public List recv_getRowsWithColumnsTs() throws IOError, org.apache.thrift.TException + { + getRowsWithColumnsTs_result result = new getRowsWithColumnsTs_result(); + receiveBase(result, "getRowsWithColumnsTs"); + if (result.isSetSuccess()) { + return result.success; + } + if (result.io != null) { + throw result.io; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getRowsWithColumnsTs failed: unknown result"); + } + + public void mutateRow(ByteBuffer tableName, ByteBuffer row, List mutations, Map attributes) throws IOError, IllegalArgument, org.apache.thrift.TException + { + send_mutateRow(tableName, row, mutations, attributes); + recv_mutateRow(); + } + + public void send_mutateRow(ByteBuffer tableName, ByteBuffer row, List mutations, Map attributes) throws org.apache.thrift.TException + { + mutateRow_args args = new mutateRow_args(); + args.setTableName(tableName); + args.setRow(row); + args.setMutations(mutations); + args.setAttributes(attributes); + sendBase("mutateRow", args); + } + + public void recv_mutateRow() throws IOError, IllegalArgument, org.apache.thrift.TException + { + mutateRow_result result = new mutateRow_result(); + receiveBase(result, "mutateRow"); + if (result.io != null) { + throw result.io; + } + if (result.ia != null) { + throw result.ia; + } + return; + } + + public void mutateRowTs(ByteBuffer tableName, ByteBuffer row, List mutations, long timestamp, Map attributes) throws IOError, IllegalArgument, org.apache.thrift.TException + { + send_mutateRowTs(tableName, row, mutations, timestamp, attributes); + recv_mutateRowTs(); + } + + public void send_mutateRowTs(ByteBuffer tableName, ByteBuffer row, List mutations, long timestamp, Map attributes) throws org.apache.thrift.TException + { + mutateRowTs_args args = new mutateRowTs_args(); + args.setTableName(tableName); + args.setRow(row); + args.setMutations(mutations); + args.setTimestamp(timestamp); + args.setAttributes(attributes); + sendBase("mutateRowTs", args); + } + + public void recv_mutateRowTs() throws IOError, IllegalArgument, org.apache.thrift.TException + { + mutateRowTs_result result = new mutateRowTs_result(); + receiveBase(result, "mutateRowTs"); + if (result.io != null) { + throw result.io; + } + if (result.ia != null) { + throw result.ia; + } + return; + } + + public void mutateRows(ByteBuffer tableName, List rowBatches, Map attributes) throws IOError, IllegalArgument, org.apache.thrift.TException + { + send_mutateRows(tableName, rowBatches, attributes); + recv_mutateRows(); + } + + public void send_mutateRows(ByteBuffer tableName, List rowBatches, Map attributes) throws org.apache.thrift.TException + { + mutateRows_args args = new mutateRows_args(); + args.setTableName(tableName); + args.setRowBatches(rowBatches); + args.setAttributes(attributes); + sendBase("mutateRows", args); + } + + public void recv_mutateRows() throws IOError, IllegalArgument, org.apache.thrift.TException + { + mutateRows_result result = new mutateRows_result(); + receiveBase(result, "mutateRows"); + if (result.io != null) { + throw result.io; + } + if (result.ia != null) { + throw result.ia; + } + return; + } + + public void mutateRowsTs(ByteBuffer tableName, List rowBatches, long timestamp, Map attributes) throws IOError, IllegalArgument, org.apache.thrift.TException + { + send_mutateRowsTs(tableName, rowBatches, timestamp, attributes); + recv_mutateRowsTs(); + } + + public void send_mutateRowsTs(ByteBuffer tableName, List rowBatches, long timestamp, Map attributes) throws org.apache.thrift.TException + { + mutateRowsTs_args args = new mutateRowsTs_args(); + args.setTableName(tableName); + args.setRowBatches(rowBatches); + args.setTimestamp(timestamp); + args.setAttributes(attributes); + sendBase("mutateRowsTs", args); + } + + public void recv_mutateRowsTs() throws IOError, IllegalArgument, org.apache.thrift.TException + { + mutateRowsTs_result result = new mutateRowsTs_result(); + receiveBase(result, "mutateRowsTs"); + if (result.io != null) { + throw result.io; + } + if (result.ia != null) { + throw result.ia; + } + return; + } + + public long atomicIncrement(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, long value) throws IOError, IllegalArgument, org.apache.thrift.TException + { + send_atomicIncrement(tableName, row, column, value); + return recv_atomicIncrement(); + } + + public void send_atomicIncrement(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, long value) throws org.apache.thrift.TException + { + atomicIncrement_args args = new atomicIncrement_args(); + args.setTableName(tableName); + args.setRow(row); + args.setColumn(column); + args.setValue(value); + sendBase("atomicIncrement", args); + } + + public long recv_atomicIncrement() throws IOError, IllegalArgument, org.apache.thrift.TException + { + atomicIncrement_result result = new atomicIncrement_result(); + receiveBase(result, "atomicIncrement"); + if (result.isSetSuccess()) { + return result.success; + } + if (result.io != null) { + throw result.io; + } + if (result.ia != null) { + throw result.ia; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "atomicIncrement failed: unknown result"); + } + + public void deleteAll(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, Map attributes) throws IOError, org.apache.thrift.TException + { + send_deleteAll(tableName, row, column, attributes); + recv_deleteAll(); + } + + public void send_deleteAll(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, Map attributes) throws org.apache.thrift.TException + { + deleteAll_args args = new deleteAll_args(); + args.setTableName(tableName); + args.setRow(row); + args.setColumn(column); + args.setAttributes(attributes); + sendBase("deleteAll", args); + } + + public void recv_deleteAll() throws IOError, org.apache.thrift.TException + { + deleteAll_result result = new deleteAll_result(); + receiveBase(result, "deleteAll"); + if (result.io != null) { + throw result.io; + } + return; + } + + public void deleteAllTs(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, long timestamp, Map attributes) throws IOError, org.apache.thrift.TException + { + send_deleteAllTs(tableName, row, column, timestamp, attributes); + recv_deleteAllTs(); + } + + public void send_deleteAllTs(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, long timestamp, Map attributes) throws org.apache.thrift.TException + { + deleteAllTs_args args = new deleteAllTs_args(); + args.setTableName(tableName); + args.setRow(row); + args.setColumn(column); + args.setTimestamp(timestamp); + args.setAttributes(attributes); + sendBase("deleteAllTs", args); + } + + public void recv_deleteAllTs() throws IOError, org.apache.thrift.TException + { + deleteAllTs_result result = new deleteAllTs_result(); + receiveBase(result, "deleteAllTs"); + if (result.io != null) { + throw result.io; + } + return; + } + + public void deleteAllRow(ByteBuffer tableName, ByteBuffer row, Map attributes) throws IOError, org.apache.thrift.TException + { + send_deleteAllRow(tableName, row, attributes); + recv_deleteAllRow(); + } + + public void send_deleteAllRow(ByteBuffer tableName, ByteBuffer row, Map attributes) throws org.apache.thrift.TException + { + deleteAllRow_args args = new deleteAllRow_args(); + args.setTableName(tableName); + args.setRow(row); + args.setAttributes(attributes); + sendBase("deleteAllRow", args); + } + + public void recv_deleteAllRow() throws IOError, org.apache.thrift.TException + { + deleteAllRow_result result = new deleteAllRow_result(); + receiveBase(result, "deleteAllRow"); + if (result.io != null) { + throw result.io; + } + return; + } + + public void increment(TIncrement increment) throws IOError, org.apache.thrift.TException + { + send_increment(increment); + recv_increment(); + } + + public void send_increment(TIncrement increment) throws org.apache.thrift.TException + { + increment_args args = new increment_args(); + args.setIncrement(increment); + sendBase("increment", args); + } + + public void recv_increment() throws IOError, org.apache.thrift.TException + { + increment_result result = new increment_result(); + receiveBase(result, "increment"); + if (result.io != null) { + throw result.io; + } + return; + } + + public void incrementRows(List increments) throws IOError, org.apache.thrift.TException + { + send_incrementRows(increments); + recv_incrementRows(); + } + + public void send_incrementRows(List increments) throws org.apache.thrift.TException + { + incrementRows_args args = new incrementRows_args(); + args.setIncrements(increments); + sendBase("incrementRows", args); + } + + public void recv_incrementRows() throws IOError, org.apache.thrift.TException + { + incrementRows_result result = new incrementRows_result(); + receiveBase(result, "incrementRows"); + if (result.io != null) { + throw result.io; + } + return; + } + + public void deleteAllRowTs(ByteBuffer tableName, ByteBuffer row, long timestamp, Map attributes) throws IOError, org.apache.thrift.TException + { + send_deleteAllRowTs(tableName, row, timestamp, attributes); + recv_deleteAllRowTs(); + } + + public void send_deleteAllRowTs(ByteBuffer tableName, ByteBuffer row, long timestamp, Map attributes) throws org.apache.thrift.TException + { + deleteAllRowTs_args args = new deleteAllRowTs_args(); + args.setTableName(tableName); + args.setRow(row); + args.setTimestamp(timestamp); + args.setAttributes(attributes); + sendBase("deleteAllRowTs", args); + } + + public void recv_deleteAllRowTs() throws IOError, org.apache.thrift.TException + { + deleteAllRowTs_result result = new deleteAllRowTs_result(); + receiveBase(result, "deleteAllRowTs"); + if (result.io != null) { + throw result.io; + } + return; + } + + public int scannerOpenWithScan(ByteBuffer tableName, TScan scan, Map attributes) throws IOError, org.apache.thrift.TException + { + send_scannerOpenWithScan(tableName, scan, attributes); + return recv_scannerOpenWithScan(); + } + + public void send_scannerOpenWithScan(ByteBuffer tableName, TScan scan, Map attributes) throws org.apache.thrift.TException + { + scannerOpenWithScan_args args = new scannerOpenWithScan_args(); + args.setTableName(tableName); + args.setScan(scan); + args.setAttributes(attributes); + sendBase("scannerOpenWithScan", args); + } + + public int recv_scannerOpenWithScan() throws IOError, org.apache.thrift.TException + { + scannerOpenWithScan_result result = new scannerOpenWithScan_result(); + receiveBase(result, "scannerOpenWithScan"); + if (result.isSetSuccess()) { + return result.success; + } + if (result.io != null) { + throw result.io; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "scannerOpenWithScan failed: unknown result"); + } + + public int scannerOpen(ByteBuffer tableName, ByteBuffer startRow, List columns, Map attributes) throws IOError, org.apache.thrift.TException + { + send_scannerOpen(tableName, startRow, columns, attributes); + return recv_scannerOpen(); + } + + public void send_scannerOpen(ByteBuffer tableName, ByteBuffer startRow, List columns, Map attributes) throws org.apache.thrift.TException + { + scannerOpen_args args = new scannerOpen_args(); + args.setTableName(tableName); + args.setStartRow(startRow); + args.setColumns(columns); + args.setAttributes(attributes); + sendBase("scannerOpen", args); + } + + public int recv_scannerOpen() throws IOError, org.apache.thrift.TException + { + scannerOpen_result result = new scannerOpen_result(); + receiveBase(result, "scannerOpen"); + if (result.isSetSuccess()) { + return result.success; + } + if (result.io != null) { + throw result.io; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "scannerOpen failed: unknown result"); + } + + public int scannerOpenWithStop(ByteBuffer tableName, ByteBuffer startRow, ByteBuffer stopRow, List columns, Map attributes) throws IOError, org.apache.thrift.TException + { + send_scannerOpenWithStop(tableName, startRow, stopRow, columns, attributes); + return recv_scannerOpenWithStop(); + } + + public void send_scannerOpenWithStop(ByteBuffer tableName, ByteBuffer startRow, ByteBuffer stopRow, List columns, Map attributes) throws org.apache.thrift.TException + { + scannerOpenWithStop_args args = new scannerOpenWithStop_args(); + args.setTableName(tableName); + args.setStartRow(startRow); + args.setStopRow(stopRow); + args.setColumns(columns); + args.setAttributes(attributes); + sendBase("scannerOpenWithStop", args); + } + + public int recv_scannerOpenWithStop() throws IOError, org.apache.thrift.TException + { + scannerOpenWithStop_result result = new scannerOpenWithStop_result(); + receiveBase(result, "scannerOpenWithStop"); + if (result.isSetSuccess()) { + return result.success; + } + if (result.io != null) { + throw result.io; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "scannerOpenWithStop failed: unknown result"); + } + + public int scannerOpenWithPrefix(ByteBuffer tableName, ByteBuffer startAndPrefix, List columns, Map attributes) throws IOError, org.apache.thrift.TException + { + send_scannerOpenWithPrefix(tableName, startAndPrefix, columns, attributes); + return recv_scannerOpenWithPrefix(); + } + + public void send_scannerOpenWithPrefix(ByteBuffer tableName, ByteBuffer startAndPrefix, List columns, Map attributes) throws org.apache.thrift.TException + { + scannerOpenWithPrefix_args args = new scannerOpenWithPrefix_args(); + args.setTableName(tableName); + args.setStartAndPrefix(startAndPrefix); + args.setColumns(columns); + args.setAttributes(attributes); + sendBase("scannerOpenWithPrefix", args); + } + + public int recv_scannerOpenWithPrefix() throws IOError, org.apache.thrift.TException + { + scannerOpenWithPrefix_result result = new scannerOpenWithPrefix_result(); + receiveBase(result, "scannerOpenWithPrefix"); + if (result.isSetSuccess()) { + return result.success; + } + if (result.io != null) { + throw result.io; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "scannerOpenWithPrefix failed: unknown result"); + } + + public int scannerOpenTs(ByteBuffer tableName, ByteBuffer startRow, List columns, long timestamp, Map attributes) throws IOError, org.apache.thrift.TException + { + send_scannerOpenTs(tableName, startRow, columns, timestamp, attributes); + return recv_scannerOpenTs(); + } + + public void send_scannerOpenTs(ByteBuffer tableName, ByteBuffer startRow, List columns, long timestamp, Map attributes) throws org.apache.thrift.TException + { + scannerOpenTs_args args = new scannerOpenTs_args(); + args.setTableName(tableName); + args.setStartRow(startRow); + args.setColumns(columns); + args.setTimestamp(timestamp); + args.setAttributes(attributes); + sendBase("scannerOpenTs", args); + } + + public int recv_scannerOpenTs() throws IOError, org.apache.thrift.TException + { + scannerOpenTs_result result = new scannerOpenTs_result(); + receiveBase(result, "scannerOpenTs"); + if (result.isSetSuccess()) { + return result.success; + } + if (result.io != null) { + throw result.io; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "scannerOpenTs failed: unknown result"); + } + + public int scannerOpenWithStopTs(ByteBuffer tableName, ByteBuffer startRow, ByteBuffer stopRow, List columns, long timestamp, Map attributes) throws IOError, org.apache.thrift.TException + { + send_scannerOpenWithStopTs(tableName, startRow, stopRow, columns, timestamp, attributes); + return recv_scannerOpenWithStopTs(); + } + + public void send_scannerOpenWithStopTs(ByteBuffer tableName, ByteBuffer startRow, ByteBuffer stopRow, List columns, long timestamp, Map attributes) throws org.apache.thrift.TException + { + scannerOpenWithStopTs_args args = new scannerOpenWithStopTs_args(); + args.setTableName(tableName); + args.setStartRow(startRow); + args.setStopRow(stopRow); + args.setColumns(columns); + args.setTimestamp(timestamp); + args.setAttributes(attributes); + sendBase("scannerOpenWithStopTs", args); + } + + public int recv_scannerOpenWithStopTs() throws IOError, org.apache.thrift.TException + { + scannerOpenWithStopTs_result result = new scannerOpenWithStopTs_result(); + receiveBase(result, "scannerOpenWithStopTs"); + if (result.isSetSuccess()) { + return result.success; + } + if (result.io != null) { + throw result.io; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "scannerOpenWithStopTs failed: unknown result"); + } + + public List scannerGet(int id) throws IOError, IllegalArgument, org.apache.thrift.TException + { + send_scannerGet(id); + return recv_scannerGet(); + } + + public void send_scannerGet(int id) throws org.apache.thrift.TException + { + scannerGet_args args = new scannerGet_args(); + args.setId(id); + sendBase("scannerGet", args); + } + + public List recv_scannerGet() throws IOError, IllegalArgument, org.apache.thrift.TException + { + scannerGet_result result = new scannerGet_result(); + receiveBase(result, "scannerGet"); + if (result.isSetSuccess()) { + return result.success; + } + if (result.io != null) { + throw result.io; + } + if (result.ia != null) { + throw result.ia; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "scannerGet failed: unknown result"); + } + + public List scannerGetList(int id, int nbRows) throws IOError, IllegalArgument, org.apache.thrift.TException + { + send_scannerGetList(id, nbRows); + return recv_scannerGetList(); + } + + public void send_scannerGetList(int id, int nbRows) throws org.apache.thrift.TException + { + scannerGetList_args args = new scannerGetList_args(); + args.setId(id); + args.setNbRows(nbRows); + sendBase("scannerGetList", args); + } + + public List recv_scannerGetList() throws IOError, IllegalArgument, org.apache.thrift.TException + { + scannerGetList_result result = new scannerGetList_result(); + receiveBase(result, "scannerGetList"); + if (result.isSetSuccess()) { + return result.success; + } + if (result.io != null) { + throw result.io; + } + if (result.ia != null) { + throw result.ia; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "scannerGetList failed: unknown result"); + } + + public void scannerClose(int id) throws IOError, IllegalArgument, org.apache.thrift.TException + { + send_scannerClose(id); + recv_scannerClose(); + } + + public void send_scannerClose(int id) throws org.apache.thrift.TException + { + scannerClose_args args = new scannerClose_args(); + args.setId(id); + sendBase("scannerClose", args); + } + + public void recv_scannerClose() throws IOError, IllegalArgument, org.apache.thrift.TException + { + scannerClose_result result = new scannerClose_result(); + receiveBase(result, "scannerClose"); + if (result.io != null) { + throw result.io; + } + if (result.ia != null) { + throw result.ia; + } + return; + } + + public TRegionInfo getRegionInfo(ByteBuffer row) throws IOError, org.apache.thrift.TException + { + send_getRegionInfo(row); + return recv_getRegionInfo(); + } + + public void send_getRegionInfo(ByteBuffer row) throws org.apache.thrift.TException + { + getRegionInfo_args args = new getRegionInfo_args(); + args.setRow(row); + sendBase("getRegionInfo", args); + } + + public TRegionInfo recv_getRegionInfo() throws IOError, org.apache.thrift.TException + { + getRegionInfo_result result = new getRegionInfo_result(); + receiveBase(result, "getRegionInfo"); + if (result.isSetSuccess()) { + return result.success; + } + if (result.io != null) { + throw result.io; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getRegionInfo failed: unknown result"); + } + + public List append(TAppend append) throws IOError, org.apache.thrift.TException + { + send_append(append); + return recv_append(); + } + + public void send_append(TAppend append) throws org.apache.thrift.TException + { + append_args args = new append_args(); + args.setAppend(append); + sendBase("append", args); + } + + public List recv_append() throws IOError, org.apache.thrift.TException + { + append_result result = new append_result(); + receiveBase(result, "append"); + if (result.isSetSuccess()) { + return result.success; + } + if (result.io != null) { + throw result.io; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "append failed: unknown result"); + } + + public boolean checkAndPut(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, ByteBuffer value, Mutation mput, Map attributes) throws IOError, IllegalArgument, org.apache.thrift.TException + { + send_checkAndPut(tableName, row, column, value, mput, attributes); + return recv_checkAndPut(); + } + + public void send_checkAndPut(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, ByteBuffer value, Mutation mput, Map attributes) throws org.apache.thrift.TException + { + checkAndPut_args args = new checkAndPut_args(); + args.setTableName(tableName); + args.setRow(row); + args.setColumn(column); + args.setValue(value); + args.setMput(mput); + args.setAttributes(attributes); + sendBase("checkAndPut", args); + } + + public boolean recv_checkAndPut() throws IOError, IllegalArgument, org.apache.thrift.TException + { + checkAndPut_result result = new checkAndPut_result(); + receiveBase(result, "checkAndPut"); + if (result.isSetSuccess()) { + return result.success; + } + if (result.io != null) { + throw result.io; + } + if (result.ia != null) { + throw result.ia; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "checkAndPut failed: unknown result"); + } + + } + public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface { + public static class Factory implements org.apache.thrift.async.TAsyncClientFactory { + private org.apache.thrift.async.TAsyncClientManager clientManager; + private org.apache.thrift.protocol.TProtocolFactory protocolFactory; + public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) { + this.clientManager = clientManager; + this.protocolFactory = protocolFactory; + } + public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) { + return new AsyncClient(protocolFactory, clientManager, transport); + } + } + + public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) { + super(protocolFactory, clientManager, transport); + } + + public void enableTable(ByteBuffer tableName, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + enableTable_call method_call = new enableTable_call(tableName, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class enableTable_call extends org.apache.thrift.async.TAsyncMethodCall { + private ByteBuffer tableName; + public enableTable_call(ByteBuffer tableName, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.tableName = tableName; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("enableTable", org.apache.thrift.protocol.TMessageType.CALL, 0)); + enableTable_args args = new enableTable_args(); + args.setTableName(tableName); + args.write(prot); + prot.writeMessageEnd(); + } + + public void getResult() throws IOError, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + (new Client(prot)).recv_enableTable(); + } + } + + public void disableTable(ByteBuffer tableName, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + disableTable_call method_call = new disableTable_call(tableName, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class disableTable_call extends org.apache.thrift.async.TAsyncMethodCall { + private ByteBuffer tableName; + public disableTable_call(ByteBuffer tableName, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.tableName = tableName; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("disableTable", org.apache.thrift.protocol.TMessageType.CALL, 0)); + disableTable_args args = new disableTable_args(); + args.setTableName(tableName); + args.write(prot); + prot.writeMessageEnd(); + } + + public void getResult() throws IOError, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + (new Client(prot)).recv_disableTable(); + } + } + + public void isTableEnabled(ByteBuffer tableName, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + isTableEnabled_call method_call = new isTableEnabled_call(tableName, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class isTableEnabled_call extends org.apache.thrift.async.TAsyncMethodCall { + private ByteBuffer tableName; + public isTableEnabled_call(ByteBuffer tableName, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.tableName = tableName; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("isTableEnabled", org.apache.thrift.protocol.TMessageType.CALL, 0)); + isTableEnabled_args args = new isTableEnabled_args(); + args.setTableName(tableName); + args.write(prot); + prot.writeMessageEnd(); + } + + public boolean getResult() throws IOError, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_isTableEnabled(); + } + } + + public void compact(ByteBuffer tableNameOrRegionName, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + compact_call method_call = new compact_call(tableNameOrRegionName, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class compact_call extends org.apache.thrift.async.TAsyncMethodCall { + private ByteBuffer tableNameOrRegionName; + public compact_call(ByteBuffer tableNameOrRegionName, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.tableNameOrRegionName = tableNameOrRegionName; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("compact", org.apache.thrift.protocol.TMessageType.CALL, 0)); + compact_args args = new compact_args(); + args.setTableNameOrRegionName(tableNameOrRegionName); + args.write(prot); + prot.writeMessageEnd(); + } + + public void getResult() throws IOError, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + (new Client(prot)).recv_compact(); + } + } + + public void majorCompact(ByteBuffer tableNameOrRegionName, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + majorCompact_call method_call = new majorCompact_call(tableNameOrRegionName, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class majorCompact_call extends org.apache.thrift.async.TAsyncMethodCall { + private ByteBuffer tableNameOrRegionName; + public majorCompact_call(ByteBuffer tableNameOrRegionName, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.tableNameOrRegionName = tableNameOrRegionName; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("majorCompact", org.apache.thrift.protocol.TMessageType.CALL, 0)); + majorCompact_args args = new majorCompact_args(); + args.setTableNameOrRegionName(tableNameOrRegionName); + args.write(prot); + prot.writeMessageEnd(); + } + + public void getResult() throws IOError, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + (new Client(prot)).recv_majorCompact(); + } + } + + public void getTableNames(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + getTableNames_call method_call = new getTableNames_call(resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class getTableNames_call extends org.apache.thrift.async.TAsyncMethodCall { + public getTableNames_call(org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getTableNames", org.apache.thrift.protocol.TMessageType.CALL, 0)); + getTableNames_args args = new getTableNames_args(); + args.write(prot); + prot.writeMessageEnd(); + } + + public List getResult() throws IOError, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_getTableNames(); + } + } + + public void getColumnDescriptors(ByteBuffer tableName, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + getColumnDescriptors_call method_call = new getColumnDescriptors_call(tableName, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class getColumnDescriptors_call extends org.apache.thrift.async.TAsyncMethodCall { + private ByteBuffer tableName; + public getColumnDescriptors_call(ByteBuffer tableName, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.tableName = tableName; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getColumnDescriptors", org.apache.thrift.protocol.TMessageType.CALL, 0)); + getColumnDescriptors_args args = new getColumnDescriptors_args(); + args.setTableName(tableName); + args.write(prot); + prot.writeMessageEnd(); + } + + public Map getResult() throws IOError, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_getColumnDescriptors(); + } + } + + public void getTableRegions(ByteBuffer tableName, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + getTableRegions_call method_call = new getTableRegions_call(tableName, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class getTableRegions_call extends org.apache.thrift.async.TAsyncMethodCall { + private ByteBuffer tableName; + public getTableRegions_call(ByteBuffer tableName, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.tableName = tableName; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getTableRegions", org.apache.thrift.protocol.TMessageType.CALL, 0)); + getTableRegions_args args = new getTableRegions_args(); + args.setTableName(tableName); + args.write(prot); + prot.writeMessageEnd(); + } + + public List getResult() throws IOError, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_getTableRegions(); + } + } + + public void createTable(ByteBuffer tableName, List columnFamilies, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + createTable_call method_call = new createTable_call(tableName, columnFamilies, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class createTable_call extends org.apache.thrift.async.TAsyncMethodCall { + private ByteBuffer tableName; + private List columnFamilies; + public createTable_call(ByteBuffer tableName, List columnFamilies, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.tableName = tableName; + this.columnFamilies = columnFamilies; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("createTable", org.apache.thrift.protocol.TMessageType.CALL, 0)); + createTable_args args = new createTable_args(); + args.setTableName(tableName); + args.setColumnFamilies(columnFamilies); + args.write(prot); + prot.writeMessageEnd(); + } + + public void getResult() throws IOError, IllegalArgument, AlreadyExists, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + (new Client(prot)).recv_createTable(); + } + } + + public void deleteTable(ByteBuffer tableName, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + deleteTable_call method_call = new deleteTable_call(tableName, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class deleteTable_call extends org.apache.thrift.async.TAsyncMethodCall { + private ByteBuffer tableName; + public deleteTable_call(ByteBuffer tableName, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.tableName = tableName; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("deleteTable", org.apache.thrift.protocol.TMessageType.CALL, 0)); + deleteTable_args args = new deleteTable_args(); + args.setTableName(tableName); + args.write(prot); + prot.writeMessageEnd(); + } + + public void getResult() throws IOError, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + (new Client(prot)).recv_deleteTable(); + } + } + + public void get(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + get_call method_call = new get_call(tableName, row, column, attributes, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class get_call extends org.apache.thrift.async.TAsyncMethodCall { + private ByteBuffer tableName; + private ByteBuffer row; + private ByteBuffer column; + private Map attributes; + public get_call(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.tableName = tableName; + this.row = row; + this.column = column; + this.attributes = attributes; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("get", org.apache.thrift.protocol.TMessageType.CALL, 0)); + get_args args = new get_args(); + args.setTableName(tableName); + args.setRow(row); + args.setColumn(column); + args.setAttributes(attributes); + args.write(prot); + prot.writeMessageEnd(); + } + + public List getResult() throws IOError, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_get(); + } + } + + public void getVer(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, int numVersions, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + getVer_call method_call = new getVer_call(tableName, row, column, numVersions, attributes, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class getVer_call extends org.apache.thrift.async.TAsyncMethodCall { + private ByteBuffer tableName; + private ByteBuffer row; + private ByteBuffer column; + private int numVersions; + private Map attributes; + public getVer_call(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, int numVersions, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.tableName = tableName; + this.row = row; + this.column = column; + this.numVersions = numVersions; + this.attributes = attributes; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getVer", org.apache.thrift.protocol.TMessageType.CALL, 0)); + getVer_args args = new getVer_args(); + args.setTableName(tableName); + args.setRow(row); + args.setColumn(column); + args.setNumVersions(numVersions); + args.setAttributes(attributes); + args.write(prot); + prot.writeMessageEnd(); + } + + public List getResult() throws IOError, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_getVer(); + } + } + + public void getVerTs(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, long timestamp, int numVersions, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + getVerTs_call method_call = new getVerTs_call(tableName, row, column, timestamp, numVersions, attributes, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class getVerTs_call extends org.apache.thrift.async.TAsyncMethodCall { + private ByteBuffer tableName; + private ByteBuffer row; + private ByteBuffer column; + private long timestamp; + private int numVersions; + private Map attributes; + public getVerTs_call(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, long timestamp, int numVersions, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.tableName = tableName; + this.row = row; + this.column = column; + this.timestamp = timestamp; + this.numVersions = numVersions; + this.attributes = attributes; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getVerTs", org.apache.thrift.protocol.TMessageType.CALL, 0)); + getVerTs_args args = new getVerTs_args(); + args.setTableName(tableName); + args.setRow(row); + args.setColumn(column); + args.setTimestamp(timestamp); + args.setNumVersions(numVersions); + args.setAttributes(attributes); + args.write(prot); + prot.writeMessageEnd(); + } + + public List getResult() throws IOError, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_getVerTs(); + } + } + + public void getRow(ByteBuffer tableName, ByteBuffer row, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + getRow_call method_call = new getRow_call(tableName, row, attributes, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class getRow_call extends org.apache.thrift.async.TAsyncMethodCall { + private ByteBuffer tableName; + private ByteBuffer row; + private Map attributes; + public getRow_call(ByteBuffer tableName, ByteBuffer row, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.tableName = tableName; + this.row = row; + this.attributes = attributes; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getRow", org.apache.thrift.protocol.TMessageType.CALL, 0)); + getRow_args args = new getRow_args(); + args.setTableName(tableName); + args.setRow(row); + args.setAttributes(attributes); + args.write(prot); + prot.writeMessageEnd(); + } + + public List getResult() throws IOError, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_getRow(); + } + } + + public void getRowWithColumns(ByteBuffer tableName, ByteBuffer row, List columns, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + getRowWithColumns_call method_call = new getRowWithColumns_call(tableName, row, columns, attributes, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class getRowWithColumns_call extends org.apache.thrift.async.TAsyncMethodCall { + private ByteBuffer tableName; + private ByteBuffer row; + private List columns; + private Map attributes; + public getRowWithColumns_call(ByteBuffer tableName, ByteBuffer row, List columns, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.tableName = tableName; + this.row = row; + this.columns = columns; + this.attributes = attributes; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getRowWithColumns", org.apache.thrift.protocol.TMessageType.CALL, 0)); + getRowWithColumns_args args = new getRowWithColumns_args(); + args.setTableName(tableName); + args.setRow(row); + args.setColumns(columns); + args.setAttributes(attributes); + args.write(prot); + prot.writeMessageEnd(); + } + + public List getResult() throws IOError, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_getRowWithColumns(); + } + } + + public void getRowTs(ByteBuffer tableName, ByteBuffer row, long timestamp, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + getRowTs_call method_call = new getRowTs_call(tableName, row, timestamp, attributes, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class getRowTs_call extends org.apache.thrift.async.TAsyncMethodCall { + private ByteBuffer tableName; + private ByteBuffer row; + private long timestamp; + private Map attributes; + public getRowTs_call(ByteBuffer tableName, ByteBuffer row, long timestamp, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.tableName = tableName; + this.row = row; + this.timestamp = timestamp; + this.attributes = attributes; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getRowTs", org.apache.thrift.protocol.TMessageType.CALL, 0)); + getRowTs_args args = new getRowTs_args(); + args.setTableName(tableName); + args.setRow(row); + args.setTimestamp(timestamp); + args.setAttributes(attributes); + args.write(prot); + prot.writeMessageEnd(); + } + + public List getResult() throws IOError, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_getRowTs(); + } + } + + public void getRowWithColumnsTs(ByteBuffer tableName, ByteBuffer row, List columns, long timestamp, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + getRowWithColumnsTs_call method_call = new getRowWithColumnsTs_call(tableName, row, columns, timestamp, attributes, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class getRowWithColumnsTs_call extends org.apache.thrift.async.TAsyncMethodCall { + private ByteBuffer tableName; + private ByteBuffer row; + private List columns; + private long timestamp; + private Map attributes; + public getRowWithColumnsTs_call(ByteBuffer tableName, ByteBuffer row, List columns, long timestamp, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.tableName = tableName; + this.row = row; + this.columns = columns; + this.timestamp = timestamp; + this.attributes = attributes; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getRowWithColumnsTs", org.apache.thrift.protocol.TMessageType.CALL, 0)); + getRowWithColumnsTs_args args = new getRowWithColumnsTs_args(); + args.setTableName(tableName); + args.setRow(row); + args.setColumns(columns); + args.setTimestamp(timestamp); + args.setAttributes(attributes); + args.write(prot); + prot.writeMessageEnd(); + } + + public List getResult() throws IOError, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_getRowWithColumnsTs(); + } + } + + public void getRows(ByteBuffer tableName, List rows, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + getRows_call method_call = new getRows_call(tableName, rows, attributes, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class getRows_call extends org.apache.thrift.async.TAsyncMethodCall { + private ByteBuffer tableName; + private List rows; + private Map attributes; + public getRows_call(ByteBuffer tableName, List rows, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.tableName = tableName; + this.rows = rows; + this.attributes = attributes; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getRows", org.apache.thrift.protocol.TMessageType.CALL, 0)); + getRows_args args = new getRows_args(); + args.setTableName(tableName); + args.setRows(rows); + args.setAttributes(attributes); + args.write(prot); + prot.writeMessageEnd(); + } + + public List getResult() throws IOError, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_getRows(); + } + } + + public void getRowsWithColumns(ByteBuffer tableName, List rows, List columns, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + getRowsWithColumns_call method_call = new getRowsWithColumns_call(tableName, rows, columns, attributes, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class getRowsWithColumns_call extends org.apache.thrift.async.TAsyncMethodCall { + private ByteBuffer tableName; + private List rows; + private List columns; + private Map attributes; + public getRowsWithColumns_call(ByteBuffer tableName, List rows, List columns, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.tableName = tableName; + this.rows = rows; + this.columns = columns; + this.attributes = attributes; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getRowsWithColumns", org.apache.thrift.protocol.TMessageType.CALL, 0)); + getRowsWithColumns_args args = new getRowsWithColumns_args(); + args.setTableName(tableName); + args.setRows(rows); + args.setColumns(columns); + args.setAttributes(attributes); + args.write(prot); + prot.writeMessageEnd(); + } + + public List getResult() throws IOError, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_getRowsWithColumns(); + } + } + + public void getRowsTs(ByteBuffer tableName, List rows, long timestamp, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + getRowsTs_call method_call = new getRowsTs_call(tableName, rows, timestamp, attributes, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class getRowsTs_call extends org.apache.thrift.async.TAsyncMethodCall { + private ByteBuffer tableName; + private List rows; + private long timestamp; + private Map attributes; + public getRowsTs_call(ByteBuffer tableName, List rows, long timestamp, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.tableName = tableName; + this.rows = rows; + this.timestamp = timestamp; + this.attributes = attributes; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getRowsTs", org.apache.thrift.protocol.TMessageType.CALL, 0)); + getRowsTs_args args = new getRowsTs_args(); + args.setTableName(tableName); + args.setRows(rows); + args.setTimestamp(timestamp); + args.setAttributes(attributes); + args.write(prot); + prot.writeMessageEnd(); + } + + public List getResult() throws IOError, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_getRowsTs(); + } + } + + public void getRowsWithColumnsTs(ByteBuffer tableName, List rows, List columns, long timestamp, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + getRowsWithColumnsTs_call method_call = new getRowsWithColumnsTs_call(tableName, rows, columns, timestamp, attributes, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class getRowsWithColumnsTs_call extends org.apache.thrift.async.TAsyncMethodCall { + private ByteBuffer tableName; + private List rows; + private List columns; + private long timestamp; + private Map attributes; + public getRowsWithColumnsTs_call(ByteBuffer tableName, List rows, List columns, long timestamp, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.tableName = tableName; + this.rows = rows; + this.columns = columns; + this.timestamp = timestamp; + this.attributes = attributes; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getRowsWithColumnsTs", org.apache.thrift.protocol.TMessageType.CALL, 0)); + getRowsWithColumnsTs_args args = new getRowsWithColumnsTs_args(); + args.setTableName(tableName); + args.setRows(rows); + args.setColumns(columns); + args.setTimestamp(timestamp); + args.setAttributes(attributes); + args.write(prot); + prot.writeMessageEnd(); + } + + public List getResult() throws IOError, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_getRowsWithColumnsTs(); + } + } + + public void mutateRow(ByteBuffer tableName, ByteBuffer row, List mutations, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + mutateRow_call method_call = new mutateRow_call(tableName, row, mutations, attributes, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class mutateRow_call extends org.apache.thrift.async.TAsyncMethodCall { + private ByteBuffer tableName; + private ByteBuffer row; + private List mutations; + private Map attributes; + public mutateRow_call(ByteBuffer tableName, ByteBuffer row, List mutations, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.tableName = tableName; + this.row = row; + this.mutations = mutations; + this.attributes = attributes; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("mutateRow", org.apache.thrift.protocol.TMessageType.CALL, 0)); + mutateRow_args args = new mutateRow_args(); + args.setTableName(tableName); + args.setRow(row); + args.setMutations(mutations); + args.setAttributes(attributes); + args.write(prot); + prot.writeMessageEnd(); + } + + public void getResult() throws IOError, IllegalArgument, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + (new Client(prot)).recv_mutateRow(); + } + } + + public void mutateRowTs(ByteBuffer tableName, ByteBuffer row, List mutations, long timestamp, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + mutateRowTs_call method_call = new mutateRowTs_call(tableName, row, mutations, timestamp, attributes, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class mutateRowTs_call extends org.apache.thrift.async.TAsyncMethodCall { + private ByteBuffer tableName; + private ByteBuffer row; + private List mutations; + private long timestamp; + private Map attributes; + public mutateRowTs_call(ByteBuffer tableName, ByteBuffer row, List mutations, long timestamp, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.tableName = tableName; + this.row = row; + this.mutations = mutations; + this.timestamp = timestamp; + this.attributes = attributes; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("mutateRowTs", org.apache.thrift.protocol.TMessageType.CALL, 0)); + mutateRowTs_args args = new mutateRowTs_args(); + args.setTableName(tableName); + args.setRow(row); + args.setMutations(mutations); + args.setTimestamp(timestamp); + args.setAttributes(attributes); + args.write(prot); + prot.writeMessageEnd(); + } + + public void getResult() throws IOError, IllegalArgument, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + (new Client(prot)).recv_mutateRowTs(); + } + } + + public void mutateRows(ByteBuffer tableName, List rowBatches, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + mutateRows_call method_call = new mutateRows_call(tableName, rowBatches, attributes, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class mutateRows_call extends org.apache.thrift.async.TAsyncMethodCall { + private ByteBuffer tableName; + private List rowBatches; + private Map attributes; + public mutateRows_call(ByteBuffer tableName, List rowBatches, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.tableName = tableName; + this.rowBatches = rowBatches; + this.attributes = attributes; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("mutateRows", org.apache.thrift.protocol.TMessageType.CALL, 0)); + mutateRows_args args = new mutateRows_args(); + args.setTableName(tableName); + args.setRowBatches(rowBatches); + args.setAttributes(attributes); + args.write(prot); + prot.writeMessageEnd(); + } + + public void getResult() throws IOError, IllegalArgument, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + (new Client(prot)).recv_mutateRows(); + } + } + + public void mutateRowsTs(ByteBuffer tableName, List rowBatches, long timestamp, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + mutateRowsTs_call method_call = new mutateRowsTs_call(tableName, rowBatches, timestamp, attributes, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class mutateRowsTs_call extends org.apache.thrift.async.TAsyncMethodCall { + private ByteBuffer tableName; + private List rowBatches; + private long timestamp; + private Map attributes; + public mutateRowsTs_call(ByteBuffer tableName, List rowBatches, long timestamp, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.tableName = tableName; + this.rowBatches = rowBatches; + this.timestamp = timestamp; + this.attributes = attributes; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("mutateRowsTs", org.apache.thrift.protocol.TMessageType.CALL, 0)); + mutateRowsTs_args args = new mutateRowsTs_args(); + args.setTableName(tableName); + args.setRowBatches(rowBatches); + args.setTimestamp(timestamp); + args.setAttributes(attributes); + args.write(prot); + prot.writeMessageEnd(); + } + + public void getResult() throws IOError, IllegalArgument, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + (new Client(prot)).recv_mutateRowsTs(); + } + } + + public void atomicIncrement(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, long value, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + atomicIncrement_call method_call = new atomicIncrement_call(tableName, row, column, value, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class atomicIncrement_call extends org.apache.thrift.async.TAsyncMethodCall { + private ByteBuffer tableName; + private ByteBuffer row; + private ByteBuffer column; + private long value; + public atomicIncrement_call(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, long value, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.tableName = tableName; + this.row = row; + this.column = column; + this.value = value; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("atomicIncrement", org.apache.thrift.protocol.TMessageType.CALL, 0)); + atomicIncrement_args args = new atomicIncrement_args(); + args.setTableName(tableName); + args.setRow(row); + args.setColumn(column); + args.setValue(value); + args.write(prot); + prot.writeMessageEnd(); + } + + public long getResult() throws IOError, IllegalArgument, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_atomicIncrement(); + } + } + + public void deleteAll(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + deleteAll_call method_call = new deleteAll_call(tableName, row, column, attributes, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class deleteAll_call extends org.apache.thrift.async.TAsyncMethodCall { + private ByteBuffer tableName; + private ByteBuffer row; + private ByteBuffer column; + private Map attributes; + public deleteAll_call(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.tableName = tableName; + this.row = row; + this.column = column; + this.attributes = attributes; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("deleteAll", org.apache.thrift.protocol.TMessageType.CALL, 0)); + deleteAll_args args = new deleteAll_args(); + args.setTableName(tableName); + args.setRow(row); + args.setColumn(column); + args.setAttributes(attributes); + args.write(prot); + prot.writeMessageEnd(); + } + + public void getResult() throws IOError, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + (new Client(prot)).recv_deleteAll(); + } + } + + public void deleteAllTs(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, long timestamp, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + deleteAllTs_call method_call = new deleteAllTs_call(tableName, row, column, timestamp, attributes, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class deleteAllTs_call extends org.apache.thrift.async.TAsyncMethodCall { + private ByteBuffer tableName; + private ByteBuffer row; + private ByteBuffer column; + private long timestamp; + private Map attributes; + public deleteAllTs_call(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, long timestamp, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.tableName = tableName; + this.row = row; + this.column = column; + this.timestamp = timestamp; + this.attributes = attributes; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("deleteAllTs", org.apache.thrift.protocol.TMessageType.CALL, 0)); + deleteAllTs_args args = new deleteAllTs_args(); + args.setTableName(tableName); + args.setRow(row); + args.setColumn(column); + args.setTimestamp(timestamp); + args.setAttributes(attributes); + args.write(prot); + prot.writeMessageEnd(); + } + + public void getResult() throws IOError, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + (new Client(prot)).recv_deleteAllTs(); + } + } + + public void deleteAllRow(ByteBuffer tableName, ByteBuffer row, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + deleteAllRow_call method_call = new deleteAllRow_call(tableName, row, attributes, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class deleteAllRow_call extends org.apache.thrift.async.TAsyncMethodCall { + private ByteBuffer tableName; + private ByteBuffer row; + private Map attributes; + public deleteAllRow_call(ByteBuffer tableName, ByteBuffer row, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.tableName = tableName; + this.row = row; + this.attributes = attributes; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("deleteAllRow", org.apache.thrift.protocol.TMessageType.CALL, 0)); + deleteAllRow_args args = new deleteAllRow_args(); + args.setTableName(tableName); + args.setRow(row); + args.setAttributes(attributes); + args.write(prot); + prot.writeMessageEnd(); + } + + public void getResult() throws IOError, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + (new Client(prot)).recv_deleteAllRow(); + } + } + + public void increment(TIncrement increment, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + increment_call method_call = new increment_call(increment, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class increment_call extends org.apache.thrift.async.TAsyncMethodCall { + private TIncrement increment; + public increment_call(TIncrement increment, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.increment = increment; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("increment", org.apache.thrift.protocol.TMessageType.CALL, 0)); + increment_args args = new increment_args(); + args.setIncrement(increment); + args.write(prot); + prot.writeMessageEnd(); + } + + public void getResult() throws IOError, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + (new Client(prot)).recv_increment(); + } + } + + public void incrementRows(List increments, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + incrementRows_call method_call = new incrementRows_call(increments, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class incrementRows_call extends org.apache.thrift.async.TAsyncMethodCall { + private List increments; + public incrementRows_call(List increments, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.increments = increments; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("incrementRows", org.apache.thrift.protocol.TMessageType.CALL, 0)); + incrementRows_args args = new incrementRows_args(); + args.setIncrements(increments); + args.write(prot); + prot.writeMessageEnd(); + } + + public void getResult() throws IOError, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + (new Client(prot)).recv_incrementRows(); + } + } + + public void deleteAllRowTs(ByteBuffer tableName, ByteBuffer row, long timestamp, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + deleteAllRowTs_call method_call = new deleteAllRowTs_call(tableName, row, timestamp, attributes, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class deleteAllRowTs_call extends org.apache.thrift.async.TAsyncMethodCall { + private ByteBuffer tableName; + private ByteBuffer row; + private long timestamp; + private Map attributes; + public deleteAllRowTs_call(ByteBuffer tableName, ByteBuffer row, long timestamp, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.tableName = tableName; + this.row = row; + this.timestamp = timestamp; + this.attributes = attributes; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("deleteAllRowTs", org.apache.thrift.protocol.TMessageType.CALL, 0)); + deleteAllRowTs_args args = new deleteAllRowTs_args(); + args.setTableName(tableName); + args.setRow(row); + args.setTimestamp(timestamp); + args.setAttributes(attributes); + args.write(prot); + prot.writeMessageEnd(); + } + + public void getResult() throws IOError, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + (new Client(prot)).recv_deleteAllRowTs(); + } + } + + public void scannerOpenWithScan(ByteBuffer tableName, TScan scan, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + scannerOpenWithScan_call method_call = new scannerOpenWithScan_call(tableName, scan, attributes, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class scannerOpenWithScan_call extends org.apache.thrift.async.TAsyncMethodCall { + private ByteBuffer tableName; + private TScan scan; + private Map attributes; + public scannerOpenWithScan_call(ByteBuffer tableName, TScan scan, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.tableName = tableName; + this.scan = scan; + this.attributes = attributes; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("scannerOpenWithScan", org.apache.thrift.protocol.TMessageType.CALL, 0)); + scannerOpenWithScan_args args = new scannerOpenWithScan_args(); + args.setTableName(tableName); + args.setScan(scan); + args.setAttributes(attributes); + args.write(prot); + prot.writeMessageEnd(); + } + + public int getResult() throws IOError, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_scannerOpenWithScan(); + } + } + + public void scannerOpen(ByteBuffer tableName, ByteBuffer startRow, List columns, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + scannerOpen_call method_call = new scannerOpen_call(tableName, startRow, columns, attributes, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class scannerOpen_call extends org.apache.thrift.async.TAsyncMethodCall { + private ByteBuffer tableName; + private ByteBuffer startRow; + private List columns; + private Map attributes; + public scannerOpen_call(ByteBuffer tableName, ByteBuffer startRow, List columns, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.tableName = tableName; + this.startRow = startRow; + this.columns = columns; + this.attributes = attributes; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("scannerOpen", org.apache.thrift.protocol.TMessageType.CALL, 0)); + scannerOpen_args args = new scannerOpen_args(); + args.setTableName(tableName); + args.setStartRow(startRow); + args.setColumns(columns); + args.setAttributes(attributes); + args.write(prot); + prot.writeMessageEnd(); + } + + public int getResult() throws IOError, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_scannerOpen(); + } + } + + public void scannerOpenWithStop(ByteBuffer tableName, ByteBuffer startRow, ByteBuffer stopRow, List columns, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + scannerOpenWithStop_call method_call = new scannerOpenWithStop_call(tableName, startRow, stopRow, columns, attributes, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class scannerOpenWithStop_call extends org.apache.thrift.async.TAsyncMethodCall { + private ByteBuffer tableName; + private ByteBuffer startRow; + private ByteBuffer stopRow; + private List columns; + private Map attributes; + public scannerOpenWithStop_call(ByteBuffer tableName, ByteBuffer startRow, ByteBuffer stopRow, List columns, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.tableName = tableName; + this.startRow = startRow; + this.stopRow = stopRow; + this.columns = columns; + this.attributes = attributes; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("scannerOpenWithStop", org.apache.thrift.protocol.TMessageType.CALL, 0)); + scannerOpenWithStop_args args = new scannerOpenWithStop_args(); + args.setTableName(tableName); + args.setStartRow(startRow); + args.setStopRow(stopRow); + args.setColumns(columns); + args.setAttributes(attributes); + args.write(prot); + prot.writeMessageEnd(); + } + + public int getResult() throws IOError, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_scannerOpenWithStop(); + } + } + + public void scannerOpenWithPrefix(ByteBuffer tableName, ByteBuffer startAndPrefix, List columns, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + scannerOpenWithPrefix_call method_call = new scannerOpenWithPrefix_call(tableName, startAndPrefix, columns, attributes, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class scannerOpenWithPrefix_call extends org.apache.thrift.async.TAsyncMethodCall { + private ByteBuffer tableName; + private ByteBuffer startAndPrefix; + private List columns; + private Map attributes; + public scannerOpenWithPrefix_call(ByteBuffer tableName, ByteBuffer startAndPrefix, List columns, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.tableName = tableName; + this.startAndPrefix = startAndPrefix; + this.columns = columns; + this.attributes = attributes; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("scannerOpenWithPrefix", org.apache.thrift.protocol.TMessageType.CALL, 0)); + scannerOpenWithPrefix_args args = new scannerOpenWithPrefix_args(); + args.setTableName(tableName); + args.setStartAndPrefix(startAndPrefix); + args.setColumns(columns); + args.setAttributes(attributes); + args.write(prot); + prot.writeMessageEnd(); + } + + public int getResult() throws IOError, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_scannerOpenWithPrefix(); + } + } + + public void scannerOpenTs(ByteBuffer tableName, ByteBuffer startRow, List columns, long timestamp, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + scannerOpenTs_call method_call = new scannerOpenTs_call(tableName, startRow, columns, timestamp, attributes, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class scannerOpenTs_call extends org.apache.thrift.async.TAsyncMethodCall { + private ByteBuffer tableName; + private ByteBuffer startRow; + private List columns; + private long timestamp; + private Map attributes; + public scannerOpenTs_call(ByteBuffer tableName, ByteBuffer startRow, List columns, long timestamp, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.tableName = tableName; + this.startRow = startRow; + this.columns = columns; + this.timestamp = timestamp; + this.attributes = attributes; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("scannerOpenTs", org.apache.thrift.protocol.TMessageType.CALL, 0)); + scannerOpenTs_args args = new scannerOpenTs_args(); + args.setTableName(tableName); + args.setStartRow(startRow); + args.setColumns(columns); + args.setTimestamp(timestamp); + args.setAttributes(attributes); + args.write(prot); + prot.writeMessageEnd(); + } + + public int getResult() throws IOError, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_scannerOpenTs(); + } + } + + public void scannerOpenWithStopTs(ByteBuffer tableName, ByteBuffer startRow, ByteBuffer stopRow, List columns, long timestamp, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + scannerOpenWithStopTs_call method_call = new scannerOpenWithStopTs_call(tableName, startRow, stopRow, columns, timestamp, attributes, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class scannerOpenWithStopTs_call extends org.apache.thrift.async.TAsyncMethodCall { + private ByteBuffer tableName; + private ByteBuffer startRow; + private ByteBuffer stopRow; + private List columns; + private long timestamp; + private Map attributes; + public scannerOpenWithStopTs_call(ByteBuffer tableName, ByteBuffer startRow, ByteBuffer stopRow, List columns, long timestamp, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.tableName = tableName; + this.startRow = startRow; + this.stopRow = stopRow; + this.columns = columns; + this.timestamp = timestamp; + this.attributes = attributes; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("scannerOpenWithStopTs", org.apache.thrift.protocol.TMessageType.CALL, 0)); + scannerOpenWithStopTs_args args = new scannerOpenWithStopTs_args(); + args.setTableName(tableName); + args.setStartRow(startRow); + args.setStopRow(stopRow); + args.setColumns(columns); + args.setTimestamp(timestamp); + args.setAttributes(attributes); + args.write(prot); + prot.writeMessageEnd(); + } + + public int getResult() throws IOError, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_scannerOpenWithStopTs(); + } + } + + public void scannerGet(int id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + scannerGet_call method_call = new scannerGet_call(id, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class scannerGet_call extends org.apache.thrift.async.TAsyncMethodCall { + private int id; + public scannerGet_call(int id, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.id = id; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("scannerGet", org.apache.thrift.protocol.TMessageType.CALL, 0)); + scannerGet_args args = new scannerGet_args(); + args.setId(id); + args.write(prot); + prot.writeMessageEnd(); + } + + public List getResult() throws IOError, IllegalArgument, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_scannerGet(); + } + } + + public void scannerGetList(int id, int nbRows, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + scannerGetList_call method_call = new scannerGetList_call(id, nbRows, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class scannerGetList_call extends org.apache.thrift.async.TAsyncMethodCall { + private int id; + private int nbRows; + public scannerGetList_call(int id, int nbRows, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.id = id; + this.nbRows = nbRows; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("scannerGetList", org.apache.thrift.protocol.TMessageType.CALL, 0)); + scannerGetList_args args = new scannerGetList_args(); + args.setId(id); + args.setNbRows(nbRows); + args.write(prot); + prot.writeMessageEnd(); + } + + public List getResult() throws IOError, IllegalArgument, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_scannerGetList(); + } + } + + public void scannerClose(int id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + scannerClose_call method_call = new scannerClose_call(id, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class scannerClose_call extends org.apache.thrift.async.TAsyncMethodCall { + private int id; + public scannerClose_call(int id, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.id = id; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("scannerClose", org.apache.thrift.protocol.TMessageType.CALL, 0)); + scannerClose_args args = new scannerClose_args(); + args.setId(id); + args.write(prot); + prot.writeMessageEnd(); + } + + public void getResult() throws IOError, IllegalArgument, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + (new Client(prot)).recv_scannerClose(); + } + } + + public void getRegionInfo(ByteBuffer row, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + getRegionInfo_call method_call = new getRegionInfo_call(row, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class getRegionInfo_call extends org.apache.thrift.async.TAsyncMethodCall { + private ByteBuffer row; + public getRegionInfo_call(ByteBuffer row, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.row = row; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getRegionInfo", org.apache.thrift.protocol.TMessageType.CALL, 0)); + getRegionInfo_args args = new getRegionInfo_args(); + args.setRow(row); + args.write(prot); + prot.writeMessageEnd(); + } + + public TRegionInfo getResult() throws IOError, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_getRegionInfo(); + } + } + + public void append(TAppend append, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + append_call method_call = new append_call(append, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class append_call extends org.apache.thrift.async.TAsyncMethodCall { + private TAppend append; + public append_call(TAppend append, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.append = append; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("append", org.apache.thrift.protocol.TMessageType.CALL, 0)); + append_args args = new append_args(); + args.setAppend(append); + args.write(prot); + prot.writeMessageEnd(); + } + + public List getResult() throws IOError, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_append(); + } + } + + public void checkAndPut(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, ByteBuffer value, Mutation mput, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + checkAndPut_call method_call = new checkAndPut_call(tableName, row, column, value, mput, attributes, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class checkAndPut_call extends org.apache.thrift.async.TAsyncMethodCall { + private ByteBuffer tableName; + private ByteBuffer row; + private ByteBuffer column; + private ByteBuffer value; + private Mutation mput; + private Map attributes; + public checkAndPut_call(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, ByteBuffer value, Mutation mput, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.tableName = tableName; + this.row = row; + this.column = column; + this.value = value; + this.mput = mput; + this.attributes = attributes; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("checkAndPut", org.apache.thrift.protocol.TMessageType.CALL, 0)); + checkAndPut_args args = new checkAndPut_args(); + args.setTableName(tableName); + args.setRow(row); + args.setColumn(column); + args.setValue(value); + args.setMput(mput); + args.setAttributes(attributes); + args.write(prot); + prot.writeMessageEnd(); + } + + public boolean getResult() throws IOError, IllegalArgument, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_checkAndPut(); + } + } + + } + + public static class Processor extends org.apache.thrift.TBaseProcessor implements org.apache.thrift.TProcessor { + private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName()); + public Processor(I iface) { + super(iface, getProcessMap(new HashMap>())); + } + + protected Processor(I iface, Map> processMap) { + super(iface, getProcessMap(processMap)); + } + + private static Map> getProcessMap(Map> processMap) { + processMap.put("enableTable", new enableTable()); + processMap.put("disableTable", new disableTable()); + processMap.put("isTableEnabled", new isTableEnabled()); + processMap.put("compact", new compact()); + processMap.put("majorCompact", new majorCompact()); + processMap.put("getTableNames", new getTableNames()); + processMap.put("getColumnDescriptors", new getColumnDescriptors()); + processMap.put("getTableRegions", new getTableRegions()); + processMap.put("createTable", new createTable()); + processMap.put("deleteTable", new deleteTable()); + processMap.put("get", new get()); + processMap.put("getVer", new getVer()); + processMap.put("getVerTs", new getVerTs()); + processMap.put("getRow", new getRow()); + processMap.put("getRowWithColumns", new getRowWithColumns()); + processMap.put("getRowTs", new getRowTs()); + processMap.put("getRowWithColumnsTs", new getRowWithColumnsTs()); + processMap.put("getRows", new getRows()); + processMap.put("getRowsWithColumns", new getRowsWithColumns()); + processMap.put("getRowsTs", new getRowsTs()); + processMap.put("getRowsWithColumnsTs", new getRowsWithColumnsTs()); + processMap.put("mutateRow", new mutateRow()); + processMap.put("mutateRowTs", new mutateRowTs()); + processMap.put("mutateRows", new mutateRows()); + processMap.put("mutateRowsTs", new mutateRowsTs()); + processMap.put("atomicIncrement", new atomicIncrement()); + processMap.put("deleteAll", new deleteAll()); + processMap.put("deleteAllTs", new deleteAllTs()); + processMap.put("deleteAllRow", new deleteAllRow()); + processMap.put("increment", new increment()); + processMap.put("incrementRows", new incrementRows()); + processMap.put("deleteAllRowTs", new deleteAllRowTs()); + processMap.put("scannerOpenWithScan", new scannerOpenWithScan()); + processMap.put("scannerOpen", new scannerOpen()); + processMap.put("scannerOpenWithStop", new scannerOpenWithStop()); + processMap.put("scannerOpenWithPrefix", new scannerOpenWithPrefix()); + processMap.put("scannerOpenTs", new scannerOpenTs()); + processMap.put("scannerOpenWithStopTs", new scannerOpenWithStopTs()); + processMap.put("scannerGet", new scannerGet()); + processMap.put("scannerGetList", new scannerGetList()); + processMap.put("scannerClose", new scannerClose()); + processMap.put("getRegionInfo", new getRegionInfo()); + processMap.put("append", new append()); + processMap.put("checkAndPut", new checkAndPut()); + return processMap; + } + + public static class enableTable extends org.apache.thrift.ProcessFunction { + public enableTable() { + super("enableTable"); + } + + public enableTable_args getEmptyArgsInstance() { + return new enableTable_args(); + } + + protected boolean isOneway() { + return false; + } + + public enableTable_result getResult(I iface, enableTable_args args) throws org.apache.thrift.TException { + enableTable_result result = new enableTable_result(); + try { + iface.enableTable(args.tableName); + } catch (IOError io) { + result.io = io; + } + return result; + } + } + + public static class disableTable extends org.apache.thrift.ProcessFunction { + public disableTable() { + super("disableTable"); + } + + public disableTable_args getEmptyArgsInstance() { + return new disableTable_args(); + } + + protected boolean isOneway() { + return false; + } + + public disableTable_result getResult(I iface, disableTable_args args) throws org.apache.thrift.TException { + disableTable_result result = new disableTable_result(); + try { + iface.disableTable(args.tableName); + } catch (IOError io) { + result.io = io; + } + return result; + } + } + + public static class isTableEnabled extends org.apache.thrift.ProcessFunction { + public isTableEnabled() { + super("isTableEnabled"); + } + + public isTableEnabled_args getEmptyArgsInstance() { + return new isTableEnabled_args(); + } + + protected boolean isOneway() { + return false; + } + + public isTableEnabled_result getResult(I iface, isTableEnabled_args args) throws org.apache.thrift.TException { + isTableEnabled_result result = new isTableEnabled_result(); + try { + result.success = iface.isTableEnabled(args.tableName); + result.setSuccessIsSet(true); + } catch (IOError io) { + result.io = io; + } + return result; + } + } + + public static class compact extends org.apache.thrift.ProcessFunction { + public compact() { + super("compact"); + } + + public compact_args getEmptyArgsInstance() { + return new compact_args(); + } + + protected boolean isOneway() { + return false; + } + + public compact_result getResult(I iface, compact_args args) throws org.apache.thrift.TException { + compact_result result = new compact_result(); + try { + iface.compact(args.tableNameOrRegionName); + } catch (IOError io) { + result.io = io; + } + return result; + } + } + + public static class majorCompact extends org.apache.thrift.ProcessFunction { + public majorCompact() { + super("majorCompact"); + } + + public majorCompact_args getEmptyArgsInstance() { + return new majorCompact_args(); + } + + protected boolean isOneway() { + return false; + } + + public majorCompact_result getResult(I iface, majorCompact_args args) throws org.apache.thrift.TException { + majorCompact_result result = new majorCompact_result(); + try { + iface.majorCompact(args.tableNameOrRegionName); + } catch (IOError io) { + result.io = io; + } + return result; + } + } + + public static class getTableNames extends org.apache.thrift.ProcessFunction { + public getTableNames() { + super("getTableNames"); + } + + public getTableNames_args getEmptyArgsInstance() { + return new getTableNames_args(); + } + + protected boolean isOneway() { + return false; + } + + public getTableNames_result getResult(I iface, getTableNames_args args) throws org.apache.thrift.TException { + getTableNames_result result = new getTableNames_result(); + try { + result.success = iface.getTableNames(); + } catch (IOError io) { + result.io = io; + } + return result; + } + } + + public static class getColumnDescriptors extends org.apache.thrift.ProcessFunction { + public getColumnDescriptors() { + super("getColumnDescriptors"); + } + + public getColumnDescriptors_args getEmptyArgsInstance() { + return new getColumnDescriptors_args(); + } + + protected boolean isOneway() { + return false; + } + + public getColumnDescriptors_result getResult(I iface, getColumnDescriptors_args args) throws org.apache.thrift.TException { + getColumnDescriptors_result result = new getColumnDescriptors_result(); + try { + result.success = iface.getColumnDescriptors(args.tableName); + } catch (IOError io) { + result.io = io; + } + return result; + } + } + + public static class getTableRegions extends org.apache.thrift.ProcessFunction { + public getTableRegions() { + super("getTableRegions"); + } + + public getTableRegions_args getEmptyArgsInstance() { + return new getTableRegions_args(); + } + + protected boolean isOneway() { + return false; + } + + public getTableRegions_result getResult(I iface, getTableRegions_args args) throws org.apache.thrift.TException { + getTableRegions_result result = new getTableRegions_result(); + try { + result.success = iface.getTableRegions(args.tableName); + } catch (IOError io) { + result.io = io; + } + return result; + } + } + + public static class createTable extends org.apache.thrift.ProcessFunction { + public createTable() { + super("createTable"); + } + + public createTable_args getEmptyArgsInstance() { + return new createTable_args(); + } + + protected boolean isOneway() { + return false; + } + + public createTable_result getResult(I iface, createTable_args args) throws org.apache.thrift.TException { + createTable_result result = new createTable_result(); + try { + iface.createTable(args.tableName, args.columnFamilies); + } catch (IOError io) { + result.io = io; + } catch (IllegalArgument ia) { + result.ia = ia; + } catch (AlreadyExists exist) { + result.exist = exist; + } + return result; + } + } + + public static class deleteTable extends org.apache.thrift.ProcessFunction { + public deleteTable() { + super("deleteTable"); + } + + public deleteTable_args getEmptyArgsInstance() { + return new deleteTable_args(); + } + + protected boolean isOneway() { + return false; + } + + public deleteTable_result getResult(I iface, deleteTable_args args) throws org.apache.thrift.TException { + deleteTable_result result = new deleteTable_result(); + try { + iface.deleteTable(args.tableName); + } catch (IOError io) { + result.io = io; + } + return result; + } + } + + public static class get extends org.apache.thrift.ProcessFunction { + public get() { + super("get"); + } + + public get_args getEmptyArgsInstance() { + return new get_args(); + } + + protected boolean isOneway() { + return false; + } + + public get_result getResult(I iface, get_args args) throws org.apache.thrift.TException { + get_result result = new get_result(); + try { + result.success = iface.get(args.tableName, args.row, args.column, args.attributes); + } catch (IOError io) { + result.io = io; + } + return result; + } + } + + public static class getVer extends org.apache.thrift.ProcessFunction { + public getVer() { + super("getVer"); + } + + public getVer_args getEmptyArgsInstance() { + return new getVer_args(); + } + + protected boolean isOneway() { + return false; + } + + public getVer_result getResult(I iface, getVer_args args) throws org.apache.thrift.TException { + getVer_result result = new getVer_result(); + try { + result.success = iface.getVer(args.tableName, args.row, args.column, args.numVersions, args.attributes); + } catch (IOError io) { + result.io = io; + } + return result; + } + } + + public static class getVerTs extends org.apache.thrift.ProcessFunction { + public getVerTs() { + super("getVerTs"); + } + + public getVerTs_args getEmptyArgsInstance() { + return new getVerTs_args(); + } + + protected boolean isOneway() { + return false; + } + + public getVerTs_result getResult(I iface, getVerTs_args args) throws org.apache.thrift.TException { + getVerTs_result result = new getVerTs_result(); + try { + result.success = iface.getVerTs(args.tableName, args.row, args.column, args.timestamp, args.numVersions, args.attributes); + } catch (IOError io) { + result.io = io; + } + return result; + } + } + + public static class getRow extends org.apache.thrift.ProcessFunction { + public getRow() { + super("getRow"); + } + + public getRow_args getEmptyArgsInstance() { + return new getRow_args(); + } + + protected boolean isOneway() { + return false; + } + + public getRow_result getResult(I iface, getRow_args args) throws org.apache.thrift.TException { + getRow_result result = new getRow_result(); + try { + result.success = iface.getRow(args.tableName, args.row, args.attributes); + } catch (IOError io) { + result.io = io; + } + return result; + } + } + + public static class getRowWithColumns extends org.apache.thrift.ProcessFunction { + public getRowWithColumns() { + super("getRowWithColumns"); + } + + public getRowWithColumns_args getEmptyArgsInstance() { + return new getRowWithColumns_args(); + } + + protected boolean isOneway() { + return false; + } + + public getRowWithColumns_result getResult(I iface, getRowWithColumns_args args) throws org.apache.thrift.TException { + getRowWithColumns_result result = new getRowWithColumns_result(); + try { + result.success = iface.getRowWithColumns(args.tableName, args.row, args.columns, args.attributes); + } catch (IOError io) { + result.io = io; + } + return result; + } + } + + public static class getRowTs extends org.apache.thrift.ProcessFunction { + public getRowTs() { + super("getRowTs"); + } + + public getRowTs_args getEmptyArgsInstance() { + return new getRowTs_args(); + } + + protected boolean isOneway() { + return false; + } + + public getRowTs_result getResult(I iface, getRowTs_args args) throws org.apache.thrift.TException { + getRowTs_result result = new getRowTs_result(); + try { + result.success = iface.getRowTs(args.tableName, args.row, args.timestamp, args.attributes); + } catch (IOError io) { + result.io = io; + } + return result; + } + } + + public static class getRowWithColumnsTs extends org.apache.thrift.ProcessFunction { + public getRowWithColumnsTs() { + super("getRowWithColumnsTs"); + } + + public getRowWithColumnsTs_args getEmptyArgsInstance() { + return new getRowWithColumnsTs_args(); + } + + protected boolean isOneway() { + return false; + } + + public getRowWithColumnsTs_result getResult(I iface, getRowWithColumnsTs_args args) throws org.apache.thrift.TException { + getRowWithColumnsTs_result result = new getRowWithColumnsTs_result(); + try { + result.success = iface.getRowWithColumnsTs(args.tableName, args.row, args.columns, args.timestamp, args.attributes); + } catch (IOError io) { + result.io = io; + } + return result; + } + } + + public static class getRows extends org.apache.thrift.ProcessFunction { + public getRows() { + super("getRows"); + } + + public getRows_args getEmptyArgsInstance() { + return new getRows_args(); + } + + protected boolean isOneway() { + return false; + } + + public getRows_result getResult(I iface, getRows_args args) throws org.apache.thrift.TException { + getRows_result result = new getRows_result(); + try { + result.success = iface.getRows(args.tableName, args.rows, args.attributes); + } catch (IOError io) { + result.io = io; + } + return result; + } + } + + public static class getRowsWithColumns extends org.apache.thrift.ProcessFunction { + public getRowsWithColumns() { + super("getRowsWithColumns"); + } + + public getRowsWithColumns_args getEmptyArgsInstance() { + return new getRowsWithColumns_args(); + } + + protected boolean isOneway() { + return false; + } + + public getRowsWithColumns_result getResult(I iface, getRowsWithColumns_args args) throws org.apache.thrift.TException { + getRowsWithColumns_result result = new getRowsWithColumns_result(); + try { + result.success = iface.getRowsWithColumns(args.tableName, args.rows, args.columns, args.attributes); + } catch (IOError io) { + result.io = io; + } + return result; + } + } + + public static class getRowsTs extends org.apache.thrift.ProcessFunction { + public getRowsTs() { + super("getRowsTs"); + } + + public getRowsTs_args getEmptyArgsInstance() { + return new getRowsTs_args(); + } + + protected boolean isOneway() { + return false; + } + + public getRowsTs_result getResult(I iface, getRowsTs_args args) throws org.apache.thrift.TException { + getRowsTs_result result = new getRowsTs_result(); + try { + result.success = iface.getRowsTs(args.tableName, args.rows, args.timestamp, args.attributes); + } catch (IOError io) { + result.io = io; + } + return result; + } + } + + public static class getRowsWithColumnsTs extends org.apache.thrift.ProcessFunction { + public getRowsWithColumnsTs() { + super("getRowsWithColumnsTs"); + } + + public getRowsWithColumnsTs_args getEmptyArgsInstance() { + return new getRowsWithColumnsTs_args(); + } + + protected boolean isOneway() { + return false; + } + + public getRowsWithColumnsTs_result getResult(I iface, getRowsWithColumnsTs_args args) throws org.apache.thrift.TException { + getRowsWithColumnsTs_result result = new getRowsWithColumnsTs_result(); + try { + result.success = iface.getRowsWithColumnsTs(args.tableName, args.rows, args.columns, args.timestamp, args.attributes); + } catch (IOError io) { + result.io = io; + } + return result; + } + } + + public static class mutateRow extends org.apache.thrift.ProcessFunction { + public mutateRow() { + super("mutateRow"); + } + + public mutateRow_args getEmptyArgsInstance() { + return new mutateRow_args(); + } + + protected boolean isOneway() { + return false; + } + + public mutateRow_result getResult(I iface, mutateRow_args args) throws org.apache.thrift.TException { + mutateRow_result result = new mutateRow_result(); + try { + iface.mutateRow(args.tableName, args.row, args.mutations, args.attributes); + } catch (IOError io) { + result.io = io; + } catch (IllegalArgument ia) { + result.ia = ia; + } + return result; + } + } + + public static class mutateRowTs extends org.apache.thrift.ProcessFunction { + public mutateRowTs() { + super("mutateRowTs"); + } + + public mutateRowTs_args getEmptyArgsInstance() { + return new mutateRowTs_args(); + } + + protected boolean isOneway() { + return false; + } + + public mutateRowTs_result getResult(I iface, mutateRowTs_args args) throws org.apache.thrift.TException { + mutateRowTs_result result = new mutateRowTs_result(); + try { + iface.mutateRowTs(args.tableName, args.row, args.mutations, args.timestamp, args.attributes); + } catch (IOError io) { + result.io = io; + } catch (IllegalArgument ia) { + result.ia = ia; + } + return result; + } + } + + public static class mutateRows extends org.apache.thrift.ProcessFunction { + public mutateRows() { + super("mutateRows"); + } + + public mutateRows_args getEmptyArgsInstance() { + return new mutateRows_args(); + } + + protected boolean isOneway() { + return false; + } + + public mutateRows_result getResult(I iface, mutateRows_args args) throws org.apache.thrift.TException { + mutateRows_result result = new mutateRows_result(); + try { + iface.mutateRows(args.tableName, args.rowBatches, args.attributes); + } catch (IOError io) { + result.io = io; + } catch (IllegalArgument ia) { + result.ia = ia; + } + return result; + } + } + + public static class mutateRowsTs extends org.apache.thrift.ProcessFunction { + public mutateRowsTs() { + super("mutateRowsTs"); + } + + public mutateRowsTs_args getEmptyArgsInstance() { + return new mutateRowsTs_args(); + } + + protected boolean isOneway() { + return false; + } + + public mutateRowsTs_result getResult(I iface, mutateRowsTs_args args) throws org.apache.thrift.TException { + mutateRowsTs_result result = new mutateRowsTs_result(); + try { + iface.mutateRowsTs(args.tableName, args.rowBatches, args.timestamp, args.attributes); + } catch (IOError io) { + result.io = io; + } catch (IllegalArgument ia) { + result.ia = ia; + } + return result; + } + } + + public static class atomicIncrement extends org.apache.thrift.ProcessFunction { + public atomicIncrement() { + super("atomicIncrement"); + } + + public atomicIncrement_args getEmptyArgsInstance() { + return new atomicIncrement_args(); + } + + protected boolean isOneway() { + return false; + } + + public atomicIncrement_result getResult(I iface, atomicIncrement_args args) throws org.apache.thrift.TException { + atomicIncrement_result result = new atomicIncrement_result(); + try { + result.success = iface.atomicIncrement(args.tableName, args.row, args.column, args.value); + result.setSuccessIsSet(true); + } catch (IOError io) { + result.io = io; + } catch (IllegalArgument ia) { + result.ia = ia; + } + return result; + } + } + + public static class deleteAll extends org.apache.thrift.ProcessFunction { + public deleteAll() { + super("deleteAll"); + } + + public deleteAll_args getEmptyArgsInstance() { + return new deleteAll_args(); + } + + protected boolean isOneway() { + return false; + } + + public deleteAll_result getResult(I iface, deleteAll_args args) throws org.apache.thrift.TException { + deleteAll_result result = new deleteAll_result(); + try { + iface.deleteAll(args.tableName, args.row, args.column, args.attributes); + } catch (IOError io) { + result.io = io; + } + return result; + } + } + + public static class deleteAllTs extends org.apache.thrift.ProcessFunction { + public deleteAllTs() { + super("deleteAllTs"); + } + + public deleteAllTs_args getEmptyArgsInstance() { + return new deleteAllTs_args(); + } + + protected boolean isOneway() { + return false; + } + + public deleteAllTs_result getResult(I iface, deleteAllTs_args args) throws org.apache.thrift.TException { + deleteAllTs_result result = new deleteAllTs_result(); + try { + iface.deleteAllTs(args.tableName, args.row, args.column, args.timestamp, args.attributes); + } catch (IOError io) { + result.io = io; + } + return result; + } + } + + public static class deleteAllRow extends org.apache.thrift.ProcessFunction { + public deleteAllRow() { + super("deleteAllRow"); + } + + public deleteAllRow_args getEmptyArgsInstance() { + return new deleteAllRow_args(); + } + + protected boolean isOneway() { + return false; + } + + public deleteAllRow_result getResult(I iface, deleteAllRow_args args) throws org.apache.thrift.TException { + deleteAllRow_result result = new deleteAllRow_result(); + try { + iface.deleteAllRow(args.tableName, args.row, args.attributes); + } catch (IOError io) { + result.io = io; + } + return result; + } + } + + public static class increment extends org.apache.thrift.ProcessFunction { + public increment() { + super("increment"); + } + + public increment_args getEmptyArgsInstance() { + return new increment_args(); + } + + protected boolean isOneway() { + return false; + } + + public increment_result getResult(I iface, increment_args args) throws org.apache.thrift.TException { + increment_result result = new increment_result(); + try { + iface.increment(args.increment); + } catch (IOError io) { + result.io = io; + } + return result; + } + } + + public static class incrementRows extends org.apache.thrift.ProcessFunction { + public incrementRows() { + super("incrementRows"); + } + + public incrementRows_args getEmptyArgsInstance() { + return new incrementRows_args(); + } + + protected boolean isOneway() { + return false; + } + + public incrementRows_result getResult(I iface, incrementRows_args args) throws org.apache.thrift.TException { + incrementRows_result result = new incrementRows_result(); + try { + iface.incrementRows(args.increments); + } catch (IOError io) { + result.io = io; + } + return result; + } + } + + public static class deleteAllRowTs extends org.apache.thrift.ProcessFunction { + public deleteAllRowTs() { + super("deleteAllRowTs"); + } + + public deleteAllRowTs_args getEmptyArgsInstance() { + return new deleteAllRowTs_args(); + } + + protected boolean isOneway() { + return false; + } + + public deleteAllRowTs_result getResult(I iface, deleteAllRowTs_args args) throws org.apache.thrift.TException { + deleteAllRowTs_result result = new deleteAllRowTs_result(); + try { + iface.deleteAllRowTs(args.tableName, args.row, args.timestamp, args.attributes); + } catch (IOError io) { + result.io = io; + } + return result; + } + } + + public static class scannerOpenWithScan extends org.apache.thrift.ProcessFunction { + public scannerOpenWithScan() { + super("scannerOpenWithScan"); + } + + public scannerOpenWithScan_args getEmptyArgsInstance() { + return new scannerOpenWithScan_args(); + } + + protected boolean isOneway() { + return false; + } + + public scannerOpenWithScan_result getResult(I iface, scannerOpenWithScan_args args) throws org.apache.thrift.TException { + scannerOpenWithScan_result result = new scannerOpenWithScan_result(); + try { + result.success = iface.scannerOpenWithScan(args.tableName, args.scan, args.attributes); + result.setSuccessIsSet(true); + } catch (IOError io) { + result.io = io; + } + return result; + } + } + + public static class scannerOpen extends org.apache.thrift.ProcessFunction { + public scannerOpen() { + super("scannerOpen"); + } + + public scannerOpen_args getEmptyArgsInstance() { + return new scannerOpen_args(); + } + + protected boolean isOneway() { + return false; + } + + public scannerOpen_result getResult(I iface, scannerOpen_args args) throws org.apache.thrift.TException { + scannerOpen_result result = new scannerOpen_result(); + try { + result.success = iface.scannerOpen(args.tableName, args.startRow, args.columns, args.attributes); + result.setSuccessIsSet(true); + } catch (IOError io) { + result.io = io; + } + return result; + } + } + + public static class scannerOpenWithStop extends org.apache.thrift.ProcessFunction { + public scannerOpenWithStop() { + super("scannerOpenWithStop"); + } + + public scannerOpenWithStop_args getEmptyArgsInstance() { + return new scannerOpenWithStop_args(); + } + + protected boolean isOneway() { + return false; + } + + public scannerOpenWithStop_result getResult(I iface, scannerOpenWithStop_args args) throws org.apache.thrift.TException { + scannerOpenWithStop_result result = new scannerOpenWithStop_result(); + try { + result.success = iface.scannerOpenWithStop(args.tableName, args.startRow, args.stopRow, args.columns, args.attributes); + result.setSuccessIsSet(true); + } catch (IOError io) { + result.io = io; + } + return result; + } + } + + public static class scannerOpenWithPrefix extends org.apache.thrift.ProcessFunction { + public scannerOpenWithPrefix() { + super("scannerOpenWithPrefix"); + } + + public scannerOpenWithPrefix_args getEmptyArgsInstance() { + return new scannerOpenWithPrefix_args(); + } + + protected boolean isOneway() { + return false; + } + + public scannerOpenWithPrefix_result getResult(I iface, scannerOpenWithPrefix_args args) throws org.apache.thrift.TException { + scannerOpenWithPrefix_result result = new scannerOpenWithPrefix_result(); + try { + result.success = iface.scannerOpenWithPrefix(args.tableName, args.startAndPrefix, args.columns, args.attributes); + result.setSuccessIsSet(true); + } catch (IOError io) { + result.io = io; + } + return result; + } + } + + public static class scannerOpenTs extends org.apache.thrift.ProcessFunction { + public scannerOpenTs() { + super("scannerOpenTs"); + } + + public scannerOpenTs_args getEmptyArgsInstance() { + return new scannerOpenTs_args(); + } + + protected boolean isOneway() { + return false; + } + + public scannerOpenTs_result getResult(I iface, scannerOpenTs_args args) throws org.apache.thrift.TException { + scannerOpenTs_result result = new scannerOpenTs_result(); + try { + result.success = iface.scannerOpenTs(args.tableName, args.startRow, args.columns, args.timestamp, args.attributes); + result.setSuccessIsSet(true); + } catch (IOError io) { + result.io = io; + } + return result; + } + } + + public static class scannerOpenWithStopTs extends org.apache.thrift.ProcessFunction { + public scannerOpenWithStopTs() { + super("scannerOpenWithStopTs"); + } + + public scannerOpenWithStopTs_args getEmptyArgsInstance() { + return new scannerOpenWithStopTs_args(); + } + + protected boolean isOneway() { + return false; + } + + public scannerOpenWithStopTs_result getResult(I iface, scannerOpenWithStopTs_args args) throws org.apache.thrift.TException { + scannerOpenWithStopTs_result result = new scannerOpenWithStopTs_result(); + try { + result.success = iface.scannerOpenWithStopTs(args.tableName, args.startRow, args.stopRow, args.columns, args.timestamp, args.attributes); + result.setSuccessIsSet(true); + } catch (IOError io) { + result.io = io; + } + return result; + } + } + + public static class scannerGet extends org.apache.thrift.ProcessFunction { + public scannerGet() { + super("scannerGet"); + } + + public scannerGet_args getEmptyArgsInstance() { + return new scannerGet_args(); + } + + protected boolean isOneway() { + return false; + } + + public scannerGet_result getResult(I iface, scannerGet_args args) throws org.apache.thrift.TException { + scannerGet_result result = new scannerGet_result(); + try { + result.success = iface.scannerGet(args.id); + } catch (IOError io) { + result.io = io; + } catch (IllegalArgument ia) { + result.ia = ia; + } + return result; + } + } + + public static class scannerGetList extends org.apache.thrift.ProcessFunction { + public scannerGetList() { + super("scannerGetList"); + } + + public scannerGetList_args getEmptyArgsInstance() { + return new scannerGetList_args(); + } + + protected boolean isOneway() { + return false; + } + + public scannerGetList_result getResult(I iface, scannerGetList_args args) throws org.apache.thrift.TException { + scannerGetList_result result = new scannerGetList_result(); + try { + result.success = iface.scannerGetList(args.id, args.nbRows); + } catch (IOError io) { + result.io = io; + } catch (IllegalArgument ia) { + result.ia = ia; + } + return result; + } + } + + public static class scannerClose extends org.apache.thrift.ProcessFunction { + public scannerClose() { + super("scannerClose"); + } + + public scannerClose_args getEmptyArgsInstance() { + return new scannerClose_args(); + } + + protected boolean isOneway() { + return false; + } + + public scannerClose_result getResult(I iface, scannerClose_args args) throws org.apache.thrift.TException { + scannerClose_result result = new scannerClose_result(); + try { + iface.scannerClose(args.id); + } catch (IOError io) { + result.io = io; + } catch (IllegalArgument ia) { + result.ia = ia; + } + return result; + } + } + + public static class getRegionInfo extends org.apache.thrift.ProcessFunction { + public getRegionInfo() { + super("getRegionInfo"); + } + + public getRegionInfo_args getEmptyArgsInstance() { + return new getRegionInfo_args(); + } + + protected boolean isOneway() { + return false; + } + + public getRegionInfo_result getResult(I iface, getRegionInfo_args args) throws org.apache.thrift.TException { + getRegionInfo_result result = new getRegionInfo_result(); + try { + result.success = iface.getRegionInfo(args.row); + } catch (IOError io) { + result.io = io; + } + return result; + } + } + + public static class append extends org.apache.thrift.ProcessFunction { + public append() { + super("append"); + } + + public append_args getEmptyArgsInstance() { + return new append_args(); + } + + protected boolean isOneway() { + return false; + } + + public append_result getResult(I iface, append_args args) throws org.apache.thrift.TException { + append_result result = new append_result(); + try { + result.success = iface.append(args.append); + } catch (IOError io) { + result.io = io; + } + return result; + } + } + + public static class checkAndPut extends org.apache.thrift.ProcessFunction { + public checkAndPut() { + super("checkAndPut"); + } + + public checkAndPut_args getEmptyArgsInstance() { + return new checkAndPut_args(); + } + + protected boolean isOneway() { + return false; + } + + public checkAndPut_result getResult(I iface, checkAndPut_args args) throws org.apache.thrift.TException { + checkAndPut_result result = new checkAndPut_result(); + try { + result.success = iface.checkAndPut(args.tableName, args.row, args.column, args.value, args.mput, args.attributes); + result.setSuccessIsSet(true); + } catch (IOError io) { + result.io = io; + } catch (IllegalArgument ia) { + result.ia = ia; + } + return result; + } + } + + } + + public static class AsyncProcessor extends org.apache.thrift.TBaseAsyncProcessor { + private static final Logger LOGGER = LoggerFactory.getLogger(AsyncProcessor.class.getName()); + public AsyncProcessor(I iface) { + super(iface, getProcessMap(new HashMap>())); + } + + protected AsyncProcessor(I iface, Map> processMap) { + super(iface, getProcessMap(processMap)); + } + + private static Map> getProcessMap(Map> processMap) { + processMap.put("enableTable", new enableTable()); + processMap.put("disableTable", new disableTable()); + processMap.put("isTableEnabled", new isTableEnabled()); + processMap.put("compact", new compact()); + processMap.put("majorCompact", new majorCompact()); + processMap.put("getTableNames", new getTableNames()); + processMap.put("getColumnDescriptors", new getColumnDescriptors()); + processMap.put("getTableRegions", new getTableRegions()); + processMap.put("createTable", new createTable()); + processMap.put("deleteTable", new deleteTable()); + processMap.put("get", new get()); + processMap.put("getVer", new getVer()); + processMap.put("getVerTs", new getVerTs()); + processMap.put("getRow", new getRow()); + processMap.put("getRowWithColumns", new getRowWithColumns()); + processMap.put("getRowTs", new getRowTs()); + processMap.put("getRowWithColumnsTs", new getRowWithColumnsTs()); + processMap.put("getRows", new getRows()); + processMap.put("getRowsWithColumns", new getRowsWithColumns()); + processMap.put("getRowsTs", new getRowsTs()); + processMap.put("getRowsWithColumnsTs", new getRowsWithColumnsTs()); + processMap.put("mutateRow", new mutateRow()); + processMap.put("mutateRowTs", new mutateRowTs()); + processMap.put("mutateRows", new mutateRows()); + processMap.put("mutateRowsTs", new mutateRowsTs()); + processMap.put("atomicIncrement", new atomicIncrement()); + processMap.put("deleteAll", new deleteAll()); + processMap.put("deleteAllTs", new deleteAllTs()); + processMap.put("deleteAllRow", new deleteAllRow()); + processMap.put("increment", new increment()); + processMap.put("incrementRows", new incrementRows()); + processMap.put("deleteAllRowTs", new deleteAllRowTs()); + processMap.put("scannerOpenWithScan", new scannerOpenWithScan()); + processMap.put("scannerOpen", new scannerOpen()); + processMap.put("scannerOpenWithStop", new scannerOpenWithStop()); + processMap.put("scannerOpenWithPrefix", new scannerOpenWithPrefix()); + processMap.put("scannerOpenTs", new scannerOpenTs()); + processMap.put("scannerOpenWithStopTs", new scannerOpenWithStopTs()); + processMap.put("scannerGet", new scannerGet()); + processMap.put("scannerGetList", new scannerGetList()); + processMap.put("scannerClose", new scannerClose()); + processMap.put("getRegionInfo", new getRegionInfo()); + processMap.put("append", new append()); + processMap.put("checkAndPut", new checkAndPut()); + return processMap; + } + + public static class enableTable extends org.apache.thrift.AsyncProcessFunction { + public enableTable() { + super("enableTable"); + } + + public enableTable_args getEmptyArgsInstance() { + return new enableTable_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(Void o) { + enableTable_result result = new enableTable_result(); + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + enableTable_result result = new enableTable_result(); + if (e instanceof IOError) { + result.io = (IOError) e; + result.setIoIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, enableTable_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.enableTable(args.tableName,resultHandler); + } + } + + public static class disableTable extends org.apache.thrift.AsyncProcessFunction { + public disableTable() { + super("disableTable"); + } + + public disableTable_args getEmptyArgsInstance() { + return new disableTable_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(Void o) { + disableTable_result result = new disableTable_result(); + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + disableTable_result result = new disableTable_result(); + if (e instanceof IOError) { + result.io = (IOError) e; + result.setIoIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, disableTable_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.disableTable(args.tableName,resultHandler); + } + } + + public static class isTableEnabled extends org.apache.thrift.AsyncProcessFunction { + public isTableEnabled() { + super("isTableEnabled"); + } + + public isTableEnabled_args getEmptyArgsInstance() { + return new isTableEnabled_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(Boolean o) { + isTableEnabled_result result = new isTableEnabled_result(); + result.success = o; + result.setSuccessIsSet(true); + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + isTableEnabled_result result = new isTableEnabled_result(); + if (e instanceof IOError) { + result.io = (IOError) e; + result.setIoIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, isTableEnabled_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.isTableEnabled(args.tableName,resultHandler); + } + } + + public static class compact extends org.apache.thrift.AsyncProcessFunction { + public compact() { + super("compact"); + } + + public compact_args getEmptyArgsInstance() { + return new compact_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(Void o) { + compact_result result = new compact_result(); + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + compact_result result = new compact_result(); + if (e instanceof IOError) { + result.io = (IOError) e; + result.setIoIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, compact_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.compact(args.tableNameOrRegionName,resultHandler); + } + } + + public static class majorCompact extends org.apache.thrift.AsyncProcessFunction { + public majorCompact() { + super("majorCompact"); + } + + public majorCompact_args getEmptyArgsInstance() { + return new majorCompact_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(Void o) { + majorCompact_result result = new majorCompact_result(); + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + majorCompact_result result = new majorCompact_result(); + if (e instanceof IOError) { + result.io = (IOError) e; + result.setIoIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, majorCompact_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.majorCompact(args.tableNameOrRegionName,resultHandler); + } + } + + public static class getTableNames extends org.apache.thrift.AsyncProcessFunction> { + public getTableNames() { + super("getTableNames"); + } + + public getTableNames_args getEmptyArgsInstance() { + return new getTableNames_args(); + } + + public AsyncMethodCallback> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback>() { + public void onComplete(List o) { + getTableNames_result result = new getTableNames_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + getTableNames_result result = new getTableNames_result(); + if (e instanceof IOError) { + result.io = (IOError) e; + result.setIoIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, getTableNames_args args, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws TException { + iface.getTableNames(resultHandler); + } + } + + public static class getColumnDescriptors extends org.apache.thrift.AsyncProcessFunction> { + public getColumnDescriptors() { + super("getColumnDescriptors"); + } + + public getColumnDescriptors_args getEmptyArgsInstance() { + return new getColumnDescriptors_args(); + } + + public AsyncMethodCallback> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback>() { + public void onComplete(Map o) { + getColumnDescriptors_result result = new getColumnDescriptors_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + getColumnDescriptors_result result = new getColumnDescriptors_result(); + if (e instanceof IOError) { + result.io = (IOError) e; + result.setIoIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, getColumnDescriptors_args args, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws TException { + iface.getColumnDescriptors(args.tableName,resultHandler); + } + } + + public static class getTableRegions extends org.apache.thrift.AsyncProcessFunction> { + public getTableRegions() { + super("getTableRegions"); + } + + public getTableRegions_args getEmptyArgsInstance() { + return new getTableRegions_args(); + } + + public AsyncMethodCallback> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback>() { + public void onComplete(List o) { + getTableRegions_result result = new getTableRegions_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + getTableRegions_result result = new getTableRegions_result(); + if (e instanceof IOError) { + result.io = (IOError) e; + result.setIoIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, getTableRegions_args args, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws TException { + iface.getTableRegions(args.tableName,resultHandler); + } + } + + public static class createTable extends org.apache.thrift.AsyncProcessFunction { + public createTable() { + super("createTable"); + } + + public createTable_args getEmptyArgsInstance() { + return new createTable_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(Void o) { + createTable_result result = new createTable_result(); + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + createTable_result result = new createTable_result(); + if (e instanceof IOError) { + result.io = (IOError) e; + result.setIoIsSet(true); + msg = result; + } + else if (e instanceof IllegalArgument) { + result.ia = (IllegalArgument) e; + result.setIaIsSet(true); + msg = result; + } + else if (e instanceof AlreadyExists) { + result.exist = (AlreadyExists) e; + result.setExistIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, createTable_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.createTable(args.tableName, args.columnFamilies,resultHandler); + } + } + + public static class deleteTable extends org.apache.thrift.AsyncProcessFunction { + public deleteTable() { + super("deleteTable"); + } + + public deleteTable_args getEmptyArgsInstance() { + return new deleteTable_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(Void o) { + deleteTable_result result = new deleteTable_result(); + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + deleteTable_result result = new deleteTable_result(); + if (e instanceof IOError) { + result.io = (IOError) e; + result.setIoIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, deleteTable_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.deleteTable(args.tableName,resultHandler); + } + } + + public static class get extends org.apache.thrift.AsyncProcessFunction> { + public get() { + super("get"); + } + + public get_args getEmptyArgsInstance() { + return new get_args(); + } + + public AsyncMethodCallback> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback>() { + public void onComplete(List o) { + get_result result = new get_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + get_result result = new get_result(); + if (e instanceof IOError) { + result.io = (IOError) e; + result.setIoIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, get_args args, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws TException { + iface.get(args.tableName, args.row, args.column, args.attributes,resultHandler); + } + } + + public static class getVer extends org.apache.thrift.AsyncProcessFunction> { + public getVer() { + super("getVer"); + } + + public getVer_args getEmptyArgsInstance() { + return new getVer_args(); + } + + public AsyncMethodCallback> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback>() { + public void onComplete(List o) { + getVer_result result = new getVer_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + getVer_result result = new getVer_result(); + if (e instanceof IOError) { + result.io = (IOError) e; + result.setIoIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, getVer_args args, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws TException { + iface.getVer(args.tableName, args.row, args.column, args.numVersions, args.attributes,resultHandler); + } + } + + public static class getVerTs extends org.apache.thrift.AsyncProcessFunction> { + public getVerTs() { + super("getVerTs"); + } + + public getVerTs_args getEmptyArgsInstance() { + return new getVerTs_args(); + } + + public AsyncMethodCallback> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback>() { + public void onComplete(List o) { + getVerTs_result result = new getVerTs_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + getVerTs_result result = new getVerTs_result(); + if (e instanceof IOError) { + result.io = (IOError) e; + result.setIoIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, getVerTs_args args, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws TException { + iface.getVerTs(args.tableName, args.row, args.column, args.timestamp, args.numVersions, args.attributes,resultHandler); + } + } + + public static class getRow extends org.apache.thrift.AsyncProcessFunction> { + public getRow() { + super("getRow"); + } + + public getRow_args getEmptyArgsInstance() { + return new getRow_args(); + } + + public AsyncMethodCallback> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback>() { + public void onComplete(List o) { + getRow_result result = new getRow_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + getRow_result result = new getRow_result(); + if (e instanceof IOError) { + result.io = (IOError) e; + result.setIoIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, getRow_args args, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws TException { + iface.getRow(args.tableName, args.row, args.attributes,resultHandler); + } + } + + public static class getRowWithColumns extends org.apache.thrift.AsyncProcessFunction> { + public getRowWithColumns() { + super("getRowWithColumns"); + } + + public getRowWithColumns_args getEmptyArgsInstance() { + return new getRowWithColumns_args(); + } + + public AsyncMethodCallback> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback>() { + public void onComplete(List o) { + getRowWithColumns_result result = new getRowWithColumns_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + getRowWithColumns_result result = new getRowWithColumns_result(); + if (e instanceof IOError) { + result.io = (IOError) e; + result.setIoIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, getRowWithColumns_args args, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws TException { + iface.getRowWithColumns(args.tableName, args.row, args.columns, args.attributes,resultHandler); + } + } + + public static class getRowTs extends org.apache.thrift.AsyncProcessFunction> { + public getRowTs() { + super("getRowTs"); + } + + public getRowTs_args getEmptyArgsInstance() { + return new getRowTs_args(); + } + + public AsyncMethodCallback> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback>() { + public void onComplete(List o) { + getRowTs_result result = new getRowTs_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + getRowTs_result result = new getRowTs_result(); + if (e instanceof IOError) { + result.io = (IOError) e; + result.setIoIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, getRowTs_args args, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws TException { + iface.getRowTs(args.tableName, args.row, args.timestamp, args.attributes,resultHandler); + } + } + + public static class getRowWithColumnsTs extends org.apache.thrift.AsyncProcessFunction> { + public getRowWithColumnsTs() { + super("getRowWithColumnsTs"); + } + + public getRowWithColumnsTs_args getEmptyArgsInstance() { + return new getRowWithColumnsTs_args(); + } + + public AsyncMethodCallback> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback>() { + public void onComplete(List o) { + getRowWithColumnsTs_result result = new getRowWithColumnsTs_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + getRowWithColumnsTs_result result = new getRowWithColumnsTs_result(); + if (e instanceof IOError) { + result.io = (IOError) e; + result.setIoIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, getRowWithColumnsTs_args args, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws TException { + iface.getRowWithColumnsTs(args.tableName, args.row, args.columns, args.timestamp, args.attributes,resultHandler); + } + } + + public static class getRows extends org.apache.thrift.AsyncProcessFunction> { + public getRows() { + super("getRows"); + } + + public getRows_args getEmptyArgsInstance() { + return new getRows_args(); + } + + public AsyncMethodCallback> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback>() { + public void onComplete(List o) { + getRows_result result = new getRows_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + getRows_result result = new getRows_result(); + if (e instanceof IOError) { + result.io = (IOError) e; + result.setIoIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, getRows_args args, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws TException { + iface.getRows(args.tableName, args.rows, args.attributes,resultHandler); + } + } + + public static class getRowsWithColumns extends org.apache.thrift.AsyncProcessFunction> { + public getRowsWithColumns() { + super("getRowsWithColumns"); + } + + public getRowsWithColumns_args getEmptyArgsInstance() { + return new getRowsWithColumns_args(); + } + + public AsyncMethodCallback> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback>() { + public void onComplete(List o) { + getRowsWithColumns_result result = new getRowsWithColumns_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + getRowsWithColumns_result result = new getRowsWithColumns_result(); + if (e instanceof IOError) { + result.io = (IOError) e; + result.setIoIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, getRowsWithColumns_args args, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws TException { + iface.getRowsWithColumns(args.tableName, args.rows, args.columns, args.attributes,resultHandler); + } + } + + public static class getRowsTs extends org.apache.thrift.AsyncProcessFunction> { + public getRowsTs() { + super("getRowsTs"); + } + + public getRowsTs_args getEmptyArgsInstance() { + return new getRowsTs_args(); + } + + public AsyncMethodCallback> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback>() { + public void onComplete(List o) { + getRowsTs_result result = new getRowsTs_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + getRowsTs_result result = new getRowsTs_result(); + if (e instanceof IOError) { + result.io = (IOError) e; + result.setIoIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, getRowsTs_args args, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws TException { + iface.getRowsTs(args.tableName, args.rows, args.timestamp, args.attributes,resultHandler); + } + } + + public static class getRowsWithColumnsTs extends org.apache.thrift.AsyncProcessFunction> { + public getRowsWithColumnsTs() { + super("getRowsWithColumnsTs"); + } + + public getRowsWithColumnsTs_args getEmptyArgsInstance() { + return new getRowsWithColumnsTs_args(); + } + + public AsyncMethodCallback> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback>() { + public void onComplete(List o) { + getRowsWithColumnsTs_result result = new getRowsWithColumnsTs_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + getRowsWithColumnsTs_result result = new getRowsWithColumnsTs_result(); + if (e instanceof IOError) { + result.io = (IOError) e; + result.setIoIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, getRowsWithColumnsTs_args args, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws TException { + iface.getRowsWithColumnsTs(args.tableName, args.rows, args.columns, args.timestamp, args.attributes,resultHandler); + } + } + + public static class mutateRow extends org.apache.thrift.AsyncProcessFunction { + public mutateRow() { + super("mutateRow"); + } + + public mutateRow_args getEmptyArgsInstance() { + return new mutateRow_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(Void o) { + mutateRow_result result = new mutateRow_result(); + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + mutateRow_result result = new mutateRow_result(); + if (e instanceof IOError) { + result.io = (IOError) e; + result.setIoIsSet(true); + msg = result; + } + else if (e instanceof IllegalArgument) { + result.ia = (IllegalArgument) e; + result.setIaIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, mutateRow_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.mutateRow(args.tableName, args.row, args.mutations, args.attributes,resultHandler); + } + } + + public static class mutateRowTs extends org.apache.thrift.AsyncProcessFunction { + public mutateRowTs() { + super("mutateRowTs"); + } + + public mutateRowTs_args getEmptyArgsInstance() { + return new mutateRowTs_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(Void o) { + mutateRowTs_result result = new mutateRowTs_result(); + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + mutateRowTs_result result = new mutateRowTs_result(); + if (e instanceof IOError) { + result.io = (IOError) e; + result.setIoIsSet(true); + msg = result; + } + else if (e instanceof IllegalArgument) { + result.ia = (IllegalArgument) e; + result.setIaIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, mutateRowTs_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.mutateRowTs(args.tableName, args.row, args.mutations, args.timestamp, args.attributes,resultHandler); + } + } + + public static class mutateRows extends org.apache.thrift.AsyncProcessFunction { + public mutateRows() { + super("mutateRows"); + } + + public mutateRows_args getEmptyArgsInstance() { + return new mutateRows_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(Void o) { + mutateRows_result result = new mutateRows_result(); + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + mutateRows_result result = new mutateRows_result(); + if (e instanceof IOError) { + result.io = (IOError) e; + result.setIoIsSet(true); + msg = result; + } + else if (e instanceof IllegalArgument) { + result.ia = (IllegalArgument) e; + result.setIaIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, mutateRows_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.mutateRows(args.tableName, args.rowBatches, args.attributes,resultHandler); + } + } + + public static class mutateRowsTs extends org.apache.thrift.AsyncProcessFunction { + public mutateRowsTs() { + super("mutateRowsTs"); + } + + public mutateRowsTs_args getEmptyArgsInstance() { + return new mutateRowsTs_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(Void o) { + mutateRowsTs_result result = new mutateRowsTs_result(); + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + mutateRowsTs_result result = new mutateRowsTs_result(); + if (e instanceof IOError) { + result.io = (IOError) e; + result.setIoIsSet(true); + msg = result; + } + else if (e instanceof IllegalArgument) { + result.ia = (IllegalArgument) e; + result.setIaIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, mutateRowsTs_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.mutateRowsTs(args.tableName, args.rowBatches, args.timestamp, args.attributes,resultHandler); + } + } + + public static class atomicIncrement extends org.apache.thrift.AsyncProcessFunction { + public atomicIncrement() { + super("atomicIncrement"); + } + + public atomicIncrement_args getEmptyArgsInstance() { + return new atomicIncrement_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(Long o) { + atomicIncrement_result result = new atomicIncrement_result(); + result.success = o; + result.setSuccessIsSet(true); + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + atomicIncrement_result result = new atomicIncrement_result(); + if (e instanceof IOError) { + result.io = (IOError) e; + result.setIoIsSet(true); + msg = result; + } + else if (e instanceof IllegalArgument) { + result.ia = (IllegalArgument) e; + result.setIaIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, atomicIncrement_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.atomicIncrement(args.tableName, args.row, args.column, args.value,resultHandler); + } + } + + public static class deleteAll extends org.apache.thrift.AsyncProcessFunction { + public deleteAll() { + super("deleteAll"); + } + + public deleteAll_args getEmptyArgsInstance() { + return new deleteAll_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(Void o) { + deleteAll_result result = new deleteAll_result(); + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + deleteAll_result result = new deleteAll_result(); + if (e instanceof IOError) { + result.io = (IOError) e; + result.setIoIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, deleteAll_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.deleteAll(args.tableName, args.row, args.column, args.attributes,resultHandler); + } + } + + public static class deleteAllTs extends org.apache.thrift.AsyncProcessFunction { + public deleteAllTs() { + super("deleteAllTs"); + } + + public deleteAllTs_args getEmptyArgsInstance() { + return new deleteAllTs_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(Void o) { + deleteAllTs_result result = new deleteAllTs_result(); + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + deleteAllTs_result result = new deleteAllTs_result(); + if (e instanceof IOError) { + result.io = (IOError) e; + result.setIoIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, deleteAllTs_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.deleteAllTs(args.tableName, args.row, args.column, args.timestamp, args.attributes,resultHandler); + } + } + + public static class deleteAllRow extends org.apache.thrift.AsyncProcessFunction { + public deleteAllRow() { + super("deleteAllRow"); + } + + public deleteAllRow_args getEmptyArgsInstance() { + return new deleteAllRow_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(Void o) { + deleteAllRow_result result = new deleteAllRow_result(); + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + deleteAllRow_result result = new deleteAllRow_result(); + if (e instanceof IOError) { + result.io = (IOError) e; + result.setIoIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, deleteAllRow_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.deleteAllRow(args.tableName, args.row, args.attributes,resultHandler); + } + } + + public static class increment extends org.apache.thrift.AsyncProcessFunction { + public increment() { + super("increment"); + } + + public increment_args getEmptyArgsInstance() { + return new increment_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(Void o) { + increment_result result = new increment_result(); + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + increment_result result = new increment_result(); + if (e instanceof IOError) { + result.io = (IOError) e; + result.setIoIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, increment_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.increment(args.increment,resultHandler); + } + } + + public static class incrementRows extends org.apache.thrift.AsyncProcessFunction { + public incrementRows() { + super("incrementRows"); + } + + public incrementRows_args getEmptyArgsInstance() { + return new incrementRows_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(Void o) { + incrementRows_result result = new incrementRows_result(); + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + incrementRows_result result = new incrementRows_result(); + if (e instanceof IOError) { + result.io = (IOError) e; + result.setIoIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, incrementRows_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.incrementRows(args.increments,resultHandler); + } + } + + public static class deleteAllRowTs extends org.apache.thrift.AsyncProcessFunction { + public deleteAllRowTs() { + super("deleteAllRowTs"); + } + + public deleteAllRowTs_args getEmptyArgsInstance() { + return new deleteAllRowTs_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(Void o) { + deleteAllRowTs_result result = new deleteAllRowTs_result(); + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + deleteAllRowTs_result result = new deleteAllRowTs_result(); + if (e instanceof IOError) { + result.io = (IOError) e; + result.setIoIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, deleteAllRowTs_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.deleteAllRowTs(args.tableName, args.row, args.timestamp, args.attributes,resultHandler); + } + } + + public static class scannerOpenWithScan extends org.apache.thrift.AsyncProcessFunction { + public scannerOpenWithScan() { + super("scannerOpenWithScan"); + } + + public scannerOpenWithScan_args getEmptyArgsInstance() { + return new scannerOpenWithScan_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(Integer o) { + scannerOpenWithScan_result result = new scannerOpenWithScan_result(); + result.success = o; + result.setSuccessIsSet(true); + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + scannerOpenWithScan_result result = new scannerOpenWithScan_result(); + if (e instanceof IOError) { + result.io = (IOError) e; + result.setIoIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, scannerOpenWithScan_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.scannerOpenWithScan(args.tableName, args.scan, args.attributes,resultHandler); + } + } + + public static class scannerOpen extends org.apache.thrift.AsyncProcessFunction { + public scannerOpen() { + super("scannerOpen"); + } + + public scannerOpen_args getEmptyArgsInstance() { + return new scannerOpen_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(Integer o) { + scannerOpen_result result = new scannerOpen_result(); + result.success = o; + result.setSuccessIsSet(true); + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + scannerOpen_result result = new scannerOpen_result(); + if (e instanceof IOError) { + result.io = (IOError) e; + result.setIoIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, scannerOpen_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.scannerOpen(args.tableName, args.startRow, args.columns, args.attributes,resultHandler); + } + } + + public static class scannerOpenWithStop extends org.apache.thrift.AsyncProcessFunction { + public scannerOpenWithStop() { + super("scannerOpenWithStop"); + } + + public scannerOpenWithStop_args getEmptyArgsInstance() { + return new scannerOpenWithStop_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(Integer o) { + scannerOpenWithStop_result result = new scannerOpenWithStop_result(); + result.success = o; + result.setSuccessIsSet(true); + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + scannerOpenWithStop_result result = new scannerOpenWithStop_result(); + if (e instanceof IOError) { + result.io = (IOError) e; + result.setIoIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, scannerOpenWithStop_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.scannerOpenWithStop(args.tableName, args.startRow, args.stopRow, args.columns, args.attributes,resultHandler); + } + } + + public static class scannerOpenWithPrefix extends org.apache.thrift.AsyncProcessFunction { + public scannerOpenWithPrefix() { + super("scannerOpenWithPrefix"); + } + + public scannerOpenWithPrefix_args getEmptyArgsInstance() { + return new scannerOpenWithPrefix_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(Integer o) { + scannerOpenWithPrefix_result result = new scannerOpenWithPrefix_result(); + result.success = o; + result.setSuccessIsSet(true); + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + scannerOpenWithPrefix_result result = new scannerOpenWithPrefix_result(); + if (e instanceof IOError) { + result.io = (IOError) e; + result.setIoIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, scannerOpenWithPrefix_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.scannerOpenWithPrefix(args.tableName, args.startAndPrefix, args.columns, args.attributes,resultHandler); + } + } + + public static class scannerOpenTs extends org.apache.thrift.AsyncProcessFunction { + public scannerOpenTs() { + super("scannerOpenTs"); + } + + public scannerOpenTs_args getEmptyArgsInstance() { + return new scannerOpenTs_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(Integer o) { + scannerOpenTs_result result = new scannerOpenTs_result(); + result.success = o; + result.setSuccessIsSet(true); + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + scannerOpenTs_result result = new scannerOpenTs_result(); + if (e instanceof IOError) { + result.io = (IOError) e; + result.setIoIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, scannerOpenTs_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.scannerOpenTs(args.tableName, args.startRow, args.columns, args.timestamp, args.attributes,resultHandler); + } + } + + public static class scannerOpenWithStopTs extends org.apache.thrift.AsyncProcessFunction { + public scannerOpenWithStopTs() { + super("scannerOpenWithStopTs"); + } + + public scannerOpenWithStopTs_args getEmptyArgsInstance() { + return new scannerOpenWithStopTs_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(Integer o) { + scannerOpenWithStopTs_result result = new scannerOpenWithStopTs_result(); + result.success = o; + result.setSuccessIsSet(true); + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + scannerOpenWithStopTs_result result = new scannerOpenWithStopTs_result(); + if (e instanceof IOError) { + result.io = (IOError) e; + result.setIoIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, scannerOpenWithStopTs_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.scannerOpenWithStopTs(args.tableName, args.startRow, args.stopRow, args.columns, args.timestamp, args.attributes,resultHandler); + } + } + + public static class scannerGet extends org.apache.thrift.AsyncProcessFunction> { + public scannerGet() { + super("scannerGet"); + } + + public scannerGet_args getEmptyArgsInstance() { + return new scannerGet_args(); + } + + public AsyncMethodCallback> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback>() { + public void onComplete(List o) { + scannerGet_result result = new scannerGet_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + scannerGet_result result = new scannerGet_result(); + if (e instanceof IOError) { + result.io = (IOError) e; + result.setIoIsSet(true); + msg = result; + } + else if (e instanceof IllegalArgument) { + result.ia = (IllegalArgument) e; + result.setIaIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, scannerGet_args args, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws TException { + iface.scannerGet(args.id,resultHandler); + } + } + + public static class scannerGetList extends org.apache.thrift.AsyncProcessFunction> { + public scannerGetList() { + super("scannerGetList"); + } + + public scannerGetList_args getEmptyArgsInstance() { + return new scannerGetList_args(); + } + + public AsyncMethodCallback> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback>() { + public void onComplete(List o) { + scannerGetList_result result = new scannerGetList_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + scannerGetList_result result = new scannerGetList_result(); + if (e instanceof IOError) { + result.io = (IOError) e; + result.setIoIsSet(true); + msg = result; + } + else if (e instanceof IllegalArgument) { + result.ia = (IllegalArgument) e; + result.setIaIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, scannerGetList_args args, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws TException { + iface.scannerGetList(args.id, args.nbRows,resultHandler); + } + } + + public static class scannerClose extends org.apache.thrift.AsyncProcessFunction { + public scannerClose() { + super("scannerClose"); + } + + public scannerClose_args getEmptyArgsInstance() { + return new scannerClose_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(Void o) { + scannerClose_result result = new scannerClose_result(); + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + scannerClose_result result = new scannerClose_result(); + if (e instanceof IOError) { + result.io = (IOError) e; + result.setIoIsSet(true); + msg = result; + } + else if (e instanceof IllegalArgument) { + result.ia = (IllegalArgument) e; + result.setIaIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, scannerClose_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.scannerClose(args.id,resultHandler); + } + } + + public static class getRegionInfo extends org.apache.thrift.AsyncProcessFunction { + public getRegionInfo() { + super("getRegionInfo"); + } + + public getRegionInfo_args getEmptyArgsInstance() { + return new getRegionInfo_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(TRegionInfo o) { + getRegionInfo_result result = new getRegionInfo_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + getRegionInfo_result result = new getRegionInfo_result(); + if (e instanceof IOError) { + result.io = (IOError) e; + result.setIoIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, getRegionInfo_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.getRegionInfo(args.row,resultHandler); + } + } + + public static class append extends org.apache.thrift.AsyncProcessFunction> { + public append() { + super("append"); + } + + public append_args getEmptyArgsInstance() { + return new append_args(); + } + + public AsyncMethodCallback> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback>() { + public void onComplete(List o) { + append_result result = new append_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + append_result result = new append_result(); + if (e instanceof IOError) { + result.io = (IOError) e; + result.setIoIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, append_args args, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws TException { + iface.append(args.append,resultHandler); + } + } + + public static class checkAndPut extends org.apache.thrift.AsyncProcessFunction { + public checkAndPut() { + super("checkAndPut"); + } + + public checkAndPut_args getEmptyArgsInstance() { + return new checkAndPut_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(Boolean o) { + checkAndPut_result result = new checkAndPut_result(); + result.success = o; + result.setSuccessIsSet(true); + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + checkAndPut_result result = new checkAndPut_result(); + if (e instanceof IOError) { + result.io = (IOError) e; + result.setIoIsSet(true); + msg = result; + } + else if (e instanceof IllegalArgument) { + result.ia = (IllegalArgument) e; + result.setIaIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, checkAndPut_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.checkAndPut(args.tableName, args.row, args.column, args.value, args.mput, args.attributes,resultHandler); + } + } + + } + + public static class enableTable_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("enableTable_args"); + + private static final org.apache.thrift.protocol.TField TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tableName", org.apache.thrift.protocol.TType.STRING, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new enableTable_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new enableTable_argsTupleSchemeFactory()); + } + + /** + * name of the table + */ + public ByteBuffer tableName; // 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 { + /** + * name of the table + */ + TABLE_NAME((short)1, "tableName"); + + private static final Map byName = new HashMap(); + + 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; + 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.TABLE_NAME, new org.apache.thrift.meta_data.FieldMetaData("tableName", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Bytes"))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(enableTable_args.class, metaDataMap); + } + + public enableTable_args() { + } + + public enableTable_args( + ByteBuffer tableName) + { + this(); + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(tableName); + } + + /** + * Performs a deep copy on other. + */ + public enableTable_args(enableTable_args other) { + if (other.isSetTableName()) { + this.tableName = other.tableName; + } + } + + public enableTable_args deepCopy() { + return new enableTable_args(this); + } + + @Override + public void clear() { + this.tableName = null; + } + + /** + * name of the table + */ + public byte[] getTableName() { + setTableName(org.apache.thrift.TBaseHelper.rightSize(tableName)); + return tableName == null ? null : tableName.array(); + } + + public ByteBuffer bufferForTableName() { + return org.apache.thrift.TBaseHelper.copyBinary(tableName); + } + + /** + * name of the table + */ + public enableTable_args setTableName(byte[] tableName) { + this.tableName = tableName == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(tableName, tableName.length)); + return this; + } + + public enableTable_args setTableName(ByteBuffer tableName) { + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(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 void setFieldValue(_Fields field, Object value) { + switch (field) { + case TABLE_NAME: + if (value == null) { + unsetTableName(); + } else { + setTableName((ByteBuffer)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case TABLE_NAME: + return getTableName(); + + } + 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(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof enableTable_args) + return this.equals((enableTable_args)that); + return false; + } + + public boolean equals(enableTable_args 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; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_tableName = true && (isSetTableName()); + list.add(present_tableName); + if (present_tableName) + list.add(tableName); + + return list.hashCode(); + } + + @Override + public int compareTo(enableTable_args 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; + } + } + 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("enableTable_args("); + boolean first = true; + + sb.append("tableName:"); + if (this.tableName == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.tableName, sb); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 enableTable_argsStandardSchemeFactory implements SchemeFactory { + public enableTable_argsStandardScheme getScheme() { + return new enableTable_argsStandardScheme(); + } + } + + private static class enableTable_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, enableTable_args 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.STRING) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(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, enableTable_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.tableName != null) { + oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC); + oprot.writeBinary(struct.tableName); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class enableTable_argsTupleSchemeFactory implements SchemeFactory { + public enableTable_argsTupleScheme getScheme() { + return new enableTable_argsTupleScheme(); + } + } + + private static class enableTable_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, enableTable_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetTableName()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetTableName()) { + oprot.writeBinary(struct.tableName); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, enableTable_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(true); + } + } + } + + } + + public static class enableTable_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("enableTable_result"); + + private static final org.apache.thrift.protocol.TField IO_FIELD_DESC = new org.apache.thrift.protocol.TField("io", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new enableTable_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new enableTable_resultTupleSchemeFactory()); + } + + public IOError io; // 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 { + IO((short)1, "io"); + + private static final Map byName = new HashMap(); + + 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: // IO + return IO; + 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.IO, new org.apache.thrift.meta_data.FieldMetaData("io", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(enableTable_result.class, metaDataMap); + } + + public enableTable_result() { + } + + public enableTable_result( + IOError io) + { + this(); + this.io = io; + } + + /** + * Performs a deep copy on other. + */ + public enableTable_result(enableTable_result other) { + if (other.isSetIo()) { + this.io = new IOError(other.io); + } + } + + public enableTable_result deepCopy() { + return new enableTable_result(this); + } + + @Override + public void clear() { + this.io = null; + } + + public IOError getIo() { + return this.io; + } + + public enableTable_result setIo(IOError io) { + this.io = io; + return this; + } + + public void unsetIo() { + this.io = null; + } + + /** Returns true if field io is set (has been assigned a value) and false otherwise */ + public boolean isSetIo() { + return this.io != null; + } + + public void setIoIsSet(boolean value) { + if (!value) { + this.io = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case IO: + if (value == null) { + unsetIo(); + } else { + setIo((IOError)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case IO: + return getIo(); + + } + 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 IO: + return isSetIo(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof enableTable_result) + return this.equals((enableTable_result)that); + return false; + } + + public boolean equals(enableTable_result that) { + if (that == null) + return false; + + boolean this_present_io = true && this.isSetIo(); + boolean that_present_io = true && that.isSetIo(); + if (this_present_io || that_present_io) { + if (!(this_present_io && that_present_io)) + return false; + if (!this.io.equals(that.io)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_io = true && (isSetIo()); + list.add(present_io); + if (present_io) + list.add(io); + + return list.hashCode(); + } + + @Override + public int compareTo(enableTable_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetIo()).compareTo(other.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, other.io); + 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("enableTable_result("); + boolean first = true; + + sb.append("io:"); + if (this.io == null) { + sb.append("null"); + } else { + sb.append(this.io); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 enableTable_resultStandardSchemeFactory implements SchemeFactory { + public enableTable_resultStandardScheme getScheme() { + return new enableTable_resultStandardScheme(); + } + } + + private static class enableTable_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, enableTable_result 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: // IO + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(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, enableTable_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.io != null) { + oprot.writeFieldBegin(IO_FIELD_DESC); + struct.io.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class enableTable_resultTupleSchemeFactory implements SchemeFactory { + public enableTable_resultTupleScheme getScheme() { + return new enableTable_resultTupleScheme(); + } + } + + private static class enableTable_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, enableTable_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetIo()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetIo()) { + struct.io.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, enableTable_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } + } + } + + } + + public static class disableTable_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("disableTable_args"); + + private static final org.apache.thrift.protocol.TField TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tableName", org.apache.thrift.protocol.TType.STRING, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new disableTable_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new disableTable_argsTupleSchemeFactory()); + } + + /** + * name of the table + */ + public ByteBuffer tableName; // 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 { + /** + * name of the table + */ + TABLE_NAME((short)1, "tableName"); + + private static final Map byName = new HashMap(); + + 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; + 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.TABLE_NAME, new org.apache.thrift.meta_data.FieldMetaData("tableName", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Bytes"))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(disableTable_args.class, metaDataMap); + } + + public disableTable_args() { + } + + public disableTable_args( + ByteBuffer tableName) + { + this(); + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(tableName); + } + + /** + * Performs a deep copy on other. + */ + public disableTable_args(disableTable_args other) { + if (other.isSetTableName()) { + this.tableName = other.tableName; + } + } + + public disableTable_args deepCopy() { + return new disableTable_args(this); + } + + @Override + public void clear() { + this.tableName = null; + } + + /** + * name of the table + */ + public byte[] getTableName() { + setTableName(org.apache.thrift.TBaseHelper.rightSize(tableName)); + return tableName == null ? null : tableName.array(); + } + + public ByteBuffer bufferForTableName() { + return org.apache.thrift.TBaseHelper.copyBinary(tableName); + } + + /** + * name of the table + */ + public disableTable_args setTableName(byte[] tableName) { + this.tableName = tableName == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(tableName, tableName.length)); + return this; + } + + public disableTable_args setTableName(ByteBuffer tableName) { + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(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 void setFieldValue(_Fields field, Object value) { + switch (field) { + case TABLE_NAME: + if (value == null) { + unsetTableName(); + } else { + setTableName((ByteBuffer)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case TABLE_NAME: + return getTableName(); + + } + 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(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof disableTable_args) + return this.equals((disableTable_args)that); + return false; + } + + public boolean equals(disableTable_args 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; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_tableName = true && (isSetTableName()); + list.add(present_tableName); + if (present_tableName) + list.add(tableName); + + return list.hashCode(); + } + + @Override + public int compareTo(disableTable_args 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; + } + } + 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("disableTable_args("); + boolean first = true; + + sb.append("tableName:"); + if (this.tableName == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.tableName, sb); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 disableTable_argsStandardSchemeFactory implements SchemeFactory { + public disableTable_argsStandardScheme getScheme() { + return new disableTable_argsStandardScheme(); + } + } + + private static class disableTable_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, disableTable_args 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.STRING) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(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, disableTable_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.tableName != null) { + oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC); + oprot.writeBinary(struct.tableName); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class disableTable_argsTupleSchemeFactory implements SchemeFactory { + public disableTable_argsTupleScheme getScheme() { + return new disableTable_argsTupleScheme(); + } + } + + private static class disableTable_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, disableTable_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetTableName()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetTableName()) { + oprot.writeBinary(struct.tableName); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, disableTable_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(true); + } + } + } + + } + + public static class disableTable_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("disableTable_result"); + + private static final org.apache.thrift.protocol.TField IO_FIELD_DESC = new org.apache.thrift.protocol.TField("io", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new disableTable_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new disableTable_resultTupleSchemeFactory()); + } + + public IOError io; // 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 { + IO((short)1, "io"); + + private static final Map byName = new HashMap(); + + 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: // IO + return IO; + 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.IO, new org.apache.thrift.meta_data.FieldMetaData("io", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(disableTable_result.class, metaDataMap); + } + + public disableTable_result() { + } + + public disableTable_result( + IOError io) + { + this(); + this.io = io; + } + + /** + * Performs a deep copy on other. + */ + public disableTable_result(disableTable_result other) { + if (other.isSetIo()) { + this.io = new IOError(other.io); + } + } + + public disableTable_result deepCopy() { + return new disableTable_result(this); + } + + @Override + public void clear() { + this.io = null; + } + + public IOError getIo() { + return this.io; + } + + public disableTable_result setIo(IOError io) { + this.io = io; + return this; + } + + public void unsetIo() { + this.io = null; + } + + /** Returns true if field io is set (has been assigned a value) and false otherwise */ + public boolean isSetIo() { + return this.io != null; + } + + public void setIoIsSet(boolean value) { + if (!value) { + this.io = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case IO: + if (value == null) { + unsetIo(); + } else { + setIo((IOError)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case IO: + return getIo(); + + } + 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 IO: + return isSetIo(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof disableTable_result) + return this.equals((disableTable_result)that); + return false; + } + + public boolean equals(disableTable_result that) { + if (that == null) + return false; + + boolean this_present_io = true && this.isSetIo(); + boolean that_present_io = true && that.isSetIo(); + if (this_present_io || that_present_io) { + if (!(this_present_io && that_present_io)) + return false; + if (!this.io.equals(that.io)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_io = true && (isSetIo()); + list.add(present_io); + if (present_io) + list.add(io); + + return list.hashCode(); + } + + @Override + public int compareTo(disableTable_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetIo()).compareTo(other.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, other.io); + 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("disableTable_result("); + boolean first = true; + + sb.append("io:"); + if (this.io == null) { + sb.append("null"); + } else { + sb.append(this.io); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 disableTable_resultStandardSchemeFactory implements SchemeFactory { + public disableTable_resultStandardScheme getScheme() { + return new disableTable_resultStandardScheme(); + } + } + + private static class disableTable_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, disableTable_result 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: // IO + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(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, disableTable_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.io != null) { + oprot.writeFieldBegin(IO_FIELD_DESC); + struct.io.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class disableTable_resultTupleSchemeFactory implements SchemeFactory { + public disableTable_resultTupleScheme getScheme() { + return new disableTable_resultTupleScheme(); + } + } + + private static class disableTable_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, disableTable_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetIo()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetIo()) { + struct.io.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, disableTable_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } + } + } + + } + + public static class isTableEnabled_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isTableEnabled_args"); + + private static final org.apache.thrift.protocol.TField TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tableName", org.apache.thrift.protocol.TType.STRING, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new isTableEnabled_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new isTableEnabled_argsTupleSchemeFactory()); + } + + /** + * name of the table to check + */ + public ByteBuffer tableName; // 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 { + /** + * name of the table to check + */ + TABLE_NAME((short)1, "tableName"); + + private static final Map byName = new HashMap(); + + 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; + 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.TABLE_NAME, new org.apache.thrift.meta_data.FieldMetaData("tableName", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Bytes"))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isTableEnabled_args.class, metaDataMap); + } + + public isTableEnabled_args() { + } + + public isTableEnabled_args( + ByteBuffer tableName) + { + this(); + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(tableName); + } + + /** + * Performs a deep copy on other. + */ + public isTableEnabled_args(isTableEnabled_args other) { + if (other.isSetTableName()) { + this.tableName = other.tableName; + } + } + + public isTableEnabled_args deepCopy() { + return new isTableEnabled_args(this); + } + + @Override + public void clear() { + this.tableName = null; + } + + /** + * name of the table to check + */ + public byte[] getTableName() { + setTableName(org.apache.thrift.TBaseHelper.rightSize(tableName)); + return tableName == null ? null : tableName.array(); + } + + public ByteBuffer bufferForTableName() { + return org.apache.thrift.TBaseHelper.copyBinary(tableName); + } + + /** + * name of the table to check + */ + public isTableEnabled_args setTableName(byte[] tableName) { + this.tableName = tableName == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(tableName, tableName.length)); + return this; + } + + public isTableEnabled_args setTableName(ByteBuffer tableName) { + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(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 void setFieldValue(_Fields field, Object value) { + switch (field) { + case TABLE_NAME: + if (value == null) { + unsetTableName(); + } else { + setTableName((ByteBuffer)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case TABLE_NAME: + return getTableName(); + + } + 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(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof isTableEnabled_args) + return this.equals((isTableEnabled_args)that); + return false; + } + + public boolean equals(isTableEnabled_args 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; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_tableName = true && (isSetTableName()); + list.add(present_tableName); + if (present_tableName) + list.add(tableName); + + return list.hashCode(); + } + + @Override + public int compareTo(isTableEnabled_args 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; + } + } + 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("isTableEnabled_args("); + boolean first = true; + + sb.append("tableName:"); + if (this.tableName == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.tableName, sb); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 isTableEnabled_argsStandardSchemeFactory implements SchemeFactory { + public isTableEnabled_argsStandardScheme getScheme() { + return new isTableEnabled_argsStandardScheme(); + } + } + + private static class isTableEnabled_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, isTableEnabled_args 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.STRING) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(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, isTableEnabled_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.tableName != null) { + oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC); + oprot.writeBinary(struct.tableName); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class isTableEnabled_argsTupleSchemeFactory implements SchemeFactory { + public isTableEnabled_argsTupleScheme getScheme() { + return new isTableEnabled_argsTupleScheme(); + } + } + + private static class isTableEnabled_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, isTableEnabled_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetTableName()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetTableName()) { + oprot.writeBinary(struct.tableName); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, isTableEnabled_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(true); + } + } + } + + } + + public static class isTableEnabled_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isTableEnabled_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0); + private static final org.apache.thrift.protocol.TField IO_FIELD_DESC = new org.apache.thrift.protocol.TField("io", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new isTableEnabled_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new isTableEnabled_resultTupleSchemeFactory()); + } + + public boolean success; // required + public IOError io; // 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 { + SUCCESS((short)0, "success"), + IO((short)1, "io"); + + private static final Map byName = new HashMap(); + + 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 0: // SUCCESS + return SUCCESS; + case 1: // IO + return IO; + 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 int __SUCCESS_ISSET_ID = 0; + private byte __isset_bitfield = 0; + 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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + tmpMap.put(_Fields.IO, new org.apache.thrift.meta_data.FieldMetaData("io", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isTableEnabled_result.class, metaDataMap); + } + + public isTableEnabled_result() { + } + + public isTableEnabled_result( + boolean success, + IOError io) + { + this(); + this.success = success; + setSuccessIsSet(true); + this.io = io; + } + + /** + * Performs a deep copy on other. + */ + public isTableEnabled_result(isTableEnabled_result other) { + __isset_bitfield = other.__isset_bitfield; + this.success = other.success; + if (other.isSetIo()) { + this.io = new IOError(other.io); + } + } + + public isTableEnabled_result deepCopy() { + return new isTableEnabled_result(this); + } + + @Override + public void clear() { + setSuccessIsSet(false); + this.success = false; + this.io = null; + } + + public boolean isSuccess() { + return this.success; + } + + public isTableEnabled_result setSuccess(boolean success) { + this.success = success; + setSuccessIsSet(true); + return this; + } + + public void unsetSuccess() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + public void setSuccessIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); + } + + public IOError getIo() { + return this.io; + } + + public isTableEnabled_result setIo(IOError io) { + this.io = io; + return this; + } + + public void unsetIo() { + this.io = null; + } + + /** Returns true if field io is set (has been assigned a value) and false otherwise */ + public boolean isSetIo() { + return this.io != null; + } + + public void setIoIsSet(boolean value) { + if (!value) { + this.io = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((Boolean)value); + } + break; + + case IO: + if (value == null) { + unsetIo(); + } else { + setIo((IOError)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return isSuccess(); + + case IO: + return getIo(); + + } + 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 SUCCESS: + return isSetSuccess(); + case IO: + return isSetIo(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof isTableEnabled_result) + return this.equals((isTableEnabled_result)that); + return false; + } + + public boolean equals(isTableEnabled_result that) { + if (that == null) + return false; + + boolean this_present_success = true; + boolean that_present_success = true; + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (this.success != that.success) + return false; + } + + boolean this_present_io = true && this.isSetIo(); + boolean that_present_io = true && that.isSetIo(); + if (this_present_io || that_present_io) { + if (!(this_present_io && that_present_io)) + return false; + if (!this.io.equals(that.io)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true; + list.add(present_success); + if (present_success) + list.add(success); + + boolean present_io = true && (isSetIo()); + list.add(present_io); + if (present_io) + list.add(io); + + return list.hashCode(); + } + + @Override + public int compareTo(isTableEnabled_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIo()).compareTo(other.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, other.io); + 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("isTableEnabled_result("); + boolean first = true; + + sb.append("success:"); + sb.append(this.success); + first = false; + if (!first) sb.append(", "); + sb.append("io:"); + if (this.io == null) { + sb.append("null"); + } else { + sb.append(this.io); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 { + // 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); + } + } + + private static class isTableEnabled_resultStandardSchemeFactory implements SchemeFactory { + public isTableEnabled_resultStandardScheme getScheme() { + return new isTableEnabled_resultStandardScheme(); + } + } + + private static class isTableEnabled_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, isTableEnabled_result 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 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IO + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(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, isTableEnabled_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeBool(struct.success); + oprot.writeFieldEnd(); + } + if (struct.io != null) { + oprot.writeFieldBegin(IO_FIELD_DESC); + struct.io.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class isTableEnabled_resultTupleSchemeFactory implements SchemeFactory { + public isTableEnabled_resultTupleScheme getScheme() { + return new isTableEnabled_resultTupleScheme(); + } + } + + private static class isTableEnabled_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, isTableEnabled_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIo()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + oprot.writeBool(struct.success); + } + if (struct.isSetIo()) { + struct.io.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, isTableEnabled_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } + } + } + + } + + public static class compact_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("compact_args"); + + private static final org.apache.thrift.protocol.TField TABLE_NAME_OR_REGION_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tableNameOrRegionName", org.apache.thrift.protocol.TType.STRING, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new compact_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new compact_argsTupleSchemeFactory()); + } + + public ByteBuffer tableNameOrRegionName; // 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 { + TABLE_NAME_OR_REGION_NAME((short)1, "tableNameOrRegionName"); + + private static final Map byName = new HashMap(); + + 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_OR_REGION_NAME + return TABLE_NAME_OR_REGION_NAME; + 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.TABLE_NAME_OR_REGION_NAME, new org.apache.thrift.meta_data.FieldMetaData("tableNameOrRegionName", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Bytes"))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(compact_args.class, metaDataMap); + } + + public compact_args() { + } + + public compact_args( + ByteBuffer tableNameOrRegionName) + { + this(); + this.tableNameOrRegionName = org.apache.thrift.TBaseHelper.copyBinary(tableNameOrRegionName); + } + + /** + * Performs a deep copy on other. + */ + public compact_args(compact_args other) { + if (other.isSetTableNameOrRegionName()) { + this.tableNameOrRegionName = other.tableNameOrRegionName; + } + } + + public compact_args deepCopy() { + return new compact_args(this); + } + + @Override + public void clear() { + this.tableNameOrRegionName = null; + } + + public byte[] getTableNameOrRegionName() { + setTableNameOrRegionName(org.apache.thrift.TBaseHelper.rightSize(tableNameOrRegionName)); + return tableNameOrRegionName == null ? null : tableNameOrRegionName.array(); + } + + public ByteBuffer bufferForTableNameOrRegionName() { + return org.apache.thrift.TBaseHelper.copyBinary(tableNameOrRegionName); + } + + public compact_args setTableNameOrRegionName(byte[] tableNameOrRegionName) { + this.tableNameOrRegionName = tableNameOrRegionName == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(tableNameOrRegionName, tableNameOrRegionName.length)); + return this; + } + + public compact_args setTableNameOrRegionName(ByteBuffer tableNameOrRegionName) { + this.tableNameOrRegionName = org.apache.thrift.TBaseHelper.copyBinary(tableNameOrRegionName); + return this; + } + + public void unsetTableNameOrRegionName() { + this.tableNameOrRegionName = null; + } + + /** Returns true if field tableNameOrRegionName is set (has been assigned a value) and false otherwise */ + public boolean isSetTableNameOrRegionName() { + return this.tableNameOrRegionName != null; + } + + public void setTableNameOrRegionNameIsSet(boolean value) { + if (!value) { + this.tableNameOrRegionName = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case TABLE_NAME_OR_REGION_NAME: + if (value == null) { + unsetTableNameOrRegionName(); + } else { + setTableNameOrRegionName((ByteBuffer)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case TABLE_NAME_OR_REGION_NAME: + return getTableNameOrRegionName(); + + } + 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_OR_REGION_NAME: + return isSetTableNameOrRegionName(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof compact_args) + return this.equals((compact_args)that); + return false; + } + + public boolean equals(compact_args that) { + if (that == null) + return false; + + boolean this_present_tableNameOrRegionName = true && this.isSetTableNameOrRegionName(); + boolean that_present_tableNameOrRegionName = true && that.isSetTableNameOrRegionName(); + if (this_present_tableNameOrRegionName || that_present_tableNameOrRegionName) { + if (!(this_present_tableNameOrRegionName && that_present_tableNameOrRegionName)) + return false; + if (!this.tableNameOrRegionName.equals(that.tableNameOrRegionName)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_tableNameOrRegionName = true && (isSetTableNameOrRegionName()); + list.add(present_tableNameOrRegionName); + if (present_tableNameOrRegionName) + list.add(tableNameOrRegionName); + + return list.hashCode(); + } + + @Override + public int compareTo(compact_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetTableNameOrRegionName()).compareTo(other.isSetTableNameOrRegionName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTableNameOrRegionName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tableNameOrRegionName, other.tableNameOrRegionName); + 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("compact_args("); + boolean first = true; + + sb.append("tableNameOrRegionName:"); + if (this.tableNameOrRegionName == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.tableNameOrRegionName, sb); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 compact_argsStandardSchemeFactory implements SchemeFactory { + public compact_argsStandardScheme getScheme() { + return new compact_argsStandardScheme(); + } + } + + private static class compact_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, compact_args 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_OR_REGION_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.tableNameOrRegionName = iprot.readBinary(); + struct.setTableNameOrRegionNameIsSet(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, compact_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.tableNameOrRegionName != null) { + oprot.writeFieldBegin(TABLE_NAME_OR_REGION_NAME_FIELD_DESC); + oprot.writeBinary(struct.tableNameOrRegionName); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class compact_argsTupleSchemeFactory implements SchemeFactory { + public compact_argsTupleScheme getScheme() { + return new compact_argsTupleScheme(); + } + } + + private static class compact_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, compact_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetTableNameOrRegionName()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetTableNameOrRegionName()) { + oprot.writeBinary(struct.tableNameOrRegionName); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, compact_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.tableNameOrRegionName = iprot.readBinary(); + struct.setTableNameOrRegionNameIsSet(true); + } + } + } + + } + + public static class compact_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("compact_result"); + + private static final org.apache.thrift.protocol.TField IO_FIELD_DESC = new org.apache.thrift.protocol.TField("io", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new compact_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new compact_resultTupleSchemeFactory()); + } + + public IOError io; // 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 { + IO((short)1, "io"); + + private static final Map byName = new HashMap(); + + 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: // IO + return IO; + 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.IO, new org.apache.thrift.meta_data.FieldMetaData("io", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(compact_result.class, metaDataMap); + } + + public compact_result() { + } + + public compact_result( + IOError io) + { + this(); + this.io = io; + } + + /** + * Performs a deep copy on other. + */ + public compact_result(compact_result other) { + if (other.isSetIo()) { + this.io = new IOError(other.io); + } + } + + public compact_result deepCopy() { + return new compact_result(this); + } + + @Override + public void clear() { + this.io = null; + } + + public IOError getIo() { + return this.io; + } + + public compact_result setIo(IOError io) { + this.io = io; + return this; + } + + public void unsetIo() { + this.io = null; + } + + /** Returns true if field io is set (has been assigned a value) and false otherwise */ + public boolean isSetIo() { + return this.io != null; + } + + public void setIoIsSet(boolean value) { + if (!value) { + this.io = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case IO: + if (value == null) { + unsetIo(); + } else { + setIo((IOError)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case IO: + return getIo(); + + } + 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 IO: + return isSetIo(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof compact_result) + return this.equals((compact_result)that); + return false; + } + + public boolean equals(compact_result that) { + if (that == null) + return false; + + boolean this_present_io = true && this.isSetIo(); + boolean that_present_io = true && that.isSetIo(); + if (this_present_io || that_present_io) { + if (!(this_present_io && that_present_io)) + return false; + if (!this.io.equals(that.io)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_io = true && (isSetIo()); + list.add(present_io); + if (present_io) + list.add(io); + + return list.hashCode(); + } + + @Override + public int compareTo(compact_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetIo()).compareTo(other.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, other.io); + 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("compact_result("); + boolean first = true; + + sb.append("io:"); + if (this.io == null) { + sb.append("null"); + } else { + sb.append(this.io); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 compact_resultStandardSchemeFactory implements SchemeFactory { + public compact_resultStandardScheme getScheme() { + return new compact_resultStandardScheme(); + } + } + + private static class compact_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, compact_result 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: // IO + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(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, compact_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.io != null) { + oprot.writeFieldBegin(IO_FIELD_DESC); + struct.io.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class compact_resultTupleSchemeFactory implements SchemeFactory { + public compact_resultTupleScheme getScheme() { + return new compact_resultTupleScheme(); + } + } + + private static class compact_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, compact_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetIo()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetIo()) { + struct.io.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, compact_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } + } + } + + } + + public static class majorCompact_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("majorCompact_args"); + + private static final org.apache.thrift.protocol.TField TABLE_NAME_OR_REGION_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tableNameOrRegionName", org.apache.thrift.protocol.TType.STRING, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new majorCompact_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new majorCompact_argsTupleSchemeFactory()); + } + + public ByteBuffer tableNameOrRegionName; // 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 { + TABLE_NAME_OR_REGION_NAME((short)1, "tableNameOrRegionName"); + + private static final Map byName = new HashMap(); + + 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_OR_REGION_NAME + return TABLE_NAME_OR_REGION_NAME; + 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.TABLE_NAME_OR_REGION_NAME, new org.apache.thrift.meta_data.FieldMetaData("tableNameOrRegionName", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Bytes"))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(majorCompact_args.class, metaDataMap); + } + + public majorCompact_args() { + } + + public majorCompact_args( + ByteBuffer tableNameOrRegionName) + { + this(); + this.tableNameOrRegionName = org.apache.thrift.TBaseHelper.copyBinary(tableNameOrRegionName); + } + + /** + * Performs a deep copy on other. + */ + public majorCompact_args(majorCompact_args other) { + if (other.isSetTableNameOrRegionName()) { + this.tableNameOrRegionName = other.tableNameOrRegionName; + } + } + + public majorCompact_args deepCopy() { + return new majorCompact_args(this); + } + + @Override + public void clear() { + this.tableNameOrRegionName = null; + } + + public byte[] getTableNameOrRegionName() { + setTableNameOrRegionName(org.apache.thrift.TBaseHelper.rightSize(tableNameOrRegionName)); + return tableNameOrRegionName == null ? null : tableNameOrRegionName.array(); + } + + public ByteBuffer bufferForTableNameOrRegionName() { + return org.apache.thrift.TBaseHelper.copyBinary(tableNameOrRegionName); + } + + public majorCompact_args setTableNameOrRegionName(byte[] tableNameOrRegionName) { + this.tableNameOrRegionName = tableNameOrRegionName == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(tableNameOrRegionName, tableNameOrRegionName.length)); + return this; + } + + public majorCompact_args setTableNameOrRegionName(ByteBuffer tableNameOrRegionName) { + this.tableNameOrRegionName = org.apache.thrift.TBaseHelper.copyBinary(tableNameOrRegionName); + return this; + } + + public void unsetTableNameOrRegionName() { + this.tableNameOrRegionName = null; + } + + /** Returns true if field tableNameOrRegionName is set (has been assigned a value) and false otherwise */ + public boolean isSetTableNameOrRegionName() { + return this.tableNameOrRegionName != null; + } + + public void setTableNameOrRegionNameIsSet(boolean value) { + if (!value) { + this.tableNameOrRegionName = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case TABLE_NAME_OR_REGION_NAME: + if (value == null) { + unsetTableNameOrRegionName(); + } else { + setTableNameOrRegionName((ByteBuffer)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case TABLE_NAME_OR_REGION_NAME: + return getTableNameOrRegionName(); + + } + 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_OR_REGION_NAME: + return isSetTableNameOrRegionName(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof majorCompact_args) + return this.equals((majorCompact_args)that); + return false; + } + + public boolean equals(majorCompact_args that) { + if (that == null) + return false; + + boolean this_present_tableNameOrRegionName = true && this.isSetTableNameOrRegionName(); + boolean that_present_tableNameOrRegionName = true && that.isSetTableNameOrRegionName(); + if (this_present_tableNameOrRegionName || that_present_tableNameOrRegionName) { + if (!(this_present_tableNameOrRegionName && that_present_tableNameOrRegionName)) + return false; + if (!this.tableNameOrRegionName.equals(that.tableNameOrRegionName)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_tableNameOrRegionName = true && (isSetTableNameOrRegionName()); + list.add(present_tableNameOrRegionName); + if (present_tableNameOrRegionName) + list.add(tableNameOrRegionName); + + return list.hashCode(); + } + + @Override + public int compareTo(majorCompact_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetTableNameOrRegionName()).compareTo(other.isSetTableNameOrRegionName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTableNameOrRegionName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tableNameOrRegionName, other.tableNameOrRegionName); + 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("majorCompact_args("); + boolean first = true; + + sb.append("tableNameOrRegionName:"); + if (this.tableNameOrRegionName == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.tableNameOrRegionName, sb); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 majorCompact_argsStandardSchemeFactory implements SchemeFactory { + public majorCompact_argsStandardScheme getScheme() { + return new majorCompact_argsStandardScheme(); + } + } + + private static class majorCompact_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, majorCompact_args 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_OR_REGION_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.tableNameOrRegionName = iprot.readBinary(); + struct.setTableNameOrRegionNameIsSet(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, majorCompact_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.tableNameOrRegionName != null) { + oprot.writeFieldBegin(TABLE_NAME_OR_REGION_NAME_FIELD_DESC); + oprot.writeBinary(struct.tableNameOrRegionName); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class majorCompact_argsTupleSchemeFactory implements SchemeFactory { + public majorCompact_argsTupleScheme getScheme() { + return new majorCompact_argsTupleScheme(); + } + } + + private static class majorCompact_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, majorCompact_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetTableNameOrRegionName()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetTableNameOrRegionName()) { + oprot.writeBinary(struct.tableNameOrRegionName); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, majorCompact_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.tableNameOrRegionName = iprot.readBinary(); + struct.setTableNameOrRegionNameIsSet(true); + } + } + } + + } + + public static class majorCompact_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("majorCompact_result"); + + private static final org.apache.thrift.protocol.TField IO_FIELD_DESC = new org.apache.thrift.protocol.TField("io", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new majorCompact_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new majorCompact_resultTupleSchemeFactory()); + } + + public IOError io; // 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 { + IO((short)1, "io"); + + private static final Map byName = new HashMap(); + + 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: // IO + return IO; + 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.IO, new org.apache.thrift.meta_data.FieldMetaData("io", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(majorCompact_result.class, metaDataMap); + } + + public majorCompact_result() { + } + + public majorCompact_result( + IOError io) + { + this(); + this.io = io; + } + + /** + * Performs a deep copy on other. + */ + public majorCompact_result(majorCompact_result other) { + if (other.isSetIo()) { + this.io = new IOError(other.io); + } + } + + public majorCompact_result deepCopy() { + return new majorCompact_result(this); + } + + @Override + public void clear() { + this.io = null; + } + + public IOError getIo() { + return this.io; + } + + public majorCompact_result setIo(IOError io) { + this.io = io; + return this; + } + + public void unsetIo() { + this.io = null; + } + + /** Returns true if field io is set (has been assigned a value) and false otherwise */ + public boolean isSetIo() { + return this.io != null; + } + + public void setIoIsSet(boolean value) { + if (!value) { + this.io = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case IO: + if (value == null) { + unsetIo(); + } else { + setIo((IOError)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case IO: + return getIo(); + + } + 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 IO: + return isSetIo(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof majorCompact_result) + return this.equals((majorCompact_result)that); + return false; + } + + public boolean equals(majorCompact_result that) { + if (that == null) + return false; + + boolean this_present_io = true && this.isSetIo(); + boolean that_present_io = true && that.isSetIo(); + if (this_present_io || that_present_io) { + if (!(this_present_io && that_present_io)) + return false; + if (!this.io.equals(that.io)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_io = true && (isSetIo()); + list.add(present_io); + if (present_io) + list.add(io); + + return list.hashCode(); + } + + @Override + public int compareTo(majorCompact_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetIo()).compareTo(other.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, other.io); + 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("majorCompact_result("); + boolean first = true; + + sb.append("io:"); + if (this.io == null) { + sb.append("null"); + } else { + sb.append(this.io); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 majorCompact_resultStandardSchemeFactory implements SchemeFactory { + public majorCompact_resultStandardScheme getScheme() { + return new majorCompact_resultStandardScheme(); + } + } + + private static class majorCompact_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, majorCompact_result 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: // IO + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(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, majorCompact_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.io != null) { + oprot.writeFieldBegin(IO_FIELD_DESC); + struct.io.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class majorCompact_resultTupleSchemeFactory implements SchemeFactory { + public majorCompact_resultTupleScheme getScheme() { + return new majorCompact_resultTupleScheme(); + } + } + + private static class majorCompact_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, majorCompact_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetIo()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetIo()) { + struct.io.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, majorCompact_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } + } + } + + } + + public static class getTableNames_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getTableNames_args"); + + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getTableNames_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getTableNames_argsTupleSchemeFactory()); + } + + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { +; + + private static final Map byName = new HashMap(); + + 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) { + 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; + } + } + 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); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getTableNames_args.class, metaDataMap); + } + + public getTableNames_args() { + } + + /** + * Performs a deep copy on other. + */ + public getTableNames_args(getTableNames_args other) { + } + + public getTableNames_args deepCopy() { + return new getTableNames_args(this); + } + + @Override + public void clear() { + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + } + 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) { + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getTableNames_args) + return this.equals((getTableNames_args)that); + return false; + } + + public boolean equals(getTableNames_args that) { + if (that == null) + return false; + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + return list.hashCode(); + } + + @Override + public int compareTo(getTableNames_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + 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("getTableNames_args("); + boolean first = true; + + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 getTableNames_argsStandardSchemeFactory implements SchemeFactory { + public getTableNames_argsStandardScheme getScheme() { + return new getTableNames_argsStandardScheme(); + } + } + + private static class getTableNames_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getTableNames_args 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) { + 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, getTableNames_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getTableNames_argsTupleSchemeFactory implements SchemeFactory { + public getTableNames_argsTupleScheme getScheme() { + return new getTableNames_argsTupleScheme(); + } + } + + private static class getTableNames_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getTableNames_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getTableNames_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + } + } + + } + + public static class getTableNames_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getTableNames_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0); + private static final org.apache.thrift.protocol.TField IO_FIELD_DESC = new org.apache.thrift.protocol.TField("io", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getTableNames_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getTableNames_resultTupleSchemeFactory()); + } + + public List success; // required + public IOError io; // 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 { + SUCCESS((short)0, "success"), + IO((short)1, "io"); + + private static final Map byName = new HashMap(); + + 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 0: // SUCCESS + return SUCCESS; + case 1: // IO + return IO; + 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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text")))); + tmpMap.put(_Fields.IO, new org.apache.thrift.meta_data.FieldMetaData("io", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getTableNames_result.class, metaDataMap); + } + + public getTableNames_result() { + } + + public getTableNames_result( + List success, + IOError io) + { + this(); + this.success = success; + this.io = io; + } + + /** + * Performs a deep copy on other. + */ + public getTableNames_result(getTableNames_result other) { + if (other.isSetSuccess()) { + List __this__success = new ArrayList(other.success.size()); + for (ByteBuffer other_element : other.success) { + __this__success.add(other_element); + } + this.success = __this__success; + } + if (other.isSetIo()) { + this.io = new IOError(other.io); + } + } + + public getTableNames_result deepCopy() { + return new getTableNames_result(this); + } + + @Override + public void clear() { + this.success = null; + this.io = null; + } + + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + public java.util.Iterator getSuccessIterator() { + return (this.success == null) ? null : this.success.iterator(); + } + + public void addToSuccess(ByteBuffer elem) { + if (this.success == null) { + this.success = new ArrayList(); + } + this.success.add(elem); + } + + public List getSuccess() { + return this.success; + } + + public getTableNames_result setSuccess(List success) { + this.success = success; + return this; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public IOError getIo() { + return this.io; + } + + public getTableNames_result setIo(IOError io) { + this.io = io; + return this; + } + + public void unsetIo() { + this.io = null; + } + + /** Returns true if field io is set (has been assigned a value) and false otherwise */ + public boolean isSetIo() { + return this.io != null; + } + + public void setIoIsSet(boolean value) { + if (!value) { + this.io = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((List)value); + } + break; + + case IO: + if (value == null) { + unsetIo(); + } else { + setIo((IOError)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + case IO: + return getIo(); + + } + 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 SUCCESS: + return isSetSuccess(); + case IO: + return isSetIo(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getTableNames_result) + return this.equals((getTableNames_result)that); + return false; + } + + public boolean equals(getTableNames_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + boolean this_present_io = true && this.isSetIo(); + boolean that_present_io = true && that.isSetIo(); + if (this_present_io || that_present_io) { + if (!(this_present_io && that_present_io)) + return false; + if (!this.io.equals(that.io)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + boolean present_io = true && (isSetIo()); + list.add(present_io); + if (present_io) + list.add(io); + + return list.hashCode(); + } + + @Override + public int compareTo(getTableNames_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIo()).compareTo(other.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, other.io); + 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("getTableNames_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.success, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("io:"); + if (this.io == null) { + sb.append("null"); + } else { + sb.append(this.io); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 getTableNames_resultStandardSchemeFactory implements SchemeFactory { + public getTableNames_resultStandardScheme getScheme() { + return new getTableNames_resultStandardScheme(); + } + } + + private static class getTableNames_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getTableNames_result 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 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list50 = iprot.readListBegin(); + struct.success = new ArrayList(_list50.size); + ByteBuffer _elem51; + for (int _i52 = 0; _i52 < _list50.size; ++_i52) + { + _elem51 = iprot.readBinary(); + struct.success.add(_elem51); + } + iprot.readListEnd(); + } + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IO + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(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, getTableNames_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.success.size())); + for (ByteBuffer _iter53 : struct.success) + { + oprot.writeBinary(_iter53); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.io != null) { + oprot.writeFieldBegin(IO_FIELD_DESC); + struct.io.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getTableNames_resultTupleSchemeFactory implements SchemeFactory { + public getTableNames_resultTupleScheme getScheme() { + return new getTableNames_resultTupleScheme(); + } + } + + private static class getTableNames_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getTableNames_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIo()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + { + oprot.writeI32(struct.success.size()); + for (ByteBuffer _iter54 : struct.success) + { + oprot.writeBinary(_iter54); + } + } + } + if (struct.isSetIo()) { + struct.io.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getTableNames_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list55 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.success = new ArrayList(_list55.size); + ByteBuffer _elem56; + for (int _i57 = 0; _i57 < _list55.size; ++_i57) + { + _elem56 = iprot.readBinary(); + struct.success.add(_elem56); + } + } + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } + } + } + + } + + public static class getColumnDescriptors_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getColumnDescriptors_args"); + + private static final org.apache.thrift.protocol.TField TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tableName", org.apache.thrift.protocol.TType.STRING, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getColumnDescriptors_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getColumnDescriptors_argsTupleSchemeFactory()); + } + + /** + * table name + */ + public ByteBuffer tableName; // 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 { + /** + * table name + */ + TABLE_NAME((short)1, "tableName"); + + private static final Map byName = new HashMap(); + + 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; + 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.TABLE_NAME, new org.apache.thrift.meta_data.FieldMetaData("tableName", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getColumnDescriptors_args.class, metaDataMap); + } + + public getColumnDescriptors_args() { + } + + public getColumnDescriptors_args( + ByteBuffer tableName) + { + this(); + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(tableName); + } + + /** + * Performs a deep copy on other. + */ + public getColumnDescriptors_args(getColumnDescriptors_args other) { + if (other.isSetTableName()) { + this.tableName = other.tableName; + } + } + + public getColumnDescriptors_args deepCopy() { + return new getColumnDescriptors_args(this); + } + + @Override + public void clear() { + this.tableName = null; + } + + /** + * table name + */ + public byte[] getTableName() { + setTableName(org.apache.thrift.TBaseHelper.rightSize(tableName)); + return tableName == null ? null : tableName.array(); + } + + public ByteBuffer bufferForTableName() { + return org.apache.thrift.TBaseHelper.copyBinary(tableName); + } + + /** + * table name + */ + public getColumnDescriptors_args setTableName(byte[] tableName) { + this.tableName = tableName == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(tableName, tableName.length)); + return this; + } + + public getColumnDescriptors_args setTableName(ByteBuffer tableName) { + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(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 void setFieldValue(_Fields field, Object value) { + switch (field) { + case TABLE_NAME: + if (value == null) { + unsetTableName(); + } else { + setTableName((ByteBuffer)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case TABLE_NAME: + return getTableName(); + + } + 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(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getColumnDescriptors_args) + return this.equals((getColumnDescriptors_args)that); + return false; + } + + public boolean equals(getColumnDescriptors_args 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; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_tableName = true && (isSetTableName()); + list.add(present_tableName); + if (present_tableName) + list.add(tableName); + + return list.hashCode(); + } + + @Override + public int compareTo(getColumnDescriptors_args 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; + } + } + 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("getColumnDescriptors_args("); + boolean first = true; + + sb.append("tableName:"); + if (this.tableName == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.tableName, sb); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 getColumnDescriptors_argsStandardSchemeFactory implements SchemeFactory { + public getColumnDescriptors_argsStandardScheme getScheme() { + return new getColumnDescriptors_argsStandardScheme(); + } + } + + private static class getColumnDescriptors_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getColumnDescriptors_args 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.STRING) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(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, getColumnDescriptors_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.tableName != null) { + oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC); + oprot.writeBinary(struct.tableName); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getColumnDescriptors_argsTupleSchemeFactory implements SchemeFactory { + public getColumnDescriptors_argsTupleScheme getScheme() { + return new getColumnDescriptors_argsTupleScheme(); + } + } + + private static class getColumnDescriptors_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getColumnDescriptors_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetTableName()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetTableName()) { + oprot.writeBinary(struct.tableName); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getColumnDescriptors_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(true); + } + } + } + + } + + public static class getColumnDescriptors_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getColumnDescriptors_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.MAP, (short)0); + private static final org.apache.thrift.protocol.TField IO_FIELD_DESC = new org.apache.thrift.protocol.TField("io", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getColumnDescriptors_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getColumnDescriptors_resultTupleSchemeFactory()); + } + + public Map success; // required + public IOError io; // 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 { + SUCCESS((short)0, "success"), + IO((short)1, "io"); + + private static final Map byName = new HashMap(); + + 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 0: // SUCCESS + return SUCCESS; + case 1: // IO + return IO; + 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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + 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 , "Text"), + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ColumnDescriptor.class)))); + tmpMap.put(_Fields.IO, new org.apache.thrift.meta_data.FieldMetaData("io", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getColumnDescriptors_result.class, metaDataMap); + } + + public getColumnDescriptors_result() { + } + + public getColumnDescriptors_result( + Map success, + IOError io) + { + this(); + this.success = success; + this.io = io; + } + + /** + * Performs a deep copy on other. + */ + public getColumnDescriptors_result(getColumnDescriptors_result other) { + if (other.isSetSuccess()) { + Map __this__success = new HashMap(other.success.size()); + for (Map.Entry other_element : other.success.entrySet()) { + + ByteBuffer other_element_key = other_element.getKey(); + ColumnDescriptor other_element_value = other_element.getValue(); + + ByteBuffer __this__success_copy_key = other_element_key; + + ColumnDescriptor __this__success_copy_value = new ColumnDescriptor(other_element_value); + + __this__success.put(__this__success_copy_key, __this__success_copy_value); + } + this.success = __this__success; + } + if (other.isSetIo()) { + this.io = new IOError(other.io); + } + } + + public getColumnDescriptors_result deepCopy() { + return new getColumnDescriptors_result(this); + } + + @Override + public void clear() { + this.success = null; + this.io = null; + } + + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + public void putToSuccess(ByteBuffer key, ColumnDescriptor val) { + if (this.success == null) { + this.success = new HashMap(); + } + this.success.put(key, val); + } + + public Map getSuccess() { + return this.success; + } + + public getColumnDescriptors_result setSuccess(Map success) { + this.success = success; + return this; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public IOError getIo() { + return this.io; + } + + public getColumnDescriptors_result setIo(IOError io) { + this.io = io; + return this; + } + + public void unsetIo() { + this.io = null; + } + + /** Returns true if field io is set (has been assigned a value) and false otherwise */ + public boolean isSetIo() { + return this.io != null; + } + + public void setIoIsSet(boolean value) { + if (!value) { + this.io = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((Map)value); + } + break; + + case IO: + if (value == null) { + unsetIo(); + } else { + setIo((IOError)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + case IO: + return getIo(); + + } + 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 SUCCESS: + return isSetSuccess(); + case IO: + return isSetIo(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getColumnDescriptors_result) + return this.equals((getColumnDescriptors_result)that); + return false; + } + + public boolean equals(getColumnDescriptors_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + boolean this_present_io = true && this.isSetIo(); + boolean that_present_io = true && that.isSetIo(); + if (this_present_io || that_present_io) { + if (!(this_present_io && that_present_io)) + return false; + if (!this.io.equals(that.io)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + boolean present_io = true && (isSetIo()); + list.add(present_io); + if (present_io) + list.add(io); + + return list.hashCode(); + } + + @Override + public int compareTo(getColumnDescriptors_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIo()).compareTo(other.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, other.io); + 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("getColumnDescriptors_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + if (!first) sb.append(", "); + sb.append("io:"); + if (this.io == null) { + sb.append("null"); + } else { + sb.append(this.io); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 getColumnDescriptors_resultStandardSchemeFactory implements SchemeFactory { + public getColumnDescriptors_resultStandardScheme getScheme() { + return new getColumnDescriptors_resultStandardScheme(); + } + } + + private static class getColumnDescriptors_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getColumnDescriptors_result 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 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map58 = iprot.readMapBegin(); + struct.success = new HashMap(2*_map58.size); + ByteBuffer _key59; + ColumnDescriptor _val60; + for (int _i61 = 0; _i61 < _map58.size; ++_i61) + { + _key59 = iprot.readBinary(); + _val60 = new ColumnDescriptor(); + _val60.read(iprot); + struct.success.put(_key59, _val60); + } + iprot.readMapEnd(); + } + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IO + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(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, getColumnDescriptors_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); + for (Map.Entry _iter62 : struct.success.entrySet()) + { + oprot.writeBinary(_iter62.getKey()); + _iter62.getValue().write(oprot); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.io != null) { + oprot.writeFieldBegin(IO_FIELD_DESC); + struct.io.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getColumnDescriptors_resultTupleSchemeFactory implements SchemeFactory { + public getColumnDescriptors_resultTupleScheme getScheme() { + return new getColumnDescriptors_resultTupleScheme(); + } + } + + private static class getColumnDescriptors_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getColumnDescriptors_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIo()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + { + oprot.writeI32(struct.success.size()); + for (Map.Entry _iter63 : struct.success.entrySet()) + { + oprot.writeBinary(_iter63.getKey()); + _iter63.getValue().write(oprot); + } + } + } + if (struct.isSetIo()) { + struct.io.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getColumnDescriptors_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TMap _map64 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new HashMap(2*_map64.size); + ByteBuffer _key65; + ColumnDescriptor _val66; + for (int _i67 = 0; _i67 < _map64.size; ++_i67) + { + _key65 = iprot.readBinary(); + _val66 = new ColumnDescriptor(); + _val66.read(iprot); + struct.success.put(_key65, _val66); + } + } + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } + } + } + + } + + public static class getTableRegions_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getTableRegions_args"); + + private static final org.apache.thrift.protocol.TField TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tableName", org.apache.thrift.protocol.TType.STRING, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getTableRegions_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getTableRegions_argsTupleSchemeFactory()); + } + + /** + * table name + */ + public ByteBuffer tableName; // 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 { + /** + * table name + */ + TABLE_NAME((short)1, "tableName"); + + private static final Map byName = new HashMap(); + + 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; + 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.TABLE_NAME, new org.apache.thrift.meta_data.FieldMetaData("tableName", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getTableRegions_args.class, metaDataMap); + } + + public getTableRegions_args() { + } + + public getTableRegions_args( + ByteBuffer tableName) + { + this(); + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(tableName); + } + + /** + * Performs a deep copy on other. + */ + public getTableRegions_args(getTableRegions_args other) { + if (other.isSetTableName()) { + this.tableName = other.tableName; + } + } + + public getTableRegions_args deepCopy() { + return new getTableRegions_args(this); + } + + @Override + public void clear() { + this.tableName = null; + } + + /** + * table name + */ + public byte[] getTableName() { + setTableName(org.apache.thrift.TBaseHelper.rightSize(tableName)); + return tableName == null ? null : tableName.array(); + } + + public ByteBuffer bufferForTableName() { + return org.apache.thrift.TBaseHelper.copyBinary(tableName); + } + + /** + * table name + */ + public getTableRegions_args setTableName(byte[] tableName) { + this.tableName = tableName == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(tableName, tableName.length)); + return this; + } + + public getTableRegions_args setTableName(ByteBuffer tableName) { + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(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 void setFieldValue(_Fields field, Object value) { + switch (field) { + case TABLE_NAME: + if (value == null) { + unsetTableName(); + } else { + setTableName((ByteBuffer)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case TABLE_NAME: + return getTableName(); + + } + 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(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getTableRegions_args) + return this.equals((getTableRegions_args)that); + return false; + } + + public boolean equals(getTableRegions_args 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; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_tableName = true && (isSetTableName()); + list.add(present_tableName); + if (present_tableName) + list.add(tableName); + + return list.hashCode(); + } + + @Override + public int compareTo(getTableRegions_args 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; + } + } + 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("getTableRegions_args("); + boolean first = true; + + sb.append("tableName:"); + if (this.tableName == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.tableName, sb); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 getTableRegions_argsStandardSchemeFactory implements SchemeFactory { + public getTableRegions_argsStandardScheme getScheme() { + return new getTableRegions_argsStandardScheme(); + } + } + + private static class getTableRegions_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getTableRegions_args 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.STRING) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(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, getTableRegions_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.tableName != null) { + oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC); + oprot.writeBinary(struct.tableName); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getTableRegions_argsTupleSchemeFactory implements SchemeFactory { + public getTableRegions_argsTupleScheme getScheme() { + return new getTableRegions_argsTupleScheme(); + } + } + + private static class getTableRegions_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getTableRegions_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetTableName()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetTableName()) { + oprot.writeBinary(struct.tableName); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getTableRegions_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(true); + } + } + } + + } + + public static class getTableRegions_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getTableRegions_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0); + private static final org.apache.thrift.protocol.TField IO_FIELD_DESC = new org.apache.thrift.protocol.TField("io", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getTableRegions_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getTableRegions_resultTupleSchemeFactory()); + } + + public List success; // required + public IOError io; // 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 { + SUCCESS((short)0, "success"), + IO((short)1, "io"); + + private static final Map byName = new HashMap(); + + 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 0: // SUCCESS + return SUCCESS; + case 1: // IO + return IO; + 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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + 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, TRegionInfo.class)))); + tmpMap.put(_Fields.IO, new org.apache.thrift.meta_data.FieldMetaData("io", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getTableRegions_result.class, metaDataMap); + } + + public getTableRegions_result() { + } + + public getTableRegions_result( + List success, + IOError io) + { + this(); + this.success = success; + this.io = io; + } + + /** + * Performs a deep copy on other. + */ + public getTableRegions_result(getTableRegions_result other) { + if (other.isSetSuccess()) { + List __this__success = new ArrayList(other.success.size()); + for (TRegionInfo other_element : other.success) { + __this__success.add(new TRegionInfo(other_element)); + } + this.success = __this__success; + } + if (other.isSetIo()) { + this.io = new IOError(other.io); + } + } + + public getTableRegions_result deepCopy() { + return new getTableRegions_result(this); + } + + @Override + public void clear() { + this.success = null; + this.io = null; + } + + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + public java.util.Iterator getSuccessIterator() { + return (this.success == null) ? null : this.success.iterator(); + } + + public void addToSuccess(TRegionInfo elem) { + if (this.success == null) { + this.success = new ArrayList(); + } + this.success.add(elem); + } + + public List getSuccess() { + return this.success; + } + + public getTableRegions_result setSuccess(List success) { + this.success = success; + return this; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public IOError getIo() { + return this.io; + } + + public getTableRegions_result setIo(IOError io) { + this.io = io; + return this; + } + + public void unsetIo() { + this.io = null; + } + + /** Returns true if field io is set (has been assigned a value) and false otherwise */ + public boolean isSetIo() { + return this.io != null; + } + + public void setIoIsSet(boolean value) { + if (!value) { + this.io = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((List)value); + } + break; + + case IO: + if (value == null) { + unsetIo(); + } else { + setIo((IOError)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + case IO: + return getIo(); + + } + 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 SUCCESS: + return isSetSuccess(); + case IO: + return isSetIo(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getTableRegions_result) + return this.equals((getTableRegions_result)that); + return false; + } + + public boolean equals(getTableRegions_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + boolean this_present_io = true && this.isSetIo(); + boolean that_present_io = true && that.isSetIo(); + if (this_present_io || that_present_io) { + if (!(this_present_io && that_present_io)) + return false; + if (!this.io.equals(that.io)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + boolean present_io = true && (isSetIo()); + list.add(present_io); + if (present_io) + list.add(io); + + return list.hashCode(); + } + + @Override + public int compareTo(getTableRegions_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIo()).compareTo(other.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, other.io); + 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("getTableRegions_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + if (!first) sb.append(", "); + sb.append("io:"); + if (this.io == null) { + sb.append("null"); + } else { + sb.append(this.io); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 getTableRegions_resultStandardSchemeFactory implements SchemeFactory { + public getTableRegions_resultStandardScheme getScheme() { + return new getTableRegions_resultStandardScheme(); + } + } + + private static class getTableRegions_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getTableRegions_result 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 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list68 = iprot.readListBegin(); + struct.success = new ArrayList(_list68.size); + TRegionInfo _elem69; + for (int _i70 = 0; _i70 < _list68.size; ++_i70) + { + _elem69 = new TRegionInfo(); + _elem69.read(iprot); + struct.success.add(_elem69); + } + iprot.readListEnd(); + } + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IO + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(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, getTableRegions_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); + for (TRegionInfo _iter71 : struct.success) + { + _iter71.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.io != null) { + oprot.writeFieldBegin(IO_FIELD_DESC); + struct.io.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getTableRegions_resultTupleSchemeFactory implements SchemeFactory { + public getTableRegions_resultTupleScheme getScheme() { + return new getTableRegions_resultTupleScheme(); + } + } + + private static class getTableRegions_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getTableRegions_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIo()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + { + oprot.writeI32(struct.success.size()); + for (TRegionInfo _iter72 : struct.success) + { + _iter72.write(oprot); + } + } + } + if (struct.isSetIo()) { + struct.io.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getTableRegions_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list73 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new ArrayList(_list73.size); + TRegionInfo _elem74; + for (int _i75 = 0; _i75 < _list73.size; ++_i75) + { + _elem74 = new TRegionInfo(); + _elem74.read(iprot); + struct.success.add(_elem74); + } + } + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } + } + } + + } + + public static class createTable_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createTable_args"); + + private static final org.apache.thrift.protocol.TField TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tableName", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField COLUMN_FAMILIES_FIELD_DESC = new org.apache.thrift.protocol.TField("columnFamilies", org.apache.thrift.protocol.TType.LIST, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new createTable_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new createTable_argsTupleSchemeFactory()); + } + + /** + * name of table to create + */ + public ByteBuffer tableName; // required + /** + * list of column family descriptors + */ + public List columnFamilies; // 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 { + /** + * name of table to create + */ + TABLE_NAME((short)1, "tableName"), + /** + * list of column family descriptors + */ + COLUMN_FAMILIES((short)2, "columnFamilies"); + + private static final Map byName = new HashMap(); + + 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: // COLUMN_FAMILIES + return COLUMN_FAMILIES; + 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.TABLE_NAME, new org.apache.thrift.meta_data.FieldMetaData("tableName", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.COLUMN_FAMILIES, new org.apache.thrift.meta_data.FieldMetaData("columnFamilies", org.apache.thrift.TFieldRequirementType.DEFAULT, + 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, ColumnDescriptor.class)))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createTable_args.class, metaDataMap); + } + + public createTable_args() { + } + + public createTable_args( + ByteBuffer tableName, + List columnFamilies) + { + this(); + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(tableName); + this.columnFamilies = columnFamilies; + } + + /** + * Performs a deep copy on other. + */ + public createTable_args(createTable_args other) { + if (other.isSetTableName()) { + this.tableName = other.tableName; + } + if (other.isSetColumnFamilies()) { + List __this__columnFamilies = new ArrayList(other.columnFamilies.size()); + for (ColumnDescriptor other_element : other.columnFamilies) { + __this__columnFamilies.add(new ColumnDescriptor(other_element)); + } + this.columnFamilies = __this__columnFamilies; + } + } + + public createTable_args deepCopy() { + return new createTable_args(this); + } + + @Override + public void clear() { + this.tableName = null; + this.columnFamilies = null; + } + + /** + * name of table to create + */ + public byte[] getTableName() { + setTableName(org.apache.thrift.TBaseHelper.rightSize(tableName)); + return tableName == null ? null : tableName.array(); + } + + public ByteBuffer bufferForTableName() { + return org.apache.thrift.TBaseHelper.copyBinary(tableName); + } + + /** + * name of table to create + */ + public createTable_args setTableName(byte[] tableName) { + this.tableName = tableName == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(tableName, tableName.length)); + return this; + } + + public createTable_args setTableName(ByteBuffer tableName) { + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(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 getColumnFamiliesSize() { + return (this.columnFamilies == null) ? 0 : this.columnFamilies.size(); + } + + public java.util.Iterator getColumnFamiliesIterator() { + return (this.columnFamilies == null) ? null : this.columnFamilies.iterator(); + } + + public void addToColumnFamilies(ColumnDescriptor elem) { + if (this.columnFamilies == null) { + this.columnFamilies = new ArrayList(); + } + this.columnFamilies.add(elem); + } + + /** + * list of column family descriptors + */ + public List getColumnFamilies() { + return this.columnFamilies; + } + + /** + * list of column family descriptors + */ + public createTable_args setColumnFamilies(List columnFamilies) { + this.columnFamilies = columnFamilies; + return this; + } + + public void unsetColumnFamilies() { + this.columnFamilies = null; + } + + /** Returns true if field columnFamilies is set (has been assigned a value) and false otherwise */ + public boolean isSetColumnFamilies() { + return this.columnFamilies != null; + } + + public void setColumnFamiliesIsSet(boolean value) { + if (!value) { + this.columnFamilies = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case TABLE_NAME: + if (value == null) { + unsetTableName(); + } else { + setTableName((ByteBuffer)value); + } + break; + + case COLUMN_FAMILIES: + if (value == null) { + unsetColumnFamilies(); + } else { + setColumnFamilies((List)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case TABLE_NAME: + return getTableName(); + + case COLUMN_FAMILIES: + return getColumnFamilies(); + + } + 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 COLUMN_FAMILIES: + return isSetColumnFamilies(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof createTable_args) + return this.equals((createTable_args)that); + return false; + } + + public boolean equals(createTable_args 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_columnFamilies = true && this.isSetColumnFamilies(); + boolean that_present_columnFamilies = true && that.isSetColumnFamilies(); + if (this_present_columnFamilies || that_present_columnFamilies) { + if (!(this_present_columnFamilies && that_present_columnFamilies)) + return false; + if (!this.columnFamilies.equals(that.columnFamilies)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_tableName = true && (isSetTableName()); + list.add(present_tableName); + if (present_tableName) + list.add(tableName); + + boolean present_columnFamilies = true && (isSetColumnFamilies()); + list.add(present_columnFamilies); + if (present_columnFamilies) + list.add(columnFamilies); + + return list.hashCode(); + } + + @Override + public int compareTo(createTable_args 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(isSetColumnFamilies()).compareTo(other.isSetColumnFamilies()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetColumnFamilies()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columnFamilies, other.columnFamilies); + 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("createTable_args("); + boolean first = true; + + sb.append("tableName:"); + if (this.tableName == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.tableName, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("columnFamilies:"); + if (this.columnFamilies == null) { + sb.append("null"); + } else { + sb.append(this.columnFamilies); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 createTable_argsStandardSchemeFactory implements SchemeFactory { + public createTable_argsStandardScheme getScheme() { + return new createTable_argsStandardScheme(); + } + } + + private static class createTable_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, createTable_args 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.STRING) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // COLUMN_FAMILIES + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list76 = iprot.readListBegin(); + struct.columnFamilies = new ArrayList(_list76.size); + ColumnDescriptor _elem77; + for (int _i78 = 0; _i78 < _list76.size; ++_i78) + { + _elem77 = new ColumnDescriptor(); + _elem77.read(iprot); + struct.columnFamilies.add(_elem77); + } + iprot.readListEnd(); + } + struct.setColumnFamiliesIsSet(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, createTable_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.tableName != null) { + oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC); + oprot.writeBinary(struct.tableName); + oprot.writeFieldEnd(); + } + if (struct.columnFamilies != null) { + oprot.writeFieldBegin(COLUMN_FAMILIES_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.columnFamilies.size())); + for (ColumnDescriptor _iter79 : struct.columnFamilies) + { + _iter79.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class createTable_argsTupleSchemeFactory implements SchemeFactory { + public createTable_argsTupleScheme getScheme() { + return new createTable_argsTupleScheme(); + } + } + + private static class createTable_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, createTable_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetTableName()) { + optionals.set(0); + } + if (struct.isSetColumnFamilies()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetTableName()) { + oprot.writeBinary(struct.tableName); + } + if (struct.isSetColumnFamilies()) { + { + oprot.writeI32(struct.columnFamilies.size()); + for (ColumnDescriptor _iter80 : struct.columnFamilies) + { + _iter80.write(oprot); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, createTable_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(true); + } + if (incoming.get(1)) { + { + org.apache.thrift.protocol.TList _list81 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.columnFamilies = new ArrayList(_list81.size); + ColumnDescriptor _elem82; + for (int _i83 = 0; _i83 < _list81.size; ++_i83) + { + _elem82 = new ColumnDescriptor(); + _elem82.read(iprot); + struct.columnFamilies.add(_elem82); + } + } + struct.setColumnFamiliesIsSet(true); + } + } + } + + } + + public static class createTable_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createTable_result"); + + private static final org.apache.thrift.protocol.TField IO_FIELD_DESC = new org.apache.thrift.protocol.TField("io", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final org.apache.thrift.protocol.TField IA_FIELD_DESC = new org.apache.thrift.protocol.TField("ia", org.apache.thrift.protocol.TType.STRUCT, (short)2); + private static final org.apache.thrift.protocol.TField EXIST_FIELD_DESC = new org.apache.thrift.protocol.TField("exist", org.apache.thrift.protocol.TType.STRUCT, (short)3); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new createTable_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new createTable_resultTupleSchemeFactory()); + } + + public IOError io; // required + public IllegalArgument ia; // required + public AlreadyExists exist; // 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 { + IO((short)1, "io"), + IA((short)2, "ia"), + EXIST((short)3, "exist"); + + private static final Map byName = new HashMap(); + + 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: // IO + return IO; + case 2: // IA + return IA; + case 3: // EXIST + return EXIST; + 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.IO, new org.apache.thrift.meta_data.FieldMetaData("io", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + tmpMap.put(_Fields.IA, new org.apache.thrift.meta_data.FieldMetaData("ia", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + tmpMap.put(_Fields.EXIST, new org.apache.thrift.meta_data.FieldMetaData("exist", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createTable_result.class, metaDataMap); + } + + public createTable_result() { + } + + public createTable_result( + IOError io, + IllegalArgument ia, + AlreadyExists exist) + { + this(); + this.io = io; + this.ia = ia; + this.exist = exist; + } + + /** + * Performs a deep copy on other. + */ + public createTable_result(createTable_result other) { + if (other.isSetIo()) { + this.io = new IOError(other.io); + } + if (other.isSetIa()) { + this.ia = new IllegalArgument(other.ia); + } + if (other.isSetExist()) { + this.exist = new AlreadyExists(other.exist); + } + } + + public createTable_result deepCopy() { + return new createTable_result(this); + } + + @Override + public void clear() { + this.io = null; + this.ia = null; + this.exist = null; + } + + public IOError getIo() { + return this.io; + } + + public createTable_result setIo(IOError io) { + this.io = io; + return this; + } + + public void unsetIo() { + this.io = null; + } + + /** Returns true if field io is set (has been assigned a value) and false otherwise */ + public boolean isSetIo() { + return this.io != null; + } + + public void setIoIsSet(boolean value) { + if (!value) { + this.io = null; + } + } + + public IllegalArgument getIa() { + return this.ia; + } + + public createTable_result setIa(IllegalArgument ia) { + this.ia = ia; + return this; + } + + public void unsetIa() { + this.ia = null; + } + + /** Returns true if field ia is set (has been assigned a value) and false otherwise */ + public boolean isSetIa() { + return this.ia != null; + } + + public void setIaIsSet(boolean value) { + if (!value) { + this.ia = null; + } + } + + public AlreadyExists getExist() { + return this.exist; + } + + public createTable_result setExist(AlreadyExists exist) { + this.exist = exist; + return this; + } + + public void unsetExist() { + this.exist = null; + } + + /** Returns true if field exist is set (has been assigned a value) and false otherwise */ + public boolean isSetExist() { + return this.exist != null; + } + + public void setExistIsSet(boolean value) { + if (!value) { + this.exist = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case IO: + if (value == null) { + unsetIo(); + } else { + setIo((IOError)value); + } + break; + + case IA: + if (value == null) { + unsetIa(); + } else { + setIa((IllegalArgument)value); + } + break; + + case EXIST: + if (value == null) { + unsetExist(); + } else { + setExist((AlreadyExists)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case IO: + return getIo(); + + case IA: + return getIa(); + + case EXIST: + return getExist(); + + } + 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 IO: + return isSetIo(); + case IA: + return isSetIa(); + case EXIST: + return isSetExist(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof createTable_result) + return this.equals((createTable_result)that); + return false; + } + + public boolean equals(createTable_result that) { + if (that == null) + return false; + + boolean this_present_io = true && this.isSetIo(); + boolean that_present_io = true && that.isSetIo(); + if (this_present_io || that_present_io) { + if (!(this_present_io && that_present_io)) + return false; + if (!this.io.equals(that.io)) + return false; + } + + boolean this_present_ia = true && this.isSetIa(); + boolean that_present_ia = true && that.isSetIa(); + if (this_present_ia || that_present_ia) { + if (!(this_present_ia && that_present_ia)) + return false; + if (!this.ia.equals(that.ia)) + return false; + } + + boolean this_present_exist = true && this.isSetExist(); + boolean that_present_exist = true && that.isSetExist(); + if (this_present_exist || that_present_exist) { + if (!(this_present_exist && that_present_exist)) + return false; + if (!this.exist.equals(that.exist)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_io = true && (isSetIo()); + list.add(present_io); + if (present_io) + list.add(io); + + boolean present_ia = true && (isSetIa()); + list.add(present_ia); + if (present_ia) + list.add(ia); + + boolean present_exist = true && (isSetExist()); + list.add(present_exist); + if (present_exist) + list.add(exist); + + return list.hashCode(); + } + + @Override + public int compareTo(createTable_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetIo()).compareTo(other.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, other.io); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIa()).compareTo(other.isSetIa()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIa()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ia, other.ia); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetExist()).compareTo(other.isSetExist()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetExist()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.exist, other.exist); + 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("createTable_result("); + boolean first = true; + + sb.append("io:"); + if (this.io == null) { + sb.append("null"); + } else { + sb.append(this.io); + } + first = false; + if (!first) sb.append(", "); + sb.append("ia:"); + if (this.ia == null) { + sb.append("null"); + } else { + sb.append(this.ia); + } + first = false; + if (!first) sb.append(", "); + sb.append("exist:"); + if (this.exist == null) { + sb.append("null"); + } else { + sb.append(this.exist); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 createTable_resultStandardSchemeFactory implements SchemeFactory { + public createTable_resultStandardScheme getScheme() { + return new createTable_resultStandardScheme(); + } + } + + private static class createTable_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, createTable_result 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: // IO + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // IA + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ia = new IllegalArgument(); + struct.ia.read(iprot); + struct.setIaIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // EXIST + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.exist = new AlreadyExists(); + struct.exist.read(iprot); + struct.setExistIsSet(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, createTable_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.io != null) { + oprot.writeFieldBegin(IO_FIELD_DESC); + struct.io.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.ia != null) { + oprot.writeFieldBegin(IA_FIELD_DESC); + struct.ia.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.exist != null) { + oprot.writeFieldBegin(EXIST_FIELD_DESC); + struct.exist.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class createTable_resultTupleSchemeFactory implements SchemeFactory { + public createTable_resultTupleScheme getScheme() { + return new createTable_resultTupleScheme(); + } + } + + private static class createTable_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, createTable_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetIo()) { + optionals.set(0); + } + if (struct.isSetIa()) { + optionals.set(1); + } + if (struct.isSetExist()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetIo()) { + struct.io.write(oprot); + } + if (struct.isSetIa()) { + struct.ia.write(oprot); + } + if (struct.isSetExist()) { + struct.exist.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, createTable_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } + if (incoming.get(1)) { + struct.ia = new IllegalArgument(); + struct.ia.read(iprot); + struct.setIaIsSet(true); + } + if (incoming.get(2)) { + struct.exist = new AlreadyExists(); + struct.exist.read(iprot); + struct.setExistIsSet(true); + } + } + } + + } + + public static class deleteTable_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteTable_args"); + + private static final org.apache.thrift.protocol.TField TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tableName", org.apache.thrift.protocol.TType.STRING, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new deleteTable_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new deleteTable_argsTupleSchemeFactory()); + } + + /** + * name of table to delete + */ + public ByteBuffer tableName; // 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 { + /** + * name of table to delete + */ + TABLE_NAME((short)1, "tableName"); + + private static final Map byName = new HashMap(); + + 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; + 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.TABLE_NAME, new org.apache.thrift.meta_data.FieldMetaData("tableName", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteTable_args.class, metaDataMap); + } + + public deleteTable_args() { + } + + public deleteTable_args( + ByteBuffer tableName) + { + this(); + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(tableName); + } + + /** + * Performs a deep copy on other. + */ + public deleteTable_args(deleteTable_args other) { + if (other.isSetTableName()) { + this.tableName = other.tableName; + } + } + + public deleteTable_args deepCopy() { + return new deleteTable_args(this); + } + + @Override + public void clear() { + this.tableName = null; + } + + /** + * name of table to delete + */ + public byte[] getTableName() { + setTableName(org.apache.thrift.TBaseHelper.rightSize(tableName)); + return tableName == null ? null : tableName.array(); + } + + public ByteBuffer bufferForTableName() { + return org.apache.thrift.TBaseHelper.copyBinary(tableName); + } + + /** + * name of table to delete + */ + public deleteTable_args setTableName(byte[] tableName) { + this.tableName = tableName == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(tableName, tableName.length)); + return this; + } + + public deleteTable_args setTableName(ByteBuffer tableName) { + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(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 void setFieldValue(_Fields field, Object value) { + switch (field) { + case TABLE_NAME: + if (value == null) { + unsetTableName(); + } else { + setTableName((ByteBuffer)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case TABLE_NAME: + return getTableName(); + + } + 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(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof deleteTable_args) + return this.equals((deleteTable_args)that); + return false; + } + + public boolean equals(deleteTable_args 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; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_tableName = true && (isSetTableName()); + list.add(present_tableName); + if (present_tableName) + list.add(tableName); + + return list.hashCode(); + } + + @Override + public int compareTo(deleteTable_args 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; + } + } + 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("deleteTable_args("); + boolean first = true; + + sb.append("tableName:"); + if (this.tableName == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.tableName, sb); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 deleteTable_argsStandardSchemeFactory implements SchemeFactory { + public deleteTable_argsStandardScheme getScheme() { + return new deleteTable_argsStandardScheme(); + } + } + + private static class deleteTable_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, deleteTable_args 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.STRING) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(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, deleteTable_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.tableName != null) { + oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC); + oprot.writeBinary(struct.tableName); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class deleteTable_argsTupleSchemeFactory implements SchemeFactory { + public deleteTable_argsTupleScheme getScheme() { + return new deleteTable_argsTupleScheme(); + } + } + + private static class deleteTable_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, deleteTable_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetTableName()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetTableName()) { + oprot.writeBinary(struct.tableName); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, deleteTable_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(true); + } + } + } + + } + + public static class deleteTable_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteTable_result"); + + private static final org.apache.thrift.protocol.TField IO_FIELD_DESC = new org.apache.thrift.protocol.TField("io", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new deleteTable_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new deleteTable_resultTupleSchemeFactory()); + } + + public IOError io; // 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 { + IO((short)1, "io"); + + private static final Map byName = new HashMap(); + + 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: // IO + return IO; + 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.IO, new org.apache.thrift.meta_data.FieldMetaData("io", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteTable_result.class, metaDataMap); + } + + public deleteTable_result() { + } + + public deleteTable_result( + IOError io) + { + this(); + this.io = io; + } + + /** + * Performs a deep copy on other. + */ + public deleteTable_result(deleteTable_result other) { + if (other.isSetIo()) { + this.io = new IOError(other.io); + } + } + + public deleteTable_result deepCopy() { + return new deleteTable_result(this); + } + + @Override + public void clear() { + this.io = null; + } + + public IOError getIo() { + return this.io; + } + + public deleteTable_result setIo(IOError io) { + this.io = io; + return this; + } + + public void unsetIo() { + this.io = null; + } + + /** Returns true if field io is set (has been assigned a value) and false otherwise */ + public boolean isSetIo() { + return this.io != null; + } + + public void setIoIsSet(boolean value) { + if (!value) { + this.io = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case IO: + if (value == null) { + unsetIo(); + } else { + setIo((IOError)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case IO: + return getIo(); + + } + 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 IO: + return isSetIo(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof deleteTable_result) + return this.equals((deleteTable_result)that); + return false; + } + + public boolean equals(deleteTable_result that) { + if (that == null) + return false; + + boolean this_present_io = true && this.isSetIo(); + boolean that_present_io = true && that.isSetIo(); + if (this_present_io || that_present_io) { + if (!(this_present_io && that_present_io)) + return false; + if (!this.io.equals(that.io)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_io = true && (isSetIo()); + list.add(present_io); + if (present_io) + list.add(io); + + return list.hashCode(); + } + + @Override + public int compareTo(deleteTable_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetIo()).compareTo(other.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, other.io); + 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("deleteTable_result("); + boolean first = true; + + sb.append("io:"); + if (this.io == null) { + sb.append("null"); + } else { + sb.append(this.io); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 deleteTable_resultStandardSchemeFactory implements SchemeFactory { + public deleteTable_resultStandardScheme getScheme() { + return new deleteTable_resultStandardScheme(); + } + } + + private static class deleteTable_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, deleteTable_result 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: // IO + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(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, deleteTable_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.io != null) { + oprot.writeFieldBegin(IO_FIELD_DESC); + struct.io.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class deleteTable_resultTupleSchemeFactory implements SchemeFactory { + public deleteTable_resultTupleScheme getScheme() { + return new deleteTable_resultTupleScheme(); + } + } + + private static class deleteTable_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, deleteTable_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetIo()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetIo()) { + struct.io.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, deleteTable_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } + } + } + + } + + public static class get_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("get_args"); + + private static final org.apache.thrift.protocol.TField TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tableName", org.apache.thrift.protocol.TType.STRING, (short)1); + 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)2); + private static final org.apache.thrift.protocol.TField COLUMN_FIELD_DESC = new org.apache.thrift.protocol.TField("column", org.apache.thrift.protocol.TType.STRING, (short)3); + 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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new get_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new get_argsTupleSchemeFactory()); + } + + /** + * name of table + */ + public ByteBuffer tableName; // required + /** + * row key + */ + public ByteBuffer row; // required + /** + * column name + */ + public ByteBuffer column; // required + /** + * Get attributes + */ + public Map attributes; // 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 { + /** + * name of table + */ + TABLE_NAME((short)1, "tableName"), + /** + * row key + */ + ROW((short)2, "row"), + /** + * column name + */ + COLUMN((short)3, "column"), + /** + * Get attributes + */ + ATTRIBUTES((short)4, "attributes"); + + private static final Map byName = new HashMap(); + + 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: // ROW + return ROW; + case 3: // COLUMN + return COLUMN; + case 4: // ATTRIBUTES + return ATTRIBUTES; + 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.TABLE_NAME, new org.apache.thrift.meta_data.FieldMetaData("tableName", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.ROW, new org.apache.thrift.meta_data.FieldMetaData("row", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.COLUMN, new org.apache.thrift.meta_data.FieldMetaData("column", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.ATTRIBUTES, new org.apache.thrift.meta_data.FieldMetaData("attributes", org.apache.thrift.TFieldRequirementType.DEFAULT, + 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 , "Text"), + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text")))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(get_args.class, metaDataMap); + } + + public get_args() { + } + + public get_args( + ByteBuffer tableName, + ByteBuffer row, + ByteBuffer column, + Map attributes) + { + this(); + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(tableName); + this.row = org.apache.thrift.TBaseHelper.copyBinary(row); + this.column = org.apache.thrift.TBaseHelper.copyBinary(column); + this.attributes = attributes; + } + + /** + * Performs a deep copy on other. + */ + public get_args(get_args other) { + if (other.isSetTableName()) { + this.tableName = other.tableName; + } + if (other.isSetRow()) { + this.row = other.row; + } + if (other.isSetColumn()) { + this.column = other.column; + } + if (other.isSetAttributes()) { + Map __this__attributes = new HashMap(other.attributes.size()); + for (Map.Entry other_element : other.attributes.entrySet()) { + + ByteBuffer other_element_key = other_element.getKey(); + ByteBuffer other_element_value = other_element.getValue(); + + ByteBuffer __this__attributes_copy_key = other_element_key; + + ByteBuffer __this__attributes_copy_value = other_element_value; + + __this__attributes.put(__this__attributes_copy_key, __this__attributes_copy_value); + } + this.attributes = __this__attributes; + } + } + + public get_args deepCopy() { + return new get_args(this); + } + + @Override + public void clear() { + this.tableName = null; + this.row = null; + this.column = null; + this.attributes = null; + } + + /** + * name of table + */ + public byte[] getTableName() { + setTableName(org.apache.thrift.TBaseHelper.rightSize(tableName)); + return tableName == null ? null : tableName.array(); + } + + public ByteBuffer bufferForTableName() { + return org.apache.thrift.TBaseHelper.copyBinary(tableName); + } + + /** + * name of table + */ + public get_args setTableName(byte[] tableName) { + this.tableName = tableName == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(tableName, tableName.length)); + return this; + } + + public get_args setTableName(ByteBuffer tableName) { + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(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; + } + } + + /** + * row key + */ + public byte[] getRow() { + setRow(org.apache.thrift.TBaseHelper.rightSize(row)); + return row == null ? null : row.array(); + } + + public ByteBuffer bufferForRow() { + return org.apache.thrift.TBaseHelper.copyBinary(row); + } + + /** + * row key + */ + public get_args setRow(byte[] row) { + this.row = row == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(row, row.length)); + return this; + } + + public get_args setRow(ByteBuffer row) { + this.row = org.apache.thrift.TBaseHelper.copyBinary(row); + return this; + } + + public void unsetRow() { + this.row = null; + } + + /** Returns true if field row is set (has been assigned a value) and false otherwise */ + public boolean isSetRow() { + return this.row != null; + } + + public void setRowIsSet(boolean value) { + if (!value) { + this.row = null; + } + } + + /** + * column name + */ + public byte[] getColumn() { + setColumn(org.apache.thrift.TBaseHelper.rightSize(column)); + return column == null ? null : column.array(); + } + + public ByteBuffer bufferForColumn() { + return org.apache.thrift.TBaseHelper.copyBinary(column); + } + + /** + * column name + */ + public get_args setColumn(byte[] column) { + this.column = column == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(column, column.length)); + return this; + } + + public get_args setColumn(ByteBuffer column) { + this.column = org.apache.thrift.TBaseHelper.copyBinary(column); + return this; + } + + public void unsetColumn() { + this.column = null; + } + + /** Returns true if field column is set (has been assigned a value) and false otherwise */ + public boolean isSetColumn() { + return this.column != null; + } + + public void setColumnIsSet(boolean value) { + if (!value) { + this.column = 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(); + } + this.attributes.put(key, val); + } + + /** + * Get attributes + */ + public Map getAttributes() { + return this.attributes; + } + + /** + * Get attributes + */ + public get_args setAttributes(Map 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; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case TABLE_NAME: + if (value == null) { + unsetTableName(); + } else { + setTableName((ByteBuffer)value); + } + break; + + case ROW: + if (value == null) { + unsetRow(); + } else { + setRow((ByteBuffer)value); + } + break; + + case COLUMN: + if (value == null) { + unsetColumn(); + } else { + setColumn((ByteBuffer)value); + } + break; + + case ATTRIBUTES: + if (value == null) { + unsetAttributes(); + } else { + setAttributes((Map)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case TABLE_NAME: + return getTableName(); + + case ROW: + return getRow(); + + case COLUMN: + return getColumn(); + + case ATTRIBUTES: + return getAttributes(); + + } + 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 ROW: + return isSetRow(); + case COLUMN: + return isSetColumn(); + case ATTRIBUTES: + return isSetAttributes(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof get_args) + return this.equals((get_args)that); + return false; + } + + public boolean equals(get_args 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_row = true && this.isSetRow(); + boolean that_present_row = true && that.isSetRow(); + if (this_present_row || that_present_row) { + if (!(this_present_row && that_present_row)) + return false; + if (!this.row.equals(that.row)) + return false; + } + + boolean this_present_column = true && this.isSetColumn(); + boolean that_present_column = true && that.isSetColumn(); + if (this_present_column || that_present_column) { + if (!(this_present_column && that_present_column)) + return false; + if (!this.column.equals(that.column)) + 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; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_tableName = true && (isSetTableName()); + list.add(present_tableName); + if (present_tableName) + list.add(tableName); + + boolean present_row = true && (isSetRow()); + list.add(present_row); + if (present_row) + list.add(row); + + boolean present_column = true && (isSetColumn()); + list.add(present_column); + if (present_column) + list.add(column); + + boolean present_attributes = true && (isSetAttributes()); + list.add(present_attributes); + if (present_attributes) + list.add(attributes); + + return list.hashCode(); + } + + @Override + public int compareTo(get_args 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(isSetRow()).compareTo(other.isSetRow()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRow()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.row, other.row); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetColumn()).compareTo(other.isSetColumn()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetColumn()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.column, other.column); + 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; + } + } + 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("get_args("); + boolean first = true; + + sb.append("tableName:"); + if (this.tableName == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.tableName, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("row:"); + if (this.row == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.row, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("column:"); + if (this.column == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.column, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("attributes:"); + if (this.attributes == null) { + sb.append("null"); + } else { + sb.append(this.attributes); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 get_argsStandardSchemeFactory implements SchemeFactory { + public get_argsStandardScheme getScheme() { + return new get_argsStandardScheme(); + } + } + + private static class get_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, get_args 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.STRING) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // ROW + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.row = iprot.readBinary(); + struct.setRowIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // COLUMN + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.column = iprot.readBinary(); + struct.setColumnIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // ATTRIBUTES + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map84 = iprot.readMapBegin(); + struct.attributes = new HashMap(2*_map84.size); + ByteBuffer _key85; + ByteBuffer _val86; + for (int _i87 = 0; _i87 < _map84.size; ++_i87) + { + _key85 = iprot.readBinary(); + _val86 = iprot.readBinary(); + struct.attributes.put(_key85, _val86); + } + iprot.readMapEnd(); + } + struct.setAttributesIsSet(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, get_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.tableName != null) { + oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC); + oprot.writeBinary(struct.tableName); + oprot.writeFieldEnd(); + } + if (struct.row != null) { + oprot.writeFieldBegin(ROW_FIELD_DESC); + oprot.writeBinary(struct.row); + oprot.writeFieldEnd(); + } + if (struct.column != null) { + oprot.writeFieldBegin(COLUMN_FIELD_DESC); + oprot.writeBinary(struct.column); + oprot.writeFieldEnd(); + } + if (struct.attributes != null) { + 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 _iter88 : struct.attributes.entrySet()) + { + oprot.writeBinary(_iter88.getKey()); + oprot.writeBinary(_iter88.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class get_argsTupleSchemeFactory implements SchemeFactory { + public get_argsTupleScheme getScheme() { + return new get_argsTupleScheme(); + } + } + + private static class get_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, get_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetTableName()) { + optionals.set(0); + } + if (struct.isSetRow()) { + optionals.set(1); + } + if (struct.isSetColumn()) { + optionals.set(2); + } + if (struct.isSetAttributes()) { + optionals.set(3); + } + oprot.writeBitSet(optionals, 4); + if (struct.isSetTableName()) { + oprot.writeBinary(struct.tableName); + } + if (struct.isSetRow()) { + oprot.writeBinary(struct.row); + } + if (struct.isSetColumn()) { + oprot.writeBinary(struct.column); + } + if (struct.isSetAttributes()) { + { + oprot.writeI32(struct.attributes.size()); + for (Map.Entry _iter89 : struct.attributes.entrySet()) + { + oprot.writeBinary(_iter89.getKey()); + oprot.writeBinary(_iter89.getValue()); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, get_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(4); + if (incoming.get(0)) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(true); + } + if (incoming.get(1)) { + struct.row = iprot.readBinary(); + struct.setRowIsSet(true); + } + if (incoming.get(2)) { + struct.column = iprot.readBinary(); + struct.setColumnIsSet(true); + } + if (incoming.get(3)) { + { + org.apache.thrift.protocol.TMap _map90 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.attributes = new HashMap(2*_map90.size); + ByteBuffer _key91; + ByteBuffer _val92; + for (int _i93 = 0; _i93 < _map90.size; ++_i93) + { + _key91 = iprot.readBinary(); + _val92 = iprot.readBinary(); + struct.attributes.put(_key91, _val92); + } + } + struct.setAttributesIsSet(true); + } + } + } + + } + + public static class get_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("get_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0); + private static final org.apache.thrift.protocol.TField IO_FIELD_DESC = new org.apache.thrift.protocol.TField("io", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new get_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new get_resultTupleSchemeFactory()); + } + + public List success; // required + public IOError io; // 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 { + SUCCESS((short)0, "success"), + IO((short)1, "io"); + + private static final Map byName = new HashMap(); + + 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 0: // SUCCESS + return SUCCESS; + case 1: // IO + return IO; + 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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + 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, TCell.class)))); + tmpMap.put(_Fields.IO, new org.apache.thrift.meta_data.FieldMetaData("io", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(get_result.class, metaDataMap); + } + + public get_result() { + } + + public get_result( + List success, + IOError io) + { + this(); + this.success = success; + this.io = io; + } + + /** + * Performs a deep copy on other. + */ + public get_result(get_result other) { + if (other.isSetSuccess()) { + List __this__success = new ArrayList(other.success.size()); + for (TCell other_element : other.success) { + __this__success.add(new TCell(other_element)); + } + this.success = __this__success; + } + if (other.isSetIo()) { + this.io = new IOError(other.io); + } + } + + public get_result deepCopy() { + return new get_result(this); + } + + @Override + public void clear() { + this.success = null; + this.io = null; + } + + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + public java.util.Iterator getSuccessIterator() { + return (this.success == null) ? null : this.success.iterator(); + } + + public void addToSuccess(TCell elem) { + if (this.success == null) { + this.success = new ArrayList(); + } + this.success.add(elem); + } + + public List getSuccess() { + return this.success; + } + + public get_result setSuccess(List success) { + this.success = success; + return this; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public IOError getIo() { + return this.io; + } + + public get_result setIo(IOError io) { + this.io = io; + return this; + } + + public void unsetIo() { + this.io = null; + } + + /** Returns true if field io is set (has been assigned a value) and false otherwise */ + public boolean isSetIo() { + return this.io != null; + } + + public void setIoIsSet(boolean value) { + if (!value) { + this.io = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((List)value); + } + break; + + case IO: + if (value == null) { + unsetIo(); + } else { + setIo((IOError)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + case IO: + return getIo(); + + } + 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 SUCCESS: + return isSetSuccess(); + case IO: + return isSetIo(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof get_result) + return this.equals((get_result)that); + return false; + } + + public boolean equals(get_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + boolean this_present_io = true && this.isSetIo(); + boolean that_present_io = true && that.isSetIo(); + if (this_present_io || that_present_io) { + if (!(this_present_io && that_present_io)) + return false; + if (!this.io.equals(that.io)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + boolean present_io = true && (isSetIo()); + list.add(present_io); + if (present_io) + list.add(io); + + return list.hashCode(); + } + + @Override + public int compareTo(get_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIo()).compareTo(other.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, other.io); + 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("get_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + if (!first) sb.append(", "); + sb.append("io:"); + if (this.io == null) { + sb.append("null"); + } else { + sb.append(this.io); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 get_resultStandardSchemeFactory implements SchemeFactory { + public get_resultStandardScheme getScheme() { + return new get_resultStandardScheme(); + } + } + + private static class get_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, get_result 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 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list94 = iprot.readListBegin(); + struct.success = new ArrayList(_list94.size); + TCell _elem95; + for (int _i96 = 0; _i96 < _list94.size; ++_i96) + { + _elem95 = new TCell(); + _elem95.read(iprot); + struct.success.add(_elem95); + } + iprot.readListEnd(); + } + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IO + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(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, get_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); + for (TCell _iter97 : struct.success) + { + _iter97.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.io != null) { + oprot.writeFieldBegin(IO_FIELD_DESC); + struct.io.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class get_resultTupleSchemeFactory implements SchemeFactory { + public get_resultTupleScheme getScheme() { + return new get_resultTupleScheme(); + } + } + + private static class get_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, get_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIo()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + { + oprot.writeI32(struct.success.size()); + for (TCell _iter98 : struct.success) + { + _iter98.write(oprot); + } + } + } + if (struct.isSetIo()) { + struct.io.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, get_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list99 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new ArrayList(_list99.size); + TCell _elem100; + for (int _i101 = 0; _i101 < _list99.size; ++_i101) + { + _elem100 = new TCell(); + _elem100.read(iprot); + struct.success.add(_elem100); + } + } + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } + } + } + + } + + public static class getVer_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getVer_args"); + + private static final org.apache.thrift.protocol.TField TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tableName", org.apache.thrift.protocol.TType.STRING, (short)1); + 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)2); + private static final org.apache.thrift.protocol.TField COLUMN_FIELD_DESC = new org.apache.thrift.protocol.TField("column", org.apache.thrift.protocol.TType.STRING, (short)3); + private static final org.apache.thrift.protocol.TField NUM_VERSIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("numVersions", org.apache.thrift.protocol.TType.I32, (short)4); + 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)5); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getVer_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getVer_argsTupleSchemeFactory()); + } + + /** + * name of table + */ + public ByteBuffer tableName; // required + /** + * row key + */ + public ByteBuffer row; // required + /** + * column name + */ + public ByteBuffer column; // required + /** + * number of versions to retrieve + */ + public int numVersions; // required + /** + * Get attributes + */ + public Map attributes; // 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 { + /** + * name of table + */ + TABLE_NAME((short)1, "tableName"), + /** + * row key + */ + ROW((short)2, "row"), + /** + * column name + */ + COLUMN((short)3, "column"), + /** + * number of versions to retrieve + */ + NUM_VERSIONS((short)4, "numVersions"), + /** + * Get attributes + */ + ATTRIBUTES((short)5, "attributes"); + + private static final Map byName = new HashMap(); + + 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: // ROW + return ROW; + case 3: // COLUMN + return COLUMN; + case 4: // NUM_VERSIONS + return NUM_VERSIONS; + case 5: // ATTRIBUTES + return ATTRIBUTES; + 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 int __NUMVERSIONS_ISSET_ID = 0; + private byte __isset_bitfield = 0; + 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.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.ROW, new org.apache.thrift.meta_data.FieldMetaData("row", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.COLUMN, new org.apache.thrift.meta_data.FieldMetaData("column", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.NUM_VERSIONS, new org.apache.thrift.meta_data.FieldMetaData("numVersions", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.ATTRIBUTES, new org.apache.thrift.meta_data.FieldMetaData("attributes", org.apache.thrift.TFieldRequirementType.DEFAULT, + 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 , "Text"), + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text")))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getVer_args.class, metaDataMap); + } + + public getVer_args() { + } + + public getVer_args( + ByteBuffer tableName, + ByteBuffer row, + ByteBuffer column, + int numVersions, + Map attributes) + { + this(); + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(tableName); + this.row = org.apache.thrift.TBaseHelper.copyBinary(row); + this.column = org.apache.thrift.TBaseHelper.copyBinary(column); + this.numVersions = numVersions; + setNumVersionsIsSet(true); + this.attributes = attributes; + } + + /** + * Performs a deep copy on other. + */ + public getVer_args(getVer_args other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetTableName()) { + this.tableName = other.tableName; + } + if (other.isSetRow()) { + this.row = other.row; + } + if (other.isSetColumn()) { + this.column = other.column; + } + this.numVersions = other.numVersions; + if (other.isSetAttributes()) { + Map __this__attributes = new HashMap(other.attributes.size()); + for (Map.Entry other_element : other.attributes.entrySet()) { + + ByteBuffer other_element_key = other_element.getKey(); + ByteBuffer other_element_value = other_element.getValue(); + + ByteBuffer __this__attributes_copy_key = other_element_key; + + ByteBuffer __this__attributes_copy_value = other_element_value; + + __this__attributes.put(__this__attributes_copy_key, __this__attributes_copy_value); + } + this.attributes = __this__attributes; + } + } + + public getVer_args deepCopy() { + return new getVer_args(this); + } + + @Override + public void clear() { + this.tableName = null; + this.row = null; + this.column = null; + setNumVersionsIsSet(false); + this.numVersions = 0; + this.attributes = null; + } + + /** + * name of table + */ + public byte[] getTableName() { + setTableName(org.apache.thrift.TBaseHelper.rightSize(tableName)); + return tableName == null ? null : tableName.array(); + } + + public ByteBuffer bufferForTableName() { + return org.apache.thrift.TBaseHelper.copyBinary(tableName); + } + + /** + * name of table + */ + public getVer_args setTableName(byte[] tableName) { + this.tableName = tableName == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(tableName, tableName.length)); + return this; + } + + public getVer_args setTableName(ByteBuffer tableName) { + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(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; + } + } + + /** + * row key + */ + public byte[] getRow() { + setRow(org.apache.thrift.TBaseHelper.rightSize(row)); + return row == null ? null : row.array(); + } + + public ByteBuffer bufferForRow() { + return org.apache.thrift.TBaseHelper.copyBinary(row); + } + + /** + * row key + */ + public getVer_args setRow(byte[] row) { + this.row = row == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(row, row.length)); + return this; + } + + public getVer_args setRow(ByteBuffer row) { + this.row = org.apache.thrift.TBaseHelper.copyBinary(row); + return this; + } + + public void unsetRow() { + this.row = null; + } + + /** Returns true if field row is set (has been assigned a value) and false otherwise */ + public boolean isSetRow() { + return this.row != null; + } + + public void setRowIsSet(boolean value) { + if (!value) { + this.row = null; + } + } + + /** + * column name + */ + public byte[] getColumn() { + setColumn(org.apache.thrift.TBaseHelper.rightSize(column)); + return column == null ? null : column.array(); + } + + public ByteBuffer bufferForColumn() { + return org.apache.thrift.TBaseHelper.copyBinary(column); + } + + /** + * column name + */ + public getVer_args setColumn(byte[] column) { + this.column = column == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(column, column.length)); + return this; + } + + public getVer_args setColumn(ByteBuffer column) { + this.column = org.apache.thrift.TBaseHelper.copyBinary(column); + return this; + } + + public void unsetColumn() { + this.column = null; + } + + /** Returns true if field column is set (has been assigned a value) and false otherwise */ + public boolean isSetColumn() { + return this.column != null; + } + + public void setColumnIsSet(boolean value) { + if (!value) { + this.column = null; + } + } + + /** + * number of versions to retrieve + */ + public int getNumVersions() { + return this.numVersions; + } + + /** + * number of versions to retrieve + */ + public getVer_args setNumVersions(int numVersions) { + this.numVersions = numVersions; + setNumVersionsIsSet(true); + return this; + } + + public void unsetNumVersions() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __NUMVERSIONS_ISSET_ID); + } + + /** Returns true if field numVersions is set (has been assigned a value) and false otherwise */ + public boolean isSetNumVersions() { + return EncodingUtils.testBit(__isset_bitfield, __NUMVERSIONS_ISSET_ID); + } + + public void setNumVersionsIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __NUMVERSIONS_ISSET_ID, value); + } + + 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(); + } + this.attributes.put(key, val); + } + + /** + * Get attributes + */ + public Map getAttributes() { + return this.attributes; + } + + /** + * Get attributes + */ + public getVer_args setAttributes(Map 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; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case TABLE_NAME: + if (value == null) { + unsetTableName(); + } else { + setTableName((ByteBuffer)value); + } + break; + + case ROW: + if (value == null) { + unsetRow(); + } else { + setRow((ByteBuffer)value); + } + break; + + case COLUMN: + if (value == null) { + unsetColumn(); + } else { + setColumn((ByteBuffer)value); + } + break; + + case NUM_VERSIONS: + if (value == null) { + unsetNumVersions(); + } else { + setNumVersions((Integer)value); + } + break; + + case ATTRIBUTES: + if (value == null) { + unsetAttributes(); + } else { + setAttributes((Map)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case TABLE_NAME: + return getTableName(); + + case ROW: + return getRow(); + + case COLUMN: + return getColumn(); + + case NUM_VERSIONS: + return getNumVersions(); + + case ATTRIBUTES: + return getAttributes(); + + } + 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 ROW: + return isSetRow(); + case COLUMN: + return isSetColumn(); + case NUM_VERSIONS: + return isSetNumVersions(); + case ATTRIBUTES: + return isSetAttributes(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getVer_args) + return this.equals((getVer_args)that); + return false; + } + + public boolean equals(getVer_args 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_row = true && this.isSetRow(); + boolean that_present_row = true && that.isSetRow(); + if (this_present_row || that_present_row) { + if (!(this_present_row && that_present_row)) + return false; + if (!this.row.equals(that.row)) + return false; + } + + boolean this_present_column = true && this.isSetColumn(); + boolean that_present_column = true && that.isSetColumn(); + if (this_present_column || that_present_column) { + if (!(this_present_column && that_present_column)) + return false; + if (!this.column.equals(that.column)) + return false; + } + + boolean this_present_numVersions = true; + boolean that_present_numVersions = true; + if (this_present_numVersions || that_present_numVersions) { + if (!(this_present_numVersions && that_present_numVersions)) + return false; + if (this.numVersions != that.numVersions) + 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; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_tableName = true && (isSetTableName()); + list.add(present_tableName); + if (present_tableName) + list.add(tableName); + + boolean present_row = true && (isSetRow()); + list.add(present_row); + if (present_row) + list.add(row); + + boolean present_column = true && (isSetColumn()); + list.add(present_column); + if (present_column) + list.add(column); + + boolean present_numVersions = true; + list.add(present_numVersions); + if (present_numVersions) + list.add(numVersions); + + boolean present_attributes = true && (isSetAttributes()); + list.add(present_attributes); + if (present_attributes) + list.add(attributes); + + return list.hashCode(); + } + + @Override + public int compareTo(getVer_args 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(isSetRow()).compareTo(other.isSetRow()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRow()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.row, other.row); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetColumn()).compareTo(other.isSetColumn()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetColumn()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.column, other.column); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetNumVersions()).compareTo(other.isSetNumVersions()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetNumVersions()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.numVersions, other.numVersions); + 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; + } + } + 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("getVer_args("); + boolean first = true; + + sb.append("tableName:"); + if (this.tableName == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.tableName, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("row:"); + if (this.row == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.row, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("column:"); + if (this.column == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.column, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("numVersions:"); + sb.append(this.numVersions); + first = false; + if (!first) sb.append(", "); + sb.append("attributes:"); + if (this.attributes == null) { + sb.append("null"); + } else { + sb.append(this.attributes); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 { + // 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); + } + } + + private static class getVer_argsStandardSchemeFactory implements SchemeFactory { + public getVer_argsStandardScheme getScheme() { + return new getVer_argsStandardScheme(); + } + } + + private static class getVer_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getVer_args 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.STRING) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // ROW + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.row = iprot.readBinary(); + struct.setRowIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // COLUMN + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.column = iprot.readBinary(); + struct.setColumnIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // NUM_VERSIONS + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.numVersions = iprot.readI32(); + struct.setNumVersionsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // ATTRIBUTES + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map102 = iprot.readMapBegin(); + struct.attributes = new HashMap(2*_map102.size); + ByteBuffer _key103; + ByteBuffer _val104; + for (int _i105 = 0; _i105 < _map102.size; ++_i105) + { + _key103 = iprot.readBinary(); + _val104 = iprot.readBinary(); + struct.attributes.put(_key103, _val104); + } + iprot.readMapEnd(); + } + struct.setAttributesIsSet(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, getVer_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.tableName != null) { + oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC); + oprot.writeBinary(struct.tableName); + oprot.writeFieldEnd(); + } + if (struct.row != null) { + oprot.writeFieldBegin(ROW_FIELD_DESC); + oprot.writeBinary(struct.row); + oprot.writeFieldEnd(); + } + if (struct.column != null) { + oprot.writeFieldBegin(COLUMN_FIELD_DESC); + oprot.writeBinary(struct.column); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(NUM_VERSIONS_FIELD_DESC); + oprot.writeI32(struct.numVersions); + oprot.writeFieldEnd(); + if (struct.attributes != null) { + 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 _iter106 : struct.attributes.entrySet()) + { + oprot.writeBinary(_iter106.getKey()); + oprot.writeBinary(_iter106.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getVer_argsTupleSchemeFactory implements SchemeFactory { + public getVer_argsTupleScheme getScheme() { + return new getVer_argsTupleScheme(); + } + } + + private static class getVer_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getVer_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetTableName()) { + optionals.set(0); + } + if (struct.isSetRow()) { + optionals.set(1); + } + if (struct.isSetColumn()) { + optionals.set(2); + } + if (struct.isSetNumVersions()) { + optionals.set(3); + } + if (struct.isSetAttributes()) { + optionals.set(4); + } + oprot.writeBitSet(optionals, 5); + if (struct.isSetTableName()) { + oprot.writeBinary(struct.tableName); + } + if (struct.isSetRow()) { + oprot.writeBinary(struct.row); + } + if (struct.isSetColumn()) { + oprot.writeBinary(struct.column); + } + if (struct.isSetNumVersions()) { + oprot.writeI32(struct.numVersions); + } + if (struct.isSetAttributes()) { + { + oprot.writeI32(struct.attributes.size()); + for (Map.Entry _iter107 : struct.attributes.entrySet()) + { + oprot.writeBinary(_iter107.getKey()); + oprot.writeBinary(_iter107.getValue()); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getVer_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(5); + if (incoming.get(0)) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(true); + } + if (incoming.get(1)) { + struct.row = iprot.readBinary(); + struct.setRowIsSet(true); + } + if (incoming.get(2)) { + struct.column = iprot.readBinary(); + struct.setColumnIsSet(true); + } + if (incoming.get(3)) { + struct.numVersions = iprot.readI32(); + struct.setNumVersionsIsSet(true); + } + if (incoming.get(4)) { + { + org.apache.thrift.protocol.TMap _map108 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.attributes = new HashMap(2*_map108.size); + ByteBuffer _key109; + ByteBuffer _val110; + for (int _i111 = 0; _i111 < _map108.size; ++_i111) + { + _key109 = iprot.readBinary(); + _val110 = iprot.readBinary(); + struct.attributes.put(_key109, _val110); + } + } + struct.setAttributesIsSet(true); + } + } + } + + } + + public static class getVer_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getVer_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0); + private static final org.apache.thrift.protocol.TField IO_FIELD_DESC = new org.apache.thrift.protocol.TField("io", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getVer_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getVer_resultTupleSchemeFactory()); + } + + public List success; // required + public IOError io; // 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 { + SUCCESS((short)0, "success"), + IO((short)1, "io"); + + private static final Map byName = new HashMap(); + + 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 0: // SUCCESS + return SUCCESS; + case 1: // IO + return IO; + 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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + 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, TCell.class)))); + tmpMap.put(_Fields.IO, new org.apache.thrift.meta_data.FieldMetaData("io", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getVer_result.class, metaDataMap); + } + + public getVer_result() { + } + + public getVer_result( + List success, + IOError io) + { + this(); + this.success = success; + this.io = io; + } + + /** + * Performs a deep copy on other. + */ + public getVer_result(getVer_result other) { + if (other.isSetSuccess()) { + List __this__success = new ArrayList(other.success.size()); + for (TCell other_element : other.success) { + __this__success.add(new TCell(other_element)); + } + this.success = __this__success; + } + if (other.isSetIo()) { + this.io = new IOError(other.io); + } + } + + public getVer_result deepCopy() { + return new getVer_result(this); + } + + @Override + public void clear() { + this.success = null; + this.io = null; + } + + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + public java.util.Iterator getSuccessIterator() { + return (this.success == null) ? null : this.success.iterator(); + } + + public void addToSuccess(TCell elem) { + if (this.success == null) { + this.success = new ArrayList(); + } + this.success.add(elem); + } + + public List getSuccess() { + return this.success; + } + + public getVer_result setSuccess(List success) { + this.success = success; + return this; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public IOError getIo() { + return this.io; + } + + public getVer_result setIo(IOError io) { + this.io = io; + return this; + } + + public void unsetIo() { + this.io = null; + } + + /** Returns true if field io is set (has been assigned a value) and false otherwise */ + public boolean isSetIo() { + return this.io != null; + } + + public void setIoIsSet(boolean value) { + if (!value) { + this.io = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((List)value); + } + break; + + case IO: + if (value == null) { + unsetIo(); + } else { + setIo((IOError)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + case IO: + return getIo(); + + } + 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 SUCCESS: + return isSetSuccess(); + case IO: + return isSetIo(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getVer_result) + return this.equals((getVer_result)that); + return false; + } + + public boolean equals(getVer_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + boolean this_present_io = true && this.isSetIo(); + boolean that_present_io = true && that.isSetIo(); + if (this_present_io || that_present_io) { + if (!(this_present_io && that_present_io)) + return false; + if (!this.io.equals(that.io)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + boolean present_io = true && (isSetIo()); + list.add(present_io); + if (present_io) + list.add(io); + + return list.hashCode(); + } + + @Override + public int compareTo(getVer_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIo()).compareTo(other.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, other.io); + 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("getVer_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + if (!first) sb.append(", "); + sb.append("io:"); + if (this.io == null) { + sb.append("null"); + } else { + sb.append(this.io); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 getVer_resultStandardSchemeFactory implements SchemeFactory { + public getVer_resultStandardScheme getScheme() { + return new getVer_resultStandardScheme(); + } + } + + private static class getVer_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getVer_result 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 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list112 = iprot.readListBegin(); + struct.success = new ArrayList(_list112.size); + TCell _elem113; + for (int _i114 = 0; _i114 < _list112.size; ++_i114) + { + _elem113 = new TCell(); + _elem113.read(iprot); + struct.success.add(_elem113); + } + iprot.readListEnd(); + } + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IO + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(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, getVer_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); + for (TCell _iter115 : struct.success) + { + _iter115.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.io != null) { + oprot.writeFieldBegin(IO_FIELD_DESC); + struct.io.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getVer_resultTupleSchemeFactory implements SchemeFactory { + public getVer_resultTupleScheme getScheme() { + return new getVer_resultTupleScheme(); + } + } + + private static class getVer_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getVer_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIo()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + { + oprot.writeI32(struct.success.size()); + for (TCell _iter116 : struct.success) + { + _iter116.write(oprot); + } + } + } + if (struct.isSetIo()) { + struct.io.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getVer_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list117 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new ArrayList(_list117.size); + TCell _elem118; + for (int _i119 = 0; _i119 < _list117.size; ++_i119) + { + _elem118 = new TCell(); + _elem118.read(iprot); + struct.success.add(_elem118); + } + } + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } + } + } + + } + + public static class getVerTs_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getVerTs_args"); + + private static final org.apache.thrift.protocol.TField TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tableName", org.apache.thrift.protocol.TType.STRING, (short)1); + 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)2); + private static final org.apache.thrift.protocol.TField COLUMN_FIELD_DESC = new org.apache.thrift.protocol.TField("column", 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 NUM_VERSIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("numVersions", org.apache.thrift.protocol.TType.I32, (short)5); + 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)6); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getVerTs_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getVerTs_argsTupleSchemeFactory()); + } + + /** + * name of table + */ + public ByteBuffer tableName; // required + /** + * row key + */ + public ByteBuffer row; // required + /** + * column name + */ + public ByteBuffer column; // required + /** + * timestamp + */ + public long timestamp; // required + /** + * number of versions to retrieve + */ + public int numVersions; // required + /** + * Get attributes + */ + public Map attributes; // 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 { + /** + * name of table + */ + TABLE_NAME((short)1, "tableName"), + /** + * row key + */ + ROW((short)2, "row"), + /** + * column name + */ + COLUMN((short)3, "column"), + /** + * timestamp + */ + TIMESTAMP((short)4, "timestamp"), + /** + * number of versions to retrieve + */ + NUM_VERSIONS((short)5, "numVersions"), + /** + * Get attributes + */ + ATTRIBUTES((short)6, "attributes"); + + private static final Map byName = new HashMap(); + + 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: // ROW + return ROW; + case 3: // COLUMN + return COLUMN; + case 4: // TIMESTAMP + return TIMESTAMP; + case 5: // NUM_VERSIONS + return NUM_VERSIONS; + case 6: // ATTRIBUTES + return ATTRIBUTES; + 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 int __TIMESTAMP_ISSET_ID = 0; + private static final int __NUMVERSIONS_ISSET_ID = 1; + private byte __isset_bitfield = 0; + 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.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.ROW, new org.apache.thrift.meta_data.FieldMetaData("row", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.COLUMN, new org.apache.thrift.meta_data.FieldMetaData("column", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("timestamp", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.NUM_VERSIONS, new org.apache.thrift.meta_data.FieldMetaData("numVersions", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.ATTRIBUTES, new org.apache.thrift.meta_data.FieldMetaData("attributes", org.apache.thrift.TFieldRequirementType.DEFAULT, + 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 , "Text"), + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text")))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getVerTs_args.class, metaDataMap); + } + + public getVerTs_args() { + } + + public getVerTs_args( + ByteBuffer tableName, + ByteBuffer row, + ByteBuffer column, + long timestamp, + int numVersions, + Map attributes) + { + this(); + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(tableName); + this.row = org.apache.thrift.TBaseHelper.copyBinary(row); + this.column = org.apache.thrift.TBaseHelper.copyBinary(column); + this.timestamp = timestamp; + setTimestampIsSet(true); + this.numVersions = numVersions; + setNumVersionsIsSet(true); + this.attributes = attributes; + } + + /** + * Performs a deep copy on other. + */ + public getVerTs_args(getVerTs_args other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetTableName()) { + this.tableName = other.tableName; + } + if (other.isSetRow()) { + this.row = other.row; + } + if (other.isSetColumn()) { + this.column = other.column; + } + this.timestamp = other.timestamp; + this.numVersions = other.numVersions; + if (other.isSetAttributes()) { + Map __this__attributes = new HashMap(other.attributes.size()); + for (Map.Entry other_element : other.attributes.entrySet()) { + + ByteBuffer other_element_key = other_element.getKey(); + ByteBuffer other_element_value = other_element.getValue(); + + ByteBuffer __this__attributes_copy_key = other_element_key; + + ByteBuffer __this__attributes_copy_value = other_element_value; + + __this__attributes.put(__this__attributes_copy_key, __this__attributes_copy_value); + } + this.attributes = __this__attributes; + } + } + + public getVerTs_args deepCopy() { + return new getVerTs_args(this); + } + + @Override + public void clear() { + this.tableName = null; + this.row = null; + this.column = null; + setTimestampIsSet(false); + this.timestamp = 0; + setNumVersionsIsSet(false); + this.numVersions = 0; + this.attributes = null; + } + + /** + * name of table + */ + public byte[] getTableName() { + setTableName(org.apache.thrift.TBaseHelper.rightSize(tableName)); + return tableName == null ? null : tableName.array(); + } + + public ByteBuffer bufferForTableName() { + return org.apache.thrift.TBaseHelper.copyBinary(tableName); + } + + /** + * name of table + */ + public getVerTs_args setTableName(byte[] tableName) { + this.tableName = tableName == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(tableName, tableName.length)); + return this; + } + + public getVerTs_args setTableName(ByteBuffer tableName) { + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(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; + } + } + + /** + * row key + */ + public byte[] getRow() { + setRow(org.apache.thrift.TBaseHelper.rightSize(row)); + return row == null ? null : row.array(); + } + + public ByteBuffer bufferForRow() { + return org.apache.thrift.TBaseHelper.copyBinary(row); + } + + /** + * row key + */ + public getVerTs_args setRow(byte[] row) { + this.row = row == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(row, row.length)); + return this; + } + + public getVerTs_args setRow(ByteBuffer row) { + this.row = org.apache.thrift.TBaseHelper.copyBinary(row); + return this; + } + + public void unsetRow() { + this.row = null; + } + + /** Returns true if field row is set (has been assigned a value) and false otherwise */ + public boolean isSetRow() { + return this.row != null; + } + + public void setRowIsSet(boolean value) { + if (!value) { + this.row = null; + } + } + + /** + * column name + */ + public byte[] getColumn() { + setColumn(org.apache.thrift.TBaseHelper.rightSize(column)); + return column == null ? null : column.array(); + } + + public ByteBuffer bufferForColumn() { + return org.apache.thrift.TBaseHelper.copyBinary(column); + } + + /** + * column name + */ + public getVerTs_args setColumn(byte[] column) { + this.column = column == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(column, column.length)); + return this; + } + + public getVerTs_args setColumn(ByteBuffer column) { + this.column = org.apache.thrift.TBaseHelper.copyBinary(column); + return this; + } + + public void unsetColumn() { + this.column = null; + } + + /** Returns true if field column is set (has been assigned a value) and false otherwise */ + public boolean isSetColumn() { + return this.column != null; + } + + public void setColumnIsSet(boolean value) { + if (!value) { + this.column = null; + } + } + + /** + * timestamp + */ + public long getTimestamp() { + return this.timestamp; + } + + /** + * timestamp + */ + public getVerTs_args setTimestamp(long timestamp) { + this.timestamp = timestamp; + setTimestampIsSet(true); + return this; + } + + public void unsetTimestamp() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); + } + + /** Returns true if field timestamp is set (has been assigned a value) and false otherwise */ + public boolean isSetTimestamp() { + return EncodingUtils.testBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); + } + + public void setTimestampIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TIMESTAMP_ISSET_ID, value); + } + + /** + * number of versions to retrieve + */ + public int getNumVersions() { + return this.numVersions; + } + + /** + * number of versions to retrieve + */ + public getVerTs_args setNumVersions(int numVersions) { + this.numVersions = numVersions; + setNumVersionsIsSet(true); + return this; + } + + public void unsetNumVersions() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __NUMVERSIONS_ISSET_ID); + } + + /** Returns true if field numVersions is set (has been assigned a value) and false otherwise */ + public boolean isSetNumVersions() { + return EncodingUtils.testBit(__isset_bitfield, __NUMVERSIONS_ISSET_ID); + } + + public void setNumVersionsIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __NUMVERSIONS_ISSET_ID, value); + } + + 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(); + } + this.attributes.put(key, val); + } + + /** + * Get attributes + */ + public Map getAttributes() { + return this.attributes; + } + + /** + * Get attributes + */ + public getVerTs_args setAttributes(Map 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; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case TABLE_NAME: + if (value == null) { + unsetTableName(); + } else { + setTableName((ByteBuffer)value); + } + break; + + case ROW: + if (value == null) { + unsetRow(); + } else { + setRow((ByteBuffer)value); + } + break; + + case COLUMN: + if (value == null) { + unsetColumn(); + } else { + setColumn((ByteBuffer)value); + } + break; + + case TIMESTAMP: + if (value == null) { + unsetTimestamp(); + } else { + setTimestamp((Long)value); + } + break; + + case NUM_VERSIONS: + if (value == null) { + unsetNumVersions(); + } else { + setNumVersions((Integer)value); + } + break; + + case ATTRIBUTES: + if (value == null) { + unsetAttributes(); + } else { + setAttributes((Map)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case TABLE_NAME: + return getTableName(); + + case ROW: + return getRow(); + + case COLUMN: + return getColumn(); + + case TIMESTAMP: + return getTimestamp(); + + case NUM_VERSIONS: + return getNumVersions(); + + case ATTRIBUTES: + return getAttributes(); + + } + 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 ROW: + return isSetRow(); + case COLUMN: + return isSetColumn(); + case TIMESTAMP: + return isSetTimestamp(); + case NUM_VERSIONS: + return isSetNumVersions(); + case ATTRIBUTES: + return isSetAttributes(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getVerTs_args) + return this.equals((getVerTs_args)that); + return false; + } + + public boolean equals(getVerTs_args 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_row = true && this.isSetRow(); + boolean that_present_row = true && that.isSetRow(); + if (this_present_row || that_present_row) { + if (!(this_present_row && that_present_row)) + return false; + if (!this.row.equals(that.row)) + return false; + } + + boolean this_present_column = true && this.isSetColumn(); + boolean that_present_column = true && that.isSetColumn(); + if (this_present_column || that_present_column) { + if (!(this_present_column && that_present_column)) + return false; + if (!this.column.equals(that.column)) + return false; + } + + boolean this_present_timestamp = true; + boolean that_present_timestamp = true; + if (this_present_timestamp || that_present_timestamp) { + if (!(this_present_timestamp && that_present_timestamp)) + return false; + if (this.timestamp != that.timestamp) + return false; + } + + boolean this_present_numVersions = true; + boolean that_present_numVersions = true; + if (this_present_numVersions || that_present_numVersions) { + if (!(this_present_numVersions && that_present_numVersions)) + return false; + if (this.numVersions != that.numVersions) + 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; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_tableName = true && (isSetTableName()); + list.add(present_tableName); + if (present_tableName) + list.add(tableName); + + boolean present_row = true && (isSetRow()); + list.add(present_row); + if (present_row) + list.add(row); + + boolean present_column = true && (isSetColumn()); + list.add(present_column); + if (present_column) + list.add(column); + + boolean present_timestamp = true; + list.add(present_timestamp); + if (present_timestamp) + list.add(timestamp); + + boolean present_numVersions = true; + list.add(present_numVersions); + if (present_numVersions) + list.add(numVersions); + + boolean present_attributes = true && (isSetAttributes()); + list.add(present_attributes); + if (present_attributes) + list.add(attributes); + + return list.hashCode(); + } + + @Override + public int compareTo(getVerTs_args 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(isSetRow()).compareTo(other.isSetRow()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRow()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.row, other.row); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetColumn()).compareTo(other.isSetColumn()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetColumn()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.column, other.column); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(other.isSetTimestamp()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTimestamp()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timestamp, other.timestamp); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetNumVersions()).compareTo(other.isSetNumVersions()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetNumVersions()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.numVersions, other.numVersions); + 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; + } + } + 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("getVerTs_args("); + boolean first = true; + + sb.append("tableName:"); + if (this.tableName == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.tableName, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("row:"); + if (this.row == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.row, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("column:"); + if (this.column == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.column, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("timestamp:"); + sb.append(this.timestamp); + first = false; + if (!first) sb.append(", "); + sb.append("numVersions:"); + sb.append(this.numVersions); + first = false; + if (!first) sb.append(", "); + sb.append("attributes:"); + if (this.attributes == null) { + sb.append("null"); + } else { + sb.append(this.attributes); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 { + // 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); + } + } + + private static class getVerTs_argsStandardSchemeFactory implements SchemeFactory { + public getVerTs_argsStandardScheme getScheme() { + return new getVerTs_argsStandardScheme(); + } + } + + private static class getVerTs_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getVerTs_args 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.STRING) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // ROW + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.row = iprot.readBinary(); + struct.setRowIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // COLUMN + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.column = iprot.readBinary(); + struct.setColumnIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // TIMESTAMP + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.timestamp = iprot.readI64(); + struct.setTimestampIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // NUM_VERSIONS + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.numVersions = iprot.readI32(); + struct.setNumVersionsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 6: // ATTRIBUTES + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map120 = iprot.readMapBegin(); + struct.attributes = new HashMap(2*_map120.size); + ByteBuffer _key121; + ByteBuffer _val122; + for (int _i123 = 0; _i123 < _map120.size; ++_i123) + { + _key121 = iprot.readBinary(); + _val122 = iprot.readBinary(); + struct.attributes.put(_key121, _val122); + } + iprot.readMapEnd(); + } + struct.setAttributesIsSet(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, getVerTs_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.tableName != null) { + oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC); + oprot.writeBinary(struct.tableName); + oprot.writeFieldEnd(); + } + if (struct.row != null) { + oprot.writeFieldBegin(ROW_FIELD_DESC); + oprot.writeBinary(struct.row); + oprot.writeFieldEnd(); + } + if (struct.column != null) { + oprot.writeFieldBegin(COLUMN_FIELD_DESC); + oprot.writeBinary(struct.column); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC); + oprot.writeI64(struct.timestamp); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(NUM_VERSIONS_FIELD_DESC); + oprot.writeI32(struct.numVersions); + oprot.writeFieldEnd(); + if (struct.attributes != null) { + 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 _iter124 : struct.attributes.entrySet()) + { + oprot.writeBinary(_iter124.getKey()); + oprot.writeBinary(_iter124.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getVerTs_argsTupleSchemeFactory implements SchemeFactory { + public getVerTs_argsTupleScheme getScheme() { + return new getVerTs_argsTupleScheme(); + } + } + + private static class getVerTs_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getVerTs_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetTableName()) { + optionals.set(0); + } + if (struct.isSetRow()) { + optionals.set(1); + } + if (struct.isSetColumn()) { + optionals.set(2); + } + if (struct.isSetTimestamp()) { + optionals.set(3); + } + if (struct.isSetNumVersions()) { + optionals.set(4); + } + if (struct.isSetAttributes()) { + optionals.set(5); + } + oprot.writeBitSet(optionals, 6); + if (struct.isSetTableName()) { + oprot.writeBinary(struct.tableName); + } + if (struct.isSetRow()) { + oprot.writeBinary(struct.row); + } + if (struct.isSetColumn()) { + oprot.writeBinary(struct.column); + } + if (struct.isSetTimestamp()) { + oprot.writeI64(struct.timestamp); + } + if (struct.isSetNumVersions()) { + oprot.writeI32(struct.numVersions); + } + if (struct.isSetAttributes()) { + { + oprot.writeI32(struct.attributes.size()); + for (Map.Entry _iter125 : struct.attributes.entrySet()) + { + oprot.writeBinary(_iter125.getKey()); + oprot.writeBinary(_iter125.getValue()); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getVerTs_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(6); + if (incoming.get(0)) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(true); + } + if (incoming.get(1)) { + struct.row = iprot.readBinary(); + struct.setRowIsSet(true); + } + if (incoming.get(2)) { + struct.column = iprot.readBinary(); + struct.setColumnIsSet(true); + } + if (incoming.get(3)) { + struct.timestamp = iprot.readI64(); + struct.setTimestampIsSet(true); + } + if (incoming.get(4)) { + struct.numVersions = iprot.readI32(); + struct.setNumVersionsIsSet(true); + } + if (incoming.get(5)) { + { + org.apache.thrift.protocol.TMap _map126 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.attributes = new HashMap(2*_map126.size); + ByteBuffer _key127; + ByteBuffer _val128; + for (int _i129 = 0; _i129 < _map126.size; ++_i129) + { + _key127 = iprot.readBinary(); + _val128 = iprot.readBinary(); + struct.attributes.put(_key127, _val128); + } + } + struct.setAttributesIsSet(true); + } + } + } + + } + + public static class getVerTs_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getVerTs_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0); + private static final org.apache.thrift.protocol.TField IO_FIELD_DESC = new org.apache.thrift.protocol.TField("io", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getVerTs_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getVerTs_resultTupleSchemeFactory()); + } + + public List success; // required + public IOError io; // 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 { + SUCCESS((short)0, "success"), + IO((short)1, "io"); + + private static final Map byName = new HashMap(); + + 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 0: // SUCCESS + return SUCCESS; + case 1: // IO + return IO; + 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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + 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, TCell.class)))); + tmpMap.put(_Fields.IO, new org.apache.thrift.meta_data.FieldMetaData("io", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getVerTs_result.class, metaDataMap); + } + + public getVerTs_result() { + } + + public getVerTs_result( + List success, + IOError io) + { + this(); + this.success = success; + this.io = io; + } + + /** + * Performs a deep copy on other. + */ + public getVerTs_result(getVerTs_result other) { + if (other.isSetSuccess()) { + List __this__success = new ArrayList(other.success.size()); + for (TCell other_element : other.success) { + __this__success.add(new TCell(other_element)); + } + this.success = __this__success; + } + if (other.isSetIo()) { + this.io = new IOError(other.io); + } + } + + public getVerTs_result deepCopy() { + return new getVerTs_result(this); + } + + @Override + public void clear() { + this.success = null; + this.io = null; + } + + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + public java.util.Iterator getSuccessIterator() { + return (this.success == null) ? null : this.success.iterator(); + } + + public void addToSuccess(TCell elem) { + if (this.success == null) { + this.success = new ArrayList(); + } + this.success.add(elem); + } + + public List getSuccess() { + return this.success; + } + + public getVerTs_result setSuccess(List success) { + this.success = success; + return this; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public IOError getIo() { + return this.io; + } + + public getVerTs_result setIo(IOError io) { + this.io = io; + return this; + } + + public void unsetIo() { + this.io = null; + } + + /** Returns true if field io is set (has been assigned a value) and false otherwise */ + public boolean isSetIo() { + return this.io != null; + } + + public void setIoIsSet(boolean value) { + if (!value) { + this.io = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((List)value); + } + break; + + case IO: + if (value == null) { + unsetIo(); + } else { + setIo((IOError)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + case IO: + return getIo(); + + } + 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 SUCCESS: + return isSetSuccess(); + case IO: + return isSetIo(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getVerTs_result) + return this.equals((getVerTs_result)that); + return false; + } + + public boolean equals(getVerTs_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + boolean this_present_io = true && this.isSetIo(); + boolean that_present_io = true && that.isSetIo(); + if (this_present_io || that_present_io) { + if (!(this_present_io && that_present_io)) + return false; + if (!this.io.equals(that.io)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + boolean present_io = true && (isSetIo()); + list.add(present_io); + if (present_io) + list.add(io); + + return list.hashCode(); + } + + @Override + public int compareTo(getVerTs_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIo()).compareTo(other.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, other.io); + 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("getVerTs_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + if (!first) sb.append(", "); + sb.append("io:"); + if (this.io == null) { + sb.append("null"); + } else { + sb.append(this.io); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 getVerTs_resultStandardSchemeFactory implements SchemeFactory { + public getVerTs_resultStandardScheme getScheme() { + return new getVerTs_resultStandardScheme(); + } + } + + private static class getVerTs_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getVerTs_result 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 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list130 = iprot.readListBegin(); + struct.success = new ArrayList(_list130.size); + TCell _elem131; + for (int _i132 = 0; _i132 < _list130.size; ++_i132) + { + _elem131 = new TCell(); + _elem131.read(iprot); + struct.success.add(_elem131); + } + iprot.readListEnd(); + } + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IO + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(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, getVerTs_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); + for (TCell _iter133 : struct.success) + { + _iter133.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.io != null) { + oprot.writeFieldBegin(IO_FIELD_DESC); + struct.io.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getVerTs_resultTupleSchemeFactory implements SchemeFactory { + public getVerTs_resultTupleScheme getScheme() { + return new getVerTs_resultTupleScheme(); + } + } + + private static class getVerTs_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getVerTs_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIo()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + { + oprot.writeI32(struct.success.size()); + for (TCell _iter134 : struct.success) + { + _iter134.write(oprot); + } + } + } + if (struct.isSetIo()) { + struct.io.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getVerTs_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list135 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new ArrayList(_list135.size); + TCell _elem136; + for (int _i137 = 0; _i137 < _list135.size; ++_i137) + { + _elem136 = new TCell(); + _elem136.read(iprot); + struct.success.add(_elem136); + } + } + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } + } + } + + } + + public static class getRow_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getRow_args"); + + private static final org.apache.thrift.protocol.TField TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tableName", org.apache.thrift.protocol.TType.STRING, (short)1); + 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)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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getRow_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getRow_argsTupleSchemeFactory()); + } + + /** + * name of table + */ + public ByteBuffer tableName; // required + /** + * row key + */ + public ByteBuffer row; // required + /** + * Get attributes + */ + public Map attributes; // 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 { + /** + * name of table + */ + TABLE_NAME((short)1, "tableName"), + /** + * row key + */ + ROW((short)2, "row"), + /** + * Get attributes + */ + ATTRIBUTES((short)3, "attributes"); + + private static final Map byName = new HashMap(); + + 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: // ROW + return ROW; + case 3: // ATTRIBUTES + return ATTRIBUTES; + 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.TABLE_NAME, new org.apache.thrift.meta_data.FieldMetaData("tableName", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.ROW, new org.apache.thrift.meta_data.FieldMetaData("row", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.ATTRIBUTES, new org.apache.thrift.meta_data.FieldMetaData("attributes", org.apache.thrift.TFieldRequirementType.DEFAULT, + 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 , "Text"), + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text")))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRow_args.class, metaDataMap); + } + + public getRow_args() { + } + + public getRow_args( + ByteBuffer tableName, + ByteBuffer row, + Map attributes) + { + this(); + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(tableName); + this.row = org.apache.thrift.TBaseHelper.copyBinary(row); + this.attributes = attributes; + } + + /** + * Performs a deep copy on other. + */ + public getRow_args(getRow_args other) { + if (other.isSetTableName()) { + this.tableName = other.tableName; + } + if (other.isSetRow()) { + this.row = other.row; + } + if (other.isSetAttributes()) { + Map __this__attributes = new HashMap(other.attributes.size()); + for (Map.Entry other_element : other.attributes.entrySet()) { + + ByteBuffer other_element_key = other_element.getKey(); + ByteBuffer other_element_value = other_element.getValue(); + + ByteBuffer __this__attributes_copy_key = other_element_key; + + ByteBuffer __this__attributes_copy_value = other_element_value; + + __this__attributes.put(__this__attributes_copy_key, __this__attributes_copy_value); + } + this.attributes = __this__attributes; + } + } + + public getRow_args deepCopy() { + return new getRow_args(this); + } + + @Override + public void clear() { + this.tableName = null; + this.row = null; + this.attributes = null; + } + + /** + * name of table + */ + public byte[] getTableName() { + setTableName(org.apache.thrift.TBaseHelper.rightSize(tableName)); + return tableName == null ? null : tableName.array(); + } + + public ByteBuffer bufferForTableName() { + return org.apache.thrift.TBaseHelper.copyBinary(tableName); + } + + /** + * name of table + */ + public getRow_args setTableName(byte[] tableName) { + this.tableName = tableName == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(tableName, tableName.length)); + return this; + } + + public getRow_args setTableName(ByteBuffer tableName) { + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(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; + } + } + + /** + * row key + */ + public byte[] getRow() { + setRow(org.apache.thrift.TBaseHelper.rightSize(row)); + return row == null ? null : row.array(); + } + + public ByteBuffer bufferForRow() { + return org.apache.thrift.TBaseHelper.copyBinary(row); + } + + /** + * row key + */ + public getRow_args setRow(byte[] row) { + this.row = row == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(row, row.length)); + return this; + } + + public getRow_args setRow(ByteBuffer row) { + this.row = org.apache.thrift.TBaseHelper.copyBinary(row); + return this; + } + + public void unsetRow() { + this.row = null; + } + + /** Returns true if field row is set (has been assigned a value) and false otherwise */ + public boolean isSetRow() { + return this.row != null; + } + + public void setRowIsSet(boolean value) { + if (!value) { + this.row = 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(); + } + this.attributes.put(key, val); + } + + /** + * Get attributes + */ + public Map getAttributes() { + return this.attributes; + } + + /** + * Get attributes + */ + public getRow_args setAttributes(Map 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; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case TABLE_NAME: + if (value == null) { + unsetTableName(); + } else { + setTableName((ByteBuffer)value); + } + break; + + case ROW: + if (value == null) { + unsetRow(); + } else { + setRow((ByteBuffer)value); + } + break; + + case ATTRIBUTES: + if (value == null) { + unsetAttributes(); + } else { + setAttributes((Map)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case TABLE_NAME: + return getTableName(); + + case ROW: + return getRow(); + + case ATTRIBUTES: + return getAttributes(); + + } + 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 ROW: + return isSetRow(); + case ATTRIBUTES: + return isSetAttributes(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getRow_args) + return this.equals((getRow_args)that); + return false; + } + + public boolean equals(getRow_args 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_row = true && this.isSetRow(); + boolean that_present_row = true && that.isSetRow(); + if (this_present_row || that_present_row) { + if (!(this_present_row && that_present_row)) + return false; + if (!this.row.equals(that.row)) + 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; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_tableName = true && (isSetTableName()); + list.add(present_tableName); + if (present_tableName) + list.add(tableName); + + boolean present_row = true && (isSetRow()); + list.add(present_row); + if (present_row) + list.add(row); + + boolean present_attributes = true && (isSetAttributes()); + list.add(present_attributes); + if (present_attributes) + list.add(attributes); + + return list.hashCode(); + } + + @Override + public int compareTo(getRow_args 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(isSetRow()).compareTo(other.isSetRow()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRow()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.row, other.row); + 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; + } + } + 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("getRow_args("); + boolean first = true; + + sb.append("tableName:"); + if (this.tableName == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.tableName, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("row:"); + if (this.row == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.row, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("attributes:"); + if (this.attributes == null) { + sb.append("null"); + } else { + sb.append(this.attributes); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 getRow_argsStandardSchemeFactory implements SchemeFactory { + public getRow_argsStandardScheme getScheme() { + return new getRow_argsStandardScheme(); + } + } + + private static class getRow_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getRow_args 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.STRING) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // ROW + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.row = iprot.readBinary(); + struct.setRowIsSet(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 _map138 = iprot.readMapBegin(); + struct.attributes = new HashMap(2*_map138.size); + ByteBuffer _key139; + ByteBuffer _val140; + for (int _i141 = 0; _i141 < _map138.size; ++_i141) + { + _key139 = iprot.readBinary(); + _val140 = iprot.readBinary(); + struct.attributes.put(_key139, _val140); + } + iprot.readMapEnd(); + } + struct.setAttributesIsSet(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, getRow_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.tableName != null) { + oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC); + oprot.writeBinary(struct.tableName); + oprot.writeFieldEnd(); + } + if (struct.row != null) { + oprot.writeFieldBegin(ROW_FIELD_DESC); + oprot.writeBinary(struct.row); + oprot.writeFieldEnd(); + } + if (struct.attributes != null) { + 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 _iter142 : struct.attributes.entrySet()) + { + oprot.writeBinary(_iter142.getKey()); + oprot.writeBinary(_iter142.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getRow_argsTupleSchemeFactory implements SchemeFactory { + public getRow_argsTupleScheme getScheme() { + return new getRow_argsTupleScheme(); + } + } + + private static class getRow_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getRow_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetTableName()) { + optionals.set(0); + } + if (struct.isSetRow()) { + optionals.set(1); + } + if (struct.isSetAttributes()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetTableName()) { + oprot.writeBinary(struct.tableName); + } + if (struct.isSetRow()) { + oprot.writeBinary(struct.row); + } + if (struct.isSetAttributes()) { + { + oprot.writeI32(struct.attributes.size()); + for (Map.Entry _iter143 : struct.attributes.entrySet()) + { + oprot.writeBinary(_iter143.getKey()); + oprot.writeBinary(_iter143.getValue()); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getRow_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(true); + } + if (incoming.get(1)) { + struct.row = iprot.readBinary(); + struct.setRowIsSet(true); + } + if (incoming.get(2)) { + { + org.apache.thrift.protocol.TMap _map144 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.attributes = new HashMap(2*_map144.size); + ByteBuffer _key145; + ByteBuffer _val146; + for (int _i147 = 0; _i147 < _map144.size; ++_i147) + { + _key145 = iprot.readBinary(); + _val146 = iprot.readBinary(); + struct.attributes.put(_key145, _val146); + } + } + struct.setAttributesIsSet(true); + } + } + } + + } + + public static class getRow_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getRow_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0); + private static final org.apache.thrift.protocol.TField IO_FIELD_DESC = new org.apache.thrift.protocol.TField("io", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getRow_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getRow_resultTupleSchemeFactory()); + } + + public List success; // required + public IOError io; // 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 { + SUCCESS((short)0, "success"), + IO((short)1, "io"); + + private static final Map byName = new HashMap(); + + 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 0: // SUCCESS + return SUCCESS; + case 1: // IO + return IO; + 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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + 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, TRowResult.class)))); + tmpMap.put(_Fields.IO, new org.apache.thrift.meta_data.FieldMetaData("io", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRow_result.class, metaDataMap); + } + + public getRow_result() { + } + + public getRow_result( + List success, + IOError io) + { + this(); + this.success = success; + this.io = io; + } + + /** + * Performs a deep copy on other. + */ + public getRow_result(getRow_result other) { + if (other.isSetSuccess()) { + List __this__success = new ArrayList(other.success.size()); + for (TRowResult other_element : other.success) { + __this__success.add(new TRowResult(other_element)); + } + this.success = __this__success; + } + if (other.isSetIo()) { + this.io = new IOError(other.io); + } + } + + public getRow_result deepCopy() { + return new getRow_result(this); + } + + @Override + public void clear() { + this.success = null; + this.io = null; + } + + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + public java.util.Iterator getSuccessIterator() { + return (this.success == null) ? null : this.success.iterator(); + } + + public void addToSuccess(TRowResult elem) { + if (this.success == null) { + this.success = new ArrayList(); + } + this.success.add(elem); + } + + public List getSuccess() { + return this.success; + } + + public getRow_result setSuccess(List success) { + this.success = success; + return this; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public IOError getIo() { + return this.io; + } + + public getRow_result setIo(IOError io) { + this.io = io; + return this; + } + + public void unsetIo() { + this.io = null; + } + + /** Returns true if field io is set (has been assigned a value) and false otherwise */ + public boolean isSetIo() { + return this.io != null; + } + + public void setIoIsSet(boolean value) { + if (!value) { + this.io = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((List)value); + } + break; + + case IO: + if (value == null) { + unsetIo(); + } else { + setIo((IOError)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + case IO: + return getIo(); + + } + 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 SUCCESS: + return isSetSuccess(); + case IO: + return isSetIo(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getRow_result) + return this.equals((getRow_result)that); + return false; + } + + public boolean equals(getRow_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + boolean this_present_io = true && this.isSetIo(); + boolean that_present_io = true && that.isSetIo(); + if (this_present_io || that_present_io) { + if (!(this_present_io && that_present_io)) + return false; + if (!this.io.equals(that.io)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + boolean present_io = true && (isSetIo()); + list.add(present_io); + if (present_io) + list.add(io); + + return list.hashCode(); + } + + @Override + public int compareTo(getRow_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIo()).compareTo(other.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, other.io); + 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("getRow_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + if (!first) sb.append(", "); + sb.append("io:"); + if (this.io == null) { + sb.append("null"); + } else { + sb.append(this.io); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 getRow_resultStandardSchemeFactory implements SchemeFactory { + public getRow_resultStandardScheme getScheme() { + return new getRow_resultStandardScheme(); + } + } + + private static class getRow_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getRow_result 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 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list148 = iprot.readListBegin(); + struct.success = new ArrayList(_list148.size); + TRowResult _elem149; + for (int _i150 = 0; _i150 < _list148.size; ++_i150) + { + _elem149 = new TRowResult(); + _elem149.read(iprot); + struct.success.add(_elem149); + } + iprot.readListEnd(); + } + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IO + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(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, getRow_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); + for (TRowResult _iter151 : struct.success) + { + _iter151.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.io != null) { + oprot.writeFieldBegin(IO_FIELD_DESC); + struct.io.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getRow_resultTupleSchemeFactory implements SchemeFactory { + public getRow_resultTupleScheme getScheme() { + return new getRow_resultTupleScheme(); + } + } + + private static class getRow_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getRow_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIo()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + { + oprot.writeI32(struct.success.size()); + for (TRowResult _iter152 : struct.success) + { + _iter152.write(oprot); + } + } + } + if (struct.isSetIo()) { + struct.io.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getRow_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list153 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new ArrayList(_list153.size); + TRowResult _elem154; + for (int _i155 = 0; _i155 < _list153.size; ++_i155) + { + _elem154 = new TRowResult(); + _elem154.read(iprot); + struct.success.add(_elem154); + } + } + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } + } + } + + } + + public static class getRowWithColumns_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getRowWithColumns_args"); + + private static final org.apache.thrift.protocol.TField TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tableName", org.apache.thrift.protocol.TType.STRING, (short)1); + 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)2); + 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)3); + 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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getRowWithColumns_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getRowWithColumns_argsTupleSchemeFactory()); + } + + /** + * name of table + */ + public ByteBuffer tableName; // required + /** + * row key + */ + public ByteBuffer row; // required + /** + * List of columns to return, null for all columns + */ + public List columns; // required + /** + * Get attributes + */ + public Map attributes; // 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 { + /** + * name of table + */ + TABLE_NAME((short)1, "tableName"), + /** + * row key + */ + ROW((short)2, "row"), + /** + * List of columns to return, null for all columns + */ + COLUMNS((short)3, "columns"), + /** + * Get attributes + */ + ATTRIBUTES((short)4, "attributes"); + + private static final Map byName = new HashMap(); + + 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: // ROW + return ROW; + case 3: // COLUMNS + return COLUMNS; + case 4: // ATTRIBUTES + return ATTRIBUTES; + 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.TABLE_NAME, new org.apache.thrift.meta_data.FieldMetaData("tableName", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.ROW, new org.apache.thrift.meta_data.FieldMetaData("row", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.COLUMNS, new org.apache.thrift.meta_data.FieldMetaData("columns", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text")))); + tmpMap.put(_Fields.ATTRIBUTES, new org.apache.thrift.meta_data.FieldMetaData("attributes", org.apache.thrift.TFieldRequirementType.DEFAULT, + 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 , "Text"), + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text")))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRowWithColumns_args.class, metaDataMap); + } + + public getRowWithColumns_args() { + } + + public getRowWithColumns_args( + ByteBuffer tableName, + ByteBuffer row, + List columns, + Map attributes) + { + this(); + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(tableName); + this.row = org.apache.thrift.TBaseHelper.copyBinary(row); + this.columns = columns; + this.attributes = attributes; + } + + /** + * Performs a deep copy on other. + */ + public getRowWithColumns_args(getRowWithColumns_args other) { + if (other.isSetTableName()) { + this.tableName = other.tableName; + } + if (other.isSetRow()) { + this.row = other.row; + } + if (other.isSetColumns()) { + List __this__columns = new ArrayList(other.columns.size()); + for (ByteBuffer other_element : other.columns) { + __this__columns.add(other_element); + } + this.columns = __this__columns; + } + if (other.isSetAttributes()) { + Map __this__attributes = new HashMap(other.attributes.size()); + for (Map.Entry other_element : other.attributes.entrySet()) { + + ByteBuffer other_element_key = other_element.getKey(); + ByteBuffer other_element_value = other_element.getValue(); + + ByteBuffer __this__attributes_copy_key = other_element_key; + + ByteBuffer __this__attributes_copy_value = other_element_value; + + __this__attributes.put(__this__attributes_copy_key, __this__attributes_copy_value); + } + this.attributes = __this__attributes; + } + } + + public getRowWithColumns_args deepCopy() { + return new getRowWithColumns_args(this); + } + + @Override + public void clear() { + this.tableName = null; + this.row = null; + this.columns = null; + this.attributes = null; + } + + /** + * name of table + */ + public byte[] getTableName() { + setTableName(org.apache.thrift.TBaseHelper.rightSize(tableName)); + return tableName == null ? null : tableName.array(); + } + + public ByteBuffer bufferForTableName() { + return org.apache.thrift.TBaseHelper.copyBinary(tableName); + } + + /** + * name of table + */ + public getRowWithColumns_args setTableName(byte[] tableName) { + this.tableName = tableName == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(tableName, tableName.length)); + return this; + } + + public getRowWithColumns_args setTableName(ByteBuffer tableName) { + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(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; + } + } + + /** + * row key + */ + public byte[] getRow() { + setRow(org.apache.thrift.TBaseHelper.rightSize(row)); + return row == null ? null : row.array(); + } + + public ByteBuffer bufferForRow() { + return org.apache.thrift.TBaseHelper.copyBinary(row); + } + + /** + * row key + */ + public getRowWithColumns_args setRow(byte[] row) { + this.row = row == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(row, row.length)); + return this; + } + + public getRowWithColumns_args setRow(ByteBuffer row) { + this.row = org.apache.thrift.TBaseHelper.copyBinary(row); + return this; + } + + public void unsetRow() { + this.row = null; + } + + /** Returns true if field row is set (has been assigned a value) and false otherwise */ + public boolean isSetRow() { + return this.row != null; + } + + public void setRowIsSet(boolean value) { + if (!value) { + this.row = null; + } + } + + public int getColumnsSize() { + return (this.columns == null) ? 0 : this.columns.size(); + } + + public java.util.Iterator getColumnsIterator() { + return (this.columns == null) ? null : this.columns.iterator(); + } + + public void addToColumns(ByteBuffer elem) { + if (this.columns == null) { + this.columns = new ArrayList(); + } + this.columns.add(elem); + } + + /** + * List of columns to return, null for all columns + */ + public List getColumns() { + return this.columns; + } + + /** + * List of columns to return, null for all columns + */ + public getRowWithColumns_args setColumns(List 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(); + } + this.attributes.put(key, val); + } + + /** + * Get attributes + */ + public Map getAttributes() { + return this.attributes; + } + + /** + * Get attributes + */ + public getRowWithColumns_args setAttributes(Map 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; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case TABLE_NAME: + if (value == null) { + unsetTableName(); + } else { + setTableName((ByteBuffer)value); + } + break; + + case ROW: + if (value == null) { + unsetRow(); + } else { + setRow((ByteBuffer)value); + } + break; + + case COLUMNS: + if (value == null) { + unsetColumns(); + } else { + setColumns((List)value); + } + break; + + case ATTRIBUTES: + if (value == null) { + unsetAttributes(); + } else { + setAttributes((Map)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case TABLE_NAME: + return getTableName(); + + case ROW: + return getRow(); + + case COLUMNS: + return getColumns(); + + case ATTRIBUTES: + return getAttributes(); + + } + 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 ROW: + return isSetRow(); + case COLUMNS: + return isSetColumns(); + case ATTRIBUTES: + return isSetAttributes(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getRowWithColumns_args) + return this.equals((getRowWithColumns_args)that); + return false; + } + + public boolean equals(getRowWithColumns_args 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_row = true && this.isSetRow(); + boolean that_present_row = true && that.isSetRow(); + if (this_present_row || that_present_row) { + if (!(this_present_row && that_present_row)) + return false; + if (!this.row.equals(that.row)) + 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; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_tableName = true && (isSetTableName()); + list.add(present_tableName); + if (present_tableName) + list.add(tableName); + + boolean present_row = true && (isSetRow()); + list.add(present_row); + if (present_row) + list.add(row); + + 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); + + return list.hashCode(); + } + + @Override + public int compareTo(getRowWithColumns_args 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(isSetRow()).compareTo(other.isSetRow()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRow()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.row, other.row); + 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; + } + } + 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("getRowWithColumns_args("); + boolean first = true; + + sb.append("tableName:"); + if (this.tableName == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.tableName, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("row:"); + if (this.row == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.row, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("columns:"); + if (this.columns == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.columns, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("attributes:"); + if (this.attributes == null) { + sb.append("null"); + } else { + sb.append(this.attributes); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 getRowWithColumns_argsStandardSchemeFactory implements SchemeFactory { + public getRowWithColumns_argsStandardScheme getScheme() { + return new getRowWithColumns_argsStandardScheme(); + } + } + + private static class getRowWithColumns_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getRowWithColumns_args 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.STRING) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // ROW + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.row = iprot.readBinary(); + struct.setRowIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // COLUMNS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list156 = iprot.readListBegin(); + struct.columns = new ArrayList(_list156.size); + ByteBuffer _elem157; + for (int _i158 = 0; _i158 < _list156.size; ++_i158) + { + _elem157 = iprot.readBinary(); + struct.columns.add(_elem157); + } + iprot.readListEnd(); + } + struct.setColumnsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // ATTRIBUTES + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map159 = iprot.readMapBegin(); + struct.attributes = new HashMap(2*_map159.size); + ByteBuffer _key160; + ByteBuffer _val161; + for (int _i162 = 0; _i162 < _map159.size; ++_i162) + { + _key160 = iprot.readBinary(); + _val161 = iprot.readBinary(); + struct.attributes.put(_key160, _val161); + } + iprot.readMapEnd(); + } + struct.setAttributesIsSet(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, getRowWithColumns_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.tableName != null) { + oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC); + oprot.writeBinary(struct.tableName); + oprot.writeFieldEnd(); + } + if (struct.row != null) { + oprot.writeFieldBegin(ROW_FIELD_DESC); + oprot.writeBinary(struct.row); + oprot.writeFieldEnd(); + } + if (struct.columns != null) { + oprot.writeFieldBegin(COLUMNS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.columns.size())); + for (ByteBuffer _iter163 : struct.columns) + { + oprot.writeBinary(_iter163); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.attributes != null) { + 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 _iter164 : struct.attributes.entrySet()) + { + oprot.writeBinary(_iter164.getKey()); + oprot.writeBinary(_iter164.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getRowWithColumns_argsTupleSchemeFactory implements SchemeFactory { + public getRowWithColumns_argsTupleScheme getScheme() { + return new getRowWithColumns_argsTupleScheme(); + } + } + + private static class getRowWithColumns_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getRowWithColumns_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetTableName()) { + optionals.set(0); + } + if (struct.isSetRow()) { + optionals.set(1); + } + if (struct.isSetColumns()) { + optionals.set(2); + } + if (struct.isSetAttributes()) { + optionals.set(3); + } + oprot.writeBitSet(optionals, 4); + if (struct.isSetTableName()) { + oprot.writeBinary(struct.tableName); + } + if (struct.isSetRow()) { + oprot.writeBinary(struct.row); + } + if (struct.isSetColumns()) { + { + oprot.writeI32(struct.columns.size()); + for (ByteBuffer _iter165 : struct.columns) + { + oprot.writeBinary(_iter165); + } + } + } + if (struct.isSetAttributes()) { + { + oprot.writeI32(struct.attributes.size()); + for (Map.Entry _iter166 : struct.attributes.entrySet()) + { + oprot.writeBinary(_iter166.getKey()); + oprot.writeBinary(_iter166.getValue()); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getRowWithColumns_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(4); + if (incoming.get(0)) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(true); + } + if (incoming.get(1)) { + struct.row = iprot.readBinary(); + struct.setRowIsSet(true); + } + if (incoming.get(2)) { + { + org.apache.thrift.protocol.TList _list167 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.columns = new ArrayList(_list167.size); + ByteBuffer _elem168; + for (int _i169 = 0; _i169 < _list167.size; ++_i169) + { + _elem168 = iprot.readBinary(); + struct.columns.add(_elem168); + } + } + struct.setColumnsIsSet(true); + } + if (incoming.get(3)) { + { + org.apache.thrift.protocol.TMap _map170 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.attributes = new HashMap(2*_map170.size); + ByteBuffer _key171; + ByteBuffer _val172; + for (int _i173 = 0; _i173 < _map170.size; ++_i173) + { + _key171 = iprot.readBinary(); + _val172 = iprot.readBinary(); + struct.attributes.put(_key171, _val172); + } + } + struct.setAttributesIsSet(true); + } + } + } + + } + + public static class getRowWithColumns_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getRowWithColumns_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0); + private static final org.apache.thrift.protocol.TField IO_FIELD_DESC = new org.apache.thrift.protocol.TField("io", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getRowWithColumns_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getRowWithColumns_resultTupleSchemeFactory()); + } + + public List success; // required + public IOError io; // 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 { + SUCCESS((short)0, "success"), + IO((short)1, "io"); + + private static final Map byName = new HashMap(); + + 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 0: // SUCCESS + return SUCCESS; + case 1: // IO + return IO; + 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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + 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, TRowResult.class)))); + tmpMap.put(_Fields.IO, new org.apache.thrift.meta_data.FieldMetaData("io", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRowWithColumns_result.class, metaDataMap); + } + + public getRowWithColumns_result() { + } + + public getRowWithColumns_result( + List success, + IOError io) + { + this(); + this.success = success; + this.io = io; + } + + /** + * Performs a deep copy on other. + */ + public getRowWithColumns_result(getRowWithColumns_result other) { + if (other.isSetSuccess()) { + List __this__success = new ArrayList(other.success.size()); + for (TRowResult other_element : other.success) { + __this__success.add(new TRowResult(other_element)); + } + this.success = __this__success; + } + if (other.isSetIo()) { + this.io = new IOError(other.io); + } + } + + public getRowWithColumns_result deepCopy() { + return new getRowWithColumns_result(this); + } + + @Override + public void clear() { + this.success = null; + this.io = null; + } + + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + public java.util.Iterator getSuccessIterator() { + return (this.success == null) ? null : this.success.iterator(); + } + + public void addToSuccess(TRowResult elem) { + if (this.success == null) { + this.success = new ArrayList(); + } + this.success.add(elem); + } + + public List getSuccess() { + return this.success; + } + + public getRowWithColumns_result setSuccess(List success) { + this.success = success; + return this; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public IOError getIo() { + return this.io; + } + + public getRowWithColumns_result setIo(IOError io) { + this.io = io; + return this; + } + + public void unsetIo() { + this.io = null; + } + + /** Returns true if field io is set (has been assigned a value) and false otherwise */ + public boolean isSetIo() { + return this.io != null; + } + + public void setIoIsSet(boolean value) { + if (!value) { + this.io = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((List)value); + } + break; + + case IO: + if (value == null) { + unsetIo(); + } else { + setIo((IOError)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + case IO: + return getIo(); + + } + 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 SUCCESS: + return isSetSuccess(); + case IO: + return isSetIo(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getRowWithColumns_result) + return this.equals((getRowWithColumns_result)that); + return false; + } + + public boolean equals(getRowWithColumns_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + boolean this_present_io = true && this.isSetIo(); + boolean that_present_io = true && that.isSetIo(); + if (this_present_io || that_present_io) { + if (!(this_present_io && that_present_io)) + return false; + if (!this.io.equals(that.io)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + boolean present_io = true && (isSetIo()); + list.add(present_io); + if (present_io) + list.add(io); + + return list.hashCode(); + } + + @Override + public int compareTo(getRowWithColumns_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIo()).compareTo(other.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, other.io); + 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("getRowWithColumns_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + if (!first) sb.append(", "); + sb.append("io:"); + if (this.io == null) { + sb.append("null"); + } else { + sb.append(this.io); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 getRowWithColumns_resultStandardSchemeFactory implements SchemeFactory { + public getRowWithColumns_resultStandardScheme getScheme() { + return new getRowWithColumns_resultStandardScheme(); + } + } + + private static class getRowWithColumns_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getRowWithColumns_result 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 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list174 = iprot.readListBegin(); + struct.success = new ArrayList(_list174.size); + TRowResult _elem175; + for (int _i176 = 0; _i176 < _list174.size; ++_i176) + { + _elem175 = new TRowResult(); + _elem175.read(iprot); + struct.success.add(_elem175); + } + iprot.readListEnd(); + } + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IO + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(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, getRowWithColumns_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); + for (TRowResult _iter177 : struct.success) + { + _iter177.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.io != null) { + oprot.writeFieldBegin(IO_FIELD_DESC); + struct.io.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getRowWithColumns_resultTupleSchemeFactory implements SchemeFactory { + public getRowWithColumns_resultTupleScheme getScheme() { + return new getRowWithColumns_resultTupleScheme(); + } + } + + private static class getRowWithColumns_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getRowWithColumns_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIo()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + { + oprot.writeI32(struct.success.size()); + for (TRowResult _iter178 : struct.success) + { + _iter178.write(oprot); + } + } + } + if (struct.isSetIo()) { + struct.io.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getRowWithColumns_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list179 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new ArrayList(_list179.size); + TRowResult _elem180; + for (int _i181 = 0; _i181 < _list179.size; ++_i181) + { + _elem180 = new TRowResult(); + _elem180.read(iprot); + struct.success.add(_elem180); + } + } + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } + } + } + + } + + public static class getRowTs_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getRowTs_args"); + + private static final org.apache.thrift.protocol.TField TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tableName", org.apache.thrift.protocol.TType.STRING, (short)1); + 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)2); + 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)3); + 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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getRowTs_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getRowTs_argsTupleSchemeFactory()); + } + + /** + * name of the table + */ + public ByteBuffer tableName; // required + /** + * row key + */ + public ByteBuffer row; // required + /** + * timestamp + */ + public long timestamp; // required + /** + * Get attributes + */ + public Map attributes; // 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 { + /** + * name of the table + */ + TABLE_NAME((short)1, "tableName"), + /** + * row key + */ + ROW((short)2, "row"), + /** + * timestamp + */ + TIMESTAMP((short)3, "timestamp"), + /** + * Get attributes + */ + ATTRIBUTES((short)4, "attributes"); + + private static final Map byName = new HashMap(); + + 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: // ROW + return ROW; + case 3: // TIMESTAMP + return TIMESTAMP; + case 4: // ATTRIBUTES + return ATTRIBUTES; + 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 int __TIMESTAMP_ISSET_ID = 0; + private byte __isset_bitfield = 0; + 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.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.ROW, new org.apache.thrift.meta_data.FieldMetaData("row", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("timestamp", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.ATTRIBUTES, new org.apache.thrift.meta_data.FieldMetaData("attributes", org.apache.thrift.TFieldRequirementType.DEFAULT, + 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 , "Text"), + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text")))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRowTs_args.class, metaDataMap); + } + + public getRowTs_args() { + } + + public getRowTs_args( + ByteBuffer tableName, + ByteBuffer row, + long timestamp, + Map attributes) + { + this(); + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(tableName); + this.row = org.apache.thrift.TBaseHelper.copyBinary(row); + this.timestamp = timestamp; + setTimestampIsSet(true); + this.attributes = attributes; + } + + /** + * Performs a deep copy on other. + */ + public getRowTs_args(getRowTs_args other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetTableName()) { + this.tableName = other.tableName; + } + if (other.isSetRow()) { + this.row = other.row; + } + this.timestamp = other.timestamp; + if (other.isSetAttributes()) { + Map __this__attributes = new HashMap(other.attributes.size()); + for (Map.Entry other_element : other.attributes.entrySet()) { + + ByteBuffer other_element_key = other_element.getKey(); + ByteBuffer other_element_value = other_element.getValue(); + + ByteBuffer __this__attributes_copy_key = other_element_key; + + ByteBuffer __this__attributes_copy_value = other_element_value; + + __this__attributes.put(__this__attributes_copy_key, __this__attributes_copy_value); + } + this.attributes = __this__attributes; + } + } + + public getRowTs_args deepCopy() { + return new getRowTs_args(this); + } + + @Override + public void clear() { + this.tableName = null; + this.row = null; + setTimestampIsSet(false); + this.timestamp = 0; + this.attributes = null; + } + + /** + * name of the table + */ + public byte[] getTableName() { + setTableName(org.apache.thrift.TBaseHelper.rightSize(tableName)); + return tableName == null ? null : tableName.array(); + } + + public ByteBuffer bufferForTableName() { + return org.apache.thrift.TBaseHelper.copyBinary(tableName); + } + + /** + * name of the table + */ + public getRowTs_args setTableName(byte[] tableName) { + this.tableName = tableName == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(tableName, tableName.length)); + return this; + } + + public getRowTs_args setTableName(ByteBuffer tableName) { + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(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; + } + } + + /** + * row key + */ + public byte[] getRow() { + setRow(org.apache.thrift.TBaseHelper.rightSize(row)); + return row == null ? null : row.array(); + } + + public ByteBuffer bufferForRow() { + return org.apache.thrift.TBaseHelper.copyBinary(row); + } + + /** + * row key + */ + public getRowTs_args setRow(byte[] row) { + this.row = row == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(row, row.length)); + return this; + } + + public getRowTs_args setRow(ByteBuffer row) { + this.row = org.apache.thrift.TBaseHelper.copyBinary(row); + return this; + } + + public void unsetRow() { + this.row = null; + } + + /** Returns true if field row is set (has been assigned a value) and false otherwise */ + public boolean isSetRow() { + return this.row != null; + } + + public void setRowIsSet(boolean value) { + if (!value) { + this.row = null; + } + } + + /** + * timestamp + */ + public long getTimestamp() { + return this.timestamp; + } + + /** + * timestamp + */ + public getRowTs_args setTimestamp(long timestamp) { + this.timestamp = timestamp; + setTimestampIsSet(true); + return this; + } + + public void unsetTimestamp() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); + } + + /** Returns true if field timestamp is set (has been assigned a value) and false otherwise */ + public boolean isSetTimestamp() { + return EncodingUtils.testBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); + } + + public void setTimestampIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TIMESTAMP_ISSET_ID, value); + } + + 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(); + } + this.attributes.put(key, val); + } + + /** + * Get attributes + */ + public Map getAttributes() { + return this.attributes; + } + + /** + * Get attributes + */ + public getRowTs_args setAttributes(Map 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; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case TABLE_NAME: + if (value == null) { + unsetTableName(); + } else { + setTableName((ByteBuffer)value); + } + break; + + case ROW: + if (value == null) { + unsetRow(); + } else { + setRow((ByteBuffer)value); + } + break; + + case TIMESTAMP: + if (value == null) { + unsetTimestamp(); + } else { + setTimestamp((Long)value); + } + break; + + case ATTRIBUTES: + if (value == null) { + unsetAttributes(); + } else { + setAttributes((Map)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case TABLE_NAME: + return getTableName(); + + case ROW: + return getRow(); + + case TIMESTAMP: + return getTimestamp(); + + case ATTRIBUTES: + return getAttributes(); + + } + 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 ROW: + return isSetRow(); + case TIMESTAMP: + return isSetTimestamp(); + case ATTRIBUTES: + return isSetAttributes(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getRowTs_args) + return this.equals((getRowTs_args)that); + return false; + } + + public boolean equals(getRowTs_args 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_row = true && this.isSetRow(); + boolean that_present_row = true && that.isSetRow(); + if (this_present_row || that_present_row) { + if (!(this_present_row && that_present_row)) + return false; + if (!this.row.equals(that.row)) + return false; + } + + boolean this_present_timestamp = true; + boolean that_present_timestamp = true; + if (this_present_timestamp || that_present_timestamp) { + if (!(this_present_timestamp && that_present_timestamp)) + return false; + if (this.timestamp != that.timestamp) + 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; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_tableName = true && (isSetTableName()); + list.add(present_tableName); + if (present_tableName) + list.add(tableName); + + boolean present_row = true && (isSetRow()); + list.add(present_row); + if (present_row) + list.add(row); + + boolean present_timestamp = true; + list.add(present_timestamp); + if (present_timestamp) + list.add(timestamp); + + boolean present_attributes = true && (isSetAttributes()); + list.add(present_attributes); + if (present_attributes) + list.add(attributes); + + return list.hashCode(); + } + + @Override + public int compareTo(getRowTs_args 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(isSetRow()).compareTo(other.isSetRow()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRow()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.row, other.row); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(other.isSetTimestamp()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTimestamp()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timestamp, other.timestamp); + 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; + } + } + 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("getRowTs_args("); + boolean first = true; + + sb.append("tableName:"); + if (this.tableName == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.tableName, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("row:"); + if (this.row == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.row, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("timestamp:"); + sb.append(this.timestamp); + first = false; + if (!first) sb.append(", "); + sb.append("attributes:"); + if (this.attributes == null) { + sb.append("null"); + } else { + sb.append(this.attributes); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 { + // 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); + } + } + + private static class getRowTs_argsStandardSchemeFactory implements SchemeFactory { + public getRowTs_argsStandardScheme getScheme() { + return new getRowTs_argsStandardScheme(); + } + } + + private static class getRowTs_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getRowTs_args 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.STRING) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // ROW + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.row = iprot.readBinary(); + struct.setRowIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // TIMESTAMP + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.timestamp = iprot.readI64(); + struct.setTimestampIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // ATTRIBUTES + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map182 = iprot.readMapBegin(); + struct.attributes = new HashMap(2*_map182.size); + ByteBuffer _key183; + ByteBuffer _val184; + for (int _i185 = 0; _i185 < _map182.size; ++_i185) + { + _key183 = iprot.readBinary(); + _val184 = iprot.readBinary(); + struct.attributes.put(_key183, _val184); + } + iprot.readMapEnd(); + } + struct.setAttributesIsSet(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, getRowTs_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.tableName != null) { + oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC); + oprot.writeBinary(struct.tableName); + oprot.writeFieldEnd(); + } + if (struct.row != null) { + oprot.writeFieldBegin(ROW_FIELD_DESC); + oprot.writeBinary(struct.row); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC); + oprot.writeI64(struct.timestamp); + oprot.writeFieldEnd(); + if (struct.attributes != null) { + 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 _iter186 : struct.attributes.entrySet()) + { + oprot.writeBinary(_iter186.getKey()); + oprot.writeBinary(_iter186.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getRowTs_argsTupleSchemeFactory implements SchemeFactory { + public getRowTs_argsTupleScheme getScheme() { + return new getRowTs_argsTupleScheme(); + } + } + + private static class getRowTs_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getRowTs_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetTableName()) { + optionals.set(0); + } + if (struct.isSetRow()) { + optionals.set(1); + } + if (struct.isSetTimestamp()) { + optionals.set(2); + } + if (struct.isSetAttributes()) { + optionals.set(3); + } + oprot.writeBitSet(optionals, 4); + if (struct.isSetTableName()) { + oprot.writeBinary(struct.tableName); + } + if (struct.isSetRow()) { + oprot.writeBinary(struct.row); + } + if (struct.isSetTimestamp()) { + oprot.writeI64(struct.timestamp); + } + if (struct.isSetAttributes()) { + { + oprot.writeI32(struct.attributes.size()); + for (Map.Entry _iter187 : struct.attributes.entrySet()) + { + oprot.writeBinary(_iter187.getKey()); + oprot.writeBinary(_iter187.getValue()); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getRowTs_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(4); + if (incoming.get(0)) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(true); + } + if (incoming.get(1)) { + struct.row = iprot.readBinary(); + struct.setRowIsSet(true); + } + if (incoming.get(2)) { + struct.timestamp = iprot.readI64(); + struct.setTimestampIsSet(true); + } + if (incoming.get(3)) { + { + org.apache.thrift.protocol.TMap _map188 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.attributes = new HashMap(2*_map188.size); + ByteBuffer _key189; + ByteBuffer _val190; + for (int _i191 = 0; _i191 < _map188.size; ++_i191) + { + _key189 = iprot.readBinary(); + _val190 = iprot.readBinary(); + struct.attributes.put(_key189, _val190); + } + } + struct.setAttributesIsSet(true); + } + } + } + + } + + public static class getRowTs_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getRowTs_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0); + private static final org.apache.thrift.protocol.TField IO_FIELD_DESC = new org.apache.thrift.protocol.TField("io", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getRowTs_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getRowTs_resultTupleSchemeFactory()); + } + + public List success; // required + public IOError io; // 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 { + SUCCESS((short)0, "success"), + IO((short)1, "io"); + + private static final Map byName = new HashMap(); + + 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 0: // SUCCESS + return SUCCESS; + case 1: // IO + return IO; + 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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + 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, TRowResult.class)))); + tmpMap.put(_Fields.IO, new org.apache.thrift.meta_data.FieldMetaData("io", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRowTs_result.class, metaDataMap); + } + + public getRowTs_result() { + } + + public getRowTs_result( + List success, + IOError io) + { + this(); + this.success = success; + this.io = io; + } + + /** + * Performs a deep copy on other. + */ + public getRowTs_result(getRowTs_result other) { + if (other.isSetSuccess()) { + List __this__success = new ArrayList(other.success.size()); + for (TRowResult other_element : other.success) { + __this__success.add(new TRowResult(other_element)); + } + this.success = __this__success; + } + if (other.isSetIo()) { + this.io = new IOError(other.io); + } + } + + public getRowTs_result deepCopy() { + return new getRowTs_result(this); + } + + @Override + public void clear() { + this.success = null; + this.io = null; + } + + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + public java.util.Iterator getSuccessIterator() { + return (this.success == null) ? null : this.success.iterator(); + } + + public void addToSuccess(TRowResult elem) { + if (this.success == null) { + this.success = new ArrayList(); + } + this.success.add(elem); + } + + public List getSuccess() { + return this.success; + } + + public getRowTs_result setSuccess(List success) { + this.success = success; + return this; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public IOError getIo() { + return this.io; + } + + public getRowTs_result setIo(IOError io) { + this.io = io; + return this; + } + + public void unsetIo() { + this.io = null; + } + + /** Returns true if field io is set (has been assigned a value) and false otherwise */ + public boolean isSetIo() { + return this.io != null; + } + + public void setIoIsSet(boolean value) { + if (!value) { + this.io = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((List)value); + } + break; + + case IO: + if (value == null) { + unsetIo(); + } else { + setIo((IOError)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + case IO: + return getIo(); + + } + 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 SUCCESS: + return isSetSuccess(); + case IO: + return isSetIo(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getRowTs_result) + return this.equals((getRowTs_result)that); + return false; + } + + public boolean equals(getRowTs_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + boolean this_present_io = true && this.isSetIo(); + boolean that_present_io = true && that.isSetIo(); + if (this_present_io || that_present_io) { + if (!(this_present_io && that_present_io)) + return false; + if (!this.io.equals(that.io)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + boolean present_io = true && (isSetIo()); + list.add(present_io); + if (present_io) + list.add(io); + + return list.hashCode(); + } + + @Override + public int compareTo(getRowTs_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIo()).compareTo(other.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, other.io); + 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("getRowTs_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + if (!first) sb.append(", "); + sb.append("io:"); + if (this.io == null) { + sb.append("null"); + } else { + sb.append(this.io); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 getRowTs_resultStandardSchemeFactory implements SchemeFactory { + public getRowTs_resultStandardScheme getScheme() { + return new getRowTs_resultStandardScheme(); + } + } + + private static class getRowTs_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getRowTs_result 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 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list192 = iprot.readListBegin(); + struct.success = new ArrayList(_list192.size); + TRowResult _elem193; + for (int _i194 = 0; _i194 < _list192.size; ++_i194) + { + _elem193 = new TRowResult(); + _elem193.read(iprot); + struct.success.add(_elem193); + } + iprot.readListEnd(); + } + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IO + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(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, getRowTs_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); + for (TRowResult _iter195 : struct.success) + { + _iter195.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.io != null) { + oprot.writeFieldBegin(IO_FIELD_DESC); + struct.io.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getRowTs_resultTupleSchemeFactory implements SchemeFactory { + public getRowTs_resultTupleScheme getScheme() { + return new getRowTs_resultTupleScheme(); + } + } + + private static class getRowTs_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getRowTs_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIo()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + { + oprot.writeI32(struct.success.size()); + for (TRowResult _iter196 : struct.success) + { + _iter196.write(oprot); + } + } + } + if (struct.isSetIo()) { + struct.io.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getRowTs_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list197 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new ArrayList(_list197.size); + TRowResult _elem198; + for (int _i199 = 0; _i199 < _list197.size; ++_i199) + { + _elem198 = new TRowResult(); + _elem198.read(iprot); + struct.success.add(_elem198); + } + } + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } + } + } + + } + + public static class getRowWithColumnsTs_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getRowWithColumnsTs_args"); + + private static final org.apache.thrift.protocol.TField TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tableName", org.apache.thrift.protocol.TType.STRING, (short)1); + 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)2); + 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)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 ATTRIBUTES_FIELD_DESC = new org.apache.thrift.protocol.TField("attributes", org.apache.thrift.protocol.TType.MAP, (short)5); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getRowWithColumnsTs_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getRowWithColumnsTs_argsTupleSchemeFactory()); + } + + /** + * name of table + */ + public ByteBuffer tableName; // required + /** + * row key + */ + public ByteBuffer row; // required + /** + * List of columns to return, null for all columns + */ + public List columns; // required + public long timestamp; // required + /** + * Get attributes + */ + public Map attributes; // 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 { + /** + * name of table + */ + TABLE_NAME((short)1, "tableName"), + /** + * row key + */ + ROW((short)2, "row"), + /** + * List of columns to return, null for all columns + */ + COLUMNS((short)3, "columns"), + TIMESTAMP((short)4, "timestamp"), + /** + * Get attributes + */ + ATTRIBUTES((short)5, "attributes"); + + private static final Map byName = new HashMap(); + + 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: // ROW + return ROW; + case 3: // COLUMNS + return COLUMNS; + case 4: // TIMESTAMP + return TIMESTAMP; + case 5: // ATTRIBUTES + return ATTRIBUTES; + 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 int __TIMESTAMP_ISSET_ID = 0; + private byte __isset_bitfield = 0; + 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.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.ROW, new org.apache.thrift.meta_data.FieldMetaData("row", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.COLUMNS, new org.apache.thrift.meta_data.FieldMetaData("columns", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text")))); + tmpMap.put(_Fields.TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("timestamp", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.ATTRIBUTES, new org.apache.thrift.meta_data.FieldMetaData("attributes", org.apache.thrift.TFieldRequirementType.DEFAULT, + 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 , "Text"), + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text")))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRowWithColumnsTs_args.class, metaDataMap); + } + + public getRowWithColumnsTs_args() { + } + + public getRowWithColumnsTs_args( + ByteBuffer tableName, + ByteBuffer row, + List columns, + long timestamp, + Map attributes) + { + this(); + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(tableName); + this.row = org.apache.thrift.TBaseHelper.copyBinary(row); + this.columns = columns; + this.timestamp = timestamp; + setTimestampIsSet(true); + this.attributes = attributes; + } + + /** + * Performs a deep copy on other. + */ + public getRowWithColumnsTs_args(getRowWithColumnsTs_args other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetTableName()) { + this.tableName = other.tableName; + } + if (other.isSetRow()) { + this.row = other.row; + } + if (other.isSetColumns()) { + List __this__columns = new ArrayList(other.columns.size()); + for (ByteBuffer other_element : other.columns) { + __this__columns.add(other_element); + } + this.columns = __this__columns; + } + this.timestamp = other.timestamp; + if (other.isSetAttributes()) { + Map __this__attributes = new HashMap(other.attributes.size()); + for (Map.Entry other_element : other.attributes.entrySet()) { + + ByteBuffer other_element_key = other_element.getKey(); + ByteBuffer other_element_value = other_element.getValue(); + + ByteBuffer __this__attributes_copy_key = other_element_key; + + ByteBuffer __this__attributes_copy_value = other_element_value; + + __this__attributes.put(__this__attributes_copy_key, __this__attributes_copy_value); + } + this.attributes = __this__attributes; + } + } + + public getRowWithColumnsTs_args deepCopy() { + return new getRowWithColumnsTs_args(this); + } + + @Override + public void clear() { + this.tableName = null; + this.row = null; + this.columns = null; + setTimestampIsSet(false); + this.timestamp = 0; + this.attributes = null; + } + + /** + * name of table + */ + public byte[] getTableName() { + setTableName(org.apache.thrift.TBaseHelper.rightSize(tableName)); + return tableName == null ? null : tableName.array(); + } + + public ByteBuffer bufferForTableName() { + return org.apache.thrift.TBaseHelper.copyBinary(tableName); + } + + /** + * name of table + */ + public getRowWithColumnsTs_args setTableName(byte[] tableName) { + this.tableName = tableName == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(tableName, tableName.length)); + return this; + } + + public getRowWithColumnsTs_args setTableName(ByteBuffer tableName) { + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(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; + } + } + + /** + * row key + */ + public byte[] getRow() { + setRow(org.apache.thrift.TBaseHelper.rightSize(row)); + return row == null ? null : row.array(); + } + + public ByteBuffer bufferForRow() { + return org.apache.thrift.TBaseHelper.copyBinary(row); + } + + /** + * row key + */ + public getRowWithColumnsTs_args setRow(byte[] row) { + this.row = row == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(row, row.length)); + return this; + } + + public getRowWithColumnsTs_args setRow(ByteBuffer row) { + this.row = org.apache.thrift.TBaseHelper.copyBinary(row); + return this; + } + + public void unsetRow() { + this.row = null; + } + + /** Returns true if field row is set (has been assigned a value) and false otherwise */ + public boolean isSetRow() { + return this.row != null; + } + + public void setRowIsSet(boolean value) { + if (!value) { + this.row = null; + } + } + + public int getColumnsSize() { + return (this.columns == null) ? 0 : this.columns.size(); + } + + public java.util.Iterator getColumnsIterator() { + return (this.columns == null) ? null : this.columns.iterator(); + } + + public void addToColumns(ByteBuffer elem) { + if (this.columns == null) { + this.columns = new ArrayList(); + } + this.columns.add(elem); + } + + /** + * List of columns to return, null for all columns + */ + public List getColumns() { + return this.columns; + } + + /** + * List of columns to return, null for all columns + */ + public getRowWithColumnsTs_args setColumns(List 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 long getTimestamp() { + return this.timestamp; + } + + public getRowWithColumnsTs_args setTimestamp(long timestamp) { + this.timestamp = timestamp; + setTimestampIsSet(true); + return this; + } + + public void unsetTimestamp() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); + } + + /** Returns true if field timestamp is set (has been assigned a value) and false otherwise */ + public boolean isSetTimestamp() { + return EncodingUtils.testBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); + } + + public void setTimestampIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TIMESTAMP_ISSET_ID, value); + } + + 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(); + } + this.attributes.put(key, val); + } + + /** + * Get attributes + */ + public Map getAttributes() { + return this.attributes; + } + + /** + * Get attributes + */ + public getRowWithColumnsTs_args setAttributes(Map 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; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case TABLE_NAME: + if (value == null) { + unsetTableName(); + } else { + setTableName((ByteBuffer)value); + } + break; + + case ROW: + if (value == null) { + unsetRow(); + } else { + setRow((ByteBuffer)value); + } + break; + + case COLUMNS: + if (value == null) { + unsetColumns(); + } else { + setColumns((List)value); + } + break; + + case TIMESTAMP: + if (value == null) { + unsetTimestamp(); + } else { + setTimestamp((Long)value); + } + break; + + case ATTRIBUTES: + if (value == null) { + unsetAttributes(); + } else { + setAttributes((Map)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case TABLE_NAME: + return getTableName(); + + case ROW: + return getRow(); + + case COLUMNS: + return getColumns(); + + case TIMESTAMP: + return getTimestamp(); + + case ATTRIBUTES: + return getAttributes(); + + } + 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 ROW: + return isSetRow(); + case COLUMNS: + return isSetColumns(); + case TIMESTAMP: + return isSetTimestamp(); + case ATTRIBUTES: + return isSetAttributes(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getRowWithColumnsTs_args) + return this.equals((getRowWithColumnsTs_args)that); + return false; + } + + public boolean equals(getRowWithColumnsTs_args 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_row = true && this.isSetRow(); + boolean that_present_row = true && that.isSetRow(); + if (this_present_row || that_present_row) { + if (!(this_present_row && that_present_row)) + return false; + if (!this.row.equals(that.row)) + 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_timestamp = true; + boolean that_present_timestamp = true; + if (this_present_timestamp || that_present_timestamp) { + if (!(this_present_timestamp && that_present_timestamp)) + return false; + if (this.timestamp != that.timestamp) + 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; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_tableName = true && (isSetTableName()); + list.add(present_tableName); + if (present_tableName) + list.add(tableName); + + boolean present_row = true && (isSetRow()); + list.add(present_row); + if (present_row) + list.add(row); + + boolean present_columns = true && (isSetColumns()); + list.add(present_columns); + if (present_columns) + list.add(columns); + + boolean present_timestamp = true; + list.add(present_timestamp); + if (present_timestamp) + list.add(timestamp); + + boolean present_attributes = true && (isSetAttributes()); + list.add(present_attributes); + if (present_attributes) + list.add(attributes); + + return list.hashCode(); + } + + @Override + public int compareTo(getRowWithColumnsTs_args 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(isSetRow()).compareTo(other.isSetRow()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRow()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.row, other.row); + 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(isSetTimestamp()).compareTo(other.isSetTimestamp()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTimestamp()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timestamp, other.timestamp); + 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; + } + } + 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("getRowWithColumnsTs_args("); + boolean first = true; + + sb.append("tableName:"); + if (this.tableName == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.tableName, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("row:"); + if (this.row == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.row, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("columns:"); + if (this.columns == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.columns, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("timestamp:"); + sb.append(this.timestamp); + first = false; + if (!first) sb.append(", "); + sb.append("attributes:"); + if (this.attributes == null) { + sb.append("null"); + } else { + sb.append(this.attributes); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 { + // 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); + } + } + + private static class getRowWithColumnsTs_argsStandardSchemeFactory implements SchemeFactory { + public getRowWithColumnsTs_argsStandardScheme getScheme() { + return new getRowWithColumnsTs_argsStandardScheme(); + } + } + + private static class getRowWithColumnsTs_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getRowWithColumnsTs_args 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.STRING) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // ROW + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.row = iprot.readBinary(); + struct.setRowIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // COLUMNS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list200 = iprot.readListBegin(); + struct.columns = new ArrayList(_list200.size); + ByteBuffer _elem201; + for (int _i202 = 0; _i202 < _list200.size; ++_i202) + { + _elem201 = iprot.readBinary(); + struct.columns.add(_elem201); + } + iprot.readListEnd(); + } + struct.setColumnsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // TIMESTAMP + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.timestamp = iprot.readI64(); + struct.setTimestampIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // ATTRIBUTES + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map203 = iprot.readMapBegin(); + struct.attributes = new HashMap(2*_map203.size); + ByteBuffer _key204; + ByteBuffer _val205; + for (int _i206 = 0; _i206 < _map203.size; ++_i206) + { + _key204 = iprot.readBinary(); + _val205 = iprot.readBinary(); + struct.attributes.put(_key204, _val205); + } + iprot.readMapEnd(); + } + struct.setAttributesIsSet(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, getRowWithColumnsTs_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.tableName != null) { + oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC); + oprot.writeBinary(struct.tableName); + oprot.writeFieldEnd(); + } + if (struct.row != null) { + oprot.writeFieldBegin(ROW_FIELD_DESC); + oprot.writeBinary(struct.row); + oprot.writeFieldEnd(); + } + if (struct.columns != null) { + oprot.writeFieldBegin(COLUMNS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.columns.size())); + for (ByteBuffer _iter207 : struct.columns) + { + oprot.writeBinary(_iter207); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC); + oprot.writeI64(struct.timestamp); + oprot.writeFieldEnd(); + if (struct.attributes != null) { + 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 _iter208 : struct.attributes.entrySet()) + { + oprot.writeBinary(_iter208.getKey()); + oprot.writeBinary(_iter208.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getRowWithColumnsTs_argsTupleSchemeFactory implements SchemeFactory { + public getRowWithColumnsTs_argsTupleScheme getScheme() { + return new getRowWithColumnsTs_argsTupleScheme(); + } + } + + private static class getRowWithColumnsTs_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getRowWithColumnsTs_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetTableName()) { + optionals.set(0); + } + if (struct.isSetRow()) { + optionals.set(1); + } + if (struct.isSetColumns()) { + optionals.set(2); + } + if (struct.isSetTimestamp()) { + optionals.set(3); + } + if (struct.isSetAttributes()) { + optionals.set(4); + } + oprot.writeBitSet(optionals, 5); + if (struct.isSetTableName()) { + oprot.writeBinary(struct.tableName); + } + if (struct.isSetRow()) { + oprot.writeBinary(struct.row); + } + if (struct.isSetColumns()) { + { + oprot.writeI32(struct.columns.size()); + for (ByteBuffer _iter209 : struct.columns) + { + oprot.writeBinary(_iter209); + } + } + } + if (struct.isSetTimestamp()) { + oprot.writeI64(struct.timestamp); + } + if (struct.isSetAttributes()) { + { + oprot.writeI32(struct.attributes.size()); + for (Map.Entry _iter210 : struct.attributes.entrySet()) + { + oprot.writeBinary(_iter210.getKey()); + oprot.writeBinary(_iter210.getValue()); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getRowWithColumnsTs_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(5); + if (incoming.get(0)) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(true); + } + if (incoming.get(1)) { + struct.row = iprot.readBinary(); + struct.setRowIsSet(true); + } + if (incoming.get(2)) { + { + org.apache.thrift.protocol.TList _list211 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.columns = new ArrayList(_list211.size); + ByteBuffer _elem212; + for (int _i213 = 0; _i213 < _list211.size; ++_i213) + { + _elem212 = iprot.readBinary(); + struct.columns.add(_elem212); + } + } + struct.setColumnsIsSet(true); + } + if (incoming.get(3)) { + struct.timestamp = iprot.readI64(); + struct.setTimestampIsSet(true); + } + if (incoming.get(4)) { + { + org.apache.thrift.protocol.TMap _map214 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.attributes = new HashMap(2*_map214.size); + ByteBuffer _key215; + ByteBuffer _val216; + for (int _i217 = 0; _i217 < _map214.size; ++_i217) + { + _key215 = iprot.readBinary(); + _val216 = iprot.readBinary(); + struct.attributes.put(_key215, _val216); + } + } + struct.setAttributesIsSet(true); + } + } + } + + } + + public static class getRowWithColumnsTs_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getRowWithColumnsTs_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0); + private static final org.apache.thrift.protocol.TField IO_FIELD_DESC = new org.apache.thrift.protocol.TField("io", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getRowWithColumnsTs_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getRowWithColumnsTs_resultTupleSchemeFactory()); + } + + public List success; // required + public IOError io; // 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 { + SUCCESS((short)0, "success"), + IO((short)1, "io"); + + private static final Map byName = new HashMap(); + + 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 0: // SUCCESS + return SUCCESS; + case 1: // IO + return IO; + 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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + 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, TRowResult.class)))); + tmpMap.put(_Fields.IO, new org.apache.thrift.meta_data.FieldMetaData("io", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRowWithColumnsTs_result.class, metaDataMap); + } + + public getRowWithColumnsTs_result() { + } + + public getRowWithColumnsTs_result( + List success, + IOError io) + { + this(); + this.success = success; + this.io = io; + } + + /** + * Performs a deep copy on other. + */ + public getRowWithColumnsTs_result(getRowWithColumnsTs_result other) { + if (other.isSetSuccess()) { + List __this__success = new ArrayList(other.success.size()); + for (TRowResult other_element : other.success) { + __this__success.add(new TRowResult(other_element)); + } + this.success = __this__success; + } + if (other.isSetIo()) { + this.io = new IOError(other.io); + } + } + + public getRowWithColumnsTs_result deepCopy() { + return new getRowWithColumnsTs_result(this); + } + + @Override + public void clear() { + this.success = null; + this.io = null; + } + + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + public java.util.Iterator getSuccessIterator() { + return (this.success == null) ? null : this.success.iterator(); + } + + public void addToSuccess(TRowResult elem) { + if (this.success == null) { + this.success = new ArrayList(); + } + this.success.add(elem); + } + + public List getSuccess() { + return this.success; + } + + public getRowWithColumnsTs_result setSuccess(List success) { + this.success = success; + return this; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public IOError getIo() { + return this.io; + } + + public getRowWithColumnsTs_result setIo(IOError io) { + this.io = io; + return this; + } + + public void unsetIo() { + this.io = null; + } + + /** Returns true if field io is set (has been assigned a value) and false otherwise */ + public boolean isSetIo() { + return this.io != null; + } + + public void setIoIsSet(boolean value) { + if (!value) { + this.io = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((List)value); + } + break; + + case IO: + if (value == null) { + unsetIo(); + } else { + setIo((IOError)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + case IO: + return getIo(); + + } + 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 SUCCESS: + return isSetSuccess(); + case IO: + return isSetIo(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getRowWithColumnsTs_result) + return this.equals((getRowWithColumnsTs_result)that); + return false; + } + + public boolean equals(getRowWithColumnsTs_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + boolean this_present_io = true && this.isSetIo(); + boolean that_present_io = true && that.isSetIo(); + if (this_present_io || that_present_io) { + if (!(this_present_io && that_present_io)) + return false; + if (!this.io.equals(that.io)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + boolean present_io = true && (isSetIo()); + list.add(present_io); + if (present_io) + list.add(io); + + return list.hashCode(); + } + + @Override + public int compareTo(getRowWithColumnsTs_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIo()).compareTo(other.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, other.io); + 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("getRowWithColumnsTs_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + if (!first) sb.append(", "); + sb.append("io:"); + if (this.io == null) { + sb.append("null"); + } else { + sb.append(this.io); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 getRowWithColumnsTs_resultStandardSchemeFactory implements SchemeFactory { + public getRowWithColumnsTs_resultStandardScheme getScheme() { + return new getRowWithColumnsTs_resultStandardScheme(); + } + } + + private static class getRowWithColumnsTs_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getRowWithColumnsTs_result 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 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list218 = iprot.readListBegin(); + struct.success = new ArrayList(_list218.size); + TRowResult _elem219; + for (int _i220 = 0; _i220 < _list218.size; ++_i220) + { + _elem219 = new TRowResult(); + _elem219.read(iprot); + struct.success.add(_elem219); + } + iprot.readListEnd(); + } + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IO + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(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, getRowWithColumnsTs_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); + for (TRowResult _iter221 : struct.success) + { + _iter221.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.io != null) { + oprot.writeFieldBegin(IO_FIELD_DESC); + struct.io.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getRowWithColumnsTs_resultTupleSchemeFactory implements SchemeFactory { + public getRowWithColumnsTs_resultTupleScheme getScheme() { + return new getRowWithColumnsTs_resultTupleScheme(); + } + } + + private static class getRowWithColumnsTs_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getRowWithColumnsTs_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIo()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + { + oprot.writeI32(struct.success.size()); + for (TRowResult _iter222 : struct.success) + { + _iter222.write(oprot); + } + } + } + if (struct.isSetIo()) { + struct.io.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getRowWithColumnsTs_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list223 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new ArrayList(_list223.size); + TRowResult _elem224; + for (int _i225 = 0; _i225 < _list223.size; ++_i225) + { + _elem224 = new TRowResult(); + _elem224.read(iprot); + struct.success.add(_elem224); + } + } + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } + } + } + + } + + public static class getRows_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getRows_args"); + + private static final org.apache.thrift.protocol.TField TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tableName", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField ROWS_FIELD_DESC = new org.apache.thrift.protocol.TField("rows", 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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getRows_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getRows_argsTupleSchemeFactory()); + } + + /** + * name of table + */ + public ByteBuffer tableName; // required + /** + * row keys + */ + public List rows; // required + /** + * Get attributes + */ + public Map attributes; // 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 { + /** + * name of table + */ + TABLE_NAME((short)1, "tableName"), + /** + * row keys + */ + ROWS((short)2, "rows"), + /** + * Get attributes + */ + ATTRIBUTES((short)3, "attributes"); + + private static final Map byName = new HashMap(); + + 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: // ROWS + return ROWS; + case 3: // ATTRIBUTES + return ATTRIBUTES; + 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.TABLE_NAME, new org.apache.thrift.meta_data.FieldMetaData("tableName", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.ROWS, new org.apache.thrift.meta_data.FieldMetaData("rows", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text")))); + tmpMap.put(_Fields.ATTRIBUTES, new org.apache.thrift.meta_data.FieldMetaData("attributes", org.apache.thrift.TFieldRequirementType.DEFAULT, + 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 , "Text"), + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text")))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRows_args.class, metaDataMap); + } + + public getRows_args() { + } + + public getRows_args( + ByteBuffer tableName, + List rows, + Map attributes) + { + this(); + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(tableName); + this.rows = rows; + this.attributes = attributes; + } + + /** + * Performs a deep copy on other. + */ + public getRows_args(getRows_args other) { + if (other.isSetTableName()) { + this.tableName = other.tableName; + } + if (other.isSetRows()) { + List __this__rows = new ArrayList(other.rows.size()); + for (ByteBuffer other_element : other.rows) { + __this__rows.add(other_element); + } + this.rows = __this__rows; + } + if (other.isSetAttributes()) { + Map __this__attributes = new HashMap(other.attributes.size()); + for (Map.Entry other_element : other.attributes.entrySet()) { + + ByteBuffer other_element_key = other_element.getKey(); + ByteBuffer other_element_value = other_element.getValue(); + + ByteBuffer __this__attributes_copy_key = other_element_key; + + ByteBuffer __this__attributes_copy_value = other_element_value; + + __this__attributes.put(__this__attributes_copy_key, __this__attributes_copy_value); + } + this.attributes = __this__attributes; + } + } + + public getRows_args deepCopy() { + return new getRows_args(this); + } + + @Override + public void clear() { + this.tableName = null; + this.rows = null; + this.attributes = null; + } + + /** + * name of table + */ + public byte[] getTableName() { + setTableName(org.apache.thrift.TBaseHelper.rightSize(tableName)); + return tableName == null ? null : tableName.array(); + } + + public ByteBuffer bufferForTableName() { + return org.apache.thrift.TBaseHelper.copyBinary(tableName); + } + + /** + * name of table + */ + public getRows_args setTableName(byte[] tableName) { + this.tableName = tableName == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(tableName, tableName.length)); + return this; + } + + public getRows_args setTableName(ByteBuffer tableName) { + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(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 getRowsSize() { + return (this.rows == null) ? 0 : this.rows.size(); + } + + public java.util.Iterator getRowsIterator() { + return (this.rows == null) ? null : this.rows.iterator(); + } + + public void addToRows(ByteBuffer elem) { + if (this.rows == null) { + this.rows = new ArrayList(); + } + this.rows.add(elem); + } + + /** + * row keys + */ + public List getRows() { + return this.rows; + } + + /** + * row keys + */ + public getRows_args setRows(List rows) { + this.rows = rows; + return this; + } + + public void unsetRows() { + this.rows = null; + } + + /** Returns true if field rows is set (has been assigned a value) and false otherwise */ + public boolean isSetRows() { + return this.rows != null; + } + + public void setRowsIsSet(boolean value) { + if (!value) { + this.rows = 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(); + } + this.attributes.put(key, val); + } + + /** + * Get attributes + */ + public Map getAttributes() { + return this.attributes; + } + + /** + * Get attributes + */ + public getRows_args setAttributes(Map 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; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case TABLE_NAME: + if (value == null) { + unsetTableName(); + } else { + setTableName((ByteBuffer)value); + } + break; + + case ROWS: + if (value == null) { + unsetRows(); + } else { + setRows((List)value); + } + break; + + case ATTRIBUTES: + if (value == null) { + unsetAttributes(); + } else { + setAttributes((Map)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case TABLE_NAME: + return getTableName(); + + case ROWS: + return getRows(); + + case ATTRIBUTES: + return getAttributes(); + + } + 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 ROWS: + return isSetRows(); + case ATTRIBUTES: + return isSetAttributes(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getRows_args) + return this.equals((getRows_args)that); + return false; + } + + public boolean equals(getRows_args 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_rows = true && this.isSetRows(); + boolean that_present_rows = true && that.isSetRows(); + if (this_present_rows || that_present_rows) { + if (!(this_present_rows && that_present_rows)) + return false; + if (!this.rows.equals(that.rows)) + 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; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_tableName = true && (isSetTableName()); + list.add(present_tableName); + if (present_tableName) + list.add(tableName); + + boolean present_rows = true && (isSetRows()); + list.add(present_rows); + if (present_rows) + list.add(rows); + + boolean present_attributes = true && (isSetAttributes()); + list.add(present_attributes); + if (present_attributes) + list.add(attributes); + + return list.hashCode(); + } + + @Override + public int compareTo(getRows_args 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(isSetRows()).compareTo(other.isSetRows()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRows()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.rows, other.rows); + 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; + } + } + 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("getRows_args("); + boolean first = true; + + sb.append("tableName:"); + if (this.tableName == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.tableName, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("rows:"); + if (this.rows == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.rows, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("attributes:"); + if (this.attributes == null) { + sb.append("null"); + } else { + sb.append(this.attributes); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 getRows_argsStandardSchemeFactory implements SchemeFactory { + public getRows_argsStandardScheme getScheme() { + return new getRows_argsStandardScheme(); + } + } + + private static class getRows_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getRows_args 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.STRING) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // ROWS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list226 = iprot.readListBegin(); + struct.rows = new ArrayList(_list226.size); + ByteBuffer _elem227; + for (int _i228 = 0; _i228 < _list226.size; ++_i228) + { + _elem227 = iprot.readBinary(); + struct.rows.add(_elem227); + } + iprot.readListEnd(); + } + struct.setRowsIsSet(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 _map229 = iprot.readMapBegin(); + struct.attributes = new HashMap(2*_map229.size); + ByteBuffer _key230; + ByteBuffer _val231; + for (int _i232 = 0; _i232 < _map229.size; ++_i232) + { + _key230 = iprot.readBinary(); + _val231 = iprot.readBinary(); + struct.attributes.put(_key230, _val231); + } + iprot.readMapEnd(); + } + struct.setAttributesIsSet(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, getRows_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.tableName != null) { + oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC); + oprot.writeBinary(struct.tableName); + oprot.writeFieldEnd(); + } + if (struct.rows != null) { + oprot.writeFieldBegin(ROWS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.rows.size())); + for (ByteBuffer _iter233 : struct.rows) + { + oprot.writeBinary(_iter233); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.attributes != null) { + 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 _iter234 : struct.attributes.entrySet()) + { + oprot.writeBinary(_iter234.getKey()); + oprot.writeBinary(_iter234.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getRows_argsTupleSchemeFactory implements SchemeFactory { + public getRows_argsTupleScheme getScheme() { + return new getRows_argsTupleScheme(); + } + } + + private static class getRows_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getRows_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetTableName()) { + optionals.set(0); + } + if (struct.isSetRows()) { + optionals.set(1); + } + if (struct.isSetAttributes()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetTableName()) { + oprot.writeBinary(struct.tableName); + } + if (struct.isSetRows()) { + { + oprot.writeI32(struct.rows.size()); + for (ByteBuffer _iter235 : struct.rows) + { + oprot.writeBinary(_iter235); + } + } + } + if (struct.isSetAttributes()) { + { + oprot.writeI32(struct.attributes.size()); + for (Map.Entry _iter236 : struct.attributes.entrySet()) + { + oprot.writeBinary(_iter236.getKey()); + oprot.writeBinary(_iter236.getValue()); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getRows_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(true); + } + if (incoming.get(1)) { + { + org.apache.thrift.protocol.TList _list237 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.rows = new ArrayList(_list237.size); + ByteBuffer _elem238; + for (int _i239 = 0; _i239 < _list237.size; ++_i239) + { + _elem238 = iprot.readBinary(); + struct.rows.add(_elem238); + } + } + struct.setRowsIsSet(true); + } + if (incoming.get(2)) { + { + org.apache.thrift.protocol.TMap _map240 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.attributes = new HashMap(2*_map240.size); + ByteBuffer _key241; + ByteBuffer _val242; + for (int _i243 = 0; _i243 < _map240.size; ++_i243) + { + _key241 = iprot.readBinary(); + _val242 = iprot.readBinary(); + struct.attributes.put(_key241, _val242); + } + } + struct.setAttributesIsSet(true); + } + } + } + + } + + public static class getRows_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getRows_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0); + private static final org.apache.thrift.protocol.TField IO_FIELD_DESC = new org.apache.thrift.protocol.TField("io", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getRows_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getRows_resultTupleSchemeFactory()); + } + + public List success; // required + public IOError io; // 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 { + SUCCESS((short)0, "success"), + IO((short)1, "io"); + + private static final Map byName = new HashMap(); + + 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 0: // SUCCESS + return SUCCESS; + case 1: // IO + return IO; + 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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + 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, TRowResult.class)))); + tmpMap.put(_Fields.IO, new org.apache.thrift.meta_data.FieldMetaData("io", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRows_result.class, metaDataMap); + } + + public getRows_result() { + } + + public getRows_result( + List success, + IOError io) + { + this(); + this.success = success; + this.io = io; + } + + /** + * Performs a deep copy on other. + */ + public getRows_result(getRows_result other) { + if (other.isSetSuccess()) { + List __this__success = new ArrayList(other.success.size()); + for (TRowResult other_element : other.success) { + __this__success.add(new TRowResult(other_element)); + } + this.success = __this__success; + } + if (other.isSetIo()) { + this.io = new IOError(other.io); + } + } + + public getRows_result deepCopy() { + return new getRows_result(this); + } + + @Override + public void clear() { + this.success = null; + this.io = null; + } + + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + public java.util.Iterator getSuccessIterator() { + return (this.success == null) ? null : this.success.iterator(); + } + + public void addToSuccess(TRowResult elem) { + if (this.success == null) { + this.success = new ArrayList(); + } + this.success.add(elem); + } + + public List getSuccess() { + return this.success; + } + + public getRows_result setSuccess(List success) { + this.success = success; + return this; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public IOError getIo() { + return this.io; + } + + public getRows_result setIo(IOError io) { + this.io = io; + return this; + } + + public void unsetIo() { + this.io = null; + } + + /** Returns true if field io is set (has been assigned a value) and false otherwise */ + public boolean isSetIo() { + return this.io != null; + } + + public void setIoIsSet(boolean value) { + if (!value) { + this.io = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((List)value); + } + break; + + case IO: + if (value == null) { + unsetIo(); + } else { + setIo((IOError)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + case IO: + return getIo(); + + } + 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 SUCCESS: + return isSetSuccess(); + case IO: + return isSetIo(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getRows_result) + return this.equals((getRows_result)that); + return false; + } + + public boolean equals(getRows_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + boolean this_present_io = true && this.isSetIo(); + boolean that_present_io = true && that.isSetIo(); + if (this_present_io || that_present_io) { + if (!(this_present_io && that_present_io)) + return false; + if (!this.io.equals(that.io)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + boolean present_io = true && (isSetIo()); + list.add(present_io); + if (present_io) + list.add(io); + + return list.hashCode(); + } + + @Override + public int compareTo(getRows_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIo()).compareTo(other.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, other.io); + 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("getRows_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + if (!first) sb.append(", "); + sb.append("io:"); + if (this.io == null) { + sb.append("null"); + } else { + sb.append(this.io); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 getRows_resultStandardSchemeFactory implements SchemeFactory { + public getRows_resultStandardScheme getScheme() { + return new getRows_resultStandardScheme(); + } + } + + private static class getRows_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getRows_result 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 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list244 = iprot.readListBegin(); + struct.success = new ArrayList(_list244.size); + TRowResult _elem245; + for (int _i246 = 0; _i246 < _list244.size; ++_i246) + { + _elem245 = new TRowResult(); + _elem245.read(iprot); + struct.success.add(_elem245); + } + iprot.readListEnd(); + } + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IO + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(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, getRows_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); + for (TRowResult _iter247 : struct.success) + { + _iter247.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.io != null) { + oprot.writeFieldBegin(IO_FIELD_DESC); + struct.io.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getRows_resultTupleSchemeFactory implements SchemeFactory { + public getRows_resultTupleScheme getScheme() { + return new getRows_resultTupleScheme(); + } + } + + private static class getRows_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getRows_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIo()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + { + oprot.writeI32(struct.success.size()); + for (TRowResult _iter248 : struct.success) + { + _iter248.write(oprot); + } + } + } + if (struct.isSetIo()) { + struct.io.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getRows_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list249 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new ArrayList(_list249.size); + TRowResult _elem250; + for (int _i251 = 0; _i251 < _list249.size; ++_i251) + { + _elem250 = new TRowResult(); + _elem250.read(iprot); + struct.success.add(_elem250); + } + } + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } + } + } + + } + + public static class getRowsWithColumns_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getRowsWithColumns_args"); + + private static final org.apache.thrift.protocol.TField TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tableName", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField ROWS_FIELD_DESC = new org.apache.thrift.protocol.TField("rows", org.apache.thrift.protocol.TType.LIST, (short)2); + 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)3); + 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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getRowsWithColumns_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getRowsWithColumns_argsTupleSchemeFactory()); + } + + /** + * name of table + */ + public ByteBuffer tableName; // required + /** + * row keys + */ + public List rows; // required + /** + * List of columns to return, null for all columns + */ + public List columns; // required + /** + * Get attributes + */ + public Map attributes; // 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 { + /** + * name of table + */ + TABLE_NAME((short)1, "tableName"), + /** + * row keys + */ + ROWS((short)2, "rows"), + /** + * List of columns to return, null for all columns + */ + COLUMNS((short)3, "columns"), + /** + * Get attributes + */ + ATTRIBUTES((short)4, "attributes"); + + private static final Map byName = new HashMap(); + + 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: // ROWS + return ROWS; + case 3: // COLUMNS + return COLUMNS; + case 4: // ATTRIBUTES + return ATTRIBUTES; + 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.TABLE_NAME, new org.apache.thrift.meta_data.FieldMetaData("tableName", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.ROWS, new org.apache.thrift.meta_data.FieldMetaData("rows", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text")))); + tmpMap.put(_Fields.COLUMNS, new org.apache.thrift.meta_data.FieldMetaData("columns", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text")))); + tmpMap.put(_Fields.ATTRIBUTES, new org.apache.thrift.meta_data.FieldMetaData("attributes", org.apache.thrift.TFieldRequirementType.DEFAULT, + 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 , "Text"), + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text")))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRowsWithColumns_args.class, metaDataMap); + } + + public getRowsWithColumns_args() { + } + + public getRowsWithColumns_args( + ByteBuffer tableName, + List rows, + List columns, + Map attributes) + { + this(); + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(tableName); + this.rows = rows; + this.columns = columns; + this.attributes = attributes; + } + + /** + * Performs a deep copy on other. + */ + public getRowsWithColumns_args(getRowsWithColumns_args other) { + if (other.isSetTableName()) { + this.tableName = other.tableName; + } + if (other.isSetRows()) { + List __this__rows = new ArrayList(other.rows.size()); + for (ByteBuffer other_element : other.rows) { + __this__rows.add(other_element); + } + this.rows = __this__rows; + } + if (other.isSetColumns()) { + List __this__columns = new ArrayList(other.columns.size()); + for (ByteBuffer other_element : other.columns) { + __this__columns.add(other_element); + } + this.columns = __this__columns; + } + if (other.isSetAttributes()) { + Map __this__attributes = new HashMap(other.attributes.size()); + for (Map.Entry other_element : other.attributes.entrySet()) { + + ByteBuffer other_element_key = other_element.getKey(); + ByteBuffer other_element_value = other_element.getValue(); + + ByteBuffer __this__attributes_copy_key = other_element_key; + + ByteBuffer __this__attributes_copy_value = other_element_value; + + __this__attributes.put(__this__attributes_copy_key, __this__attributes_copy_value); + } + this.attributes = __this__attributes; + } + } + + public getRowsWithColumns_args deepCopy() { + return new getRowsWithColumns_args(this); + } + + @Override + public void clear() { + this.tableName = null; + this.rows = null; + this.columns = null; + this.attributes = null; + } + + /** + * name of table + */ + public byte[] getTableName() { + setTableName(org.apache.thrift.TBaseHelper.rightSize(tableName)); + return tableName == null ? null : tableName.array(); + } + + public ByteBuffer bufferForTableName() { + return org.apache.thrift.TBaseHelper.copyBinary(tableName); + } + + /** + * name of table + */ + public getRowsWithColumns_args setTableName(byte[] tableName) { + this.tableName = tableName == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(tableName, tableName.length)); + return this; + } + + public getRowsWithColumns_args setTableName(ByteBuffer tableName) { + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(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 getRowsSize() { + return (this.rows == null) ? 0 : this.rows.size(); + } + + public java.util.Iterator getRowsIterator() { + return (this.rows == null) ? null : this.rows.iterator(); + } + + public void addToRows(ByteBuffer elem) { + if (this.rows == null) { + this.rows = new ArrayList(); + } + this.rows.add(elem); + } + + /** + * row keys + */ + public List getRows() { + return this.rows; + } + + /** + * row keys + */ + public getRowsWithColumns_args setRows(List rows) { + this.rows = rows; + return this; + } + + public void unsetRows() { + this.rows = null; + } + + /** Returns true if field rows is set (has been assigned a value) and false otherwise */ + public boolean isSetRows() { + return this.rows != null; + } + + public void setRowsIsSet(boolean value) { + if (!value) { + this.rows = null; + } + } + + public int getColumnsSize() { + return (this.columns == null) ? 0 : this.columns.size(); + } + + public java.util.Iterator getColumnsIterator() { + return (this.columns == null) ? null : this.columns.iterator(); + } + + public void addToColumns(ByteBuffer elem) { + if (this.columns == null) { + this.columns = new ArrayList(); + } + this.columns.add(elem); + } + + /** + * List of columns to return, null for all columns + */ + public List getColumns() { + return this.columns; + } + + /** + * List of columns to return, null for all columns + */ + public getRowsWithColumns_args setColumns(List 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(); + } + this.attributes.put(key, val); + } + + /** + * Get attributes + */ + public Map getAttributes() { + return this.attributes; + } + + /** + * Get attributes + */ + public getRowsWithColumns_args setAttributes(Map 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; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case TABLE_NAME: + if (value == null) { + unsetTableName(); + } else { + setTableName((ByteBuffer)value); + } + break; + + case ROWS: + if (value == null) { + unsetRows(); + } else { + setRows((List)value); + } + break; + + case COLUMNS: + if (value == null) { + unsetColumns(); + } else { + setColumns((List)value); + } + break; + + case ATTRIBUTES: + if (value == null) { + unsetAttributes(); + } else { + setAttributes((Map)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case TABLE_NAME: + return getTableName(); + + case ROWS: + return getRows(); + + case COLUMNS: + return getColumns(); + + case ATTRIBUTES: + return getAttributes(); + + } + 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 ROWS: + return isSetRows(); + case COLUMNS: + return isSetColumns(); + case ATTRIBUTES: + return isSetAttributes(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getRowsWithColumns_args) + return this.equals((getRowsWithColumns_args)that); + return false; + } + + public boolean equals(getRowsWithColumns_args 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_rows = true && this.isSetRows(); + boolean that_present_rows = true && that.isSetRows(); + if (this_present_rows || that_present_rows) { + if (!(this_present_rows && that_present_rows)) + return false; + if (!this.rows.equals(that.rows)) + 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; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_tableName = true && (isSetTableName()); + list.add(present_tableName); + if (present_tableName) + list.add(tableName); + + boolean present_rows = true && (isSetRows()); + list.add(present_rows); + if (present_rows) + list.add(rows); + + 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); + + return list.hashCode(); + } + + @Override + public int compareTo(getRowsWithColumns_args 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(isSetRows()).compareTo(other.isSetRows()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRows()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.rows, other.rows); + 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; + } + } + 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("getRowsWithColumns_args("); + boolean first = true; + + sb.append("tableName:"); + if (this.tableName == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.tableName, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("rows:"); + if (this.rows == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.rows, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("columns:"); + if (this.columns == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.columns, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("attributes:"); + if (this.attributes == null) { + sb.append("null"); + } else { + sb.append(this.attributes); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 getRowsWithColumns_argsStandardSchemeFactory implements SchemeFactory { + public getRowsWithColumns_argsStandardScheme getScheme() { + return new getRowsWithColumns_argsStandardScheme(); + } + } + + private static class getRowsWithColumns_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getRowsWithColumns_args 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.STRING) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // ROWS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list252 = iprot.readListBegin(); + struct.rows = new ArrayList(_list252.size); + ByteBuffer _elem253; + for (int _i254 = 0; _i254 < _list252.size; ++_i254) + { + _elem253 = iprot.readBinary(); + struct.rows.add(_elem253); + } + iprot.readListEnd(); + } + struct.setRowsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // COLUMNS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list255 = iprot.readListBegin(); + struct.columns = new ArrayList(_list255.size); + ByteBuffer _elem256; + for (int _i257 = 0; _i257 < _list255.size; ++_i257) + { + _elem256 = iprot.readBinary(); + struct.columns.add(_elem256); + } + iprot.readListEnd(); + } + struct.setColumnsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // ATTRIBUTES + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map258 = iprot.readMapBegin(); + struct.attributes = new HashMap(2*_map258.size); + ByteBuffer _key259; + ByteBuffer _val260; + for (int _i261 = 0; _i261 < _map258.size; ++_i261) + { + _key259 = iprot.readBinary(); + _val260 = iprot.readBinary(); + struct.attributes.put(_key259, _val260); + } + iprot.readMapEnd(); + } + struct.setAttributesIsSet(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, getRowsWithColumns_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.tableName != null) { + oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC); + oprot.writeBinary(struct.tableName); + oprot.writeFieldEnd(); + } + if (struct.rows != null) { + oprot.writeFieldBegin(ROWS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.rows.size())); + for (ByteBuffer _iter262 : struct.rows) + { + oprot.writeBinary(_iter262); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.columns != null) { + oprot.writeFieldBegin(COLUMNS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.columns.size())); + for (ByteBuffer _iter263 : struct.columns) + { + oprot.writeBinary(_iter263); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.attributes != null) { + 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 _iter264 : struct.attributes.entrySet()) + { + oprot.writeBinary(_iter264.getKey()); + oprot.writeBinary(_iter264.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getRowsWithColumns_argsTupleSchemeFactory implements SchemeFactory { + public getRowsWithColumns_argsTupleScheme getScheme() { + return new getRowsWithColumns_argsTupleScheme(); + } + } + + private static class getRowsWithColumns_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getRowsWithColumns_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetTableName()) { + optionals.set(0); + } + if (struct.isSetRows()) { + optionals.set(1); + } + if (struct.isSetColumns()) { + optionals.set(2); + } + if (struct.isSetAttributes()) { + optionals.set(3); + } + oprot.writeBitSet(optionals, 4); + if (struct.isSetTableName()) { + oprot.writeBinary(struct.tableName); + } + if (struct.isSetRows()) { + { + oprot.writeI32(struct.rows.size()); + for (ByteBuffer _iter265 : struct.rows) + { + oprot.writeBinary(_iter265); + } + } + } + if (struct.isSetColumns()) { + { + oprot.writeI32(struct.columns.size()); + for (ByteBuffer _iter266 : struct.columns) + { + oprot.writeBinary(_iter266); + } + } + } + if (struct.isSetAttributes()) { + { + oprot.writeI32(struct.attributes.size()); + for (Map.Entry _iter267 : struct.attributes.entrySet()) + { + oprot.writeBinary(_iter267.getKey()); + oprot.writeBinary(_iter267.getValue()); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getRowsWithColumns_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(4); + if (incoming.get(0)) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(true); + } + if (incoming.get(1)) { + { + org.apache.thrift.protocol.TList _list268 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.rows = new ArrayList(_list268.size); + ByteBuffer _elem269; + for (int _i270 = 0; _i270 < _list268.size; ++_i270) + { + _elem269 = iprot.readBinary(); + struct.rows.add(_elem269); + } + } + struct.setRowsIsSet(true); + } + if (incoming.get(2)) { + { + org.apache.thrift.protocol.TList _list271 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.columns = new ArrayList(_list271.size); + ByteBuffer _elem272; + for (int _i273 = 0; _i273 < _list271.size; ++_i273) + { + _elem272 = iprot.readBinary(); + struct.columns.add(_elem272); + } + } + struct.setColumnsIsSet(true); + } + if (incoming.get(3)) { + { + org.apache.thrift.protocol.TMap _map274 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.attributes = new HashMap(2*_map274.size); + ByteBuffer _key275; + ByteBuffer _val276; + for (int _i277 = 0; _i277 < _map274.size; ++_i277) + { + _key275 = iprot.readBinary(); + _val276 = iprot.readBinary(); + struct.attributes.put(_key275, _val276); + } + } + struct.setAttributesIsSet(true); + } + } + } + + } + + public static class getRowsWithColumns_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getRowsWithColumns_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0); + private static final org.apache.thrift.protocol.TField IO_FIELD_DESC = new org.apache.thrift.protocol.TField("io", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getRowsWithColumns_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getRowsWithColumns_resultTupleSchemeFactory()); + } + + public List success; // required + public IOError io; // 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 { + SUCCESS((short)0, "success"), + IO((short)1, "io"); + + private static final Map byName = new HashMap(); + + 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 0: // SUCCESS + return SUCCESS; + case 1: // IO + return IO; + 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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + 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, TRowResult.class)))); + tmpMap.put(_Fields.IO, new org.apache.thrift.meta_data.FieldMetaData("io", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRowsWithColumns_result.class, metaDataMap); + } + + public getRowsWithColumns_result() { + } + + public getRowsWithColumns_result( + List success, + IOError io) + { + this(); + this.success = success; + this.io = io; + } + + /** + * Performs a deep copy on other. + */ + public getRowsWithColumns_result(getRowsWithColumns_result other) { + if (other.isSetSuccess()) { + List __this__success = new ArrayList(other.success.size()); + for (TRowResult other_element : other.success) { + __this__success.add(new TRowResult(other_element)); + } + this.success = __this__success; + } + if (other.isSetIo()) { + this.io = new IOError(other.io); + } + } + + public getRowsWithColumns_result deepCopy() { + return new getRowsWithColumns_result(this); + } + + @Override + public void clear() { + this.success = null; + this.io = null; + } + + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + public java.util.Iterator getSuccessIterator() { + return (this.success == null) ? null : this.success.iterator(); + } + + public void addToSuccess(TRowResult elem) { + if (this.success == null) { + this.success = new ArrayList(); + } + this.success.add(elem); + } + + public List getSuccess() { + return this.success; + } + + public getRowsWithColumns_result setSuccess(List success) { + this.success = success; + return this; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public IOError getIo() { + return this.io; + } + + public getRowsWithColumns_result setIo(IOError io) { + this.io = io; + return this; + } + + public void unsetIo() { + this.io = null; + } + + /** Returns true if field io is set (has been assigned a value) and false otherwise */ + public boolean isSetIo() { + return this.io != null; + } + + public void setIoIsSet(boolean value) { + if (!value) { + this.io = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((List)value); + } + break; + + case IO: + if (value == null) { + unsetIo(); + } else { + setIo((IOError)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + case IO: + return getIo(); + + } + 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 SUCCESS: + return isSetSuccess(); + case IO: + return isSetIo(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getRowsWithColumns_result) + return this.equals((getRowsWithColumns_result)that); + return false; + } + + public boolean equals(getRowsWithColumns_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + boolean this_present_io = true && this.isSetIo(); + boolean that_present_io = true && that.isSetIo(); + if (this_present_io || that_present_io) { + if (!(this_present_io && that_present_io)) + return false; + if (!this.io.equals(that.io)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + boolean present_io = true && (isSetIo()); + list.add(present_io); + if (present_io) + list.add(io); + + return list.hashCode(); + } + + @Override + public int compareTo(getRowsWithColumns_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIo()).compareTo(other.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, other.io); + 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("getRowsWithColumns_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + if (!first) sb.append(", "); + sb.append("io:"); + if (this.io == null) { + sb.append("null"); + } else { + sb.append(this.io); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 getRowsWithColumns_resultStandardSchemeFactory implements SchemeFactory { + public getRowsWithColumns_resultStandardScheme getScheme() { + return new getRowsWithColumns_resultStandardScheme(); + } + } + + private static class getRowsWithColumns_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getRowsWithColumns_result 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 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list278 = iprot.readListBegin(); + struct.success = new ArrayList(_list278.size); + TRowResult _elem279; + for (int _i280 = 0; _i280 < _list278.size; ++_i280) + { + _elem279 = new TRowResult(); + _elem279.read(iprot); + struct.success.add(_elem279); + } + iprot.readListEnd(); + } + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IO + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(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, getRowsWithColumns_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); + for (TRowResult _iter281 : struct.success) + { + _iter281.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.io != null) { + oprot.writeFieldBegin(IO_FIELD_DESC); + struct.io.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getRowsWithColumns_resultTupleSchemeFactory implements SchemeFactory { + public getRowsWithColumns_resultTupleScheme getScheme() { + return new getRowsWithColumns_resultTupleScheme(); + } + } + + private static class getRowsWithColumns_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getRowsWithColumns_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIo()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + { + oprot.writeI32(struct.success.size()); + for (TRowResult _iter282 : struct.success) + { + _iter282.write(oprot); + } + } + } + if (struct.isSetIo()) { + struct.io.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getRowsWithColumns_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list283 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new ArrayList(_list283.size); + TRowResult _elem284; + for (int _i285 = 0; _i285 < _list283.size; ++_i285) + { + _elem284 = new TRowResult(); + _elem284.read(iprot); + struct.success.add(_elem284); + } + } + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } + } + } + + } + + public static class getRowsTs_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getRowsTs_args"); + + private static final org.apache.thrift.protocol.TField TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tableName", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField ROWS_FIELD_DESC = new org.apache.thrift.protocol.TField("rows", org.apache.thrift.protocol.TType.LIST, (short)2); + 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)3); + 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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getRowsTs_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getRowsTs_argsTupleSchemeFactory()); + } + + /** + * name of the table + */ + public ByteBuffer tableName; // required + /** + * row keys + */ + public List rows; // required + /** + * timestamp + */ + public long timestamp; // required + /** + * Get attributes + */ + public Map attributes; // 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 { + /** + * name of the table + */ + TABLE_NAME((short)1, "tableName"), + /** + * row keys + */ + ROWS((short)2, "rows"), + /** + * timestamp + */ + TIMESTAMP((short)3, "timestamp"), + /** + * Get attributes + */ + ATTRIBUTES((short)4, "attributes"); + + private static final Map byName = new HashMap(); + + 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: // ROWS + return ROWS; + case 3: // TIMESTAMP + return TIMESTAMP; + case 4: // ATTRIBUTES + return ATTRIBUTES; + 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 int __TIMESTAMP_ISSET_ID = 0; + private byte __isset_bitfield = 0; + 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.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.ROWS, new org.apache.thrift.meta_data.FieldMetaData("rows", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text")))); + tmpMap.put(_Fields.TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("timestamp", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.ATTRIBUTES, new org.apache.thrift.meta_data.FieldMetaData("attributes", org.apache.thrift.TFieldRequirementType.DEFAULT, + 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 , "Text"), + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text")))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRowsTs_args.class, metaDataMap); + } + + public getRowsTs_args() { + } + + public getRowsTs_args( + ByteBuffer tableName, + List rows, + long timestamp, + Map attributes) + { + this(); + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(tableName); + this.rows = rows; + this.timestamp = timestamp; + setTimestampIsSet(true); + this.attributes = attributes; + } + + /** + * Performs a deep copy on other. + */ + public getRowsTs_args(getRowsTs_args other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetTableName()) { + this.tableName = other.tableName; + } + if (other.isSetRows()) { + List __this__rows = new ArrayList(other.rows.size()); + for (ByteBuffer other_element : other.rows) { + __this__rows.add(other_element); + } + this.rows = __this__rows; + } + this.timestamp = other.timestamp; + if (other.isSetAttributes()) { + Map __this__attributes = new HashMap(other.attributes.size()); + for (Map.Entry other_element : other.attributes.entrySet()) { + + ByteBuffer other_element_key = other_element.getKey(); + ByteBuffer other_element_value = other_element.getValue(); + + ByteBuffer __this__attributes_copy_key = other_element_key; + + ByteBuffer __this__attributes_copy_value = other_element_value; + + __this__attributes.put(__this__attributes_copy_key, __this__attributes_copy_value); + } + this.attributes = __this__attributes; + } + } + + public getRowsTs_args deepCopy() { + return new getRowsTs_args(this); + } + + @Override + public void clear() { + this.tableName = null; + this.rows = null; + setTimestampIsSet(false); + this.timestamp = 0; + this.attributes = null; + } + + /** + * name of the table + */ + public byte[] getTableName() { + setTableName(org.apache.thrift.TBaseHelper.rightSize(tableName)); + return tableName == null ? null : tableName.array(); + } + + public ByteBuffer bufferForTableName() { + return org.apache.thrift.TBaseHelper.copyBinary(tableName); + } + + /** + * name of the table + */ + public getRowsTs_args setTableName(byte[] tableName) { + this.tableName = tableName == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(tableName, tableName.length)); + return this; + } + + public getRowsTs_args setTableName(ByteBuffer tableName) { + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(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 getRowsSize() { + return (this.rows == null) ? 0 : this.rows.size(); + } + + public java.util.Iterator getRowsIterator() { + return (this.rows == null) ? null : this.rows.iterator(); + } + + public void addToRows(ByteBuffer elem) { + if (this.rows == null) { + this.rows = new ArrayList(); + } + this.rows.add(elem); + } + + /** + * row keys + */ + public List getRows() { + return this.rows; + } + + /** + * row keys + */ + public getRowsTs_args setRows(List rows) { + this.rows = rows; + return this; + } + + public void unsetRows() { + this.rows = null; + } + + /** Returns true if field rows is set (has been assigned a value) and false otherwise */ + public boolean isSetRows() { + return this.rows != null; + } + + public void setRowsIsSet(boolean value) { + if (!value) { + this.rows = null; + } + } + + /** + * timestamp + */ + public long getTimestamp() { + return this.timestamp; + } + + /** + * timestamp + */ + public getRowsTs_args setTimestamp(long timestamp) { + this.timestamp = timestamp; + setTimestampIsSet(true); + return this; + } + + public void unsetTimestamp() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); + } + + /** Returns true if field timestamp is set (has been assigned a value) and false otherwise */ + public boolean isSetTimestamp() { + return EncodingUtils.testBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); + } + + public void setTimestampIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TIMESTAMP_ISSET_ID, value); + } + + 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(); + } + this.attributes.put(key, val); + } + + /** + * Get attributes + */ + public Map getAttributes() { + return this.attributes; + } + + /** + * Get attributes + */ + public getRowsTs_args setAttributes(Map 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; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case TABLE_NAME: + if (value == null) { + unsetTableName(); + } else { + setTableName((ByteBuffer)value); + } + break; + + case ROWS: + if (value == null) { + unsetRows(); + } else { + setRows((List)value); + } + break; + + case TIMESTAMP: + if (value == null) { + unsetTimestamp(); + } else { + setTimestamp((Long)value); + } + break; + + case ATTRIBUTES: + if (value == null) { + unsetAttributes(); + } else { + setAttributes((Map)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case TABLE_NAME: + return getTableName(); + + case ROWS: + return getRows(); + + case TIMESTAMP: + return getTimestamp(); + + case ATTRIBUTES: + return getAttributes(); + + } + 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 ROWS: + return isSetRows(); + case TIMESTAMP: + return isSetTimestamp(); + case ATTRIBUTES: + return isSetAttributes(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getRowsTs_args) + return this.equals((getRowsTs_args)that); + return false; + } + + public boolean equals(getRowsTs_args 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_rows = true && this.isSetRows(); + boolean that_present_rows = true && that.isSetRows(); + if (this_present_rows || that_present_rows) { + if (!(this_present_rows && that_present_rows)) + return false; + if (!this.rows.equals(that.rows)) + return false; + } + + boolean this_present_timestamp = true; + boolean that_present_timestamp = true; + if (this_present_timestamp || that_present_timestamp) { + if (!(this_present_timestamp && that_present_timestamp)) + return false; + if (this.timestamp != that.timestamp) + 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; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_tableName = true && (isSetTableName()); + list.add(present_tableName); + if (present_tableName) + list.add(tableName); + + boolean present_rows = true && (isSetRows()); + list.add(present_rows); + if (present_rows) + list.add(rows); + + boolean present_timestamp = true; + list.add(present_timestamp); + if (present_timestamp) + list.add(timestamp); + + boolean present_attributes = true && (isSetAttributes()); + list.add(present_attributes); + if (present_attributes) + list.add(attributes); + + return list.hashCode(); + } + + @Override + public int compareTo(getRowsTs_args 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(isSetRows()).compareTo(other.isSetRows()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRows()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.rows, other.rows); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(other.isSetTimestamp()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTimestamp()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timestamp, other.timestamp); + 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; + } + } + 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("getRowsTs_args("); + boolean first = true; + + sb.append("tableName:"); + if (this.tableName == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.tableName, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("rows:"); + if (this.rows == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.rows, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("timestamp:"); + sb.append(this.timestamp); + first = false; + if (!first) sb.append(", "); + sb.append("attributes:"); + if (this.attributes == null) { + sb.append("null"); + } else { + sb.append(this.attributes); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 { + // 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); + } + } + + private static class getRowsTs_argsStandardSchemeFactory implements SchemeFactory { + public getRowsTs_argsStandardScheme getScheme() { + return new getRowsTs_argsStandardScheme(); + } + } + + private static class getRowsTs_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getRowsTs_args 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.STRING) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // ROWS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list286 = iprot.readListBegin(); + struct.rows = new ArrayList(_list286.size); + ByteBuffer _elem287; + for (int _i288 = 0; _i288 < _list286.size; ++_i288) + { + _elem287 = iprot.readBinary(); + struct.rows.add(_elem287); + } + iprot.readListEnd(); + } + struct.setRowsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // TIMESTAMP + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.timestamp = iprot.readI64(); + struct.setTimestampIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // ATTRIBUTES + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map289 = iprot.readMapBegin(); + struct.attributes = new HashMap(2*_map289.size); + ByteBuffer _key290; + ByteBuffer _val291; + for (int _i292 = 0; _i292 < _map289.size; ++_i292) + { + _key290 = iprot.readBinary(); + _val291 = iprot.readBinary(); + struct.attributes.put(_key290, _val291); + } + iprot.readMapEnd(); + } + struct.setAttributesIsSet(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, getRowsTs_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.tableName != null) { + oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC); + oprot.writeBinary(struct.tableName); + oprot.writeFieldEnd(); + } + if (struct.rows != null) { + oprot.writeFieldBegin(ROWS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.rows.size())); + for (ByteBuffer _iter293 : struct.rows) + { + oprot.writeBinary(_iter293); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC); + oprot.writeI64(struct.timestamp); + oprot.writeFieldEnd(); + if (struct.attributes != null) { + 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 _iter294 : struct.attributes.entrySet()) + { + oprot.writeBinary(_iter294.getKey()); + oprot.writeBinary(_iter294.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getRowsTs_argsTupleSchemeFactory implements SchemeFactory { + public getRowsTs_argsTupleScheme getScheme() { + return new getRowsTs_argsTupleScheme(); + } + } + + private static class getRowsTs_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getRowsTs_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetTableName()) { + optionals.set(0); + } + if (struct.isSetRows()) { + optionals.set(1); + } + if (struct.isSetTimestamp()) { + optionals.set(2); + } + if (struct.isSetAttributes()) { + optionals.set(3); + } + oprot.writeBitSet(optionals, 4); + if (struct.isSetTableName()) { + oprot.writeBinary(struct.tableName); + } + if (struct.isSetRows()) { + { + oprot.writeI32(struct.rows.size()); + for (ByteBuffer _iter295 : struct.rows) + { + oprot.writeBinary(_iter295); + } + } + } + if (struct.isSetTimestamp()) { + oprot.writeI64(struct.timestamp); + } + if (struct.isSetAttributes()) { + { + oprot.writeI32(struct.attributes.size()); + for (Map.Entry _iter296 : struct.attributes.entrySet()) + { + oprot.writeBinary(_iter296.getKey()); + oprot.writeBinary(_iter296.getValue()); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getRowsTs_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(4); + if (incoming.get(0)) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(true); + } + if (incoming.get(1)) { + { + org.apache.thrift.protocol.TList _list297 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.rows = new ArrayList(_list297.size); + ByteBuffer _elem298; + for (int _i299 = 0; _i299 < _list297.size; ++_i299) + { + _elem298 = iprot.readBinary(); + struct.rows.add(_elem298); + } + } + struct.setRowsIsSet(true); + } + if (incoming.get(2)) { + struct.timestamp = iprot.readI64(); + struct.setTimestampIsSet(true); + } + if (incoming.get(3)) { + { + org.apache.thrift.protocol.TMap _map300 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.attributes = new HashMap(2*_map300.size); + ByteBuffer _key301; + ByteBuffer _val302; + for (int _i303 = 0; _i303 < _map300.size; ++_i303) + { + _key301 = iprot.readBinary(); + _val302 = iprot.readBinary(); + struct.attributes.put(_key301, _val302); + } + } + struct.setAttributesIsSet(true); + } + } + } + + } + + public static class getRowsTs_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getRowsTs_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0); + private static final org.apache.thrift.protocol.TField IO_FIELD_DESC = new org.apache.thrift.protocol.TField("io", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getRowsTs_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getRowsTs_resultTupleSchemeFactory()); + } + + public List success; // required + public IOError io; // 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 { + SUCCESS((short)0, "success"), + IO((short)1, "io"); + + private static final Map byName = new HashMap(); + + 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 0: // SUCCESS + return SUCCESS; + case 1: // IO + return IO; + 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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + 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, TRowResult.class)))); + tmpMap.put(_Fields.IO, new org.apache.thrift.meta_data.FieldMetaData("io", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRowsTs_result.class, metaDataMap); + } + + public getRowsTs_result() { + } + + public getRowsTs_result( + List success, + IOError io) + { + this(); + this.success = success; + this.io = io; + } + + /** + * Performs a deep copy on other. + */ + public getRowsTs_result(getRowsTs_result other) { + if (other.isSetSuccess()) { + List __this__success = new ArrayList(other.success.size()); + for (TRowResult other_element : other.success) { + __this__success.add(new TRowResult(other_element)); + } + this.success = __this__success; + } + if (other.isSetIo()) { + this.io = new IOError(other.io); + } + } + + public getRowsTs_result deepCopy() { + return new getRowsTs_result(this); + } + + @Override + public void clear() { + this.success = null; + this.io = null; + } + + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + public java.util.Iterator getSuccessIterator() { + return (this.success == null) ? null : this.success.iterator(); + } + + public void addToSuccess(TRowResult elem) { + if (this.success == null) { + this.success = new ArrayList(); + } + this.success.add(elem); + } + + public List getSuccess() { + return this.success; + } + + public getRowsTs_result setSuccess(List success) { + this.success = success; + return this; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public IOError getIo() { + return this.io; + } + + public getRowsTs_result setIo(IOError io) { + this.io = io; + return this; + } + + public void unsetIo() { + this.io = null; + } + + /** Returns true if field io is set (has been assigned a value) and false otherwise */ + public boolean isSetIo() { + return this.io != null; + } + + public void setIoIsSet(boolean value) { + if (!value) { + this.io = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((List)value); + } + break; + + case IO: + if (value == null) { + unsetIo(); + } else { + setIo((IOError)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + case IO: + return getIo(); + + } + 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 SUCCESS: + return isSetSuccess(); + case IO: + return isSetIo(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getRowsTs_result) + return this.equals((getRowsTs_result)that); + return false; + } + + public boolean equals(getRowsTs_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + boolean this_present_io = true && this.isSetIo(); + boolean that_present_io = true && that.isSetIo(); + if (this_present_io || that_present_io) { + if (!(this_present_io && that_present_io)) + return false; + if (!this.io.equals(that.io)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + boolean present_io = true && (isSetIo()); + list.add(present_io); + if (present_io) + list.add(io); + + return list.hashCode(); + } + + @Override + public int compareTo(getRowsTs_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIo()).compareTo(other.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, other.io); + 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("getRowsTs_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + if (!first) sb.append(", "); + sb.append("io:"); + if (this.io == null) { + sb.append("null"); + } else { + sb.append(this.io); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 getRowsTs_resultStandardSchemeFactory implements SchemeFactory { + public getRowsTs_resultStandardScheme getScheme() { + return new getRowsTs_resultStandardScheme(); + } + } + + private static class getRowsTs_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getRowsTs_result 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 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list304 = iprot.readListBegin(); + struct.success = new ArrayList(_list304.size); + TRowResult _elem305; + for (int _i306 = 0; _i306 < _list304.size; ++_i306) + { + _elem305 = new TRowResult(); + _elem305.read(iprot); + struct.success.add(_elem305); + } + iprot.readListEnd(); + } + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IO + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(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, getRowsTs_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); + for (TRowResult _iter307 : struct.success) + { + _iter307.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.io != null) { + oprot.writeFieldBegin(IO_FIELD_DESC); + struct.io.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getRowsTs_resultTupleSchemeFactory implements SchemeFactory { + public getRowsTs_resultTupleScheme getScheme() { + return new getRowsTs_resultTupleScheme(); + } + } + + private static class getRowsTs_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getRowsTs_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIo()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + { + oprot.writeI32(struct.success.size()); + for (TRowResult _iter308 : struct.success) + { + _iter308.write(oprot); + } + } + } + if (struct.isSetIo()) { + struct.io.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getRowsTs_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list309 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new ArrayList(_list309.size); + TRowResult _elem310; + for (int _i311 = 0; _i311 < _list309.size; ++_i311) + { + _elem310 = new TRowResult(); + _elem310.read(iprot); + struct.success.add(_elem310); + } + } + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } + } + } + + } + + public static class getRowsWithColumnsTs_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getRowsWithColumnsTs_args"); + + private static final org.apache.thrift.protocol.TField TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tableName", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField ROWS_FIELD_DESC = new org.apache.thrift.protocol.TField("rows", org.apache.thrift.protocol.TType.LIST, (short)2); + 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)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 ATTRIBUTES_FIELD_DESC = new org.apache.thrift.protocol.TField("attributes", org.apache.thrift.protocol.TType.MAP, (short)5); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getRowsWithColumnsTs_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getRowsWithColumnsTs_argsTupleSchemeFactory()); + } + + /** + * name of table + */ + public ByteBuffer tableName; // required + /** + * row keys + */ + public List rows; // required + /** + * List of columns to return, null for all columns + */ + public List columns; // required + public long timestamp; // required + /** + * Get attributes + */ + public Map attributes; // 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 { + /** + * name of table + */ + TABLE_NAME((short)1, "tableName"), + /** + * row keys + */ + ROWS((short)2, "rows"), + /** + * List of columns to return, null for all columns + */ + COLUMNS((short)3, "columns"), + TIMESTAMP((short)4, "timestamp"), + /** + * Get attributes + */ + ATTRIBUTES((short)5, "attributes"); + + private static final Map byName = new HashMap(); + + 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: // ROWS + return ROWS; + case 3: // COLUMNS + return COLUMNS; + case 4: // TIMESTAMP + return TIMESTAMP; + case 5: // ATTRIBUTES + return ATTRIBUTES; + 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 int __TIMESTAMP_ISSET_ID = 0; + private byte __isset_bitfield = 0; + 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.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.ROWS, new org.apache.thrift.meta_data.FieldMetaData("rows", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text")))); + tmpMap.put(_Fields.COLUMNS, new org.apache.thrift.meta_data.FieldMetaData("columns", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text")))); + tmpMap.put(_Fields.TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("timestamp", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.ATTRIBUTES, new org.apache.thrift.meta_data.FieldMetaData("attributes", org.apache.thrift.TFieldRequirementType.DEFAULT, + 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 , "Text"), + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text")))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRowsWithColumnsTs_args.class, metaDataMap); + } + + public getRowsWithColumnsTs_args() { + } + + public getRowsWithColumnsTs_args( + ByteBuffer tableName, + List rows, + List columns, + long timestamp, + Map attributes) + { + this(); + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(tableName); + this.rows = rows; + this.columns = columns; + this.timestamp = timestamp; + setTimestampIsSet(true); + this.attributes = attributes; + } + + /** + * Performs a deep copy on other. + */ + public getRowsWithColumnsTs_args(getRowsWithColumnsTs_args other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetTableName()) { + this.tableName = other.tableName; + } + if (other.isSetRows()) { + List __this__rows = new ArrayList(other.rows.size()); + for (ByteBuffer other_element : other.rows) { + __this__rows.add(other_element); + } + this.rows = __this__rows; + } + if (other.isSetColumns()) { + List __this__columns = new ArrayList(other.columns.size()); + for (ByteBuffer other_element : other.columns) { + __this__columns.add(other_element); + } + this.columns = __this__columns; + } + this.timestamp = other.timestamp; + if (other.isSetAttributes()) { + Map __this__attributes = new HashMap(other.attributes.size()); + for (Map.Entry other_element : other.attributes.entrySet()) { + + ByteBuffer other_element_key = other_element.getKey(); + ByteBuffer other_element_value = other_element.getValue(); + + ByteBuffer __this__attributes_copy_key = other_element_key; + + ByteBuffer __this__attributes_copy_value = other_element_value; + + __this__attributes.put(__this__attributes_copy_key, __this__attributes_copy_value); + } + this.attributes = __this__attributes; + } + } + + public getRowsWithColumnsTs_args deepCopy() { + return new getRowsWithColumnsTs_args(this); + } + + @Override + public void clear() { + this.tableName = null; + this.rows = null; + this.columns = null; + setTimestampIsSet(false); + this.timestamp = 0; + this.attributes = null; + } + + /** + * name of table + */ + public byte[] getTableName() { + setTableName(org.apache.thrift.TBaseHelper.rightSize(tableName)); + return tableName == null ? null : tableName.array(); + } + + public ByteBuffer bufferForTableName() { + return org.apache.thrift.TBaseHelper.copyBinary(tableName); + } + + /** + * name of table + */ + public getRowsWithColumnsTs_args setTableName(byte[] tableName) { + this.tableName = tableName == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(tableName, tableName.length)); + return this; + } + + public getRowsWithColumnsTs_args setTableName(ByteBuffer tableName) { + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(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 getRowsSize() { + return (this.rows == null) ? 0 : this.rows.size(); + } + + public java.util.Iterator getRowsIterator() { + return (this.rows == null) ? null : this.rows.iterator(); + } + + public void addToRows(ByteBuffer elem) { + if (this.rows == null) { + this.rows = new ArrayList(); + } + this.rows.add(elem); + } + + /** + * row keys + */ + public List getRows() { + return this.rows; + } + + /** + * row keys + */ + public getRowsWithColumnsTs_args setRows(List rows) { + this.rows = rows; + return this; + } + + public void unsetRows() { + this.rows = null; + } + + /** Returns true if field rows is set (has been assigned a value) and false otherwise */ + public boolean isSetRows() { + return this.rows != null; + } + + public void setRowsIsSet(boolean value) { + if (!value) { + this.rows = null; + } + } + + public int getColumnsSize() { + return (this.columns == null) ? 0 : this.columns.size(); + } + + public java.util.Iterator getColumnsIterator() { + return (this.columns == null) ? null : this.columns.iterator(); + } + + public void addToColumns(ByteBuffer elem) { + if (this.columns == null) { + this.columns = new ArrayList(); + } + this.columns.add(elem); + } + + /** + * List of columns to return, null for all columns + */ + public List getColumns() { + return this.columns; + } + + /** + * List of columns to return, null for all columns + */ + public getRowsWithColumnsTs_args setColumns(List 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 long getTimestamp() { + return this.timestamp; + } + + public getRowsWithColumnsTs_args setTimestamp(long timestamp) { + this.timestamp = timestamp; + setTimestampIsSet(true); + return this; + } + + public void unsetTimestamp() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); + } + + /** Returns true if field timestamp is set (has been assigned a value) and false otherwise */ + public boolean isSetTimestamp() { + return EncodingUtils.testBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); + } + + public void setTimestampIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TIMESTAMP_ISSET_ID, value); + } + + 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(); + } + this.attributes.put(key, val); + } + + /** + * Get attributes + */ + public Map getAttributes() { + return this.attributes; + } + + /** + * Get attributes + */ + public getRowsWithColumnsTs_args setAttributes(Map 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; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case TABLE_NAME: + if (value == null) { + unsetTableName(); + } else { + setTableName((ByteBuffer)value); + } + break; + + case ROWS: + if (value == null) { + unsetRows(); + } else { + setRows((List)value); + } + break; + + case COLUMNS: + if (value == null) { + unsetColumns(); + } else { + setColumns((List)value); + } + break; + + case TIMESTAMP: + if (value == null) { + unsetTimestamp(); + } else { + setTimestamp((Long)value); + } + break; + + case ATTRIBUTES: + if (value == null) { + unsetAttributes(); + } else { + setAttributes((Map)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case TABLE_NAME: + return getTableName(); + + case ROWS: + return getRows(); + + case COLUMNS: + return getColumns(); + + case TIMESTAMP: + return getTimestamp(); + + case ATTRIBUTES: + return getAttributes(); + + } + 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 ROWS: + return isSetRows(); + case COLUMNS: + return isSetColumns(); + case TIMESTAMP: + return isSetTimestamp(); + case ATTRIBUTES: + return isSetAttributes(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getRowsWithColumnsTs_args) + return this.equals((getRowsWithColumnsTs_args)that); + return false; + } + + public boolean equals(getRowsWithColumnsTs_args 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_rows = true && this.isSetRows(); + boolean that_present_rows = true && that.isSetRows(); + if (this_present_rows || that_present_rows) { + if (!(this_present_rows && that_present_rows)) + return false; + if (!this.rows.equals(that.rows)) + 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_timestamp = true; + boolean that_present_timestamp = true; + if (this_present_timestamp || that_present_timestamp) { + if (!(this_present_timestamp && that_present_timestamp)) + return false; + if (this.timestamp != that.timestamp) + 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; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_tableName = true && (isSetTableName()); + list.add(present_tableName); + if (present_tableName) + list.add(tableName); + + boolean present_rows = true && (isSetRows()); + list.add(present_rows); + if (present_rows) + list.add(rows); + + boolean present_columns = true && (isSetColumns()); + list.add(present_columns); + if (present_columns) + list.add(columns); + + boolean present_timestamp = true; + list.add(present_timestamp); + if (present_timestamp) + list.add(timestamp); + + boolean present_attributes = true && (isSetAttributes()); + list.add(present_attributes); + if (present_attributes) + list.add(attributes); + + return list.hashCode(); + } + + @Override + public int compareTo(getRowsWithColumnsTs_args 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(isSetRows()).compareTo(other.isSetRows()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRows()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.rows, other.rows); + 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(isSetTimestamp()).compareTo(other.isSetTimestamp()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTimestamp()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timestamp, other.timestamp); + 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; + } + } + 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("getRowsWithColumnsTs_args("); + boolean first = true; + + sb.append("tableName:"); + if (this.tableName == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.tableName, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("rows:"); + if (this.rows == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.rows, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("columns:"); + if (this.columns == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.columns, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("timestamp:"); + sb.append(this.timestamp); + first = false; + if (!first) sb.append(", "); + sb.append("attributes:"); + if (this.attributes == null) { + sb.append("null"); + } else { + sb.append(this.attributes); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 { + // 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); + } + } + + private static class getRowsWithColumnsTs_argsStandardSchemeFactory implements SchemeFactory { + public getRowsWithColumnsTs_argsStandardScheme getScheme() { + return new getRowsWithColumnsTs_argsStandardScheme(); + } + } + + private static class getRowsWithColumnsTs_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getRowsWithColumnsTs_args 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.STRING) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // ROWS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list312 = iprot.readListBegin(); + struct.rows = new ArrayList(_list312.size); + ByteBuffer _elem313; + for (int _i314 = 0; _i314 < _list312.size; ++_i314) + { + _elem313 = iprot.readBinary(); + struct.rows.add(_elem313); + } + iprot.readListEnd(); + } + struct.setRowsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // COLUMNS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list315 = iprot.readListBegin(); + struct.columns = new ArrayList(_list315.size); + ByteBuffer _elem316; + for (int _i317 = 0; _i317 < _list315.size; ++_i317) + { + _elem316 = iprot.readBinary(); + struct.columns.add(_elem316); + } + iprot.readListEnd(); + } + struct.setColumnsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // TIMESTAMP + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.timestamp = iprot.readI64(); + struct.setTimestampIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // ATTRIBUTES + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map318 = iprot.readMapBegin(); + struct.attributes = new HashMap(2*_map318.size); + ByteBuffer _key319; + ByteBuffer _val320; + for (int _i321 = 0; _i321 < _map318.size; ++_i321) + { + _key319 = iprot.readBinary(); + _val320 = iprot.readBinary(); + struct.attributes.put(_key319, _val320); + } + iprot.readMapEnd(); + } + struct.setAttributesIsSet(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, getRowsWithColumnsTs_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.tableName != null) { + oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC); + oprot.writeBinary(struct.tableName); + oprot.writeFieldEnd(); + } + if (struct.rows != null) { + oprot.writeFieldBegin(ROWS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.rows.size())); + for (ByteBuffer _iter322 : struct.rows) + { + oprot.writeBinary(_iter322); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.columns != null) { + oprot.writeFieldBegin(COLUMNS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.columns.size())); + for (ByteBuffer _iter323 : struct.columns) + { + oprot.writeBinary(_iter323); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC); + oprot.writeI64(struct.timestamp); + oprot.writeFieldEnd(); + if (struct.attributes != null) { + 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 _iter324 : struct.attributes.entrySet()) + { + oprot.writeBinary(_iter324.getKey()); + oprot.writeBinary(_iter324.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getRowsWithColumnsTs_argsTupleSchemeFactory implements SchemeFactory { + public getRowsWithColumnsTs_argsTupleScheme getScheme() { + return new getRowsWithColumnsTs_argsTupleScheme(); + } + } + + private static class getRowsWithColumnsTs_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getRowsWithColumnsTs_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetTableName()) { + optionals.set(0); + } + if (struct.isSetRows()) { + optionals.set(1); + } + if (struct.isSetColumns()) { + optionals.set(2); + } + if (struct.isSetTimestamp()) { + optionals.set(3); + } + if (struct.isSetAttributes()) { + optionals.set(4); + } + oprot.writeBitSet(optionals, 5); + if (struct.isSetTableName()) { + oprot.writeBinary(struct.tableName); + } + if (struct.isSetRows()) { + { + oprot.writeI32(struct.rows.size()); + for (ByteBuffer _iter325 : struct.rows) + { + oprot.writeBinary(_iter325); + } + } + } + if (struct.isSetColumns()) { + { + oprot.writeI32(struct.columns.size()); + for (ByteBuffer _iter326 : struct.columns) + { + oprot.writeBinary(_iter326); + } + } + } + if (struct.isSetTimestamp()) { + oprot.writeI64(struct.timestamp); + } + if (struct.isSetAttributes()) { + { + oprot.writeI32(struct.attributes.size()); + for (Map.Entry _iter327 : struct.attributes.entrySet()) + { + oprot.writeBinary(_iter327.getKey()); + oprot.writeBinary(_iter327.getValue()); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getRowsWithColumnsTs_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(5); + if (incoming.get(0)) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(true); + } + if (incoming.get(1)) { + { + org.apache.thrift.protocol.TList _list328 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.rows = new ArrayList(_list328.size); + ByteBuffer _elem329; + for (int _i330 = 0; _i330 < _list328.size; ++_i330) + { + _elem329 = iprot.readBinary(); + struct.rows.add(_elem329); + } + } + struct.setRowsIsSet(true); + } + if (incoming.get(2)) { + { + org.apache.thrift.protocol.TList _list331 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.columns = new ArrayList(_list331.size); + ByteBuffer _elem332; + for (int _i333 = 0; _i333 < _list331.size; ++_i333) + { + _elem332 = iprot.readBinary(); + struct.columns.add(_elem332); + } + } + struct.setColumnsIsSet(true); + } + if (incoming.get(3)) { + struct.timestamp = iprot.readI64(); + struct.setTimestampIsSet(true); + } + if (incoming.get(4)) { + { + org.apache.thrift.protocol.TMap _map334 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.attributes = new HashMap(2*_map334.size); + ByteBuffer _key335; + ByteBuffer _val336; + for (int _i337 = 0; _i337 < _map334.size; ++_i337) + { + _key335 = iprot.readBinary(); + _val336 = iprot.readBinary(); + struct.attributes.put(_key335, _val336); + } + } + struct.setAttributesIsSet(true); + } + } + } + + } + + public static class getRowsWithColumnsTs_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getRowsWithColumnsTs_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0); + private static final org.apache.thrift.protocol.TField IO_FIELD_DESC = new org.apache.thrift.protocol.TField("io", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getRowsWithColumnsTs_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getRowsWithColumnsTs_resultTupleSchemeFactory()); + } + + public List success; // required + public IOError io; // 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 { + SUCCESS((short)0, "success"), + IO((short)1, "io"); + + private static final Map byName = new HashMap(); + + 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 0: // SUCCESS + return SUCCESS; + case 1: // IO + return IO; + 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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + 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, TRowResult.class)))); + tmpMap.put(_Fields.IO, new org.apache.thrift.meta_data.FieldMetaData("io", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRowsWithColumnsTs_result.class, metaDataMap); + } + + public getRowsWithColumnsTs_result() { + } + + public getRowsWithColumnsTs_result( + List success, + IOError io) + { + this(); + this.success = success; + this.io = io; + } + + /** + * Performs a deep copy on other. + */ + public getRowsWithColumnsTs_result(getRowsWithColumnsTs_result other) { + if (other.isSetSuccess()) { + List __this__success = new ArrayList(other.success.size()); + for (TRowResult other_element : other.success) { + __this__success.add(new TRowResult(other_element)); + } + this.success = __this__success; + } + if (other.isSetIo()) { + this.io = new IOError(other.io); + } + } + + public getRowsWithColumnsTs_result deepCopy() { + return new getRowsWithColumnsTs_result(this); + } + + @Override + public void clear() { + this.success = null; + this.io = null; + } + + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + public java.util.Iterator getSuccessIterator() { + return (this.success == null) ? null : this.success.iterator(); + } + + public void addToSuccess(TRowResult elem) { + if (this.success == null) { + this.success = new ArrayList(); + } + this.success.add(elem); + } + + public List getSuccess() { + return this.success; + } + + public getRowsWithColumnsTs_result setSuccess(List success) { + this.success = success; + return this; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public IOError getIo() { + return this.io; + } + + public getRowsWithColumnsTs_result setIo(IOError io) { + this.io = io; + return this; + } + + public void unsetIo() { + this.io = null; + } + + /** Returns true if field io is set (has been assigned a value) and false otherwise */ + public boolean isSetIo() { + return this.io != null; + } + + public void setIoIsSet(boolean value) { + if (!value) { + this.io = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((List)value); + } + break; + + case IO: + if (value == null) { + unsetIo(); + } else { + setIo((IOError)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + case IO: + return getIo(); + + } + 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 SUCCESS: + return isSetSuccess(); + case IO: + return isSetIo(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getRowsWithColumnsTs_result) + return this.equals((getRowsWithColumnsTs_result)that); + return false; + } + + public boolean equals(getRowsWithColumnsTs_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + boolean this_present_io = true && this.isSetIo(); + boolean that_present_io = true && that.isSetIo(); + if (this_present_io || that_present_io) { + if (!(this_present_io && that_present_io)) + return false; + if (!this.io.equals(that.io)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + boolean present_io = true && (isSetIo()); + list.add(present_io); + if (present_io) + list.add(io); + + return list.hashCode(); + } + + @Override + public int compareTo(getRowsWithColumnsTs_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIo()).compareTo(other.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, other.io); + 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("getRowsWithColumnsTs_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + if (!first) sb.append(", "); + sb.append("io:"); + if (this.io == null) { + sb.append("null"); + } else { + sb.append(this.io); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 getRowsWithColumnsTs_resultStandardSchemeFactory implements SchemeFactory { + public getRowsWithColumnsTs_resultStandardScheme getScheme() { + return new getRowsWithColumnsTs_resultStandardScheme(); + } + } + + private static class getRowsWithColumnsTs_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getRowsWithColumnsTs_result 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 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list338 = iprot.readListBegin(); + struct.success = new ArrayList(_list338.size); + TRowResult _elem339; + for (int _i340 = 0; _i340 < _list338.size; ++_i340) + { + _elem339 = new TRowResult(); + _elem339.read(iprot); + struct.success.add(_elem339); + } + iprot.readListEnd(); + } + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IO + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(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, getRowsWithColumnsTs_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); + for (TRowResult _iter341 : struct.success) + { + _iter341.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.io != null) { + oprot.writeFieldBegin(IO_FIELD_DESC); + struct.io.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getRowsWithColumnsTs_resultTupleSchemeFactory implements SchemeFactory { + public getRowsWithColumnsTs_resultTupleScheme getScheme() { + return new getRowsWithColumnsTs_resultTupleScheme(); + } + } + + private static class getRowsWithColumnsTs_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getRowsWithColumnsTs_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIo()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + { + oprot.writeI32(struct.success.size()); + for (TRowResult _iter342 : struct.success) + { + _iter342.write(oprot); + } + } + } + if (struct.isSetIo()) { + struct.io.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getRowsWithColumnsTs_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list343 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new ArrayList(_list343.size); + TRowResult _elem344; + for (int _i345 = 0; _i345 < _list343.size; ++_i345) + { + _elem344 = new TRowResult(); + _elem344.read(iprot); + struct.success.add(_elem344); + } + } + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } + } + } + + } + + public static class mutateRow_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("mutateRow_args"); + + private static final org.apache.thrift.protocol.TField TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tableName", org.apache.thrift.protocol.TType.STRING, (short)1); + 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)2); + private static final org.apache.thrift.protocol.TField MUTATIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("mutations", org.apache.thrift.protocol.TType.LIST, (short)3); + 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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new mutateRow_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new mutateRow_argsTupleSchemeFactory()); + } + + /** + * name of table + */ + public ByteBuffer tableName; // required + /** + * row key + */ + public ByteBuffer row; // required + /** + * list of mutation commands + */ + public List mutations; // required + /** + * Mutation attributes + */ + public Map attributes; // 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 { + /** + * name of table + */ + TABLE_NAME((short)1, "tableName"), + /** + * row key + */ + ROW((short)2, "row"), + /** + * list of mutation commands + */ + MUTATIONS((short)3, "mutations"), + /** + * Mutation attributes + */ + ATTRIBUTES((short)4, "attributes"); + + private static final Map byName = new HashMap(); + + 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: // ROW + return ROW; + case 3: // MUTATIONS + return MUTATIONS; + case 4: // ATTRIBUTES + return ATTRIBUTES; + 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.TABLE_NAME, new org.apache.thrift.meta_data.FieldMetaData("tableName", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.ROW, new org.apache.thrift.meta_data.FieldMetaData("row", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.MUTATIONS, new org.apache.thrift.meta_data.FieldMetaData("mutations", org.apache.thrift.TFieldRequirementType.DEFAULT, + 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, Mutation.class)))); + tmpMap.put(_Fields.ATTRIBUTES, new org.apache.thrift.meta_data.FieldMetaData("attributes", org.apache.thrift.TFieldRequirementType.DEFAULT, + 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 , "Text"), + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text")))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(mutateRow_args.class, metaDataMap); + } + + public mutateRow_args() { + } + + public mutateRow_args( + ByteBuffer tableName, + ByteBuffer row, + List mutations, + Map attributes) + { + this(); + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(tableName); + this.row = org.apache.thrift.TBaseHelper.copyBinary(row); + this.mutations = mutations; + this.attributes = attributes; + } + + /** + * Performs a deep copy on other. + */ + public mutateRow_args(mutateRow_args other) { + if (other.isSetTableName()) { + this.tableName = other.tableName; + } + if (other.isSetRow()) { + this.row = other.row; + } + if (other.isSetMutations()) { + List __this__mutations = new ArrayList(other.mutations.size()); + for (Mutation other_element : other.mutations) { + __this__mutations.add(new Mutation(other_element)); + } + this.mutations = __this__mutations; + } + if (other.isSetAttributes()) { + Map __this__attributes = new HashMap(other.attributes.size()); + for (Map.Entry other_element : other.attributes.entrySet()) { + + ByteBuffer other_element_key = other_element.getKey(); + ByteBuffer other_element_value = other_element.getValue(); + + ByteBuffer __this__attributes_copy_key = other_element_key; + + ByteBuffer __this__attributes_copy_value = other_element_value; + + __this__attributes.put(__this__attributes_copy_key, __this__attributes_copy_value); + } + this.attributes = __this__attributes; + } + } + + public mutateRow_args deepCopy() { + return new mutateRow_args(this); + } + + @Override + public void clear() { + this.tableName = null; + this.row = null; + this.mutations = null; + this.attributes = null; + } + + /** + * name of table + */ + public byte[] getTableName() { + setTableName(org.apache.thrift.TBaseHelper.rightSize(tableName)); + return tableName == null ? null : tableName.array(); + } + + public ByteBuffer bufferForTableName() { + return org.apache.thrift.TBaseHelper.copyBinary(tableName); + } + + /** + * name of table + */ + public mutateRow_args setTableName(byte[] tableName) { + this.tableName = tableName == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(tableName, tableName.length)); + return this; + } + + public mutateRow_args setTableName(ByteBuffer tableName) { + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(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; + } + } + + /** + * row key + */ + public byte[] getRow() { + setRow(org.apache.thrift.TBaseHelper.rightSize(row)); + return row == null ? null : row.array(); + } + + public ByteBuffer bufferForRow() { + return org.apache.thrift.TBaseHelper.copyBinary(row); + } + + /** + * row key + */ + public mutateRow_args setRow(byte[] row) { + this.row = row == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(row, row.length)); + return this; + } + + public mutateRow_args setRow(ByteBuffer row) { + this.row = org.apache.thrift.TBaseHelper.copyBinary(row); + return this; + } + + public void unsetRow() { + this.row = null; + } + + /** Returns true if field row is set (has been assigned a value) and false otherwise */ + public boolean isSetRow() { + return this.row != null; + } + + public void setRowIsSet(boolean value) { + if (!value) { + this.row = null; + } + } + + public int getMutationsSize() { + return (this.mutations == null) ? 0 : this.mutations.size(); + } + + public java.util.Iterator getMutationsIterator() { + return (this.mutations == null) ? null : this.mutations.iterator(); + } + + public void addToMutations(Mutation elem) { + if (this.mutations == null) { + this.mutations = new ArrayList(); + } + this.mutations.add(elem); + } + + /** + * list of mutation commands + */ + public List getMutations() { + return this.mutations; + } + + /** + * list of mutation commands + */ + public mutateRow_args setMutations(List mutations) { + this.mutations = mutations; + return this; + } + + public void unsetMutations() { + this.mutations = null; + } + + /** Returns true if field mutations is set (has been assigned a value) and false otherwise */ + public boolean isSetMutations() { + return this.mutations != null; + } + + public void setMutationsIsSet(boolean value) { + if (!value) { + this.mutations = 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(); + } + this.attributes.put(key, val); + } + + /** + * Mutation attributes + */ + public Map getAttributes() { + return this.attributes; + } + + /** + * Mutation attributes + */ + public mutateRow_args setAttributes(Map 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; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case TABLE_NAME: + if (value == null) { + unsetTableName(); + } else { + setTableName((ByteBuffer)value); + } + break; + + case ROW: + if (value == null) { + unsetRow(); + } else { + setRow((ByteBuffer)value); + } + break; + + case MUTATIONS: + if (value == null) { + unsetMutations(); + } else { + setMutations((List)value); + } + break; + + case ATTRIBUTES: + if (value == null) { + unsetAttributes(); + } else { + setAttributes((Map)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case TABLE_NAME: + return getTableName(); + + case ROW: + return getRow(); + + case MUTATIONS: + return getMutations(); + + case ATTRIBUTES: + return getAttributes(); + + } + 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 ROW: + return isSetRow(); + case MUTATIONS: + return isSetMutations(); + case ATTRIBUTES: + return isSetAttributes(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof mutateRow_args) + return this.equals((mutateRow_args)that); + return false; + } + + public boolean equals(mutateRow_args 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_row = true && this.isSetRow(); + boolean that_present_row = true && that.isSetRow(); + if (this_present_row || that_present_row) { + if (!(this_present_row && that_present_row)) + return false; + if (!this.row.equals(that.row)) + return false; + } + + boolean this_present_mutations = true && this.isSetMutations(); + boolean that_present_mutations = true && that.isSetMutations(); + if (this_present_mutations || that_present_mutations) { + if (!(this_present_mutations && that_present_mutations)) + return false; + if (!this.mutations.equals(that.mutations)) + 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; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_tableName = true && (isSetTableName()); + list.add(present_tableName); + if (present_tableName) + list.add(tableName); + + boolean present_row = true && (isSetRow()); + list.add(present_row); + if (present_row) + list.add(row); + + boolean present_mutations = true && (isSetMutations()); + list.add(present_mutations); + if (present_mutations) + list.add(mutations); + + boolean present_attributes = true && (isSetAttributes()); + list.add(present_attributes); + if (present_attributes) + list.add(attributes); + + return list.hashCode(); + } + + @Override + public int compareTo(mutateRow_args 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(isSetRow()).compareTo(other.isSetRow()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRow()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.row, other.row); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetMutations()).compareTo(other.isSetMutations()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetMutations()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.mutations, other.mutations); + 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; + } + } + 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("mutateRow_args("); + boolean first = true; + + sb.append("tableName:"); + if (this.tableName == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.tableName, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("row:"); + if (this.row == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.row, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("mutations:"); + if (this.mutations == null) { + sb.append("null"); + } else { + sb.append(this.mutations); + } + first = false; + if (!first) sb.append(", "); + sb.append("attributes:"); + if (this.attributes == null) { + sb.append("null"); + } else { + sb.append(this.attributes); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 mutateRow_argsStandardSchemeFactory implements SchemeFactory { + public mutateRow_argsStandardScheme getScheme() { + return new mutateRow_argsStandardScheme(); + } + } + + private static class mutateRow_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, mutateRow_args 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.STRING) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // ROW + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.row = iprot.readBinary(); + struct.setRowIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // MUTATIONS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list346 = iprot.readListBegin(); + struct.mutations = new ArrayList(_list346.size); + Mutation _elem347; + for (int _i348 = 0; _i348 < _list346.size; ++_i348) + { + _elem347 = new Mutation(); + _elem347.read(iprot); + struct.mutations.add(_elem347); + } + iprot.readListEnd(); + } + struct.setMutationsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // ATTRIBUTES + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map349 = iprot.readMapBegin(); + struct.attributes = new HashMap(2*_map349.size); + ByteBuffer _key350; + ByteBuffer _val351; + for (int _i352 = 0; _i352 < _map349.size; ++_i352) + { + _key350 = iprot.readBinary(); + _val351 = iprot.readBinary(); + struct.attributes.put(_key350, _val351); + } + iprot.readMapEnd(); + } + struct.setAttributesIsSet(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, mutateRow_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.tableName != null) { + oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC); + oprot.writeBinary(struct.tableName); + oprot.writeFieldEnd(); + } + if (struct.row != null) { + oprot.writeFieldBegin(ROW_FIELD_DESC); + oprot.writeBinary(struct.row); + oprot.writeFieldEnd(); + } + if (struct.mutations != null) { + oprot.writeFieldBegin(MUTATIONS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.mutations.size())); + for (Mutation _iter353 : struct.mutations) + { + _iter353.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.attributes != null) { + 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 _iter354 : struct.attributes.entrySet()) + { + oprot.writeBinary(_iter354.getKey()); + oprot.writeBinary(_iter354.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class mutateRow_argsTupleSchemeFactory implements SchemeFactory { + public mutateRow_argsTupleScheme getScheme() { + return new mutateRow_argsTupleScheme(); + } + } + + private static class mutateRow_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, mutateRow_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetTableName()) { + optionals.set(0); + } + if (struct.isSetRow()) { + optionals.set(1); + } + if (struct.isSetMutations()) { + optionals.set(2); + } + if (struct.isSetAttributes()) { + optionals.set(3); + } + oprot.writeBitSet(optionals, 4); + if (struct.isSetTableName()) { + oprot.writeBinary(struct.tableName); + } + if (struct.isSetRow()) { + oprot.writeBinary(struct.row); + } + if (struct.isSetMutations()) { + { + oprot.writeI32(struct.mutations.size()); + for (Mutation _iter355 : struct.mutations) + { + _iter355.write(oprot); + } + } + } + if (struct.isSetAttributes()) { + { + oprot.writeI32(struct.attributes.size()); + for (Map.Entry _iter356 : struct.attributes.entrySet()) + { + oprot.writeBinary(_iter356.getKey()); + oprot.writeBinary(_iter356.getValue()); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, mutateRow_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(4); + if (incoming.get(0)) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(true); + } + if (incoming.get(1)) { + struct.row = iprot.readBinary(); + struct.setRowIsSet(true); + } + if (incoming.get(2)) { + { + org.apache.thrift.protocol.TList _list357 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.mutations = new ArrayList(_list357.size); + Mutation _elem358; + for (int _i359 = 0; _i359 < _list357.size; ++_i359) + { + _elem358 = new Mutation(); + _elem358.read(iprot); + struct.mutations.add(_elem358); + } + } + struct.setMutationsIsSet(true); + } + if (incoming.get(3)) { + { + org.apache.thrift.protocol.TMap _map360 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.attributes = new HashMap(2*_map360.size); + ByteBuffer _key361; + ByteBuffer _val362; + for (int _i363 = 0; _i363 < _map360.size; ++_i363) + { + _key361 = iprot.readBinary(); + _val362 = iprot.readBinary(); + struct.attributes.put(_key361, _val362); + } + } + struct.setAttributesIsSet(true); + } + } + } + + } + + public static class mutateRow_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("mutateRow_result"); + + private static final org.apache.thrift.protocol.TField IO_FIELD_DESC = new org.apache.thrift.protocol.TField("io", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final org.apache.thrift.protocol.TField IA_FIELD_DESC = new org.apache.thrift.protocol.TField("ia", org.apache.thrift.protocol.TType.STRUCT, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new mutateRow_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new mutateRow_resultTupleSchemeFactory()); + } + + public IOError io; // required + public IllegalArgument ia; // 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 { + IO((short)1, "io"), + IA((short)2, "ia"); + + private static final Map byName = new HashMap(); + + 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: // IO + return IO; + case 2: // IA + return IA; + 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.IO, new org.apache.thrift.meta_data.FieldMetaData("io", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + tmpMap.put(_Fields.IA, new org.apache.thrift.meta_data.FieldMetaData("ia", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(mutateRow_result.class, metaDataMap); + } + + public mutateRow_result() { + } + + public mutateRow_result( + IOError io, + IllegalArgument ia) + { + this(); + this.io = io; + this.ia = ia; + } + + /** + * Performs a deep copy on other. + */ + public mutateRow_result(mutateRow_result other) { + if (other.isSetIo()) { + this.io = new IOError(other.io); + } + if (other.isSetIa()) { + this.ia = new IllegalArgument(other.ia); + } + } + + public mutateRow_result deepCopy() { + return new mutateRow_result(this); + } + + @Override + public void clear() { + this.io = null; + this.ia = null; + } + + public IOError getIo() { + return this.io; + } + + public mutateRow_result setIo(IOError io) { + this.io = io; + return this; + } + + public void unsetIo() { + this.io = null; + } + + /** Returns true if field io is set (has been assigned a value) and false otherwise */ + public boolean isSetIo() { + return this.io != null; + } + + public void setIoIsSet(boolean value) { + if (!value) { + this.io = null; + } + } + + public IllegalArgument getIa() { + return this.ia; + } + + public mutateRow_result setIa(IllegalArgument ia) { + this.ia = ia; + return this; + } + + public void unsetIa() { + this.ia = null; + } + + /** Returns true if field ia is set (has been assigned a value) and false otherwise */ + public boolean isSetIa() { + return this.ia != null; + } + + public void setIaIsSet(boolean value) { + if (!value) { + this.ia = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case IO: + if (value == null) { + unsetIo(); + } else { + setIo((IOError)value); + } + break; + + case IA: + if (value == null) { + unsetIa(); + } else { + setIa((IllegalArgument)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case IO: + return getIo(); + + case IA: + return getIa(); + + } + 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 IO: + return isSetIo(); + case IA: + return isSetIa(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof mutateRow_result) + return this.equals((mutateRow_result)that); + return false; + } + + public boolean equals(mutateRow_result that) { + if (that == null) + return false; + + boolean this_present_io = true && this.isSetIo(); + boolean that_present_io = true && that.isSetIo(); + if (this_present_io || that_present_io) { + if (!(this_present_io && that_present_io)) + return false; + if (!this.io.equals(that.io)) + return false; + } + + boolean this_present_ia = true && this.isSetIa(); + boolean that_present_ia = true && that.isSetIa(); + if (this_present_ia || that_present_ia) { + if (!(this_present_ia && that_present_ia)) + return false; + if (!this.ia.equals(that.ia)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_io = true && (isSetIo()); + list.add(present_io); + if (present_io) + list.add(io); + + boolean present_ia = true && (isSetIa()); + list.add(present_ia); + if (present_ia) + list.add(ia); + + return list.hashCode(); + } + + @Override + public int compareTo(mutateRow_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetIo()).compareTo(other.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, other.io); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIa()).compareTo(other.isSetIa()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIa()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ia, other.ia); + 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("mutateRow_result("); + boolean first = true; + + sb.append("io:"); + if (this.io == null) { + sb.append("null"); + } else { + sb.append(this.io); + } + first = false; + if (!first) sb.append(", "); + sb.append("ia:"); + if (this.ia == null) { + sb.append("null"); + } else { + sb.append(this.ia); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 mutateRow_resultStandardSchemeFactory implements SchemeFactory { + public mutateRow_resultStandardScheme getScheme() { + return new mutateRow_resultStandardScheme(); + } + } + + private static class mutateRow_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, mutateRow_result 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: // IO + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // IA + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ia = new IllegalArgument(); + struct.ia.read(iprot); + struct.setIaIsSet(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, mutateRow_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.io != null) { + oprot.writeFieldBegin(IO_FIELD_DESC); + struct.io.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.ia != null) { + oprot.writeFieldBegin(IA_FIELD_DESC); + struct.ia.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class mutateRow_resultTupleSchemeFactory implements SchemeFactory { + public mutateRow_resultTupleScheme getScheme() { + return new mutateRow_resultTupleScheme(); + } + } + + private static class mutateRow_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, mutateRow_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetIo()) { + optionals.set(0); + } + if (struct.isSetIa()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetIo()) { + struct.io.write(oprot); + } + if (struct.isSetIa()) { + struct.ia.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, mutateRow_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } + if (incoming.get(1)) { + struct.ia = new IllegalArgument(); + struct.ia.read(iprot); + struct.setIaIsSet(true); + } + } + } + + } + + public static class mutateRowTs_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("mutateRowTs_args"); + + private static final org.apache.thrift.protocol.TField TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tableName", org.apache.thrift.protocol.TType.STRING, (short)1); + 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)2); + private static final org.apache.thrift.protocol.TField MUTATIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("mutations", org.apache.thrift.protocol.TType.LIST, (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 ATTRIBUTES_FIELD_DESC = new org.apache.thrift.protocol.TField("attributes", org.apache.thrift.protocol.TType.MAP, (short)5); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new mutateRowTs_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new mutateRowTs_argsTupleSchemeFactory()); + } + + /** + * name of table + */ + public ByteBuffer tableName; // required + /** + * row key + */ + public ByteBuffer row; // required + /** + * list of mutation commands + */ + public List mutations; // required + /** + * timestamp + */ + public long timestamp; // required + /** + * Mutation attributes + */ + public Map attributes; // 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 { + /** + * name of table + */ + TABLE_NAME((short)1, "tableName"), + /** + * row key + */ + ROW((short)2, "row"), + /** + * list of mutation commands + */ + MUTATIONS((short)3, "mutations"), + /** + * timestamp + */ + TIMESTAMP((short)4, "timestamp"), + /** + * Mutation attributes + */ + ATTRIBUTES((short)5, "attributes"); + + private static final Map byName = new HashMap(); + + 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: // ROW + return ROW; + case 3: // MUTATIONS + return MUTATIONS; + case 4: // TIMESTAMP + return TIMESTAMP; + case 5: // ATTRIBUTES + return ATTRIBUTES; + 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 int __TIMESTAMP_ISSET_ID = 0; + private byte __isset_bitfield = 0; + 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.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.ROW, new org.apache.thrift.meta_data.FieldMetaData("row", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.MUTATIONS, new org.apache.thrift.meta_data.FieldMetaData("mutations", org.apache.thrift.TFieldRequirementType.DEFAULT, + 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, Mutation.class)))); + tmpMap.put(_Fields.TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("timestamp", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.ATTRIBUTES, new org.apache.thrift.meta_data.FieldMetaData("attributes", org.apache.thrift.TFieldRequirementType.DEFAULT, + 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 , "Text"), + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text")))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(mutateRowTs_args.class, metaDataMap); + } + + public mutateRowTs_args() { + } + + public mutateRowTs_args( + ByteBuffer tableName, + ByteBuffer row, + List mutations, + long timestamp, + Map attributes) + { + this(); + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(tableName); + this.row = org.apache.thrift.TBaseHelper.copyBinary(row); + this.mutations = mutations; + this.timestamp = timestamp; + setTimestampIsSet(true); + this.attributes = attributes; + } + + /** + * Performs a deep copy on other. + */ + public mutateRowTs_args(mutateRowTs_args other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetTableName()) { + this.tableName = other.tableName; + } + if (other.isSetRow()) { + this.row = other.row; + } + if (other.isSetMutations()) { + List __this__mutations = new ArrayList(other.mutations.size()); + for (Mutation other_element : other.mutations) { + __this__mutations.add(new Mutation(other_element)); + } + this.mutations = __this__mutations; + } + this.timestamp = other.timestamp; + if (other.isSetAttributes()) { + Map __this__attributes = new HashMap(other.attributes.size()); + for (Map.Entry other_element : other.attributes.entrySet()) { + + ByteBuffer other_element_key = other_element.getKey(); + ByteBuffer other_element_value = other_element.getValue(); + + ByteBuffer __this__attributes_copy_key = other_element_key; + + ByteBuffer __this__attributes_copy_value = other_element_value; + + __this__attributes.put(__this__attributes_copy_key, __this__attributes_copy_value); + } + this.attributes = __this__attributes; + } + } + + public mutateRowTs_args deepCopy() { + return new mutateRowTs_args(this); + } + + @Override + public void clear() { + this.tableName = null; + this.row = null; + this.mutations = null; + setTimestampIsSet(false); + this.timestamp = 0; + this.attributes = null; + } + + /** + * name of table + */ + public byte[] getTableName() { + setTableName(org.apache.thrift.TBaseHelper.rightSize(tableName)); + return tableName == null ? null : tableName.array(); + } + + public ByteBuffer bufferForTableName() { + return org.apache.thrift.TBaseHelper.copyBinary(tableName); + } + + /** + * name of table + */ + public mutateRowTs_args setTableName(byte[] tableName) { + this.tableName = tableName == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(tableName, tableName.length)); + return this; + } + + public mutateRowTs_args setTableName(ByteBuffer tableName) { + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(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; + } + } + + /** + * row key + */ + public byte[] getRow() { + setRow(org.apache.thrift.TBaseHelper.rightSize(row)); + return row == null ? null : row.array(); + } + + public ByteBuffer bufferForRow() { + return org.apache.thrift.TBaseHelper.copyBinary(row); + } + + /** + * row key + */ + public mutateRowTs_args setRow(byte[] row) { + this.row = row == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(row, row.length)); + return this; + } + + public mutateRowTs_args setRow(ByteBuffer row) { + this.row = org.apache.thrift.TBaseHelper.copyBinary(row); + return this; + } + + public void unsetRow() { + this.row = null; + } + + /** Returns true if field row is set (has been assigned a value) and false otherwise */ + public boolean isSetRow() { + return this.row != null; + } + + public void setRowIsSet(boolean value) { + if (!value) { + this.row = null; + } + } + + public int getMutationsSize() { + return (this.mutations == null) ? 0 : this.mutations.size(); + } + + public java.util.Iterator getMutationsIterator() { + return (this.mutations == null) ? null : this.mutations.iterator(); + } + + public void addToMutations(Mutation elem) { + if (this.mutations == null) { + this.mutations = new ArrayList(); + } + this.mutations.add(elem); + } + + /** + * list of mutation commands + */ + public List getMutations() { + return this.mutations; + } + + /** + * list of mutation commands + */ + public mutateRowTs_args setMutations(List mutations) { + this.mutations = mutations; + return this; + } + + public void unsetMutations() { + this.mutations = null; + } + + /** Returns true if field mutations is set (has been assigned a value) and false otherwise */ + public boolean isSetMutations() { + return this.mutations != null; + } + + public void setMutationsIsSet(boolean value) { + if (!value) { + this.mutations = null; + } + } + + /** + * timestamp + */ + public long getTimestamp() { + return this.timestamp; + } + + /** + * timestamp + */ + public mutateRowTs_args setTimestamp(long timestamp) { + this.timestamp = timestamp; + setTimestampIsSet(true); + return this; + } + + public void unsetTimestamp() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); + } + + /** Returns true if field timestamp is set (has been assigned a value) and false otherwise */ + public boolean isSetTimestamp() { + return EncodingUtils.testBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); + } + + public void setTimestampIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TIMESTAMP_ISSET_ID, value); + } + + 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(); + } + this.attributes.put(key, val); + } + + /** + * Mutation attributes + */ + public Map getAttributes() { + return this.attributes; + } + + /** + * Mutation attributes + */ + public mutateRowTs_args setAttributes(Map 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; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case TABLE_NAME: + if (value == null) { + unsetTableName(); + } else { + setTableName((ByteBuffer)value); + } + break; + + case ROW: + if (value == null) { + unsetRow(); + } else { + setRow((ByteBuffer)value); + } + break; + + case MUTATIONS: + if (value == null) { + unsetMutations(); + } else { + setMutations((List)value); + } + break; + + case TIMESTAMP: + if (value == null) { + unsetTimestamp(); + } else { + setTimestamp((Long)value); + } + break; + + case ATTRIBUTES: + if (value == null) { + unsetAttributes(); + } else { + setAttributes((Map)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case TABLE_NAME: + return getTableName(); + + case ROW: + return getRow(); + + case MUTATIONS: + return getMutations(); + + case TIMESTAMP: + return getTimestamp(); + + case ATTRIBUTES: + return getAttributes(); + + } + 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 ROW: + return isSetRow(); + case MUTATIONS: + return isSetMutations(); + case TIMESTAMP: + return isSetTimestamp(); + case ATTRIBUTES: + return isSetAttributes(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof mutateRowTs_args) + return this.equals((mutateRowTs_args)that); + return false; + } + + public boolean equals(mutateRowTs_args 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_row = true && this.isSetRow(); + boolean that_present_row = true && that.isSetRow(); + if (this_present_row || that_present_row) { + if (!(this_present_row && that_present_row)) + return false; + if (!this.row.equals(that.row)) + return false; + } + + boolean this_present_mutations = true && this.isSetMutations(); + boolean that_present_mutations = true && that.isSetMutations(); + if (this_present_mutations || that_present_mutations) { + if (!(this_present_mutations && that_present_mutations)) + return false; + if (!this.mutations.equals(that.mutations)) + return false; + } + + boolean this_present_timestamp = true; + boolean that_present_timestamp = true; + if (this_present_timestamp || that_present_timestamp) { + if (!(this_present_timestamp && that_present_timestamp)) + return false; + if (this.timestamp != that.timestamp) + 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; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_tableName = true && (isSetTableName()); + list.add(present_tableName); + if (present_tableName) + list.add(tableName); + + boolean present_row = true && (isSetRow()); + list.add(present_row); + if (present_row) + list.add(row); + + boolean present_mutations = true && (isSetMutations()); + list.add(present_mutations); + if (present_mutations) + list.add(mutations); + + boolean present_timestamp = true; + list.add(present_timestamp); + if (present_timestamp) + list.add(timestamp); + + boolean present_attributes = true && (isSetAttributes()); + list.add(present_attributes); + if (present_attributes) + list.add(attributes); + + return list.hashCode(); + } + + @Override + public int compareTo(mutateRowTs_args 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(isSetRow()).compareTo(other.isSetRow()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRow()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.row, other.row); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetMutations()).compareTo(other.isSetMutations()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetMutations()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.mutations, other.mutations); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(other.isSetTimestamp()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTimestamp()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timestamp, other.timestamp); + 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; + } + } + 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("mutateRowTs_args("); + boolean first = true; + + sb.append("tableName:"); + if (this.tableName == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.tableName, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("row:"); + if (this.row == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.row, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("mutations:"); + if (this.mutations == null) { + sb.append("null"); + } else { + sb.append(this.mutations); + } + first = false; + if (!first) sb.append(", "); + sb.append("timestamp:"); + sb.append(this.timestamp); + first = false; + if (!first) sb.append(", "); + sb.append("attributes:"); + if (this.attributes == null) { + sb.append("null"); + } else { + sb.append(this.attributes); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 { + // 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); + } + } + + private static class mutateRowTs_argsStandardSchemeFactory implements SchemeFactory { + public mutateRowTs_argsStandardScheme getScheme() { + return new mutateRowTs_argsStandardScheme(); + } + } + + private static class mutateRowTs_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, mutateRowTs_args 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.STRING) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // ROW + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.row = iprot.readBinary(); + struct.setRowIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // MUTATIONS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list364 = iprot.readListBegin(); + struct.mutations = new ArrayList(_list364.size); + Mutation _elem365; + for (int _i366 = 0; _i366 < _list364.size; ++_i366) + { + _elem365 = new Mutation(); + _elem365.read(iprot); + struct.mutations.add(_elem365); + } + iprot.readListEnd(); + } + struct.setMutationsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // TIMESTAMP + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.timestamp = iprot.readI64(); + struct.setTimestampIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // ATTRIBUTES + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map367 = iprot.readMapBegin(); + struct.attributes = new HashMap(2*_map367.size); + ByteBuffer _key368; + ByteBuffer _val369; + for (int _i370 = 0; _i370 < _map367.size; ++_i370) + { + _key368 = iprot.readBinary(); + _val369 = iprot.readBinary(); + struct.attributes.put(_key368, _val369); + } + iprot.readMapEnd(); + } + struct.setAttributesIsSet(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, mutateRowTs_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.tableName != null) { + oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC); + oprot.writeBinary(struct.tableName); + oprot.writeFieldEnd(); + } + if (struct.row != null) { + oprot.writeFieldBegin(ROW_FIELD_DESC); + oprot.writeBinary(struct.row); + oprot.writeFieldEnd(); + } + if (struct.mutations != null) { + oprot.writeFieldBegin(MUTATIONS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.mutations.size())); + for (Mutation _iter371 : struct.mutations) + { + _iter371.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC); + oprot.writeI64(struct.timestamp); + oprot.writeFieldEnd(); + if (struct.attributes != null) { + 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 _iter372 : struct.attributes.entrySet()) + { + oprot.writeBinary(_iter372.getKey()); + oprot.writeBinary(_iter372.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class mutateRowTs_argsTupleSchemeFactory implements SchemeFactory { + public mutateRowTs_argsTupleScheme getScheme() { + return new mutateRowTs_argsTupleScheme(); + } + } + + private static class mutateRowTs_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, mutateRowTs_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetTableName()) { + optionals.set(0); + } + if (struct.isSetRow()) { + optionals.set(1); + } + if (struct.isSetMutations()) { + optionals.set(2); + } + if (struct.isSetTimestamp()) { + optionals.set(3); + } + if (struct.isSetAttributes()) { + optionals.set(4); + } + oprot.writeBitSet(optionals, 5); + if (struct.isSetTableName()) { + oprot.writeBinary(struct.tableName); + } + if (struct.isSetRow()) { + oprot.writeBinary(struct.row); + } + if (struct.isSetMutations()) { + { + oprot.writeI32(struct.mutations.size()); + for (Mutation _iter373 : struct.mutations) + { + _iter373.write(oprot); + } + } + } + if (struct.isSetTimestamp()) { + oprot.writeI64(struct.timestamp); + } + if (struct.isSetAttributes()) { + { + oprot.writeI32(struct.attributes.size()); + for (Map.Entry _iter374 : struct.attributes.entrySet()) + { + oprot.writeBinary(_iter374.getKey()); + oprot.writeBinary(_iter374.getValue()); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, mutateRowTs_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(5); + if (incoming.get(0)) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(true); + } + if (incoming.get(1)) { + struct.row = iprot.readBinary(); + struct.setRowIsSet(true); + } + if (incoming.get(2)) { + { + org.apache.thrift.protocol.TList _list375 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.mutations = new ArrayList(_list375.size); + Mutation _elem376; + for (int _i377 = 0; _i377 < _list375.size; ++_i377) + { + _elem376 = new Mutation(); + _elem376.read(iprot); + struct.mutations.add(_elem376); + } + } + struct.setMutationsIsSet(true); + } + if (incoming.get(3)) { + struct.timestamp = iprot.readI64(); + struct.setTimestampIsSet(true); + } + if (incoming.get(4)) { + { + org.apache.thrift.protocol.TMap _map378 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.attributes = new HashMap(2*_map378.size); + ByteBuffer _key379; + ByteBuffer _val380; + for (int _i381 = 0; _i381 < _map378.size; ++_i381) + { + _key379 = iprot.readBinary(); + _val380 = iprot.readBinary(); + struct.attributes.put(_key379, _val380); + } + } + struct.setAttributesIsSet(true); + } + } + } + + } + + public static class mutateRowTs_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("mutateRowTs_result"); + + private static final org.apache.thrift.protocol.TField IO_FIELD_DESC = new org.apache.thrift.protocol.TField("io", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final org.apache.thrift.protocol.TField IA_FIELD_DESC = new org.apache.thrift.protocol.TField("ia", org.apache.thrift.protocol.TType.STRUCT, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new mutateRowTs_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new mutateRowTs_resultTupleSchemeFactory()); + } + + public IOError io; // required + public IllegalArgument ia; // 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 { + IO((short)1, "io"), + IA((short)2, "ia"); + + private static final Map byName = new HashMap(); + + 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: // IO + return IO; + case 2: // IA + return IA; + 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.IO, new org.apache.thrift.meta_data.FieldMetaData("io", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + tmpMap.put(_Fields.IA, new org.apache.thrift.meta_data.FieldMetaData("ia", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(mutateRowTs_result.class, metaDataMap); + } + + public mutateRowTs_result() { + } + + public mutateRowTs_result( + IOError io, + IllegalArgument ia) + { + this(); + this.io = io; + this.ia = ia; + } + + /** + * Performs a deep copy on other. + */ + public mutateRowTs_result(mutateRowTs_result other) { + if (other.isSetIo()) { + this.io = new IOError(other.io); + } + if (other.isSetIa()) { + this.ia = new IllegalArgument(other.ia); + } + } + + public mutateRowTs_result deepCopy() { + return new mutateRowTs_result(this); + } + + @Override + public void clear() { + this.io = null; + this.ia = null; + } + + public IOError getIo() { + return this.io; + } + + public mutateRowTs_result setIo(IOError io) { + this.io = io; + return this; + } + + public void unsetIo() { + this.io = null; + } + + /** Returns true if field io is set (has been assigned a value) and false otherwise */ + public boolean isSetIo() { + return this.io != null; + } + + public void setIoIsSet(boolean value) { + if (!value) { + this.io = null; + } + } + + public IllegalArgument getIa() { + return this.ia; + } + + public mutateRowTs_result setIa(IllegalArgument ia) { + this.ia = ia; + return this; + } + + public void unsetIa() { + this.ia = null; + } + + /** Returns true if field ia is set (has been assigned a value) and false otherwise */ + public boolean isSetIa() { + return this.ia != null; + } + + public void setIaIsSet(boolean value) { + if (!value) { + this.ia = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case IO: + if (value == null) { + unsetIo(); + } else { + setIo((IOError)value); + } + break; + + case IA: + if (value == null) { + unsetIa(); + } else { + setIa((IllegalArgument)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case IO: + return getIo(); + + case IA: + return getIa(); + + } + 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 IO: + return isSetIo(); + case IA: + return isSetIa(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof mutateRowTs_result) + return this.equals((mutateRowTs_result)that); + return false; + } + + public boolean equals(mutateRowTs_result that) { + if (that == null) + return false; + + boolean this_present_io = true && this.isSetIo(); + boolean that_present_io = true && that.isSetIo(); + if (this_present_io || that_present_io) { + if (!(this_present_io && that_present_io)) + return false; + if (!this.io.equals(that.io)) + return false; + } + + boolean this_present_ia = true && this.isSetIa(); + boolean that_present_ia = true && that.isSetIa(); + if (this_present_ia || that_present_ia) { + if (!(this_present_ia && that_present_ia)) + return false; + if (!this.ia.equals(that.ia)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_io = true && (isSetIo()); + list.add(present_io); + if (present_io) + list.add(io); + + boolean present_ia = true && (isSetIa()); + list.add(present_ia); + if (present_ia) + list.add(ia); + + return list.hashCode(); + } + + @Override + public int compareTo(mutateRowTs_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetIo()).compareTo(other.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, other.io); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIa()).compareTo(other.isSetIa()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIa()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ia, other.ia); + 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("mutateRowTs_result("); + boolean first = true; + + sb.append("io:"); + if (this.io == null) { + sb.append("null"); + } else { + sb.append(this.io); + } + first = false; + if (!first) sb.append(", "); + sb.append("ia:"); + if (this.ia == null) { + sb.append("null"); + } else { + sb.append(this.ia); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 mutateRowTs_resultStandardSchemeFactory implements SchemeFactory { + public mutateRowTs_resultStandardScheme getScheme() { + return new mutateRowTs_resultStandardScheme(); + } + } + + private static class mutateRowTs_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, mutateRowTs_result 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: // IO + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // IA + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ia = new IllegalArgument(); + struct.ia.read(iprot); + struct.setIaIsSet(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, mutateRowTs_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.io != null) { + oprot.writeFieldBegin(IO_FIELD_DESC); + struct.io.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.ia != null) { + oprot.writeFieldBegin(IA_FIELD_DESC); + struct.ia.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class mutateRowTs_resultTupleSchemeFactory implements SchemeFactory { + public mutateRowTs_resultTupleScheme getScheme() { + return new mutateRowTs_resultTupleScheme(); + } + } + + private static class mutateRowTs_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, mutateRowTs_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetIo()) { + optionals.set(0); + } + if (struct.isSetIa()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetIo()) { + struct.io.write(oprot); + } + if (struct.isSetIa()) { + struct.ia.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, mutateRowTs_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } + if (incoming.get(1)) { + struct.ia = new IllegalArgument(); + struct.ia.read(iprot); + struct.setIaIsSet(true); + } + } + } + + } + + public static class mutateRows_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("mutateRows_args"); + + private static final org.apache.thrift.protocol.TField TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tableName", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField ROW_BATCHES_FIELD_DESC = new org.apache.thrift.protocol.TField("rowBatches", 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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new mutateRows_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new mutateRows_argsTupleSchemeFactory()); + } + + /** + * name of table + */ + public ByteBuffer tableName; // required + /** + * list of row batches + */ + public List rowBatches; // required + /** + * Mutation attributes + */ + public Map attributes; // 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 { + /** + * name of table + */ + TABLE_NAME((short)1, "tableName"), + /** + * list of row batches + */ + ROW_BATCHES((short)2, "rowBatches"), + /** + * Mutation attributes + */ + ATTRIBUTES((short)3, "attributes"); + + private static final Map byName = new HashMap(); + + 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: // ROW_BATCHES + return ROW_BATCHES; + case 3: // ATTRIBUTES + return ATTRIBUTES; + 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.TABLE_NAME, new org.apache.thrift.meta_data.FieldMetaData("tableName", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.ROW_BATCHES, new org.apache.thrift.meta_data.FieldMetaData("rowBatches", org.apache.thrift.TFieldRequirementType.DEFAULT, + 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, BatchMutation.class)))); + tmpMap.put(_Fields.ATTRIBUTES, new org.apache.thrift.meta_data.FieldMetaData("attributes", org.apache.thrift.TFieldRequirementType.DEFAULT, + 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 , "Text"), + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text")))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(mutateRows_args.class, metaDataMap); + } + + public mutateRows_args() { + } + + public mutateRows_args( + ByteBuffer tableName, + List rowBatches, + Map attributes) + { + this(); + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(tableName); + this.rowBatches = rowBatches; + this.attributes = attributes; + } + + /** + * Performs a deep copy on other. + */ + public mutateRows_args(mutateRows_args other) { + if (other.isSetTableName()) { + this.tableName = other.tableName; + } + if (other.isSetRowBatches()) { + List __this__rowBatches = new ArrayList(other.rowBatches.size()); + for (BatchMutation other_element : other.rowBatches) { + __this__rowBatches.add(new BatchMutation(other_element)); + } + this.rowBatches = __this__rowBatches; + } + if (other.isSetAttributes()) { + Map __this__attributes = new HashMap(other.attributes.size()); + for (Map.Entry other_element : other.attributes.entrySet()) { + + ByteBuffer other_element_key = other_element.getKey(); + ByteBuffer other_element_value = other_element.getValue(); + + ByteBuffer __this__attributes_copy_key = other_element_key; + + ByteBuffer __this__attributes_copy_value = other_element_value; + + __this__attributes.put(__this__attributes_copy_key, __this__attributes_copy_value); + } + this.attributes = __this__attributes; + } + } + + public mutateRows_args deepCopy() { + return new mutateRows_args(this); + } + + @Override + public void clear() { + this.tableName = null; + this.rowBatches = null; + this.attributes = null; + } + + /** + * name of table + */ + public byte[] getTableName() { + setTableName(org.apache.thrift.TBaseHelper.rightSize(tableName)); + return tableName == null ? null : tableName.array(); + } + + public ByteBuffer bufferForTableName() { + return org.apache.thrift.TBaseHelper.copyBinary(tableName); + } + + /** + * name of table + */ + public mutateRows_args setTableName(byte[] tableName) { + this.tableName = tableName == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(tableName, tableName.length)); + return this; + } + + public mutateRows_args setTableName(ByteBuffer tableName) { + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(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 getRowBatchesSize() { + return (this.rowBatches == null) ? 0 : this.rowBatches.size(); + } + + public java.util.Iterator getRowBatchesIterator() { + return (this.rowBatches == null) ? null : this.rowBatches.iterator(); + } + + public void addToRowBatches(BatchMutation elem) { + if (this.rowBatches == null) { + this.rowBatches = new ArrayList(); + } + this.rowBatches.add(elem); + } + + /** + * list of row batches + */ + public List getRowBatches() { + return this.rowBatches; + } + + /** + * list of row batches + */ + public mutateRows_args setRowBatches(List rowBatches) { + this.rowBatches = rowBatches; + return this; + } + + public void unsetRowBatches() { + this.rowBatches = null; + } + + /** Returns true if field rowBatches is set (has been assigned a value) and false otherwise */ + public boolean isSetRowBatches() { + return this.rowBatches != null; + } + + public void setRowBatchesIsSet(boolean value) { + if (!value) { + this.rowBatches = 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(); + } + this.attributes.put(key, val); + } + + /** + * Mutation attributes + */ + public Map getAttributes() { + return this.attributes; + } + + /** + * Mutation attributes + */ + public mutateRows_args setAttributes(Map 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; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case TABLE_NAME: + if (value == null) { + unsetTableName(); + } else { + setTableName((ByteBuffer)value); + } + break; + + case ROW_BATCHES: + if (value == null) { + unsetRowBatches(); + } else { + setRowBatches((List)value); + } + break; + + case ATTRIBUTES: + if (value == null) { + unsetAttributes(); + } else { + setAttributes((Map)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case TABLE_NAME: + return getTableName(); + + case ROW_BATCHES: + return getRowBatches(); + + case ATTRIBUTES: + return getAttributes(); + + } + 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 ROW_BATCHES: + return isSetRowBatches(); + case ATTRIBUTES: + return isSetAttributes(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof mutateRows_args) + return this.equals((mutateRows_args)that); + return false; + } + + public boolean equals(mutateRows_args 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_rowBatches = true && this.isSetRowBatches(); + boolean that_present_rowBatches = true && that.isSetRowBatches(); + if (this_present_rowBatches || that_present_rowBatches) { + if (!(this_present_rowBatches && that_present_rowBatches)) + return false; + if (!this.rowBatches.equals(that.rowBatches)) + 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; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_tableName = true && (isSetTableName()); + list.add(present_tableName); + if (present_tableName) + list.add(tableName); + + boolean present_rowBatches = true && (isSetRowBatches()); + list.add(present_rowBatches); + if (present_rowBatches) + list.add(rowBatches); + + boolean present_attributes = true && (isSetAttributes()); + list.add(present_attributes); + if (present_attributes) + list.add(attributes); + + return list.hashCode(); + } + + @Override + public int compareTo(mutateRows_args 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(isSetRowBatches()).compareTo(other.isSetRowBatches()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRowBatches()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.rowBatches, other.rowBatches); + 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; + } + } + 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("mutateRows_args("); + boolean first = true; + + sb.append("tableName:"); + if (this.tableName == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.tableName, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("rowBatches:"); + if (this.rowBatches == null) { + sb.append("null"); + } else { + sb.append(this.rowBatches); + } + first = false; + if (!first) sb.append(", "); + sb.append("attributes:"); + if (this.attributes == null) { + sb.append("null"); + } else { + sb.append(this.attributes); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 mutateRows_argsStandardSchemeFactory implements SchemeFactory { + public mutateRows_argsStandardScheme getScheme() { + return new mutateRows_argsStandardScheme(); + } + } + + private static class mutateRows_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, mutateRows_args 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.STRING) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // ROW_BATCHES + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list382 = iprot.readListBegin(); + struct.rowBatches = new ArrayList(_list382.size); + BatchMutation _elem383; + for (int _i384 = 0; _i384 < _list382.size; ++_i384) + { + _elem383 = new BatchMutation(); + _elem383.read(iprot); + struct.rowBatches.add(_elem383); + } + iprot.readListEnd(); + } + struct.setRowBatchesIsSet(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 _map385 = iprot.readMapBegin(); + struct.attributes = new HashMap(2*_map385.size); + ByteBuffer _key386; + ByteBuffer _val387; + for (int _i388 = 0; _i388 < _map385.size; ++_i388) + { + _key386 = iprot.readBinary(); + _val387 = iprot.readBinary(); + struct.attributes.put(_key386, _val387); + } + iprot.readMapEnd(); + } + struct.setAttributesIsSet(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, mutateRows_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.tableName != null) { + oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC); + oprot.writeBinary(struct.tableName); + oprot.writeFieldEnd(); + } + if (struct.rowBatches != null) { + oprot.writeFieldBegin(ROW_BATCHES_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.rowBatches.size())); + for (BatchMutation _iter389 : struct.rowBatches) + { + _iter389.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.attributes != null) { + 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 _iter390 : struct.attributes.entrySet()) + { + oprot.writeBinary(_iter390.getKey()); + oprot.writeBinary(_iter390.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class mutateRows_argsTupleSchemeFactory implements SchemeFactory { + public mutateRows_argsTupleScheme getScheme() { + return new mutateRows_argsTupleScheme(); + } + } + + private static class mutateRows_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, mutateRows_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetTableName()) { + optionals.set(0); + } + if (struct.isSetRowBatches()) { + optionals.set(1); + } + if (struct.isSetAttributes()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetTableName()) { + oprot.writeBinary(struct.tableName); + } + if (struct.isSetRowBatches()) { + { + oprot.writeI32(struct.rowBatches.size()); + for (BatchMutation _iter391 : struct.rowBatches) + { + _iter391.write(oprot); + } + } + } + if (struct.isSetAttributes()) { + { + oprot.writeI32(struct.attributes.size()); + for (Map.Entry _iter392 : struct.attributes.entrySet()) + { + oprot.writeBinary(_iter392.getKey()); + oprot.writeBinary(_iter392.getValue()); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, mutateRows_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(true); + } + if (incoming.get(1)) { + { + org.apache.thrift.protocol.TList _list393 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.rowBatches = new ArrayList(_list393.size); + BatchMutation _elem394; + for (int _i395 = 0; _i395 < _list393.size; ++_i395) + { + _elem394 = new BatchMutation(); + _elem394.read(iprot); + struct.rowBatches.add(_elem394); + } + } + struct.setRowBatchesIsSet(true); + } + if (incoming.get(2)) { + { + org.apache.thrift.protocol.TMap _map396 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.attributes = new HashMap(2*_map396.size); + ByteBuffer _key397; + ByteBuffer _val398; + for (int _i399 = 0; _i399 < _map396.size; ++_i399) + { + _key397 = iprot.readBinary(); + _val398 = iprot.readBinary(); + struct.attributes.put(_key397, _val398); + } + } + struct.setAttributesIsSet(true); + } + } + } + + } + + public static class mutateRows_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("mutateRows_result"); + + private static final org.apache.thrift.protocol.TField IO_FIELD_DESC = new org.apache.thrift.protocol.TField("io", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final org.apache.thrift.protocol.TField IA_FIELD_DESC = new org.apache.thrift.protocol.TField("ia", org.apache.thrift.protocol.TType.STRUCT, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new mutateRows_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new mutateRows_resultTupleSchemeFactory()); + } + + public IOError io; // required + public IllegalArgument ia; // 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 { + IO((short)1, "io"), + IA((short)2, "ia"); + + private static final Map byName = new HashMap(); + + 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: // IO + return IO; + case 2: // IA + return IA; + 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.IO, new org.apache.thrift.meta_data.FieldMetaData("io", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + tmpMap.put(_Fields.IA, new org.apache.thrift.meta_data.FieldMetaData("ia", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(mutateRows_result.class, metaDataMap); + } + + public mutateRows_result() { + } + + public mutateRows_result( + IOError io, + IllegalArgument ia) + { + this(); + this.io = io; + this.ia = ia; + } + + /** + * Performs a deep copy on other. + */ + public mutateRows_result(mutateRows_result other) { + if (other.isSetIo()) { + this.io = new IOError(other.io); + } + if (other.isSetIa()) { + this.ia = new IllegalArgument(other.ia); + } + } + + public mutateRows_result deepCopy() { + return new mutateRows_result(this); + } + + @Override + public void clear() { + this.io = null; + this.ia = null; + } + + public IOError getIo() { + return this.io; + } + + public mutateRows_result setIo(IOError io) { + this.io = io; + return this; + } + + public void unsetIo() { + this.io = null; + } + + /** Returns true if field io is set (has been assigned a value) and false otherwise */ + public boolean isSetIo() { + return this.io != null; + } + + public void setIoIsSet(boolean value) { + if (!value) { + this.io = null; + } + } + + public IllegalArgument getIa() { + return this.ia; + } + + public mutateRows_result setIa(IllegalArgument ia) { + this.ia = ia; + return this; + } + + public void unsetIa() { + this.ia = null; + } + + /** Returns true if field ia is set (has been assigned a value) and false otherwise */ + public boolean isSetIa() { + return this.ia != null; + } + + public void setIaIsSet(boolean value) { + if (!value) { + this.ia = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case IO: + if (value == null) { + unsetIo(); + } else { + setIo((IOError)value); + } + break; + + case IA: + if (value == null) { + unsetIa(); + } else { + setIa((IllegalArgument)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case IO: + return getIo(); + + case IA: + return getIa(); + + } + 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 IO: + return isSetIo(); + case IA: + return isSetIa(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof mutateRows_result) + return this.equals((mutateRows_result)that); + return false; + } + + public boolean equals(mutateRows_result that) { + if (that == null) + return false; + + boolean this_present_io = true && this.isSetIo(); + boolean that_present_io = true && that.isSetIo(); + if (this_present_io || that_present_io) { + if (!(this_present_io && that_present_io)) + return false; + if (!this.io.equals(that.io)) + return false; + } + + boolean this_present_ia = true && this.isSetIa(); + boolean that_present_ia = true && that.isSetIa(); + if (this_present_ia || that_present_ia) { + if (!(this_present_ia && that_present_ia)) + return false; + if (!this.ia.equals(that.ia)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_io = true && (isSetIo()); + list.add(present_io); + if (present_io) + list.add(io); + + boolean present_ia = true && (isSetIa()); + list.add(present_ia); + if (present_ia) + list.add(ia); + + return list.hashCode(); + } + + @Override + public int compareTo(mutateRows_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetIo()).compareTo(other.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, other.io); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIa()).compareTo(other.isSetIa()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIa()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ia, other.ia); + 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("mutateRows_result("); + boolean first = true; + + sb.append("io:"); + if (this.io == null) { + sb.append("null"); + } else { + sb.append(this.io); + } + first = false; + if (!first) sb.append(", "); + sb.append("ia:"); + if (this.ia == null) { + sb.append("null"); + } else { + sb.append(this.ia); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 mutateRows_resultStandardSchemeFactory implements SchemeFactory { + public mutateRows_resultStandardScheme getScheme() { + return new mutateRows_resultStandardScheme(); + } + } + + private static class mutateRows_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, mutateRows_result 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: // IO + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // IA + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ia = new IllegalArgument(); + struct.ia.read(iprot); + struct.setIaIsSet(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, mutateRows_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.io != null) { + oprot.writeFieldBegin(IO_FIELD_DESC); + struct.io.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.ia != null) { + oprot.writeFieldBegin(IA_FIELD_DESC); + struct.ia.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class mutateRows_resultTupleSchemeFactory implements SchemeFactory { + public mutateRows_resultTupleScheme getScheme() { + return new mutateRows_resultTupleScheme(); + } + } + + private static class mutateRows_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, mutateRows_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetIo()) { + optionals.set(0); + } + if (struct.isSetIa()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetIo()) { + struct.io.write(oprot); + } + if (struct.isSetIa()) { + struct.ia.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, mutateRows_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } + if (incoming.get(1)) { + struct.ia = new IllegalArgument(); + struct.ia.read(iprot); + struct.setIaIsSet(true); + } + } + } + + } + + public static class mutateRowsTs_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("mutateRowsTs_args"); + + private static final org.apache.thrift.protocol.TField TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tableName", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField ROW_BATCHES_FIELD_DESC = new org.apache.thrift.protocol.TField("rowBatches", org.apache.thrift.protocol.TType.LIST, (short)2); + 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)3); + 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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new mutateRowsTs_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new mutateRowsTs_argsTupleSchemeFactory()); + } + + /** + * name of table + */ + public ByteBuffer tableName; // required + /** + * list of row batches + */ + public List rowBatches; // required + /** + * timestamp + */ + public long timestamp; // required + /** + * Mutation attributes + */ + public Map attributes; // 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 { + /** + * name of table + */ + TABLE_NAME((short)1, "tableName"), + /** + * list of row batches + */ + ROW_BATCHES((short)2, "rowBatches"), + /** + * timestamp + */ + TIMESTAMP((short)3, "timestamp"), + /** + * Mutation attributes + */ + ATTRIBUTES((short)4, "attributes"); + + private static final Map byName = new HashMap(); + + 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: // ROW_BATCHES + return ROW_BATCHES; + case 3: // TIMESTAMP + return TIMESTAMP; + case 4: // ATTRIBUTES + return ATTRIBUTES; + 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 int __TIMESTAMP_ISSET_ID = 0; + private byte __isset_bitfield = 0; + 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.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.ROW_BATCHES, new org.apache.thrift.meta_data.FieldMetaData("rowBatches", org.apache.thrift.TFieldRequirementType.DEFAULT, + 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, BatchMutation.class)))); + tmpMap.put(_Fields.TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("timestamp", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.ATTRIBUTES, new org.apache.thrift.meta_data.FieldMetaData("attributes", org.apache.thrift.TFieldRequirementType.DEFAULT, + 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 , "Text"), + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text")))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(mutateRowsTs_args.class, metaDataMap); + } + + public mutateRowsTs_args() { + } + + public mutateRowsTs_args( + ByteBuffer tableName, + List rowBatches, + long timestamp, + Map attributes) + { + this(); + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(tableName); + this.rowBatches = rowBatches; + this.timestamp = timestamp; + setTimestampIsSet(true); + this.attributes = attributes; + } + + /** + * Performs a deep copy on other. + */ + public mutateRowsTs_args(mutateRowsTs_args other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetTableName()) { + this.tableName = other.tableName; + } + if (other.isSetRowBatches()) { + List __this__rowBatches = new ArrayList(other.rowBatches.size()); + for (BatchMutation other_element : other.rowBatches) { + __this__rowBatches.add(new BatchMutation(other_element)); + } + this.rowBatches = __this__rowBatches; + } + this.timestamp = other.timestamp; + if (other.isSetAttributes()) { + Map __this__attributes = new HashMap(other.attributes.size()); + for (Map.Entry other_element : other.attributes.entrySet()) { + + ByteBuffer other_element_key = other_element.getKey(); + ByteBuffer other_element_value = other_element.getValue(); + + ByteBuffer __this__attributes_copy_key = other_element_key; + + ByteBuffer __this__attributes_copy_value = other_element_value; + + __this__attributes.put(__this__attributes_copy_key, __this__attributes_copy_value); + } + this.attributes = __this__attributes; + } + } + + public mutateRowsTs_args deepCopy() { + return new mutateRowsTs_args(this); + } + + @Override + public void clear() { + this.tableName = null; + this.rowBatches = null; + setTimestampIsSet(false); + this.timestamp = 0; + this.attributes = null; + } + + /** + * name of table + */ + public byte[] getTableName() { + setTableName(org.apache.thrift.TBaseHelper.rightSize(tableName)); + return tableName == null ? null : tableName.array(); + } + + public ByteBuffer bufferForTableName() { + return org.apache.thrift.TBaseHelper.copyBinary(tableName); + } + + /** + * name of table + */ + public mutateRowsTs_args setTableName(byte[] tableName) { + this.tableName = tableName == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(tableName, tableName.length)); + return this; + } + + public mutateRowsTs_args setTableName(ByteBuffer tableName) { + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(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 getRowBatchesSize() { + return (this.rowBatches == null) ? 0 : this.rowBatches.size(); + } + + public java.util.Iterator getRowBatchesIterator() { + return (this.rowBatches == null) ? null : this.rowBatches.iterator(); + } + + public void addToRowBatches(BatchMutation elem) { + if (this.rowBatches == null) { + this.rowBatches = new ArrayList(); + } + this.rowBatches.add(elem); + } + + /** + * list of row batches + */ + public List getRowBatches() { + return this.rowBatches; + } + + /** + * list of row batches + */ + public mutateRowsTs_args setRowBatches(List rowBatches) { + this.rowBatches = rowBatches; + return this; + } + + public void unsetRowBatches() { + this.rowBatches = null; + } + + /** Returns true if field rowBatches is set (has been assigned a value) and false otherwise */ + public boolean isSetRowBatches() { + return this.rowBatches != null; + } + + public void setRowBatchesIsSet(boolean value) { + if (!value) { + this.rowBatches = null; + } + } + + /** + * timestamp + */ + public long getTimestamp() { + return this.timestamp; + } + + /** + * timestamp + */ + public mutateRowsTs_args setTimestamp(long timestamp) { + this.timestamp = timestamp; + setTimestampIsSet(true); + return this; + } + + public void unsetTimestamp() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); + } + + /** Returns true if field timestamp is set (has been assigned a value) and false otherwise */ + public boolean isSetTimestamp() { + return EncodingUtils.testBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); + } + + public void setTimestampIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TIMESTAMP_ISSET_ID, value); + } + + 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(); + } + this.attributes.put(key, val); + } + + /** + * Mutation attributes + */ + public Map getAttributes() { + return this.attributes; + } + + /** + * Mutation attributes + */ + public mutateRowsTs_args setAttributes(Map 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; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case TABLE_NAME: + if (value == null) { + unsetTableName(); + } else { + setTableName((ByteBuffer)value); + } + break; + + case ROW_BATCHES: + if (value == null) { + unsetRowBatches(); + } else { + setRowBatches((List)value); + } + break; + + case TIMESTAMP: + if (value == null) { + unsetTimestamp(); + } else { + setTimestamp((Long)value); + } + break; + + case ATTRIBUTES: + if (value == null) { + unsetAttributes(); + } else { + setAttributes((Map)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case TABLE_NAME: + return getTableName(); + + case ROW_BATCHES: + return getRowBatches(); + + case TIMESTAMP: + return getTimestamp(); + + case ATTRIBUTES: + return getAttributes(); + + } + 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 ROW_BATCHES: + return isSetRowBatches(); + case TIMESTAMP: + return isSetTimestamp(); + case ATTRIBUTES: + return isSetAttributes(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof mutateRowsTs_args) + return this.equals((mutateRowsTs_args)that); + return false; + } + + public boolean equals(mutateRowsTs_args 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_rowBatches = true && this.isSetRowBatches(); + boolean that_present_rowBatches = true && that.isSetRowBatches(); + if (this_present_rowBatches || that_present_rowBatches) { + if (!(this_present_rowBatches && that_present_rowBatches)) + return false; + if (!this.rowBatches.equals(that.rowBatches)) + return false; + } + + boolean this_present_timestamp = true; + boolean that_present_timestamp = true; + if (this_present_timestamp || that_present_timestamp) { + if (!(this_present_timestamp && that_present_timestamp)) + return false; + if (this.timestamp != that.timestamp) + 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; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_tableName = true && (isSetTableName()); + list.add(present_tableName); + if (present_tableName) + list.add(tableName); + + boolean present_rowBatches = true && (isSetRowBatches()); + list.add(present_rowBatches); + if (present_rowBatches) + list.add(rowBatches); + + boolean present_timestamp = true; + list.add(present_timestamp); + if (present_timestamp) + list.add(timestamp); + + boolean present_attributes = true && (isSetAttributes()); + list.add(present_attributes); + if (present_attributes) + list.add(attributes); + + return list.hashCode(); + } + + @Override + public int compareTo(mutateRowsTs_args 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(isSetRowBatches()).compareTo(other.isSetRowBatches()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRowBatches()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.rowBatches, other.rowBatches); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(other.isSetTimestamp()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTimestamp()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timestamp, other.timestamp); + 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; + } + } + 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("mutateRowsTs_args("); + boolean first = true; + + sb.append("tableName:"); + if (this.tableName == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.tableName, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("rowBatches:"); + if (this.rowBatches == null) { + sb.append("null"); + } else { + sb.append(this.rowBatches); + } + first = false; + if (!first) sb.append(", "); + sb.append("timestamp:"); + sb.append(this.timestamp); + first = false; + if (!first) sb.append(", "); + sb.append("attributes:"); + if (this.attributes == null) { + sb.append("null"); + } else { + sb.append(this.attributes); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 { + // 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); + } + } + + private static class mutateRowsTs_argsStandardSchemeFactory implements SchemeFactory { + public mutateRowsTs_argsStandardScheme getScheme() { + return new mutateRowsTs_argsStandardScheme(); + } + } + + private static class mutateRowsTs_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, mutateRowsTs_args 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.STRING) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // ROW_BATCHES + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list400 = iprot.readListBegin(); + struct.rowBatches = new ArrayList(_list400.size); + BatchMutation _elem401; + for (int _i402 = 0; _i402 < _list400.size; ++_i402) + { + _elem401 = new BatchMutation(); + _elem401.read(iprot); + struct.rowBatches.add(_elem401); + } + iprot.readListEnd(); + } + struct.setRowBatchesIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // TIMESTAMP + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.timestamp = iprot.readI64(); + struct.setTimestampIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // ATTRIBUTES + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map403 = iprot.readMapBegin(); + struct.attributes = new HashMap(2*_map403.size); + ByteBuffer _key404; + ByteBuffer _val405; + for (int _i406 = 0; _i406 < _map403.size; ++_i406) + { + _key404 = iprot.readBinary(); + _val405 = iprot.readBinary(); + struct.attributes.put(_key404, _val405); + } + iprot.readMapEnd(); + } + struct.setAttributesIsSet(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, mutateRowsTs_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.tableName != null) { + oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC); + oprot.writeBinary(struct.tableName); + oprot.writeFieldEnd(); + } + if (struct.rowBatches != null) { + oprot.writeFieldBegin(ROW_BATCHES_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.rowBatches.size())); + for (BatchMutation _iter407 : struct.rowBatches) + { + _iter407.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC); + oprot.writeI64(struct.timestamp); + oprot.writeFieldEnd(); + if (struct.attributes != null) { + 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 _iter408 : struct.attributes.entrySet()) + { + oprot.writeBinary(_iter408.getKey()); + oprot.writeBinary(_iter408.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class mutateRowsTs_argsTupleSchemeFactory implements SchemeFactory { + public mutateRowsTs_argsTupleScheme getScheme() { + return new mutateRowsTs_argsTupleScheme(); + } + } + + private static class mutateRowsTs_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, mutateRowsTs_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetTableName()) { + optionals.set(0); + } + if (struct.isSetRowBatches()) { + optionals.set(1); + } + if (struct.isSetTimestamp()) { + optionals.set(2); + } + if (struct.isSetAttributes()) { + optionals.set(3); + } + oprot.writeBitSet(optionals, 4); + if (struct.isSetTableName()) { + oprot.writeBinary(struct.tableName); + } + if (struct.isSetRowBatches()) { + { + oprot.writeI32(struct.rowBatches.size()); + for (BatchMutation _iter409 : struct.rowBatches) + { + _iter409.write(oprot); + } + } + } + if (struct.isSetTimestamp()) { + oprot.writeI64(struct.timestamp); + } + if (struct.isSetAttributes()) { + { + oprot.writeI32(struct.attributes.size()); + for (Map.Entry _iter410 : struct.attributes.entrySet()) + { + oprot.writeBinary(_iter410.getKey()); + oprot.writeBinary(_iter410.getValue()); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, mutateRowsTs_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(4); + if (incoming.get(0)) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(true); + } + if (incoming.get(1)) { + { + org.apache.thrift.protocol.TList _list411 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.rowBatches = new ArrayList(_list411.size); + BatchMutation _elem412; + for (int _i413 = 0; _i413 < _list411.size; ++_i413) + { + _elem412 = new BatchMutation(); + _elem412.read(iprot); + struct.rowBatches.add(_elem412); + } + } + struct.setRowBatchesIsSet(true); + } + if (incoming.get(2)) { + struct.timestamp = iprot.readI64(); + struct.setTimestampIsSet(true); + } + if (incoming.get(3)) { + { + org.apache.thrift.protocol.TMap _map414 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.attributes = new HashMap(2*_map414.size); + ByteBuffer _key415; + ByteBuffer _val416; + for (int _i417 = 0; _i417 < _map414.size; ++_i417) + { + _key415 = iprot.readBinary(); + _val416 = iprot.readBinary(); + struct.attributes.put(_key415, _val416); + } + } + struct.setAttributesIsSet(true); + } + } + } + + } + + public static class mutateRowsTs_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("mutateRowsTs_result"); + + private static final org.apache.thrift.protocol.TField IO_FIELD_DESC = new org.apache.thrift.protocol.TField("io", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final org.apache.thrift.protocol.TField IA_FIELD_DESC = new org.apache.thrift.protocol.TField("ia", org.apache.thrift.protocol.TType.STRUCT, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new mutateRowsTs_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new mutateRowsTs_resultTupleSchemeFactory()); + } + + public IOError io; // required + public IllegalArgument ia; // 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 { + IO((short)1, "io"), + IA((short)2, "ia"); + + private static final Map byName = new HashMap(); + + 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: // IO + return IO; + case 2: // IA + return IA; + 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.IO, new org.apache.thrift.meta_data.FieldMetaData("io", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + tmpMap.put(_Fields.IA, new org.apache.thrift.meta_data.FieldMetaData("ia", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(mutateRowsTs_result.class, metaDataMap); + } + + public mutateRowsTs_result() { + } + + public mutateRowsTs_result( + IOError io, + IllegalArgument ia) + { + this(); + this.io = io; + this.ia = ia; + } + + /** + * Performs a deep copy on other. + */ + public mutateRowsTs_result(mutateRowsTs_result other) { + if (other.isSetIo()) { + this.io = new IOError(other.io); + } + if (other.isSetIa()) { + this.ia = new IllegalArgument(other.ia); + } + } + + public mutateRowsTs_result deepCopy() { + return new mutateRowsTs_result(this); + } + + @Override + public void clear() { + this.io = null; + this.ia = null; + } + + public IOError getIo() { + return this.io; + } + + public mutateRowsTs_result setIo(IOError io) { + this.io = io; + return this; + } + + public void unsetIo() { + this.io = null; + } + + /** Returns true if field io is set (has been assigned a value) and false otherwise */ + public boolean isSetIo() { + return this.io != null; + } + + public void setIoIsSet(boolean value) { + if (!value) { + this.io = null; + } + } + + public IllegalArgument getIa() { + return this.ia; + } + + public mutateRowsTs_result setIa(IllegalArgument ia) { + this.ia = ia; + return this; + } + + public void unsetIa() { + this.ia = null; + } + + /** Returns true if field ia is set (has been assigned a value) and false otherwise */ + public boolean isSetIa() { + return this.ia != null; + } + + public void setIaIsSet(boolean value) { + if (!value) { + this.ia = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case IO: + if (value == null) { + unsetIo(); + } else { + setIo((IOError)value); + } + break; + + case IA: + if (value == null) { + unsetIa(); + } else { + setIa((IllegalArgument)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case IO: + return getIo(); + + case IA: + return getIa(); + + } + 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 IO: + return isSetIo(); + case IA: + return isSetIa(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof mutateRowsTs_result) + return this.equals((mutateRowsTs_result)that); + return false; + } + + public boolean equals(mutateRowsTs_result that) { + if (that == null) + return false; + + boolean this_present_io = true && this.isSetIo(); + boolean that_present_io = true && that.isSetIo(); + if (this_present_io || that_present_io) { + if (!(this_present_io && that_present_io)) + return false; + if (!this.io.equals(that.io)) + return false; + } + + boolean this_present_ia = true && this.isSetIa(); + boolean that_present_ia = true && that.isSetIa(); + if (this_present_ia || that_present_ia) { + if (!(this_present_ia && that_present_ia)) + return false; + if (!this.ia.equals(that.ia)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_io = true && (isSetIo()); + list.add(present_io); + if (present_io) + list.add(io); + + boolean present_ia = true && (isSetIa()); + list.add(present_ia); + if (present_ia) + list.add(ia); + + return list.hashCode(); + } + + @Override + public int compareTo(mutateRowsTs_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetIo()).compareTo(other.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, other.io); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIa()).compareTo(other.isSetIa()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIa()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ia, other.ia); + 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("mutateRowsTs_result("); + boolean first = true; + + sb.append("io:"); + if (this.io == null) { + sb.append("null"); + } else { + sb.append(this.io); + } + first = false; + if (!first) sb.append(", "); + sb.append("ia:"); + if (this.ia == null) { + sb.append("null"); + } else { + sb.append(this.ia); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 mutateRowsTs_resultStandardSchemeFactory implements SchemeFactory { + public mutateRowsTs_resultStandardScheme getScheme() { + return new mutateRowsTs_resultStandardScheme(); + } + } + + private static class mutateRowsTs_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, mutateRowsTs_result 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: // IO + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // IA + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ia = new IllegalArgument(); + struct.ia.read(iprot); + struct.setIaIsSet(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, mutateRowsTs_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.io != null) { + oprot.writeFieldBegin(IO_FIELD_DESC); + struct.io.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.ia != null) { + oprot.writeFieldBegin(IA_FIELD_DESC); + struct.ia.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class mutateRowsTs_resultTupleSchemeFactory implements SchemeFactory { + public mutateRowsTs_resultTupleScheme getScheme() { + return new mutateRowsTs_resultTupleScheme(); + } + } + + private static class mutateRowsTs_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, mutateRowsTs_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetIo()) { + optionals.set(0); + } + if (struct.isSetIa()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetIo()) { + struct.io.write(oprot); + } + if (struct.isSetIa()) { + struct.ia.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, mutateRowsTs_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } + if (incoming.get(1)) { + struct.ia = new IllegalArgument(); + struct.ia.read(iprot); + struct.setIaIsSet(true); + } + } + } + + } + + public static class atomicIncrement_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("atomicIncrement_args"); + + private static final org.apache.thrift.protocol.TField TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tableName", org.apache.thrift.protocol.TType.STRING, (short)1); + 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)2); + private static final org.apache.thrift.protocol.TField COLUMN_FIELD_DESC = new org.apache.thrift.protocol.TField("column", org.apache.thrift.protocol.TType.STRING, (short)3); + private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.I64, (short)4); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new atomicIncrement_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new atomicIncrement_argsTupleSchemeFactory()); + } + + /** + * name of table + */ + public ByteBuffer tableName; // required + /** + * row to increment + */ + public ByteBuffer row; // required + /** + * name of column + */ + public ByteBuffer column; // required + /** + * amount to increment by + */ + public long value; // 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 { + /** + * name of table + */ + TABLE_NAME((short)1, "tableName"), + /** + * row to increment + */ + ROW((short)2, "row"), + /** + * name of column + */ + COLUMN((short)3, "column"), + /** + * amount to increment by + */ + VALUE((short)4, "value"); + + private static final Map byName = new HashMap(); + + 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: // ROW + return ROW; + case 3: // COLUMN + return COLUMN; + case 4: // VALUE + return VALUE; + 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 int __VALUE_ISSET_ID = 0; + private byte __isset_bitfield = 0; + 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.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.ROW, new org.apache.thrift.meta_data.FieldMetaData("row", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.COLUMN, new org.apache.thrift.meta_data.FieldMetaData("column", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(atomicIncrement_args.class, metaDataMap); + } + + public atomicIncrement_args() { + } + + public atomicIncrement_args( + ByteBuffer tableName, + ByteBuffer row, + ByteBuffer column, + long value) + { + this(); + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(tableName); + this.row = org.apache.thrift.TBaseHelper.copyBinary(row); + this.column = org.apache.thrift.TBaseHelper.copyBinary(column); + this.value = value; + setValueIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public atomicIncrement_args(atomicIncrement_args other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetTableName()) { + this.tableName = other.tableName; + } + if (other.isSetRow()) { + this.row = other.row; + } + if (other.isSetColumn()) { + this.column = other.column; + } + this.value = other.value; + } + + public atomicIncrement_args deepCopy() { + return new atomicIncrement_args(this); + } + + @Override + public void clear() { + this.tableName = null; + this.row = null; + this.column = null; + setValueIsSet(false); + this.value = 0; + } + + /** + * name of table + */ + public byte[] getTableName() { + setTableName(org.apache.thrift.TBaseHelper.rightSize(tableName)); + return tableName == null ? null : tableName.array(); + } + + public ByteBuffer bufferForTableName() { + return org.apache.thrift.TBaseHelper.copyBinary(tableName); + } + + /** + * name of table + */ + public atomicIncrement_args setTableName(byte[] tableName) { + this.tableName = tableName == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(tableName, tableName.length)); + return this; + } + + public atomicIncrement_args setTableName(ByteBuffer tableName) { + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(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; + } + } + + /** + * row to increment + */ + public byte[] getRow() { + setRow(org.apache.thrift.TBaseHelper.rightSize(row)); + return row == null ? null : row.array(); + } + + public ByteBuffer bufferForRow() { + return org.apache.thrift.TBaseHelper.copyBinary(row); + } + + /** + * row to increment + */ + public atomicIncrement_args setRow(byte[] row) { + this.row = row == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(row, row.length)); + return this; + } + + public atomicIncrement_args setRow(ByteBuffer row) { + this.row = org.apache.thrift.TBaseHelper.copyBinary(row); + return this; + } + + public void unsetRow() { + this.row = null; + } + + /** Returns true if field row is set (has been assigned a value) and false otherwise */ + public boolean isSetRow() { + return this.row != null; + } + + public void setRowIsSet(boolean value) { + if (!value) { + this.row = null; + } + } + + /** + * name of column + */ + public byte[] getColumn() { + setColumn(org.apache.thrift.TBaseHelper.rightSize(column)); + return column == null ? null : column.array(); + } + + public ByteBuffer bufferForColumn() { + return org.apache.thrift.TBaseHelper.copyBinary(column); + } + + /** + * name of column + */ + public atomicIncrement_args setColumn(byte[] column) { + this.column = column == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(column, column.length)); + return this; + } + + public atomicIncrement_args setColumn(ByteBuffer column) { + this.column = org.apache.thrift.TBaseHelper.copyBinary(column); + return this; + } + + public void unsetColumn() { + this.column = null; + } + + /** Returns true if field column is set (has been assigned a value) and false otherwise */ + public boolean isSetColumn() { + return this.column != null; + } + + public void setColumnIsSet(boolean value) { + if (!value) { + this.column = null; + } + } + + /** + * amount to increment by + */ + public long getValue() { + return this.value; + } + + /** + * amount to increment by + */ + public atomicIncrement_args setValue(long value) { + this.value = value; + setValueIsSet(true); + return this; + } + + public void unsetValue() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __VALUE_ISSET_ID); + } + + /** Returns true if field value is set (has been assigned a value) and false otherwise */ + public boolean isSetValue() { + return EncodingUtils.testBit(__isset_bitfield, __VALUE_ISSET_ID); + } + + public void setValueIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __VALUE_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case TABLE_NAME: + if (value == null) { + unsetTableName(); + } else { + setTableName((ByteBuffer)value); + } + break; + + case ROW: + if (value == null) { + unsetRow(); + } else { + setRow((ByteBuffer)value); + } + break; + + case COLUMN: + if (value == null) { + unsetColumn(); + } else { + setColumn((ByteBuffer)value); + } + break; + + case VALUE: + if (value == null) { + unsetValue(); + } else { + setValue((Long)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case TABLE_NAME: + return getTableName(); + + case ROW: + return getRow(); + + case COLUMN: + return getColumn(); + + case VALUE: + return getValue(); + + } + 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 ROW: + return isSetRow(); + case COLUMN: + return isSetColumn(); + case VALUE: + return isSetValue(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof atomicIncrement_args) + return this.equals((atomicIncrement_args)that); + return false; + } + + public boolean equals(atomicIncrement_args 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_row = true && this.isSetRow(); + boolean that_present_row = true && that.isSetRow(); + if (this_present_row || that_present_row) { + if (!(this_present_row && that_present_row)) + return false; + if (!this.row.equals(that.row)) + return false; + } + + boolean this_present_column = true && this.isSetColumn(); + boolean that_present_column = true && that.isSetColumn(); + if (this_present_column || that_present_column) { + if (!(this_present_column && that_present_column)) + return false; + if (!this.column.equals(that.column)) + return false; + } + + boolean this_present_value = true; + boolean that_present_value = true; + if (this_present_value || that_present_value) { + if (!(this_present_value && that_present_value)) + return false; + if (this.value != that.value) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_tableName = true && (isSetTableName()); + list.add(present_tableName); + if (present_tableName) + list.add(tableName); + + boolean present_row = true && (isSetRow()); + list.add(present_row); + if (present_row) + list.add(row); + + boolean present_column = true && (isSetColumn()); + list.add(present_column); + if (present_column) + list.add(column); + + boolean present_value = true; + list.add(present_value); + if (present_value) + list.add(value); + + return list.hashCode(); + } + + @Override + public int compareTo(atomicIncrement_args 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(isSetRow()).compareTo(other.isSetRow()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRow()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.row, other.row); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetColumn()).compareTo(other.isSetColumn()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetColumn()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.column, other.column); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValue()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, other.value); + 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("atomicIncrement_args("); + boolean first = true; + + sb.append("tableName:"); + if (this.tableName == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.tableName, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("row:"); + if (this.row == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.row, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("column:"); + if (this.column == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.column, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("value:"); + sb.append(this.value); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 { + // 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); + } + } + + private static class atomicIncrement_argsStandardSchemeFactory implements SchemeFactory { + public atomicIncrement_argsStandardScheme getScheme() { + return new atomicIncrement_argsStandardScheme(); + } + } + + private static class atomicIncrement_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, atomicIncrement_args 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.STRING) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // ROW + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.row = iprot.readBinary(); + struct.setRowIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // COLUMN + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.column = iprot.readBinary(); + struct.setColumnIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // VALUE + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.value = iprot.readI64(); + struct.setValueIsSet(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, atomicIncrement_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.tableName != null) { + oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC); + oprot.writeBinary(struct.tableName); + oprot.writeFieldEnd(); + } + if (struct.row != null) { + oprot.writeFieldBegin(ROW_FIELD_DESC); + oprot.writeBinary(struct.row); + oprot.writeFieldEnd(); + } + if (struct.column != null) { + oprot.writeFieldBegin(COLUMN_FIELD_DESC); + oprot.writeBinary(struct.column); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(VALUE_FIELD_DESC); + oprot.writeI64(struct.value); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class atomicIncrement_argsTupleSchemeFactory implements SchemeFactory { + public atomicIncrement_argsTupleScheme getScheme() { + return new atomicIncrement_argsTupleScheme(); + } + } + + private static class atomicIncrement_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, atomicIncrement_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetTableName()) { + optionals.set(0); + } + if (struct.isSetRow()) { + optionals.set(1); + } + if (struct.isSetColumn()) { + optionals.set(2); + } + if (struct.isSetValue()) { + optionals.set(3); + } + oprot.writeBitSet(optionals, 4); + if (struct.isSetTableName()) { + oprot.writeBinary(struct.tableName); + } + if (struct.isSetRow()) { + oprot.writeBinary(struct.row); + } + if (struct.isSetColumn()) { + oprot.writeBinary(struct.column); + } + if (struct.isSetValue()) { + oprot.writeI64(struct.value); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, atomicIncrement_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(4); + if (incoming.get(0)) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(true); + } + if (incoming.get(1)) { + struct.row = iprot.readBinary(); + struct.setRowIsSet(true); + } + if (incoming.get(2)) { + struct.column = iprot.readBinary(); + struct.setColumnIsSet(true); + } + if (incoming.get(3)) { + struct.value = iprot.readI64(); + struct.setValueIsSet(true); + } + } + } + + } + + public static class atomicIncrement_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("atomicIncrement_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I64, (short)0); + private static final org.apache.thrift.protocol.TField IO_FIELD_DESC = new org.apache.thrift.protocol.TField("io", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final org.apache.thrift.protocol.TField IA_FIELD_DESC = new org.apache.thrift.protocol.TField("ia", org.apache.thrift.protocol.TType.STRUCT, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new atomicIncrement_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new atomicIncrement_resultTupleSchemeFactory()); + } + + public long success; // required + public IOError io; // required + public IllegalArgument ia; // 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 { + SUCCESS((short)0, "success"), + IO((short)1, "io"), + IA((short)2, "ia"); + + private static final Map byName = new HashMap(); + + 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 0: // SUCCESS + return SUCCESS; + case 1: // IO + return IO; + case 2: // IA + return IA; + 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 int __SUCCESS_ISSET_ID = 0; + private byte __isset_bitfield = 0; + 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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.IO, new org.apache.thrift.meta_data.FieldMetaData("io", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + tmpMap.put(_Fields.IA, new org.apache.thrift.meta_data.FieldMetaData("ia", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(atomicIncrement_result.class, metaDataMap); + } + + public atomicIncrement_result() { + } + + public atomicIncrement_result( + long success, + IOError io, + IllegalArgument ia) + { + this(); + this.success = success; + setSuccessIsSet(true); + this.io = io; + this.ia = ia; + } + + /** + * Performs a deep copy on other. + */ + public atomicIncrement_result(atomicIncrement_result other) { + __isset_bitfield = other.__isset_bitfield; + this.success = other.success; + if (other.isSetIo()) { + this.io = new IOError(other.io); + } + if (other.isSetIa()) { + this.ia = new IllegalArgument(other.ia); + } + } + + public atomicIncrement_result deepCopy() { + return new atomicIncrement_result(this); + } + + @Override + public void clear() { + setSuccessIsSet(false); + this.success = 0; + this.io = null; + this.ia = null; + } + + public long getSuccess() { + return this.success; + } + + public atomicIncrement_result setSuccess(long success) { + this.success = success; + setSuccessIsSet(true); + return this; + } + + public void unsetSuccess() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + public void setSuccessIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); + } + + public IOError getIo() { + return this.io; + } + + public atomicIncrement_result setIo(IOError io) { + this.io = io; + return this; + } + + public void unsetIo() { + this.io = null; + } + + /** Returns true if field io is set (has been assigned a value) and false otherwise */ + public boolean isSetIo() { + return this.io != null; + } + + public void setIoIsSet(boolean value) { + if (!value) { + this.io = null; + } + } + + public IllegalArgument getIa() { + return this.ia; + } + + public atomicIncrement_result setIa(IllegalArgument ia) { + this.ia = ia; + return this; + } + + public void unsetIa() { + this.ia = null; + } + + /** Returns true if field ia is set (has been assigned a value) and false otherwise */ + public boolean isSetIa() { + return this.ia != null; + } + + public void setIaIsSet(boolean value) { + if (!value) { + this.ia = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((Long)value); + } + break; + + case IO: + if (value == null) { + unsetIo(); + } else { + setIo((IOError)value); + } + break; + + case IA: + if (value == null) { + unsetIa(); + } else { + setIa((IllegalArgument)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + case IO: + return getIo(); + + case IA: + return getIa(); + + } + 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 SUCCESS: + return isSetSuccess(); + case IO: + return isSetIo(); + case IA: + return isSetIa(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof atomicIncrement_result) + return this.equals((atomicIncrement_result)that); + return false; + } + + public boolean equals(atomicIncrement_result that) { + if (that == null) + return false; + + boolean this_present_success = true; + boolean that_present_success = true; + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (this.success != that.success) + return false; + } + + boolean this_present_io = true && this.isSetIo(); + boolean that_present_io = true && that.isSetIo(); + if (this_present_io || that_present_io) { + if (!(this_present_io && that_present_io)) + return false; + if (!this.io.equals(that.io)) + return false; + } + + boolean this_present_ia = true && this.isSetIa(); + boolean that_present_ia = true && that.isSetIa(); + if (this_present_ia || that_present_ia) { + if (!(this_present_ia && that_present_ia)) + return false; + if (!this.ia.equals(that.ia)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true; + list.add(present_success); + if (present_success) + list.add(success); + + boolean present_io = true && (isSetIo()); + list.add(present_io); + if (present_io) + list.add(io); + + boolean present_ia = true && (isSetIa()); + list.add(present_ia); + if (present_ia) + list.add(ia); + + return list.hashCode(); + } + + @Override + public int compareTo(atomicIncrement_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIo()).compareTo(other.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, other.io); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIa()).compareTo(other.isSetIa()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIa()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ia, other.ia); + 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("atomicIncrement_result("); + boolean first = true; + + sb.append("success:"); + sb.append(this.success); + first = false; + if (!first) sb.append(", "); + sb.append("io:"); + if (this.io == null) { + sb.append("null"); + } else { + sb.append(this.io); + } + first = false; + if (!first) sb.append(", "); + sb.append("ia:"); + if (this.ia == null) { + sb.append("null"); + } else { + sb.append(this.ia); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 { + // 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); + } + } + + private static class atomicIncrement_resultStandardSchemeFactory implements SchemeFactory { + public atomicIncrement_resultStandardScheme getScheme() { + return new atomicIncrement_resultStandardScheme(); + } + } + + private static class atomicIncrement_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, atomicIncrement_result 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 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.success = iprot.readI64(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IO + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // IA + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ia = new IllegalArgument(); + struct.ia.read(iprot); + struct.setIaIsSet(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, atomicIncrement_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeI64(struct.success); + oprot.writeFieldEnd(); + } + if (struct.io != null) { + oprot.writeFieldBegin(IO_FIELD_DESC); + struct.io.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.ia != null) { + oprot.writeFieldBegin(IA_FIELD_DESC); + struct.ia.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class atomicIncrement_resultTupleSchemeFactory implements SchemeFactory { + public atomicIncrement_resultTupleScheme getScheme() { + return new atomicIncrement_resultTupleScheme(); + } + } + + private static class atomicIncrement_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, atomicIncrement_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIo()) { + optionals.set(1); + } + if (struct.isSetIa()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetSuccess()) { + oprot.writeI64(struct.success); + } + if (struct.isSetIo()) { + struct.io.write(oprot); + } + if (struct.isSetIa()) { + struct.ia.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, atomicIncrement_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + struct.success = iprot.readI64(); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } + if (incoming.get(2)) { + struct.ia = new IllegalArgument(); + struct.ia.read(iprot); + struct.setIaIsSet(true); + } + } + } + + } + + public static class deleteAll_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteAll_args"); + + private static final org.apache.thrift.protocol.TField TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tableName", org.apache.thrift.protocol.TType.STRING, (short)1); + 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)2); + private static final org.apache.thrift.protocol.TField COLUMN_FIELD_DESC = new org.apache.thrift.protocol.TField("column", org.apache.thrift.protocol.TType.STRING, (short)3); + 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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new deleteAll_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new deleteAll_argsTupleSchemeFactory()); + } + + /** + * name of table + */ + public ByteBuffer tableName; // required + /** + * Row to update + */ + public ByteBuffer row; // required + /** + * name of column whose value is to be deleted + */ + public ByteBuffer column; // required + /** + * Delete attributes + */ + public Map attributes; // 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 { + /** + * name of table + */ + TABLE_NAME((short)1, "tableName"), + /** + * Row to update + */ + ROW((short)2, "row"), + /** + * name of column whose value is to be deleted + */ + COLUMN((short)3, "column"), + /** + * Delete attributes + */ + ATTRIBUTES((short)4, "attributes"); + + private static final Map byName = new HashMap(); + + 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: // ROW + return ROW; + case 3: // COLUMN + return COLUMN; + case 4: // ATTRIBUTES + return ATTRIBUTES; + 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.TABLE_NAME, new org.apache.thrift.meta_data.FieldMetaData("tableName", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.ROW, new org.apache.thrift.meta_data.FieldMetaData("row", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.COLUMN, new org.apache.thrift.meta_data.FieldMetaData("column", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.ATTRIBUTES, new org.apache.thrift.meta_data.FieldMetaData("attributes", org.apache.thrift.TFieldRequirementType.DEFAULT, + 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 , "Text"), + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text")))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteAll_args.class, metaDataMap); + } + + public deleteAll_args() { + } + + public deleteAll_args( + ByteBuffer tableName, + ByteBuffer row, + ByteBuffer column, + Map attributes) + { + this(); + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(tableName); + this.row = org.apache.thrift.TBaseHelper.copyBinary(row); + this.column = org.apache.thrift.TBaseHelper.copyBinary(column); + this.attributes = attributes; + } + + /** + * Performs a deep copy on other. + */ + public deleteAll_args(deleteAll_args other) { + if (other.isSetTableName()) { + this.tableName = other.tableName; + } + if (other.isSetRow()) { + this.row = other.row; + } + if (other.isSetColumn()) { + this.column = other.column; + } + if (other.isSetAttributes()) { + Map __this__attributes = new HashMap(other.attributes.size()); + for (Map.Entry other_element : other.attributes.entrySet()) { + + ByteBuffer other_element_key = other_element.getKey(); + ByteBuffer other_element_value = other_element.getValue(); + + ByteBuffer __this__attributes_copy_key = other_element_key; + + ByteBuffer __this__attributes_copy_value = other_element_value; + + __this__attributes.put(__this__attributes_copy_key, __this__attributes_copy_value); + } + this.attributes = __this__attributes; + } + } + + public deleteAll_args deepCopy() { + return new deleteAll_args(this); + } + + @Override + public void clear() { + this.tableName = null; + this.row = null; + this.column = null; + this.attributes = null; + } + + /** + * name of table + */ + public byte[] getTableName() { + setTableName(org.apache.thrift.TBaseHelper.rightSize(tableName)); + return tableName == null ? null : tableName.array(); + } + + public ByteBuffer bufferForTableName() { + return org.apache.thrift.TBaseHelper.copyBinary(tableName); + } + + /** + * name of table + */ + public deleteAll_args setTableName(byte[] tableName) { + this.tableName = tableName == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(tableName, tableName.length)); + return this; + } + + public deleteAll_args setTableName(ByteBuffer tableName) { + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(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; + } + } + + /** + * Row to update + */ + public byte[] getRow() { + setRow(org.apache.thrift.TBaseHelper.rightSize(row)); + return row == null ? null : row.array(); + } + + public ByteBuffer bufferForRow() { + return org.apache.thrift.TBaseHelper.copyBinary(row); + } + + /** + * Row to update + */ + public deleteAll_args setRow(byte[] row) { + this.row = row == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(row, row.length)); + return this; + } + + public deleteAll_args setRow(ByteBuffer row) { + this.row = org.apache.thrift.TBaseHelper.copyBinary(row); + return this; + } + + public void unsetRow() { + this.row = null; + } + + /** Returns true if field row is set (has been assigned a value) and false otherwise */ + public boolean isSetRow() { + return this.row != null; + } + + public void setRowIsSet(boolean value) { + if (!value) { + this.row = null; + } + } + + /** + * name of column whose value is to be deleted + */ + public byte[] getColumn() { + setColumn(org.apache.thrift.TBaseHelper.rightSize(column)); + return column == null ? null : column.array(); + } + + public ByteBuffer bufferForColumn() { + return org.apache.thrift.TBaseHelper.copyBinary(column); + } + + /** + * name of column whose value is to be deleted + */ + public deleteAll_args setColumn(byte[] column) { + this.column = column == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(column, column.length)); + return this; + } + + public deleteAll_args setColumn(ByteBuffer column) { + this.column = org.apache.thrift.TBaseHelper.copyBinary(column); + return this; + } + + public void unsetColumn() { + this.column = null; + } + + /** Returns true if field column is set (has been assigned a value) and false otherwise */ + public boolean isSetColumn() { + return this.column != null; + } + + public void setColumnIsSet(boolean value) { + if (!value) { + this.column = 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(); + } + this.attributes.put(key, val); + } + + /** + * Delete attributes + */ + public Map getAttributes() { + return this.attributes; + } + + /** + * Delete attributes + */ + public deleteAll_args setAttributes(Map 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; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case TABLE_NAME: + if (value == null) { + unsetTableName(); + } else { + setTableName((ByteBuffer)value); + } + break; + + case ROW: + if (value == null) { + unsetRow(); + } else { + setRow((ByteBuffer)value); + } + break; + + case COLUMN: + if (value == null) { + unsetColumn(); + } else { + setColumn((ByteBuffer)value); + } + break; + + case ATTRIBUTES: + if (value == null) { + unsetAttributes(); + } else { + setAttributes((Map)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case TABLE_NAME: + return getTableName(); + + case ROW: + return getRow(); + + case COLUMN: + return getColumn(); + + case ATTRIBUTES: + return getAttributes(); + + } + 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 ROW: + return isSetRow(); + case COLUMN: + return isSetColumn(); + case ATTRIBUTES: + return isSetAttributes(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof deleteAll_args) + return this.equals((deleteAll_args)that); + return false; + } + + public boolean equals(deleteAll_args 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_row = true && this.isSetRow(); + boolean that_present_row = true && that.isSetRow(); + if (this_present_row || that_present_row) { + if (!(this_present_row && that_present_row)) + return false; + if (!this.row.equals(that.row)) + return false; + } + + boolean this_present_column = true && this.isSetColumn(); + boolean that_present_column = true && that.isSetColumn(); + if (this_present_column || that_present_column) { + if (!(this_present_column && that_present_column)) + return false; + if (!this.column.equals(that.column)) + 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; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_tableName = true && (isSetTableName()); + list.add(present_tableName); + if (present_tableName) + list.add(tableName); + + boolean present_row = true && (isSetRow()); + list.add(present_row); + if (present_row) + list.add(row); + + boolean present_column = true && (isSetColumn()); + list.add(present_column); + if (present_column) + list.add(column); + + boolean present_attributes = true && (isSetAttributes()); + list.add(present_attributes); + if (present_attributes) + list.add(attributes); + + return list.hashCode(); + } + + @Override + public int compareTo(deleteAll_args 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(isSetRow()).compareTo(other.isSetRow()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRow()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.row, other.row); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetColumn()).compareTo(other.isSetColumn()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetColumn()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.column, other.column); + 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; + } + } + 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("deleteAll_args("); + boolean first = true; + + sb.append("tableName:"); + if (this.tableName == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.tableName, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("row:"); + if (this.row == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.row, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("column:"); + if (this.column == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.column, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("attributes:"); + if (this.attributes == null) { + sb.append("null"); + } else { + sb.append(this.attributes); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 deleteAll_argsStandardSchemeFactory implements SchemeFactory { + public deleteAll_argsStandardScheme getScheme() { + return new deleteAll_argsStandardScheme(); + } + } + + private static class deleteAll_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, deleteAll_args 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.STRING) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // ROW + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.row = iprot.readBinary(); + struct.setRowIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // COLUMN + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.column = iprot.readBinary(); + struct.setColumnIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // ATTRIBUTES + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map418 = iprot.readMapBegin(); + struct.attributes = new HashMap(2*_map418.size); + ByteBuffer _key419; + ByteBuffer _val420; + for (int _i421 = 0; _i421 < _map418.size; ++_i421) + { + _key419 = iprot.readBinary(); + _val420 = iprot.readBinary(); + struct.attributes.put(_key419, _val420); + } + iprot.readMapEnd(); + } + struct.setAttributesIsSet(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, deleteAll_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.tableName != null) { + oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC); + oprot.writeBinary(struct.tableName); + oprot.writeFieldEnd(); + } + if (struct.row != null) { + oprot.writeFieldBegin(ROW_FIELD_DESC); + oprot.writeBinary(struct.row); + oprot.writeFieldEnd(); + } + if (struct.column != null) { + oprot.writeFieldBegin(COLUMN_FIELD_DESC); + oprot.writeBinary(struct.column); + oprot.writeFieldEnd(); + } + if (struct.attributes != null) { + 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 _iter422 : struct.attributes.entrySet()) + { + oprot.writeBinary(_iter422.getKey()); + oprot.writeBinary(_iter422.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class deleteAll_argsTupleSchemeFactory implements SchemeFactory { + public deleteAll_argsTupleScheme getScheme() { + return new deleteAll_argsTupleScheme(); + } + } + + private static class deleteAll_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, deleteAll_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetTableName()) { + optionals.set(0); + } + if (struct.isSetRow()) { + optionals.set(1); + } + if (struct.isSetColumn()) { + optionals.set(2); + } + if (struct.isSetAttributes()) { + optionals.set(3); + } + oprot.writeBitSet(optionals, 4); + if (struct.isSetTableName()) { + oprot.writeBinary(struct.tableName); + } + if (struct.isSetRow()) { + oprot.writeBinary(struct.row); + } + if (struct.isSetColumn()) { + oprot.writeBinary(struct.column); + } + if (struct.isSetAttributes()) { + { + oprot.writeI32(struct.attributes.size()); + for (Map.Entry _iter423 : struct.attributes.entrySet()) + { + oprot.writeBinary(_iter423.getKey()); + oprot.writeBinary(_iter423.getValue()); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, deleteAll_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(4); + if (incoming.get(0)) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(true); + } + if (incoming.get(1)) { + struct.row = iprot.readBinary(); + struct.setRowIsSet(true); + } + if (incoming.get(2)) { + struct.column = iprot.readBinary(); + struct.setColumnIsSet(true); + } + if (incoming.get(3)) { + { + org.apache.thrift.protocol.TMap _map424 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.attributes = new HashMap(2*_map424.size); + ByteBuffer _key425; + ByteBuffer _val426; + for (int _i427 = 0; _i427 < _map424.size; ++_i427) + { + _key425 = iprot.readBinary(); + _val426 = iprot.readBinary(); + struct.attributes.put(_key425, _val426); + } + } + struct.setAttributesIsSet(true); + } + } + } + + } + + public static class deleteAll_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteAll_result"); + + private static final org.apache.thrift.protocol.TField IO_FIELD_DESC = new org.apache.thrift.protocol.TField("io", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new deleteAll_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new deleteAll_resultTupleSchemeFactory()); + } + + public IOError io; // 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 { + IO((short)1, "io"); + + private static final Map byName = new HashMap(); + + 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: // IO + return IO; + 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.IO, new org.apache.thrift.meta_data.FieldMetaData("io", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteAll_result.class, metaDataMap); + } + + public deleteAll_result() { + } + + public deleteAll_result( + IOError io) + { + this(); + this.io = io; + } + + /** + * Performs a deep copy on other. + */ + public deleteAll_result(deleteAll_result other) { + if (other.isSetIo()) { + this.io = new IOError(other.io); + } + } + + public deleteAll_result deepCopy() { + return new deleteAll_result(this); + } + + @Override + public void clear() { + this.io = null; + } + + public IOError getIo() { + return this.io; + } + + public deleteAll_result setIo(IOError io) { + this.io = io; + return this; + } + + public void unsetIo() { + this.io = null; + } + + /** Returns true if field io is set (has been assigned a value) and false otherwise */ + public boolean isSetIo() { + return this.io != null; + } + + public void setIoIsSet(boolean value) { + if (!value) { + this.io = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case IO: + if (value == null) { + unsetIo(); + } else { + setIo((IOError)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case IO: + return getIo(); + + } + 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 IO: + return isSetIo(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof deleteAll_result) + return this.equals((deleteAll_result)that); + return false; + } + + public boolean equals(deleteAll_result that) { + if (that == null) + return false; + + boolean this_present_io = true && this.isSetIo(); + boolean that_present_io = true && that.isSetIo(); + if (this_present_io || that_present_io) { + if (!(this_present_io && that_present_io)) + return false; + if (!this.io.equals(that.io)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_io = true && (isSetIo()); + list.add(present_io); + if (present_io) + list.add(io); + + return list.hashCode(); + } + + @Override + public int compareTo(deleteAll_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetIo()).compareTo(other.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, other.io); + 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("deleteAll_result("); + boolean first = true; + + sb.append("io:"); + if (this.io == null) { + sb.append("null"); + } else { + sb.append(this.io); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 deleteAll_resultStandardSchemeFactory implements SchemeFactory { + public deleteAll_resultStandardScheme getScheme() { + return new deleteAll_resultStandardScheme(); + } + } + + private static class deleteAll_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, deleteAll_result 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: // IO + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(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, deleteAll_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.io != null) { + oprot.writeFieldBegin(IO_FIELD_DESC); + struct.io.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class deleteAll_resultTupleSchemeFactory implements SchemeFactory { + public deleteAll_resultTupleScheme getScheme() { + return new deleteAll_resultTupleScheme(); + } + } + + private static class deleteAll_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, deleteAll_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetIo()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetIo()) { + struct.io.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, deleteAll_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } + } + } + + } + + public static class deleteAllTs_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteAllTs_args"); + + private static final org.apache.thrift.protocol.TField TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tableName", org.apache.thrift.protocol.TType.STRING, (short)1); + 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)2); + private static final org.apache.thrift.protocol.TField COLUMN_FIELD_DESC = new org.apache.thrift.protocol.TField("column", 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 ATTRIBUTES_FIELD_DESC = new org.apache.thrift.protocol.TField("attributes", org.apache.thrift.protocol.TType.MAP, (short)5); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new deleteAllTs_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new deleteAllTs_argsTupleSchemeFactory()); + } + + /** + * name of table + */ + public ByteBuffer tableName; // required + /** + * Row to update + */ + public ByteBuffer row; // required + /** + * name of column whose value is to be deleted + */ + public ByteBuffer column; // required + /** + * timestamp + */ + public long timestamp; // required + /** + * Delete attributes + */ + public Map attributes; // 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 { + /** + * name of table + */ + TABLE_NAME((short)1, "tableName"), + /** + * Row to update + */ + ROW((short)2, "row"), + /** + * name of column whose value is to be deleted + */ + COLUMN((short)3, "column"), + /** + * timestamp + */ + TIMESTAMP((short)4, "timestamp"), + /** + * Delete attributes + */ + ATTRIBUTES((short)5, "attributes"); + + private static final Map byName = new HashMap(); + + 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: // ROW + return ROW; + case 3: // COLUMN + return COLUMN; + case 4: // TIMESTAMP + return TIMESTAMP; + case 5: // ATTRIBUTES + return ATTRIBUTES; + 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 int __TIMESTAMP_ISSET_ID = 0; + private byte __isset_bitfield = 0; + 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.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.ROW, new org.apache.thrift.meta_data.FieldMetaData("row", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.COLUMN, new org.apache.thrift.meta_data.FieldMetaData("column", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("timestamp", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.ATTRIBUTES, new org.apache.thrift.meta_data.FieldMetaData("attributes", org.apache.thrift.TFieldRequirementType.DEFAULT, + 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 , "Text"), + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text")))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteAllTs_args.class, metaDataMap); + } + + public deleteAllTs_args() { + } + + public deleteAllTs_args( + ByteBuffer tableName, + ByteBuffer row, + ByteBuffer column, + long timestamp, + Map attributes) + { + this(); + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(tableName); + this.row = org.apache.thrift.TBaseHelper.copyBinary(row); + this.column = org.apache.thrift.TBaseHelper.copyBinary(column); + this.timestamp = timestamp; + setTimestampIsSet(true); + this.attributes = attributes; + } + + /** + * Performs a deep copy on other. + */ + public deleteAllTs_args(deleteAllTs_args other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetTableName()) { + this.tableName = other.tableName; + } + if (other.isSetRow()) { + this.row = other.row; + } + if (other.isSetColumn()) { + this.column = other.column; + } + this.timestamp = other.timestamp; + if (other.isSetAttributes()) { + Map __this__attributes = new HashMap(other.attributes.size()); + for (Map.Entry other_element : other.attributes.entrySet()) { + + ByteBuffer other_element_key = other_element.getKey(); + ByteBuffer other_element_value = other_element.getValue(); + + ByteBuffer __this__attributes_copy_key = other_element_key; + + ByteBuffer __this__attributes_copy_value = other_element_value; + + __this__attributes.put(__this__attributes_copy_key, __this__attributes_copy_value); + } + this.attributes = __this__attributes; + } + } + + public deleteAllTs_args deepCopy() { + return new deleteAllTs_args(this); + } + + @Override + public void clear() { + this.tableName = null; + this.row = null; + this.column = null; + setTimestampIsSet(false); + this.timestamp = 0; + this.attributes = null; + } + + /** + * name of table + */ + public byte[] getTableName() { + setTableName(org.apache.thrift.TBaseHelper.rightSize(tableName)); + return tableName == null ? null : tableName.array(); + } + + public ByteBuffer bufferForTableName() { + return org.apache.thrift.TBaseHelper.copyBinary(tableName); + } + + /** + * name of table + */ + public deleteAllTs_args setTableName(byte[] tableName) { + this.tableName = tableName == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(tableName, tableName.length)); + return this; + } + + public deleteAllTs_args setTableName(ByteBuffer tableName) { + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(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; + } + } + + /** + * Row to update + */ + public byte[] getRow() { + setRow(org.apache.thrift.TBaseHelper.rightSize(row)); + return row == null ? null : row.array(); + } + + public ByteBuffer bufferForRow() { + return org.apache.thrift.TBaseHelper.copyBinary(row); + } + + /** + * Row to update + */ + public deleteAllTs_args setRow(byte[] row) { + this.row = row == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(row, row.length)); + return this; + } + + public deleteAllTs_args setRow(ByteBuffer row) { + this.row = org.apache.thrift.TBaseHelper.copyBinary(row); + return this; + } + + public void unsetRow() { + this.row = null; + } + + /** Returns true if field row is set (has been assigned a value) and false otherwise */ + public boolean isSetRow() { + return this.row != null; + } + + public void setRowIsSet(boolean value) { + if (!value) { + this.row = null; + } + } + + /** + * name of column whose value is to be deleted + */ + public byte[] getColumn() { + setColumn(org.apache.thrift.TBaseHelper.rightSize(column)); + return column == null ? null : column.array(); + } + + public ByteBuffer bufferForColumn() { + return org.apache.thrift.TBaseHelper.copyBinary(column); + } + + /** + * name of column whose value is to be deleted + */ + public deleteAllTs_args setColumn(byte[] column) { + this.column = column == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(column, column.length)); + return this; + } + + public deleteAllTs_args setColumn(ByteBuffer column) { + this.column = org.apache.thrift.TBaseHelper.copyBinary(column); + return this; + } + + public void unsetColumn() { + this.column = null; + } + + /** Returns true if field column is set (has been assigned a value) and false otherwise */ + public boolean isSetColumn() { + return this.column != null; + } + + public void setColumnIsSet(boolean value) { + if (!value) { + this.column = null; + } + } + + /** + * timestamp + */ + public long getTimestamp() { + return this.timestamp; + } + + /** + * timestamp + */ + public deleteAllTs_args setTimestamp(long timestamp) { + this.timestamp = timestamp; + setTimestampIsSet(true); + return this; + } + + public void unsetTimestamp() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); + } + + /** Returns true if field timestamp is set (has been assigned a value) and false otherwise */ + public boolean isSetTimestamp() { + return EncodingUtils.testBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); + } + + public void setTimestampIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TIMESTAMP_ISSET_ID, value); + } + + 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(); + } + this.attributes.put(key, val); + } + + /** + * Delete attributes + */ + public Map getAttributes() { + return this.attributes; + } + + /** + * Delete attributes + */ + public deleteAllTs_args setAttributes(Map 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; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case TABLE_NAME: + if (value == null) { + unsetTableName(); + } else { + setTableName((ByteBuffer)value); + } + break; + + case ROW: + if (value == null) { + unsetRow(); + } else { + setRow((ByteBuffer)value); + } + break; + + case COLUMN: + if (value == null) { + unsetColumn(); + } else { + setColumn((ByteBuffer)value); + } + break; + + case TIMESTAMP: + if (value == null) { + unsetTimestamp(); + } else { + setTimestamp((Long)value); + } + break; + + case ATTRIBUTES: + if (value == null) { + unsetAttributes(); + } else { + setAttributes((Map)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case TABLE_NAME: + return getTableName(); + + case ROW: + return getRow(); + + case COLUMN: + return getColumn(); + + case TIMESTAMP: + return getTimestamp(); + + case ATTRIBUTES: + return getAttributes(); + + } + 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 ROW: + return isSetRow(); + case COLUMN: + return isSetColumn(); + case TIMESTAMP: + return isSetTimestamp(); + case ATTRIBUTES: + return isSetAttributes(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof deleteAllTs_args) + return this.equals((deleteAllTs_args)that); + return false; + } + + public boolean equals(deleteAllTs_args 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_row = true && this.isSetRow(); + boolean that_present_row = true && that.isSetRow(); + if (this_present_row || that_present_row) { + if (!(this_present_row && that_present_row)) + return false; + if (!this.row.equals(that.row)) + return false; + } + + boolean this_present_column = true && this.isSetColumn(); + boolean that_present_column = true && that.isSetColumn(); + if (this_present_column || that_present_column) { + if (!(this_present_column && that_present_column)) + return false; + if (!this.column.equals(that.column)) + return false; + } + + boolean this_present_timestamp = true; + boolean that_present_timestamp = true; + if (this_present_timestamp || that_present_timestamp) { + if (!(this_present_timestamp && that_present_timestamp)) + return false; + if (this.timestamp != that.timestamp) + 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; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_tableName = true && (isSetTableName()); + list.add(present_tableName); + if (present_tableName) + list.add(tableName); + + boolean present_row = true && (isSetRow()); + list.add(present_row); + if (present_row) + list.add(row); + + boolean present_column = true && (isSetColumn()); + list.add(present_column); + if (present_column) + list.add(column); + + boolean present_timestamp = true; + list.add(present_timestamp); + if (present_timestamp) + list.add(timestamp); + + boolean present_attributes = true && (isSetAttributes()); + list.add(present_attributes); + if (present_attributes) + list.add(attributes); + + return list.hashCode(); + } + + @Override + public int compareTo(deleteAllTs_args 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(isSetRow()).compareTo(other.isSetRow()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRow()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.row, other.row); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetColumn()).compareTo(other.isSetColumn()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetColumn()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.column, other.column); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(other.isSetTimestamp()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTimestamp()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timestamp, other.timestamp); + 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; + } + } + 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("deleteAllTs_args("); + boolean first = true; + + sb.append("tableName:"); + if (this.tableName == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.tableName, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("row:"); + if (this.row == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.row, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("column:"); + if (this.column == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.column, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("timestamp:"); + sb.append(this.timestamp); + first = false; + if (!first) sb.append(", "); + sb.append("attributes:"); + if (this.attributes == null) { + sb.append("null"); + } else { + sb.append(this.attributes); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 { + // 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); + } + } + + private static class deleteAllTs_argsStandardSchemeFactory implements SchemeFactory { + public deleteAllTs_argsStandardScheme getScheme() { + return new deleteAllTs_argsStandardScheme(); + } + } + + private static class deleteAllTs_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, deleteAllTs_args 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.STRING) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // ROW + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.row = iprot.readBinary(); + struct.setRowIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // COLUMN + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.column = iprot.readBinary(); + struct.setColumnIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // TIMESTAMP + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.timestamp = iprot.readI64(); + struct.setTimestampIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // ATTRIBUTES + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map428 = iprot.readMapBegin(); + struct.attributes = new HashMap(2*_map428.size); + ByteBuffer _key429; + ByteBuffer _val430; + for (int _i431 = 0; _i431 < _map428.size; ++_i431) + { + _key429 = iprot.readBinary(); + _val430 = iprot.readBinary(); + struct.attributes.put(_key429, _val430); + } + iprot.readMapEnd(); + } + struct.setAttributesIsSet(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, deleteAllTs_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.tableName != null) { + oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC); + oprot.writeBinary(struct.tableName); + oprot.writeFieldEnd(); + } + if (struct.row != null) { + oprot.writeFieldBegin(ROW_FIELD_DESC); + oprot.writeBinary(struct.row); + oprot.writeFieldEnd(); + } + if (struct.column != null) { + oprot.writeFieldBegin(COLUMN_FIELD_DESC); + oprot.writeBinary(struct.column); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC); + oprot.writeI64(struct.timestamp); + oprot.writeFieldEnd(); + if (struct.attributes != null) { + 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 _iter432 : struct.attributes.entrySet()) + { + oprot.writeBinary(_iter432.getKey()); + oprot.writeBinary(_iter432.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class deleteAllTs_argsTupleSchemeFactory implements SchemeFactory { + public deleteAllTs_argsTupleScheme getScheme() { + return new deleteAllTs_argsTupleScheme(); + } + } + + private static class deleteAllTs_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, deleteAllTs_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetTableName()) { + optionals.set(0); + } + if (struct.isSetRow()) { + optionals.set(1); + } + if (struct.isSetColumn()) { + optionals.set(2); + } + if (struct.isSetTimestamp()) { + optionals.set(3); + } + if (struct.isSetAttributes()) { + optionals.set(4); + } + oprot.writeBitSet(optionals, 5); + if (struct.isSetTableName()) { + oprot.writeBinary(struct.tableName); + } + if (struct.isSetRow()) { + oprot.writeBinary(struct.row); + } + if (struct.isSetColumn()) { + oprot.writeBinary(struct.column); + } + if (struct.isSetTimestamp()) { + oprot.writeI64(struct.timestamp); + } + if (struct.isSetAttributes()) { + { + oprot.writeI32(struct.attributes.size()); + for (Map.Entry _iter433 : struct.attributes.entrySet()) + { + oprot.writeBinary(_iter433.getKey()); + oprot.writeBinary(_iter433.getValue()); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, deleteAllTs_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(5); + if (incoming.get(0)) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(true); + } + if (incoming.get(1)) { + struct.row = iprot.readBinary(); + struct.setRowIsSet(true); + } + if (incoming.get(2)) { + struct.column = iprot.readBinary(); + struct.setColumnIsSet(true); + } + if (incoming.get(3)) { + struct.timestamp = iprot.readI64(); + struct.setTimestampIsSet(true); + } + if (incoming.get(4)) { + { + org.apache.thrift.protocol.TMap _map434 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.attributes = new HashMap(2*_map434.size); + ByteBuffer _key435; + ByteBuffer _val436; + for (int _i437 = 0; _i437 < _map434.size; ++_i437) + { + _key435 = iprot.readBinary(); + _val436 = iprot.readBinary(); + struct.attributes.put(_key435, _val436); + } + } + struct.setAttributesIsSet(true); + } + } + } + + } + + public static class deleteAllTs_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteAllTs_result"); + + private static final org.apache.thrift.protocol.TField IO_FIELD_DESC = new org.apache.thrift.protocol.TField("io", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new deleteAllTs_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new deleteAllTs_resultTupleSchemeFactory()); + } + + public IOError io; // 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 { + IO((short)1, "io"); + + private static final Map byName = new HashMap(); + + 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: // IO + return IO; + 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.IO, new org.apache.thrift.meta_data.FieldMetaData("io", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteAllTs_result.class, metaDataMap); + } + + public deleteAllTs_result() { + } + + public deleteAllTs_result( + IOError io) + { + this(); + this.io = io; + } + + /** + * Performs a deep copy on other. + */ + public deleteAllTs_result(deleteAllTs_result other) { + if (other.isSetIo()) { + this.io = new IOError(other.io); + } + } + + public deleteAllTs_result deepCopy() { + return new deleteAllTs_result(this); + } + + @Override + public void clear() { + this.io = null; + } + + public IOError getIo() { + return this.io; + } + + public deleteAllTs_result setIo(IOError io) { + this.io = io; + return this; + } + + public void unsetIo() { + this.io = null; + } + + /** Returns true if field io is set (has been assigned a value) and false otherwise */ + public boolean isSetIo() { + return this.io != null; + } + + public void setIoIsSet(boolean value) { + if (!value) { + this.io = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case IO: + if (value == null) { + unsetIo(); + } else { + setIo((IOError)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case IO: + return getIo(); + + } + 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 IO: + return isSetIo(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof deleteAllTs_result) + return this.equals((deleteAllTs_result)that); + return false; + } + + public boolean equals(deleteAllTs_result that) { + if (that == null) + return false; + + boolean this_present_io = true && this.isSetIo(); + boolean that_present_io = true && that.isSetIo(); + if (this_present_io || that_present_io) { + if (!(this_present_io && that_present_io)) + return false; + if (!this.io.equals(that.io)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_io = true && (isSetIo()); + list.add(present_io); + if (present_io) + list.add(io); + + return list.hashCode(); + } + + @Override + public int compareTo(deleteAllTs_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetIo()).compareTo(other.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, other.io); + 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("deleteAllTs_result("); + boolean first = true; + + sb.append("io:"); + if (this.io == null) { + sb.append("null"); + } else { + sb.append(this.io); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 deleteAllTs_resultStandardSchemeFactory implements SchemeFactory { + public deleteAllTs_resultStandardScheme getScheme() { + return new deleteAllTs_resultStandardScheme(); + } + } + + private static class deleteAllTs_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, deleteAllTs_result 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: // IO + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(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, deleteAllTs_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.io != null) { + oprot.writeFieldBegin(IO_FIELD_DESC); + struct.io.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class deleteAllTs_resultTupleSchemeFactory implements SchemeFactory { + public deleteAllTs_resultTupleScheme getScheme() { + return new deleteAllTs_resultTupleScheme(); + } + } + + private static class deleteAllTs_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, deleteAllTs_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetIo()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetIo()) { + struct.io.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, deleteAllTs_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } + } + } + + } + + public static class deleteAllRow_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteAllRow_args"); + + private static final org.apache.thrift.protocol.TField TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tableName", org.apache.thrift.protocol.TType.STRING, (short)1); + 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)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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new deleteAllRow_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new deleteAllRow_argsTupleSchemeFactory()); + } + + /** + * name of table + */ + public ByteBuffer tableName; // required + /** + * key of the row to be completely deleted. + */ + public ByteBuffer row; // required + /** + * Delete attributes + */ + public Map attributes; // 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 { + /** + * name of table + */ + TABLE_NAME((short)1, "tableName"), + /** + * key of the row to be completely deleted. + */ + ROW((short)2, "row"), + /** + * Delete attributes + */ + ATTRIBUTES((short)3, "attributes"); + + private static final Map byName = new HashMap(); + + 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: // ROW + return ROW; + case 3: // ATTRIBUTES + return ATTRIBUTES; + 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.TABLE_NAME, new org.apache.thrift.meta_data.FieldMetaData("tableName", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.ROW, new org.apache.thrift.meta_data.FieldMetaData("row", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.ATTRIBUTES, new org.apache.thrift.meta_data.FieldMetaData("attributes", org.apache.thrift.TFieldRequirementType.DEFAULT, + 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 , "Text"), + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text")))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteAllRow_args.class, metaDataMap); + } + + public deleteAllRow_args() { + } + + public deleteAllRow_args( + ByteBuffer tableName, + ByteBuffer row, + Map attributes) + { + this(); + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(tableName); + this.row = org.apache.thrift.TBaseHelper.copyBinary(row); + this.attributes = attributes; + } + + /** + * Performs a deep copy on other. + */ + public deleteAllRow_args(deleteAllRow_args other) { + if (other.isSetTableName()) { + this.tableName = other.tableName; + } + if (other.isSetRow()) { + this.row = other.row; + } + if (other.isSetAttributes()) { + Map __this__attributes = new HashMap(other.attributes.size()); + for (Map.Entry other_element : other.attributes.entrySet()) { + + ByteBuffer other_element_key = other_element.getKey(); + ByteBuffer other_element_value = other_element.getValue(); + + ByteBuffer __this__attributes_copy_key = other_element_key; + + ByteBuffer __this__attributes_copy_value = other_element_value; + + __this__attributes.put(__this__attributes_copy_key, __this__attributes_copy_value); + } + this.attributes = __this__attributes; + } + } + + public deleteAllRow_args deepCopy() { + return new deleteAllRow_args(this); + } + + @Override + public void clear() { + this.tableName = null; + this.row = null; + this.attributes = null; + } + + /** + * name of table + */ + public byte[] getTableName() { + setTableName(org.apache.thrift.TBaseHelper.rightSize(tableName)); + return tableName == null ? null : tableName.array(); + } + + public ByteBuffer bufferForTableName() { + return org.apache.thrift.TBaseHelper.copyBinary(tableName); + } + + /** + * name of table + */ + public deleteAllRow_args setTableName(byte[] tableName) { + this.tableName = tableName == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(tableName, tableName.length)); + return this; + } + + public deleteAllRow_args setTableName(ByteBuffer tableName) { + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(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; + } + } + + /** + * key of the row to be completely deleted. + */ + public byte[] getRow() { + setRow(org.apache.thrift.TBaseHelper.rightSize(row)); + return row == null ? null : row.array(); + } + + public ByteBuffer bufferForRow() { + return org.apache.thrift.TBaseHelper.copyBinary(row); + } + + /** + * key of the row to be completely deleted. + */ + public deleteAllRow_args setRow(byte[] row) { + this.row = row == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(row, row.length)); + return this; + } + + public deleteAllRow_args setRow(ByteBuffer row) { + this.row = org.apache.thrift.TBaseHelper.copyBinary(row); + return this; + } + + public void unsetRow() { + this.row = null; + } + + /** Returns true if field row is set (has been assigned a value) and false otherwise */ + public boolean isSetRow() { + return this.row != null; + } + + public void setRowIsSet(boolean value) { + if (!value) { + this.row = 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(); + } + this.attributes.put(key, val); + } + + /** + * Delete attributes + */ + public Map getAttributes() { + return this.attributes; + } + + /** + * Delete attributes + */ + public deleteAllRow_args setAttributes(Map 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; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case TABLE_NAME: + if (value == null) { + unsetTableName(); + } else { + setTableName((ByteBuffer)value); + } + break; + + case ROW: + if (value == null) { + unsetRow(); + } else { + setRow((ByteBuffer)value); + } + break; + + case ATTRIBUTES: + if (value == null) { + unsetAttributes(); + } else { + setAttributes((Map)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case TABLE_NAME: + return getTableName(); + + case ROW: + return getRow(); + + case ATTRIBUTES: + return getAttributes(); + + } + 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 ROW: + return isSetRow(); + case ATTRIBUTES: + return isSetAttributes(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof deleteAllRow_args) + return this.equals((deleteAllRow_args)that); + return false; + } + + public boolean equals(deleteAllRow_args 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_row = true && this.isSetRow(); + boolean that_present_row = true && that.isSetRow(); + if (this_present_row || that_present_row) { + if (!(this_present_row && that_present_row)) + return false; + if (!this.row.equals(that.row)) + 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; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_tableName = true && (isSetTableName()); + list.add(present_tableName); + if (present_tableName) + list.add(tableName); + + boolean present_row = true && (isSetRow()); + list.add(present_row); + if (present_row) + list.add(row); + + boolean present_attributes = true && (isSetAttributes()); + list.add(present_attributes); + if (present_attributes) + list.add(attributes); + + return list.hashCode(); + } + + @Override + public int compareTo(deleteAllRow_args 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(isSetRow()).compareTo(other.isSetRow()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRow()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.row, other.row); + 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; + } + } + 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("deleteAllRow_args("); + boolean first = true; + + sb.append("tableName:"); + if (this.tableName == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.tableName, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("row:"); + if (this.row == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.row, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("attributes:"); + if (this.attributes == null) { + sb.append("null"); + } else { + sb.append(this.attributes); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 deleteAllRow_argsStandardSchemeFactory implements SchemeFactory { + public deleteAllRow_argsStandardScheme getScheme() { + return new deleteAllRow_argsStandardScheme(); + } + } + + private static class deleteAllRow_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, deleteAllRow_args 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.STRING) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // ROW + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.row = iprot.readBinary(); + struct.setRowIsSet(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 _map438 = iprot.readMapBegin(); + struct.attributes = new HashMap(2*_map438.size); + ByteBuffer _key439; + ByteBuffer _val440; + for (int _i441 = 0; _i441 < _map438.size; ++_i441) + { + _key439 = iprot.readBinary(); + _val440 = iprot.readBinary(); + struct.attributes.put(_key439, _val440); + } + iprot.readMapEnd(); + } + struct.setAttributesIsSet(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, deleteAllRow_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.tableName != null) { + oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC); + oprot.writeBinary(struct.tableName); + oprot.writeFieldEnd(); + } + if (struct.row != null) { + oprot.writeFieldBegin(ROW_FIELD_DESC); + oprot.writeBinary(struct.row); + oprot.writeFieldEnd(); + } + if (struct.attributes != null) { + 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 _iter442 : struct.attributes.entrySet()) + { + oprot.writeBinary(_iter442.getKey()); + oprot.writeBinary(_iter442.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class deleteAllRow_argsTupleSchemeFactory implements SchemeFactory { + public deleteAllRow_argsTupleScheme getScheme() { + return new deleteAllRow_argsTupleScheme(); + } + } + + private static class deleteAllRow_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, deleteAllRow_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetTableName()) { + optionals.set(0); + } + if (struct.isSetRow()) { + optionals.set(1); + } + if (struct.isSetAttributes()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetTableName()) { + oprot.writeBinary(struct.tableName); + } + if (struct.isSetRow()) { + oprot.writeBinary(struct.row); + } + if (struct.isSetAttributes()) { + { + oprot.writeI32(struct.attributes.size()); + for (Map.Entry _iter443 : struct.attributes.entrySet()) + { + oprot.writeBinary(_iter443.getKey()); + oprot.writeBinary(_iter443.getValue()); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, deleteAllRow_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(true); + } + if (incoming.get(1)) { + struct.row = iprot.readBinary(); + struct.setRowIsSet(true); + } + if (incoming.get(2)) { + { + org.apache.thrift.protocol.TMap _map444 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.attributes = new HashMap(2*_map444.size); + ByteBuffer _key445; + ByteBuffer _val446; + for (int _i447 = 0; _i447 < _map444.size; ++_i447) + { + _key445 = iprot.readBinary(); + _val446 = iprot.readBinary(); + struct.attributes.put(_key445, _val446); + } + } + struct.setAttributesIsSet(true); + } + } + } + + } + + public static class deleteAllRow_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteAllRow_result"); + + private static final org.apache.thrift.protocol.TField IO_FIELD_DESC = new org.apache.thrift.protocol.TField("io", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new deleteAllRow_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new deleteAllRow_resultTupleSchemeFactory()); + } + + public IOError io; // 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 { + IO((short)1, "io"); + + private static final Map byName = new HashMap(); + + 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: // IO + return IO; + 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.IO, new org.apache.thrift.meta_data.FieldMetaData("io", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteAllRow_result.class, metaDataMap); + } + + public deleteAllRow_result() { + } + + public deleteAllRow_result( + IOError io) + { + this(); + this.io = io; + } + + /** + * Performs a deep copy on other. + */ + public deleteAllRow_result(deleteAllRow_result other) { + if (other.isSetIo()) { + this.io = new IOError(other.io); + } + } + + public deleteAllRow_result deepCopy() { + return new deleteAllRow_result(this); + } + + @Override + public void clear() { + this.io = null; + } + + public IOError getIo() { + return this.io; + } + + public deleteAllRow_result setIo(IOError io) { + this.io = io; + return this; + } + + public void unsetIo() { + this.io = null; + } + + /** Returns true if field io is set (has been assigned a value) and false otherwise */ + public boolean isSetIo() { + return this.io != null; + } + + public void setIoIsSet(boolean value) { + if (!value) { + this.io = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case IO: + if (value == null) { + unsetIo(); + } else { + setIo((IOError)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case IO: + return getIo(); + + } + 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 IO: + return isSetIo(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof deleteAllRow_result) + return this.equals((deleteAllRow_result)that); + return false; + } + + public boolean equals(deleteAllRow_result that) { + if (that == null) + return false; + + boolean this_present_io = true && this.isSetIo(); + boolean that_present_io = true && that.isSetIo(); + if (this_present_io || that_present_io) { + if (!(this_present_io && that_present_io)) + return false; + if (!this.io.equals(that.io)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_io = true && (isSetIo()); + list.add(present_io); + if (present_io) + list.add(io); + + return list.hashCode(); + } + + @Override + public int compareTo(deleteAllRow_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetIo()).compareTo(other.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, other.io); + 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("deleteAllRow_result("); + boolean first = true; + + sb.append("io:"); + if (this.io == null) { + sb.append("null"); + } else { + sb.append(this.io); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 deleteAllRow_resultStandardSchemeFactory implements SchemeFactory { + public deleteAllRow_resultStandardScheme getScheme() { + return new deleteAllRow_resultStandardScheme(); + } + } + + private static class deleteAllRow_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, deleteAllRow_result 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: // IO + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(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, deleteAllRow_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.io != null) { + oprot.writeFieldBegin(IO_FIELD_DESC); + struct.io.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class deleteAllRow_resultTupleSchemeFactory implements SchemeFactory { + public deleteAllRow_resultTupleScheme getScheme() { + return new deleteAllRow_resultTupleScheme(); + } + } + + private static class deleteAllRow_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, deleteAllRow_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetIo()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetIo()) { + struct.io.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, deleteAllRow_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } + } + } + + } + + public static class increment_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("increment_args"); + + private static final org.apache.thrift.protocol.TField INCREMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("increment", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new increment_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new increment_argsTupleSchemeFactory()); + } + + /** + * The single increment to apply + */ + public TIncrement increment; // 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 { + /** + * The single increment to apply + */ + INCREMENT((short)1, "increment"); + + private static final Map byName = new HashMap(); + + 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: // INCREMENT + return INCREMENT; + 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.INCREMENT, new org.apache.thrift.meta_data.FieldMetaData("increment", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TIncrement.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(increment_args.class, metaDataMap); + } + + public increment_args() { + } + + public increment_args( + TIncrement increment) + { + this(); + this.increment = increment; + } + + /** + * Performs a deep copy on other. + */ + public increment_args(increment_args other) { + if (other.isSetIncrement()) { + this.increment = new TIncrement(other.increment); + } + } + + public increment_args deepCopy() { + return new increment_args(this); + } + + @Override + public void clear() { + this.increment = null; + } + + /** + * The single increment to apply + */ + public TIncrement getIncrement() { + return this.increment; + } + + /** + * The single increment to apply + */ + public increment_args setIncrement(TIncrement increment) { + this.increment = increment; + return this; + } + + public void unsetIncrement() { + this.increment = null; + } + + /** Returns true if field increment is set (has been assigned a value) and false otherwise */ + public boolean isSetIncrement() { + return this.increment != null; + } + + public void setIncrementIsSet(boolean value) { + if (!value) { + this.increment = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case INCREMENT: + if (value == null) { + unsetIncrement(); + } else { + setIncrement((TIncrement)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case INCREMENT: + return getIncrement(); + + } + 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 INCREMENT: + return isSetIncrement(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof increment_args) + return this.equals((increment_args)that); + return false; + } + + public boolean equals(increment_args that) { + if (that == null) + return false; + + boolean this_present_increment = true && this.isSetIncrement(); + boolean that_present_increment = true && that.isSetIncrement(); + if (this_present_increment || that_present_increment) { + if (!(this_present_increment && that_present_increment)) + return false; + if (!this.increment.equals(that.increment)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_increment = true && (isSetIncrement()); + list.add(present_increment); + if (present_increment) + list.add(increment); + + return list.hashCode(); + } + + @Override + public int compareTo(increment_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetIncrement()).compareTo(other.isSetIncrement()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIncrement()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.increment, other.increment); + 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("increment_args("); + boolean first = true; + + sb.append("increment:"); + if (this.increment == null) { + sb.append("null"); + } else { + sb.append(this.increment); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + if (increment != null) { + increment.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 increment_argsStandardSchemeFactory implements SchemeFactory { + public increment_argsStandardScheme getScheme() { + return new increment_argsStandardScheme(); + } + } + + private static class increment_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, increment_args 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: // INCREMENT + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.increment = new TIncrement(); + struct.increment.read(iprot); + struct.setIncrementIsSet(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, increment_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.increment != null) { + oprot.writeFieldBegin(INCREMENT_FIELD_DESC); + struct.increment.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class increment_argsTupleSchemeFactory implements SchemeFactory { + public increment_argsTupleScheme getScheme() { + return new increment_argsTupleScheme(); + } + } + + private static class increment_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, increment_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetIncrement()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetIncrement()) { + struct.increment.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, increment_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.increment = new TIncrement(); + struct.increment.read(iprot); + struct.setIncrementIsSet(true); + } + } + } + + } + + public static class increment_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("increment_result"); + + private static final org.apache.thrift.protocol.TField IO_FIELD_DESC = new org.apache.thrift.protocol.TField("io", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new increment_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new increment_resultTupleSchemeFactory()); + } + + public IOError io; // 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 { + IO((short)1, "io"); + + private static final Map byName = new HashMap(); + + 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: // IO + return IO; + 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.IO, new org.apache.thrift.meta_data.FieldMetaData("io", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(increment_result.class, metaDataMap); + } + + public increment_result() { + } + + public increment_result( + IOError io) + { + this(); + this.io = io; + } + + /** + * Performs a deep copy on other. + */ + public increment_result(increment_result other) { + if (other.isSetIo()) { + this.io = new IOError(other.io); + } + } + + public increment_result deepCopy() { + return new increment_result(this); + } + + @Override + public void clear() { + this.io = null; + } + + public IOError getIo() { + return this.io; + } + + public increment_result setIo(IOError io) { + this.io = io; + return this; + } + + public void unsetIo() { + this.io = null; + } + + /** Returns true if field io is set (has been assigned a value) and false otherwise */ + public boolean isSetIo() { + return this.io != null; + } + + public void setIoIsSet(boolean value) { + if (!value) { + this.io = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case IO: + if (value == null) { + unsetIo(); + } else { + setIo((IOError)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case IO: + return getIo(); + + } + 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 IO: + return isSetIo(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof increment_result) + return this.equals((increment_result)that); + return false; + } + + public boolean equals(increment_result that) { + if (that == null) + return false; + + boolean this_present_io = true && this.isSetIo(); + boolean that_present_io = true && that.isSetIo(); + if (this_present_io || that_present_io) { + if (!(this_present_io && that_present_io)) + return false; + if (!this.io.equals(that.io)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_io = true && (isSetIo()); + list.add(present_io); + if (present_io) + list.add(io); + + return list.hashCode(); + } + + @Override + public int compareTo(increment_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetIo()).compareTo(other.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, other.io); + 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("increment_result("); + boolean first = true; + + sb.append("io:"); + if (this.io == null) { + sb.append("null"); + } else { + sb.append(this.io); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 increment_resultStandardSchemeFactory implements SchemeFactory { + public increment_resultStandardScheme getScheme() { + return new increment_resultStandardScheme(); + } + } + + private static class increment_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, increment_result 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: // IO + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(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, increment_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.io != null) { + oprot.writeFieldBegin(IO_FIELD_DESC); + struct.io.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class increment_resultTupleSchemeFactory implements SchemeFactory { + public increment_resultTupleScheme getScheme() { + return new increment_resultTupleScheme(); + } + } + + private static class increment_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, increment_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetIo()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetIo()) { + struct.io.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, increment_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } + } + } + + } + + public static class incrementRows_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("incrementRows_args"); + + private static final org.apache.thrift.protocol.TField INCREMENTS_FIELD_DESC = new org.apache.thrift.protocol.TField("increments", org.apache.thrift.protocol.TType.LIST, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new incrementRows_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new incrementRows_argsTupleSchemeFactory()); + } + + /** + * The list of increments + */ + public List increments; // 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 { + /** + * The list of increments + */ + INCREMENTS((short)1, "increments"); + + private static final Map byName = new HashMap(); + + 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: // INCREMENTS + return INCREMENTS; + 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.INCREMENTS, new org.apache.thrift.meta_data.FieldMetaData("increments", org.apache.thrift.TFieldRequirementType.DEFAULT, + 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, TIncrement.class)))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(incrementRows_args.class, metaDataMap); + } + + public incrementRows_args() { + } + + public incrementRows_args( + List increments) + { + this(); + this.increments = increments; + } + + /** + * Performs a deep copy on other. + */ + public incrementRows_args(incrementRows_args other) { + if (other.isSetIncrements()) { + List __this__increments = new ArrayList(other.increments.size()); + for (TIncrement other_element : other.increments) { + __this__increments.add(new TIncrement(other_element)); + } + this.increments = __this__increments; + } + } + + public incrementRows_args deepCopy() { + return new incrementRows_args(this); + } + + @Override + public void clear() { + this.increments = null; + } + + public int getIncrementsSize() { + return (this.increments == null) ? 0 : this.increments.size(); + } + + public java.util.Iterator getIncrementsIterator() { + return (this.increments == null) ? null : this.increments.iterator(); + } + + public void addToIncrements(TIncrement elem) { + if (this.increments == null) { + this.increments = new ArrayList(); + } + this.increments.add(elem); + } + + /** + * The list of increments + */ + public List getIncrements() { + return this.increments; + } + + /** + * The list of increments + */ + public incrementRows_args setIncrements(List increments) { + this.increments = increments; + return this; + } + + public void unsetIncrements() { + this.increments = null; + } + + /** Returns true if field increments is set (has been assigned a value) and false otherwise */ + public boolean isSetIncrements() { + return this.increments != null; + } + + public void setIncrementsIsSet(boolean value) { + if (!value) { + this.increments = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case INCREMENTS: + if (value == null) { + unsetIncrements(); + } else { + setIncrements((List)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case INCREMENTS: + return getIncrements(); + + } + 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 INCREMENTS: + return isSetIncrements(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof incrementRows_args) + return this.equals((incrementRows_args)that); + return false; + } + + public boolean equals(incrementRows_args that) { + if (that == null) + return false; + + boolean this_present_increments = true && this.isSetIncrements(); + boolean that_present_increments = true && that.isSetIncrements(); + if (this_present_increments || that_present_increments) { + if (!(this_present_increments && that_present_increments)) + return false; + if (!this.increments.equals(that.increments)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_increments = true && (isSetIncrements()); + list.add(present_increments); + if (present_increments) + list.add(increments); + + return list.hashCode(); + } + + @Override + public int compareTo(incrementRows_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetIncrements()).compareTo(other.isSetIncrements()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIncrements()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.increments, other.increments); + 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("incrementRows_args("); + boolean first = true; + + sb.append("increments:"); + if (this.increments == null) { + sb.append("null"); + } else { + sb.append(this.increments); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 incrementRows_argsStandardSchemeFactory implements SchemeFactory { + public incrementRows_argsStandardScheme getScheme() { + return new incrementRows_argsStandardScheme(); + } + } + + private static class incrementRows_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, incrementRows_args 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: // INCREMENTS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list448 = iprot.readListBegin(); + struct.increments = new ArrayList(_list448.size); + TIncrement _elem449; + for (int _i450 = 0; _i450 < _list448.size; ++_i450) + { + _elem449 = new TIncrement(); + _elem449.read(iprot); + struct.increments.add(_elem449); + } + iprot.readListEnd(); + } + struct.setIncrementsIsSet(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, incrementRows_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.increments != null) { + oprot.writeFieldBegin(INCREMENTS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.increments.size())); + for (TIncrement _iter451 : struct.increments) + { + _iter451.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class incrementRows_argsTupleSchemeFactory implements SchemeFactory { + public incrementRows_argsTupleScheme getScheme() { + return new incrementRows_argsTupleScheme(); + } + } + + private static class incrementRows_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, incrementRows_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetIncrements()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetIncrements()) { + { + oprot.writeI32(struct.increments.size()); + for (TIncrement _iter452 : struct.increments) + { + _iter452.write(oprot); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, incrementRows_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list453 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.increments = new ArrayList(_list453.size); + TIncrement _elem454; + for (int _i455 = 0; _i455 < _list453.size; ++_i455) + { + _elem454 = new TIncrement(); + _elem454.read(iprot); + struct.increments.add(_elem454); + } + } + struct.setIncrementsIsSet(true); + } + } + } + + } + + public static class incrementRows_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("incrementRows_result"); + + private static final org.apache.thrift.protocol.TField IO_FIELD_DESC = new org.apache.thrift.protocol.TField("io", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new incrementRows_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new incrementRows_resultTupleSchemeFactory()); + } + + public IOError io; // 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 { + IO((short)1, "io"); + + private static final Map byName = new HashMap(); + + 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: // IO + return IO; + 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.IO, new org.apache.thrift.meta_data.FieldMetaData("io", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(incrementRows_result.class, metaDataMap); + } + + public incrementRows_result() { + } + + public incrementRows_result( + IOError io) + { + this(); + this.io = io; + } + + /** + * Performs a deep copy on other. + */ + public incrementRows_result(incrementRows_result other) { + if (other.isSetIo()) { + this.io = new IOError(other.io); + } + } + + public incrementRows_result deepCopy() { + return new incrementRows_result(this); + } + + @Override + public void clear() { + this.io = null; + } + + public IOError getIo() { + return this.io; + } + + public incrementRows_result setIo(IOError io) { + this.io = io; + return this; + } + + public void unsetIo() { + this.io = null; + } + + /** Returns true if field io is set (has been assigned a value) and false otherwise */ + public boolean isSetIo() { + return this.io != null; + } + + public void setIoIsSet(boolean value) { + if (!value) { + this.io = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case IO: + if (value == null) { + unsetIo(); + } else { + setIo((IOError)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case IO: + return getIo(); + + } + 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 IO: + return isSetIo(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof incrementRows_result) + return this.equals((incrementRows_result)that); + return false; + } + + public boolean equals(incrementRows_result that) { + if (that == null) + return false; + + boolean this_present_io = true && this.isSetIo(); + boolean that_present_io = true && that.isSetIo(); + if (this_present_io || that_present_io) { + if (!(this_present_io && that_present_io)) + return false; + if (!this.io.equals(that.io)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_io = true && (isSetIo()); + list.add(present_io); + if (present_io) + list.add(io); + + return list.hashCode(); + } + + @Override + public int compareTo(incrementRows_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetIo()).compareTo(other.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, other.io); + 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("incrementRows_result("); + boolean first = true; + + sb.append("io:"); + if (this.io == null) { + sb.append("null"); + } else { + sb.append(this.io); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 incrementRows_resultStandardSchemeFactory implements SchemeFactory { + public incrementRows_resultStandardScheme getScheme() { + return new incrementRows_resultStandardScheme(); + } + } + + private static class incrementRows_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, incrementRows_result 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: // IO + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(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, incrementRows_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.io != null) { + oprot.writeFieldBegin(IO_FIELD_DESC); + struct.io.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class incrementRows_resultTupleSchemeFactory implements SchemeFactory { + public incrementRows_resultTupleScheme getScheme() { + return new incrementRows_resultTupleScheme(); + } + } + + private static class incrementRows_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, incrementRows_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetIo()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetIo()) { + struct.io.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, incrementRows_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } + } + } + + } + + public static class deleteAllRowTs_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteAllRowTs_args"); + + private static final org.apache.thrift.protocol.TField TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tableName", org.apache.thrift.protocol.TType.STRING, (short)1); + 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)2); + 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)3); + 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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new deleteAllRowTs_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new deleteAllRowTs_argsTupleSchemeFactory()); + } + + /** + * name of table + */ + public ByteBuffer tableName; // required + /** + * key of the row to be completely deleted. + */ + public ByteBuffer row; // required + /** + * timestamp + */ + public long timestamp; // required + /** + * Delete attributes + */ + public Map attributes; // 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 { + /** + * name of table + */ + TABLE_NAME((short)1, "tableName"), + /** + * key of the row to be completely deleted. + */ + ROW((short)2, "row"), + /** + * timestamp + */ + TIMESTAMP((short)3, "timestamp"), + /** + * Delete attributes + */ + ATTRIBUTES((short)4, "attributes"); + + private static final Map byName = new HashMap(); + + 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: // ROW + return ROW; + case 3: // TIMESTAMP + return TIMESTAMP; + case 4: // ATTRIBUTES + return ATTRIBUTES; + 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 int __TIMESTAMP_ISSET_ID = 0; + private byte __isset_bitfield = 0; + 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.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.ROW, new org.apache.thrift.meta_data.FieldMetaData("row", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("timestamp", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.ATTRIBUTES, new org.apache.thrift.meta_data.FieldMetaData("attributes", org.apache.thrift.TFieldRequirementType.DEFAULT, + 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 , "Text"), + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text")))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteAllRowTs_args.class, metaDataMap); + } + + public deleteAllRowTs_args() { + } + + public deleteAllRowTs_args( + ByteBuffer tableName, + ByteBuffer row, + long timestamp, + Map attributes) + { + this(); + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(tableName); + this.row = org.apache.thrift.TBaseHelper.copyBinary(row); + this.timestamp = timestamp; + setTimestampIsSet(true); + this.attributes = attributes; + } + + /** + * Performs a deep copy on other. + */ + public deleteAllRowTs_args(deleteAllRowTs_args other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetTableName()) { + this.tableName = other.tableName; + } + if (other.isSetRow()) { + this.row = other.row; + } + this.timestamp = other.timestamp; + if (other.isSetAttributes()) { + Map __this__attributes = new HashMap(other.attributes.size()); + for (Map.Entry other_element : other.attributes.entrySet()) { + + ByteBuffer other_element_key = other_element.getKey(); + ByteBuffer other_element_value = other_element.getValue(); + + ByteBuffer __this__attributes_copy_key = other_element_key; + + ByteBuffer __this__attributes_copy_value = other_element_value; + + __this__attributes.put(__this__attributes_copy_key, __this__attributes_copy_value); + } + this.attributes = __this__attributes; + } + } + + public deleteAllRowTs_args deepCopy() { + return new deleteAllRowTs_args(this); + } + + @Override + public void clear() { + this.tableName = null; + this.row = null; + setTimestampIsSet(false); + this.timestamp = 0; + this.attributes = null; + } + + /** + * name of table + */ + public byte[] getTableName() { + setTableName(org.apache.thrift.TBaseHelper.rightSize(tableName)); + return tableName == null ? null : tableName.array(); + } + + public ByteBuffer bufferForTableName() { + return org.apache.thrift.TBaseHelper.copyBinary(tableName); + } + + /** + * name of table + */ + public deleteAllRowTs_args setTableName(byte[] tableName) { + this.tableName = tableName == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(tableName, tableName.length)); + return this; + } + + public deleteAllRowTs_args setTableName(ByteBuffer tableName) { + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(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; + } + } + + /** + * key of the row to be completely deleted. + */ + public byte[] getRow() { + setRow(org.apache.thrift.TBaseHelper.rightSize(row)); + return row == null ? null : row.array(); + } + + public ByteBuffer bufferForRow() { + return org.apache.thrift.TBaseHelper.copyBinary(row); + } + + /** + * key of the row to be completely deleted. + */ + public deleteAllRowTs_args setRow(byte[] row) { + this.row = row == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(row, row.length)); + return this; + } + + public deleteAllRowTs_args setRow(ByteBuffer row) { + this.row = org.apache.thrift.TBaseHelper.copyBinary(row); + return this; + } + + public void unsetRow() { + this.row = null; + } + + /** Returns true if field row is set (has been assigned a value) and false otherwise */ + public boolean isSetRow() { + return this.row != null; + } + + public void setRowIsSet(boolean value) { + if (!value) { + this.row = null; + } + } + + /** + * timestamp + */ + public long getTimestamp() { + return this.timestamp; + } + + /** + * timestamp + */ + public deleteAllRowTs_args setTimestamp(long timestamp) { + this.timestamp = timestamp; + setTimestampIsSet(true); + return this; + } + + public void unsetTimestamp() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); + } + + /** Returns true if field timestamp is set (has been assigned a value) and false otherwise */ + public boolean isSetTimestamp() { + return EncodingUtils.testBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); + } + + public void setTimestampIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TIMESTAMP_ISSET_ID, value); + } + + 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(); + } + this.attributes.put(key, val); + } + + /** + * Delete attributes + */ + public Map getAttributes() { + return this.attributes; + } + + /** + * Delete attributes + */ + public deleteAllRowTs_args setAttributes(Map 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; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case TABLE_NAME: + if (value == null) { + unsetTableName(); + } else { + setTableName((ByteBuffer)value); + } + break; + + case ROW: + if (value == null) { + unsetRow(); + } else { + setRow((ByteBuffer)value); + } + break; + + case TIMESTAMP: + if (value == null) { + unsetTimestamp(); + } else { + setTimestamp((Long)value); + } + break; + + case ATTRIBUTES: + if (value == null) { + unsetAttributes(); + } else { + setAttributes((Map)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case TABLE_NAME: + return getTableName(); + + case ROW: + return getRow(); + + case TIMESTAMP: + return getTimestamp(); + + case ATTRIBUTES: + return getAttributes(); + + } + 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 ROW: + return isSetRow(); + case TIMESTAMP: + return isSetTimestamp(); + case ATTRIBUTES: + return isSetAttributes(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof deleteAllRowTs_args) + return this.equals((deleteAllRowTs_args)that); + return false; + } + + public boolean equals(deleteAllRowTs_args 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_row = true && this.isSetRow(); + boolean that_present_row = true && that.isSetRow(); + if (this_present_row || that_present_row) { + if (!(this_present_row && that_present_row)) + return false; + if (!this.row.equals(that.row)) + return false; + } + + boolean this_present_timestamp = true; + boolean that_present_timestamp = true; + if (this_present_timestamp || that_present_timestamp) { + if (!(this_present_timestamp && that_present_timestamp)) + return false; + if (this.timestamp != that.timestamp) + 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; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_tableName = true && (isSetTableName()); + list.add(present_tableName); + if (present_tableName) + list.add(tableName); + + boolean present_row = true && (isSetRow()); + list.add(present_row); + if (present_row) + list.add(row); + + boolean present_timestamp = true; + list.add(present_timestamp); + if (present_timestamp) + list.add(timestamp); + + boolean present_attributes = true && (isSetAttributes()); + list.add(present_attributes); + if (present_attributes) + list.add(attributes); + + return list.hashCode(); + } + + @Override + public int compareTo(deleteAllRowTs_args 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(isSetRow()).compareTo(other.isSetRow()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRow()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.row, other.row); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(other.isSetTimestamp()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTimestamp()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timestamp, other.timestamp); + 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; + } + } + 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("deleteAllRowTs_args("); + boolean first = true; + + sb.append("tableName:"); + if (this.tableName == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.tableName, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("row:"); + if (this.row == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.row, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("timestamp:"); + sb.append(this.timestamp); + first = false; + if (!first) sb.append(", "); + sb.append("attributes:"); + if (this.attributes == null) { + sb.append("null"); + } else { + sb.append(this.attributes); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 { + // 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); + } + } + + private static class deleteAllRowTs_argsStandardSchemeFactory implements SchemeFactory { + public deleteAllRowTs_argsStandardScheme getScheme() { + return new deleteAllRowTs_argsStandardScheme(); + } + } + + private static class deleteAllRowTs_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, deleteAllRowTs_args 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.STRING) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // ROW + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.row = iprot.readBinary(); + struct.setRowIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // TIMESTAMP + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.timestamp = iprot.readI64(); + struct.setTimestampIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // ATTRIBUTES + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map456 = iprot.readMapBegin(); + struct.attributes = new HashMap(2*_map456.size); + ByteBuffer _key457; + ByteBuffer _val458; + for (int _i459 = 0; _i459 < _map456.size; ++_i459) + { + _key457 = iprot.readBinary(); + _val458 = iprot.readBinary(); + struct.attributes.put(_key457, _val458); + } + iprot.readMapEnd(); + } + struct.setAttributesIsSet(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, deleteAllRowTs_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.tableName != null) { + oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC); + oprot.writeBinary(struct.tableName); + oprot.writeFieldEnd(); + } + if (struct.row != null) { + oprot.writeFieldBegin(ROW_FIELD_DESC); + oprot.writeBinary(struct.row); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC); + oprot.writeI64(struct.timestamp); + oprot.writeFieldEnd(); + if (struct.attributes != null) { + 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 _iter460 : struct.attributes.entrySet()) + { + oprot.writeBinary(_iter460.getKey()); + oprot.writeBinary(_iter460.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class deleteAllRowTs_argsTupleSchemeFactory implements SchemeFactory { + public deleteAllRowTs_argsTupleScheme getScheme() { + return new deleteAllRowTs_argsTupleScheme(); + } + } + + private static class deleteAllRowTs_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, deleteAllRowTs_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetTableName()) { + optionals.set(0); + } + if (struct.isSetRow()) { + optionals.set(1); + } + if (struct.isSetTimestamp()) { + optionals.set(2); + } + if (struct.isSetAttributes()) { + optionals.set(3); + } + oprot.writeBitSet(optionals, 4); + if (struct.isSetTableName()) { + oprot.writeBinary(struct.tableName); + } + if (struct.isSetRow()) { + oprot.writeBinary(struct.row); + } + if (struct.isSetTimestamp()) { + oprot.writeI64(struct.timestamp); + } + if (struct.isSetAttributes()) { + { + oprot.writeI32(struct.attributes.size()); + for (Map.Entry _iter461 : struct.attributes.entrySet()) + { + oprot.writeBinary(_iter461.getKey()); + oprot.writeBinary(_iter461.getValue()); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, deleteAllRowTs_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(4); + if (incoming.get(0)) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(true); + } + if (incoming.get(1)) { + struct.row = iprot.readBinary(); + struct.setRowIsSet(true); + } + if (incoming.get(2)) { + struct.timestamp = iprot.readI64(); + struct.setTimestampIsSet(true); + } + if (incoming.get(3)) { + { + org.apache.thrift.protocol.TMap _map462 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.attributes = new HashMap(2*_map462.size); + ByteBuffer _key463; + ByteBuffer _val464; + for (int _i465 = 0; _i465 < _map462.size; ++_i465) + { + _key463 = iprot.readBinary(); + _val464 = iprot.readBinary(); + struct.attributes.put(_key463, _val464); + } + } + struct.setAttributesIsSet(true); + } + } + } + + } + + public static class deleteAllRowTs_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteAllRowTs_result"); + + private static final org.apache.thrift.protocol.TField IO_FIELD_DESC = new org.apache.thrift.protocol.TField("io", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new deleteAllRowTs_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new deleteAllRowTs_resultTupleSchemeFactory()); + } + + public IOError io; // 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 { + IO((short)1, "io"); + + private static final Map byName = new HashMap(); + + 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: // IO + return IO; + 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.IO, new org.apache.thrift.meta_data.FieldMetaData("io", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteAllRowTs_result.class, metaDataMap); + } + + public deleteAllRowTs_result() { + } + + public deleteAllRowTs_result( + IOError io) + { + this(); + this.io = io; + } + + /** + * Performs a deep copy on other. + */ + public deleteAllRowTs_result(deleteAllRowTs_result other) { + if (other.isSetIo()) { + this.io = new IOError(other.io); + } + } + + public deleteAllRowTs_result deepCopy() { + return new deleteAllRowTs_result(this); + } + + @Override + public void clear() { + this.io = null; + } + + public IOError getIo() { + return this.io; + } + + public deleteAllRowTs_result setIo(IOError io) { + this.io = io; + return this; + } + + public void unsetIo() { + this.io = null; + } + + /** Returns true if field io is set (has been assigned a value) and false otherwise */ + public boolean isSetIo() { + return this.io != null; + } + + public void setIoIsSet(boolean value) { + if (!value) { + this.io = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case IO: + if (value == null) { + unsetIo(); + } else { + setIo((IOError)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case IO: + return getIo(); + + } + 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 IO: + return isSetIo(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof deleteAllRowTs_result) + return this.equals((deleteAllRowTs_result)that); + return false; + } + + public boolean equals(deleteAllRowTs_result that) { + if (that == null) + return false; + + boolean this_present_io = true && this.isSetIo(); + boolean that_present_io = true && that.isSetIo(); + if (this_present_io || that_present_io) { + if (!(this_present_io && that_present_io)) + return false; + if (!this.io.equals(that.io)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_io = true && (isSetIo()); + list.add(present_io); + if (present_io) + list.add(io); + + return list.hashCode(); + } + + @Override + public int compareTo(deleteAllRowTs_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetIo()).compareTo(other.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, other.io); + 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("deleteAllRowTs_result("); + boolean first = true; + + sb.append("io:"); + if (this.io == null) { + sb.append("null"); + } else { + sb.append(this.io); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 deleteAllRowTs_resultStandardSchemeFactory implements SchemeFactory { + public deleteAllRowTs_resultStandardScheme getScheme() { + return new deleteAllRowTs_resultStandardScheme(); + } + } + + private static class deleteAllRowTs_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, deleteAllRowTs_result 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: // IO + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(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, deleteAllRowTs_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.io != null) { + oprot.writeFieldBegin(IO_FIELD_DESC); + struct.io.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class deleteAllRowTs_resultTupleSchemeFactory implements SchemeFactory { + public deleteAllRowTs_resultTupleScheme getScheme() { + return new deleteAllRowTs_resultTupleScheme(); + } + } + + private static class deleteAllRowTs_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, deleteAllRowTs_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetIo()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetIo()) { + struct.io.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, deleteAllRowTs_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } + } + } + + } + + public static class scannerOpenWithScan_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("scannerOpenWithScan_args"); + + private static final org.apache.thrift.protocol.TField TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tableName", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField SCAN_FIELD_DESC = new org.apache.thrift.protocol.TField("scan", org.apache.thrift.protocol.TType.STRUCT, (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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new scannerOpenWithScan_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new scannerOpenWithScan_argsTupleSchemeFactory()); + } + + /** + * name of table + */ + public ByteBuffer tableName; // required + /** + * Scan instance + */ + public TScan scan; // required + /** + * Scan attributes + */ + public Map attributes; // 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 { + /** + * name of table + */ + TABLE_NAME((short)1, "tableName"), + /** + * Scan instance + */ + SCAN((short)2, "scan"), + /** + * Scan attributes + */ + ATTRIBUTES((short)3, "attributes"); + + private static final Map byName = new HashMap(); + + 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: // SCAN + return SCAN; + case 3: // ATTRIBUTES + return ATTRIBUTES; + 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.TABLE_NAME, new org.apache.thrift.meta_data.FieldMetaData("tableName", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.SCAN, new org.apache.thrift.meta_data.FieldMetaData("scan", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TScan.class))); + tmpMap.put(_Fields.ATTRIBUTES, new org.apache.thrift.meta_data.FieldMetaData("attributes", org.apache.thrift.TFieldRequirementType.DEFAULT, + 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 , "Text"), + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text")))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(scannerOpenWithScan_args.class, metaDataMap); + } + + public scannerOpenWithScan_args() { + } + + public scannerOpenWithScan_args( + ByteBuffer tableName, + TScan scan, + Map attributes) + { + this(); + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(tableName); + this.scan = scan; + this.attributes = attributes; + } + + /** + * Performs a deep copy on other. + */ + public scannerOpenWithScan_args(scannerOpenWithScan_args other) { + if (other.isSetTableName()) { + this.tableName = other.tableName; + } + if (other.isSetScan()) { + this.scan = new TScan(other.scan); + } + if (other.isSetAttributes()) { + Map __this__attributes = new HashMap(other.attributes.size()); + for (Map.Entry other_element : other.attributes.entrySet()) { + + ByteBuffer other_element_key = other_element.getKey(); + ByteBuffer other_element_value = other_element.getValue(); + + ByteBuffer __this__attributes_copy_key = other_element_key; + + ByteBuffer __this__attributes_copy_value = other_element_value; + + __this__attributes.put(__this__attributes_copy_key, __this__attributes_copy_value); + } + this.attributes = __this__attributes; + } + } + + public scannerOpenWithScan_args deepCopy() { + return new scannerOpenWithScan_args(this); + } + + @Override + public void clear() { + this.tableName = null; + this.scan = null; + this.attributes = null; + } + + /** + * name of table + */ + public byte[] getTableName() { + setTableName(org.apache.thrift.TBaseHelper.rightSize(tableName)); + return tableName == null ? null : tableName.array(); + } + + public ByteBuffer bufferForTableName() { + return org.apache.thrift.TBaseHelper.copyBinary(tableName); + } + + /** + * name of table + */ + public scannerOpenWithScan_args setTableName(byte[] tableName) { + this.tableName = tableName == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(tableName, tableName.length)); + return this; + } + + public scannerOpenWithScan_args setTableName(ByteBuffer tableName) { + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(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; + } + } + + /** + * Scan instance + */ + public TScan getScan() { + return this.scan; + } + + /** + * Scan instance + */ + public scannerOpenWithScan_args setScan(TScan scan) { + this.scan = scan; + return this; + } + + public void unsetScan() { + this.scan = null; + } + + /** Returns true if field scan is set (has been assigned a value) and false otherwise */ + public boolean isSetScan() { + return this.scan != null; + } + + public void setScanIsSet(boolean value) { + if (!value) { + this.scan = 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(); + } + this.attributes.put(key, val); + } + + /** + * Scan attributes + */ + public Map getAttributes() { + return this.attributes; + } + + /** + * Scan attributes + */ + public scannerOpenWithScan_args setAttributes(Map 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; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case TABLE_NAME: + if (value == null) { + unsetTableName(); + } else { + setTableName((ByteBuffer)value); + } + break; + + case SCAN: + if (value == null) { + unsetScan(); + } else { + setScan((TScan)value); + } + break; + + case ATTRIBUTES: + if (value == null) { + unsetAttributes(); + } else { + setAttributes((Map)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case TABLE_NAME: + return getTableName(); + + case SCAN: + return getScan(); + + case ATTRIBUTES: + return getAttributes(); + + } + 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 SCAN: + return isSetScan(); + case ATTRIBUTES: + return isSetAttributes(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof scannerOpenWithScan_args) + return this.equals((scannerOpenWithScan_args)that); + return false; + } + + public boolean equals(scannerOpenWithScan_args 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_scan = true && this.isSetScan(); + boolean that_present_scan = true && that.isSetScan(); + if (this_present_scan || that_present_scan) { + if (!(this_present_scan && that_present_scan)) + return false; + if (!this.scan.equals(that.scan)) + 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; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_tableName = true && (isSetTableName()); + list.add(present_tableName); + if (present_tableName) + list.add(tableName); + + boolean present_scan = true && (isSetScan()); + list.add(present_scan); + if (present_scan) + list.add(scan); + + boolean present_attributes = true && (isSetAttributes()); + list.add(present_attributes); + if (present_attributes) + list.add(attributes); + + return list.hashCode(); + } + + @Override + public int compareTo(scannerOpenWithScan_args 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(isSetScan()).compareTo(other.isSetScan()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetScan()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.scan, other.scan); + 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; + } + } + 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("scannerOpenWithScan_args("); + boolean first = true; + + sb.append("tableName:"); + if (this.tableName == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.tableName, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("scan:"); + if (this.scan == null) { + sb.append("null"); + } else { + sb.append(this.scan); + } + first = false; + if (!first) sb.append(", "); + sb.append("attributes:"); + if (this.attributes == null) { + sb.append("null"); + } else { + sb.append(this.attributes); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + if (scan != null) { + scan.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 scannerOpenWithScan_argsStandardSchemeFactory implements SchemeFactory { + public scannerOpenWithScan_argsStandardScheme getScheme() { + return new scannerOpenWithScan_argsStandardScheme(); + } + } + + private static class scannerOpenWithScan_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, scannerOpenWithScan_args 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.STRING) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // SCAN + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.scan = new TScan(); + struct.scan.read(iprot); + struct.setScanIsSet(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 _map466 = iprot.readMapBegin(); + struct.attributes = new HashMap(2*_map466.size); + ByteBuffer _key467; + ByteBuffer _val468; + for (int _i469 = 0; _i469 < _map466.size; ++_i469) + { + _key467 = iprot.readBinary(); + _val468 = iprot.readBinary(); + struct.attributes.put(_key467, _val468); + } + iprot.readMapEnd(); + } + struct.setAttributesIsSet(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, scannerOpenWithScan_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.tableName != null) { + oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC); + oprot.writeBinary(struct.tableName); + oprot.writeFieldEnd(); + } + if (struct.scan != null) { + oprot.writeFieldBegin(SCAN_FIELD_DESC); + struct.scan.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.attributes != null) { + 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 _iter470 : struct.attributes.entrySet()) + { + oprot.writeBinary(_iter470.getKey()); + oprot.writeBinary(_iter470.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class scannerOpenWithScan_argsTupleSchemeFactory implements SchemeFactory { + public scannerOpenWithScan_argsTupleScheme getScheme() { + return new scannerOpenWithScan_argsTupleScheme(); + } + } + + private static class scannerOpenWithScan_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, scannerOpenWithScan_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetTableName()) { + optionals.set(0); + } + if (struct.isSetScan()) { + optionals.set(1); + } + if (struct.isSetAttributes()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetTableName()) { + oprot.writeBinary(struct.tableName); + } + if (struct.isSetScan()) { + struct.scan.write(oprot); + } + if (struct.isSetAttributes()) { + { + oprot.writeI32(struct.attributes.size()); + for (Map.Entry _iter471 : struct.attributes.entrySet()) + { + oprot.writeBinary(_iter471.getKey()); + oprot.writeBinary(_iter471.getValue()); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, scannerOpenWithScan_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(true); + } + if (incoming.get(1)) { + struct.scan = new TScan(); + struct.scan.read(iprot); + struct.setScanIsSet(true); + } + if (incoming.get(2)) { + { + org.apache.thrift.protocol.TMap _map472 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.attributes = new HashMap(2*_map472.size); + ByteBuffer _key473; + ByteBuffer _val474; + for (int _i475 = 0; _i475 < _map472.size; ++_i475) + { + _key473 = iprot.readBinary(); + _val474 = iprot.readBinary(); + struct.attributes.put(_key473, _val474); + } + } + struct.setAttributesIsSet(true); + } + } + } + + } + + public static class scannerOpenWithScan_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("scannerOpenWithScan_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I32, (short)0); + private static final org.apache.thrift.protocol.TField IO_FIELD_DESC = new org.apache.thrift.protocol.TField("io", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new scannerOpenWithScan_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new scannerOpenWithScan_resultTupleSchemeFactory()); + } + + public int success; // required + public IOError io; // 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 { + SUCCESS((short)0, "success"), + IO((short)1, "io"); + + private static final Map byName = new HashMap(); + + 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 0: // SUCCESS + return SUCCESS; + case 1: // IO + return IO; + 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 int __SUCCESS_ISSET_ID = 0; + private byte __isset_bitfield = 0; + 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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32 , "ScannerID"))); + tmpMap.put(_Fields.IO, new org.apache.thrift.meta_data.FieldMetaData("io", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(scannerOpenWithScan_result.class, metaDataMap); + } + + public scannerOpenWithScan_result() { + } + + public scannerOpenWithScan_result( + int success, + IOError io) + { + this(); + this.success = success; + setSuccessIsSet(true); + this.io = io; + } + + /** + * Performs a deep copy on other. + */ + public scannerOpenWithScan_result(scannerOpenWithScan_result other) { + __isset_bitfield = other.__isset_bitfield; + this.success = other.success; + if (other.isSetIo()) { + this.io = new IOError(other.io); + } + } + + public scannerOpenWithScan_result deepCopy() { + return new scannerOpenWithScan_result(this); + } + + @Override + public void clear() { + setSuccessIsSet(false); + this.success = 0; + this.io = null; + } + + public int getSuccess() { + return this.success; + } + + public scannerOpenWithScan_result setSuccess(int success) { + this.success = success; + setSuccessIsSet(true); + return this; + } + + public void unsetSuccess() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + public void setSuccessIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); + } + + public IOError getIo() { + return this.io; + } + + public scannerOpenWithScan_result setIo(IOError io) { + this.io = io; + return this; + } + + public void unsetIo() { + this.io = null; + } + + /** Returns true if field io is set (has been assigned a value) and false otherwise */ + public boolean isSetIo() { + return this.io != null; + } + + public void setIoIsSet(boolean value) { + if (!value) { + this.io = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((Integer)value); + } + break; + + case IO: + if (value == null) { + unsetIo(); + } else { + setIo((IOError)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + case IO: + return getIo(); + + } + 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 SUCCESS: + return isSetSuccess(); + case IO: + return isSetIo(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof scannerOpenWithScan_result) + return this.equals((scannerOpenWithScan_result)that); + return false; + } + + public boolean equals(scannerOpenWithScan_result that) { + if (that == null) + return false; + + boolean this_present_success = true; + boolean that_present_success = true; + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (this.success != that.success) + return false; + } + + boolean this_present_io = true && this.isSetIo(); + boolean that_present_io = true && that.isSetIo(); + if (this_present_io || that_present_io) { + if (!(this_present_io && that_present_io)) + return false; + if (!this.io.equals(that.io)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true; + list.add(present_success); + if (present_success) + list.add(success); + + boolean present_io = true && (isSetIo()); + list.add(present_io); + if (present_io) + list.add(io); + + return list.hashCode(); + } + + @Override + public int compareTo(scannerOpenWithScan_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIo()).compareTo(other.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, other.io); + 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("scannerOpenWithScan_result("); + boolean first = true; + + sb.append("success:"); + sb.append(this.success); + first = false; + if (!first) sb.append(", "); + sb.append("io:"); + if (this.io == null) { + sb.append("null"); + } else { + sb.append(this.io); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 { + // 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); + } + } + + private static class scannerOpenWithScan_resultStandardSchemeFactory implements SchemeFactory { + public scannerOpenWithScan_resultStandardScheme getScheme() { + return new scannerOpenWithScan_resultStandardScheme(); + } + } + + private static class scannerOpenWithScan_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, scannerOpenWithScan_result 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 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.success = iprot.readI32(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IO + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(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, scannerOpenWithScan_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeI32(struct.success); + oprot.writeFieldEnd(); + } + if (struct.io != null) { + oprot.writeFieldBegin(IO_FIELD_DESC); + struct.io.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class scannerOpenWithScan_resultTupleSchemeFactory implements SchemeFactory { + public scannerOpenWithScan_resultTupleScheme getScheme() { + return new scannerOpenWithScan_resultTupleScheme(); + } + } + + private static class scannerOpenWithScan_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, scannerOpenWithScan_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIo()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + oprot.writeI32(struct.success); + } + if (struct.isSetIo()) { + struct.io.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, scannerOpenWithScan_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.success = iprot.readI32(); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } + } + } + + } + + public static class scannerOpen_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("scannerOpen_args"); + + private static final org.apache.thrift.protocol.TField TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tableName", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField START_ROW_FIELD_DESC = new org.apache.thrift.protocol.TField("startRow", org.apache.thrift.protocol.TType.STRING, (short)2); + 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)3); + 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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new scannerOpen_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new scannerOpen_argsTupleSchemeFactory()); + } + + /** + * name of table + */ + public ByteBuffer tableName; // required + /** + * Starting row in table to scan. + * Send "" (empty string) to start at the first row. + */ + public ByteBuffer startRow; // required + /** + * columns to scan. If column name is a column family, all + * columns of the specified column family are returned. It's also possible + * to pass a regex in the column qualifier. + */ + public List columns; // required + /** + * Scan attributes + */ + public Map attributes; // 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 { + /** + * name of table + */ + TABLE_NAME((short)1, "tableName"), + /** + * Starting row in table to scan. + * Send "" (empty string) to start at the first row. + */ + START_ROW((short)2, "startRow"), + /** + * columns to scan. If column name is a column family, all + * columns of the specified column family are returned. It's also possible + * to pass a regex in the column qualifier. + */ + COLUMNS((short)3, "columns"), + /** + * Scan attributes + */ + ATTRIBUTES((short)4, "attributes"); + + private static final Map byName = new HashMap(); + + 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: // START_ROW + return START_ROW; + case 3: // COLUMNS + return COLUMNS; + case 4: // ATTRIBUTES + return ATTRIBUTES; + 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.TABLE_NAME, new org.apache.thrift.meta_data.FieldMetaData("tableName", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.START_ROW, new org.apache.thrift.meta_data.FieldMetaData("startRow", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.COLUMNS, new org.apache.thrift.meta_data.FieldMetaData("columns", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text")))); + tmpMap.put(_Fields.ATTRIBUTES, new org.apache.thrift.meta_data.FieldMetaData("attributes", org.apache.thrift.TFieldRequirementType.DEFAULT, + 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 , "Text"), + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text")))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(scannerOpen_args.class, metaDataMap); + } + + public scannerOpen_args() { + } + + public scannerOpen_args( + ByteBuffer tableName, + ByteBuffer startRow, + List columns, + Map attributes) + { + this(); + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(tableName); + this.startRow = org.apache.thrift.TBaseHelper.copyBinary(startRow); + this.columns = columns; + this.attributes = attributes; + } + + /** + * Performs a deep copy on other. + */ + public scannerOpen_args(scannerOpen_args other) { + if (other.isSetTableName()) { + this.tableName = other.tableName; + } + if (other.isSetStartRow()) { + this.startRow = other.startRow; + } + if (other.isSetColumns()) { + List __this__columns = new ArrayList(other.columns.size()); + for (ByteBuffer other_element : other.columns) { + __this__columns.add(other_element); + } + this.columns = __this__columns; + } + if (other.isSetAttributes()) { + Map __this__attributes = new HashMap(other.attributes.size()); + for (Map.Entry other_element : other.attributes.entrySet()) { + + ByteBuffer other_element_key = other_element.getKey(); + ByteBuffer other_element_value = other_element.getValue(); + + ByteBuffer __this__attributes_copy_key = other_element_key; + + ByteBuffer __this__attributes_copy_value = other_element_value; + + __this__attributes.put(__this__attributes_copy_key, __this__attributes_copy_value); + } + this.attributes = __this__attributes; + } + } + + public scannerOpen_args deepCopy() { + return new scannerOpen_args(this); + } + + @Override + public void clear() { + this.tableName = null; + this.startRow = null; + this.columns = null; + this.attributes = null; + } + + /** + * name of table + */ + public byte[] getTableName() { + setTableName(org.apache.thrift.TBaseHelper.rightSize(tableName)); + return tableName == null ? null : tableName.array(); + } + + public ByteBuffer bufferForTableName() { + return org.apache.thrift.TBaseHelper.copyBinary(tableName); + } + + /** + * name of table + */ + public scannerOpen_args setTableName(byte[] tableName) { + this.tableName = tableName == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(tableName, tableName.length)); + return this; + } + + public scannerOpen_args setTableName(ByteBuffer tableName) { + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(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; + } + } + + /** + * Starting row in table to scan. + * Send "" (empty string) to start at the first row. + */ + public byte[] getStartRow() { + setStartRow(org.apache.thrift.TBaseHelper.rightSize(startRow)); + return startRow == null ? null : startRow.array(); + } + + public ByteBuffer bufferForStartRow() { + return org.apache.thrift.TBaseHelper.copyBinary(startRow); + } + + /** + * Starting row in table to scan. + * Send "" (empty string) to start at the first row. + */ + public scannerOpen_args setStartRow(byte[] startRow) { + this.startRow = startRow == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(startRow, startRow.length)); + return this; + } + + public scannerOpen_args setStartRow(ByteBuffer startRow) { + this.startRow = org.apache.thrift.TBaseHelper.copyBinary(startRow); + return this; + } + + public void unsetStartRow() { + this.startRow = null; + } + + /** Returns true if field startRow is set (has been assigned a value) and false otherwise */ + public boolean isSetStartRow() { + return this.startRow != null; + } + + public void setStartRowIsSet(boolean value) { + if (!value) { + this.startRow = null; + } + } + + public int getColumnsSize() { + return (this.columns == null) ? 0 : this.columns.size(); + } + + public java.util.Iterator getColumnsIterator() { + return (this.columns == null) ? null : this.columns.iterator(); + } + + public void addToColumns(ByteBuffer elem) { + if (this.columns == null) { + this.columns = new ArrayList(); + } + this.columns.add(elem); + } + + /** + * columns to scan. If column name is a column family, all + * columns of the specified column family are returned. It's also possible + * to pass a regex in the column qualifier. + */ + public List getColumns() { + return this.columns; + } + + /** + * columns to scan. If column name is a column family, all + * columns of the specified column family are returned. It's also possible + * to pass a regex in the column qualifier. + */ + public scannerOpen_args setColumns(List 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(); + } + this.attributes.put(key, val); + } + + /** + * Scan attributes + */ + public Map getAttributes() { + return this.attributes; + } + + /** + * Scan attributes + */ + public scannerOpen_args setAttributes(Map 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; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case TABLE_NAME: + if (value == null) { + unsetTableName(); + } else { + setTableName((ByteBuffer)value); + } + break; + + case START_ROW: + if (value == null) { + unsetStartRow(); + } else { + setStartRow((ByteBuffer)value); + } + break; + + case COLUMNS: + if (value == null) { + unsetColumns(); + } else { + setColumns((List)value); + } + break; + + case ATTRIBUTES: + if (value == null) { + unsetAttributes(); + } else { + setAttributes((Map)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case TABLE_NAME: + return getTableName(); + + case START_ROW: + return getStartRow(); + + case COLUMNS: + return getColumns(); + + case ATTRIBUTES: + return getAttributes(); + + } + 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 START_ROW: + return isSetStartRow(); + case COLUMNS: + return isSetColumns(); + case ATTRIBUTES: + return isSetAttributes(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof scannerOpen_args) + return this.equals((scannerOpen_args)that); + return false; + } + + public boolean equals(scannerOpen_args 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_startRow = true && this.isSetStartRow(); + boolean that_present_startRow = true && that.isSetStartRow(); + if (this_present_startRow || that_present_startRow) { + if (!(this_present_startRow && that_present_startRow)) + return false; + if (!this.startRow.equals(that.startRow)) + 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; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_tableName = true && (isSetTableName()); + list.add(present_tableName); + if (present_tableName) + list.add(tableName); + + boolean present_startRow = true && (isSetStartRow()); + list.add(present_startRow); + if (present_startRow) + list.add(startRow); + + 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); + + return list.hashCode(); + } + + @Override + public int compareTo(scannerOpen_args 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(isSetStartRow()).compareTo(other.isSetStartRow()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStartRow()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startRow, other.startRow); + 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; + } + } + 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("scannerOpen_args("); + boolean first = true; + + sb.append("tableName:"); + if (this.tableName == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.tableName, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("startRow:"); + if (this.startRow == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.startRow, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("columns:"); + if (this.columns == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.columns, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("attributes:"); + if (this.attributes == null) { + sb.append("null"); + } else { + sb.append(this.attributes); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 scannerOpen_argsStandardSchemeFactory implements SchemeFactory { + public scannerOpen_argsStandardScheme getScheme() { + return new scannerOpen_argsStandardScheme(); + } + } + + private static class scannerOpen_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, scannerOpen_args 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.STRING) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // START_ROW + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.startRow = iprot.readBinary(); + struct.setStartRowIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // COLUMNS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list476 = iprot.readListBegin(); + struct.columns = new ArrayList(_list476.size); + ByteBuffer _elem477; + for (int _i478 = 0; _i478 < _list476.size; ++_i478) + { + _elem477 = iprot.readBinary(); + struct.columns.add(_elem477); + } + iprot.readListEnd(); + } + struct.setColumnsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // ATTRIBUTES + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map479 = iprot.readMapBegin(); + struct.attributes = new HashMap(2*_map479.size); + ByteBuffer _key480; + ByteBuffer _val481; + for (int _i482 = 0; _i482 < _map479.size; ++_i482) + { + _key480 = iprot.readBinary(); + _val481 = iprot.readBinary(); + struct.attributes.put(_key480, _val481); + } + iprot.readMapEnd(); + } + struct.setAttributesIsSet(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, scannerOpen_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.tableName != null) { + oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC); + oprot.writeBinary(struct.tableName); + oprot.writeFieldEnd(); + } + if (struct.startRow != null) { + oprot.writeFieldBegin(START_ROW_FIELD_DESC); + oprot.writeBinary(struct.startRow); + oprot.writeFieldEnd(); + } + if (struct.columns != null) { + oprot.writeFieldBegin(COLUMNS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.columns.size())); + for (ByteBuffer _iter483 : struct.columns) + { + oprot.writeBinary(_iter483); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.attributes != null) { + 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 _iter484 : struct.attributes.entrySet()) + { + oprot.writeBinary(_iter484.getKey()); + oprot.writeBinary(_iter484.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class scannerOpen_argsTupleSchemeFactory implements SchemeFactory { + public scannerOpen_argsTupleScheme getScheme() { + return new scannerOpen_argsTupleScheme(); + } + } + + private static class scannerOpen_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, scannerOpen_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetTableName()) { + optionals.set(0); + } + if (struct.isSetStartRow()) { + optionals.set(1); + } + if (struct.isSetColumns()) { + optionals.set(2); + } + if (struct.isSetAttributes()) { + optionals.set(3); + } + oprot.writeBitSet(optionals, 4); + if (struct.isSetTableName()) { + oprot.writeBinary(struct.tableName); + } + if (struct.isSetStartRow()) { + oprot.writeBinary(struct.startRow); + } + if (struct.isSetColumns()) { + { + oprot.writeI32(struct.columns.size()); + for (ByteBuffer _iter485 : struct.columns) + { + oprot.writeBinary(_iter485); + } + } + } + if (struct.isSetAttributes()) { + { + oprot.writeI32(struct.attributes.size()); + for (Map.Entry _iter486 : struct.attributes.entrySet()) + { + oprot.writeBinary(_iter486.getKey()); + oprot.writeBinary(_iter486.getValue()); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, scannerOpen_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(4); + if (incoming.get(0)) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(true); + } + if (incoming.get(1)) { + struct.startRow = iprot.readBinary(); + struct.setStartRowIsSet(true); + } + if (incoming.get(2)) { + { + org.apache.thrift.protocol.TList _list487 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.columns = new ArrayList(_list487.size); + ByteBuffer _elem488; + for (int _i489 = 0; _i489 < _list487.size; ++_i489) + { + _elem488 = iprot.readBinary(); + struct.columns.add(_elem488); + } + } + struct.setColumnsIsSet(true); + } + if (incoming.get(3)) { + { + org.apache.thrift.protocol.TMap _map490 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.attributes = new HashMap(2*_map490.size); + ByteBuffer _key491; + ByteBuffer _val492; + for (int _i493 = 0; _i493 < _map490.size; ++_i493) + { + _key491 = iprot.readBinary(); + _val492 = iprot.readBinary(); + struct.attributes.put(_key491, _val492); + } + } + struct.setAttributesIsSet(true); + } + } + } + + } + + public static class scannerOpen_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("scannerOpen_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I32, (short)0); + private static final org.apache.thrift.protocol.TField IO_FIELD_DESC = new org.apache.thrift.protocol.TField("io", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new scannerOpen_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new scannerOpen_resultTupleSchemeFactory()); + } + + public int success; // required + public IOError io; // 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 { + SUCCESS((short)0, "success"), + IO((short)1, "io"); + + private static final Map byName = new HashMap(); + + 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 0: // SUCCESS + return SUCCESS; + case 1: // IO + return IO; + 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 int __SUCCESS_ISSET_ID = 0; + private byte __isset_bitfield = 0; + 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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32 , "ScannerID"))); + tmpMap.put(_Fields.IO, new org.apache.thrift.meta_data.FieldMetaData("io", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(scannerOpen_result.class, metaDataMap); + } + + public scannerOpen_result() { + } + + public scannerOpen_result( + int success, + IOError io) + { + this(); + this.success = success; + setSuccessIsSet(true); + this.io = io; + } + + /** + * Performs a deep copy on other. + */ + public scannerOpen_result(scannerOpen_result other) { + __isset_bitfield = other.__isset_bitfield; + this.success = other.success; + if (other.isSetIo()) { + this.io = new IOError(other.io); + } + } + + public scannerOpen_result deepCopy() { + return new scannerOpen_result(this); + } + + @Override + public void clear() { + setSuccessIsSet(false); + this.success = 0; + this.io = null; + } + + public int getSuccess() { + return this.success; + } + + public scannerOpen_result setSuccess(int success) { + this.success = success; + setSuccessIsSet(true); + return this; + } + + public void unsetSuccess() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + public void setSuccessIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); + } + + public IOError getIo() { + return this.io; + } + + public scannerOpen_result setIo(IOError io) { + this.io = io; + return this; + } + + public void unsetIo() { + this.io = null; + } + + /** Returns true if field io is set (has been assigned a value) and false otherwise */ + public boolean isSetIo() { + return this.io != null; + } + + public void setIoIsSet(boolean value) { + if (!value) { + this.io = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((Integer)value); + } + break; + + case IO: + if (value == null) { + unsetIo(); + } else { + setIo((IOError)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + case IO: + return getIo(); + + } + 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 SUCCESS: + return isSetSuccess(); + case IO: + return isSetIo(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof scannerOpen_result) + return this.equals((scannerOpen_result)that); + return false; + } + + public boolean equals(scannerOpen_result that) { + if (that == null) + return false; + + boolean this_present_success = true; + boolean that_present_success = true; + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (this.success != that.success) + return false; + } + + boolean this_present_io = true && this.isSetIo(); + boolean that_present_io = true && that.isSetIo(); + if (this_present_io || that_present_io) { + if (!(this_present_io && that_present_io)) + return false; + if (!this.io.equals(that.io)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true; + list.add(present_success); + if (present_success) + list.add(success); + + boolean present_io = true && (isSetIo()); + list.add(present_io); + if (present_io) + list.add(io); + + return list.hashCode(); + } + + @Override + public int compareTo(scannerOpen_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIo()).compareTo(other.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, other.io); + 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("scannerOpen_result("); + boolean first = true; + + sb.append("success:"); + sb.append(this.success); + first = false; + if (!first) sb.append(", "); + sb.append("io:"); + if (this.io == null) { + sb.append("null"); + } else { + sb.append(this.io); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 { + // 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); + } + } + + private static class scannerOpen_resultStandardSchemeFactory implements SchemeFactory { + public scannerOpen_resultStandardScheme getScheme() { + return new scannerOpen_resultStandardScheme(); + } + } + + private static class scannerOpen_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, scannerOpen_result 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 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.success = iprot.readI32(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IO + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(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, scannerOpen_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeI32(struct.success); + oprot.writeFieldEnd(); + } + if (struct.io != null) { + oprot.writeFieldBegin(IO_FIELD_DESC); + struct.io.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class scannerOpen_resultTupleSchemeFactory implements SchemeFactory { + public scannerOpen_resultTupleScheme getScheme() { + return new scannerOpen_resultTupleScheme(); + } + } + + private static class scannerOpen_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, scannerOpen_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIo()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + oprot.writeI32(struct.success); + } + if (struct.isSetIo()) { + struct.io.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, scannerOpen_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.success = iprot.readI32(); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } + } + } + + } + + public static class scannerOpenWithStop_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("scannerOpenWithStop_args"); + + private static final org.apache.thrift.protocol.TField TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tableName", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField START_ROW_FIELD_DESC = new org.apache.thrift.protocol.TField("startRow", org.apache.thrift.protocol.TType.STRING, (short)2); + private static final org.apache.thrift.protocol.TField STOP_ROW_FIELD_DESC = new org.apache.thrift.protocol.TField("stopRow", org.apache.thrift.protocol.TType.STRING, (short)3); + 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)4); + 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)5); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new scannerOpenWithStop_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new scannerOpenWithStop_argsTupleSchemeFactory()); + } + + /** + * name of table + */ + public ByteBuffer tableName; // required + /** + * Starting row in table to scan. + * Send "" (empty string) to start at the first row. + */ + public ByteBuffer startRow; // required + /** + * row to stop scanning on. This row is *not* included in the + * scanner's results + */ + public ByteBuffer stopRow; // required + /** + * columns to scan. If column name is a column family, all + * columns of the specified column family are returned. It's also possible + * to pass a regex in the column qualifier. + */ + public List columns; // required + /** + * Scan attributes + */ + public Map attributes; // 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 { + /** + * name of table + */ + TABLE_NAME((short)1, "tableName"), + /** + * Starting row in table to scan. + * Send "" (empty string) to start at the first row. + */ + START_ROW((short)2, "startRow"), + /** + * row to stop scanning on. This row is *not* included in the + * scanner's results + */ + STOP_ROW((short)3, "stopRow"), + /** + * columns to scan. If column name is a column family, all + * columns of the specified column family are returned. It's also possible + * to pass a regex in the column qualifier. + */ + COLUMNS((short)4, "columns"), + /** + * Scan attributes + */ + ATTRIBUTES((short)5, "attributes"); + + private static final Map byName = new HashMap(); + + 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: // START_ROW + return START_ROW; + case 3: // STOP_ROW + return STOP_ROW; + case 4: // COLUMNS + return COLUMNS; + case 5: // ATTRIBUTES + return ATTRIBUTES; + 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.TABLE_NAME, new org.apache.thrift.meta_data.FieldMetaData("tableName", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.START_ROW, new org.apache.thrift.meta_data.FieldMetaData("startRow", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.STOP_ROW, new org.apache.thrift.meta_data.FieldMetaData("stopRow", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.COLUMNS, new org.apache.thrift.meta_data.FieldMetaData("columns", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text")))); + tmpMap.put(_Fields.ATTRIBUTES, new org.apache.thrift.meta_data.FieldMetaData("attributes", org.apache.thrift.TFieldRequirementType.DEFAULT, + 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 , "Text"), + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text")))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(scannerOpenWithStop_args.class, metaDataMap); + } + + public scannerOpenWithStop_args() { + } + + public scannerOpenWithStop_args( + ByteBuffer tableName, + ByteBuffer startRow, + ByteBuffer stopRow, + List columns, + Map attributes) + { + this(); + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(tableName); + this.startRow = org.apache.thrift.TBaseHelper.copyBinary(startRow); + this.stopRow = org.apache.thrift.TBaseHelper.copyBinary(stopRow); + this.columns = columns; + this.attributes = attributes; + } + + /** + * Performs a deep copy on other. + */ + public scannerOpenWithStop_args(scannerOpenWithStop_args other) { + if (other.isSetTableName()) { + this.tableName = other.tableName; + } + if (other.isSetStartRow()) { + this.startRow = other.startRow; + } + if (other.isSetStopRow()) { + this.stopRow = other.stopRow; + } + if (other.isSetColumns()) { + List __this__columns = new ArrayList(other.columns.size()); + for (ByteBuffer other_element : other.columns) { + __this__columns.add(other_element); + } + this.columns = __this__columns; + } + if (other.isSetAttributes()) { + Map __this__attributes = new HashMap(other.attributes.size()); + for (Map.Entry other_element : other.attributes.entrySet()) { + + ByteBuffer other_element_key = other_element.getKey(); + ByteBuffer other_element_value = other_element.getValue(); + + ByteBuffer __this__attributes_copy_key = other_element_key; + + ByteBuffer __this__attributes_copy_value = other_element_value; + + __this__attributes.put(__this__attributes_copy_key, __this__attributes_copy_value); + } + this.attributes = __this__attributes; + } + } + + public scannerOpenWithStop_args deepCopy() { + return new scannerOpenWithStop_args(this); + } + + @Override + public void clear() { + this.tableName = null; + this.startRow = null; + this.stopRow = null; + this.columns = null; + this.attributes = null; + } + + /** + * name of table + */ + public byte[] getTableName() { + setTableName(org.apache.thrift.TBaseHelper.rightSize(tableName)); + return tableName == null ? null : tableName.array(); + } + + public ByteBuffer bufferForTableName() { + return org.apache.thrift.TBaseHelper.copyBinary(tableName); + } + + /** + * name of table + */ + public scannerOpenWithStop_args setTableName(byte[] tableName) { + this.tableName = tableName == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(tableName, tableName.length)); + return this; + } + + public scannerOpenWithStop_args setTableName(ByteBuffer tableName) { + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(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; + } + } + + /** + * Starting row in table to scan. + * Send "" (empty string) to start at the first row. + */ + public byte[] getStartRow() { + setStartRow(org.apache.thrift.TBaseHelper.rightSize(startRow)); + return startRow == null ? null : startRow.array(); + } + + public ByteBuffer bufferForStartRow() { + return org.apache.thrift.TBaseHelper.copyBinary(startRow); + } + + /** + * Starting row in table to scan. + * Send "" (empty string) to start at the first row. + */ + public scannerOpenWithStop_args setStartRow(byte[] startRow) { + this.startRow = startRow == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(startRow, startRow.length)); + return this; + } + + public scannerOpenWithStop_args setStartRow(ByteBuffer startRow) { + this.startRow = org.apache.thrift.TBaseHelper.copyBinary(startRow); + return this; + } + + public void unsetStartRow() { + this.startRow = null; + } + + /** Returns true if field startRow is set (has been assigned a value) and false otherwise */ + public boolean isSetStartRow() { + return this.startRow != null; + } + + public void setStartRowIsSet(boolean value) { + if (!value) { + this.startRow = null; + } + } + + /** + * row to stop scanning on. This row is *not* included in the + * scanner's results + */ + public byte[] getStopRow() { + setStopRow(org.apache.thrift.TBaseHelper.rightSize(stopRow)); + return stopRow == null ? null : stopRow.array(); + } + + public ByteBuffer bufferForStopRow() { + return org.apache.thrift.TBaseHelper.copyBinary(stopRow); + } + + /** + * row to stop scanning on. This row is *not* included in the + * scanner's results + */ + public scannerOpenWithStop_args setStopRow(byte[] stopRow) { + this.stopRow = stopRow == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(stopRow, stopRow.length)); + return this; + } + + public scannerOpenWithStop_args setStopRow(ByteBuffer stopRow) { + this.stopRow = org.apache.thrift.TBaseHelper.copyBinary(stopRow); + return this; + } + + public void unsetStopRow() { + this.stopRow = null; + } + + /** Returns true if field stopRow is set (has been assigned a value) and false otherwise */ + public boolean isSetStopRow() { + return this.stopRow != null; + } + + public void setStopRowIsSet(boolean value) { + if (!value) { + this.stopRow = null; + } + } + + public int getColumnsSize() { + return (this.columns == null) ? 0 : this.columns.size(); + } + + public java.util.Iterator getColumnsIterator() { + return (this.columns == null) ? null : this.columns.iterator(); + } + + public void addToColumns(ByteBuffer elem) { + if (this.columns == null) { + this.columns = new ArrayList(); + } + this.columns.add(elem); + } + + /** + * columns to scan. If column name is a column family, all + * columns of the specified column family are returned. It's also possible + * to pass a regex in the column qualifier. + */ + public List getColumns() { + return this.columns; + } + + /** + * columns to scan. If column name is a column family, all + * columns of the specified column family are returned. It's also possible + * to pass a regex in the column qualifier. + */ + public scannerOpenWithStop_args setColumns(List 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(); + } + this.attributes.put(key, val); + } + + /** + * Scan attributes + */ + public Map getAttributes() { + return this.attributes; + } + + /** + * Scan attributes + */ + public scannerOpenWithStop_args setAttributes(Map 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; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case TABLE_NAME: + if (value == null) { + unsetTableName(); + } else { + setTableName((ByteBuffer)value); + } + break; + + case START_ROW: + if (value == null) { + unsetStartRow(); + } else { + setStartRow((ByteBuffer)value); + } + break; + + case STOP_ROW: + if (value == null) { + unsetStopRow(); + } else { + setStopRow((ByteBuffer)value); + } + break; + + case COLUMNS: + if (value == null) { + unsetColumns(); + } else { + setColumns((List)value); + } + break; + + case ATTRIBUTES: + if (value == null) { + unsetAttributes(); + } else { + setAttributes((Map)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case TABLE_NAME: + return getTableName(); + + case START_ROW: + return getStartRow(); + + case STOP_ROW: + return getStopRow(); + + case COLUMNS: + return getColumns(); + + case ATTRIBUTES: + return getAttributes(); + + } + 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 START_ROW: + return isSetStartRow(); + case STOP_ROW: + return isSetStopRow(); + case COLUMNS: + return isSetColumns(); + case ATTRIBUTES: + return isSetAttributes(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof scannerOpenWithStop_args) + return this.equals((scannerOpenWithStop_args)that); + return false; + } + + public boolean equals(scannerOpenWithStop_args 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_startRow = true && this.isSetStartRow(); + boolean that_present_startRow = true && that.isSetStartRow(); + if (this_present_startRow || that_present_startRow) { + if (!(this_present_startRow && that_present_startRow)) + return false; + if (!this.startRow.equals(that.startRow)) + return false; + } + + boolean this_present_stopRow = true && this.isSetStopRow(); + boolean that_present_stopRow = true && that.isSetStopRow(); + if (this_present_stopRow || that_present_stopRow) { + if (!(this_present_stopRow && that_present_stopRow)) + return false; + if (!this.stopRow.equals(that.stopRow)) + 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; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_tableName = true && (isSetTableName()); + list.add(present_tableName); + if (present_tableName) + list.add(tableName); + + boolean present_startRow = true && (isSetStartRow()); + list.add(present_startRow); + if (present_startRow) + list.add(startRow); + + boolean present_stopRow = true && (isSetStopRow()); + list.add(present_stopRow); + if (present_stopRow) + list.add(stopRow); + + 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); + + return list.hashCode(); + } + + @Override + public int compareTo(scannerOpenWithStop_args 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(isSetStartRow()).compareTo(other.isSetStartRow()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStartRow()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startRow, other.startRow); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetStopRow()).compareTo(other.isSetStopRow()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStopRow()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stopRow, other.stopRow); + 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; + } + } + 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("scannerOpenWithStop_args("); + boolean first = true; + + sb.append("tableName:"); + if (this.tableName == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.tableName, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("startRow:"); + if (this.startRow == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.startRow, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("stopRow:"); + if (this.stopRow == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.stopRow, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("columns:"); + if (this.columns == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.columns, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("attributes:"); + if (this.attributes == null) { + sb.append("null"); + } else { + sb.append(this.attributes); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 scannerOpenWithStop_argsStandardSchemeFactory implements SchemeFactory { + public scannerOpenWithStop_argsStandardScheme getScheme() { + return new scannerOpenWithStop_argsStandardScheme(); + } + } + + private static class scannerOpenWithStop_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, scannerOpenWithStop_args 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.STRING) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // START_ROW + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.startRow = iprot.readBinary(); + struct.setStartRowIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // STOP_ROW + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.stopRow = iprot.readBinary(); + struct.setStopRowIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // COLUMNS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list494 = iprot.readListBegin(); + struct.columns = new ArrayList(_list494.size); + ByteBuffer _elem495; + for (int _i496 = 0; _i496 < _list494.size; ++_i496) + { + _elem495 = iprot.readBinary(); + struct.columns.add(_elem495); + } + iprot.readListEnd(); + } + struct.setColumnsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // ATTRIBUTES + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map497 = iprot.readMapBegin(); + struct.attributes = new HashMap(2*_map497.size); + ByteBuffer _key498; + ByteBuffer _val499; + for (int _i500 = 0; _i500 < _map497.size; ++_i500) + { + _key498 = iprot.readBinary(); + _val499 = iprot.readBinary(); + struct.attributes.put(_key498, _val499); + } + iprot.readMapEnd(); + } + struct.setAttributesIsSet(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, scannerOpenWithStop_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.tableName != null) { + oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC); + oprot.writeBinary(struct.tableName); + oprot.writeFieldEnd(); + } + if (struct.startRow != null) { + oprot.writeFieldBegin(START_ROW_FIELD_DESC); + oprot.writeBinary(struct.startRow); + oprot.writeFieldEnd(); + } + if (struct.stopRow != null) { + oprot.writeFieldBegin(STOP_ROW_FIELD_DESC); + oprot.writeBinary(struct.stopRow); + oprot.writeFieldEnd(); + } + if (struct.columns != null) { + oprot.writeFieldBegin(COLUMNS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.columns.size())); + for (ByteBuffer _iter501 : struct.columns) + { + oprot.writeBinary(_iter501); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.attributes != null) { + 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 _iter502 : struct.attributes.entrySet()) + { + oprot.writeBinary(_iter502.getKey()); + oprot.writeBinary(_iter502.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class scannerOpenWithStop_argsTupleSchemeFactory implements SchemeFactory { + public scannerOpenWithStop_argsTupleScheme getScheme() { + return new scannerOpenWithStop_argsTupleScheme(); + } + } + + private static class scannerOpenWithStop_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, scannerOpenWithStop_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetTableName()) { + optionals.set(0); + } + if (struct.isSetStartRow()) { + optionals.set(1); + } + if (struct.isSetStopRow()) { + optionals.set(2); + } + if (struct.isSetColumns()) { + optionals.set(3); + } + if (struct.isSetAttributes()) { + optionals.set(4); + } + oprot.writeBitSet(optionals, 5); + if (struct.isSetTableName()) { + oprot.writeBinary(struct.tableName); + } + if (struct.isSetStartRow()) { + oprot.writeBinary(struct.startRow); + } + if (struct.isSetStopRow()) { + oprot.writeBinary(struct.stopRow); + } + if (struct.isSetColumns()) { + { + oprot.writeI32(struct.columns.size()); + for (ByteBuffer _iter503 : struct.columns) + { + oprot.writeBinary(_iter503); + } + } + } + if (struct.isSetAttributes()) { + { + oprot.writeI32(struct.attributes.size()); + for (Map.Entry _iter504 : struct.attributes.entrySet()) + { + oprot.writeBinary(_iter504.getKey()); + oprot.writeBinary(_iter504.getValue()); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, scannerOpenWithStop_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(5); + if (incoming.get(0)) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(true); + } + if (incoming.get(1)) { + struct.startRow = iprot.readBinary(); + struct.setStartRowIsSet(true); + } + if (incoming.get(2)) { + struct.stopRow = iprot.readBinary(); + struct.setStopRowIsSet(true); + } + if (incoming.get(3)) { + { + org.apache.thrift.protocol.TList _list505 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.columns = new ArrayList(_list505.size); + ByteBuffer _elem506; + for (int _i507 = 0; _i507 < _list505.size; ++_i507) + { + _elem506 = iprot.readBinary(); + struct.columns.add(_elem506); + } + } + struct.setColumnsIsSet(true); + } + if (incoming.get(4)) { + { + org.apache.thrift.protocol.TMap _map508 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.attributes = new HashMap(2*_map508.size); + ByteBuffer _key509; + ByteBuffer _val510; + for (int _i511 = 0; _i511 < _map508.size; ++_i511) + { + _key509 = iprot.readBinary(); + _val510 = iprot.readBinary(); + struct.attributes.put(_key509, _val510); + } + } + struct.setAttributesIsSet(true); + } + } + } + + } + + public static class scannerOpenWithStop_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("scannerOpenWithStop_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I32, (short)0); + private static final org.apache.thrift.protocol.TField IO_FIELD_DESC = new org.apache.thrift.protocol.TField("io", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new scannerOpenWithStop_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new scannerOpenWithStop_resultTupleSchemeFactory()); + } + + public int success; // required + public IOError io; // 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 { + SUCCESS((short)0, "success"), + IO((short)1, "io"); + + private static final Map byName = new HashMap(); + + 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 0: // SUCCESS + return SUCCESS; + case 1: // IO + return IO; + 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 int __SUCCESS_ISSET_ID = 0; + private byte __isset_bitfield = 0; + 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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32 , "ScannerID"))); + tmpMap.put(_Fields.IO, new org.apache.thrift.meta_data.FieldMetaData("io", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(scannerOpenWithStop_result.class, metaDataMap); + } + + public scannerOpenWithStop_result() { + } + + public scannerOpenWithStop_result( + int success, + IOError io) + { + this(); + this.success = success; + setSuccessIsSet(true); + this.io = io; + } + + /** + * Performs a deep copy on other. + */ + public scannerOpenWithStop_result(scannerOpenWithStop_result other) { + __isset_bitfield = other.__isset_bitfield; + this.success = other.success; + if (other.isSetIo()) { + this.io = new IOError(other.io); + } + } + + public scannerOpenWithStop_result deepCopy() { + return new scannerOpenWithStop_result(this); + } + + @Override + public void clear() { + setSuccessIsSet(false); + this.success = 0; + this.io = null; + } + + public int getSuccess() { + return this.success; + } + + public scannerOpenWithStop_result setSuccess(int success) { + this.success = success; + setSuccessIsSet(true); + return this; + } + + public void unsetSuccess() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + public void setSuccessIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); + } + + public IOError getIo() { + return this.io; + } + + public scannerOpenWithStop_result setIo(IOError io) { + this.io = io; + return this; + } + + public void unsetIo() { + this.io = null; + } + + /** Returns true if field io is set (has been assigned a value) and false otherwise */ + public boolean isSetIo() { + return this.io != null; + } + + public void setIoIsSet(boolean value) { + if (!value) { + this.io = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((Integer)value); + } + break; + + case IO: + if (value == null) { + unsetIo(); + } else { + setIo((IOError)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + case IO: + return getIo(); + + } + 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 SUCCESS: + return isSetSuccess(); + case IO: + return isSetIo(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof scannerOpenWithStop_result) + return this.equals((scannerOpenWithStop_result)that); + return false; + } + + public boolean equals(scannerOpenWithStop_result that) { + if (that == null) + return false; + + boolean this_present_success = true; + boolean that_present_success = true; + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (this.success != that.success) + return false; + } + + boolean this_present_io = true && this.isSetIo(); + boolean that_present_io = true && that.isSetIo(); + if (this_present_io || that_present_io) { + if (!(this_present_io && that_present_io)) + return false; + if (!this.io.equals(that.io)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true; + list.add(present_success); + if (present_success) + list.add(success); + + boolean present_io = true && (isSetIo()); + list.add(present_io); + if (present_io) + list.add(io); + + return list.hashCode(); + } + + @Override + public int compareTo(scannerOpenWithStop_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIo()).compareTo(other.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, other.io); + 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("scannerOpenWithStop_result("); + boolean first = true; + + sb.append("success:"); + sb.append(this.success); + first = false; + if (!first) sb.append(", "); + sb.append("io:"); + if (this.io == null) { + sb.append("null"); + } else { + sb.append(this.io); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 { + // 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); + } + } + + private static class scannerOpenWithStop_resultStandardSchemeFactory implements SchemeFactory { + public scannerOpenWithStop_resultStandardScheme getScheme() { + return new scannerOpenWithStop_resultStandardScheme(); + } + } + + private static class scannerOpenWithStop_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, scannerOpenWithStop_result 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 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.success = iprot.readI32(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IO + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(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, scannerOpenWithStop_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeI32(struct.success); + oprot.writeFieldEnd(); + } + if (struct.io != null) { + oprot.writeFieldBegin(IO_FIELD_DESC); + struct.io.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class scannerOpenWithStop_resultTupleSchemeFactory implements SchemeFactory { + public scannerOpenWithStop_resultTupleScheme getScheme() { + return new scannerOpenWithStop_resultTupleScheme(); + } + } + + private static class scannerOpenWithStop_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, scannerOpenWithStop_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIo()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + oprot.writeI32(struct.success); + } + if (struct.isSetIo()) { + struct.io.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, scannerOpenWithStop_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.success = iprot.readI32(); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } + } + } + + } + + public static class scannerOpenWithPrefix_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("scannerOpenWithPrefix_args"); + + private static final org.apache.thrift.protocol.TField TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tableName", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField START_AND_PREFIX_FIELD_DESC = new org.apache.thrift.protocol.TField("startAndPrefix", org.apache.thrift.protocol.TType.STRING, (short)2); + 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)3); + 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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new scannerOpenWithPrefix_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new scannerOpenWithPrefix_argsTupleSchemeFactory()); + } + + /** + * name of table + */ + public ByteBuffer tableName; // required + /** + * the prefix (and thus start row) of the keys you want + */ + public ByteBuffer startAndPrefix; // required + /** + * the columns you want returned + */ + public List columns; // required + /** + * Scan attributes + */ + public Map attributes; // 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 { + /** + * name of table + */ + TABLE_NAME((short)1, "tableName"), + /** + * the prefix (and thus start row) of the keys you want + */ + START_AND_PREFIX((short)2, "startAndPrefix"), + /** + * the columns you want returned + */ + COLUMNS((short)3, "columns"), + /** + * Scan attributes + */ + ATTRIBUTES((short)4, "attributes"); + + private static final Map byName = new HashMap(); + + 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: // START_AND_PREFIX + return START_AND_PREFIX; + case 3: // COLUMNS + return COLUMNS; + case 4: // ATTRIBUTES + return ATTRIBUTES; + 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.TABLE_NAME, new org.apache.thrift.meta_data.FieldMetaData("tableName", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.START_AND_PREFIX, new org.apache.thrift.meta_data.FieldMetaData("startAndPrefix", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.COLUMNS, new org.apache.thrift.meta_data.FieldMetaData("columns", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text")))); + tmpMap.put(_Fields.ATTRIBUTES, new org.apache.thrift.meta_data.FieldMetaData("attributes", org.apache.thrift.TFieldRequirementType.DEFAULT, + 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 , "Text"), + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text")))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(scannerOpenWithPrefix_args.class, metaDataMap); + } + + public scannerOpenWithPrefix_args() { + } + + public scannerOpenWithPrefix_args( + ByteBuffer tableName, + ByteBuffer startAndPrefix, + List columns, + Map attributes) + { + this(); + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(tableName); + this.startAndPrefix = org.apache.thrift.TBaseHelper.copyBinary(startAndPrefix); + this.columns = columns; + this.attributes = attributes; + } + + /** + * Performs a deep copy on other. + */ + public scannerOpenWithPrefix_args(scannerOpenWithPrefix_args other) { + if (other.isSetTableName()) { + this.tableName = other.tableName; + } + if (other.isSetStartAndPrefix()) { + this.startAndPrefix = other.startAndPrefix; + } + if (other.isSetColumns()) { + List __this__columns = new ArrayList(other.columns.size()); + for (ByteBuffer other_element : other.columns) { + __this__columns.add(other_element); + } + this.columns = __this__columns; + } + if (other.isSetAttributes()) { + Map __this__attributes = new HashMap(other.attributes.size()); + for (Map.Entry other_element : other.attributes.entrySet()) { + + ByteBuffer other_element_key = other_element.getKey(); + ByteBuffer other_element_value = other_element.getValue(); + + ByteBuffer __this__attributes_copy_key = other_element_key; + + ByteBuffer __this__attributes_copy_value = other_element_value; + + __this__attributes.put(__this__attributes_copy_key, __this__attributes_copy_value); + } + this.attributes = __this__attributes; + } + } + + public scannerOpenWithPrefix_args deepCopy() { + return new scannerOpenWithPrefix_args(this); + } + + @Override + public void clear() { + this.tableName = null; + this.startAndPrefix = null; + this.columns = null; + this.attributes = null; + } + + /** + * name of table + */ + public byte[] getTableName() { + setTableName(org.apache.thrift.TBaseHelper.rightSize(tableName)); + return tableName == null ? null : tableName.array(); + } + + public ByteBuffer bufferForTableName() { + return org.apache.thrift.TBaseHelper.copyBinary(tableName); + } + + /** + * name of table + */ + public scannerOpenWithPrefix_args setTableName(byte[] tableName) { + this.tableName = tableName == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(tableName, tableName.length)); + return this; + } + + public scannerOpenWithPrefix_args setTableName(ByteBuffer tableName) { + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(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; + } + } + + /** + * the prefix (and thus start row) of the keys you want + */ + public byte[] getStartAndPrefix() { + setStartAndPrefix(org.apache.thrift.TBaseHelper.rightSize(startAndPrefix)); + return startAndPrefix == null ? null : startAndPrefix.array(); + } + + public ByteBuffer bufferForStartAndPrefix() { + return org.apache.thrift.TBaseHelper.copyBinary(startAndPrefix); + } + + /** + * the prefix (and thus start row) of the keys you want + */ + public scannerOpenWithPrefix_args setStartAndPrefix(byte[] startAndPrefix) { + this.startAndPrefix = startAndPrefix == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(startAndPrefix, startAndPrefix.length)); + return this; + } + + public scannerOpenWithPrefix_args setStartAndPrefix(ByteBuffer startAndPrefix) { + this.startAndPrefix = org.apache.thrift.TBaseHelper.copyBinary(startAndPrefix); + return this; + } + + public void unsetStartAndPrefix() { + this.startAndPrefix = null; + } + + /** Returns true if field startAndPrefix is set (has been assigned a value) and false otherwise */ + public boolean isSetStartAndPrefix() { + return this.startAndPrefix != null; + } + + public void setStartAndPrefixIsSet(boolean value) { + if (!value) { + this.startAndPrefix = null; + } + } + + public int getColumnsSize() { + return (this.columns == null) ? 0 : this.columns.size(); + } + + public java.util.Iterator getColumnsIterator() { + return (this.columns == null) ? null : this.columns.iterator(); + } + + public void addToColumns(ByteBuffer elem) { + if (this.columns == null) { + this.columns = new ArrayList(); + } + this.columns.add(elem); + } + + /** + * the columns you want returned + */ + public List getColumns() { + return this.columns; + } + + /** + * the columns you want returned + */ + public scannerOpenWithPrefix_args setColumns(List 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(); + } + this.attributes.put(key, val); + } + + /** + * Scan attributes + */ + public Map getAttributes() { + return this.attributes; + } + + /** + * Scan attributes + */ + public scannerOpenWithPrefix_args setAttributes(Map 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; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case TABLE_NAME: + if (value == null) { + unsetTableName(); + } else { + setTableName((ByteBuffer)value); + } + break; + + case START_AND_PREFIX: + if (value == null) { + unsetStartAndPrefix(); + } else { + setStartAndPrefix((ByteBuffer)value); + } + break; + + case COLUMNS: + if (value == null) { + unsetColumns(); + } else { + setColumns((List)value); + } + break; + + case ATTRIBUTES: + if (value == null) { + unsetAttributes(); + } else { + setAttributes((Map)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case TABLE_NAME: + return getTableName(); + + case START_AND_PREFIX: + return getStartAndPrefix(); + + case COLUMNS: + return getColumns(); + + case ATTRIBUTES: + return getAttributes(); + + } + 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 START_AND_PREFIX: + return isSetStartAndPrefix(); + case COLUMNS: + return isSetColumns(); + case ATTRIBUTES: + return isSetAttributes(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof scannerOpenWithPrefix_args) + return this.equals((scannerOpenWithPrefix_args)that); + return false; + } + + public boolean equals(scannerOpenWithPrefix_args 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_startAndPrefix = true && this.isSetStartAndPrefix(); + boolean that_present_startAndPrefix = true && that.isSetStartAndPrefix(); + if (this_present_startAndPrefix || that_present_startAndPrefix) { + if (!(this_present_startAndPrefix && that_present_startAndPrefix)) + return false; + if (!this.startAndPrefix.equals(that.startAndPrefix)) + 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; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_tableName = true && (isSetTableName()); + list.add(present_tableName); + if (present_tableName) + list.add(tableName); + + boolean present_startAndPrefix = true && (isSetStartAndPrefix()); + list.add(present_startAndPrefix); + if (present_startAndPrefix) + list.add(startAndPrefix); + + 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); + + return list.hashCode(); + } + + @Override + public int compareTo(scannerOpenWithPrefix_args 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(isSetStartAndPrefix()).compareTo(other.isSetStartAndPrefix()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStartAndPrefix()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startAndPrefix, other.startAndPrefix); + 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; + } + } + 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("scannerOpenWithPrefix_args("); + boolean first = true; + + sb.append("tableName:"); + if (this.tableName == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.tableName, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("startAndPrefix:"); + if (this.startAndPrefix == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.startAndPrefix, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("columns:"); + if (this.columns == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.columns, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("attributes:"); + if (this.attributes == null) { + sb.append("null"); + } else { + sb.append(this.attributes); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 scannerOpenWithPrefix_argsStandardSchemeFactory implements SchemeFactory { + public scannerOpenWithPrefix_argsStandardScheme getScheme() { + return new scannerOpenWithPrefix_argsStandardScheme(); + } + } + + private static class scannerOpenWithPrefix_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, scannerOpenWithPrefix_args 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.STRING) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // START_AND_PREFIX + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.startAndPrefix = iprot.readBinary(); + struct.setStartAndPrefixIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // COLUMNS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list512 = iprot.readListBegin(); + struct.columns = new ArrayList(_list512.size); + ByteBuffer _elem513; + for (int _i514 = 0; _i514 < _list512.size; ++_i514) + { + _elem513 = iprot.readBinary(); + struct.columns.add(_elem513); + } + iprot.readListEnd(); + } + struct.setColumnsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // ATTRIBUTES + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map515 = iprot.readMapBegin(); + struct.attributes = new HashMap(2*_map515.size); + ByteBuffer _key516; + ByteBuffer _val517; + for (int _i518 = 0; _i518 < _map515.size; ++_i518) + { + _key516 = iprot.readBinary(); + _val517 = iprot.readBinary(); + struct.attributes.put(_key516, _val517); + } + iprot.readMapEnd(); + } + struct.setAttributesIsSet(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, scannerOpenWithPrefix_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.tableName != null) { + oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC); + oprot.writeBinary(struct.tableName); + oprot.writeFieldEnd(); + } + if (struct.startAndPrefix != null) { + oprot.writeFieldBegin(START_AND_PREFIX_FIELD_DESC); + oprot.writeBinary(struct.startAndPrefix); + oprot.writeFieldEnd(); + } + if (struct.columns != null) { + oprot.writeFieldBegin(COLUMNS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.columns.size())); + for (ByteBuffer _iter519 : struct.columns) + { + oprot.writeBinary(_iter519); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.attributes != null) { + 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 _iter520 : struct.attributes.entrySet()) + { + oprot.writeBinary(_iter520.getKey()); + oprot.writeBinary(_iter520.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class scannerOpenWithPrefix_argsTupleSchemeFactory implements SchemeFactory { + public scannerOpenWithPrefix_argsTupleScheme getScheme() { + return new scannerOpenWithPrefix_argsTupleScheme(); + } + } + + private static class scannerOpenWithPrefix_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, scannerOpenWithPrefix_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetTableName()) { + optionals.set(0); + } + if (struct.isSetStartAndPrefix()) { + optionals.set(1); + } + if (struct.isSetColumns()) { + optionals.set(2); + } + if (struct.isSetAttributes()) { + optionals.set(3); + } + oprot.writeBitSet(optionals, 4); + if (struct.isSetTableName()) { + oprot.writeBinary(struct.tableName); + } + if (struct.isSetStartAndPrefix()) { + oprot.writeBinary(struct.startAndPrefix); + } + if (struct.isSetColumns()) { + { + oprot.writeI32(struct.columns.size()); + for (ByteBuffer _iter521 : struct.columns) + { + oprot.writeBinary(_iter521); + } + } + } + if (struct.isSetAttributes()) { + { + oprot.writeI32(struct.attributes.size()); + for (Map.Entry _iter522 : struct.attributes.entrySet()) + { + oprot.writeBinary(_iter522.getKey()); + oprot.writeBinary(_iter522.getValue()); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, scannerOpenWithPrefix_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(4); + if (incoming.get(0)) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(true); + } + if (incoming.get(1)) { + struct.startAndPrefix = iprot.readBinary(); + struct.setStartAndPrefixIsSet(true); + } + if (incoming.get(2)) { + { + org.apache.thrift.protocol.TList _list523 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.columns = new ArrayList(_list523.size); + ByteBuffer _elem524; + for (int _i525 = 0; _i525 < _list523.size; ++_i525) + { + _elem524 = iprot.readBinary(); + struct.columns.add(_elem524); + } + } + struct.setColumnsIsSet(true); + } + if (incoming.get(3)) { + { + org.apache.thrift.protocol.TMap _map526 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.attributes = new HashMap(2*_map526.size); + ByteBuffer _key527; + ByteBuffer _val528; + for (int _i529 = 0; _i529 < _map526.size; ++_i529) + { + _key527 = iprot.readBinary(); + _val528 = iprot.readBinary(); + struct.attributes.put(_key527, _val528); + } + } + struct.setAttributesIsSet(true); + } + } + } + + } + + public static class scannerOpenWithPrefix_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("scannerOpenWithPrefix_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I32, (short)0); + private static final org.apache.thrift.protocol.TField IO_FIELD_DESC = new org.apache.thrift.protocol.TField("io", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new scannerOpenWithPrefix_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new scannerOpenWithPrefix_resultTupleSchemeFactory()); + } + + public int success; // required + public IOError io; // 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 { + SUCCESS((short)0, "success"), + IO((short)1, "io"); + + private static final Map byName = new HashMap(); + + 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 0: // SUCCESS + return SUCCESS; + case 1: // IO + return IO; + 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 int __SUCCESS_ISSET_ID = 0; + private byte __isset_bitfield = 0; + 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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32 , "ScannerID"))); + tmpMap.put(_Fields.IO, new org.apache.thrift.meta_data.FieldMetaData("io", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(scannerOpenWithPrefix_result.class, metaDataMap); + } + + public scannerOpenWithPrefix_result() { + } + + public scannerOpenWithPrefix_result( + int success, + IOError io) + { + this(); + this.success = success; + setSuccessIsSet(true); + this.io = io; + } + + /** + * Performs a deep copy on other. + */ + public scannerOpenWithPrefix_result(scannerOpenWithPrefix_result other) { + __isset_bitfield = other.__isset_bitfield; + this.success = other.success; + if (other.isSetIo()) { + this.io = new IOError(other.io); + } + } + + public scannerOpenWithPrefix_result deepCopy() { + return new scannerOpenWithPrefix_result(this); + } + + @Override + public void clear() { + setSuccessIsSet(false); + this.success = 0; + this.io = null; + } + + public int getSuccess() { + return this.success; + } + + public scannerOpenWithPrefix_result setSuccess(int success) { + this.success = success; + setSuccessIsSet(true); + return this; + } + + public void unsetSuccess() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + public void setSuccessIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); + } + + public IOError getIo() { + return this.io; + } + + public scannerOpenWithPrefix_result setIo(IOError io) { + this.io = io; + return this; + } + + public void unsetIo() { + this.io = null; + } + + /** Returns true if field io is set (has been assigned a value) and false otherwise */ + public boolean isSetIo() { + return this.io != null; + } + + public void setIoIsSet(boolean value) { + if (!value) { + this.io = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((Integer)value); + } + break; + + case IO: + if (value == null) { + unsetIo(); + } else { + setIo((IOError)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + case IO: + return getIo(); + + } + 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 SUCCESS: + return isSetSuccess(); + case IO: + return isSetIo(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof scannerOpenWithPrefix_result) + return this.equals((scannerOpenWithPrefix_result)that); + return false; + } + + public boolean equals(scannerOpenWithPrefix_result that) { + if (that == null) + return false; + + boolean this_present_success = true; + boolean that_present_success = true; + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (this.success != that.success) + return false; + } + + boolean this_present_io = true && this.isSetIo(); + boolean that_present_io = true && that.isSetIo(); + if (this_present_io || that_present_io) { + if (!(this_present_io && that_present_io)) + return false; + if (!this.io.equals(that.io)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true; + list.add(present_success); + if (present_success) + list.add(success); + + boolean present_io = true && (isSetIo()); + list.add(present_io); + if (present_io) + list.add(io); + + return list.hashCode(); + } + + @Override + public int compareTo(scannerOpenWithPrefix_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIo()).compareTo(other.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, other.io); + 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("scannerOpenWithPrefix_result("); + boolean first = true; + + sb.append("success:"); + sb.append(this.success); + first = false; + if (!first) sb.append(", "); + sb.append("io:"); + if (this.io == null) { + sb.append("null"); + } else { + sb.append(this.io); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 { + // 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); + } + } + + private static class scannerOpenWithPrefix_resultStandardSchemeFactory implements SchemeFactory { + public scannerOpenWithPrefix_resultStandardScheme getScheme() { + return new scannerOpenWithPrefix_resultStandardScheme(); + } + } + + private static class scannerOpenWithPrefix_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, scannerOpenWithPrefix_result 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 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.success = iprot.readI32(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IO + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(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, scannerOpenWithPrefix_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeI32(struct.success); + oprot.writeFieldEnd(); + } + if (struct.io != null) { + oprot.writeFieldBegin(IO_FIELD_DESC); + struct.io.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class scannerOpenWithPrefix_resultTupleSchemeFactory implements SchemeFactory { + public scannerOpenWithPrefix_resultTupleScheme getScheme() { + return new scannerOpenWithPrefix_resultTupleScheme(); + } + } + + private static class scannerOpenWithPrefix_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, scannerOpenWithPrefix_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIo()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + oprot.writeI32(struct.success); + } + if (struct.isSetIo()) { + struct.io.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, scannerOpenWithPrefix_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.success = iprot.readI32(); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } + } + } + + } + + public static class scannerOpenTs_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("scannerOpenTs_args"); + + private static final org.apache.thrift.protocol.TField TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tableName", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField START_ROW_FIELD_DESC = new org.apache.thrift.protocol.TField("startRow", org.apache.thrift.protocol.TType.STRING, (short)2); + 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)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 ATTRIBUTES_FIELD_DESC = new org.apache.thrift.protocol.TField("attributes", org.apache.thrift.protocol.TType.MAP, (short)5); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new scannerOpenTs_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new scannerOpenTs_argsTupleSchemeFactory()); + } + + /** + * name of table + */ + public ByteBuffer tableName; // required + /** + * Starting row in table to scan. + * Send "" (empty string) to start at the first row. + */ + public ByteBuffer startRow; // required + /** + * columns to scan. If column name is a column family, all + * columns of the specified column family are returned. It's also possible + * to pass a regex in the column qualifier. + */ + public List columns; // required + /** + * timestamp + */ + public long timestamp; // required + /** + * Scan attributes + */ + public Map attributes; // 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 { + /** + * name of table + */ + TABLE_NAME((short)1, "tableName"), + /** + * Starting row in table to scan. + * Send "" (empty string) to start at the first row. + */ + START_ROW((short)2, "startRow"), + /** + * columns to scan. If column name is a column family, all + * columns of the specified column family are returned. It's also possible + * to pass a regex in the column qualifier. + */ + COLUMNS((short)3, "columns"), + /** + * timestamp + */ + TIMESTAMP((short)4, "timestamp"), + /** + * Scan attributes + */ + ATTRIBUTES((short)5, "attributes"); + + private static final Map byName = new HashMap(); + + 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: // START_ROW + return START_ROW; + case 3: // COLUMNS + return COLUMNS; + case 4: // TIMESTAMP + return TIMESTAMP; + case 5: // ATTRIBUTES + return ATTRIBUTES; + 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 int __TIMESTAMP_ISSET_ID = 0; + private byte __isset_bitfield = 0; + 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.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.START_ROW, new org.apache.thrift.meta_data.FieldMetaData("startRow", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.COLUMNS, new org.apache.thrift.meta_data.FieldMetaData("columns", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text")))); + tmpMap.put(_Fields.TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("timestamp", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.ATTRIBUTES, new org.apache.thrift.meta_data.FieldMetaData("attributes", org.apache.thrift.TFieldRequirementType.DEFAULT, + 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 , "Text"), + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text")))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(scannerOpenTs_args.class, metaDataMap); + } + + public scannerOpenTs_args() { + } + + public scannerOpenTs_args( + ByteBuffer tableName, + ByteBuffer startRow, + List columns, + long timestamp, + Map attributes) + { + this(); + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(tableName); + this.startRow = org.apache.thrift.TBaseHelper.copyBinary(startRow); + this.columns = columns; + this.timestamp = timestamp; + setTimestampIsSet(true); + this.attributes = attributes; + } + + /** + * Performs a deep copy on other. + */ + public scannerOpenTs_args(scannerOpenTs_args other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetTableName()) { + this.tableName = other.tableName; + } + if (other.isSetStartRow()) { + this.startRow = other.startRow; + } + if (other.isSetColumns()) { + List __this__columns = new ArrayList(other.columns.size()); + for (ByteBuffer other_element : other.columns) { + __this__columns.add(other_element); + } + this.columns = __this__columns; + } + this.timestamp = other.timestamp; + if (other.isSetAttributes()) { + Map __this__attributes = new HashMap(other.attributes.size()); + for (Map.Entry other_element : other.attributes.entrySet()) { + + ByteBuffer other_element_key = other_element.getKey(); + ByteBuffer other_element_value = other_element.getValue(); + + ByteBuffer __this__attributes_copy_key = other_element_key; + + ByteBuffer __this__attributes_copy_value = other_element_value; + + __this__attributes.put(__this__attributes_copy_key, __this__attributes_copy_value); + } + this.attributes = __this__attributes; + } + } + + public scannerOpenTs_args deepCopy() { + return new scannerOpenTs_args(this); + } + + @Override + public void clear() { + this.tableName = null; + this.startRow = null; + this.columns = null; + setTimestampIsSet(false); + this.timestamp = 0; + this.attributes = null; + } + + /** + * name of table + */ + public byte[] getTableName() { + setTableName(org.apache.thrift.TBaseHelper.rightSize(tableName)); + return tableName == null ? null : tableName.array(); + } + + public ByteBuffer bufferForTableName() { + return org.apache.thrift.TBaseHelper.copyBinary(tableName); + } + + /** + * name of table + */ + public scannerOpenTs_args setTableName(byte[] tableName) { + this.tableName = tableName == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(tableName, tableName.length)); + return this; + } + + public scannerOpenTs_args setTableName(ByteBuffer tableName) { + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(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; + } + } + + /** + * Starting row in table to scan. + * Send "" (empty string) to start at the first row. + */ + public byte[] getStartRow() { + setStartRow(org.apache.thrift.TBaseHelper.rightSize(startRow)); + return startRow == null ? null : startRow.array(); + } + + public ByteBuffer bufferForStartRow() { + return org.apache.thrift.TBaseHelper.copyBinary(startRow); + } + + /** + * Starting row in table to scan. + * Send "" (empty string) to start at the first row. + */ + public scannerOpenTs_args setStartRow(byte[] startRow) { + this.startRow = startRow == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(startRow, startRow.length)); + return this; + } + + public scannerOpenTs_args setStartRow(ByteBuffer startRow) { + this.startRow = org.apache.thrift.TBaseHelper.copyBinary(startRow); + return this; + } + + public void unsetStartRow() { + this.startRow = null; + } + + /** Returns true if field startRow is set (has been assigned a value) and false otherwise */ + public boolean isSetStartRow() { + return this.startRow != null; + } + + public void setStartRowIsSet(boolean value) { + if (!value) { + this.startRow = null; + } + } + + public int getColumnsSize() { + return (this.columns == null) ? 0 : this.columns.size(); + } + + public java.util.Iterator getColumnsIterator() { + return (this.columns == null) ? null : this.columns.iterator(); + } + + public void addToColumns(ByteBuffer elem) { + if (this.columns == null) { + this.columns = new ArrayList(); + } + this.columns.add(elem); + } + + /** + * columns to scan. If column name is a column family, all + * columns of the specified column family are returned. It's also possible + * to pass a regex in the column qualifier. + */ + public List getColumns() { + return this.columns; + } + + /** + * columns to scan. If column name is a column family, all + * columns of the specified column family are returned. It's also possible + * to pass a regex in the column qualifier. + */ + public scannerOpenTs_args setColumns(List 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; + } + } + + /** + * timestamp + */ + public long getTimestamp() { + return this.timestamp; + } + + /** + * timestamp + */ + public scannerOpenTs_args setTimestamp(long timestamp) { + this.timestamp = timestamp; + setTimestampIsSet(true); + return this; + } + + public void unsetTimestamp() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); + } + + /** Returns true if field timestamp is set (has been assigned a value) and false otherwise */ + public boolean isSetTimestamp() { + return EncodingUtils.testBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); + } + + public void setTimestampIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TIMESTAMP_ISSET_ID, value); + } + + 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(); + } + this.attributes.put(key, val); + } + + /** + * Scan attributes + */ + public Map getAttributes() { + return this.attributes; + } + + /** + * Scan attributes + */ + public scannerOpenTs_args setAttributes(Map 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; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case TABLE_NAME: + if (value == null) { + unsetTableName(); + } else { + setTableName((ByteBuffer)value); + } + break; + + case START_ROW: + if (value == null) { + unsetStartRow(); + } else { + setStartRow((ByteBuffer)value); + } + break; + + case COLUMNS: + if (value == null) { + unsetColumns(); + } else { + setColumns((List)value); + } + break; + + case TIMESTAMP: + if (value == null) { + unsetTimestamp(); + } else { + setTimestamp((Long)value); + } + break; + + case ATTRIBUTES: + if (value == null) { + unsetAttributes(); + } else { + setAttributes((Map)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case TABLE_NAME: + return getTableName(); + + case START_ROW: + return getStartRow(); + + case COLUMNS: + return getColumns(); + + case TIMESTAMP: + return getTimestamp(); + + case ATTRIBUTES: + return getAttributes(); + + } + 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 START_ROW: + return isSetStartRow(); + case COLUMNS: + return isSetColumns(); + case TIMESTAMP: + return isSetTimestamp(); + case ATTRIBUTES: + return isSetAttributes(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof scannerOpenTs_args) + return this.equals((scannerOpenTs_args)that); + return false; + } + + public boolean equals(scannerOpenTs_args 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_startRow = true && this.isSetStartRow(); + boolean that_present_startRow = true && that.isSetStartRow(); + if (this_present_startRow || that_present_startRow) { + if (!(this_present_startRow && that_present_startRow)) + return false; + if (!this.startRow.equals(that.startRow)) + 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_timestamp = true; + boolean that_present_timestamp = true; + if (this_present_timestamp || that_present_timestamp) { + if (!(this_present_timestamp && that_present_timestamp)) + return false; + if (this.timestamp != that.timestamp) + 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; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_tableName = true && (isSetTableName()); + list.add(present_tableName); + if (present_tableName) + list.add(tableName); + + boolean present_startRow = true && (isSetStartRow()); + list.add(present_startRow); + if (present_startRow) + list.add(startRow); + + boolean present_columns = true && (isSetColumns()); + list.add(present_columns); + if (present_columns) + list.add(columns); + + boolean present_timestamp = true; + list.add(present_timestamp); + if (present_timestamp) + list.add(timestamp); + + boolean present_attributes = true && (isSetAttributes()); + list.add(present_attributes); + if (present_attributes) + list.add(attributes); + + return list.hashCode(); + } + + @Override + public int compareTo(scannerOpenTs_args 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(isSetStartRow()).compareTo(other.isSetStartRow()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStartRow()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startRow, other.startRow); + 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(isSetTimestamp()).compareTo(other.isSetTimestamp()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTimestamp()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timestamp, other.timestamp); + 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; + } + } + 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("scannerOpenTs_args("); + boolean first = true; + + sb.append("tableName:"); + if (this.tableName == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.tableName, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("startRow:"); + if (this.startRow == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.startRow, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("columns:"); + if (this.columns == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.columns, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("timestamp:"); + sb.append(this.timestamp); + first = false; + if (!first) sb.append(", "); + sb.append("attributes:"); + if (this.attributes == null) { + sb.append("null"); + } else { + sb.append(this.attributes); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 { + // 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); + } + } + + private static class scannerOpenTs_argsStandardSchemeFactory implements SchemeFactory { + public scannerOpenTs_argsStandardScheme getScheme() { + return new scannerOpenTs_argsStandardScheme(); + } + } + + private static class scannerOpenTs_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, scannerOpenTs_args 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.STRING) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // START_ROW + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.startRow = iprot.readBinary(); + struct.setStartRowIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // COLUMNS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list530 = iprot.readListBegin(); + struct.columns = new ArrayList(_list530.size); + ByteBuffer _elem531; + for (int _i532 = 0; _i532 < _list530.size; ++_i532) + { + _elem531 = iprot.readBinary(); + struct.columns.add(_elem531); + } + iprot.readListEnd(); + } + struct.setColumnsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // TIMESTAMP + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.timestamp = iprot.readI64(); + struct.setTimestampIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // ATTRIBUTES + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map533 = iprot.readMapBegin(); + struct.attributes = new HashMap(2*_map533.size); + ByteBuffer _key534; + ByteBuffer _val535; + for (int _i536 = 0; _i536 < _map533.size; ++_i536) + { + _key534 = iprot.readBinary(); + _val535 = iprot.readBinary(); + struct.attributes.put(_key534, _val535); + } + iprot.readMapEnd(); + } + struct.setAttributesIsSet(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, scannerOpenTs_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.tableName != null) { + oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC); + oprot.writeBinary(struct.tableName); + oprot.writeFieldEnd(); + } + if (struct.startRow != null) { + oprot.writeFieldBegin(START_ROW_FIELD_DESC); + oprot.writeBinary(struct.startRow); + oprot.writeFieldEnd(); + } + if (struct.columns != null) { + oprot.writeFieldBegin(COLUMNS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.columns.size())); + for (ByteBuffer _iter537 : struct.columns) + { + oprot.writeBinary(_iter537); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC); + oprot.writeI64(struct.timestamp); + oprot.writeFieldEnd(); + if (struct.attributes != null) { + 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 _iter538 : struct.attributes.entrySet()) + { + oprot.writeBinary(_iter538.getKey()); + oprot.writeBinary(_iter538.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class scannerOpenTs_argsTupleSchemeFactory implements SchemeFactory { + public scannerOpenTs_argsTupleScheme getScheme() { + return new scannerOpenTs_argsTupleScheme(); + } + } + + private static class scannerOpenTs_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, scannerOpenTs_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetTableName()) { + optionals.set(0); + } + if (struct.isSetStartRow()) { + optionals.set(1); + } + if (struct.isSetColumns()) { + optionals.set(2); + } + if (struct.isSetTimestamp()) { + optionals.set(3); + } + if (struct.isSetAttributes()) { + optionals.set(4); + } + oprot.writeBitSet(optionals, 5); + if (struct.isSetTableName()) { + oprot.writeBinary(struct.tableName); + } + if (struct.isSetStartRow()) { + oprot.writeBinary(struct.startRow); + } + if (struct.isSetColumns()) { + { + oprot.writeI32(struct.columns.size()); + for (ByteBuffer _iter539 : struct.columns) + { + oprot.writeBinary(_iter539); + } + } + } + if (struct.isSetTimestamp()) { + oprot.writeI64(struct.timestamp); + } + if (struct.isSetAttributes()) { + { + oprot.writeI32(struct.attributes.size()); + for (Map.Entry _iter540 : struct.attributes.entrySet()) + { + oprot.writeBinary(_iter540.getKey()); + oprot.writeBinary(_iter540.getValue()); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, scannerOpenTs_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(5); + if (incoming.get(0)) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(true); + } + if (incoming.get(1)) { + struct.startRow = iprot.readBinary(); + struct.setStartRowIsSet(true); + } + if (incoming.get(2)) { + { + org.apache.thrift.protocol.TList _list541 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.columns = new ArrayList(_list541.size); + ByteBuffer _elem542; + for (int _i543 = 0; _i543 < _list541.size; ++_i543) + { + _elem542 = iprot.readBinary(); + struct.columns.add(_elem542); + } + } + struct.setColumnsIsSet(true); + } + if (incoming.get(3)) { + struct.timestamp = iprot.readI64(); + struct.setTimestampIsSet(true); + } + if (incoming.get(4)) { + { + org.apache.thrift.protocol.TMap _map544 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.attributes = new HashMap(2*_map544.size); + ByteBuffer _key545; + ByteBuffer _val546; + for (int _i547 = 0; _i547 < _map544.size; ++_i547) + { + _key545 = iprot.readBinary(); + _val546 = iprot.readBinary(); + struct.attributes.put(_key545, _val546); + } + } + struct.setAttributesIsSet(true); + } + } + } + + } + + public static class scannerOpenTs_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("scannerOpenTs_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I32, (short)0); + private static final org.apache.thrift.protocol.TField IO_FIELD_DESC = new org.apache.thrift.protocol.TField("io", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new scannerOpenTs_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new scannerOpenTs_resultTupleSchemeFactory()); + } + + public int success; // required + public IOError io; // 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 { + SUCCESS((short)0, "success"), + IO((short)1, "io"); + + private static final Map byName = new HashMap(); + + 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 0: // SUCCESS + return SUCCESS; + case 1: // IO + return IO; + 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 int __SUCCESS_ISSET_ID = 0; + private byte __isset_bitfield = 0; + 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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32 , "ScannerID"))); + tmpMap.put(_Fields.IO, new org.apache.thrift.meta_data.FieldMetaData("io", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(scannerOpenTs_result.class, metaDataMap); + } + + public scannerOpenTs_result() { + } + + public scannerOpenTs_result( + int success, + IOError io) + { + this(); + this.success = success; + setSuccessIsSet(true); + this.io = io; + } + + /** + * Performs a deep copy on other. + */ + public scannerOpenTs_result(scannerOpenTs_result other) { + __isset_bitfield = other.__isset_bitfield; + this.success = other.success; + if (other.isSetIo()) { + this.io = new IOError(other.io); + } + } + + public scannerOpenTs_result deepCopy() { + return new scannerOpenTs_result(this); + } + + @Override + public void clear() { + setSuccessIsSet(false); + this.success = 0; + this.io = null; + } + + public int getSuccess() { + return this.success; + } + + public scannerOpenTs_result setSuccess(int success) { + this.success = success; + setSuccessIsSet(true); + return this; + } + + public void unsetSuccess() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + public void setSuccessIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); + } + + public IOError getIo() { + return this.io; + } + + public scannerOpenTs_result setIo(IOError io) { + this.io = io; + return this; + } + + public void unsetIo() { + this.io = null; + } + + /** Returns true if field io is set (has been assigned a value) and false otherwise */ + public boolean isSetIo() { + return this.io != null; + } + + public void setIoIsSet(boolean value) { + if (!value) { + this.io = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((Integer)value); + } + break; + + case IO: + if (value == null) { + unsetIo(); + } else { + setIo((IOError)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + case IO: + return getIo(); + + } + 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 SUCCESS: + return isSetSuccess(); + case IO: + return isSetIo(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof scannerOpenTs_result) + return this.equals((scannerOpenTs_result)that); + return false; + } + + public boolean equals(scannerOpenTs_result that) { + if (that == null) + return false; + + boolean this_present_success = true; + boolean that_present_success = true; + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (this.success != that.success) + return false; + } + + boolean this_present_io = true && this.isSetIo(); + boolean that_present_io = true && that.isSetIo(); + if (this_present_io || that_present_io) { + if (!(this_present_io && that_present_io)) + return false; + if (!this.io.equals(that.io)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true; + list.add(present_success); + if (present_success) + list.add(success); + + boolean present_io = true && (isSetIo()); + list.add(present_io); + if (present_io) + list.add(io); + + return list.hashCode(); + } + + @Override + public int compareTo(scannerOpenTs_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIo()).compareTo(other.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, other.io); + 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("scannerOpenTs_result("); + boolean first = true; + + sb.append("success:"); + sb.append(this.success); + first = false; + if (!first) sb.append(", "); + sb.append("io:"); + if (this.io == null) { + sb.append("null"); + } else { + sb.append(this.io); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 { + // 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); + } + } + + private static class scannerOpenTs_resultStandardSchemeFactory implements SchemeFactory { + public scannerOpenTs_resultStandardScheme getScheme() { + return new scannerOpenTs_resultStandardScheme(); + } + } + + private static class scannerOpenTs_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, scannerOpenTs_result 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 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.success = iprot.readI32(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IO + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(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, scannerOpenTs_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeI32(struct.success); + oprot.writeFieldEnd(); + } + if (struct.io != null) { + oprot.writeFieldBegin(IO_FIELD_DESC); + struct.io.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class scannerOpenTs_resultTupleSchemeFactory implements SchemeFactory { + public scannerOpenTs_resultTupleScheme getScheme() { + return new scannerOpenTs_resultTupleScheme(); + } + } + + private static class scannerOpenTs_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, scannerOpenTs_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIo()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + oprot.writeI32(struct.success); + } + if (struct.isSetIo()) { + struct.io.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, scannerOpenTs_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.success = iprot.readI32(); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } + } + } + + } + + public static class scannerOpenWithStopTs_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("scannerOpenWithStopTs_args"); + + private static final org.apache.thrift.protocol.TField TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tableName", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField START_ROW_FIELD_DESC = new org.apache.thrift.protocol.TField("startRow", org.apache.thrift.protocol.TType.STRING, (short)2); + private static final org.apache.thrift.protocol.TField STOP_ROW_FIELD_DESC = new org.apache.thrift.protocol.TField("stopRow", org.apache.thrift.protocol.TType.STRING, (short)3); + 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)4); + 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)5); + 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)6); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new scannerOpenWithStopTs_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new scannerOpenWithStopTs_argsTupleSchemeFactory()); + } + + /** + * name of table + */ + public ByteBuffer tableName; // required + /** + * Starting row in table to scan. + * Send "" (empty string) to start at the first row. + */ + public ByteBuffer startRow; // required + /** + * row to stop scanning on. This row is *not* included in the + * scanner's results + */ + public ByteBuffer stopRow; // required + /** + * columns to scan. If column name is a column family, all + * columns of the specified column family are returned. It's also possible + * to pass a regex in the column qualifier. + */ + public List columns; // required + /** + * timestamp + */ + public long timestamp; // required + /** + * Scan attributes + */ + public Map attributes; // 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 { + /** + * name of table + */ + TABLE_NAME((short)1, "tableName"), + /** + * Starting row in table to scan. + * Send "" (empty string) to start at the first row. + */ + START_ROW((short)2, "startRow"), + /** + * row to stop scanning on. This row is *not* included in the + * scanner's results + */ + STOP_ROW((short)3, "stopRow"), + /** + * columns to scan. If column name is a column family, all + * columns of the specified column family are returned. It's also possible + * to pass a regex in the column qualifier. + */ + COLUMNS((short)4, "columns"), + /** + * timestamp + */ + TIMESTAMP((short)5, "timestamp"), + /** + * Scan attributes + */ + ATTRIBUTES((short)6, "attributes"); + + private static final Map byName = new HashMap(); + + 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: // START_ROW + return START_ROW; + case 3: // STOP_ROW + return STOP_ROW; + case 4: // COLUMNS + return COLUMNS; + case 5: // TIMESTAMP + return TIMESTAMP; + case 6: // ATTRIBUTES + return ATTRIBUTES; + 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 int __TIMESTAMP_ISSET_ID = 0; + private byte __isset_bitfield = 0; + 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.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.START_ROW, new org.apache.thrift.meta_data.FieldMetaData("startRow", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.STOP_ROW, new org.apache.thrift.meta_data.FieldMetaData("stopRow", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.COLUMNS, new org.apache.thrift.meta_data.FieldMetaData("columns", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text")))); + tmpMap.put(_Fields.TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("timestamp", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.ATTRIBUTES, new org.apache.thrift.meta_data.FieldMetaData("attributes", org.apache.thrift.TFieldRequirementType.DEFAULT, + 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 , "Text"), + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text")))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(scannerOpenWithStopTs_args.class, metaDataMap); + } + + public scannerOpenWithStopTs_args() { + } + + public scannerOpenWithStopTs_args( + ByteBuffer tableName, + ByteBuffer startRow, + ByteBuffer stopRow, + List columns, + long timestamp, + Map attributes) + { + this(); + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(tableName); + this.startRow = org.apache.thrift.TBaseHelper.copyBinary(startRow); + this.stopRow = org.apache.thrift.TBaseHelper.copyBinary(stopRow); + this.columns = columns; + this.timestamp = timestamp; + setTimestampIsSet(true); + this.attributes = attributes; + } + + /** + * Performs a deep copy on other. + */ + public scannerOpenWithStopTs_args(scannerOpenWithStopTs_args other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetTableName()) { + this.tableName = other.tableName; + } + if (other.isSetStartRow()) { + this.startRow = other.startRow; + } + if (other.isSetStopRow()) { + this.stopRow = other.stopRow; + } + if (other.isSetColumns()) { + List __this__columns = new ArrayList(other.columns.size()); + for (ByteBuffer other_element : other.columns) { + __this__columns.add(other_element); + } + this.columns = __this__columns; + } + this.timestamp = other.timestamp; + if (other.isSetAttributes()) { + Map __this__attributes = new HashMap(other.attributes.size()); + for (Map.Entry other_element : other.attributes.entrySet()) { + + ByteBuffer other_element_key = other_element.getKey(); + ByteBuffer other_element_value = other_element.getValue(); + + ByteBuffer __this__attributes_copy_key = other_element_key; + + ByteBuffer __this__attributes_copy_value = other_element_value; + + __this__attributes.put(__this__attributes_copy_key, __this__attributes_copy_value); + } + this.attributes = __this__attributes; + } + } + + public scannerOpenWithStopTs_args deepCopy() { + return new scannerOpenWithStopTs_args(this); + } + + @Override + public void clear() { + this.tableName = null; + this.startRow = null; + this.stopRow = null; + this.columns = null; + setTimestampIsSet(false); + this.timestamp = 0; + this.attributes = null; + } + + /** + * name of table + */ + public byte[] getTableName() { + setTableName(org.apache.thrift.TBaseHelper.rightSize(tableName)); + return tableName == null ? null : tableName.array(); + } + + public ByteBuffer bufferForTableName() { + return org.apache.thrift.TBaseHelper.copyBinary(tableName); + } + + /** + * name of table + */ + public scannerOpenWithStopTs_args setTableName(byte[] tableName) { + this.tableName = tableName == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(tableName, tableName.length)); + return this; + } + + public scannerOpenWithStopTs_args setTableName(ByteBuffer tableName) { + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(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; + } + } + + /** + * Starting row in table to scan. + * Send "" (empty string) to start at the first row. + */ + public byte[] getStartRow() { + setStartRow(org.apache.thrift.TBaseHelper.rightSize(startRow)); + return startRow == null ? null : startRow.array(); + } + + public ByteBuffer bufferForStartRow() { + return org.apache.thrift.TBaseHelper.copyBinary(startRow); + } + + /** + * Starting row in table to scan. + * Send "" (empty string) to start at the first row. + */ + public scannerOpenWithStopTs_args setStartRow(byte[] startRow) { + this.startRow = startRow == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(startRow, startRow.length)); + return this; + } + + public scannerOpenWithStopTs_args setStartRow(ByteBuffer startRow) { + this.startRow = org.apache.thrift.TBaseHelper.copyBinary(startRow); + return this; + } + + public void unsetStartRow() { + this.startRow = null; + } + + /** Returns true if field startRow is set (has been assigned a value) and false otherwise */ + public boolean isSetStartRow() { + return this.startRow != null; + } + + public void setStartRowIsSet(boolean value) { + if (!value) { + this.startRow = null; + } + } + + /** + * row to stop scanning on. This row is *not* included in the + * scanner's results + */ + public byte[] getStopRow() { + setStopRow(org.apache.thrift.TBaseHelper.rightSize(stopRow)); + return stopRow == null ? null : stopRow.array(); + } + + public ByteBuffer bufferForStopRow() { + return org.apache.thrift.TBaseHelper.copyBinary(stopRow); + } + + /** + * row to stop scanning on. This row is *not* included in the + * scanner's results + */ + public scannerOpenWithStopTs_args setStopRow(byte[] stopRow) { + this.stopRow = stopRow == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(stopRow, stopRow.length)); + return this; + } + + public scannerOpenWithStopTs_args setStopRow(ByteBuffer stopRow) { + this.stopRow = org.apache.thrift.TBaseHelper.copyBinary(stopRow); + return this; + } + + public void unsetStopRow() { + this.stopRow = null; + } + + /** Returns true if field stopRow is set (has been assigned a value) and false otherwise */ + public boolean isSetStopRow() { + return this.stopRow != null; + } + + public void setStopRowIsSet(boolean value) { + if (!value) { + this.stopRow = null; + } + } + + public int getColumnsSize() { + return (this.columns == null) ? 0 : this.columns.size(); + } + + public java.util.Iterator getColumnsIterator() { + return (this.columns == null) ? null : this.columns.iterator(); + } + + public void addToColumns(ByteBuffer elem) { + if (this.columns == null) { + this.columns = new ArrayList(); + } + this.columns.add(elem); + } + + /** + * columns to scan. If column name is a column family, all + * columns of the specified column family are returned. It's also possible + * to pass a regex in the column qualifier. + */ + public List getColumns() { + return this.columns; + } + + /** + * columns to scan. If column name is a column family, all + * columns of the specified column family are returned. It's also possible + * to pass a regex in the column qualifier. + */ + public scannerOpenWithStopTs_args setColumns(List 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; + } + } + + /** + * timestamp + */ + public long getTimestamp() { + return this.timestamp; + } + + /** + * timestamp + */ + public scannerOpenWithStopTs_args setTimestamp(long timestamp) { + this.timestamp = timestamp; + setTimestampIsSet(true); + return this; + } + + public void unsetTimestamp() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); + } + + /** Returns true if field timestamp is set (has been assigned a value) and false otherwise */ + public boolean isSetTimestamp() { + return EncodingUtils.testBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); + } + + public void setTimestampIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TIMESTAMP_ISSET_ID, value); + } + + 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(); + } + this.attributes.put(key, val); + } + + /** + * Scan attributes + */ + public Map getAttributes() { + return this.attributes; + } + + /** + * Scan attributes + */ + public scannerOpenWithStopTs_args setAttributes(Map 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; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case TABLE_NAME: + if (value == null) { + unsetTableName(); + } else { + setTableName((ByteBuffer)value); + } + break; + + case START_ROW: + if (value == null) { + unsetStartRow(); + } else { + setStartRow((ByteBuffer)value); + } + break; + + case STOP_ROW: + if (value == null) { + unsetStopRow(); + } else { + setStopRow((ByteBuffer)value); + } + break; + + case COLUMNS: + if (value == null) { + unsetColumns(); + } else { + setColumns((List)value); + } + break; + + case TIMESTAMP: + if (value == null) { + unsetTimestamp(); + } else { + setTimestamp((Long)value); + } + break; + + case ATTRIBUTES: + if (value == null) { + unsetAttributes(); + } else { + setAttributes((Map)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case TABLE_NAME: + return getTableName(); + + case START_ROW: + return getStartRow(); + + case STOP_ROW: + return getStopRow(); + + case COLUMNS: + return getColumns(); + + case TIMESTAMP: + return getTimestamp(); + + case ATTRIBUTES: + return getAttributes(); + + } + 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 START_ROW: + return isSetStartRow(); + case STOP_ROW: + return isSetStopRow(); + case COLUMNS: + return isSetColumns(); + case TIMESTAMP: + return isSetTimestamp(); + case ATTRIBUTES: + return isSetAttributes(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof scannerOpenWithStopTs_args) + return this.equals((scannerOpenWithStopTs_args)that); + return false; + } + + public boolean equals(scannerOpenWithStopTs_args 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_startRow = true && this.isSetStartRow(); + boolean that_present_startRow = true && that.isSetStartRow(); + if (this_present_startRow || that_present_startRow) { + if (!(this_present_startRow && that_present_startRow)) + return false; + if (!this.startRow.equals(that.startRow)) + return false; + } + + boolean this_present_stopRow = true && this.isSetStopRow(); + boolean that_present_stopRow = true && that.isSetStopRow(); + if (this_present_stopRow || that_present_stopRow) { + if (!(this_present_stopRow && that_present_stopRow)) + return false; + if (!this.stopRow.equals(that.stopRow)) + 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_timestamp = true; + boolean that_present_timestamp = true; + if (this_present_timestamp || that_present_timestamp) { + if (!(this_present_timestamp && that_present_timestamp)) + return false; + if (this.timestamp != that.timestamp) + 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; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_tableName = true && (isSetTableName()); + list.add(present_tableName); + if (present_tableName) + list.add(tableName); + + boolean present_startRow = true && (isSetStartRow()); + list.add(present_startRow); + if (present_startRow) + list.add(startRow); + + boolean present_stopRow = true && (isSetStopRow()); + list.add(present_stopRow); + if (present_stopRow) + list.add(stopRow); + + boolean present_columns = true && (isSetColumns()); + list.add(present_columns); + if (present_columns) + list.add(columns); + + boolean present_timestamp = true; + list.add(present_timestamp); + if (present_timestamp) + list.add(timestamp); + + boolean present_attributes = true && (isSetAttributes()); + list.add(present_attributes); + if (present_attributes) + list.add(attributes); + + return list.hashCode(); + } + + @Override + public int compareTo(scannerOpenWithStopTs_args 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(isSetStartRow()).compareTo(other.isSetStartRow()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStartRow()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startRow, other.startRow); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetStopRow()).compareTo(other.isSetStopRow()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStopRow()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stopRow, other.stopRow); + 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(isSetTimestamp()).compareTo(other.isSetTimestamp()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTimestamp()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timestamp, other.timestamp); + 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; + } + } + 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("scannerOpenWithStopTs_args("); + boolean first = true; + + sb.append("tableName:"); + if (this.tableName == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.tableName, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("startRow:"); + if (this.startRow == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.startRow, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("stopRow:"); + if (this.stopRow == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.stopRow, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("columns:"); + if (this.columns == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.columns, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("timestamp:"); + sb.append(this.timestamp); + first = false; + if (!first) sb.append(", "); + sb.append("attributes:"); + if (this.attributes == null) { + sb.append("null"); + } else { + sb.append(this.attributes); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 { + // 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); + } + } + + private static class scannerOpenWithStopTs_argsStandardSchemeFactory implements SchemeFactory { + public scannerOpenWithStopTs_argsStandardScheme getScheme() { + return new scannerOpenWithStopTs_argsStandardScheme(); + } + } + + private static class scannerOpenWithStopTs_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, scannerOpenWithStopTs_args 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.STRING) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // START_ROW + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.startRow = iprot.readBinary(); + struct.setStartRowIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // STOP_ROW + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.stopRow = iprot.readBinary(); + struct.setStopRowIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // COLUMNS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list548 = iprot.readListBegin(); + struct.columns = new ArrayList(_list548.size); + ByteBuffer _elem549; + for (int _i550 = 0; _i550 < _list548.size; ++_i550) + { + _elem549 = iprot.readBinary(); + struct.columns.add(_elem549); + } + iprot.readListEnd(); + } + struct.setColumnsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // TIMESTAMP + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.timestamp = iprot.readI64(); + struct.setTimestampIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 6: // ATTRIBUTES + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map551 = iprot.readMapBegin(); + struct.attributes = new HashMap(2*_map551.size); + ByteBuffer _key552; + ByteBuffer _val553; + for (int _i554 = 0; _i554 < _map551.size; ++_i554) + { + _key552 = iprot.readBinary(); + _val553 = iprot.readBinary(); + struct.attributes.put(_key552, _val553); + } + iprot.readMapEnd(); + } + struct.setAttributesIsSet(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, scannerOpenWithStopTs_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.tableName != null) { + oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC); + oprot.writeBinary(struct.tableName); + oprot.writeFieldEnd(); + } + if (struct.startRow != null) { + oprot.writeFieldBegin(START_ROW_FIELD_DESC); + oprot.writeBinary(struct.startRow); + oprot.writeFieldEnd(); + } + if (struct.stopRow != null) { + oprot.writeFieldBegin(STOP_ROW_FIELD_DESC); + oprot.writeBinary(struct.stopRow); + oprot.writeFieldEnd(); + } + if (struct.columns != null) { + oprot.writeFieldBegin(COLUMNS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.columns.size())); + for (ByteBuffer _iter555 : struct.columns) + { + oprot.writeBinary(_iter555); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC); + oprot.writeI64(struct.timestamp); + oprot.writeFieldEnd(); + if (struct.attributes != null) { + 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 _iter556 : struct.attributes.entrySet()) + { + oprot.writeBinary(_iter556.getKey()); + oprot.writeBinary(_iter556.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class scannerOpenWithStopTs_argsTupleSchemeFactory implements SchemeFactory { + public scannerOpenWithStopTs_argsTupleScheme getScheme() { + return new scannerOpenWithStopTs_argsTupleScheme(); + } + } + + private static class scannerOpenWithStopTs_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, scannerOpenWithStopTs_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetTableName()) { + optionals.set(0); + } + if (struct.isSetStartRow()) { + optionals.set(1); + } + if (struct.isSetStopRow()) { + optionals.set(2); + } + if (struct.isSetColumns()) { + optionals.set(3); + } + if (struct.isSetTimestamp()) { + optionals.set(4); + } + if (struct.isSetAttributes()) { + optionals.set(5); + } + oprot.writeBitSet(optionals, 6); + if (struct.isSetTableName()) { + oprot.writeBinary(struct.tableName); + } + if (struct.isSetStartRow()) { + oprot.writeBinary(struct.startRow); + } + if (struct.isSetStopRow()) { + oprot.writeBinary(struct.stopRow); + } + if (struct.isSetColumns()) { + { + oprot.writeI32(struct.columns.size()); + for (ByteBuffer _iter557 : struct.columns) + { + oprot.writeBinary(_iter557); + } + } + } + if (struct.isSetTimestamp()) { + oprot.writeI64(struct.timestamp); + } + if (struct.isSetAttributes()) { + { + oprot.writeI32(struct.attributes.size()); + for (Map.Entry _iter558 : struct.attributes.entrySet()) + { + oprot.writeBinary(_iter558.getKey()); + oprot.writeBinary(_iter558.getValue()); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, scannerOpenWithStopTs_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(6); + if (incoming.get(0)) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(true); + } + if (incoming.get(1)) { + struct.startRow = iprot.readBinary(); + struct.setStartRowIsSet(true); + } + if (incoming.get(2)) { + struct.stopRow = iprot.readBinary(); + struct.setStopRowIsSet(true); + } + if (incoming.get(3)) { + { + org.apache.thrift.protocol.TList _list559 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.columns = new ArrayList(_list559.size); + ByteBuffer _elem560; + for (int _i561 = 0; _i561 < _list559.size; ++_i561) + { + _elem560 = iprot.readBinary(); + struct.columns.add(_elem560); + } + } + struct.setColumnsIsSet(true); + } + if (incoming.get(4)) { + struct.timestamp = iprot.readI64(); + struct.setTimestampIsSet(true); + } + if (incoming.get(5)) { + { + org.apache.thrift.protocol.TMap _map562 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.attributes = new HashMap(2*_map562.size); + ByteBuffer _key563; + ByteBuffer _val564; + for (int _i565 = 0; _i565 < _map562.size; ++_i565) + { + _key563 = iprot.readBinary(); + _val564 = iprot.readBinary(); + struct.attributes.put(_key563, _val564); + } + } + struct.setAttributesIsSet(true); + } + } + } + + } + + public static class scannerOpenWithStopTs_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("scannerOpenWithStopTs_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I32, (short)0); + private static final org.apache.thrift.protocol.TField IO_FIELD_DESC = new org.apache.thrift.protocol.TField("io", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new scannerOpenWithStopTs_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new scannerOpenWithStopTs_resultTupleSchemeFactory()); + } + + public int success; // required + public IOError io; // 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 { + SUCCESS((short)0, "success"), + IO((short)1, "io"); + + private static final Map byName = new HashMap(); + + 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 0: // SUCCESS + return SUCCESS; + case 1: // IO + return IO; + 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 int __SUCCESS_ISSET_ID = 0; + private byte __isset_bitfield = 0; + 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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32 , "ScannerID"))); + tmpMap.put(_Fields.IO, new org.apache.thrift.meta_data.FieldMetaData("io", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(scannerOpenWithStopTs_result.class, metaDataMap); + } + + public scannerOpenWithStopTs_result() { + } + + public scannerOpenWithStopTs_result( + int success, + IOError io) + { + this(); + this.success = success; + setSuccessIsSet(true); + this.io = io; + } + + /** + * Performs a deep copy on other. + */ + public scannerOpenWithStopTs_result(scannerOpenWithStopTs_result other) { + __isset_bitfield = other.__isset_bitfield; + this.success = other.success; + if (other.isSetIo()) { + this.io = new IOError(other.io); + } + } + + public scannerOpenWithStopTs_result deepCopy() { + return new scannerOpenWithStopTs_result(this); + } + + @Override + public void clear() { + setSuccessIsSet(false); + this.success = 0; + this.io = null; + } + + public int getSuccess() { + return this.success; + } + + public scannerOpenWithStopTs_result setSuccess(int success) { + this.success = success; + setSuccessIsSet(true); + return this; + } + + public void unsetSuccess() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + public void setSuccessIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); + } + + public IOError getIo() { + return this.io; + } + + public scannerOpenWithStopTs_result setIo(IOError io) { + this.io = io; + return this; + } + + public void unsetIo() { + this.io = null; + } + + /** Returns true if field io is set (has been assigned a value) and false otherwise */ + public boolean isSetIo() { + return this.io != null; + } + + public void setIoIsSet(boolean value) { + if (!value) { + this.io = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((Integer)value); + } + break; + + case IO: + if (value == null) { + unsetIo(); + } else { + setIo((IOError)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + case IO: + return getIo(); + + } + 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 SUCCESS: + return isSetSuccess(); + case IO: + return isSetIo(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof scannerOpenWithStopTs_result) + return this.equals((scannerOpenWithStopTs_result)that); + return false; + } + + public boolean equals(scannerOpenWithStopTs_result that) { + if (that == null) + return false; + + boolean this_present_success = true; + boolean that_present_success = true; + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (this.success != that.success) + return false; + } + + boolean this_present_io = true && this.isSetIo(); + boolean that_present_io = true && that.isSetIo(); + if (this_present_io || that_present_io) { + if (!(this_present_io && that_present_io)) + return false; + if (!this.io.equals(that.io)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true; + list.add(present_success); + if (present_success) + list.add(success); + + boolean present_io = true && (isSetIo()); + list.add(present_io); + if (present_io) + list.add(io); + + return list.hashCode(); + } + + @Override + public int compareTo(scannerOpenWithStopTs_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIo()).compareTo(other.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, other.io); + 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("scannerOpenWithStopTs_result("); + boolean first = true; + + sb.append("success:"); + sb.append(this.success); + first = false; + if (!first) sb.append(", "); + sb.append("io:"); + if (this.io == null) { + sb.append("null"); + } else { + sb.append(this.io); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 { + // 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); + } + } + + private static class scannerOpenWithStopTs_resultStandardSchemeFactory implements SchemeFactory { + public scannerOpenWithStopTs_resultStandardScheme getScheme() { + return new scannerOpenWithStopTs_resultStandardScheme(); + } + } + + private static class scannerOpenWithStopTs_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, scannerOpenWithStopTs_result 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 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.success = iprot.readI32(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IO + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(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, scannerOpenWithStopTs_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeI32(struct.success); + oprot.writeFieldEnd(); + } + if (struct.io != null) { + oprot.writeFieldBegin(IO_FIELD_DESC); + struct.io.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class scannerOpenWithStopTs_resultTupleSchemeFactory implements SchemeFactory { + public scannerOpenWithStopTs_resultTupleScheme getScheme() { + return new scannerOpenWithStopTs_resultTupleScheme(); + } + } + + private static class scannerOpenWithStopTs_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, scannerOpenWithStopTs_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIo()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + oprot.writeI32(struct.success); + } + if (struct.isSetIo()) { + struct.io.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, scannerOpenWithStopTs_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.success = iprot.readI32(); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } + } + } + + } + + public static class scannerGet_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("scannerGet_args"); + + private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.I32, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new scannerGet_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new scannerGet_argsTupleSchemeFactory()); + } + + /** + * id of a scanner returned by scannerOpen + */ + public int id; // 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 { + /** + * id of a scanner returned by scannerOpen + */ + ID((short)1, "id"); + + private static final Map byName = new HashMap(); + + 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: // ID + return ID; + 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 int __ID_ISSET_ID = 0; + private byte __isset_bitfield = 0; + 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.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32 , "ScannerID"))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(scannerGet_args.class, metaDataMap); + } + + public scannerGet_args() { + } + + public scannerGet_args( + int id) + { + this(); + this.id = id; + setIdIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public scannerGet_args(scannerGet_args other) { + __isset_bitfield = other.__isset_bitfield; + this.id = other.id; + } + + public scannerGet_args deepCopy() { + return new scannerGet_args(this); + } + + @Override + public void clear() { + setIdIsSet(false); + this.id = 0; + } + + /** + * id of a scanner returned by scannerOpen + */ + public int getId() { + return this.id; + } + + /** + * id of a scanner returned by scannerOpen + */ + public scannerGet_args setId(int id) { + this.id = id; + setIdIsSet(true); + return this; + } + + public void unsetId() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ID_ISSET_ID); + } + + /** Returns true if field id is set (has been assigned a value) and false otherwise */ + public boolean isSetId() { + return EncodingUtils.testBit(__isset_bitfield, __ID_ISSET_ID); + } + + public void setIdIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ID_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case ID: + if (value == null) { + unsetId(); + } else { + setId((Integer)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case ID: + return getId(); + + } + 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 ID: + return isSetId(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof scannerGet_args) + return this.equals((scannerGet_args)that); + return false; + } + + public boolean equals(scannerGet_args that) { + if (that == null) + return false; + + boolean this_present_id = true; + boolean that_present_id = true; + if (this_present_id || that_present_id) { + if (!(this_present_id && that_present_id)) + return false; + if (this.id != that.id) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_id = true; + list.add(present_id); + if (present_id) + list.add(id); + + return list.hashCode(); + } + + @Override + public int compareTo(scannerGet_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id); + 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("scannerGet_args("); + boolean first = true; + + sb.append("id:"); + sb.append(this.id); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 { + // 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); + } + } + + private static class scannerGet_argsStandardSchemeFactory implements SchemeFactory { + public scannerGet_argsStandardScheme getScheme() { + return new scannerGet_argsStandardScheme(); + } + } + + private static class scannerGet_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, scannerGet_args 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: // ID + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.id = iprot.readI32(); + struct.setIdIsSet(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, scannerGet_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(ID_FIELD_DESC); + oprot.writeI32(struct.id); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class scannerGet_argsTupleSchemeFactory implements SchemeFactory { + public scannerGet_argsTupleScheme getScheme() { + return new scannerGet_argsTupleScheme(); + } + } + + private static class scannerGet_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, scannerGet_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetId()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetId()) { + oprot.writeI32(struct.id); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, scannerGet_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.id = iprot.readI32(); + struct.setIdIsSet(true); + } + } + } + + } + + public static class scannerGet_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("scannerGet_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0); + private static final org.apache.thrift.protocol.TField IO_FIELD_DESC = new org.apache.thrift.protocol.TField("io", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final org.apache.thrift.protocol.TField IA_FIELD_DESC = new org.apache.thrift.protocol.TField("ia", org.apache.thrift.protocol.TType.STRUCT, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new scannerGet_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new scannerGet_resultTupleSchemeFactory()); + } + + public List success; // required + public IOError io; // required + public IllegalArgument ia; // 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 { + SUCCESS((short)0, "success"), + IO((short)1, "io"), + IA((short)2, "ia"); + + private static final Map byName = new HashMap(); + + 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 0: // SUCCESS + return SUCCESS; + case 1: // IO + return IO; + case 2: // IA + return IA; + 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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + 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, TRowResult.class)))); + tmpMap.put(_Fields.IO, new org.apache.thrift.meta_data.FieldMetaData("io", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + tmpMap.put(_Fields.IA, new org.apache.thrift.meta_data.FieldMetaData("ia", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(scannerGet_result.class, metaDataMap); + } + + public scannerGet_result() { + } + + public scannerGet_result( + List success, + IOError io, + IllegalArgument ia) + { + this(); + this.success = success; + this.io = io; + this.ia = ia; + } + + /** + * Performs a deep copy on other. + */ + public scannerGet_result(scannerGet_result other) { + if (other.isSetSuccess()) { + List __this__success = new ArrayList(other.success.size()); + for (TRowResult other_element : other.success) { + __this__success.add(new TRowResult(other_element)); + } + this.success = __this__success; + } + if (other.isSetIo()) { + this.io = new IOError(other.io); + } + if (other.isSetIa()) { + this.ia = new IllegalArgument(other.ia); + } + } + + public scannerGet_result deepCopy() { + return new scannerGet_result(this); + } + + @Override + public void clear() { + this.success = null; + this.io = null; + this.ia = null; + } + + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + public java.util.Iterator getSuccessIterator() { + return (this.success == null) ? null : this.success.iterator(); + } + + public void addToSuccess(TRowResult elem) { + if (this.success == null) { + this.success = new ArrayList(); + } + this.success.add(elem); + } + + public List getSuccess() { + return this.success; + } + + public scannerGet_result setSuccess(List success) { + this.success = success; + return this; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public IOError getIo() { + return this.io; + } + + public scannerGet_result setIo(IOError io) { + this.io = io; + return this; + } + + public void unsetIo() { + this.io = null; + } + + /** Returns true if field io is set (has been assigned a value) and false otherwise */ + public boolean isSetIo() { + return this.io != null; + } + + public void setIoIsSet(boolean value) { + if (!value) { + this.io = null; + } + } + + public IllegalArgument getIa() { + return this.ia; + } + + public scannerGet_result setIa(IllegalArgument ia) { + this.ia = ia; + return this; + } + + public void unsetIa() { + this.ia = null; + } + + /** Returns true if field ia is set (has been assigned a value) and false otherwise */ + public boolean isSetIa() { + return this.ia != null; + } + + public void setIaIsSet(boolean value) { + if (!value) { + this.ia = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((List)value); + } + break; + + case IO: + if (value == null) { + unsetIo(); + } else { + setIo((IOError)value); + } + break; + + case IA: + if (value == null) { + unsetIa(); + } else { + setIa((IllegalArgument)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + case IO: + return getIo(); + + case IA: + return getIa(); + + } + 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 SUCCESS: + return isSetSuccess(); + case IO: + return isSetIo(); + case IA: + return isSetIa(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof scannerGet_result) + return this.equals((scannerGet_result)that); + return false; + } + + public boolean equals(scannerGet_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + boolean this_present_io = true && this.isSetIo(); + boolean that_present_io = true && that.isSetIo(); + if (this_present_io || that_present_io) { + if (!(this_present_io && that_present_io)) + return false; + if (!this.io.equals(that.io)) + return false; + } + + boolean this_present_ia = true && this.isSetIa(); + boolean that_present_ia = true && that.isSetIa(); + if (this_present_ia || that_present_ia) { + if (!(this_present_ia && that_present_ia)) + return false; + if (!this.ia.equals(that.ia)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + boolean present_io = true && (isSetIo()); + list.add(present_io); + if (present_io) + list.add(io); + + boolean present_ia = true && (isSetIa()); + list.add(present_ia); + if (present_ia) + list.add(ia); + + return list.hashCode(); + } + + @Override + public int compareTo(scannerGet_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIo()).compareTo(other.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, other.io); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIa()).compareTo(other.isSetIa()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIa()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ia, other.ia); + 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("scannerGet_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + if (!first) sb.append(", "); + sb.append("io:"); + if (this.io == null) { + sb.append("null"); + } else { + sb.append(this.io); + } + first = false; + if (!first) sb.append(", "); + sb.append("ia:"); + if (this.ia == null) { + sb.append("null"); + } else { + sb.append(this.ia); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 scannerGet_resultStandardSchemeFactory implements SchemeFactory { + public scannerGet_resultStandardScheme getScheme() { + return new scannerGet_resultStandardScheme(); + } + } + + private static class scannerGet_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, scannerGet_result 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 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list566 = iprot.readListBegin(); + struct.success = new ArrayList(_list566.size); + TRowResult _elem567; + for (int _i568 = 0; _i568 < _list566.size; ++_i568) + { + _elem567 = new TRowResult(); + _elem567.read(iprot); + struct.success.add(_elem567); + } + iprot.readListEnd(); + } + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IO + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // IA + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ia = new IllegalArgument(); + struct.ia.read(iprot); + struct.setIaIsSet(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, scannerGet_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); + for (TRowResult _iter569 : struct.success) + { + _iter569.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.io != null) { + oprot.writeFieldBegin(IO_FIELD_DESC); + struct.io.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.ia != null) { + oprot.writeFieldBegin(IA_FIELD_DESC); + struct.ia.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class scannerGet_resultTupleSchemeFactory implements SchemeFactory { + public scannerGet_resultTupleScheme getScheme() { + return new scannerGet_resultTupleScheme(); + } + } + + private static class scannerGet_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, scannerGet_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIo()) { + optionals.set(1); + } + if (struct.isSetIa()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetSuccess()) { + { + oprot.writeI32(struct.success.size()); + for (TRowResult _iter570 : struct.success) + { + _iter570.write(oprot); + } + } + } + if (struct.isSetIo()) { + struct.io.write(oprot); + } + if (struct.isSetIa()) { + struct.ia.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, scannerGet_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list571 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new ArrayList(_list571.size); + TRowResult _elem572; + for (int _i573 = 0; _i573 < _list571.size; ++_i573) + { + _elem572 = new TRowResult(); + _elem572.read(iprot); + struct.success.add(_elem572); + } + } + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } + if (incoming.get(2)) { + struct.ia = new IllegalArgument(); + struct.ia.read(iprot); + struct.setIaIsSet(true); + } + } + } + + } + + public static class scannerGetList_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("scannerGetList_args"); + + private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.I32, (short)1); + private static final org.apache.thrift.protocol.TField NB_ROWS_FIELD_DESC = new org.apache.thrift.protocol.TField("nbRows", org.apache.thrift.protocol.TType.I32, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new scannerGetList_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new scannerGetList_argsTupleSchemeFactory()); + } + + /** + * id of a scanner returned by scannerOpen + */ + public int id; // required + /** + * number of results to return + */ + public int nbRows; // 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 { + /** + * id of a scanner returned by scannerOpen + */ + ID((short)1, "id"), + /** + * number of results to return + */ + NB_ROWS((short)2, "nbRows"); + + private static final Map byName = new HashMap(); + + 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: // ID + return ID; + case 2: // NB_ROWS + return NB_ROWS; + 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 int __ID_ISSET_ID = 0; + private static final int __NBROWS_ISSET_ID = 1; + private byte __isset_bitfield = 0; + 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.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32 , "ScannerID"))); + tmpMap.put(_Fields.NB_ROWS, new org.apache.thrift.meta_data.FieldMetaData("nbRows", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(scannerGetList_args.class, metaDataMap); + } + + public scannerGetList_args() { + } + + public scannerGetList_args( + int id, + int nbRows) + { + this(); + this.id = id; + setIdIsSet(true); + this.nbRows = nbRows; + setNbRowsIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public scannerGetList_args(scannerGetList_args other) { + __isset_bitfield = other.__isset_bitfield; + this.id = other.id; + this.nbRows = other.nbRows; + } + + public scannerGetList_args deepCopy() { + return new scannerGetList_args(this); + } + + @Override + public void clear() { + setIdIsSet(false); + this.id = 0; + setNbRowsIsSet(false); + this.nbRows = 0; + } + + /** + * id of a scanner returned by scannerOpen + */ + public int getId() { + return this.id; + } + + /** + * id of a scanner returned by scannerOpen + */ + public scannerGetList_args setId(int id) { + this.id = id; + setIdIsSet(true); + return this; + } + + public void unsetId() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ID_ISSET_ID); + } + + /** Returns true if field id is set (has been assigned a value) and false otherwise */ + public boolean isSetId() { + return EncodingUtils.testBit(__isset_bitfield, __ID_ISSET_ID); + } + + public void setIdIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ID_ISSET_ID, value); + } + + /** + * number of results to return + */ + public int getNbRows() { + return this.nbRows; + } + + /** + * number of results to return + */ + public scannerGetList_args setNbRows(int nbRows) { + this.nbRows = nbRows; + setNbRowsIsSet(true); + return this; + } + + public void unsetNbRows() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __NBROWS_ISSET_ID); + } + + /** Returns true if field nbRows is set (has been assigned a value) and false otherwise */ + public boolean isSetNbRows() { + return EncodingUtils.testBit(__isset_bitfield, __NBROWS_ISSET_ID); + } + + public void setNbRowsIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __NBROWS_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case ID: + if (value == null) { + unsetId(); + } else { + setId((Integer)value); + } + break; + + case NB_ROWS: + if (value == null) { + unsetNbRows(); + } else { + setNbRows((Integer)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case ID: + return getId(); + + case NB_ROWS: + return getNbRows(); + + } + 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 ID: + return isSetId(); + case NB_ROWS: + return isSetNbRows(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof scannerGetList_args) + return this.equals((scannerGetList_args)that); + return false; + } + + public boolean equals(scannerGetList_args that) { + if (that == null) + return false; + + boolean this_present_id = true; + boolean that_present_id = true; + if (this_present_id || that_present_id) { + if (!(this_present_id && that_present_id)) + return false; + if (this.id != that.id) + return false; + } + + boolean this_present_nbRows = true; + boolean that_present_nbRows = true; + if (this_present_nbRows || that_present_nbRows) { + if (!(this_present_nbRows && that_present_nbRows)) + return false; + if (this.nbRows != that.nbRows) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_id = true; + list.add(present_id); + if (present_id) + list.add(id); + + boolean present_nbRows = true; + list.add(present_nbRows); + if (present_nbRows) + list.add(nbRows); + + return list.hashCode(); + } + + @Override + public int compareTo(scannerGetList_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetNbRows()).compareTo(other.isSetNbRows()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetNbRows()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nbRows, other.nbRows); + 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("scannerGetList_args("); + boolean first = true; + + sb.append("id:"); + sb.append(this.id); + first = false; + if (!first) sb.append(", "); + sb.append("nbRows:"); + sb.append(this.nbRows); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 { + // 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); + } + } + + private static class scannerGetList_argsStandardSchemeFactory implements SchemeFactory { + public scannerGetList_argsStandardScheme getScheme() { + return new scannerGetList_argsStandardScheme(); + } + } + + private static class scannerGetList_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, scannerGetList_args 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: // ID + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.id = iprot.readI32(); + struct.setIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // NB_ROWS + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.nbRows = iprot.readI32(); + struct.setNbRowsIsSet(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, scannerGetList_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(ID_FIELD_DESC); + oprot.writeI32(struct.id); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(NB_ROWS_FIELD_DESC); + oprot.writeI32(struct.nbRows); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class scannerGetList_argsTupleSchemeFactory implements SchemeFactory { + public scannerGetList_argsTupleScheme getScheme() { + return new scannerGetList_argsTupleScheme(); + } + } + + private static class scannerGetList_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, scannerGetList_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetId()) { + optionals.set(0); + } + if (struct.isSetNbRows()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetId()) { + oprot.writeI32(struct.id); + } + if (struct.isSetNbRows()) { + oprot.writeI32(struct.nbRows); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, scannerGetList_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.id = iprot.readI32(); + struct.setIdIsSet(true); + } + if (incoming.get(1)) { + struct.nbRows = iprot.readI32(); + struct.setNbRowsIsSet(true); + } + } + } + + } + + public static class scannerGetList_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("scannerGetList_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0); + private static final org.apache.thrift.protocol.TField IO_FIELD_DESC = new org.apache.thrift.protocol.TField("io", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final org.apache.thrift.protocol.TField IA_FIELD_DESC = new org.apache.thrift.protocol.TField("ia", org.apache.thrift.protocol.TType.STRUCT, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new scannerGetList_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new scannerGetList_resultTupleSchemeFactory()); + } + + public List success; // required + public IOError io; // required + public IllegalArgument ia; // 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 { + SUCCESS((short)0, "success"), + IO((short)1, "io"), + IA((short)2, "ia"); + + private static final Map byName = new HashMap(); + + 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 0: // SUCCESS + return SUCCESS; + case 1: // IO + return IO; + case 2: // IA + return IA; + 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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + 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, TRowResult.class)))); + tmpMap.put(_Fields.IO, new org.apache.thrift.meta_data.FieldMetaData("io", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + tmpMap.put(_Fields.IA, new org.apache.thrift.meta_data.FieldMetaData("ia", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(scannerGetList_result.class, metaDataMap); + } + + public scannerGetList_result() { + } + + public scannerGetList_result( + List success, + IOError io, + IllegalArgument ia) + { + this(); + this.success = success; + this.io = io; + this.ia = ia; + } + + /** + * Performs a deep copy on other. + */ + public scannerGetList_result(scannerGetList_result other) { + if (other.isSetSuccess()) { + List __this__success = new ArrayList(other.success.size()); + for (TRowResult other_element : other.success) { + __this__success.add(new TRowResult(other_element)); + } + this.success = __this__success; + } + if (other.isSetIo()) { + this.io = new IOError(other.io); + } + if (other.isSetIa()) { + this.ia = new IllegalArgument(other.ia); + } + } + + public scannerGetList_result deepCopy() { + return new scannerGetList_result(this); + } + + @Override + public void clear() { + this.success = null; + this.io = null; + this.ia = null; + } + + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + public java.util.Iterator getSuccessIterator() { + return (this.success == null) ? null : this.success.iterator(); + } + + public void addToSuccess(TRowResult elem) { + if (this.success == null) { + this.success = new ArrayList(); + } + this.success.add(elem); + } + + public List getSuccess() { + return this.success; + } + + public scannerGetList_result setSuccess(List success) { + this.success = success; + return this; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public IOError getIo() { + return this.io; + } + + public scannerGetList_result setIo(IOError io) { + this.io = io; + return this; + } + + public void unsetIo() { + this.io = null; + } + + /** Returns true if field io is set (has been assigned a value) and false otherwise */ + public boolean isSetIo() { + return this.io != null; + } + + public void setIoIsSet(boolean value) { + if (!value) { + this.io = null; + } + } + + public IllegalArgument getIa() { + return this.ia; + } + + public scannerGetList_result setIa(IllegalArgument ia) { + this.ia = ia; + return this; + } + + public void unsetIa() { + this.ia = null; + } + + /** Returns true if field ia is set (has been assigned a value) and false otherwise */ + public boolean isSetIa() { + return this.ia != null; + } + + public void setIaIsSet(boolean value) { + if (!value) { + this.ia = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((List)value); + } + break; + + case IO: + if (value == null) { + unsetIo(); + } else { + setIo((IOError)value); + } + break; + + case IA: + if (value == null) { + unsetIa(); + } else { + setIa((IllegalArgument)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + case IO: + return getIo(); + + case IA: + return getIa(); + + } + 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 SUCCESS: + return isSetSuccess(); + case IO: + return isSetIo(); + case IA: + return isSetIa(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof scannerGetList_result) + return this.equals((scannerGetList_result)that); + return false; + } + + public boolean equals(scannerGetList_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + boolean this_present_io = true && this.isSetIo(); + boolean that_present_io = true && that.isSetIo(); + if (this_present_io || that_present_io) { + if (!(this_present_io && that_present_io)) + return false; + if (!this.io.equals(that.io)) + return false; + } + + boolean this_present_ia = true && this.isSetIa(); + boolean that_present_ia = true && that.isSetIa(); + if (this_present_ia || that_present_ia) { + if (!(this_present_ia && that_present_ia)) + return false; + if (!this.ia.equals(that.ia)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + boolean present_io = true && (isSetIo()); + list.add(present_io); + if (present_io) + list.add(io); + + boolean present_ia = true && (isSetIa()); + list.add(present_ia); + if (present_ia) + list.add(ia); + + return list.hashCode(); + } + + @Override + public int compareTo(scannerGetList_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIo()).compareTo(other.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, other.io); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIa()).compareTo(other.isSetIa()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIa()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ia, other.ia); + 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("scannerGetList_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + if (!first) sb.append(", "); + sb.append("io:"); + if (this.io == null) { + sb.append("null"); + } else { + sb.append(this.io); + } + first = false; + if (!first) sb.append(", "); + sb.append("ia:"); + if (this.ia == null) { + sb.append("null"); + } else { + sb.append(this.ia); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 scannerGetList_resultStandardSchemeFactory implements SchemeFactory { + public scannerGetList_resultStandardScheme getScheme() { + return new scannerGetList_resultStandardScheme(); + } + } + + private static class scannerGetList_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, scannerGetList_result 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 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list574 = iprot.readListBegin(); + struct.success = new ArrayList(_list574.size); + TRowResult _elem575; + for (int _i576 = 0; _i576 < _list574.size; ++_i576) + { + _elem575 = new TRowResult(); + _elem575.read(iprot); + struct.success.add(_elem575); + } + iprot.readListEnd(); + } + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IO + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // IA + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ia = new IllegalArgument(); + struct.ia.read(iprot); + struct.setIaIsSet(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, scannerGetList_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); + for (TRowResult _iter577 : struct.success) + { + _iter577.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.io != null) { + oprot.writeFieldBegin(IO_FIELD_DESC); + struct.io.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.ia != null) { + oprot.writeFieldBegin(IA_FIELD_DESC); + struct.ia.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class scannerGetList_resultTupleSchemeFactory implements SchemeFactory { + public scannerGetList_resultTupleScheme getScheme() { + return new scannerGetList_resultTupleScheme(); + } + } + + private static class scannerGetList_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, scannerGetList_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIo()) { + optionals.set(1); + } + if (struct.isSetIa()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetSuccess()) { + { + oprot.writeI32(struct.success.size()); + for (TRowResult _iter578 : struct.success) + { + _iter578.write(oprot); + } + } + } + if (struct.isSetIo()) { + struct.io.write(oprot); + } + if (struct.isSetIa()) { + struct.ia.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, scannerGetList_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list579 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new ArrayList(_list579.size); + TRowResult _elem580; + for (int _i581 = 0; _i581 < _list579.size; ++_i581) + { + _elem580 = new TRowResult(); + _elem580.read(iprot); + struct.success.add(_elem580); + } + } + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } + if (incoming.get(2)) { + struct.ia = new IllegalArgument(); + struct.ia.read(iprot); + struct.setIaIsSet(true); + } + } + } + + } + + public static class scannerClose_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("scannerClose_args"); + + private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.I32, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new scannerClose_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new scannerClose_argsTupleSchemeFactory()); + } + + /** + * id of a scanner returned by scannerOpen + */ + public int id; // 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 { + /** + * id of a scanner returned by scannerOpen + */ + ID((short)1, "id"); + + private static final Map byName = new HashMap(); + + 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: // ID + return ID; + 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 int __ID_ISSET_ID = 0; + private byte __isset_bitfield = 0; + 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.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32 , "ScannerID"))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(scannerClose_args.class, metaDataMap); + } + + public scannerClose_args() { + } + + public scannerClose_args( + int id) + { + this(); + this.id = id; + setIdIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public scannerClose_args(scannerClose_args other) { + __isset_bitfield = other.__isset_bitfield; + this.id = other.id; + } + + public scannerClose_args deepCopy() { + return new scannerClose_args(this); + } + + @Override + public void clear() { + setIdIsSet(false); + this.id = 0; + } + + /** + * id of a scanner returned by scannerOpen + */ + public int getId() { + return this.id; + } + + /** + * id of a scanner returned by scannerOpen + */ + public scannerClose_args setId(int id) { + this.id = id; + setIdIsSet(true); + return this; + } + + public void unsetId() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ID_ISSET_ID); + } + + /** Returns true if field id is set (has been assigned a value) and false otherwise */ + public boolean isSetId() { + return EncodingUtils.testBit(__isset_bitfield, __ID_ISSET_ID); + } + + public void setIdIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ID_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case ID: + if (value == null) { + unsetId(); + } else { + setId((Integer)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case ID: + return getId(); + + } + 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 ID: + return isSetId(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof scannerClose_args) + return this.equals((scannerClose_args)that); + return false; + } + + public boolean equals(scannerClose_args that) { + if (that == null) + return false; + + boolean this_present_id = true; + boolean that_present_id = true; + if (this_present_id || that_present_id) { + if (!(this_present_id && that_present_id)) + return false; + if (this.id != that.id) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_id = true; + list.add(present_id); + if (present_id) + list.add(id); + + return list.hashCode(); + } + + @Override + public int compareTo(scannerClose_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id); + 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("scannerClose_args("); + boolean first = true; + + sb.append("id:"); + sb.append(this.id); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 { + // 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); + } + } + + private static class scannerClose_argsStandardSchemeFactory implements SchemeFactory { + public scannerClose_argsStandardScheme getScheme() { + return new scannerClose_argsStandardScheme(); + } + } + + private static class scannerClose_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, scannerClose_args 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: // ID + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.id = iprot.readI32(); + struct.setIdIsSet(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, scannerClose_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(ID_FIELD_DESC); + oprot.writeI32(struct.id); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class scannerClose_argsTupleSchemeFactory implements SchemeFactory { + public scannerClose_argsTupleScheme getScheme() { + return new scannerClose_argsTupleScheme(); + } + } + + private static class scannerClose_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, scannerClose_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetId()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetId()) { + oprot.writeI32(struct.id); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, scannerClose_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.id = iprot.readI32(); + struct.setIdIsSet(true); + } + } + } + + } + + public static class scannerClose_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("scannerClose_result"); + + private static final org.apache.thrift.protocol.TField IO_FIELD_DESC = new org.apache.thrift.protocol.TField("io", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final org.apache.thrift.protocol.TField IA_FIELD_DESC = new org.apache.thrift.protocol.TField("ia", org.apache.thrift.protocol.TType.STRUCT, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new scannerClose_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new scannerClose_resultTupleSchemeFactory()); + } + + public IOError io; // required + public IllegalArgument ia; // 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 { + IO((short)1, "io"), + IA((short)2, "ia"); + + private static final Map byName = new HashMap(); + + 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: // IO + return IO; + case 2: // IA + return IA; + 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.IO, new org.apache.thrift.meta_data.FieldMetaData("io", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + tmpMap.put(_Fields.IA, new org.apache.thrift.meta_data.FieldMetaData("ia", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(scannerClose_result.class, metaDataMap); + } + + public scannerClose_result() { + } + + public scannerClose_result( + IOError io, + IllegalArgument ia) + { + this(); + this.io = io; + this.ia = ia; + } + + /** + * Performs a deep copy on other. + */ + public scannerClose_result(scannerClose_result other) { + if (other.isSetIo()) { + this.io = new IOError(other.io); + } + if (other.isSetIa()) { + this.ia = new IllegalArgument(other.ia); + } + } + + public scannerClose_result deepCopy() { + return new scannerClose_result(this); + } + + @Override + public void clear() { + this.io = null; + this.ia = null; + } + + public IOError getIo() { + return this.io; + } + + public scannerClose_result setIo(IOError io) { + this.io = io; + return this; + } + + public void unsetIo() { + this.io = null; + } + + /** Returns true if field io is set (has been assigned a value) and false otherwise */ + public boolean isSetIo() { + return this.io != null; + } + + public void setIoIsSet(boolean value) { + if (!value) { + this.io = null; + } + } + + public IllegalArgument getIa() { + return this.ia; + } + + public scannerClose_result setIa(IllegalArgument ia) { + this.ia = ia; + return this; + } + + public void unsetIa() { + this.ia = null; + } + + /** Returns true if field ia is set (has been assigned a value) and false otherwise */ + public boolean isSetIa() { + return this.ia != null; + } + + public void setIaIsSet(boolean value) { + if (!value) { + this.ia = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case IO: + if (value == null) { + unsetIo(); + } else { + setIo((IOError)value); + } + break; + + case IA: + if (value == null) { + unsetIa(); + } else { + setIa((IllegalArgument)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case IO: + return getIo(); + + case IA: + return getIa(); + + } + 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 IO: + return isSetIo(); + case IA: + return isSetIa(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof scannerClose_result) + return this.equals((scannerClose_result)that); + return false; + } + + public boolean equals(scannerClose_result that) { + if (that == null) + return false; + + boolean this_present_io = true && this.isSetIo(); + boolean that_present_io = true && that.isSetIo(); + if (this_present_io || that_present_io) { + if (!(this_present_io && that_present_io)) + return false; + if (!this.io.equals(that.io)) + return false; + } + + boolean this_present_ia = true && this.isSetIa(); + boolean that_present_ia = true && that.isSetIa(); + if (this_present_ia || that_present_ia) { + if (!(this_present_ia && that_present_ia)) + return false; + if (!this.ia.equals(that.ia)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_io = true && (isSetIo()); + list.add(present_io); + if (present_io) + list.add(io); + + boolean present_ia = true && (isSetIa()); + list.add(present_ia); + if (present_ia) + list.add(ia); + + return list.hashCode(); + } + + @Override + public int compareTo(scannerClose_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetIo()).compareTo(other.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, other.io); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIa()).compareTo(other.isSetIa()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIa()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ia, other.ia); + 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("scannerClose_result("); + boolean first = true; + + sb.append("io:"); + if (this.io == null) { + sb.append("null"); + } else { + sb.append(this.io); + } + first = false; + if (!first) sb.append(", "); + sb.append("ia:"); + if (this.ia == null) { + sb.append("null"); + } else { + sb.append(this.ia); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 scannerClose_resultStandardSchemeFactory implements SchemeFactory { + public scannerClose_resultStandardScheme getScheme() { + return new scannerClose_resultStandardScheme(); + } + } + + private static class scannerClose_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, scannerClose_result 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: // IO + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // IA + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ia = new IllegalArgument(); + struct.ia.read(iprot); + struct.setIaIsSet(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, scannerClose_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.io != null) { + oprot.writeFieldBegin(IO_FIELD_DESC); + struct.io.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.ia != null) { + oprot.writeFieldBegin(IA_FIELD_DESC); + struct.ia.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class scannerClose_resultTupleSchemeFactory implements SchemeFactory { + public scannerClose_resultTupleScheme getScheme() { + return new scannerClose_resultTupleScheme(); + } + } + + private static class scannerClose_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, scannerClose_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetIo()) { + optionals.set(0); + } + if (struct.isSetIa()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetIo()) { + struct.io.write(oprot); + } + if (struct.isSetIa()) { + struct.ia.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, scannerClose_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } + if (incoming.get(1)) { + struct.ia = new IllegalArgument(); + struct.ia.read(iprot); + struct.setIaIsSet(true); + } + } + } + + } + + public static class getRegionInfo_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getRegionInfo_args"); + + 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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getRegionInfo_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getRegionInfo_argsTupleSchemeFactory()); + } + + /** + * row key + */ + public ByteBuffer row; // 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 { + /** + * row key + */ + ROW((short)1, "row"); + + private static final Map byName = new HashMap(); + + 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: // ROW + return ROW; + 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.ROW, new org.apache.thrift.meta_data.FieldMetaData("row", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRegionInfo_args.class, metaDataMap); + } + + public getRegionInfo_args() { + } + + public getRegionInfo_args( + ByteBuffer row) + { + this(); + this.row = org.apache.thrift.TBaseHelper.copyBinary(row); + } + + /** + * Performs a deep copy on other. + */ + public getRegionInfo_args(getRegionInfo_args other) { + if (other.isSetRow()) { + this.row = other.row; + } + } + + public getRegionInfo_args deepCopy() { + return new getRegionInfo_args(this); + } + + @Override + public void clear() { + this.row = null; + } + + /** + * row key + */ + public byte[] getRow() { + setRow(org.apache.thrift.TBaseHelper.rightSize(row)); + return row == null ? null : row.array(); + } + + public ByteBuffer bufferForRow() { + return org.apache.thrift.TBaseHelper.copyBinary(row); + } + + /** + * row key + */ + public getRegionInfo_args setRow(byte[] row) { + this.row = row == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(row, row.length)); + return this; + } + + public getRegionInfo_args setRow(ByteBuffer row) { + this.row = org.apache.thrift.TBaseHelper.copyBinary(row); + return this; + } + + public void unsetRow() { + this.row = null; + } + + /** Returns true if field row is set (has been assigned a value) and false otherwise */ + public boolean isSetRow() { + return this.row != null; + } + + public void setRowIsSet(boolean value) { + if (!value) { + this.row = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case ROW: + if (value == null) { + unsetRow(); + } else { + setRow((ByteBuffer)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case ROW: + return getRow(); + + } + 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 ROW: + return isSetRow(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getRegionInfo_args) + return this.equals((getRegionInfo_args)that); + return false; + } + + public boolean equals(getRegionInfo_args that) { + if (that == null) + return false; + + boolean this_present_row = true && this.isSetRow(); + boolean that_present_row = true && that.isSetRow(); + if (this_present_row || that_present_row) { + if (!(this_present_row && that_present_row)) + return false; + if (!this.row.equals(that.row)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_row = true && (isSetRow()); + list.add(present_row); + if (present_row) + list.add(row); + + return list.hashCode(); + } + + @Override + public int compareTo(getRegionInfo_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetRow()).compareTo(other.isSetRow()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRow()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.row, other.row); + 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("getRegionInfo_args("); + boolean first = true; + + sb.append("row:"); + if (this.row == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.row, sb); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 getRegionInfo_argsStandardSchemeFactory implements SchemeFactory { + public getRegionInfo_argsStandardScheme getScheme() { + return new getRegionInfo_argsStandardScheme(); + } + } + + private static class getRegionInfo_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getRegionInfo_args 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: // ROW + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.row = iprot.readBinary(); + struct.setRowIsSet(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, getRegionInfo_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.row != null) { + oprot.writeFieldBegin(ROW_FIELD_DESC); + oprot.writeBinary(struct.row); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getRegionInfo_argsTupleSchemeFactory implements SchemeFactory { + public getRegionInfo_argsTupleScheme getScheme() { + return new getRegionInfo_argsTupleScheme(); + } + } + + private static class getRegionInfo_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getRegionInfo_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetRow()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetRow()) { + oprot.writeBinary(struct.row); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getRegionInfo_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.row = iprot.readBinary(); + struct.setRowIsSet(true); + } + } + } + + } + + public static class getRegionInfo_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getRegionInfo_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); + private static final org.apache.thrift.protocol.TField IO_FIELD_DESC = new org.apache.thrift.protocol.TField("io", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getRegionInfo_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getRegionInfo_resultTupleSchemeFactory()); + } + + public TRegionInfo success; // required + public IOError io; // 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 { + SUCCESS((short)0, "success"), + IO((short)1, "io"); + + private static final Map byName = new HashMap(); + + 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 0: // SUCCESS + return SUCCESS; + case 1: // IO + return IO; + 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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TRegionInfo.class))); + tmpMap.put(_Fields.IO, new org.apache.thrift.meta_data.FieldMetaData("io", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRegionInfo_result.class, metaDataMap); + } + + public getRegionInfo_result() { + } + + public getRegionInfo_result( + TRegionInfo success, + IOError io) + { + this(); + this.success = success; + this.io = io; + } + + /** + * Performs a deep copy on other. + */ + public getRegionInfo_result(getRegionInfo_result other) { + if (other.isSetSuccess()) { + this.success = new TRegionInfo(other.success); + } + if (other.isSetIo()) { + this.io = new IOError(other.io); + } + } + + public getRegionInfo_result deepCopy() { + return new getRegionInfo_result(this); + } + + @Override + public void clear() { + this.success = null; + this.io = null; + } + + public TRegionInfo getSuccess() { + return this.success; + } + + public getRegionInfo_result setSuccess(TRegionInfo success) { + this.success = success; + return this; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public IOError getIo() { + return this.io; + } + + public getRegionInfo_result setIo(IOError io) { + this.io = io; + return this; + } + + public void unsetIo() { + this.io = null; + } + + /** Returns true if field io is set (has been assigned a value) and false otherwise */ + public boolean isSetIo() { + return this.io != null; + } + + public void setIoIsSet(boolean value) { + if (!value) { + this.io = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((TRegionInfo)value); + } + break; + + case IO: + if (value == null) { + unsetIo(); + } else { + setIo((IOError)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + case IO: + return getIo(); + + } + 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 SUCCESS: + return isSetSuccess(); + case IO: + return isSetIo(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getRegionInfo_result) + return this.equals((getRegionInfo_result)that); + return false; + } + + public boolean equals(getRegionInfo_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + boolean this_present_io = true && this.isSetIo(); + boolean that_present_io = true && that.isSetIo(); + if (this_present_io || that_present_io) { + if (!(this_present_io && that_present_io)) + return false; + if (!this.io.equals(that.io)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + boolean present_io = true && (isSetIo()); + list.add(present_io); + if (present_io) + list.add(io); + + return list.hashCode(); + } + + @Override + public int compareTo(getRegionInfo_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIo()).compareTo(other.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, other.io); + 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("getRegionInfo_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + if (!first) sb.append(", "); + sb.append("io:"); + if (this.io == null) { + sb.append("null"); + } else { + sb.append(this.io); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + if (success != null) { + success.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 getRegionInfo_resultStandardSchemeFactory implements SchemeFactory { + public getRegionInfo_resultStandardScheme getScheme() { + return new getRegionInfo_resultStandardScheme(); + } + } + + private static class getRegionInfo_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getRegionInfo_result 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 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.success = new TRegionInfo(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IO + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(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, getRegionInfo_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + struct.success.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.io != null) { + oprot.writeFieldBegin(IO_FIELD_DESC); + struct.io.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getRegionInfo_resultTupleSchemeFactory implements SchemeFactory { + public getRegionInfo_resultTupleScheme getScheme() { + return new getRegionInfo_resultTupleScheme(); + } + } + + private static class getRegionInfo_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getRegionInfo_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIo()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + struct.success.write(oprot); + } + if (struct.isSetIo()) { + struct.io.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getRegionInfo_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.success = new TRegionInfo(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } + } + } + + } + + public static class append_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("append_args"); + + private static final org.apache.thrift.protocol.TField APPEND_FIELD_DESC = new org.apache.thrift.protocol.TField("append", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new append_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new append_argsTupleSchemeFactory()); + } + + /** + * The single append operation to apply + */ + public TAppend append; // 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 { + /** + * The single append operation to apply + */ + APPEND((short)1, "append"); + + private static final Map byName = new HashMap(); + + 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: // APPEND + return APPEND; + 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.APPEND, new org.apache.thrift.meta_data.FieldMetaData("append", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TAppend.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(append_args.class, metaDataMap); + } + + public append_args() { + } + + public append_args( + TAppend append) + { + this(); + this.append = append; + } + + /** + * Performs a deep copy on other. + */ + public append_args(append_args other) { + if (other.isSetAppend()) { + this.append = new TAppend(other.append); + } + } + + public append_args deepCopy() { + return new append_args(this); + } + + @Override + public void clear() { + this.append = null; + } + + /** + * The single append operation to apply + */ + public TAppend getAppend() { + return this.append; + } + + /** + * The single append operation to apply + */ + public append_args setAppend(TAppend append) { + this.append = append; + return this; + } + + public void unsetAppend() { + this.append = null; + } + + /** Returns true if field append is set (has been assigned a value) and false otherwise */ + public boolean isSetAppend() { + return this.append != null; + } + + public void setAppendIsSet(boolean value) { + if (!value) { + this.append = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case APPEND: + if (value == null) { + unsetAppend(); + } else { + setAppend((TAppend)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case APPEND: + return getAppend(); + + } + 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 APPEND: + return isSetAppend(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof append_args) + return this.equals((append_args)that); + return false; + } + + public boolean equals(append_args that) { + if (that == null) + return false; + + boolean this_present_append = true && this.isSetAppend(); + boolean that_present_append = true && that.isSetAppend(); + if (this_present_append || that_present_append) { + if (!(this_present_append && that_present_append)) + return false; + if (!this.append.equals(that.append)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_append = true && (isSetAppend()); + list.add(present_append); + if (present_append) + list.add(append); + + return list.hashCode(); + } + + @Override + public int compareTo(append_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetAppend()).compareTo(other.isSetAppend()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetAppend()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.append, other.append); + 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("append_args("); + boolean first = true; + + sb.append("append:"); + if (this.append == null) { + sb.append("null"); + } else { + sb.append(this.append); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + if (append != null) { + append.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 append_argsStandardSchemeFactory implements SchemeFactory { + public append_argsStandardScheme getScheme() { + return new append_argsStandardScheme(); + } + } + + private static class append_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, append_args 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: // APPEND + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.append = new TAppend(); + struct.append.read(iprot); + struct.setAppendIsSet(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, append_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.append != null) { + oprot.writeFieldBegin(APPEND_FIELD_DESC); + struct.append.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class append_argsTupleSchemeFactory implements SchemeFactory { + public append_argsTupleScheme getScheme() { + return new append_argsTupleScheme(); + } + } + + private static class append_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, append_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetAppend()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetAppend()) { + struct.append.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, append_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.append = new TAppend(); + struct.append.read(iprot); + struct.setAppendIsSet(true); + } + } + } + + } + + public static class append_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("append_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0); + private static final org.apache.thrift.protocol.TField IO_FIELD_DESC = new org.apache.thrift.protocol.TField("io", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new append_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new append_resultTupleSchemeFactory()); + } + + public List success; // required + public IOError io; // 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 { + SUCCESS((short)0, "success"), + IO((short)1, "io"); + + private static final Map byName = new HashMap(); + + 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 0: // SUCCESS + return SUCCESS; + case 1: // IO + return IO; + 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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + 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, TCell.class)))); + tmpMap.put(_Fields.IO, new org.apache.thrift.meta_data.FieldMetaData("io", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(append_result.class, metaDataMap); + } + + public append_result() { + } + + public append_result( + List success, + IOError io) + { + this(); + this.success = success; + this.io = io; + } + + /** + * Performs a deep copy on other. + */ + public append_result(append_result other) { + if (other.isSetSuccess()) { + List __this__success = new ArrayList(other.success.size()); + for (TCell other_element : other.success) { + __this__success.add(new TCell(other_element)); + } + this.success = __this__success; + } + if (other.isSetIo()) { + this.io = new IOError(other.io); + } + } + + public append_result deepCopy() { + return new append_result(this); + } + + @Override + public void clear() { + this.success = null; + this.io = null; + } + + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + public java.util.Iterator getSuccessIterator() { + return (this.success == null) ? null : this.success.iterator(); + } + + public void addToSuccess(TCell elem) { + if (this.success == null) { + this.success = new ArrayList(); + } + this.success.add(elem); + } + + public List getSuccess() { + return this.success; + } + + public append_result setSuccess(List success) { + this.success = success; + return this; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public IOError getIo() { + return this.io; + } + + public append_result setIo(IOError io) { + this.io = io; + return this; + } + + public void unsetIo() { + this.io = null; + } + + /** Returns true if field io is set (has been assigned a value) and false otherwise */ + public boolean isSetIo() { + return this.io != null; + } + + public void setIoIsSet(boolean value) { + if (!value) { + this.io = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((List)value); + } + break; + + case IO: + if (value == null) { + unsetIo(); + } else { + setIo((IOError)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + case IO: + return getIo(); + + } + 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 SUCCESS: + return isSetSuccess(); + case IO: + return isSetIo(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof append_result) + return this.equals((append_result)that); + return false; + } + + public boolean equals(append_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + boolean this_present_io = true && this.isSetIo(); + boolean that_present_io = true && that.isSetIo(); + if (this_present_io || that_present_io) { + if (!(this_present_io && that_present_io)) + return false; + if (!this.io.equals(that.io)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + boolean present_io = true && (isSetIo()); + list.add(present_io); + if (present_io) + list.add(io); + + return list.hashCode(); + } + + @Override + public int compareTo(append_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIo()).compareTo(other.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, other.io); + 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("append_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + if (!first) sb.append(", "); + sb.append("io:"); + if (this.io == null) { + sb.append("null"); + } else { + sb.append(this.io); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 append_resultStandardSchemeFactory implements SchemeFactory { + public append_resultStandardScheme getScheme() { + return new append_resultStandardScheme(); + } + } + + private static class append_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, append_result 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 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list582 = iprot.readListBegin(); + struct.success = new ArrayList(_list582.size); + TCell _elem583; + for (int _i584 = 0; _i584 < _list582.size; ++_i584) + { + _elem583 = new TCell(); + _elem583.read(iprot); + struct.success.add(_elem583); + } + iprot.readListEnd(); + } + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IO + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(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, append_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); + for (TCell _iter585 : struct.success) + { + _iter585.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.io != null) { + oprot.writeFieldBegin(IO_FIELD_DESC); + struct.io.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class append_resultTupleSchemeFactory implements SchemeFactory { + public append_resultTupleScheme getScheme() { + return new append_resultTupleScheme(); + } + } + + private static class append_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, append_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIo()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + { + oprot.writeI32(struct.success.size()); + for (TCell _iter586 : struct.success) + { + _iter586.write(oprot); + } + } + } + if (struct.isSetIo()) { + struct.io.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, append_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list587 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new ArrayList(_list587.size); + TCell _elem588; + for (int _i589 = 0; _i589 < _list587.size; ++_i589) + { + _elem588 = new TCell(); + _elem588.read(iprot); + struct.success.add(_elem588); + } + } + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } + } + } + + } + + public static class checkAndPut_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("checkAndPut_args"); + + private static final org.apache.thrift.protocol.TField TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tableName", org.apache.thrift.protocol.TType.STRING, (short)1); + 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)2); + private static final org.apache.thrift.protocol.TField COLUMN_FIELD_DESC = new org.apache.thrift.protocol.TField("column", org.apache.thrift.protocol.TType.STRING, (short)3); + 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)5); + private static final org.apache.thrift.protocol.TField MPUT_FIELD_DESC = new org.apache.thrift.protocol.TField("mput", org.apache.thrift.protocol.TType.STRUCT, (short)6); + 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)7); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new checkAndPut_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new checkAndPut_argsTupleSchemeFactory()); + } + + /** + * name of table + */ + public ByteBuffer tableName; // required + /** + * row key + */ + public ByteBuffer row; // required + /** + * column name + */ + public ByteBuffer column; // required + /** + * the expected value for the column parameter, if not + * provided the check is for the non-existence of the + * column in question + */ + public ByteBuffer value; // required + /** + * mutation for the put + */ + public Mutation mput; // required + /** + * Mutation attributes + */ + public Map attributes; // 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 { + /** + * name of table + */ + TABLE_NAME((short)1, "tableName"), + /** + * row key + */ + ROW((short)2, "row"), + /** + * column name + */ + COLUMN((short)3, "column"), + /** + * the expected value for the column parameter, if not + * provided the check is for the non-existence of the + * column in question + */ + VALUE((short)5, "value"), + /** + * mutation for the put + */ + MPUT((short)6, "mput"), + /** + * Mutation attributes + */ + ATTRIBUTES((short)7, "attributes"); + + private static final Map byName = new HashMap(); + + 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: // ROW + return ROW; + case 3: // COLUMN + return COLUMN; + case 5: // VALUE + return VALUE; + case 6: // MPUT + return MPUT; + case 7: // ATTRIBUTES + return ATTRIBUTES; + 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.TABLE_NAME, new org.apache.thrift.meta_data.FieldMetaData("tableName", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.ROW, new org.apache.thrift.meta_data.FieldMetaData("row", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.COLUMN, new org.apache.thrift.meta_data.FieldMetaData("column", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.MPUT, new org.apache.thrift.meta_data.FieldMetaData("mput", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Mutation.class))); + tmpMap.put(_Fields.ATTRIBUTES, new org.apache.thrift.meta_data.FieldMetaData("attributes", org.apache.thrift.TFieldRequirementType.DEFAULT, + 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 , "Text"), + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text")))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(checkAndPut_args.class, metaDataMap); + } + + public checkAndPut_args() { + } + + public checkAndPut_args( + ByteBuffer tableName, + ByteBuffer row, + ByteBuffer column, + ByteBuffer value, + Mutation mput, + Map attributes) + { + this(); + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(tableName); + this.row = org.apache.thrift.TBaseHelper.copyBinary(row); + this.column = org.apache.thrift.TBaseHelper.copyBinary(column); + this.value = org.apache.thrift.TBaseHelper.copyBinary(value); + this.mput = mput; + this.attributes = attributes; + } + + /** + * Performs a deep copy on other. + */ + public checkAndPut_args(checkAndPut_args other) { + if (other.isSetTableName()) { + this.tableName = other.tableName; + } + if (other.isSetRow()) { + this.row = other.row; + } + if (other.isSetColumn()) { + this.column = other.column; + } + if (other.isSetValue()) { + this.value = other.value; + } + if (other.isSetMput()) { + this.mput = new Mutation(other.mput); + } + if (other.isSetAttributes()) { + Map __this__attributes = new HashMap(other.attributes.size()); + for (Map.Entry other_element : other.attributes.entrySet()) { + + ByteBuffer other_element_key = other_element.getKey(); + ByteBuffer other_element_value = other_element.getValue(); + + ByteBuffer __this__attributes_copy_key = other_element_key; + + ByteBuffer __this__attributes_copy_value = other_element_value; + + __this__attributes.put(__this__attributes_copy_key, __this__attributes_copy_value); + } + this.attributes = __this__attributes; + } + } + + public checkAndPut_args deepCopy() { + return new checkAndPut_args(this); + } + + @Override + public void clear() { + this.tableName = null; + this.row = null; + this.column = null; + this.value = null; + this.mput = null; + this.attributes = null; + } + + /** + * name of table + */ + public byte[] getTableName() { + setTableName(org.apache.thrift.TBaseHelper.rightSize(tableName)); + return tableName == null ? null : tableName.array(); + } + + public ByteBuffer bufferForTableName() { + return org.apache.thrift.TBaseHelper.copyBinary(tableName); + } + + /** + * name of table + */ + public checkAndPut_args setTableName(byte[] tableName) { + this.tableName = tableName == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(tableName, tableName.length)); + return this; + } + + public checkAndPut_args setTableName(ByteBuffer tableName) { + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(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; + } + } + + /** + * row key + */ + public byte[] getRow() { + setRow(org.apache.thrift.TBaseHelper.rightSize(row)); + return row == null ? null : row.array(); + } + + public ByteBuffer bufferForRow() { + return org.apache.thrift.TBaseHelper.copyBinary(row); + } + + /** + * row key + */ + public checkAndPut_args setRow(byte[] row) { + this.row = row == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(row, row.length)); + return this; + } + + public checkAndPut_args setRow(ByteBuffer row) { + this.row = org.apache.thrift.TBaseHelper.copyBinary(row); + return this; + } + + public void unsetRow() { + this.row = null; + } + + /** Returns true if field row is set (has been assigned a value) and false otherwise */ + public boolean isSetRow() { + return this.row != null; + } + + public void setRowIsSet(boolean value) { + if (!value) { + this.row = null; + } + } + + /** + * column name + */ + public byte[] getColumn() { + setColumn(org.apache.thrift.TBaseHelper.rightSize(column)); + return column == null ? null : column.array(); + } + + public ByteBuffer bufferForColumn() { + return org.apache.thrift.TBaseHelper.copyBinary(column); + } + + /** + * column name + */ + public checkAndPut_args setColumn(byte[] column) { + this.column = column == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(column, column.length)); + return this; + } + + public checkAndPut_args setColumn(ByteBuffer column) { + this.column = org.apache.thrift.TBaseHelper.copyBinary(column); + return this; + } + + public void unsetColumn() { + this.column = null; + } + + /** Returns true if field column is set (has been assigned a value) and false otherwise */ + public boolean isSetColumn() { + return this.column != null; + } + + public void setColumnIsSet(boolean value) { + if (!value) { + this.column = null; + } + } + + /** + * the expected value for the column parameter, if not + * provided the check is for the non-existence of the + * column in question + */ + public byte[] getValue() { + setValue(org.apache.thrift.TBaseHelper.rightSize(value)); + return value == null ? null : value.array(); + } + + public ByteBuffer bufferForValue() { + return org.apache.thrift.TBaseHelper.copyBinary(value); + } + + /** + * the expected value for the column parameter, if not + * provided the check is for the non-existence of the + * column in question + */ + public checkAndPut_args setValue(byte[] value) { + this.value = value == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(value, value.length)); + return this; + } + + public checkAndPut_args setValue(ByteBuffer value) { + this.value = org.apache.thrift.TBaseHelper.copyBinary(value); + return this; + } + + public void unsetValue() { + this.value = null; + } + + /** Returns true if field value is set (has been assigned a value) and false otherwise */ + public boolean isSetValue() { + return this.value != null; + } + + public void setValueIsSet(boolean value) { + if (!value) { + this.value = null; + } + } + + /** + * mutation for the put + */ + public Mutation getMput() { + return this.mput; + } + + /** + * mutation for the put + */ + public checkAndPut_args setMput(Mutation mput) { + this.mput = mput; + return this; + } + + public void unsetMput() { + this.mput = null; + } + + /** Returns true if field mput is set (has been assigned a value) and false otherwise */ + public boolean isSetMput() { + return this.mput != null; + } + + public void setMputIsSet(boolean value) { + if (!value) { + this.mput = 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(); + } + this.attributes.put(key, val); + } + + /** + * Mutation attributes + */ + public Map getAttributes() { + return this.attributes; + } + + /** + * Mutation attributes + */ + public checkAndPut_args setAttributes(Map 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; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case TABLE_NAME: + if (value == null) { + unsetTableName(); + } else { + setTableName((ByteBuffer)value); + } + break; + + case ROW: + if (value == null) { + unsetRow(); + } else { + setRow((ByteBuffer)value); + } + break; + + case COLUMN: + if (value == null) { + unsetColumn(); + } else { + setColumn((ByteBuffer)value); + } + break; + + case VALUE: + if (value == null) { + unsetValue(); + } else { + setValue((ByteBuffer)value); + } + break; + + case MPUT: + if (value == null) { + unsetMput(); + } else { + setMput((Mutation)value); + } + break; + + case ATTRIBUTES: + if (value == null) { + unsetAttributes(); + } else { + setAttributes((Map)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case TABLE_NAME: + return getTableName(); + + case ROW: + return getRow(); + + case COLUMN: + return getColumn(); + + case VALUE: + return getValue(); + + case MPUT: + return getMput(); + + case ATTRIBUTES: + return getAttributes(); + + } + 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 ROW: + return isSetRow(); + case COLUMN: + return isSetColumn(); + case VALUE: + return isSetValue(); + case MPUT: + return isSetMput(); + case ATTRIBUTES: + return isSetAttributes(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof checkAndPut_args) + return this.equals((checkAndPut_args)that); + return false; + } + + public boolean equals(checkAndPut_args 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_row = true && this.isSetRow(); + boolean that_present_row = true && that.isSetRow(); + if (this_present_row || that_present_row) { + if (!(this_present_row && that_present_row)) + return false; + if (!this.row.equals(that.row)) + return false; + } + + boolean this_present_column = true && this.isSetColumn(); + boolean that_present_column = true && that.isSetColumn(); + if (this_present_column || that_present_column) { + if (!(this_present_column && that_present_column)) + return false; + if (!this.column.equals(that.column)) + return false; + } + + boolean this_present_value = true && this.isSetValue(); + boolean that_present_value = true && that.isSetValue(); + if (this_present_value || that_present_value) { + if (!(this_present_value && that_present_value)) + return false; + if (!this.value.equals(that.value)) + return false; + } + + boolean this_present_mput = true && this.isSetMput(); + boolean that_present_mput = true && that.isSetMput(); + if (this_present_mput || that_present_mput) { + if (!(this_present_mput && that_present_mput)) + return false; + if (!this.mput.equals(that.mput)) + 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; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_tableName = true && (isSetTableName()); + list.add(present_tableName); + if (present_tableName) + list.add(tableName); + + boolean present_row = true && (isSetRow()); + list.add(present_row); + if (present_row) + list.add(row); + + boolean present_column = true && (isSetColumn()); + list.add(present_column); + if (present_column) + list.add(column); + + boolean present_value = true && (isSetValue()); + list.add(present_value); + if (present_value) + list.add(value); + + boolean present_mput = true && (isSetMput()); + list.add(present_mput); + if (present_mput) + list.add(mput); + + boolean present_attributes = true && (isSetAttributes()); + list.add(present_attributes); + if (present_attributes) + list.add(attributes); + + return list.hashCode(); + } + + @Override + public int compareTo(checkAndPut_args 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(isSetRow()).compareTo(other.isSetRow()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRow()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.row, other.row); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetColumn()).compareTo(other.isSetColumn()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetColumn()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.column, other.column); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValue()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, other.value); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetMput()).compareTo(other.isSetMput()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetMput()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.mput, other.mput); + 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; + } + } + 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("checkAndPut_args("); + boolean first = true; + + sb.append("tableName:"); + if (this.tableName == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.tableName, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("row:"); + if (this.row == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.row, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("column:"); + if (this.column == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.column, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("value:"); + if (this.value == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.value, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("mput:"); + if (this.mput == null) { + sb.append("null"); + } else { + sb.append(this.mput); + } + first = false; + if (!first) sb.append(", "); + sb.append("attributes:"); + if (this.attributes == null) { + sb.append("null"); + } else { + sb.append(this.attributes); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + if (mput != null) { + mput.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 checkAndPut_argsStandardSchemeFactory implements SchemeFactory { + public checkAndPut_argsStandardScheme getScheme() { + return new checkAndPut_argsStandardScheme(); + } + } + + private static class checkAndPut_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, checkAndPut_args 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.STRING) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // ROW + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.row = iprot.readBinary(); + struct.setRowIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // COLUMN + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.column = iprot.readBinary(); + struct.setColumnIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // VALUE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.value = iprot.readBinary(); + struct.setValueIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 6: // MPUT + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.mput = new Mutation(); + struct.mput.read(iprot); + struct.setMputIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 7: // ATTRIBUTES + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map590 = iprot.readMapBegin(); + struct.attributes = new HashMap(2*_map590.size); + ByteBuffer _key591; + ByteBuffer _val592; + for (int _i593 = 0; _i593 < _map590.size; ++_i593) + { + _key591 = iprot.readBinary(); + _val592 = iprot.readBinary(); + struct.attributes.put(_key591, _val592); + } + iprot.readMapEnd(); + } + struct.setAttributesIsSet(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, checkAndPut_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.tableName != null) { + oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC); + oprot.writeBinary(struct.tableName); + oprot.writeFieldEnd(); + } + if (struct.row != null) { + oprot.writeFieldBegin(ROW_FIELD_DESC); + oprot.writeBinary(struct.row); + oprot.writeFieldEnd(); + } + if (struct.column != null) { + oprot.writeFieldBegin(COLUMN_FIELD_DESC); + oprot.writeBinary(struct.column); + oprot.writeFieldEnd(); + } + if (struct.value != null) { + oprot.writeFieldBegin(VALUE_FIELD_DESC); + oprot.writeBinary(struct.value); + oprot.writeFieldEnd(); + } + if (struct.mput != null) { + oprot.writeFieldBegin(MPUT_FIELD_DESC); + struct.mput.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.attributes != null) { + 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 _iter594 : struct.attributes.entrySet()) + { + oprot.writeBinary(_iter594.getKey()); + oprot.writeBinary(_iter594.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class checkAndPut_argsTupleSchemeFactory implements SchemeFactory { + public checkAndPut_argsTupleScheme getScheme() { + return new checkAndPut_argsTupleScheme(); + } + } + + private static class checkAndPut_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, checkAndPut_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetTableName()) { + optionals.set(0); + } + if (struct.isSetRow()) { + optionals.set(1); + } + if (struct.isSetColumn()) { + optionals.set(2); + } + if (struct.isSetValue()) { + optionals.set(3); + } + if (struct.isSetMput()) { + optionals.set(4); + } + if (struct.isSetAttributes()) { + optionals.set(5); + } + oprot.writeBitSet(optionals, 6); + if (struct.isSetTableName()) { + oprot.writeBinary(struct.tableName); + } + if (struct.isSetRow()) { + oprot.writeBinary(struct.row); + } + if (struct.isSetColumn()) { + oprot.writeBinary(struct.column); + } + if (struct.isSetValue()) { + oprot.writeBinary(struct.value); + } + if (struct.isSetMput()) { + struct.mput.write(oprot); + } + if (struct.isSetAttributes()) { + { + oprot.writeI32(struct.attributes.size()); + for (Map.Entry _iter595 : struct.attributes.entrySet()) + { + oprot.writeBinary(_iter595.getKey()); + oprot.writeBinary(_iter595.getValue()); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, checkAndPut_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(6); + if (incoming.get(0)) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(true); + } + if (incoming.get(1)) { + struct.row = iprot.readBinary(); + struct.setRowIsSet(true); + } + if (incoming.get(2)) { + struct.column = iprot.readBinary(); + struct.setColumnIsSet(true); + } + if (incoming.get(3)) { + struct.value = iprot.readBinary(); + struct.setValueIsSet(true); + } + if (incoming.get(4)) { + struct.mput = new Mutation(); + struct.mput.read(iprot); + struct.setMputIsSet(true); + } + if (incoming.get(5)) { + { + org.apache.thrift.protocol.TMap _map596 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.attributes = new HashMap(2*_map596.size); + ByteBuffer _key597; + ByteBuffer _val598; + for (int _i599 = 0; _i599 < _map596.size; ++_i599) + { + _key597 = iprot.readBinary(); + _val598 = iprot.readBinary(); + struct.attributes.put(_key597, _val598); + } + } + struct.setAttributesIsSet(true); + } + } + } + + } + + public static class checkAndPut_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("checkAndPut_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0); + private static final org.apache.thrift.protocol.TField IO_FIELD_DESC = new org.apache.thrift.protocol.TField("io", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final org.apache.thrift.protocol.TField IA_FIELD_DESC = new org.apache.thrift.protocol.TField("ia", org.apache.thrift.protocol.TType.STRUCT, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new checkAndPut_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new checkAndPut_resultTupleSchemeFactory()); + } + + public boolean success; // required + public IOError io; // required + public IllegalArgument ia; // 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 { + SUCCESS((short)0, "success"), + IO((short)1, "io"), + IA((short)2, "ia"); + + private static final Map byName = new HashMap(); + + 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 0: // SUCCESS + return SUCCESS; + case 1: // IO + return IO; + case 2: // IA + return IA; + 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 int __SUCCESS_ISSET_ID = 0; + private byte __isset_bitfield = 0; + 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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + tmpMap.put(_Fields.IO, new org.apache.thrift.meta_data.FieldMetaData("io", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + tmpMap.put(_Fields.IA, new org.apache.thrift.meta_data.FieldMetaData("ia", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(checkAndPut_result.class, metaDataMap); + } + + public checkAndPut_result() { + } + + public checkAndPut_result( + boolean success, + IOError io, + IllegalArgument ia) + { + this(); + this.success = success; + setSuccessIsSet(true); + this.io = io; + this.ia = ia; + } + + /** + * Performs a deep copy on other. + */ + public checkAndPut_result(checkAndPut_result other) { + __isset_bitfield = other.__isset_bitfield; + this.success = other.success; + if (other.isSetIo()) { + this.io = new IOError(other.io); + } + if (other.isSetIa()) { + this.ia = new IllegalArgument(other.ia); + } + } + + public checkAndPut_result deepCopy() { + return new checkAndPut_result(this); + } + + @Override + public void clear() { + setSuccessIsSet(false); + this.success = false; + this.io = null; + this.ia = null; + } + + public boolean isSuccess() { + return this.success; + } + + public checkAndPut_result setSuccess(boolean success) { + this.success = success; + setSuccessIsSet(true); + return this; + } + + public void unsetSuccess() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + public void setSuccessIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); + } + + public IOError getIo() { + return this.io; + } + + public checkAndPut_result setIo(IOError io) { + this.io = io; + return this; + } + + public void unsetIo() { + this.io = null; + } + + /** Returns true if field io is set (has been assigned a value) and false otherwise */ + public boolean isSetIo() { + return this.io != null; + } + + public void setIoIsSet(boolean value) { + if (!value) { + this.io = null; + } + } + + public IllegalArgument getIa() { + return this.ia; + } + + public checkAndPut_result setIa(IllegalArgument ia) { + this.ia = ia; + return this; + } + + public void unsetIa() { + this.ia = null; + } + + /** Returns true if field ia is set (has been assigned a value) and false otherwise */ + public boolean isSetIa() { + return this.ia != null; + } + + public void setIaIsSet(boolean value) { + if (!value) { + this.ia = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((Boolean)value); + } + break; + + case IO: + if (value == null) { + unsetIo(); + } else { + setIo((IOError)value); + } + break; + + case IA: + if (value == null) { + unsetIa(); + } else { + setIa((IllegalArgument)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return isSuccess(); + + case IO: + return getIo(); + + case IA: + return getIa(); + + } + 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 SUCCESS: + return isSetSuccess(); + case IO: + return isSetIo(); + case IA: + return isSetIa(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof checkAndPut_result) + return this.equals((checkAndPut_result)that); + return false; + } + + public boolean equals(checkAndPut_result that) { + if (that == null) + return false; + + boolean this_present_success = true; + boolean that_present_success = true; + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (this.success != that.success) + return false; + } + + boolean this_present_io = true && this.isSetIo(); + boolean that_present_io = true && that.isSetIo(); + if (this_present_io || that_present_io) { + if (!(this_present_io && that_present_io)) + return false; + if (!this.io.equals(that.io)) + return false; + } + + boolean this_present_ia = true && this.isSetIa(); + boolean that_present_ia = true && that.isSetIa(); + if (this_present_ia || that_present_ia) { + if (!(this_present_ia && that_present_ia)) + return false; + if (!this.ia.equals(that.ia)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true; + list.add(present_success); + if (present_success) + list.add(success); + + boolean present_io = true && (isSetIo()); + list.add(present_io); + if (present_io) + list.add(io); + + boolean present_ia = true && (isSetIa()); + list.add(present_ia); + if (present_ia) + list.add(ia); + + return list.hashCode(); + } + + @Override + public int compareTo(checkAndPut_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIo()).compareTo(other.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, other.io); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIa()).compareTo(other.isSetIa()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIa()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ia, other.ia); + 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("checkAndPut_result("); + boolean first = true; + + sb.append("success:"); + sb.append(this.success); + first = false; + if (!first) sb.append(", "); + sb.append("io:"); + if (this.io == null) { + sb.append("null"); + } else { + sb.append(this.io); + } + first = false; + if (!first) sb.append(", "); + sb.append("ia:"); + if (this.ia == null) { + sb.append("null"); + } else { + sb.append(this.ia); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 { + // 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); + } + } + + private static class checkAndPut_resultStandardSchemeFactory implements SchemeFactory { + public checkAndPut_resultStandardScheme getScheme() { + return new checkAndPut_resultStandardScheme(); + } + } + + private static class checkAndPut_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, checkAndPut_result 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 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IO + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // IA + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ia = new IllegalArgument(); + struct.ia.read(iprot); + struct.setIaIsSet(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, checkAndPut_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeBool(struct.success); + oprot.writeFieldEnd(); + } + if (struct.io != null) { + oprot.writeFieldBegin(IO_FIELD_DESC); + struct.io.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.ia != null) { + oprot.writeFieldBegin(IA_FIELD_DESC); + struct.ia.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class checkAndPut_resultTupleSchemeFactory implements SchemeFactory { + public checkAndPut_resultTupleScheme getScheme() { + return new checkAndPut_resultTupleScheme(); + } + } + + private static class checkAndPut_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, checkAndPut_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIo()) { + optionals.set(1); + } + if (struct.isSetIa()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetSuccess()) { + oprot.writeBool(struct.success); + } + if (struct.isSetIo()) { + struct.io.write(oprot); + } + if (struct.isSetIa()) { + struct.ia.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, checkAndPut_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.io = new IOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } + if (incoming.get(2)) { + struct.ia = new IllegalArgument(); + struct.ia.read(iprot); + struct.setIaIsSet(true); + } + } + } + + } + +} diff --git "a/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/generated/IOError.java" "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/generated/IOError.java" new file mode 100644 index 00000000000..558f3e1cc13 --- /dev/null +++ "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/generated/IOError.java" @@ -0,0 +1,403 @@ +/** + * 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.thrift.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"}) +/** + * An IOError exception signals that an error occurred communicating + * 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") +public class IOError extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("IOError"); + + private static final org.apache.thrift.protocol.TField MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("message", org.apache.thrift.protocol.TType.STRING, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new IOErrorStandardSchemeFactory()); + schemes.put(TupleScheme.class, new IOErrorTupleSchemeFactory()); + } + + public String message; // 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 { + MESSAGE((short)1, "message"); + + private static final Map byName = new HashMap(); + + 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: // MESSAGE + return MESSAGE; + 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.MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("message", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(IOError.class, metaDataMap); + } + + public IOError() { + } + + public IOError( + String message) + { + this(); + this.message = message; + } + + /** + * Performs a deep copy on other. + */ + public IOError(IOError other) { + if (other.isSetMessage()) { + this.message = other.message; + } + } + + public IOError deepCopy() { + return new IOError(this); + } + + @Override + public void clear() { + this.message = null; + } + + public String getMessage() { + return this.message; + } + + public IOError setMessage(String message) { + this.message = message; + return this; + } + + public void unsetMessage() { + this.message = null; + } + + /** Returns true if field message is set (has been assigned a value) and false otherwise */ + public boolean isSetMessage() { + return this.message != null; + } + + public void setMessageIsSet(boolean value) { + if (!value) { + this.message = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case MESSAGE: + if (value == null) { + unsetMessage(); + } else { + setMessage((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case MESSAGE: + return getMessage(); + + } + 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 MESSAGE: + return isSetMessage(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof IOError) + return this.equals((IOError)that); + return false; + } + + public boolean equals(IOError that) { + if (that == null) + return false; + + boolean this_present_message = true && this.isSetMessage(); + boolean that_present_message = true && that.isSetMessage(); + if (this_present_message || that_present_message) { + if (!(this_present_message && that_present_message)) + return false; + if (!this.message.equals(that.message)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_message = true && (isSetMessage()); + list.add(present_message); + if (present_message) + list.add(message); + + return list.hashCode(); + } + + @Override + public int compareTo(IOError other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetMessage()).compareTo(other.isSetMessage()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetMessage()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.message, other.message); + 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("IOError("); + boolean first = true; + + sb.append("message:"); + if (this.message == null) { + sb.append("null"); + } else { + sb.append(this.message); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 IOErrorStandardSchemeFactory implements SchemeFactory { + public IOErrorStandardScheme getScheme() { + return new IOErrorStandardScheme(); + } + } + + private static class IOErrorStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, IOError 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: // MESSAGE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.message = iprot.readString(); + struct.setMessageIsSet(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, IOError struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.message != null) { + oprot.writeFieldBegin(MESSAGE_FIELD_DESC); + oprot.writeString(struct.message); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class IOErrorTupleSchemeFactory implements SchemeFactory { + public IOErrorTupleScheme getScheme() { + return new IOErrorTupleScheme(); + } + } + + private static class IOErrorTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, IOError struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetMessage()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetMessage()) { + oprot.writeString(struct.message); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, IOError struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.message = iprot.readString(); + struct.setMessageIsSet(true); + } + } + } + +} + diff --git "a/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/generated/IllegalArgument.java" "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/generated/IllegalArgument.java" new file mode 100644 index 00000000000..bd296cca3d8 --- /dev/null +++ "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/generated/IllegalArgument.java" @@ -0,0 +1,402 @@ +/** + * 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.thrift.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"}) +/** + * 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") +public class IllegalArgument extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("IllegalArgument"); + + private static final org.apache.thrift.protocol.TField MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("message", org.apache.thrift.protocol.TType.STRING, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new IllegalArgumentStandardSchemeFactory()); + schemes.put(TupleScheme.class, new IllegalArgumentTupleSchemeFactory()); + } + + public String message; // 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 { + MESSAGE((short)1, "message"); + + private static final Map byName = new HashMap(); + + 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: // MESSAGE + return MESSAGE; + 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.MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("message", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(IllegalArgument.class, metaDataMap); + } + + public IllegalArgument() { + } + + public IllegalArgument( + String message) + { + this(); + this.message = message; + } + + /** + * Performs a deep copy on other. + */ + public IllegalArgument(IllegalArgument other) { + if (other.isSetMessage()) { + this.message = other.message; + } + } + + public IllegalArgument deepCopy() { + return new IllegalArgument(this); + } + + @Override + public void clear() { + this.message = null; + } + + public String getMessage() { + return this.message; + } + + public IllegalArgument setMessage(String message) { + this.message = message; + return this; + } + + public void unsetMessage() { + this.message = null; + } + + /** Returns true if field message is set (has been assigned a value) and false otherwise */ + public boolean isSetMessage() { + return this.message != null; + } + + public void setMessageIsSet(boolean value) { + if (!value) { + this.message = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case MESSAGE: + if (value == null) { + unsetMessage(); + } else { + setMessage((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case MESSAGE: + return getMessage(); + + } + 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 MESSAGE: + return isSetMessage(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof IllegalArgument) + return this.equals((IllegalArgument)that); + return false; + } + + public boolean equals(IllegalArgument that) { + if (that == null) + return false; + + boolean this_present_message = true && this.isSetMessage(); + boolean that_present_message = true && that.isSetMessage(); + if (this_present_message || that_present_message) { + if (!(this_present_message && that_present_message)) + return false; + if (!this.message.equals(that.message)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_message = true && (isSetMessage()); + list.add(present_message); + if (present_message) + list.add(message); + + return list.hashCode(); + } + + @Override + public int compareTo(IllegalArgument other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetMessage()).compareTo(other.isSetMessage()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetMessage()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.message, other.message); + 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("IllegalArgument("); + boolean first = true; + + sb.append("message:"); + if (this.message == null) { + sb.append("null"); + } else { + sb.append(this.message); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 IllegalArgumentStandardSchemeFactory implements SchemeFactory { + public IllegalArgumentStandardScheme getScheme() { + return new IllegalArgumentStandardScheme(); + } + } + + private static class IllegalArgumentStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, IllegalArgument 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: // MESSAGE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.message = iprot.readString(); + struct.setMessageIsSet(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, IllegalArgument struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.message != null) { + oprot.writeFieldBegin(MESSAGE_FIELD_DESC); + oprot.writeString(struct.message); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class IllegalArgumentTupleSchemeFactory implements SchemeFactory { + public IllegalArgumentTupleScheme getScheme() { + return new IllegalArgumentTupleScheme(); + } + } + + private static class IllegalArgumentTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, IllegalArgument struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetMessage()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetMessage()) { + oprot.writeString(struct.message); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, IllegalArgument struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.message = iprot.readString(); + struct.setMessageIsSet(true); + } + } + } + +} + diff --git "a/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/generated/Mutation.java" "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/generated/Mutation.java" new file mode 100644 index 00000000000..216df2d197d --- /dev/null +++ "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/generated/Mutation.java" @@ -0,0 +1,732 @@ +/** + * 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.thrift.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"}) +/** + * 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") +public class Mutation implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Mutation"); + + private static final org.apache.thrift.protocol.TField IS_DELETE_FIELD_DESC = new org.apache.thrift.protocol.TField("isDelete", org.apache.thrift.protocol.TType.BOOL, (short)1); + private static final org.apache.thrift.protocol.TField COLUMN_FIELD_DESC = new org.apache.thrift.protocol.TField("column", org.apache.thrift.protocol.TType.STRING, (short)2); + 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 WRITE_TO_WAL_FIELD_DESC = new org.apache.thrift.protocol.TField("writeToWAL", org.apache.thrift.protocol.TType.BOOL, (short)4); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new MutationStandardSchemeFactory()); + schemes.put(TupleScheme.class, new MutationTupleSchemeFactory()); + } + + public boolean isDelete; // required + public ByteBuffer column; // required + public ByteBuffer value; // required + public boolean writeToWAL; // 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 { + IS_DELETE((short)1, "isDelete"), + COLUMN((short)2, "column"), + VALUE((short)3, "value"), + WRITE_TO_WAL((short)4, "writeToWAL"); + + private static final Map byName = new HashMap(); + + 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: // IS_DELETE + return IS_DELETE; + case 2: // COLUMN + return COLUMN; + case 3: // VALUE + return VALUE; + case 4: // WRITE_TO_WAL + return WRITE_TO_WAL; + 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 int __ISDELETE_ISSET_ID = 0; + private static final int __WRITETOWAL_ISSET_ID = 1; + private byte __isset_bitfield = 0; + 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.IS_DELETE, new org.apache.thrift.meta_data.FieldMetaData("isDelete", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + tmpMap.put(_Fields.COLUMN, new org.apache.thrift.meta_data.FieldMetaData("column", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.WRITE_TO_WAL, new org.apache.thrift.meta_data.FieldMetaData("writeToWAL", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Mutation.class, metaDataMap); + } + + public Mutation() { + this.isDelete = false; + + this.writeToWAL = true; + + } + + public Mutation( + boolean isDelete, + ByteBuffer column, + ByteBuffer value, + boolean writeToWAL) + { + this(); + this.isDelete = isDelete; + setIsDeleteIsSet(true); + this.column = org.apache.thrift.TBaseHelper.copyBinary(column); + this.value = org.apache.thrift.TBaseHelper.copyBinary(value); + this.writeToWAL = writeToWAL; + setWriteToWALIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public Mutation(Mutation other) { + __isset_bitfield = other.__isset_bitfield; + this.isDelete = other.isDelete; + if (other.isSetColumn()) { + this.column = other.column; + } + if (other.isSetValue()) { + this.value = other.value; + } + this.writeToWAL = other.writeToWAL; + } + + public Mutation deepCopy() { + return new Mutation(this); + } + + @Override + public void clear() { + this.isDelete = false; + + this.column = null; + this.value = null; + this.writeToWAL = true; + + } + + public boolean isIsDelete() { + return this.isDelete; + } + + public Mutation setIsDelete(boolean isDelete) { + this.isDelete = isDelete; + setIsDeleteIsSet(true); + return this; + } + + public void unsetIsDelete() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ISDELETE_ISSET_ID); + } + + /** Returns true if field isDelete is set (has been assigned a value) and false otherwise */ + public boolean isSetIsDelete() { + return EncodingUtils.testBit(__isset_bitfield, __ISDELETE_ISSET_ID); + } + + public void setIsDeleteIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ISDELETE_ISSET_ID, value); + } + + public byte[] getColumn() { + setColumn(org.apache.thrift.TBaseHelper.rightSize(column)); + return column == null ? null : column.array(); + } + + public ByteBuffer bufferForColumn() { + return org.apache.thrift.TBaseHelper.copyBinary(column); + } + + public Mutation setColumn(byte[] column) { + this.column = column == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(column, column.length)); + return this; + } + + public Mutation setColumn(ByteBuffer column) { + this.column = org.apache.thrift.TBaseHelper.copyBinary(column); + return this; + } + + public void unsetColumn() { + this.column = null; + } + + /** Returns true if field column is set (has been assigned a value) and false otherwise */ + public boolean isSetColumn() { + return this.column != null; + } + + public void setColumnIsSet(boolean value) { + if (!value) { + this.column = null; + } + } + + public byte[] getValue() { + setValue(org.apache.thrift.TBaseHelper.rightSize(value)); + return value == null ? null : value.array(); + } + + public ByteBuffer bufferForValue() { + return org.apache.thrift.TBaseHelper.copyBinary(value); + } + + public Mutation setValue(byte[] value) { + this.value = value == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(value, value.length)); + return this; + } + + public Mutation setValue(ByteBuffer value) { + this.value = org.apache.thrift.TBaseHelper.copyBinary(value); + return this; + } + + public void unsetValue() { + this.value = null; + } + + /** Returns true if field value is set (has been assigned a value) and false otherwise */ + public boolean isSetValue() { + return this.value != null; + } + + public void setValueIsSet(boolean value) { + if (!value) { + this.value = null; + } + } + + public boolean isWriteToWAL() { + return this.writeToWAL; + } + + public Mutation setWriteToWAL(boolean writeToWAL) { + this.writeToWAL = writeToWAL; + setWriteToWALIsSet(true); + return this; + } + + public void unsetWriteToWAL() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __WRITETOWAL_ISSET_ID); + } + + /** Returns true if field writeToWAL is set (has been assigned a value) and false otherwise */ + public boolean isSetWriteToWAL() { + return EncodingUtils.testBit(__isset_bitfield, __WRITETOWAL_ISSET_ID); + } + + public void setWriteToWALIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __WRITETOWAL_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case IS_DELETE: + if (value == null) { + unsetIsDelete(); + } else { + setIsDelete((Boolean)value); + } + break; + + case COLUMN: + if (value == null) { + unsetColumn(); + } else { + setColumn((ByteBuffer)value); + } + break; + + case VALUE: + if (value == null) { + unsetValue(); + } else { + setValue((ByteBuffer)value); + } + break; + + case WRITE_TO_WAL: + if (value == null) { + unsetWriteToWAL(); + } else { + setWriteToWAL((Boolean)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case IS_DELETE: + return isIsDelete(); + + case COLUMN: + return getColumn(); + + case VALUE: + return getValue(); + + case WRITE_TO_WAL: + return isWriteToWAL(); + + } + 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 IS_DELETE: + return isSetIsDelete(); + case COLUMN: + return isSetColumn(); + case VALUE: + return isSetValue(); + case WRITE_TO_WAL: + return isSetWriteToWAL(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof Mutation) + return this.equals((Mutation)that); + return false; + } + + public boolean equals(Mutation that) { + if (that == null) + return false; + + boolean this_present_isDelete = true; + boolean that_present_isDelete = true; + if (this_present_isDelete || that_present_isDelete) { + if (!(this_present_isDelete && that_present_isDelete)) + return false; + if (this.isDelete != that.isDelete) + return false; + } + + boolean this_present_column = true && this.isSetColumn(); + boolean that_present_column = true && that.isSetColumn(); + if (this_present_column || that_present_column) { + if (!(this_present_column && that_present_column)) + return false; + if (!this.column.equals(that.column)) + return false; + } + + boolean this_present_value = true && this.isSetValue(); + boolean that_present_value = true && that.isSetValue(); + if (this_present_value || that_present_value) { + if (!(this_present_value && that_present_value)) + return false; + if (!this.value.equals(that.value)) + return false; + } + + boolean this_present_writeToWAL = true; + boolean that_present_writeToWAL = true; + if (this_present_writeToWAL || that_present_writeToWAL) { + if (!(this_present_writeToWAL && that_present_writeToWAL)) + return false; + if (this.writeToWAL != that.writeToWAL) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_isDelete = true; + list.add(present_isDelete); + if (present_isDelete) + list.add(isDelete); + + boolean present_column = true && (isSetColumn()); + list.add(present_column); + if (present_column) + list.add(column); + + boolean present_value = true && (isSetValue()); + list.add(present_value); + if (present_value) + list.add(value); + + boolean present_writeToWAL = true; + list.add(present_writeToWAL); + if (present_writeToWAL) + list.add(writeToWAL); + + return list.hashCode(); + } + + @Override + public int compareTo(Mutation other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetIsDelete()).compareTo(other.isSetIsDelete()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIsDelete()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isDelete, other.isDelete); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetColumn()).compareTo(other.isSetColumn()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetColumn()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.column, other.column); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValue()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, other.value); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetWriteToWAL()).compareTo(other.isSetWriteToWAL()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetWriteToWAL()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.writeToWAL, other.writeToWAL); + 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("Mutation("); + boolean first = true; + + sb.append("isDelete:"); + sb.append(this.isDelete); + first = false; + if (!first) sb.append(", "); + sb.append("column:"); + if (this.column == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.column, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("value:"); + if (this.value == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.value, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("writeToWAL:"); + sb.append(this.writeToWAL); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 { + // 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); + } + } + + private static class MutationStandardSchemeFactory implements SchemeFactory { + public MutationStandardScheme getScheme() { + return new MutationStandardScheme(); + } + } + + private static class MutationStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, Mutation 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: // IS_DELETE + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.isDelete = iprot.readBool(); + struct.setIsDeleteIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // COLUMN + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.column = iprot.readBinary(); + struct.setColumnIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // VALUE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.value = iprot.readBinary(); + struct.setValueIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // WRITE_TO_WAL + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.writeToWAL = iprot.readBool(); + struct.setWriteToWALIsSet(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, Mutation struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(IS_DELETE_FIELD_DESC); + oprot.writeBool(struct.isDelete); + oprot.writeFieldEnd(); + if (struct.column != null) { + oprot.writeFieldBegin(COLUMN_FIELD_DESC); + oprot.writeBinary(struct.column); + oprot.writeFieldEnd(); + } + if (struct.value != null) { + oprot.writeFieldBegin(VALUE_FIELD_DESC); + oprot.writeBinary(struct.value); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(WRITE_TO_WAL_FIELD_DESC); + oprot.writeBool(struct.writeToWAL); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class MutationTupleSchemeFactory implements SchemeFactory { + public MutationTupleScheme getScheme() { + return new MutationTupleScheme(); + } + } + + private static class MutationTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, Mutation struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetIsDelete()) { + optionals.set(0); + } + if (struct.isSetColumn()) { + optionals.set(1); + } + if (struct.isSetValue()) { + optionals.set(2); + } + if (struct.isSetWriteToWAL()) { + optionals.set(3); + } + oprot.writeBitSet(optionals, 4); + if (struct.isSetIsDelete()) { + oprot.writeBool(struct.isDelete); + } + if (struct.isSetColumn()) { + oprot.writeBinary(struct.column); + } + if (struct.isSetValue()) { + oprot.writeBinary(struct.value); + } + if (struct.isSetWriteToWAL()) { + oprot.writeBool(struct.writeToWAL); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, Mutation struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(4); + if (incoming.get(0)) { + struct.isDelete = iprot.readBool(); + struct.setIsDeleteIsSet(true); + } + if (incoming.get(1)) { + struct.column = iprot.readBinary(); + struct.setColumnIsSet(true); + } + if (incoming.get(2)) { + struct.value = iprot.readBinary(); + struct.setValueIsSet(true); + } + if (incoming.get(3)) { + struct.writeToWAL = iprot.readBool(); + struct.setWriteToWALIsSet(true); + } + } + } + +} + diff --git "a/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/generated/TAppend.java" "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/generated/TAppend.java" new file mode 100644 index 00000000000..439d71e31c2 --- /dev/null +++ "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/generated/TAppend.java" @@ -0,0 +1,840 @@ +/** + * 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.thrift.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"}) +/** + * 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") +public class TAppend implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TAppend"); + + private static final org.apache.thrift.protocol.TField TABLE_FIELD_DESC = new org.apache.thrift.protocol.TField("table", org.apache.thrift.protocol.TType.STRING, (short)1); + 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)2); + 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)3); + private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)4); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TAppendStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TAppendTupleSchemeFactory()); + } + + public ByteBuffer table; // required + public ByteBuffer row; // required + public List columns; // required + public List values; // 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 { + TABLE((short)1, "table"), + ROW((short)2, "row"), + COLUMNS((short)3, "columns"), + VALUES((short)4, "values"); + + private static final Map byName = new HashMap(); + + 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 + return TABLE; + case 2: // ROW + return ROW; + case 3: // COLUMNS + return COLUMNS; + case 4: // VALUES + return VALUES; + 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.TABLE, new org.apache.thrift.meta_data.FieldMetaData("table", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.ROW, new org.apache.thrift.meta_data.FieldMetaData("row", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.COLUMNS, new org.apache.thrift.meta_data.FieldMetaData("columns", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text")))); + tmpMap.put(_Fields.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text")))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TAppend.class, metaDataMap); + } + + public TAppend() { + } + + public TAppend( + ByteBuffer table, + ByteBuffer row, + List columns, + List values) + { + this(); + this.table = org.apache.thrift.TBaseHelper.copyBinary(table); + this.row = org.apache.thrift.TBaseHelper.copyBinary(row); + this.columns = columns; + this.values = values; + } + + /** + * Performs a deep copy on other. + */ + public TAppend(TAppend other) { + if (other.isSetTable()) { + this.table = other.table; + } + if (other.isSetRow()) { + this.row = other.row; + } + if (other.isSetColumns()) { + List __this__columns = new ArrayList(other.columns.size()); + for (ByteBuffer other_element : other.columns) { + __this__columns.add(other_element); + } + this.columns = __this__columns; + } + if (other.isSetValues()) { + List __this__values = new ArrayList(other.values.size()); + for (ByteBuffer other_element : other.values) { + __this__values.add(other_element); + } + this.values = __this__values; + } + } + + public TAppend deepCopy() { + return new TAppend(this); + } + + @Override + public void clear() { + this.table = null; + this.row = null; + this.columns = null; + this.values = null; + } + + public byte[] getTable() { + setTable(org.apache.thrift.TBaseHelper.rightSize(table)); + return table == null ? null : table.array(); + } + + public ByteBuffer bufferForTable() { + return org.apache.thrift.TBaseHelper.copyBinary(table); + } + + public TAppend setTable(byte[] table) { + this.table = table == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(table, table.length)); + return this; + } + + public TAppend setTable(ByteBuffer table) { + this.table = org.apache.thrift.TBaseHelper.copyBinary(table); + return this; + } + + public void unsetTable() { + this.table = null; + } + + /** Returns true if field table is set (has been assigned a value) and false otherwise */ + public boolean isSetTable() { + return this.table != null; + } + + public void setTableIsSet(boolean value) { + if (!value) { + this.table = null; + } + } + + public byte[] getRow() { + setRow(org.apache.thrift.TBaseHelper.rightSize(row)); + return row == null ? null : row.array(); + } + + public ByteBuffer bufferForRow() { + return org.apache.thrift.TBaseHelper.copyBinary(row); + } + + public TAppend setRow(byte[] row) { + this.row = row == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(row, row.length)); + return this; + } + + public TAppend setRow(ByteBuffer row) { + this.row = org.apache.thrift.TBaseHelper.copyBinary(row); + return this; + } + + public void unsetRow() { + this.row = null; + } + + /** Returns true if field row is set (has been assigned a value) and false otherwise */ + public boolean isSetRow() { + return this.row != null; + } + + public void setRowIsSet(boolean value) { + if (!value) { + this.row = null; + } + } + + public int getColumnsSize() { + return (this.columns == null) ? 0 : this.columns.size(); + } + + public java.util.Iterator getColumnsIterator() { + return (this.columns == null) ? null : this.columns.iterator(); + } + + public void addToColumns(ByteBuffer elem) { + if (this.columns == null) { + this.columns = new ArrayList(); + } + this.columns.add(elem); + } + + public List getColumns() { + return this.columns; + } + + public TAppend setColumns(List 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 getValuesSize() { + return (this.values == null) ? 0 : this.values.size(); + } + + public java.util.Iterator getValuesIterator() { + return (this.values == null) ? null : this.values.iterator(); + } + + public void addToValues(ByteBuffer elem) { + if (this.values == null) { + this.values = new ArrayList(); + } + this.values.add(elem); + } + + public List getValues() { + return this.values; + } + + public TAppend setValues(List values) { + this.values = values; + return this; + } + + public void unsetValues() { + this.values = null; + } + + /** Returns true if field values is set (has been assigned a value) and false otherwise */ + public boolean isSetValues() { + return this.values != null; + } + + public void setValuesIsSet(boolean value) { + if (!value) { + this.values = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case TABLE: + if (value == null) { + unsetTable(); + } else { + setTable((ByteBuffer)value); + } + break; + + case ROW: + if (value == null) { + unsetRow(); + } else { + setRow((ByteBuffer)value); + } + break; + + case COLUMNS: + if (value == null) { + unsetColumns(); + } else { + setColumns((List)value); + } + break; + + case VALUES: + if (value == null) { + unsetValues(); + } else { + setValues((List)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case TABLE: + return getTable(); + + case ROW: + return getRow(); + + case COLUMNS: + return getColumns(); + + case VALUES: + return getValues(); + + } + 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: + return isSetTable(); + case ROW: + return isSetRow(); + case COLUMNS: + return isSetColumns(); + case VALUES: + return isSetValues(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TAppend) + return this.equals((TAppend)that); + return false; + } + + public boolean equals(TAppend that) { + if (that == null) + return false; + + boolean this_present_table = true && this.isSetTable(); + boolean that_present_table = true && that.isSetTable(); + if (this_present_table || that_present_table) { + if (!(this_present_table && that_present_table)) + return false; + if (!this.table.equals(that.table)) + return false; + } + + boolean this_present_row = true && this.isSetRow(); + boolean that_present_row = true && that.isSetRow(); + if (this_present_row || that_present_row) { + if (!(this_present_row && that_present_row)) + return false; + if (!this.row.equals(that.row)) + 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_values = true && this.isSetValues(); + boolean that_present_values = true && that.isSetValues(); + if (this_present_values || that_present_values) { + if (!(this_present_values && that_present_values)) + return false; + if (!this.values.equals(that.values)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_table = true && (isSetTable()); + list.add(present_table); + if (present_table) + list.add(table); + + boolean present_row = true && (isSetRow()); + list.add(present_row); + if (present_row) + list.add(row); + + boolean present_columns = true && (isSetColumns()); + list.add(present_columns); + if (present_columns) + list.add(columns); + + boolean present_values = true && (isSetValues()); + list.add(present_values); + if (present_values) + list.add(values); + + return list.hashCode(); + } + + @Override + public int compareTo(TAppend other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetTable()).compareTo(other.isSetTable()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTable()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.table, other.table); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetRow()).compareTo(other.isSetRow()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRow()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.row, other.row); + 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(isSetValues()).compareTo(other.isSetValues()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValues()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.values, other.values); + 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("TAppend("); + boolean first = true; + + sb.append("table:"); + if (this.table == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.table, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("row:"); + if (this.row == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.row, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("columns:"); + if (this.columns == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.columns, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("values:"); + if (this.values == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.values, sb); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 TAppendStandardSchemeFactory implements SchemeFactory { + public TAppendStandardScheme getScheme() { + return new TAppendStandardScheme(); + } + } + + private static class TAppendStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TAppend 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 + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.table = iprot.readBinary(); + struct.setTableIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // ROW + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.row = iprot.readBinary(); + struct.setRowIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // COLUMNS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list34 = iprot.readListBegin(); + struct.columns = new ArrayList(_list34.size); + ByteBuffer _elem35; + for (int _i36 = 0; _i36 < _list34.size; ++_i36) + { + _elem35 = iprot.readBinary(); + struct.columns.add(_elem35); + } + iprot.readListEnd(); + } + struct.setColumnsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // VALUES + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list37 = iprot.readListBegin(); + struct.values = new ArrayList(_list37.size); + ByteBuffer _elem38; + for (int _i39 = 0; _i39 < _list37.size; ++_i39) + { + _elem38 = iprot.readBinary(); + struct.values.add(_elem38); + } + iprot.readListEnd(); + } + struct.setValuesIsSet(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, TAppend struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.table != null) { + oprot.writeFieldBegin(TABLE_FIELD_DESC); + oprot.writeBinary(struct.table); + oprot.writeFieldEnd(); + } + if (struct.row != null) { + oprot.writeFieldBegin(ROW_FIELD_DESC); + oprot.writeBinary(struct.row); + oprot.writeFieldEnd(); + } + if (struct.columns != null) { + oprot.writeFieldBegin(COLUMNS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.columns.size())); + for (ByteBuffer _iter40 : struct.columns) + { + oprot.writeBinary(_iter40); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.values != null) { + oprot.writeFieldBegin(VALUES_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.values.size())); + for (ByteBuffer _iter41 : struct.values) + { + oprot.writeBinary(_iter41); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TAppendTupleSchemeFactory implements SchemeFactory { + public TAppendTupleScheme getScheme() { + return new TAppendTupleScheme(); + } + } + + private static class TAppendTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TAppend struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetTable()) { + optionals.set(0); + } + if (struct.isSetRow()) { + optionals.set(1); + } + if (struct.isSetColumns()) { + optionals.set(2); + } + if (struct.isSetValues()) { + optionals.set(3); + } + oprot.writeBitSet(optionals, 4); + if (struct.isSetTable()) { + oprot.writeBinary(struct.table); + } + if (struct.isSetRow()) { + oprot.writeBinary(struct.row); + } + if (struct.isSetColumns()) { + { + oprot.writeI32(struct.columns.size()); + for (ByteBuffer _iter42 : struct.columns) + { + oprot.writeBinary(_iter42); + } + } + } + if (struct.isSetValues()) { + { + oprot.writeI32(struct.values.size()); + for (ByteBuffer _iter43 : struct.values) + { + oprot.writeBinary(_iter43); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TAppend struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(4); + if (incoming.get(0)) { + struct.table = iprot.readBinary(); + struct.setTableIsSet(true); + } + if (incoming.get(1)) { + struct.row = iprot.readBinary(); + struct.setRowIsSet(true); + } + if (incoming.get(2)) { + { + org.apache.thrift.protocol.TList _list44 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.columns = new ArrayList(_list44.size); + ByteBuffer _elem45; + for (int _i46 = 0; _i46 < _list44.size; ++_i46) + { + _elem45 = iprot.readBinary(); + struct.columns.add(_elem45); + } + } + struct.setColumnsIsSet(true); + } + if (incoming.get(3)) { + { + org.apache.thrift.protocol.TList _list47 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.values = new ArrayList(_list47.size); + ByteBuffer _elem48; + for (int _i49 = 0; _i49 < _list47.size; ++_i49) + { + _elem48 = iprot.readBinary(); + struct.values.add(_elem48); + } + } + struct.setValuesIsSet(true); + } + } + } + +} + diff --git "a/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/generated/TCell.java" "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/generated/TCell.java" new file mode 100644 index 00000000000..37021c0eccd --- /dev/null +++ "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/generated/TCell.java" @@ -0,0 +1,517 @@ +/** + * 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.thrift.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"}) +/** + * TCell - Used to transport a cell value (byte[]) and the timestamp it was + * stored with together as a result for get and getRow methods. This promotes + * 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") +public class TCell implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCell"); + + 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)1); + 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)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TCellStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TCellTupleSchemeFactory()); + } + + public ByteBuffer value; // required + public long timestamp; // 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 { + VALUE((short)1, "value"), + TIMESTAMP((short)2, "timestamp"); + + private static final Map byName = new HashMap(); + + 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: // VALUE + return VALUE; + case 2: // TIMESTAMP + return TIMESTAMP; + 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 int __TIMESTAMP_ISSET_ID = 0; + private byte __isset_bitfield = 0; + 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.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Bytes"))); + tmpMap.put(_Fields.TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("timestamp", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCell.class, metaDataMap); + } + + public TCell() { + } + + public TCell( + ByteBuffer value, + long timestamp) + { + this(); + this.value = org.apache.thrift.TBaseHelper.copyBinary(value); + this.timestamp = timestamp; + setTimestampIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public TCell(TCell other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetValue()) { + this.value = other.value; + } + this.timestamp = other.timestamp; + } + + public TCell deepCopy() { + return new TCell(this); + } + + @Override + public void clear() { + this.value = null; + setTimestampIsSet(false); + this.timestamp = 0; + } + + public byte[] getValue() { + setValue(org.apache.thrift.TBaseHelper.rightSize(value)); + return value == null ? null : value.array(); + } + + public ByteBuffer bufferForValue() { + return org.apache.thrift.TBaseHelper.copyBinary(value); + } + + public TCell setValue(byte[] value) { + this.value = value == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(value, value.length)); + return this; + } + + public TCell setValue(ByteBuffer value) { + this.value = org.apache.thrift.TBaseHelper.copyBinary(value); + return this; + } + + public void unsetValue() { + this.value = null; + } + + /** Returns true if field value is set (has been assigned a value) and false otherwise */ + public boolean isSetValue() { + return this.value != null; + } + + public void setValueIsSet(boolean value) { + if (!value) { + this.value = null; + } + } + + public long getTimestamp() { + return this.timestamp; + } + + public TCell setTimestamp(long timestamp) { + this.timestamp = timestamp; + setTimestampIsSet(true); + return this; + } + + public void unsetTimestamp() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); + } + + /** Returns true if field timestamp is set (has been assigned a value) and false otherwise */ + public boolean isSetTimestamp() { + return EncodingUtils.testBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); + } + + public void setTimestampIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TIMESTAMP_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case VALUE: + if (value == null) { + unsetValue(); + } else { + setValue((ByteBuffer)value); + } + break; + + case TIMESTAMP: + if (value == null) { + unsetTimestamp(); + } else { + setTimestamp((Long)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case VALUE: + return getValue(); + + case TIMESTAMP: + return getTimestamp(); + + } + 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 VALUE: + return isSetValue(); + case TIMESTAMP: + return isSetTimestamp(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TCell) + return this.equals((TCell)that); + return false; + } + + public boolean equals(TCell that) { + if (that == null) + return false; + + boolean this_present_value = true && this.isSetValue(); + boolean that_present_value = true && that.isSetValue(); + if (this_present_value || that_present_value) { + if (!(this_present_value && that_present_value)) + return false; + if (!this.value.equals(that.value)) + return false; + } + + boolean this_present_timestamp = true; + boolean that_present_timestamp = true; + if (this_present_timestamp || that_present_timestamp) { + if (!(this_present_timestamp && that_present_timestamp)) + return false; + if (this.timestamp != that.timestamp) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_value = true && (isSetValue()); + list.add(present_value); + if (present_value) + list.add(value); + + boolean present_timestamp = true; + list.add(present_timestamp); + if (present_timestamp) + list.add(timestamp); + + return list.hashCode(); + } + + @Override + public int compareTo(TCell other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValue()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, other.value); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(other.isSetTimestamp()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTimestamp()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timestamp, other.timestamp); + 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("TCell("); + boolean first = true; + + sb.append("value:"); + if (this.value == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.value, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("timestamp:"); + sb.append(this.timestamp); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 { + // 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); + } + } + + private static class TCellStandardSchemeFactory implements SchemeFactory { + public TCellStandardScheme getScheme() { + return new TCellStandardScheme(); + } + } + + private static class TCellStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TCell 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: // VALUE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.value = iprot.readBinary(); + struct.setValueIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // TIMESTAMP + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.timestamp = iprot.readI64(); + struct.setTimestampIsSet(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, TCell struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.value != null) { + oprot.writeFieldBegin(VALUE_FIELD_DESC); + oprot.writeBinary(struct.value); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC); + oprot.writeI64(struct.timestamp); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TCellTupleSchemeFactory implements SchemeFactory { + public TCellTupleScheme getScheme() { + return new TCellTupleScheme(); + } + } + + private static class TCellTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TCell struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetValue()) { + optionals.set(0); + } + if (struct.isSetTimestamp()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetValue()) { + oprot.writeBinary(struct.value); + } + if (struct.isSetTimestamp()) { + oprot.writeI64(struct.timestamp); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TCell struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.value = iprot.readBinary(); + struct.setValueIsSet(true); + } + if (incoming.get(1)) { + struct.timestamp = iprot.readI64(); + struct.setTimestampIsSet(true); + } + } + } + +} + diff --git "a/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/generated/TColumn.java" "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/generated/TColumn.java" new file mode 100644 index 00000000000..77e875da2d6 --- /dev/null +++ "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/generated/TColumn.java" @@ -0,0 +1,521 @@ +/** + * 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.thrift.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"}) +/** + * Holds column name and the cell. + */ +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-25") +public class TColumn implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TColumn"); + + private static final org.apache.thrift.protocol.TField COLUMN_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("columnName", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField CELL_FIELD_DESC = new org.apache.thrift.protocol.TField("cell", org.apache.thrift.protocol.TType.STRUCT, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TColumnStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TColumnTupleSchemeFactory()); + } + + public ByteBuffer columnName; // required + public TCell cell; // 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 { + COLUMN_NAME((short)1, "columnName"), + CELL((short)2, "cell"); + + private static final Map byName = new HashMap(); + + 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: // COLUMN_NAME + return COLUMN_NAME; + case 2: // CELL + return CELL; + 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.COLUMN_NAME, new org.apache.thrift.meta_data.FieldMetaData("columnName", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.CELL, new org.apache.thrift.meta_data.FieldMetaData("cell", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TCell.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TColumn.class, metaDataMap); + } + + public TColumn() { + } + + public TColumn( + ByteBuffer columnName, + TCell cell) + { + this(); + this.columnName = org.apache.thrift.TBaseHelper.copyBinary(columnName); + this.cell = cell; + } + + /** + * Performs a deep copy on other. + */ + public TColumn(TColumn other) { + if (other.isSetColumnName()) { + this.columnName = other.columnName; + } + if (other.isSetCell()) { + this.cell = new TCell(other.cell); + } + } + + public TColumn deepCopy() { + return new TColumn(this); + } + + @Override + public void clear() { + this.columnName = null; + this.cell = null; + } + + public byte[] getColumnName() { + setColumnName(org.apache.thrift.TBaseHelper.rightSize(columnName)); + return columnName == null ? null : columnName.array(); + } + + public ByteBuffer bufferForColumnName() { + return org.apache.thrift.TBaseHelper.copyBinary(columnName); + } + + public TColumn setColumnName(byte[] columnName) { + this.columnName = columnName == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(columnName, columnName.length)); + return this; + } + + public TColumn setColumnName(ByteBuffer columnName) { + this.columnName = org.apache.thrift.TBaseHelper.copyBinary(columnName); + return this; + } + + public void unsetColumnName() { + this.columnName = null; + } + + /** Returns true if field columnName is set (has been assigned a value) and false otherwise */ + public boolean isSetColumnName() { + return this.columnName != null; + } + + public void setColumnNameIsSet(boolean value) { + if (!value) { + this.columnName = null; + } + } + + public TCell getCell() { + return this.cell; + } + + public TColumn setCell(TCell cell) { + this.cell = cell; + return this; + } + + public void unsetCell() { + this.cell = null; + } + + /** Returns true if field cell is set (has been assigned a value) and false otherwise */ + public boolean isSetCell() { + return this.cell != null; + } + + public void setCellIsSet(boolean value) { + if (!value) { + this.cell = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case COLUMN_NAME: + if (value == null) { + unsetColumnName(); + } else { + setColumnName((ByteBuffer)value); + } + break; + + case CELL: + if (value == null) { + unsetCell(); + } else { + setCell((TCell)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case COLUMN_NAME: + return getColumnName(); + + case CELL: + return getCell(); + + } + 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 COLUMN_NAME: + return isSetColumnName(); + case CELL: + return isSetCell(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TColumn) + return this.equals((TColumn)that); + return false; + } + + public boolean equals(TColumn that) { + if (that == null) + return false; + + boolean this_present_columnName = true && this.isSetColumnName(); + boolean that_present_columnName = true && that.isSetColumnName(); + if (this_present_columnName || that_present_columnName) { + if (!(this_present_columnName && that_present_columnName)) + return false; + if (!this.columnName.equals(that.columnName)) + return false; + } + + boolean this_present_cell = true && this.isSetCell(); + boolean that_present_cell = true && that.isSetCell(); + if (this_present_cell || that_present_cell) { + if (!(this_present_cell && that_present_cell)) + return false; + if (!this.cell.equals(that.cell)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_columnName = true && (isSetColumnName()); + list.add(present_columnName); + if (present_columnName) + list.add(columnName); + + boolean present_cell = true && (isSetCell()); + list.add(present_cell); + if (present_cell) + list.add(cell); + + return list.hashCode(); + } + + @Override + public int compareTo(TColumn other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetColumnName()).compareTo(other.isSetColumnName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetColumnName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columnName, other.columnName); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetCell()).compareTo(other.isSetCell()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetCell()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cell, other.cell); + 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("TColumn("); + boolean first = true; + + sb.append("columnName:"); + if (this.columnName == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.columnName, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("cell:"); + if (this.cell == null) { + sb.append("null"); + } else { + sb.append(this.cell); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + if (cell != null) { + cell.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 TColumnStandardSchemeFactory implements SchemeFactory { + public TColumnStandardScheme getScheme() { + return new TColumnStandardScheme(); + } + } + + private static class TColumnStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TColumn 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: // COLUMN_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.columnName = iprot.readBinary(); + struct.setColumnNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // CELL + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.cell = new TCell(); + struct.cell.read(iprot); + struct.setCellIsSet(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, TColumn struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.columnName != null) { + oprot.writeFieldBegin(COLUMN_NAME_FIELD_DESC); + oprot.writeBinary(struct.columnName); + oprot.writeFieldEnd(); + } + if (struct.cell != null) { + oprot.writeFieldBegin(CELL_FIELD_DESC); + struct.cell.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TColumnTupleSchemeFactory implements SchemeFactory { + public TColumnTupleScheme getScheme() { + return new TColumnTupleScheme(); + } + } + + private static class TColumnTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TColumn struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetColumnName()) { + optionals.set(0); + } + if (struct.isSetCell()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetColumnName()) { + oprot.writeBinary(struct.columnName); + } + if (struct.isSetCell()) { + struct.cell.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TColumn struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.columnName = iprot.readBinary(); + struct.setColumnNameIsSet(true); + } + if (incoming.get(1)) { + struct.cell = new TCell(); + struct.cell.read(iprot); + struct.setCellIsSet(true); + } + } + } + +} + diff --git "a/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/generated/TIncrement.java" "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/generated/TIncrement.java" new file mode 100644 index 00000000000..22b5f79c6fb --- /dev/null +++ "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/generated/TIncrement.java" @@ -0,0 +1,745 @@ +/** + * 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.thrift.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"}) +/** + * For increments that are not incrementColumnValue + * equivalents. + */ +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-25") +public class TIncrement implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TIncrement"); + + private static final org.apache.thrift.protocol.TField TABLE_FIELD_DESC = new org.apache.thrift.protocol.TField("table", org.apache.thrift.protocol.TType.STRING, (short)1); + 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)2); + private static final org.apache.thrift.protocol.TField COLUMN_FIELD_DESC = new org.apache.thrift.protocol.TField("column", org.apache.thrift.protocol.TType.STRING, (short)3); + private static final org.apache.thrift.protocol.TField AMMOUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("ammount", org.apache.thrift.protocol.TType.I64, (short)4); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TIncrementStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TIncrementTupleSchemeFactory()); + } + + public ByteBuffer table; // required + public ByteBuffer row; // required + public ByteBuffer column; // required + public long ammount; // 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 { + TABLE((short)1, "table"), + ROW((short)2, "row"), + COLUMN((short)3, "column"), + AMMOUNT((short)4, "ammount"); + + private static final Map byName = new HashMap(); + + 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 + return TABLE; + case 2: // ROW + return ROW; + case 3: // COLUMN + return COLUMN; + case 4: // AMMOUNT + return AMMOUNT; + 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 int __AMMOUNT_ISSET_ID = 0; + private byte __isset_bitfield = 0; + 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, new org.apache.thrift.meta_data.FieldMetaData("table", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.ROW, new org.apache.thrift.meta_data.FieldMetaData("row", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.COLUMN, new org.apache.thrift.meta_data.FieldMetaData("column", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.AMMOUNT, new org.apache.thrift.meta_data.FieldMetaData("ammount", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TIncrement.class, metaDataMap); + } + + public TIncrement() { + } + + public TIncrement( + ByteBuffer table, + ByteBuffer row, + ByteBuffer column, + long ammount) + { + this(); + this.table = org.apache.thrift.TBaseHelper.copyBinary(table); + this.row = org.apache.thrift.TBaseHelper.copyBinary(row); + this.column = org.apache.thrift.TBaseHelper.copyBinary(column); + this.ammount = ammount; + setAmmountIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public TIncrement(TIncrement other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetTable()) { + this.table = other.table; + } + if (other.isSetRow()) { + this.row = other.row; + } + if (other.isSetColumn()) { + this.column = other.column; + } + this.ammount = other.ammount; + } + + public TIncrement deepCopy() { + return new TIncrement(this); + } + + @Override + public void clear() { + this.table = null; + this.row = null; + this.column = null; + setAmmountIsSet(false); + this.ammount = 0; + } + + public byte[] getTable() { + setTable(org.apache.thrift.TBaseHelper.rightSize(table)); + return table == null ? null : table.array(); + } + + public ByteBuffer bufferForTable() { + return org.apache.thrift.TBaseHelper.copyBinary(table); + } + + public TIncrement setTable(byte[] table) { + this.table = table == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(table, table.length)); + return this; + } + + public TIncrement setTable(ByteBuffer table) { + this.table = org.apache.thrift.TBaseHelper.copyBinary(table); + return this; + } + + public void unsetTable() { + this.table = null; + } + + /** Returns true if field table is set (has been assigned a value) and false otherwise */ + public boolean isSetTable() { + return this.table != null; + } + + public void setTableIsSet(boolean value) { + if (!value) { + this.table = null; + } + } + + public byte[] getRow() { + setRow(org.apache.thrift.TBaseHelper.rightSize(row)); + return row == null ? null : row.array(); + } + + public ByteBuffer bufferForRow() { + return org.apache.thrift.TBaseHelper.copyBinary(row); + } + + public TIncrement setRow(byte[] row) { + this.row = row == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(row, row.length)); + return this; + } + + public TIncrement setRow(ByteBuffer row) { + this.row = org.apache.thrift.TBaseHelper.copyBinary(row); + return this; + } + + public void unsetRow() { + this.row = null; + } + + /** Returns true if field row is set (has been assigned a value) and false otherwise */ + public boolean isSetRow() { + return this.row != null; + } + + public void setRowIsSet(boolean value) { + if (!value) { + this.row = null; + } + } + + public byte[] getColumn() { + setColumn(org.apache.thrift.TBaseHelper.rightSize(column)); + return column == null ? null : column.array(); + } + + public ByteBuffer bufferForColumn() { + return org.apache.thrift.TBaseHelper.copyBinary(column); + } + + public TIncrement setColumn(byte[] column) { + this.column = column == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(column, column.length)); + return this; + } + + public TIncrement setColumn(ByteBuffer column) { + this.column = org.apache.thrift.TBaseHelper.copyBinary(column); + return this; + } + + public void unsetColumn() { + this.column = null; + } + + /** Returns true if field column is set (has been assigned a value) and false otherwise */ + public boolean isSetColumn() { + return this.column != null; + } + + public void setColumnIsSet(boolean value) { + if (!value) { + this.column = null; + } + } + + public long getAmmount() { + return this.ammount; + } + + public TIncrement setAmmount(long ammount) { + this.ammount = ammount; + setAmmountIsSet(true); + return this; + } + + public void unsetAmmount() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __AMMOUNT_ISSET_ID); + } + + /** Returns true if field ammount is set (has been assigned a value) and false otherwise */ + public boolean isSetAmmount() { + return EncodingUtils.testBit(__isset_bitfield, __AMMOUNT_ISSET_ID); + } + + public void setAmmountIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __AMMOUNT_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case TABLE: + if (value == null) { + unsetTable(); + } else { + setTable((ByteBuffer)value); + } + break; + + case ROW: + if (value == null) { + unsetRow(); + } else { + setRow((ByteBuffer)value); + } + break; + + case COLUMN: + if (value == null) { + unsetColumn(); + } else { + setColumn((ByteBuffer)value); + } + break; + + case AMMOUNT: + if (value == null) { + unsetAmmount(); + } else { + setAmmount((Long)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case TABLE: + return getTable(); + + case ROW: + return getRow(); + + case COLUMN: + return getColumn(); + + case AMMOUNT: + return getAmmount(); + + } + 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: + return isSetTable(); + case ROW: + return isSetRow(); + case COLUMN: + return isSetColumn(); + case AMMOUNT: + return isSetAmmount(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TIncrement) + return this.equals((TIncrement)that); + return false; + } + + public boolean equals(TIncrement that) { + if (that == null) + return false; + + boolean this_present_table = true && this.isSetTable(); + boolean that_present_table = true && that.isSetTable(); + if (this_present_table || that_present_table) { + if (!(this_present_table && that_present_table)) + return false; + if (!this.table.equals(that.table)) + return false; + } + + boolean this_present_row = true && this.isSetRow(); + boolean that_present_row = true && that.isSetRow(); + if (this_present_row || that_present_row) { + if (!(this_present_row && that_present_row)) + return false; + if (!this.row.equals(that.row)) + return false; + } + + boolean this_present_column = true && this.isSetColumn(); + boolean that_present_column = true && that.isSetColumn(); + if (this_present_column || that_present_column) { + if (!(this_present_column && that_present_column)) + return false; + if (!this.column.equals(that.column)) + return false; + } + + boolean this_present_ammount = true; + boolean that_present_ammount = true; + if (this_present_ammount || that_present_ammount) { + if (!(this_present_ammount && that_present_ammount)) + return false; + if (this.ammount != that.ammount) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_table = true && (isSetTable()); + list.add(present_table); + if (present_table) + list.add(table); + + boolean present_row = true && (isSetRow()); + list.add(present_row); + if (present_row) + list.add(row); + + boolean present_column = true && (isSetColumn()); + list.add(present_column); + if (present_column) + list.add(column); + + boolean present_ammount = true; + list.add(present_ammount); + if (present_ammount) + list.add(ammount); + + return list.hashCode(); + } + + @Override + public int compareTo(TIncrement other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetTable()).compareTo(other.isSetTable()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTable()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.table, other.table); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetRow()).compareTo(other.isSetRow()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRow()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.row, other.row); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetColumn()).compareTo(other.isSetColumn()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetColumn()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.column, other.column); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetAmmount()).compareTo(other.isSetAmmount()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetAmmount()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ammount, other.ammount); + 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("TIncrement("); + boolean first = true; + + sb.append("table:"); + if (this.table == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.table, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("row:"); + if (this.row == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.row, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("column:"); + if (this.column == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.column, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("ammount:"); + sb.append(this.ammount); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 { + // 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); + } + } + + private static class TIncrementStandardSchemeFactory implements SchemeFactory { + public TIncrementStandardScheme getScheme() { + return new TIncrementStandardScheme(); + } + } + + private static class TIncrementStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TIncrement 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 + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.table = iprot.readBinary(); + struct.setTableIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // ROW + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.row = iprot.readBinary(); + struct.setRowIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // COLUMN + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.column = iprot.readBinary(); + struct.setColumnIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // AMMOUNT + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.ammount = iprot.readI64(); + struct.setAmmountIsSet(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, TIncrement struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.table != null) { + oprot.writeFieldBegin(TABLE_FIELD_DESC); + oprot.writeBinary(struct.table); + oprot.writeFieldEnd(); + } + if (struct.row != null) { + oprot.writeFieldBegin(ROW_FIELD_DESC); + oprot.writeBinary(struct.row); + oprot.writeFieldEnd(); + } + if (struct.column != null) { + oprot.writeFieldBegin(COLUMN_FIELD_DESC); + oprot.writeBinary(struct.column); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(AMMOUNT_FIELD_DESC); + oprot.writeI64(struct.ammount); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TIncrementTupleSchemeFactory implements SchemeFactory { + public TIncrementTupleScheme getScheme() { + return new TIncrementTupleScheme(); + } + } + + private static class TIncrementTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TIncrement struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetTable()) { + optionals.set(0); + } + if (struct.isSetRow()) { + optionals.set(1); + } + if (struct.isSetColumn()) { + optionals.set(2); + } + if (struct.isSetAmmount()) { + optionals.set(3); + } + oprot.writeBitSet(optionals, 4); + if (struct.isSetTable()) { + oprot.writeBinary(struct.table); + } + if (struct.isSetRow()) { + oprot.writeBinary(struct.row); + } + if (struct.isSetColumn()) { + oprot.writeBinary(struct.column); + } + if (struct.isSetAmmount()) { + oprot.writeI64(struct.ammount); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TIncrement struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(4); + if (incoming.get(0)) { + struct.table = iprot.readBinary(); + struct.setTableIsSet(true); + } + if (incoming.get(1)) { + struct.row = iprot.readBinary(); + struct.setRowIsSet(true); + } + if (incoming.get(2)) { + struct.column = iprot.readBinary(); + struct.setColumnIsSet(true); + } + if (incoming.get(3)) { + struct.ammount = iprot.readI64(); + struct.setAmmountIsSet(true); + } + } + } + +} + diff --git "a/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/generated/TRegionInfo.java" "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/generated/TRegionInfo.java" new file mode 100644 index 00000000000..a1dab6b01ad --- /dev/null +++ "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/generated/TRegionInfo.java" @@ -0,0 +1,1057 @@ +/** + * 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.thrift.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"}) +/** + * A TRegionInfo contains information about an HTable region. + */ +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-25") +public class TRegionInfo implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TRegionInfo"); + + private static final org.apache.thrift.protocol.TField START_KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("startKey", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField END_KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("endKey", org.apache.thrift.protocol.TType.STRING, (short)2); + private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.I64, (short)3); + 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)4); + private static final org.apache.thrift.protocol.TField VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("version", org.apache.thrift.protocol.TType.BYTE, (short)5); + private static final org.apache.thrift.protocol.TField SERVER_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("serverName", org.apache.thrift.protocol.TType.STRING, (short)6); + private static final org.apache.thrift.protocol.TField PORT_FIELD_DESC = new org.apache.thrift.protocol.TField("port", org.apache.thrift.protocol.TType.I32, (short)7); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TRegionInfoStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TRegionInfoTupleSchemeFactory()); + } + + public ByteBuffer startKey; // required + public ByteBuffer endKey; // required + public long id; // required + public ByteBuffer name; // required + public byte version; // required + public ByteBuffer serverName; // required + public int port; // 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 { + START_KEY((short)1, "startKey"), + END_KEY((short)2, "endKey"), + ID((short)3, "id"), + NAME((short)4, "name"), + VERSION((short)5, "version"), + SERVER_NAME((short)6, "serverName"), + PORT((short)7, "port"); + + private static final Map byName = new HashMap(); + + 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: // START_KEY + return START_KEY; + case 2: // END_KEY + return END_KEY; + case 3: // ID + return ID; + case 4: // NAME + return NAME; + case 5: // VERSION + return VERSION; + case 6: // SERVER_NAME + return SERVER_NAME; + case 7: // PORT + return PORT; + 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 int __ID_ISSET_ID = 0; + private static final int __VERSION_ISSET_ID = 1; + private static final int __PORT_ISSET_ID = 2; + private byte __isset_bitfield = 0; + 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.START_KEY, new org.apache.thrift.meta_data.FieldMetaData("startKey", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.END_KEY, new org.apache.thrift.meta_data.FieldMetaData("endKey", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.VERSION, new org.apache.thrift.meta_data.FieldMetaData("version", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BYTE))); + tmpMap.put(_Fields.SERVER_NAME, new org.apache.thrift.meta_data.FieldMetaData("serverName", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.PORT, new org.apache.thrift.meta_data.FieldMetaData("port", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TRegionInfo.class, metaDataMap); + } + + public TRegionInfo() { + } + + public TRegionInfo( + ByteBuffer startKey, + ByteBuffer endKey, + long id, + ByteBuffer name, + byte version, + ByteBuffer serverName, + int port) + { + this(); + this.startKey = org.apache.thrift.TBaseHelper.copyBinary(startKey); + this.endKey = org.apache.thrift.TBaseHelper.copyBinary(endKey); + this.id = id; + setIdIsSet(true); + this.name = org.apache.thrift.TBaseHelper.copyBinary(name); + this.version = version; + setVersionIsSet(true); + this.serverName = org.apache.thrift.TBaseHelper.copyBinary(serverName); + this.port = port; + setPortIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public TRegionInfo(TRegionInfo other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetStartKey()) { + this.startKey = other.startKey; + } + if (other.isSetEndKey()) { + this.endKey = other.endKey; + } + this.id = other.id; + if (other.isSetName()) { + this.name = other.name; + } + this.version = other.version; + if (other.isSetServerName()) { + this.serverName = other.serverName; + } + this.port = other.port; + } + + public TRegionInfo deepCopy() { + return new TRegionInfo(this); + } + + @Override + public void clear() { + this.startKey = null; + this.endKey = null; + setIdIsSet(false); + this.id = 0; + this.name = null; + setVersionIsSet(false); + this.version = 0; + this.serverName = null; + setPortIsSet(false); + this.port = 0; + } + + public byte[] getStartKey() { + setStartKey(org.apache.thrift.TBaseHelper.rightSize(startKey)); + return startKey == null ? null : startKey.array(); + } + + public ByteBuffer bufferForStartKey() { + return org.apache.thrift.TBaseHelper.copyBinary(startKey); + } + + public TRegionInfo setStartKey(byte[] startKey) { + this.startKey = startKey == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(startKey, startKey.length)); + return this; + } + + public TRegionInfo setStartKey(ByteBuffer startKey) { + this.startKey = org.apache.thrift.TBaseHelper.copyBinary(startKey); + return this; + } + + public void unsetStartKey() { + this.startKey = null; + } + + /** Returns true if field startKey is set (has been assigned a value) and false otherwise */ + public boolean isSetStartKey() { + return this.startKey != null; + } + + public void setStartKeyIsSet(boolean value) { + if (!value) { + this.startKey = null; + } + } + + public byte[] getEndKey() { + setEndKey(org.apache.thrift.TBaseHelper.rightSize(endKey)); + return endKey == null ? null : endKey.array(); + } + + public ByteBuffer bufferForEndKey() { + return org.apache.thrift.TBaseHelper.copyBinary(endKey); + } + + public TRegionInfo setEndKey(byte[] endKey) { + this.endKey = endKey == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(endKey, endKey.length)); + return this; + } + + public TRegionInfo setEndKey(ByteBuffer endKey) { + this.endKey = org.apache.thrift.TBaseHelper.copyBinary(endKey); + return this; + } + + public void unsetEndKey() { + this.endKey = null; + } + + /** Returns true if field endKey is set (has been assigned a value) and false otherwise */ + public boolean isSetEndKey() { + return this.endKey != null; + } + + public void setEndKeyIsSet(boolean value) { + if (!value) { + this.endKey = null; + } + } + + public long getId() { + return this.id; + } + + public TRegionInfo setId(long id) { + this.id = id; + setIdIsSet(true); + return this; + } + + public void unsetId() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ID_ISSET_ID); + } + + /** Returns true if field id is set (has been assigned a value) and false otherwise */ + public boolean isSetId() { + return EncodingUtils.testBit(__isset_bitfield, __ID_ISSET_ID); + } + + public void setIdIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ID_ISSET_ID, value); + } + + public byte[] getName() { + setName(org.apache.thrift.TBaseHelper.rightSize(name)); + return name == null ? null : name.array(); + } + + public ByteBuffer bufferForName() { + return org.apache.thrift.TBaseHelper.copyBinary(name); + } + + public TRegionInfo setName(byte[] name) { + this.name = name == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(name, name.length)); + return this; + } + + public TRegionInfo setName(ByteBuffer name) { + this.name = org.apache.thrift.TBaseHelper.copyBinary(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 byte getVersion() { + return this.version; + } + + public TRegionInfo setVersion(byte version) { + this.version = version; + setVersionIsSet(true); + return this; + } + + public void unsetVersion() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __VERSION_ISSET_ID); + } + + /** Returns true if field version is set (has been assigned a value) and false otherwise */ + public boolean isSetVersion() { + return EncodingUtils.testBit(__isset_bitfield, __VERSION_ISSET_ID); + } + + public void setVersionIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __VERSION_ISSET_ID, value); + } + + public byte[] getServerName() { + setServerName(org.apache.thrift.TBaseHelper.rightSize(serverName)); + return serverName == null ? null : serverName.array(); + } + + public ByteBuffer bufferForServerName() { + return org.apache.thrift.TBaseHelper.copyBinary(serverName); + } + + public TRegionInfo setServerName(byte[] serverName) { + this.serverName = serverName == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(serverName, serverName.length)); + return this; + } + + public TRegionInfo setServerName(ByteBuffer serverName) { + this.serverName = org.apache.thrift.TBaseHelper.copyBinary(serverName); + return this; + } + + public void unsetServerName() { + this.serverName = null; + } + + /** Returns true if field serverName is set (has been assigned a value) and false otherwise */ + public boolean isSetServerName() { + return this.serverName != null; + } + + public void setServerNameIsSet(boolean value) { + if (!value) { + this.serverName = null; + } + } + + public int getPort() { + return this.port; + } + + public TRegionInfo setPort(int port) { + this.port = port; + setPortIsSet(true); + return this; + } + + public void unsetPort() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PORT_ISSET_ID); + } + + /** Returns true if field port is set (has been assigned a value) and false otherwise */ + public boolean isSetPort() { + return EncodingUtils.testBit(__isset_bitfield, __PORT_ISSET_ID); + } + + public void setPortIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PORT_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case START_KEY: + if (value == null) { + unsetStartKey(); + } else { + setStartKey((ByteBuffer)value); + } + break; + + case END_KEY: + if (value == null) { + unsetEndKey(); + } else { + setEndKey((ByteBuffer)value); + } + break; + + case ID: + if (value == null) { + unsetId(); + } else { + setId((Long)value); + } + break; + + case NAME: + if (value == null) { + unsetName(); + } else { + setName((ByteBuffer)value); + } + break; + + case VERSION: + if (value == null) { + unsetVersion(); + } else { + setVersion((Byte)value); + } + break; + + case SERVER_NAME: + if (value == null) { + unsetServerName(); + } else { + setServerName((ByteBuffer)value); + } + break; + + case PORT: + if (value == null) { + unsetPort(); + } else { + setPort((Integer)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case START_KEY: + return getStartKey(); + + case END_KEY: + return getEndKey(); + + case ID: + return getId(); + + case NAME: + return getName(); + + case VERSION: + return getVersion(); + + case SERVER_NAME: + return getServerName(); + + case PORT: + return getPort(); + + } + 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 START_KEY: + return isSetStartKey(); + case END_KEY: + return isSetEndKey(); + case ID: + return isSetId(); + case NAME: + return isSetName(); + case VERSION: + return isSetVersion(); + case SERVER_NAME: + return isSetServerName(); + case PORT: + return isSetPort(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TRegionInfo) + return this.equals((TRegionInfo)that); + return false; + } + + public boolean equals(TRegionInfo that) { + if (that == null) + return false; + + boolean this_present_startKey = true && this.isSetStartKey(); + boolean that_present_startKey = true && that.isSetStartKey(); + if (this_present_startKey || that_present_startKey) { + if (!(this_present_startKey && that_present_startKey)) + return false; + if (!this.startKey.equals(that.startKey)) + return false; + } + + boolean this_present_endKey = true && this.isSetEndKey(); + boolean that_present_endKey = true && that.isSetEndKey(); + if (this_present_endKey || that_present_endKey) { + if (!(this_present_endKey && that_present_endKey)) + return false; + if (!this.endKey.equals(that.endKey)) + return false; + } + + boolean this_present_id = true; + boolean that_present_id = true; + if (this_present_id || that_present_id) { + if (!(this_present_id && that_present_id)) + return false; + if (this.id != that.id) + 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_version = true; + boolean that_present_version = true; + if (this_present_version || that_present_version) { + if (!(this_present_version && that_present_version)) + return false; + if (this.version != that.version) + return false; + } + + boolean this_present_serverName = true && this.isSetServerName(); + boolean that_present_serverName = true && that.isSetServerName(); + if (this_present_serverName || that_present_serverName) { + if (!(this_present_serverName && that_present_serverName)) + return false; + if (!this.serverName.equals(that.serverName)) + return false; + } + + boolean this_present_port = true; + boolean that_present_port = true; + if (this_present_port || that_present_port) { + if (!(this_present_port && that_present_port)) + return false; + if (this.port != that.port) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_startKey = true && (isSetStartKey()); + list.add(present_startKey); + if (present_startKey) + list.add(startKey); + + boolean present_endKey = true && (isSetEndKey()); + list.add(present_endKey); + if (present_endKey) + list.add(endKey); + + boolean present_id = true; + list.add(present_id); + if (present_id) + list.add(id); + + boolean present_name = true && (isSetName()); + list.add(present_name); + if (present_name) + list.add(name); + + boolean present_version = true; + list.add(present_version); + if (present_version) + list.add(version); + + boolean present_serverName = true && (isSetServerName()); + list.add(present_serverName); + if (present_serverName) + list.add(serverName); + + boolean present_port = true; + list.add(present_port); + if (present_port) + list.add(port); + + return list.hashCode(); + } + + @Override + public int compareTo(TRegionInfo other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetStartKey()).compareTo(other.isSetStartKey()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStartKey()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startKey, other.startKey); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetEndKey()).compareTo(other.isSetEndKey()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetEndKey()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endKey, other.endKey); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id); + if (lastComparison != 0) { + return lastComparison; + } + } + 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(isSetVersion()).compareTo(other.isSetVersion()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetVersion()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.version, other.version); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetServerName()).compareTo(other.isSetServerName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetServerName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serverName, other.serverName); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetPort()).compareTo(other.isSetPort()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetPort()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.port, other.port); + 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("TRegionInfo("); + boolean first = true; + + sb.append("startKey:"); + if (this.startKey == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.startKey, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("endKey:"); + if (this.endKey == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.endKey, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("id:"); + sb.append(this.id); + first = false; + if (!first) sb.append(", "); + sb.append("name:"); + if (this.name == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.name, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("version:"); + sb.append(this.version); + first = false; + if (!first) sb.append(", "); + sb.append("serverName:"); + if (this.serverName == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.serverName, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("port:"); + sb.append(this.port); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 { + // 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); + } + } + + private static class TRegionInfoStandardSchemeFactory implements SchemeFactory { + public TRegionInfoStandardScheme getScheme() { + return new TRegionInfoStandardScheme(); + } + } + + private static class TRegionInfoStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TRegionInfo 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: // START_KEY + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.startKey = iprot.readBinary(); + struct.setStartKeyIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // END_KEY + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.endKey = iprot.readBinary(); + struct.setEndKeyIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.id = iprot.readI64(); + struct.setIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.name = iprot.readBinary(); + struct.setNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // VERSION + if (schemeField.type == org.apache.thrift.protocol.TType.BYTE) { + struct.version = iprot.readByte(); + struct.setVersionIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 6: // SERVER_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.serverName = iprot.readBinary(); + struct.setServerNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 7: // PORT + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.port = iprot.readI32(); + struct.setPortIsSet(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, TRegionInfo struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.startKey != null) { + oprot.writeFieldBegin(START_KEY_FIELD_DESC); + oprot.writeBinary(struct.startKey); + oprot.writeFieldEnd(); + } + if (struct.endKey != null) { + oprot.writeFieldBegin(END_KEY_FIELD_DESC); + oprot.writeBinary(struct.endKey); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(ID_FIELD_DESC); + oprot.writeI64(struct.id); + oprot.writeFieldEnd(); + if (struct.name != null) { + oprot.writeFieldBegin(NAME_FIELD_DESC); + oprot.writeBinary(struct.name); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(VERSION_FIELD_DESC); + oprot.writeByte(struct.version); + oprot.writeFieldEnd(); + if (struct.serverName != null) { + oprot.writeFieldBegin(SERVER_NAME_FIELD_DESC); + oprot.writeBinary(struct.serverName); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(PORT_FIELD_DESC); + oprot.writeI32(struct.port); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TRegionInfoTupleSchemeFactory implements SchemeFactory { + public TRegionInfoTupleScheme getScheme() { + return new TRegionInfoTupleScheme(); + } + } + + private static class TRegionInfoTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TRegionInfo struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetStartKey()) { + optionals.set(0); + } + if (struct.isSetEndKey()) { + optionals.set(1); + } + if (struct.isSetId()) { + optionals.set(2); + } + if (struct.isSetName()) { + optionals.set(3); + } + if (struct.isSetVersion()) { + optionals.set(4); + } + if (struct.isSetServerName()) { + optionals.set(5); + } + if (struct.isSetPort()) { + optionals.set(6); + } + oprot.writeBitSet(optionals, 7); + if (struct.isSetStartKey()) { + oprot.writeBinary(struct.startKey); + } + if (struct.isSetEndKey()) { + oprot.writeBinary(struct.endKey); + } + if (struct.isSetId()) { + oprot.writeI64(struct.id); + } + if (struct.isSetName()) { + oprot.writeBinary(struct.name); + } + if (struct.isSetVersion()) { + oprot.writeByte(struct.version); + } + if (struct.isSetServerName()) { + oprot.writeBinary(struct.serverName); + } + if (struct.isSetPort()) { + oprot.writeI32(struct.port); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TRegionInfo struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(7); + if (incoming.get(0)) { + struct.startKey = iprot.readBinary(); + struct.setStartKeyIsSet(true); + } + if (incoming.get(1)) { + struct.endKey = iprot.readBinary(); + struct.setEndKeyIsSet(true); + } + if (incoming.get(2)) { + struct.id = iprot.readI64(); + struct.setIdIsSet(true); + } + if (incoming.get(3)) { + struct.name = iprot.readBinary(); + struct.setNameIsSet(true); + } + if (incoming.get(4)) { + struct.version = iprot.readByte(); + struct.setVersionIsSet(true); + } + if (incoming.get(5)) { + struct.serverName = iprot.readBinary(); + struct.setServerNameIsSet(true); + } + if (incoming.get(6)) { + struct.port = iprot.readI32(); + struct.setPortIsSet(true); + } + } + } + +} + diff --git "a/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/generated/TRowResult.java" "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/generated/TRowResult.java" new file mode 100644 index 00000000000..418f5034510 --- /dev/null +++ "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/generated/TRowResult.java" @@ -0,0 +1,745 @@ +/** + * 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.thrift.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"}) +/** + * Holds row name and then a map of columns to cells. + */ +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-25") +public class TRowResult implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TRowResult"); + + 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 COLUMNS_FIELD_DESC = new org.apache.thrift.protocol.TField("columns", org.apache.thrift.protocol.TType.MAP, (short)2); + private static final org.apache.thrift.protocol.TField SORTED_COLUMNS_FIELD_DESC = new org.apache.thrift.protocol.TField("sortedColumns", org.apache.thrift.protocol.TType.LIST, (short)3); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TRowResultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TRowResultTupleSchemeFactory()); + } + + public ByteBuffer row; // required + public Map columns; // optional + public List sortedColumns; // 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"), + COLUMNS((short)2, "columns"), + SORTED_COLUMNS((short)3, "sortedColumns"); + + private static final Map byName = new HashMap(); + + 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: // ROW + return ROW; + case 2: // COLUMNS + return COLUMNS; + case 3: // SORTED_COLUMNS + return SORTED_COLUMNS; + 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.SORTED_COLUMNS}; + 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.ROW, new org.apache.thrift.meta_data.FieldMetaData("row", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.COLUMNS, new org.apache.thrift.meta_data.FieldMetaData("columns", 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 , "Text"), + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TCell.class)))); + tmpMap.put(_Fields.SORTED_COLUMNS, new org.apache.thrift.meta_data.FieldMetaData("sortedColumns", 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, TColumn.class)))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TRowResult.class, metaDataMap); + } + + public TRowResult() { + } + + public TRowResult( + ByteBuffer row) + { + this(); + this.row = org.apache.thrift.TBaseHelper.copyBinary(row); + } + + /** + * Performs a deep copy on other. + */ + public TRowResult(TRowResult other) { + if (other.isSetRow()) { + this.row = other.row; + } + if (other.isSetColumns()) { + Map __this__columns = new HashMap(other.columns.size()); + for (Map.Entry other_element : other.columns.entrySet()) { + + ByteBuffer other_element_key = other_element.getKey(); + TCell other_element_value = other_element.getValue(); + + ByteBuffer __this__columns_copy_key = other_element_key; + + TCell __this__columns_copy_value = new TCell(other_element_value); + + __this__columns.put(__this__columns_copy_key, __this__columns_copy_value); + } + this.columns = __this__columns; + } + if (other.isSetSortedColumns()) { + List __this__sortedColumns = new ArrayList(other.sortedColumns.size()); + for (TColumn other_element : other.sortedColumns) { + __this__sortedColumns.add(new TColumn(other_element)); + } + this.sortedColumns = __this__sortedColumns; + } + } + + public TRowResult deepCopy() { + return new TRowResult(this); + } + + @Override + public void clear() { + this.row = null; + this.columns = null; + this.sortedColumns = null; + } + + public byte[] getRow() { + setRow(org.apache.thrift.TBaseHelper.rightSize(row)); + return row == null ? null : row.array(); + } + + public ByteBuffer bufferForRow() { + return org.apache.thrift.TBaseHelper.copyBinary(row); + } + + public TRowResult setRow(byte[] row) { + this.row = row == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(row, row.length)); + return this; + } + + public TRowResult setRow(ByteBuffer row) { + this.row = org.apache.thrift.TBaseHelper.copyBinary(row); + return this; + } + + public void unsetRow() { + this.row = null; + } + + /** Returns true if field row is set (has been assigned a value) and false otherwise */ + public boolean isSetRow() { + return this.row != null; + } + + public void setRowIsSet(boolean value) { + if (!value) { + this.row = null; + } + } + + public int getColumnsSize() { + return (this.columns == null) ? 0 : this.columns.size(); + } + + public void putToColumns(ByteBuffer key, TCell val) { + if (this.columns == null) { + this.columns = new HashMap(); + } + this.columns.put(key, val); + } + + public Map getColumns() { + return this.columns; + } + + public TRowResult setColumns(Map 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 getSortedColumnsSize() { + return (this.sortedColumns == null) ? 0 : this.sortedColumns.size(); + } + + public java.util.Iterator getSortedColumnsIterator() { + return (this.sortedColumns == null) ? null : this.sortedColumns.iterator(); + } + + public void addToSortedColumns(TColumn elem) { + if (this.sortedColumns == null) { + this.sortedColumns = new ArrayList(); + } + this.sortedColumns.add(elem); + } + + public List getSortedColumns() { + return this.sortedColumns; + } + + public TRowResult setSortedColumns(List sortedColumns) { + this.sortedColumns = sortedColumns; + return this; + } + + public void unsetSortedColumns() { + this.sortedColumns = null; + } + + /** Returns true if field sortedColumns is set (has been assigned a value) and false otherwise */ + public boolean isSetSortedColumns() { + return this.sortedColumns != null; + } + + public void setSortedColumnsIsSet(boolean value) { + if (!value) { + this.sortedColumns = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case ROW: + if (value == null) { + unsetRow(); + } else { + setRow((ByteBuffer)value); + } + break; + + case COLUMNS: + if (value == null) { + unsetColumns(); + } else { + setColumns((Map)value); + } + break; + + case SORTED_COLUMNS: + if (value == null) { + unsetSortedColumns(); + } else { + setSortedColumns((List)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case ROW: + return getRow(); + + case COLUMNS: + return getColumns(); + + case SORTED_COLUMNS: + return getSortedColumns(); + + } + 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 ROW: + return isSetRow(); + case COLUMNS: + return isSetColumns(); + case SORTED_COLUMNS: + return isSetSortedColumns(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TRowResult) + return this.equals((TRowResult)that); + return false; + } + + public boolean equals(TRowResult that) { + if (that == null) + return false; + + boolean this_present_row = true && this.isSetRow(); + boolean that_present_row = true && that.isSetRow(); + if (this_present_row || that_present_row) { + if (!(this_present_row && that_present_row)) + return false; + if (!this.row.equals(that.row)) + 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_sortedColumns = true && this.isSetSortedColumns(); + boolean that_present_sortedColumns = true && that.isSetSortedColumns(); + if (this_present_sortedColumns || that_present_sortedColumns) { + if (!(this_present_sortedColumns && that_present_sortedColumns)) + return false; + if (!this.sortedColumns.equals(that.sortedColumns)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_row = true && (isSetRow()); + list.add(present_row); + if (present_row) + list.add(row); + + boolean present_columns = true && (isSetColumns()); + list.add(present_columns); + if (present_columns) + list.add(columns); + + boolean present_sortedColumns = true && (isSetSortedColumns()); + list.add(present_sortedColumns); + if (present_sortedColumns) + list.add(sortedColumns); + + return list.hashCode(); + } + + @Override + public int compareTo(TRowResult other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetRow()).compareTo(other.isSetRow()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRow()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.row, other.row); + 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(isSetSortedColumns()).compareTo(other.isSetSortedColumns()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSortedColumns()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sortedColumns, other.sortedColumns); + 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("TRowResult("); + boolean first = true; + + sb.append("row:"); + if (this.row == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.row, sb); + } + 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 (isSetSortedColumns()) { + if (!first) sb.append(", "); + sb.append("sortedColumns:"); + if (this.sortedColumns == null) { + sb.append("null"); + } else { + sb.append(this.sortedColumns); + } + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 TRowResultStandardSchemeFactory implements SchemeFactory { + public TRowResultStandardScheme getScheme() { + return new TRowResultStandardScheme(); + } + } + + private static class TRowResultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TRowResult 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: // ROW + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.row = iprot.readBinary(); + struct.setRowIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // COLUMNS + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map8 = iprot.readMapBegin(); + struct.columns = new HashMap(2*_map8.size); + ByteBuffer _key9; + TCell _val10; + for (int _i11 = 0; _i11 < _map8.size; ++_i11) + { + _key9 = iprot.readBinary(); + _val10 = new TCell(); + _val10.read(iprot); + struct.columns.put(_key9, _val10); + } + iprot.readMapEnd(); + } + struct.setColumnsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // SORTED_COLUMNS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list12 = iprot.readListBegin(); + struct.sortedColumns = new ArrayList(_list12.size); + TColumn _elem13; + for (int _i14 = 0; _i14 < _list12.size; ++_i14) + { + _elem13 = new TColumn(); + _elem13.read(iprot); + struct.sortedColumns.add(_elem13); + } + iprot.readListEnd(); + } + struct.setSortedColumnsIsSet(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, TRowResult struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.row != null) { + oprot.writeFieldBegin(ROW_FIELD_DESC); + oprot.writeBinary(struct.row); + oprot.writeFieldEnd(); + } + if (struct.columns != null) { + if (struct.isSetColumns()) { + oprot.writeFieldBegin(COLUMNS_FIELD_DESC); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, struct.columns.size())); + for (Map.Entry _iter15 : struct.columns.entrySet()) + { + oprot.writeBinary(_iter15.getKey()); + _iter15.getValue().write(oprot); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + } + if (struct.sortedColumns != null) { + if (struct.isSetSortedColumns()) { + oprot.writeFieldBegin(SORTED_COLUMNS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.sortedColumns.size())); + for (TColumn _iter16 : struct.sortedColumns) + { + _iter16.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TRowResultTupleSchemeFactory implements SchemeFactory { + public TRowResultTupleScheme getScheme() { + return new TRowResultTupleScheme(); + } + } + + private static class TRowResultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TRowResult struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetRow()) { + optionals.set(0); + } + if (struct.isSetColumns()) { + optionals.set(1); + } + if (struct.isSetSortedColumns()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetRow()) { + oprot.writeBinary(struct.row); + } + if (struct.isSetColumns()) { + { + oprot.writeI32(struct.columns.size()); + for (Map.Entry _iter17 : struct.columns.entrySet()) + { + oprot.writeBinary(_iter17.getKey()); + _iter17.getValue().write(oprot); + } + } + } + if (struct.isSetSortedColumns()) { + { + oprot.writeI32(struct.sortedColumns.size()); + for (TColumn _iter18 : struct.sortedColumns) + { + _iter18.write(oprot); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TRowResult struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + struct.row = iprot.readBinary(); + struct.setRowIsSet(true); + } + if (incoming.get(1)) { + { + org.apache.thrift.protocol.TMap _map19 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.columns = new HashMap(2*_map19.size); + ByteBuffer _key20; + TCell _val21; + for (int _i22 = 0; _i22 < _map19.size; ++_i22) + { + _key20 = iprot.readBinary(); + _val21 = new TCell(); + _val21.read(iprot); + struct.columns.put(_key20, _val21); + } + } + struct.setColumnsIsSet(true); + } + if (incoming.get(2)) { + { + org.apache.thrift.protocol.TList _list23 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.sortedColumns = new ArrayList(_list23.size); + TColumn _elem24; + for (int _i25 = 0; _i25 < _list23.size; ++_i25) + { + _elem24 = new TColumn(); + _elem24.read(iprot); + struct.sortedColumns.add(_elem24); + } + } + struct.setSortedColumnsIsSet(true); + } + } + } + +} + diff --git "a/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/generated/TScan.java" "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/generated/TScan.java" new file mode 100644 index 00000000000..3faadd9ee50 --- /dev/null +++ "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift/generated/TScan.java" @@ -0,0 +1,1406 @@ +/** + * 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.thrift.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"}) +/** + * 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") +public class TScan implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TScan"); + + private static final org.apache.thrift.protocol.TField START_ROW_FIELD_DESC = new org.apache.thrift.protocol.TField("startRow", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField STOP_ROW_FIELD_DESC = new org.apache.thrift.protocol.TField("stopRow", org.apache.thrift.protocol.TType.STRING, (short)2); + 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)3); + 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)4); + private static final org.apache.thrift.protocol.TField CACHING_FIELD_DESC = new org.apache.thrift.protocol.TField("caching", org.apache.thrift.protocol.TType.I32, (short)5); + private static final org.apache.thrift.protocol.TField FILTER_STRING_FIELD_DESC = new org.apache.thrift.protocol.TField("filterString", org.apache.thrift.protocol.TType.STRING, (short)6); + private static final org.apache.thrift.protocol.TField BATCH_SIZE_FIELD_DESC = new org.apache.thrift.protocol.TField("batchSize", org.apache.thrift.protocol.TType.I32, (short)7); + private static final org.apache.thrift.protocol.TField SORT_COLUMNS_FIELD_DESC = new org.apache.thrift.protocol.TField("sortColumns", org.apache.thrift.protocol.TType.BOOL, (short)8); + private static final org.apache.thrift.protocol.TField REVERSED_FIELD_DESC = new org.apache.thrift.protocol.TField("reversed", org.apache.thrift.protocol.TType.BOOL, (short)9); + 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)10); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TScanStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TScanTupleSchemeFactory()); + } + + public ByteBuffer startRow; // optional + public ByteBuffer stopRow; // optional + public long timestamp; // optional + public List columns; // optional + public int caching; // optional + public ByteBuffer filterString; // optional + public int batchSize; // optional + public boolean sortColumns; // optional + public boolean reversed; // optional + public boolean cacheBlocks; // 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 { + START_ROW((short)1, "startRow"), + STOP_ROW((short)2, "stopRow"), + TIMESTAMP((short)3, "timestamp"), + COLUMNS((short)4, "columns"), + CACHING((short)5, "caching"), + FILTER_STRING((short)6, "filterString"), + BATCH_SIZE((short)7, "batchSize"), + SORT_COLUMNS((short)8, "sortColumns"), + REVERSED((short)9, "reversed"), + CACHE_BLOCKS((short)10, "cacheBlocks"); + + private static final Map byName = new HashMap(); + + 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: // START_ROW + return START_ROW; + case 2: // STOP_ROW + return STOP_ROW; + case 3: // TIMESTAMP + return TIMESTAMP; + case 4: // COLUMNS + return COLUMNS; + case 5: // CACHING + return CACHING; + case 6: // FILTER_STRING + return FILTER_STRING; + case 7: // BATCH_SIZE + return BATCH_SIZE; + case 8: // SORT_COLUMNS + return SORT_COLUMNS; + case 9: // REVERSED + return REVERSED; + case 10: // CACHE_BLOCKS + return CACHE_BLOCKS; + 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 int __TIMESTAMP_ISSET_ID = 0; + private static final int __CACHING_ISSET_ID = 1; + private static final int __BATCHSIZE_ISSET_ID = 2; + private static final int __SORTCOLUMNS_ISSET_ID = 3; + private static final int __REVERSED_ISSET_ID = 4; + private static final int __CACHEBLOCKS_ISSET_ID = 5; + private byte __isset_bitfield = 0; + private static final _Fields optionals[] = {_Fields.START_ROW,_Fields.STOP_ROW,_Fields.TIMESTAMP,_Fields.COLUMNS,_Fields.CACHING,_Fields.FILTER_STRING,_Fields.BATCH_SIZE,_Fields.SORT_COLUMNS,_Fields.REVERSED,_Fields.CACHE_BLOCKS}; + 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.START_ROW, new org.apache.thrift.meta_data.FieldMetaData("startRow", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.STOP_ROW, new org.apache.thrift.meta_data.FieldMetaData("stopRow", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("timestamp", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + 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.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text")))); + tmpMap.put(_Fields.CACHING, new org.apache.thrift.meta_data.FieldMetaData("caching", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.FILTER_STRING, new org.apache.thrift.meta_data.FieldMetaData("filterString", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); + tmpMap.put(_Fields.BATCH_SIZE, new org.apache.thrift.meta_data.FieldMetaData("batchSize", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.SORT_COLUMNS, new org.apache.thrift.meta_data.FieldMetaData("sortColumns", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + tmpMap.put(_Fields.REVERSED, new org.apache.thrift.meta_data.FieldMetaData("reversed", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + 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))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TScan.class, metaDataMap); + } + + public TScan() { + } + + /** + * Performs a deep copy on other. + */ + public TScan(TScan other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetStartRow()) { + this.startRow = other.startRow; + } + if (other.isSetStopRow()) { + this.stopRow = other.stopRow; + } + this.timestamp = other.timestamp; + if (other.isSetColumns()) { + List __this__columns = new ArrayList(other.columns.size()); + for (ByteBuffer other_element : other.columns) { + __this__columns.add(other_element); + } + this.columns = __this__columns; + } + this.caching = other.caching; + if (other.isSetFilterString()) { + this.filterString = other.filterString; + } + this.batchSize = other.batchSize; + this.sortColumns = other.sortColumns; + this.reversed = other.reversed; + this.cacheBlocks = other.cacheBlocks; + } + + public TScan deepCopy() { + return new TScan(this); + } + + @Override + public void clear() { + this.startRow = null; + this.stopRow = null; + setTimestampIsSet(false); + this.timestamp = 0; + this.columns = null; + setCachingIsSet(false); + this.caching = 0; + this.filterString = null; + setBatchSizeIsSet(false); + this.batchSize = 0; + setSortColumnsIsSet(false); + this.sortColumns = false; + setReversedIsSet(false); + this.reversed = false; + setCacheBlocksIsSet(false); + this.cacheBlocks = false; + } + + public byte[] getStartRow() { + setStartRow(org.apache.thrift.TBaseHelper.rightSize(startRow)); + return startRow == null ? null : startRow.array(); + } + + public ByteBuffer bufferForStartRow() { + return org.apache.thrift.TBaseHelper.copyBinary(startRow); + } + + public TScan setStartRow(byte[] startRow) { + this.startRow = startRow == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(startRow, startRow.length)); + return this; + } + + public TScan setStartRow(ByteBuffer startRow) { + this.startRow = org.apache.thrift.TBaseHelper.copyBinary(startRow); + return this; + } + + public void unsetStartRow() { + this.startRow = null; + } + + /** Returns true if field startRow is set (has been assigned a value) and false otherwise */ + public boolean isSetStartRow() { + return this.startRow != null; + } + + public void setStartRowIsSet(boolean value) { + if (!value) { + this.startRow = null; + } + } + + public byte[] getStopRow() { + setStopRow(org.apache.thrift.TBaseHelper.rightSize(stopRow)); + return stopRow == null ? null : stopRow.array(); + } + + public ByteBuffer bufferForStopRow() { + return org.apache.thrift.TBaseHelper.copyBinary(stopRow); + } + + public TScan setStopRow(byte[] stopRow) { + this.stopRow = stopRow == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(stopRow, stopRow.length)); + return this; + } + + public TScan setStopRow(ByteBuffer stopRow) { + this.stopRow = org.apache.thrift.TBaseHelper.copyBinary(stopRow); + return this; + } + + public void unsetStopRow() { + this.stopRow = null; + } + + /** Returns true if field stopRow is set (has been assigned a value) and false otherwise */ + public boolean isSetStopRow() { + return this.stopRow != null; + } + + public void setStopRowIsSet(boolean value) { + if (!value) { + this.stopRow = null; + } + } + + public long getTimestamp() { + return this.timestamp; + } + + public TScan setTimestamp(long timestamp) { + this.timestamp = timestamp; + setTimestampIsSet(true); + return this; + } + + public void unsetTimestamp() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); + } + + /** Returns true if field timestamp is set (has been assigned a value) and false otherwise */ + public boolean isSetTimestamp() { + return EncodingUtils.testBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); + } + + public void setTimestampIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TIMESTAMP_ISSET_ID, value); + } + + public int getColumnsSize() { + return (this.columns == null) ? 0 : this.columns.size(); + } + + public java.util.Iterator getColumnsIterator() { + return (this.columns == null) ? null : this.columns.iterator(); + } + + public void addToColumns(ByteBuffer elem) { + if (this.columns == null) { + this.columns = new ArrayList(); + } + this.columns.add(elem); + } + + public List getColumns() { + return this.columns; + } + + public TScan setColumns(List 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 getCaching() { + return this.caching; + } + + public TScan setCaching(int caching) { + this.caching = caching; + setCachingIsSet(true); + return this; + } + + public void unsetCaching() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CACHING_ISSET_ID); + } + + /** Returns true if field caching is set (has been assigned a value) and false otherwise */ + public boolean isSetCaching() { + return EncodingUtils.testBit(__isset_bitfield, __CACHING_ISSET_ID); + } + + public void setCachingIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CACHING_ISSET_ID, value); + } + + public byte[] getFilterString() { + setFilterString(org.apache.thrift.TBaseHelper.rightSize(filterString)); + return filterString == null ? null : filterString.array(); + } + + public ByteBuffer bufferForFilterString() { + return org.apache.thrift.TBaseHelper.copyBinary(filterString); + } + + public TScan setFilterString(byte[] filterString) { + this.filterString = filterString == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(filterString, filterString.length)); + return this; + } + + public TScan setFilterString(ByteBuffer filterString) { + this.filterString = org.apache.thrift.TBaseHelper.copyBinary(filterString); + return this; + } + + public void unsetFilterString() { + this.filterString = null; + } + + /** Returns true if field filterString is set (has been assigned a value) and false otherwise */ + public boolean isSetFilterString() { + return this.filterString != null; + } + + public void setFilterStringIsSet(boolean value) { + if (!value) { + this.filterString = null; + } + } + + public int getBatchSize() { + return this.batchSize; + } + + public TScan setBatchSize(int batchSize) { + this.batchSize = batchSize; + setBatchSizeIsSet(true); + return this; + } + + public void unsetBatchSize() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __BATCHSIZE_ISSET_ID); + } + + /** Returns true if field batchSize is set (has been assigned a value) and false otherwise */ + public boolean isSetBatchSize() { + return EncodingUtils.testBit(__isset_bitfield, __BATCHSIZE_ISSET_ID); + } + + public void setBatchSizeIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __BATCHSIZE_ISSET_ID, value); + } + + public boolean isSortColumns() { + return this.sortColumns; + } + + public TScan setSortColumns(boolean sortColumns) { + this.sortColumns = sortColumns; + setSortColumnsIsSet(true); + return this; + } + + public void unsetSortColumns() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SORTCOLUMNS_ISSET_ID); + } + + /** Returns true if field sortColumns is set (has been assigned a value) and false otherwise */ + public boolean isSetSortColumns() { + return EncodingUtils.testBit(__isset_bitfield, __SORTCOLUMNS_ISSET_ID); + } + + public void setSortColumnsIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SORTCOLUMNS_ISSET_ID, value); + } + + public boolean isReversed() { + return this.reversed; + } + + public TScan setReversed(boolean reversed) { + this.reversed = reversed; + setReversedIsSet(true); + return this; + } + + public void unsetReversed() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __REVERSED_ISSET_ID); + } + + /** Returns true if field reversed is set (has been assigned a value) and false otherwise */ + public boolean isSetReversed() { + return EncodingUtils.testBit(__isset_bitfield, __REVERSED_ISSET_ID); + } + + public void setReversedIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __REVERSED_ISSET_ID, value); + } + + public boolean isCacheBlocks() { + return this.cacheBlocks; + } + + public TScan 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 void setFieldValue(_Fields field, Object value) { + switch (field) { + case START_ROW: + if (value == null) { + unsetStartRow(); + } else { + setStartRow((ByteBuffer)value); + } + break; + + case STOP_ROW: + if (value == null) { + unsetStopRow(); + } else { + setStopRow((ByteBuffer)value); + } + break; + + case TIMESTAMP: + if (value == null) { + unsetTimestamp(); + } else { + setTimestamp((Long)value); + } + break; + + case COLUMNS: + if (value == null) { + unsetColumns(); + } else { + setColumns((List)value); + } + break; + + case CACHING: + if (value == null) { + unsetCaching(); + } else { + setCaching((Integer)value); + } + break; + + case FILTER_STRING: + if (value == null) { + unsetFilterString(); + } else { + setFilterString((ByteBuffer)value); + } + break; + + case BATCH_SIZE: + if (value == null) { + unsetBatchSize(); + } else { + setBatchSize((Integer)value); + } + break; + + case SORT_COLUMNS: + if (value == null) { + unsetSortColumns(); + } else { + setSortColumns((Boolean)value); + } + break; + + case REVERSED: + if (value == null) { + unsetReversed(); + } else { + setReversed((Boolean)value); + } + break; + + case CACHE_BLOCKS: + if (value == null) { + unsetCacheBlocks(); + } else { + setCacheBlocks((Boolean)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case START_ROW: + return getStartRow(); + + case STOP_ROW: + return getStopRow(); + + case TIMESTAMP: + return getTimestamp(); + + case COLUMNS: + return getColumns(); + + case CACHING: + return getCaching(); + + case FILTER_STRING: + return getFilterString(); + + case BATCH_SIZE: + return getBatchSize(); + + case SORT_COLUMNS: + return isSortColumns(); + + case REVERSED: + return isReversed(); + + case CACHE_BLOCKS: + return isCacheBlocks(); + + } + 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 START_ROW: + return isSetStartRow(); + case STOP_ROW: + return isSetStopRow(); + case TIMESTAMP: + return isSetTimestamp(); + case COLUMNS: + return isSetColumns(); + case CACHING: + return isSetCaching(); + case FILTER_STRING: + return isSetFilterString(); + case BATCH_SIZE: + return isSetBatchSize(); + case SORT_COLUMNS: + return isSetSortColumns(); + case REVERSED: + return isSetReversed(); + case CACHE_BLOCKS: + return isSetCacheBlocks(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TScan) + return this.equals((TScan)that); + return false; + } + + public boolean equals(TScan that) { + if (that == null) + return false; + + boolean this_present_startRow = true && this.isSetStartRow(); + boolean that_present_startRow = true && that.isSetStartRow(); + if (this_present_startRow || that_present_startRow) { + if (!(this_present_startRow && that_present_startRow)) + return false; + if (!this.startRow.equals(that.startRow)) + return false; + } + + boolean this_present_stopRow = true && this.isSetStopRow(); + boolean that_present_stopRow = true && that.isSetStopRow(); + if (this_present_stopRow || that_present_stopRow) { + if (!(this_present_stopRow && that_present_stopRow)) + return false; + if (!this.stopRow.equals(that.stopRow)) + return false; + } + + boolean this_present_timestamp = true && this.isSetTimestamp(); + boolean that_present_timestamp = true && that.isSetTimestamp(); + if (this_present_timestamp || that_present_timestamp) { + if (!(this_present_timestamp && that_present_timestamp)) + return false; + if (this.timestamp != that.timestamp) + 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_caching = true && this.isSetCaching(); + boolean that_present_caching = true && that.isSetCaching(); + if (this_present_caching || that_present_caching) { + if (!(this_present_caching && that_present_caching)) + return false; + if (this.caching != that.caching) + return false; + } + + boolean this_present_filterString = true && this.isSetFilterString(); + boolean that_present_filterString = true && that.isSetFilterString(); + if (this_present_filterString || that_present_filterString) { + if (!(this_present_filterString && that_present_filterString)) + return false; + if (!this.filterString.equals(that.filterString)) + return false; + } + + boolean this_present_batchSize = true && this.isSetBatchSize(); + boolean that_present_batchSize = true && that.isSetBatchSize(); + if (this_present_batchSize || that_present_batchSize) { + if (!(this_present_batchSize && that_present_batchSize)) + return false; + if (this.batchSize != that.batchSize) + return false; + } + + boolean this_present_sortColumns = true && this.isSetSortColumns(); + boolean that_present_sortColumns = true && that.isSetSortColumns(); + if (this_present_sortColumns || that_present_sortColumns) { + if (!(this_present_sortColumns && that_present_sortColumns)) + return false; + if (this.sortColumns != that.sortColumns) + return false; + } + + boolean this_present_reversed = true && this.isSetReversed(); + boolean that_present_reversed = true && that.isSetReversed(); + if (this_present_reversed || that_present_reversed) { + if (!(this_present_reversed && that_present_reversed)) + return false; + if (this.reversed != that.reversed) + 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; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_startRow = true && (isSetStartRow()); + list.add(present_startRow); + if (present_startRow) + list.add(startRow); + + boolean present_stopRow = true && (isSetStopRow()); + list.add(present_stopRow); + if (present_stopRow) + list.add(stopRow); + + boolean present_timestamp = true && (isSetTimestamp()); + list.add(present_timestamp); + if (present_timestamp) + list.add(timestamp); + + boolean present_columns = true && (isSetColumns()); + list.add(present_columns); + if (present_columns) + list.add(columns); + + boolean present_caching = true && (isSetCaching()); + list.add(present_caching); + if (present_caching) + list.add(caching); + + boolean present_filterString = true && (isSetFilterString()); + list.add(present_filterString); + if (present_filterString) + list.add(filterString); + + boolean present_batchSize = true && (isSetBatchSize()); + list.add(present_batchSize); + if (present_batchSize) + list.add(batchSize); + + boolean present_sortColumns = true && (isSetSortColumns()); + list.add(present_sortColumns); + if (present_sortColumns) + list.add(sortColumns); + + boolean present_reversed = true && (isSetReversed()); + list.add(present_reversed); + if (present_reversed) + list.add(reversed); + + boolean present_cacheBlocks = true && (isSetCacheBlocks()); + list.add(present_cacheBlocks); + if (present_cacheBlocks) + list.add(cacheBlocks); + + return list.hashCode(); + } + + @Override + public int compareTo(TScan other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetStartRow()).compareTo(other.isSetStartRow()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStartRow()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startRow, other.startRow); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetStopRow()).compareTo(other.isSetStopRow()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStopRow()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stopRow, other.stopRow); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(other.isSetTimestamp()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTimestamp()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timestamp, other.timestamp); + 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(isSetCaching()).compareTo(other.isSetCaching()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetCaching()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.caching, other.caching); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetFilterString()).compareTo(other.isSetFilterString()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetFilterString()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.filterString, other.filterString); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetBatchSize()).compareTo(other.isSetBatchSize()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetBatchSize()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.batchSize, other.batchSize); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetSortColumns()).compareTo(other.isSetSortColumns()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSortColumns()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sortColumns, other.sortColumns); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetReversed()).compareTo(other.isSetReversed()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetReversed()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.reversed, other.reversed); + if (lastComparison != 0) { + 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; + } + } + 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("TScan("); + boolean first = true; + + if (isSetStartRow()) { + sb.append("startRow:"); + if (this.startRow == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.startRow, sb); + } + first = false; + } + if (isSetStopRow()) { + if (!first) sb.append(", "); + sb.append("stopRow:"); + if (this.stopRow == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.stopRow, sb); + } + first = false; + } + if (isSetTimestamp()) { + if (!first) sb.append(", "); + sb.append("timestamp:"); + sb.append(this.timestamp); + first = false; + } + if (isSetColumns()) { + if (!first) sb.append(", "); + sb.append("columns:"); + if (this.columns == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.columns, sb); + } + first = false; + } + if (isSetCaching()) { + if (!first) sb.append(", "); + sb.append("caching:"); + sb.append(this.caching); + first = false; + } + if (isSetFilterString()) { + if (!first) sb.append(", "); + sb.append("filterString:"); + if (this.filterString == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.filterString, sb); + } + first = false; + } + if (isSetBatchSize()) { + if (!first) sb.append(", "); + sb.append("batchSize:"); + sb.append(this.batchSize); + first = false; + } + if (isSetSortColumns()) { + if (!first) sb.append(", "); + sb.append("sortColumns:"); + sb.append(this.sortColumns); + first = false; + } + if (isSetReversed()) { + if (!first) sb.append(", "); + sb.append("reversed:"); + sb.append(this.reversed); + first = false; + } + if (isSetCacheBlocks()) { + if (!first) sb.append(", "); + sb.append("cacheBlocks:"); + sb.append(this.cacheBlocks); + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 { + // 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); + } + } + + private static class TScanStandardSchemeFactory implements SchemeFactory { + public TScanStandardScheme getScheme() { + return new TScanStandardScheme(); + } + } + + private static class TScanStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TScan 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: // START_ROW + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.startRow = iprot.readBinary(); + struct.setStartRowIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // STOP_ROW + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.stopRow = iprot.readBinary(); + struct.setStopRowIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // TIMESTAMP + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.timestamp = iprot.readI64(); + struct.setTimestampIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // COLUMNS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list26 = iprot.readListBegin(); + struct.columns = new ArrayList(_list26.size); + ByteBuffer _elem27; + for (int _i28 = 0; _i28 < _list26.size; ++_i28) + { + _elem27 = iprot.readBinary(); + struct.columns.add(_elem27); + } + iprot.readListEnd(); + } + struct.setColumnsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // CACHING + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.caching = iprot.readI32(); + struct.setCachingIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 6: // FILTER_STRING + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.filterString = iprot.readBinary(); + struct.setFilterStringIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 7: // BATCH_SIZE + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.batchSize = iprot.readI32(); + struct.setBatchSizeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 8: // SORT_COLUMNS + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.sortColumns = iprot.readBool(); + struct.setSortColumnsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 9: // REVERSED + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.reversed = iprot.readBool(); + struct.setReversedIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 10: // 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; + 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, TScan struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.startRow != null) { + if (struct.isSetStartRow()) { + oprot.writeFieldBegin(START_ROW_FIELD_DESC); + oprot.writeBinary(struct.startRow); + oprot.writeFieldEnd(); + } + } + if (struct.stopRow != null) { + if (struct.isSetStopRow()) { + oprot.writeFieldBegin(STOP_ROW_FIELD_DESC); + oprot.writeBinary(struct.stopRow); + oprot.writeFieldEnd(); + } + } + if (struct.isSetTimestamp()) { + oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC); + oprot.writeI64(struct.timestamp); + 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.STRING, struct.columns.size())); + for (ByteBuffer _iter29 : struct.columns) + { + oprot.writeBinary(_iter29); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + } + if (struct.isSetCaching()) { + oprot.writeFieldBegin(CACHING_FIELD_DESC); + oprot.writeI32(struct.caching); + oprot.writeFieldEnd(); + } + if (struct.filterString != null) { + if (struct.isSetFilterString()) { + oprot.writeFieldBegin(FILTER_STRING_FIELD_DESC); + oprot.writeBinary(struct.filterString); + oprot.writeFieldEnd(); + } + } + if (struct.isSetBatchSize()) { + oprot.writeFieldBegin(BATCH_SIZE_FIELD_DESC); + oprot.writeI32(struct.batchSize); + oprot.writeFieldEnd(); + } + if (struct.isSetSortColumns()) { + oprot.writeFieldBegin(SORT_COLUMNS_FIELD_DESC); + oprot.writeBool(struct.sortColumns); + oprot.writeFieldEnd(); + } + if (struct.isSetReversed()) { + oprot.writeFieldBegin(REVERSED_FIELD_DESC); + oprot.writeBool(struct.reversed); + oprot.writeFieldEnd(); + } + if (struct.isSetCacheBlocks()) { + oprot.writeFieldBegin(CACHE_BLOCKS_FIELD_DESC); + oprot.writeBool(struct.cacheBlocks); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TScanTupleSchemeFactory implements SchemeFactory { + public TScanTupleScheme getScheme() { + return new TScanTupleScheme(); + } + } + + private static class TScanTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TScan struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetStartRow()) { + optionals.set(0); + } + if (struct.isSetStopRow()) { + optionals.set(1); + } + if (struct.isSetTimestamp()) { + optionals.set(2); + } + if (struct.isSetColumns()) { + optionals.set(3); + } + if (struct.isSetCaching()) { + optionals.set(4); + } + if (struct.isSetFilterString()) { + optionals.set(5); + } + if (struct.isSetBatchSize()) { + optionals.set(6); + } + if (struct.isSetSortColumns()) { + optionals.set(7); + } + if (struct.isSetReversed()) { + optionals.set(8); + } + if (struct.isSetCacheBlocks()) { + optionals.set(9); + } + oprot.writeBitSet(optionals, 10); + if (struct.isSetStartRow()) { + oprot.writeBinary(struct.startRow); + } + if (struct.isSetStopRow()) { + oprot.writeBinary(struct.stopRow); + } + if (struct.isSetTimestamp()) { + oprot.writeI64(struct.timestamp); + } + if (struct.isSetColumns()) { + { + oprot.writeI32(struct.columns.size()); + for (ByteBuffer _iter30 : struct.columns) + { + oprot.writeBinary(_iter30); + } + } + } + if (struct.isSetCaching()) { + oprot.writeI32(struct.caching); + } + if (struct.isSetFilterString()) { + oprot.writeBinary(struct.filterString); + } + if (struct.isSetBatchSize()) { + oprot.writeI32(struct.batchSize); + } + if (struct.isSetSortColumns()) { + oprot.writeBool(struct.sortColumns); + } + if (struct.isSetReversed()) { + oprot.writeBool(struct.reversed); + } + if (struct.isSetCacheBlocks()) { + oprot.writeBool(struct.cacheBlocks); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TScan struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(10); + if (incoming.get(0)) { + struct.startRow = iprot.readBinary(); + struct.setStartRowIsSet(true); + } + if (incoming.get(1)) { + struct.stopRow = iprot.readBinary(); + struct.setStopRowIsSet(true); + } + if (incoming.get(2)) { + struct.timestamp = iprot.readI64(); + struct.setTimestampIsSet(true); + } + if (incoming.get(3)) { + { + org.apache.thrift.protocol.TList _list31 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.columns = new ArrayList(_list31.size); + ByteBuffer _elem32; + for (int _i33 = 0; _i33 < _list31.size; ++_i33) + { + _elem32 = iprot.readBinary(); + struct.columns.add(_elem32); + } + } + struct.setColumnsIsSet(true); + } + if (incoming.get(4)) { + struct.caching = iprot.readI32(); + struct.setCachingIsSet(true); + } + if (incoming.get(5)) { + struct.filterString = iprot.readBinary(); + struct.setFilterStringIsSet(true); + } + if (incoming.get(6)) { + struct.batchSize = iprot.readI32(); + struct.setBatchSizeIsSet(true); + } + if (incoming.get(7)) { + struct.sortColumns = iprot.readBool(); + struct.setSortColumnsIsSet(true); + } + if (incoming.get(8)) { + struct.reversed = iprot.readBool(); + struct.setReversedIsSet(true); + } + if (incoming.get(9)) { + struct.cacheBlocks = iprot.readBool(); + struct.setCacheBlocksIsSet(true); + } + } + } + +} + diff --git "a/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/ThriftHBaseServiceHandler.java" "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/ThriftHBaseServiceHandler.java" new file mode 100644 index 00000000000..a69a7df3574 --- /dev/null +++ "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/ThriftHBaseServiceHandler.java" @@ -0,0 +1,487 @@ +/** + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.hadoop.hbase.thrift2; + +import static org.apache.hadoop.hbase.thrift2.ThriftUtilities.appendFromThrift; +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.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.thrift.TBaseHelper.byteBufferToByteArray; + +import java.io.IOException; +import java.lang.reflect.InvocationHandler; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.lang.reflect.Proxy; +import java.nio.ByteBuffer; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.atomic.AtomicInteger; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hbase.HRegionLocation; +import org.apache.hadoop.hbase.classification.InterfaceAudience; +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.security.UserProvider; +import org.apache.hadoop.hbase.thrift.ThriftMetrics; +import org.apache.hadoop.hbase.thrift2.generated.TAppend; +import org.apache.hadoop.hbase.thrift2.generated.TCompareOp; +import org.apache.hadoop.hbase.thrift2.generated.TDelete; +import org.apache.hadoop.hbase.thrift2.generated.TGet; +import org.apache.hadoop.hbase.thrift2.generated.THBaseService; +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.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.util.Bytes; +import org.apache.hadoop.hbase.util.ConnectionCache; +import org.apache.thrift.TException; + +/** + * This class is a glue object that connects Thrift RPC calls to the HBase client API primarily + * defined in the Table interface. + */ +@InterfaceAudience.Private +@SuppressWarnings("deprecation") +public class ThriftHBaseServiceHandler implements THBaseService.Iface { + + // TODO: Size of pool configuraple + private static final Log LOG = LogFactory.getLog(ThriftHBaseServiceHandler.class); + + // nextScannerId and scannerMap are used to manage scanner state + // TODO: Cleanup thread for Scanners, Scanner id wrap + private final AtomicInteger nextScannerId = new AtomicInteger(0); + private final Map scannerMap = + new ConcurrentHashMap(); + + private final ConnectionCache connectionCache; + + static final String CLEANUP_INTERVAL = "hbase.thrift.connection.cleanup-interval"; + static final String MAX_IDLETIME = "hbase.thrift.connection.max-idletime"; + + public static THBaseService.Iface newInstance( + THBaseService.Iface handler, ThriftMetrics metrics) { + return (THBaseService.Iface) Proxy.newProxyInstance(handler.getClass().getClassLoader(), + new Class[] { THBaseService.Iface.class }, new THBaseServiceMetricsProxy(handler, metrics)); + } + + private static final class THBaseServiceMetricsProxy implements InvocationHandler { + private final THBaseService.Iface handler; + private final ThriftMetrics metrics; + + private THBaseServiceMetricsProxy(THBaseService.Iface handler, ThriftMetrics metrics) { + this.handler = handler; + this.metrics = metrics; + } + + @Override + public Object invoke(Object proxy, Method m, Object[] args) throws Throwable { + Object result; + try { + long start = now(); + result = m.invoke(handler, args); + int processTime = (int) (now() - start); + metrics.incMethodTime(m.getName(), processTime); + } catch (InvocationTargetException e) { + throw e.getTargetException(); + } catch (Exception e) { + throw new RuntimeException("unexpected invocation exception: " + e.getMessage()); + } + return result; + } + } + + private static long now() { + return System.nanoTime(); + } + + ThriftHBaseServiceHandler(final Configuration conf, + final UserProvider userProvider) throws IOException { + int cleanInterval = conf.getInt(CLEANUP_INTERVAL, 10 * 1000); + int maxIdleTime = conf.getInt(MAX_IDLETIME, 10 * 60 * 1000); + connectionCache = new ConnectionCache( + conf, userProvider, cleanInterval, maxIdleTime); + } + + private Table getTable(ByteBuffer tableName) { + try { + return connectionCache.getTable(Bytes.toString(byteBufferToByteArray(tableName))); + } catch (IOException ie) { + throw new RuntimeException(ie); + } + } + + private RegionLocator getLocator(ByteBuffer tableName) { + try { + return connectionCache.getRegionLocator(byteBufferToByteArray(tableName)); + } catch (IOException ie) { + throw new RuntimeException(ie); + } + } + + private void closeTable(Table table) throws TIOError { + try { + table.close(); + } catch (IOException e) { + throw getTIOError(e); + } + } + + private TIOError getTIOError(IOException e) { + TIOError err = new TIOError(); + err.setMessage(e.getMessage()); + return err; + } + + /** + * Assigns a unique ID to the scanner and adds the mapping to an internal HashMap. + * @param scanner to add + * @return Id for this Scanner + */ + private int addScanner(ResultScanner scanner) { + int id = nextScannerId.getAndIncrement(); + scannerMap.put(id, scanner); + return id; + } + + /** + * Returns the Scanner associated with the specified Id. + * @param id of the Scanner to get + * @return a Scanner, or null if the Id is invalid + */ + private ResultScanner getScanner(int id) { + return scannerMap.get(id); + } + + void setEffectiveUser(String effectiveUser) { + connectionCache.setEffectiveUser(effectiveUser); + } + + /** + * Removes the scanner associated with the specified ID from the internal HashMap. + * @param id of the Scanner to remove + * @return the removed Scanner, or null if the Id is invalid + */ + protected ResultScanner removeScanner(int id) { + return scannerMap.remove(id); + } + + @Override + public boolean exists(ByteBuffer table, TGet get) throws TIOError, TException { + Table htable = getTable(table); + try { + return htable.exists(getFromThrift(get)); + } catch (IOException e) { + throw getTIOError(e); + } finally { + closeTable(htable); + } + } + + @Override + public TResult get(ByteBuffer table, TGet get) throws TIOError, TException { + Table htable = getTable(table); + try { + return resultFromHBase(htable.get(getFromThrift(get))); + } catch (IOException e) { + throw getTIOError(e); + } finally { + closeTable(htable); + } + } + + @Override + public List getMultiple(ByteBuffer table, List gets) throws TIOError, TException { + Table htable = getTable(table); + try { + return resultsFromHBase(htable.get(getsFromThrift(gets))); + } catch (IOException e) { + throw getTIOError(e); + } finally { + closeTable(htable); + } + } + + @Override + public void put(ByteBuffer table, TPut put) throws TIOError, TException { + Table htable = getTable(table); + try { + htable.put(putFromThrift(put)); + } catch (IOException e) { + throw getTIOError(e); + } finally { + closeTable(htable); + } + } + + @Override + public boolean checkAndPut(ByteBuffer table, ByteBuffer row, ByteBuffer family, + ByteBuffer qualifier, ByteBuffer value, TPut put) throws TIOError, TException { + Table htable = getTable(table); + try { + return htable.checkAndPut(byteBufferToByteArray(row), byteBufferToByteArray(family), + byteBufferToByteArray(qualifier), (value == null) ? null : byteBufferToByteArray(value), + putFromThrift(put)); + } catch (IOException e) { + throw getTIOError(e); + } finally { + closeTable(htable); + } + } + + @Override + public void putMultiple(ByteBuffer table, List puts) throws TIOError, TException { + Table htable = getTable(table); + try { + htable.put(putsFromThrift(puts)); + } catch (IOException e) { + throw getTIOError(e); + } finally { + closeTable(htable); + } + } + + @Override + public void deleteSingle(ByteBuffer table, TDelete deleteSingle) throws TIOError, TException { + Table htable = getTable(table); + try { + htable.delete(deleteFromThrift(deleteSingle)); + } catch (IOException e) { + throw getTIOError(e); + } finally { + closeTable(htable); + } + } + + @Override + public List deleteMultiple(ByteBuffer table, List deletes) throws TIOError, + TException { + Table htable = getTable(table); + try { + htable.delete(deletesFromThrift(deletes)); + } catch (IOException e) { + throw getTIOError(e); + } finally { + closeTable(htable); + } + return Collections.emptyList(); + } + + @Override + public boolean checkAndMutate(ByteBuffer table, ByteBuffer row, ByteBuffer family, + ByteBuffer qualifier, TCompareOp compareOp, ByteBuffer value, TRowMutations rowMutations) + throws TIOError, TException { + try (final Table htable = getTable(table)) { + return htable.checkAndMutate(byteBufferToByteArray(row), byteBufferToByteArray(family), + byteBufferToByteArray(qualifier), compareOpFromThrift(compareOp), + byteBufferToByteArray(value), rowMutationsFromThrift(rowMutations)); + } catch (IOException e) { + throw getTIOError(e); + } + } + + @Override + public boolean checkAndDelete(ByteBuffer table, ByteBuffer row, ByteBuffer family, + ByteBuffer qualifier, ByteBuffer value, TDelete deleteSingle) throws TIOError, TException { + Table htable = getTable(table); + + try { + if (value == null) { + return htable.checkAndDelete(byteBufferToByteArray(row), byteBufferToByteArray(family), + byteBufferToByteArray(qualifier), null, deleteFromThrift(deleteSingle)); + } else { + return htable.checkAndDelete(byteBufferToByteArray(row), byteBufferToByteArray(family), + byteBufferToByteArray(qualifier), byteBufferToByteArray(value), + deleteFromThrift(deleteSingle)); + } + } catch (IOException e) { + throw getTIOError(e); + } finally { + closeTable(htable); + } + } + + @Override + public TResult increment(ByteBuffer table, TIncrement increment) throws TIOError, TException { + Table htable = getTable(table); + try { + return resultFromHBase(htable.increment(incrementFromThrift(increment))); + } catch (IOException e) { + throw getTIOError(e); + } finally { + closeTable(htable); + } + } + + @Override + public TResult append(ByteBuffer table, TAppend append) throws TIOError, TException { + Table htable = getTable(table); + try { + return resultFromHBase(htable.append(appendFromThrift(append))); + } catch (IOException e) { + throw getTIOError(e); + } finally { + closeTable(htable); + } + } + + @Override + public int openScanner(ByteBuffer table, TScan scan) throws TIOError, TException { + Table htable = getTable(table); + ResultScanner resultScanner = null; + try { + resultScanner = htable.getScanner(scanFromThrift(scan)); + } catch (IOException e) { + throw getTIOError(e); + } finally { + closeTable(htable); + } + return addScanner(resultScanner); + } + + @Override + public List getScannerRows(int scannerId, int numRows) throws TIOError, + TIllegalArgument, TException { + ResultScanner scanner = getScanner(scannerId); + if (scanner == null) { + TIllegalArgument ex = new TIllegalArgument(); + ex.setMessage("Invalid scanner Id"); + throw ex; + } + try { + connectionCache.updateConnectionAccessTime(); + return resultsFromHBase(scanner.next(numRows)); + } catch (IOException e) { + throw getTIOError(e); + } + } + + @Override + public List getScannerResults(ByteBuffer table, TScan scan, int numRows) + throws TIOError, TException { + Table htable = getTable(table); + List results = null; + ResultScanner scanner = null; + try { + scanner = htable.getScanner(scanFromThrift(scan)); + results = resultsFromHBase(scanner.next(numRows)); + } catch (IOException e) { + throw getTIOError(e); + } finally { + if (scanner != null) { + scanner.close(); + } + closeTable(htable); + } + return results; + } + + + + @Override + public void closeScanner(int scannerId) throws TIOError, TIllegalArgument, TException { + LOG.debug("scannerClose: id=" + scannerId); + ResultScanner scanner = getScanner(scannerId); + if (scanner == null) { + String message = "scanner ID is invalid"; + LOG.warn(message); + TIllegalArgument ex = new TIllegalArgument(); + ex.setMessage("Invalid scanner Id"); + throw ex; + } + scanner.close(); + removeScanner(scannerId); + } + + @Override + public void mutateRow(ByteBuffer table, TRowMutations rowMutations) throws TIOError, TException { + Table htable = getTable(table); + try { + htable.mutateRow(rowMutationsFromThrift(rowMutations)); + } catch (IOException e) { + throw getTIOError(e); + } finally { + closeTable(htable); + } + } + + @Override + public List getAllRegionLocations(ByteBuffer table) + throws TIOError, TException { + RegionLocator locator = null; + try { + locator = getLocator(table); + return ThriftUtilities.regionLocationsFromHBase(locator.getAllRegionLocations()); + + } catch (IOException e) { + throw getTIOError(e); + } finally { + if (locator != null) { + try { + locator.close(); + } catch (IOException e) { + LOG.warn("Couldn't close the locator.", e); + } + } + } + } + + @Override + public THRegionLocation getRegionLocation(ByteBuffer table, ByteBuffer row, boolean reload) + throws TIOError, TException { + + RegionLocator locator = null; + try { + locator = getLocator(table); + byte[] rowBytes = byteBufferToByteArray(row); + HRegionLocation hrl = locator.getRegionLocation(rowBytes, reload); + return ThriftUtilities.regionLocationFromHBase(hrl); + + } catch (IOException e) { + throw getTIOError(e); + } finally { + if (locator != null) { + try { + locator.close(); + } catch (IOException e) { + LOG.warn("Couldn't close the locator.", e); + } + } + } + } +} diff --git "a/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/ThriftServer.java" "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/ThriftServer.java" new file mode 100644 index 00000000000..7d94d0e8cc6 --- /dev/null +++ "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/ThriftServer.java" @@ -0,0 +1,555 @@ +/** + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.hadoop.hbase.thrift2; + +import java.io.IOException; +import java.net.InetAddress; +import java.net.InetSocketAddress; +import java.net.UnknownHostException; +import java.security.PrivilegedAction; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.TimeUnit; + +import javax.security.auth.callback.Callback; +import javax.security.auth.callback.UnsupportedCallbackException; +import javax.security.sasl.AuthorizeCallback; +import javax.security.sasl.Sasl; +import javax.security.sasl.SaslServer; + +import org.apache.commons.cli.CommandLine; +import org.apache.commons.cli.CommandLineParser; +import org.apache.commons.cli.HelpFormatter; +import org.apache.commons.cli.Option; +import org.apache.commons.cli.OptionGroup; +import org.apache.commons.cli.Options; +import org.apache.commons.cli.ParseException; +import org.apache.commons.cli.PosixParser; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.hadoop.hbase.classification.InterfaceAudience; +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.conf.Configured; +import org.apache.hadoop.hbase.HBaseConfiguration; +import org.apache.hadoop.hbase.HBaseInterfaceAudience; +import org.apache.hadoop.hbase.filter.ParseFilter; +import org.apache.hadoop.hbase.http.InfoServer; +import org.apache.hadoop.hbase.security.SaslUtil; +import org.apache.hadoop.hbase.security.SecurityUtil; +import org.apache.hadoop.hbase.security.UserProvider; +import org.apache.hadoop.hbase.thrift.CallQueue; +import org.apache.hadoop.hbase.thrift.CallQueue.Call; +import org.apache.hadoop.hbase.thrift.ThriftMetrics; +import org.apache.hadoop.hbase.thrift2.generated.THBaseService; +import org.apache.hadoop.hbase.util.DNS; +import org.apache.hadoop.hbase.util.JvmPauseMonitor; +import org.apache.hadoop.hbase.util.Strings; +import org.apache.hadoop.security.UserGroupInformation; +import org.apache.hadoop.security.SaslRpcServer.SaslGssCallbackHandler; +import org.apache.hadoop.util.Tool; +import org.apache.hadoop.util.ToolRunner; +import org.apache.thrift.TException; +import org.apache.thrift.TProcessor; +import org.apache.thrift.protocol.TBinaryProtocol; +import org.apache.thrift.protocol.TCompactProtocol; +import org.apache.thrift.protocol.TProtocol; +import org.apache.thrift.protocol.TProtocolFactory; +import org.apache.thrift.server.THsHaServer; +import org.apache.thrift.server.TNonblockingServer; +import org.apache.thrift.server.TServer; +import org.apache.thrift.server.TThreadPoolServer; +import org.apache.thrift.transport.TFramedTransport; +import org.apache.thrift.transport.TNonblockingServerSocket; +import org.apache.thrift.transport.TNonblockingServerTransport; +import org.apache.thrift.transport.TSaslServerTransport; +import org.apache.thrift.transport.TServerSocket; +import org.apache.thrift.transport.TServerTransport; +import org.apache.thrift.transport.TTransportException; +import org.apache.thrift.transport.TTransportFactory; + +import com.google.common.util.concurrent.ThreadFactoryBuilder; + +/** + * ThriftServer - this class starts up a Thrift server which implements the HBase API specified in the + * HbaseClient.thrift IDL file. + */ +@InterfaceAudience.LimitedPrivate(HBaseInterfaceAudience.TOOLS) +@SuppressWarnings({ "rawtypes", "unchecked" }) +public class ThriftServer extends Configured implements Tool { + private static final Log log = LogFactory.getLog(ThriftServer.class); + + /** + * Thrift quality of protection configuration key. Valid values can be: + * privacy: authentication, integrity and confidentiality checking + * integrity: authentication and integrity checking + * authentication: authentication only + * + * This is used to authenticate the callers and support impersonation. + * The thrift server and the HBase cluster must run in secure mode. + */ + static final String THRIFT_QOP_KEY = "hbase.thrift.security.qop"; + + static final String BACKLOG_CONF_KEY = "hbase.regionserver.thrift.backlog"; + + public static final int DEFAULT_LISTEN_PORT = 9090; + + private static final String READ_TIMEOUT_OPTION = "readTimeout"; + + /** + * Amount of time in milliseconds before a server thread will timeout + * waiting for client to send data on a connected socket. Currently, + * applies only to TBoundedThreadPoolServer + */ + public static final String THRIFT_SERVER_SOCKET_READ_TIMEOUT_KEY = + "hbase.thrift.server.socket.read.timeout"; + public static final int THRIFT_SERVER_SOCKET_READ_TIMEOUT_DEFAULT = 60000; + + public ThriftServer() { + } + + private static void printUsage() { + HelpFormatter formatter = new HelpFormatter(); + formatter.printHelp("Thrift", null, getOptions(), + "To start the Thrift server run 'bin/hbase-daemon.sh start thrift2'\n" + + "To shutdown the thrift server run 'bin/hbase-daemon.sh stop thrift2' or" + + " send a kill signal to the thrift server pid", + true); + } + + private static Options getOptions() { + Options options = new Options(); + options.addOption("b", "bind", true, + "Address to bind the Thrift server to. [default: 0.0.0.0]"); + options.addOption("p", "port", true, "Port to bind to [default: " + DEFAULT_LISTEN_PORT + "]"); + options.addOption("f", "framed", false, "Use framed transport"); + options.addOption("c", "compact", false, "Use the compact protocol"); + options.addOption("w", "workers", true, "How many worker threads to use."); + options.addOption("q", "callQueueSize", true, + "Max size of request queue (unbounded by default)"); + options.addOption("h", "help", false, "Print help information"); + options.addOption(null, "infoport", true, "Port for web UI"); + options.addOption("t", READ_TIMEOUT_OPTION, true, + "Amount of time in milliseconds before a server thread will timeout " + + "waiting for client to send data on a connected socket. Currently, " + + "only applies to TBoundedThreadPoolServer"); + OptionGroup servers = new OptionGroup(); + servers.addOption( + new Option("nonblocking", false, "Use the TNonblockingServer. This implies the framed transport.")); + servers.addOption(new Option("hsha", false, "Use the THsHaServer. This implies the framed transport.")); + servers.addOption(new Option("threadpool", false, "Use the TThreadPoolServer. This is the default.")); + options.addOptionGroup(servers); + return options; + } + + private static CommandLine parseArguments(Configuration conf, Options options, String[] args) + throws ParseException, IOException { + CommandLineParser parser = new PosixParser(); + return parser.parse(options, args); + } + + private static TProtocolFactory getTProtocolFactory(boolean isCompact) { + if (isCompact) { + log.debug("Using compact protocol"); + return new TCompactProtocol.Factory(); + } else { + log.debug("Using binary protocol"); + return new TBinaryProtocol.Factory(); + } + } + + private static TTransportFactory getTTransportFactory( + SaslUtil.QualityOfProtection qop, String name, String host, + boolean framed, int frameSize) { + if (framed) { + if (qop != null) { + throw new RuntimeException("Thrift server authentication" + + " doesn't work with framed transport yet"); + } + log.debug("Using framed transport"); + return new TFramedTransport.Factory(frameSize); + } else if (qop == null) { + return new TTransportFactory(); + } else { + Map saslProperties = new HashMap(); + saslProperties.put(Sasl.QOP, qop.getSaslQop()); + TSaslServerTransport.Factory saslFactory = new TSaslServerTransport.Factory(); + saslFactory.addServerDefinition("GSSAPI", name, host, saslProperties, + new SaslGssCallbackHandler() { + @Override + public void handle(Callback[] callbacks) + throws UnsupportedCallbackException { + AuthorizeCallback ac = null; + for (Callback callback : callbacks) { + if (callback instanceof AuthorizeCallback) { + ac = (AuthorizeCallback) callback; + } else { + throw new UnsupportedCallbackException(callback, + "Unrecognized SASL GSSAPI Callback"); + } + } + if (ac != null) { + String authid = ac.getAuthenticationID(); + String authzid = ac.getAuthorizationID(); + if (!authid.equals(authzid)) { + ac.setAuthorized(false); + } else { + ac.setAuthorized(true); + String userName = SecurityUtil.getUserFromPrincipal(authzid); + log.info("Effective user: " + userName); + ac.setAuthorizedID(userName); + } + } + } + }); + return saslFactory; + } + } + + /* + * If bindValue is null, we don't bind. + */ + private static InetSocketAddress bindToPort(String bindValue, int listenPort) + throws UnknownHostException { + try { + if (bindValue == null) { + return new InetSocketAddress(listenPort); + } else { + return new InetSocketAddress(InetAddress.getByName(bindValue), listenPort); + } + } catch (UnknownHostException e) { + throw new RuntimeException("Could not bind to provided ip address", e); + } + } + + private static TServer getTNonBlockingServer(TProtocolFactory protocolFactory, TProcessor processor, + TTransportFactory transportFactory, InetSocketAddress inetSocketAddress) throws TTransportException { + TNonblockingServerTransport serverTransport = new TNonblockingServerSocket(inetSocketAddress); + log.info("starting HBase Nonblocking Thrift server on " + inetSocketAddress.toString()); + TNonblockingServer.Args serverArgs = new TNonblockingServer.Args(serverTransport); + serverArgs.processor(processor); + serverArgs.transportFactory(transportFactory); + serverArgs.protocolFactory(protocolFactory); + return new TNonblockingServer(serverArgs); + } + + private static TServer getTHsHaServer(TProtocolFactory protocolFactory, + TProcessor processor, TTransportFactory transportFactory, + int workerThreads, int maxCallQueueSize, + InetSocketAddress inetSocketAddress, ThriftMetrics metrics) + throws TTransportException { + TNonblockingServerTransport serverTransport = new TNonblockingServerSocket(inetSocketAddress); + log.info("starting HBase HsHA Thrift server on " + inetSocketAddress.toString()); + THsHaServer.Args serverArgs = new THsHaServer.Args(serverTransport); + if (workerThreads > 0) { + // Could support the min & max threads, avoiding to preserve existing functionality. + serverArgs.minWorkerThreads(workerThreads).maxWorkerThreads(workerThreads); + } + ExecutorService executorService = createExecutor( + workerThreads, maxCallQueueSize, metrics); + serverArgs.executorService(executorService); + serverArgs.processor(processor); + serverArgs.transportFactory(transportFactory); + serverArgs.protocolFactory(protocolFactory); + return new THsHaServer(serverArgs); + } + + private static ExecutorService createExecutor( + int workerThreads, int maxCallQueueSize, ThriftMetrics metrics) { + CallQueue callQueue; + if (maxCallQueueSize > 0) { + callQueue = new CallQueue(new LinkedBlockingQueue(maxCallQueueSize), metrics); + } else { + callQueue = new CallQueue(new LinkedBlockingQueue(), metrics); + } + + ThreadFactoryBuilder tfb = new ThreadFactoryBuilder(); + tfb.setDaemon(true); + tfb.setNameFormat("thrift2-worker-%d"); + ThreadPoolExecutor pool = new ThreadPoolExecutor(workerThreads, workerThreads, + Long.MAX_VALUE, TimeUnit.SECONDS, callQueue, tfb.build()); + pool.prestartAllCoreThreads(); + return pool; + } + + private static TServer getTThreadPoolServer(TProtocolFactory protocolFactory, + TProcessor processor, + TTransportFactory transportFactory, + int workerThreads, + InetSocketAddress inetSocketAddress, + int backlog, + int clientTimeout) + throws TTransportException { + TServerTransport serverTransport = new TServerSocket( + new TServerSocket.ServerSocketTransportArgs(). + bindAddr(inetSocketAddress).backlog(backlog). + clientTimeout(clientTimeout)); + log.info("starting HBase ThreadPool Thrift server on " + inetSocketAddress.toString()); + TThreadPoolServer.Args serverArgs = new TThreadPoolServer.Args(serverTransport); + serverArgs.processor(processor); + serverArgs.transportFactory(transportFactory); + serverArgs.protocolFactory(protocolFactory); + if (workerThreads > 0) { + serverArgs.maxWorkerThreads(workerThreads); + } + return new TThreadPoolServer(serverArgs); + } + + /** + * Adds the option to pre-load filters at startup. + * + * @param conf The current configuration instance. + */ + protected static void registerFilters(Configuration conf) { + String[] filters = conf.getStrings("hbase.thrift.filters"); + if(filters != null) { + for(String filterClass: filters) { + String[] filterPart = filterClass.split(":"); + if(filterPart.length != 2) { + log.warn("Invalid filter specification " + filterClass + " - skipping"); + } else { + ParseFilter.registerFilter(filterPart[0], filterPart[1]); + } + } + } + } + + /** + * Start up the Thrift2 server. + */ + public static void main(String[] args) throws Exception { + final Configuration conf = HBaseConfiguration.create(); + // for now, only time we return is on an argument error. + final int status = ToolRunner.run(conf, new ThriftServer(), args); + System.exit(status); + } + + @Override + public int run(String[] args) throws Exception { + final Configuration conf = getConf(); + TServer server = null; + Options options = getOptions(); + CommandLine cmd = parseArguments(conf, options, args); + int workerThreads = 0; + int maxCallQueueSize = -1; // use unbounded queue by default + + /** + * This is to please both bin/hbase and bin/hbase-daemon. hbase-daemon provides "start" and "stop" arguments hbase + * should print the help if no argument is provided + */ + List argList = cmd.getArgList(); + if (cmd.hasOption("help") || !argList.contains("start") || argList.contains("stop")) { + printUsage(); + return 1; + } + + // Get address to bind + String bindAddress; + if (cmd.hasOption("bind")) { + bindAddress = cmd.getOptionValue("bind"); + conf.set("hbase.thrift.info.bindAddress", bindAddress); + } else { + bindAddress = conf.get("hbase.thrift.info.bindAddress"); + } + + // Get read timeout + int readTimeout = THRIFT_SERVER_SOCKET_READ_TIMEOUT_DEFAULT; + if (cmd.hasOption(READ_TIMEOUT_OPTION)) { + try { + readTimeout = Integer.parseInt(cmd.getOptionValue(READ_TIMEOUT_OPTION)); + } catch (NumberFormatException e) { + throw new RuntimeException("Could not parse the value provided for the timeout option", e); + } + } else { + readTimeout = conf.getInt(THRIFT_SERVER_SOCKET_READ_TIMEOUT_KEY, + THRIFT_SERVER_SOCKET_READ_TIMEOUT_DEFAULT); + } + + // Get port to bind to + int listenPort = 0; + try { + if (cmd.hasOption("port")) { + listenPort = Integer.parseInt(cmd.getOptionValue("port")); + } else { + listenPort = conf.getInt("hbase.regionserver.thrift.port", DEFAULT_LISTEN_PORT); + } + } catch (NumberFormatException e) { + throw new RuntimeException("Could not parse the value provided for the port option", e); + } + + // Thrift's implementation uses '0' as a placeholder for 'use the default.' + int backlog = conf.getInt(BACKLOG_CONF_KEY, 0); + + // Local hostname and user name, + // used only if QOP is configured. + String host = null; + String name = null; + + UserProvider userProvider = UserProvider.instantiate(conf); + // login the server principal (if using secure Hadoop) + boolean securityEnabled = userProvider.isHadoopSecurityEnabled() + && userProvider.isHBaseSecurityEnabled(); + if (securityEnabled) { + host = Strings.domainNamePointerToHostName(DNS.getDefaultHost( + conf.get("hbase.thrift.dns.interface", "default"), + conf.get("hbase.thrift.dns.nameserver", "default"))); + userProvider.login("hbase.thrift.keytab.file", + "hbase.thrift.kerberos.principal", host); + } + + UserGroupInformation realUser = userProvider.getCurrent().getUGI(); + String stringQop = conf.get(THRIFT_QOP_KEY); + SaslUtil.QualityOfProtection qop = null; + if (stringQop != null) { + qop = SaslUtil.getQop(stringQop); + if (!securityEnabled) { + throw new IOException("Thrift server must" + + " run in secure mode to support authentication"); + } + // Extract the name from the principal + name = SecurityUtil.getUserFromPrincipal( + conf.get("hbase.thrift.kerberos.principal")); + } + + boolean nonblocking = cmd.hasOption("nonblocking"); + boolean hsha = cmd.hasOption("hsha"); + + ThriftMetrics metrics = new ThriftMetrics(conf, ThriftMetrics.ThriftServerType.TWO); + final JvmPauseMonitor pauseMonitor = new JvmPauseMonitor(conf, metrics.getSource()); + + String implType = "threadpool"; + if (nonblocking) { + implType = "nonblocking"; + } else if (hsha) { + implType = "hsha"; + } + + conf.set("hbase.regionserver.thrift.server.type", implType); + conf.setInt("hbase.regionserver.thrift.port", listenPort); + registerFilters(conf); + + // Construct correct ProtocolFactory + boolean compact = cmd.hasOption("compact") || + conf.getBoolean("hbase.regionserver.thrift.compact", false); + TProtocolFactory protocolFactory = getTProtocolFactory(compact); + final ThriftHBaseServiceHandler hbaseHandler = + new ThriftHBaseServiceHandler(conf, userProvider); + THBaseService.Iface handler = + ThriftHBaseServiceHandler.newInstance(hbaseHandler, metrics); + final THBaseService.Processor p = new THBaseService.Processor(handler); + conf.setBoolean("hbase.regionserver.thrift.compact", compact); + TProcessor processor = p; + + boolean framed = cmd.hasOption("framed") || + conf.getBoolean("hbase.regionserver.thrift.framed", false) || nonblocking || hsha; + TTransportFactory transportFactory = getTTransportFactory(qop, name, host, framed, + conf.getInt("hbase.regionserver.thrift.framed.max_frame_size_in_mb", 2) * 1024 * 1024); + InetSocketAddress inetSocketAddress = bindToPort(bindAddress, listenPort); + conf.setBoolean("hbase.regionserver.thrift.framed", framed); + if (qop != null) { + // Create a processor wrapper, to get the caller + processor = new TProcessor() { + @Override + public boolean process(TProtocol inProt, + TProtocol outProt) throws TException { + TSaslServerTransport saslServerTransport = + (TSaslServerTransport)inProt.getTransport(); + SaslServer saslServer = saslServerTransport.getSaslServer(); + String principal = saslServer.getAuthorizationID(); + hbaseHandler.setEffectiveUser(principal); + return p.process(inProt, outProt); + } + }; + } + + if (cmd.hasOption("w")) { + workerThreads = Integer.parseInt(cmd.getOptionValue("w")); + } + + if (cmd.hasOption("q")) { + maxCallQueueSize = Integer.parseInt(cmd.getOptionValue("q")); + } + + // check for user-defined info server port setting, if so override the conf + try { + if (cmd.hasOption("infoport")) { + String val = cmd.getOptionValue("infoport"); + conf.setInt("hbase.thrift.info.port", Integer.parseInt(val)); + log.debug("Web UI port set to " + val); + } + } catch (NumberFormatException e) { + log.error("Could not parse the value provided for the infoport option", e); + printUsage(); + System.exit(1); + } + + // Put up info server. + int port = conf.getInt("hbase.thrift.info.port", 9095); + if (port >= 0) { + conf.setLong("startcode", System.currentTimeMillis()); + String a = conf.get("hbase.thrift.info.bindAddress", "0.0.0.0"); + InfoServer infoServer = new InfoServer("thrift", a, port, false, conf); + infoServer.setAttribute("hbase.conf", conf); + infoServer.start(); + } + + if (nonblocking) { + server = getTNonBlockingServer(protocolFactory, + processor, + transportFactory, + inetSocketAddress); + } else if (hsha) { + server = getTHsHaServer(protocolFactory, + processor, + transportFactory, + workerThreads, + maxCallQueueSize, + inetSocketAddress, + metrics); + } else { + server = getTThreadPoolServer(protocolFactory, + processor, + transportFactory, + workerThreads, + inetSocketAddress, + backlog, + readTimeout); + } + + final TServer tserver = server; + realUser.doAs( + new PrivilegedAction() { + @Override + public Object run() { + pauseMonitor.start(); + try { + tserver.serve(); + return null; + } finally { + pauseMonitor.stop(); + } + } + }); + // when tserver.stop eventually happens we'll get here. + return 0; + } +} diff --git "a/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/ThriftUtilities.java" "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/ThriftUtilities.java" new file mode 100644 index 00000000000..94bdbb51e76 --- /dev/null +++ "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/ThriftUtilities.java" @@ -0,0 +1,552 @@ +/** + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.hadoop.hbase.thrift2; + +import static org.apache.hadoop.hbase.util.Bytes.getBytes; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import org.apache.hadoop.hbase.HRegionInfo; +import org.apache.hadoop.hbase.HRegionLocation; +import org.apache.hadoop.hbase.ServerName; +import org.apache.hadoop.hbase.classification.InterfaceAudience; +import org.apache.hadoop.hbase.Cell; +import org.apache.hadoop.hbase.CellUtil; +import org.apache.hadoop.hbase.HConstants; +import org.apache.hadoop.hbase.client.Append; +import org.apache.hadoop.hbase.client.Delete; +import org.apache.hadoop.hbase.client.Durability; +import org.apache.hadoop.hbase.client.Get; +import org.apache.hadoop.hbase.client.Increment; +import org.apache.hadoop.hbase.client.OperationWithAttributes; +import org.apache.hadoop.hbase.client.Put; +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.filter.CompareFilter.CompareOp; +import org.apache.hadoop.hbase.filter.ParseFilter; +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.TColumn; +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.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.TMutation; +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.TServerName; +import org.apache.hadoop.hbase.thrift2.generated.TTimeRange; +import org.apache.hadoop.hbase.util.Bytes; + +@InterfaceAudience.Private +public class ThriftUtilities { + + private ThriftUtilities() { + throw new UnsupportedOperationException("Can't initialize class"); + } + + /** + * Creates a {@link Get} (HBase) from a {@link TGet} (Thrift). + * + * This ignores any timestamps set on {@link TColumn} objects. + * + * @param in the TGet to convert + * + * @return Get object + * + * @throws IOException if an invalid time range or max version parameter is given + */ + public static Get getFromThrift(TGet in) throws IOException { + Get out = new Get(in.getRow()); + + // Timestamp overwrites time range if both are set + if (in.isSetTimestamp()) { + out.setTimeStamp(in.getTimestamp()); + } else if (in.isSetTimeRange()) { + out.setTimeRange(in.getTimeRange().getMinStamp(), in.getTimeRange().getMaxStamp()); + } + + if (in.isSetMaxVersions()) { + out.setMaxVersions(in.getMaxVersions()); + } + + if (in.isSetFilterString()) { + ParseFilter parseFilter = new ParseFilter(); + out.setFilter(parseFilter.parseFilterString(in.getFilterString())); + } + + if (in.isSetAttributes()) { + addAttributes(out,in.getAttributes()); + } + + if (in.isSetAuthorizations()) { + out.setAuthorizations(new Authorizations(in.getAuthorizations().getLabels())); + } + + if (!in.isSetColumns()) { + return out; + } + + for (TColumn column : in.getColumns()) { + if (column.isSetQualifier()) { + out.addColumn(column.getFamily(), column.getQualifier()); + } else { + out.addFamily(column.getFamily()); + } + } + + return out; + } + + /** + * Converts multiple {@link TGet}s (Thrift) into a list of {@link Get}s (HBase). + * + * @param in list of TGets to convert + * + * @return list of Get objects + * + * @throws IOException if an invalid time range or max version parameter is given + * @see #getFromThrift(TGet) + */ + public static List getsFromThrift(List in) throws IOException { + List out = new ArrayList(in.size()); + for (TGet get : in) { + out.add(getFromThrift(get)); + } + return out; + } + + /** + * Creates a {@link TResult} (Thrift) from a {@link Result} (HBase). + * + * @param in the Result to convert + * + * @return converted result, returns an empty result if the input is null + */ + public static TResult resultFromHBase(Result in) { + Cell[] raw = in.rawCells(); + TResult out = new TResult(); + byte[] row = in.getRow(); + if (row != null) { + out.setRow(in.getRow()); + } + List columnValues = new ArrayList(); + for (Cell kv : raw) { + TColumnValue col = new TColumnValue(); + col.setFamily(CellUtil.cloneFamily(kv)); + col.setQualifier(CellUtil.cloneQualifier(kv)); + col.setTimestamp(kv.getTimestamp()); + col.setValue(CellUtil.cloneValue(kv)); + if (kv.getTagsLength() > 0) { + col.setTags(CellUtil.getTagArray(kv)); + } + columnValues.add(col); + } + out.setColumnValues(columnValues); + return out; + } + + /** + * Converts multiple {@link Result}s (HBase) into a list of {@link TResult}s (Thrift). + * + * @param in array of Results to convert + * + * @return list of converted TResults + * + * @see #resultFromHBase(Result) + */ + public static List resultsFromHBase(Result[] in) { + List out = new ArrayList(in.length); + for (Result result : in) { + out.add(resultFromHBase(result)); + } + return out; + } + + /** + * Creates a {@link Put} (HBase) from a {@link TPut} (Thrift) + * + * @param in the TPut to convert + * + * @return converted Put + */ + public static Put putFromThrift(TPut in) { + Put out; + + if (in.isSetTimestamp()) { + out = new Put(in.getRow(), in.getTimestamp()); + } else { + out = new Put(in.getRow()); + } + + if (in.isSetDurability()) { + out.setDurability(durabilityFromThrift(in.getDurability())); + } + + for (TColumnValue columnValue : in.getColumnValues()) { + if (columnValue.isSetTimestamp()) { + out.addImmutable( + columnValue.getFamily(), columnValue.getQualifier(), columnValue.getTimestamp(), + columnValue.getValue()); + } else { + out.addImmutable( + columnValue.getFamily(), columnValue.getQualifier(), columnValue.getValue()); + } + } + + if (in.isSetAttributes()) { + addAttributes(out,in.getAttributes()); + } + + if (in.getCellVisibility() != null) { + out.setCellVisibility(new CellVisibility(in.getCellVisibility().getExpression())); + } + + return out; + } + + /** + * Converts multiple {@link TPut}s (Thrift) into a list of {@link Put}s (HBase). + * + * @param in list of TPuts to convert + * + * @return list of converted Puts + * + * @see #putFromThrift(TPut) + */ + public static List putsFromThrift(List in) { + List out = new ArrayList(in.size()); + for (TPut put : in) { + out.add(putFromThrift(put)); + } + return out; + } + + /** + * Creates a {@link Delete} (HBase) from a {@link TDelete} (Thrift). + * + * @param in the TDelete to convert + * + * @return converted Delete + */ + public static Delete deleteFromThrift(TDelete in) { + Delete out; + + if (in.isSetColumns()) { + out = new Delete(in.getRow()); + for (TColumn column : in.getColumns()) { + if (column.isSetQualifier()) { + if (column.isSetTimestamp()) { + if (in.isSetDeleteType() && + in.getDeleteType().equals(TDeleteType.DELETE_COLUMNS)) + out.addColumns(column.getFamily(), column.getQualifier(), column.getTimestamp()); + else + out.addColumn(column.getFamily(), column.getQualifier(), column.getTimestamp()); + } else { + if (in.isSetDeleteType() && + in.getDeleteType().equals(TDeleteType.DELETE_COLUMNS)) + out.addColumns(column.getFamily(), column.getQualifier()); + else + out.addColumn(column.getFamily(), column.getQualifier()); + } + + } else { + if (column.isSetTimestamp()) { + out.addFamily(column.getFamily(), column.getTimestamp()); + } else { + out.addFamily(column.getFamily()); + } + } + } + } else { + if (in.isSetTimestamp()) { + out = new Delete(in.getRow(), in.getTimestamp()); + } else { + out = new Delete(in.getRow()); + } + } + + if (in.isSetAttributes()) { + addAttributes(out,in.getAttributes()); + } + + if (in.isSetDurability()) { + out.setDurability(durabilityFromThrift(in.getDurability())); + } + + return out; + } + + /** + * Converts multiple {@link TDelete}s (Thrift) into a list of {@link Delete}s (HBase). + * + * @param in list of TDeletes to convert + * + * @return list of converted Deletes + * + * @see #deleteFromThrift(TDelete) + */ + + public static List deletesFromThrift(List in) { + List out = new ArrayList(in.size()); + for (TDelete delete : in) { + out.add(deleteFromThrift(delete)); + } + return out; + } + + public static TDelete deleteFromHBase(Delete in) { + TDelete out = new TDelete(ByteBuffer.wrap(in.getRow())); + + List columns = new ArrayList(); + long rowTimestamp = in.getTimeStamp(); + if (rowTimestamp != HConstants.LATEST_TIMESTAMP) { + out.setTimestamp(rowTimestamp); + } + + // Map> + for (Map.Entry> familyEntry: + in.getFamilyCellMap().entrySet()) { + TColumn column = new TColumn(ByteBuffer.wrap(familyEntry.getKey())); + for (org.apache.hadoop.hbase.Cell cell: familyEntry.getValue()) { + byte[] family = CellUtil.cloneFamily(cell); + byte[] qualifier = CellUtil.cloneQualifier(cell); + long timestamp = cell.getTimestamp(); + if (family != null) { + column.setFamily(family); + } + if (qualifier != null) { + column.setQualifier(qualifier); + } + if (timestamp != HConstants.LATEST_TIMESTAMP) { + column.setTimestamp(timestamp); + } + } + columns.add(column); + } + out.setColumns(columns); + + return out; + } + + /** + * Creates a {@link RowMutations} (HBase) from a {@link TRowMutations} (Thrift) + * + * @param in the TRowMutations to convert + * + * @return converted RowMutations + */ + public static RowMutations rowMutationsFromThrift(TRowMutations in) throws IOException { + RowMutations out = new RowMutations(in.getRow()); + List mutations = in.getMutations(); + for (TMutation mutation : mutations) { + if (mutation.isSetPut()) { + out.add(putFromThrift(mutation.getPut())); + } + if (mutation.isSetDeleteSingle()) { + out.add(deleteFromThrift(mutation.getDeleteSingle())); + } + } + return out; + } + + public static Scan scanFromThrift(TScan in) throws IOException { + Scan out = new Scan(); + + if (in.isSetStartRow()) + out.setStartRow(in.getStartRow()); + if (in.isSetStopRow()) + out.setStopRow(in.getStopRow()); + if (in.isSetCaching()) + out.setCaching(in.getCaching()); + if (in.isSetMaxVersions()) { + out.setMaxVersions(in.getMaxVersions()); + } + + if (in.isSetColumns()) { + for (TColumn column : in.getColumns()) { + if (column.isSetQualifier()) { + out.addColumn(column.getFamily(), column.getQualifier()); + } else { + out.addFamily(column.getFamily()); + } + } + } + + TTimeRange timeRange = in.getTimeRange(); + if (timeRange != null && + timeRange.isSetMinStamp() && timeRange.isSetMaxStamp()) { + out.setTimeRange(timeRange.getMinStamp(), timeRange.getMaxStamp()); + } + + if (in.isSetBatchSize()) { + out.setBatch(in.getBatchSize()); + } + + if (in.isSetFilterString()) { + ParseFilter parseFilter = new ParseFilter(); + out.setFilter(parseFilter.parseFilterString(in.getFilterString())); + } + + if (in.isSetAttributes()) { + addAttributes(out,in.getAttributes()); + } + + if (in.isSetAuthorizations()) { + out.setAuthorizations(new Authorizations(in.getAuthorizations().getLabels())); + } + + if (in.isSetReversed()) { + out.setReversed(in.isReversed()); + } + + if (in.isSetCacheBlocks()) { + out.setCacheBlocks(in.isCacheBlocks()); + } + + return out; + } + + public static Increment incrementFromThrift(TIncrement in) throws IOException { + Increment out = new Increment(in.getRow()); + for (TColumnIncrement column : in.getColumns()) { + out.addColumn(column.getFamily(), column.getQualifier(), column.getAmount()); + } + + if (in.isSetAttributes()) { + addAttributes(out,in.getAttributes()); + } + + if (in.isSetDurability()) { + out.setDurability(durabilityFromThrift(in.getDurability())); + } + + if(in.getCellVisibility() != null) { + out.setCellVisibility(new CellVisibility(in.getCellVisibility().getExpression())); + } + + return out; + } + + public static Append appendFromThrift(TAppend append) throws IOException { + Append out = new Append(append.getRow()); + for (TColumnValue column : append.getColumns()) { + out.add(column.getFamily(), column.getQualifier(), column.getValue()); + } + + if (append.isSetAttributes()) { + addAttributes(out, append.getAttributes()); + } + + if (append.isSetDurability()) { + out.setDurability(durabilityFromThrift(append.getDurability())); + } + + if(append.getCellVisibility() != null) { + out.setCellVisibility(new CellVisibility(append.getCellVisibility().getExpression())); + } + + return out; + } + + public static THRegionLocation regionLocationFromHBase(HRegionLocation hrl) { + HRegionInfo hri = hrl.getRegionInfo(); + ServerName serverName = hrl.getServerName(); + + THRegionInfo thRegionInfo = new THRegionInfo(); + THRegionLocation thRegionLocation = new THRegionLocation(); + TServerName tServerName = new TServerName(); + + tServerName.setHostName(serverName.getHostname()); + tServerName.setPort(serverName.getPort()); + tServerName.setStartCode(serverName.getStartcode()); + + thRegionInfo.setTableName(hri.getTable().getName()); + thRegionInfo.setEndKey(hri.getEndKey()); + thRegionInfo.setStartKey(hri.getStartKey()); + thRegionInfo.setOffline(hri.isOffline()); + thRegionInfo.setSplit(hri.isSplit()); + thRegionInfo.setReplicaId(hri.getReplicaId()); + + thRegionLocation.setRegionInfo(thRegionInfo); + thRegionLocation.setServerName(tServerName); + + return thRegionLocation; + } + + public static List regionLocationsFromHBase(List locations) { + List tlocations = new ArrayList(locations.size()); + for (HRegionLocation hrl:locations) { + tlocations.add(regionLocationFromHBase(hrl)); + } + return tlocations; + } + + /** + * Adds all the attributes into the Operation object + */ + private static void addAttributes(OperationWithAttributes op, + Map attributes) { + if (attributes == null || attributes.size() == 0) { + return; + } + for (Map.Entry entry : attributes.entrySet()) { + String name = Bytes.toStringBinary(getBytes(entry.getKey())); + byte[] value = getBytes(entry.getValue()); + op.setAttribute(name, value); + } + } + + private static Durability durabilityFromThrift(TDurability tDurability) { + switch (tDurability.getValue()) { + 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; + } + } + + public static CompareOp compareOpFromThrift(TCompareOp tCompareOp) { + switch (tCompareOp.getValue()) { + case 0: return CompareOp.LESS; + case 1: return CompareOp.LESS_OR_EQUAL; + case 2: return CompareOp.EQUAL; + case 3: return CompareOp.NOT_EQUAL; + case 4: return CompareOp.GREATER_OR_EQUAL; + case 5: return CompareOp.GREATER; + case 6: return CompareOp.NO_OP; + default: return null; + } + } +} diff --git "a/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TAppend.java" "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TAppend.java" new file mode 100644 index 00000000000..e0e3074e28e --- /dev/null +++ "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TAppend.java" @@ -0,0 +1,954 @@ +/** + * 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 = "2016-05-25") +public class TAppend implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TAppend"); + + 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 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 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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TAppendStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TAppendTupleSchemeFactory()); + } + + public ByteBuffer row; // required + public List columns; // required + public Map attributes; // optional + /** + * + * @see TDurability + */ + public TDurability durability; // optional + public TCellVisibility cellVisibility; // 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"), + COLUMNS((short)2, "columns"), + ATTRIBUTES((short)3, "attributes"), + /** + * + * @see TDurability + */ + DURABILITY((short)4, "durability"), + CELL_VISIBILITY((short)5, "cellVisibility"); + + private static final Map byName = new HashMap(); + + 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: // ROW + return ROW; + case 2: // COLUMNS + return COLUMNS; + case 3: // ATTRIBUTES + return ATTRIBUTES; + case 4: // DURABILITY + return DURABILITY; + case 5: // CELL_VISIBILITY + return CELL_VISIBILITY; + 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.ATTRIBUTES,_Fields.DURABILITY,_Fields.CELL_VISIBILITY}; + 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.ROW, new org.apache.thrift.meta_data.FieldMetaData("row", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + tmpMap.put(_Fields.COLUMNS, new org.apache.thrift.meta_data.FieldMetaData("columns", org.apache.thrift.TFieldRequirementType.REQUIRED, + 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, TColumnValue.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))); + 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))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TAppend.class, metaDataMap); + } + + public TAppend() { + } + + public TAppend( + ByteBuffer row, + List columns) + { + this(); + this.row = org.apache.thrift.TBaseHelper.copyBinary(row); + this.columns = columns; + } + + /** + * Performs a deep copy on other. + */ + public TAppend(TAppend other) { + if (other.isSetRow()) { + this.row = org.apache.thrift.TBaseHelper.copyBinary(other.row); + } + if (other.isSetColumns()) { + List __this__columns = new ArrayList(other.columns.size()); + for (TColumnValue other_element : other.columns) { + __this__columns.add(new TColumnValue(other_element)); + } + this.columns = __this__columns; + } + if (other.isSetAttributes()) { + Map __this__attributes = new HashMap(other.attributes); + this.attributes = __this__attributes; + } + if (other.isSetDurability()) { + this.durability = other.durability; + } + if (other.isSetCellVisibility()) { + this.cellVisibility = new TCellVisibility(other.cellVisibility); + } + } + + public TAppend deepCopy() { + return new TAppend(this); + } + + @Override + public void clear() { + this.row = null; + this.columns = null; + this.attributes = null; + this.durability = null; + this.cellVisibility = null; + } + + public byte[] getRow() { + setRow(org.apache.thrift.TBaseHelper.rightSize(row)); + return row == null ? null : row.array(); + } + + public ByteBuffer bufferForRow() { + return org.apache.thrift.TBaseHelper.copyBinary(row); + } + + public TAppend setRow(byte[] row) { + this.row = row == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(row, row.length)); + return this; + } + + public TAppend setRow(ByteBuffer row) { + this.row = org.apache.thrift.TBaseHelper.copyBinary(row); + return this; + } + + public void unsetRow() { + this.row = null; + } + + /** Returns true if field row is set (has been assigned a value) and false otherwise */ + public boolean isSetRow() { + return this.row != null; + } + + public void setRowIsSet(boolean value) { + if (!value) { + this.row = null; + } + } + + public int getColumnsSize() { + return (this.columns == null) ? 0 : this.columns.size(); + } + + public java.util.Iterator getColumnsIterator() { + return (this.columns == null) ? null : this.columns.iterator(); + } + + public void addToColumns(TColumnValue elem) { + if (this.columns == null) { + this.columns = new ArrayList(); + } + this.columns.add(elem); + } + + public List getColumns() { + return this.columns; + } + + public TAppend setColumns(List 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(); + } + this.attributes.put(key, val); + } + + public Map getAttributes() { + return this.attributes; + } + + public TAppend setAttributes(Map 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 TAppend 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 TCellVisibility getCellVisibility() { + return this.cellVisibility; + } + + public TAppend setCellVisibility(TCellVisibility cellVisibility) { + this.cellVisibility = cellVisibility; + return this; + } + + public void unsetCellVisibility() { + this.cellVisibility = null; + } + + /** Returns true if field cellVisibility is set (has been assigned a value) and false otherwise */ + public boolean isSetCellVisibility() { + return this.cellVisibility != null; + } + + public void setCellVisibilityIsSet(boolean value) { + if (!value) { + this.cellVisibility = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case ROW: + if (value == null) { + unsetRow(); + } else { + setRow((ByteBuffer)value); + } + break; + + case COLUMNS: + if (value == null) { + unsetColumns(); + } else { + setColumns((List)value); + } + break; + + case ATTRIBUTES: + if (value == null) { + unsetAttributes(); + } else { + setAttributes((Map)value); + } + break; + + case DURABILITY: + if (value == null) { + unsetDurability(); + } else { + setDurability((TDurability)value); + } + break; + + case CELL_VISIBILITY: + if (value == null) { + unsetCellVisibility(); + } else { + setCellVisibility((TCellVisibility)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case ROW: + return getRow(); + + case COLUMNS: + return getColumns(); + + case ATTRIBUTES: + return getAttributes(); + + case DURABILITY: + return getDurability(); + + case CELL_VISIBILITY: + return getCellVisibility(); + + } + 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 ROW: + return isSetRow(); + case COLUMNS: + return isSetColumns(); + case ATTRIBUTES: + return isSetAttributes(); + case DURABILITY: + return isSetDurability(); + case CELL_VISIBILITY: + return isSetCellVisibility(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TAppend) + return this.equals((TAppend)that); + return false; + } + + public boolean equals(TAppend that) { + if (that == null) + return false; + + boolean this_present_row = true && this.isSetRow(); + boolean that_present_row = true && that.isSetRow(); + if (this_present_row || that_present_row) { + if (!(this_present_row && that_present_row)) + return false; + if (!this.row.equals(that.row)) + 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; + } + + boolean this_present_cellVisibility = true && this.isSetCellVisibility(); + boolean that_present_cellVisibility = true && that.isSetCellVisibility(); + if (this_present_cellVisibility || that_present_cellVisibility) { + if (!(this_present_cellVisibility && that_present_cellVisibility)) + return false; + if (!this.cellVisibility.equals(that.cellVisibility)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_row = true && (isSetRow()); + list.add(present_row); + if (present_row) + list.add(row); + + 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()); + + boolean present_cellVisibility = true && (isSetCellVisibility()); + list.add(present_cellVisibility); + if (present_cellVisibility) + list.add(cellVisibility); + + return list.hashCode(); + } + + @Override + public int compareTo(TAppend other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetRow()).compareTo(other.isSetRow()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRow()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.row, other.row); + 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; + } + } + lastComparison = Boolean.valueOf(isSetCellVisibility()).compareTo(other.isSetCellVisibility()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetCellVisibility()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cellVisibility, other.cellVisibility); + 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("TAppend("); + boolean first = true; + + sb.append("row:"); + if (this.row == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.row, sb); + } + first = false; + 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; + } + if (isSetCellVisibility()) { + if (!first) sb.append(", "); + sb.append("cellVisibility:"); + if (this.cellVisibility == null) { + sb.append("null"); + } else { + sb.append(this.cellVisibility); + } + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (row == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'row' was not present! Struct: " + toString()); + } + if (columns == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'columns' was not present! Struct: " + toString()); + } + // check for sub-struct validity + if (cellVisibility != null) { + cellVisibility.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 TAppendStandardSchemeFactory implements SchemeFactory { + public TAppendStandardScheme getScheme() { + return new TAppendStandardScheme(); + } + } + + private static class TAppendStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TAppend 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: // ROW + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.row = iprot.readBinary(); + struct.setRowIsSet(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 _list88 = iprot.readListBegin(); + struct.columns = new ArrayList(_list88.size); + TColumnValue _elem89; + for (int _i90 = 0; _i90 < _list88.size; ++_i90) + { + _elem89 = new TColumnValue(); + _elem89.read(iprot); + struct.columns.add(_elem89); + } + 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 _map91 = iprot.readMapBegin(); + struct.attributes = new HashMap(2*_map91.size); + ByteBuffer _key92; + ByteBuffer _val93; + for (int _i94 = 0; _i94 < _map91.size; ++_i94) + { + _key92 = iprot.readBinary(); + _val93 = iprot.readBinary(); + struct.attributes.put(_key92, _val93); + } + 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; + case 5: // CELL_VISIBILITY + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.cellVisibility = new TCellVisibility(); + struct.cellVisibility.read(iprot); + struct.setCellVisibilityIsSet(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, TAppend struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.row != null) { + oprot.writeFieldBegin(ROW_FIELD_DESC); + oprot.writeBinary(struct.row); + oprot.writeFieldEnd(); + } + if (struct.columns != null) { + oprot.writeFieldBegin(COLUMNS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.columns.size())); + for (TColumnValue _iter95 : struct.columns) + { + _iter95.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 _iter96 : struct.attributes.entrySet()) + { + oprot.writeBinary(_iter96.getKey()); + oprot.writeBinary(_iter96.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + } + if (struct.durability != null) { + if (struct.isSetDurability()) { + oprot.writeFieldBegin(DURABILITY_FIELD_DESC); + oprot.writeI32(struct.durability.getValue()); + oprot.writeFieldEnd(); + } + } + if (struct.cellVisibility != null) { + if (struct.isSetCellVisibility()) { + oprot.writeFieldBegin(CELL_VISIBILITY_FIELD_DESC); + struct.cellVisibility.write(oprot); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TAppendTupleSchemeFactory implements SchemeFactory { + public TAppendTupleScheme getScheme() { + return new TAppendTupleScheme(); + } + } + + private static class TAppendTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TAppend struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeBinary(struct.row); + { + oprot.writeI32(struct.columns.size()); + for (TColumnValue _iter97 : struct.columns) + { + _iter97.write(oprot); + } + } + BitSet optionals = new BitSet(); + if (struct.isSetAttributes()) { + optionals.set(0); + } + if (struct.isSetDurability()) { + optionals.set(1); + } + if (struct.isSetCellVisibility()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetAttributes()) { + { + oprot.writeI32(struct.attributes.size()); + for (Map.Entry _iter98 : struct.attributes.entrySet()) + { + oprot.writeBinary(_iter98.getKey()); + oprot.writeBinary(_iter98.getValue()); + } + } + } + if (struct.isSetDurability()) { + oprot.writeI32(struct.durability.getValue()); + } + if (struct.isSetCellVisibility()) { + struct.cellVisibility.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TAppend struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.row = iprot.readBinary(); + struct.setRowIsSet(true); + { + org.apache.thrift.protocol.TList _list99 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.columns = new ArrayList(_list99.size); + TColumnValue _elem100; + for (int _i101 = 0; _i101 < _list99.size; ++_i101) + { + _elem100 = new TColumnValue(); + _elem100.read(iprot); + struct.columns.add(_elem100); + } + } + struct.setColumnsIsSet(true); + BitSet incoming = iprot.readBitSet(3); + 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()); + struct.attributes = new HashMap(2*_map102.size); + ByteBuffer _key103; + ByteBuffer _val104; + for (int _i105 = 0; _i105 < _map102.size; ++_i105) + { + _key103 = iprot.readBinary(); + _val104 = iprot.readBinary(); + struct.attributes.put(_key103, _val104); + } + } + struct.setAttributesIsSet(true); + } + if (incoming.get(1)) { + struct.durability = org.apache.hadoop.hbase.thrift2.generated.TDurability.findByValue(iprot.readI32()); + struct.setDurabilityIsSet(true); + } + if (incoming.get(2)) { + struct.cellVisibility = new TCellVisibility(); + struct.cellVisibility.read(iprot); + struct.setCellVisibilityIsSet(true); + } + } + } + +} + diff --git "a/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TAuthorization.java" "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TAuthorization.java" new file mode 100644 index 00000000000..6c355a65b1f --- /dev/null +++ "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TAuthorization.java" @@ -0,0 +1,445 @@ +/** + * 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 = "2016-05-25") +public class TAuthorization implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TAuthorization"); + + private static final org.apache.thrift.protocol.TField LABELS_FIELD_DESC = new org.apache.thrift.protocol.TField("labels", org.apache.thrift.protocol.TType.LIST, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TAuthorizationStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TAuthorizationTupleSchemeFactory()); + } + + public List labels; // 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 { + LABELS((short)1, "labels"); + + private static final Map byName = new HashMap(); + + 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: // LABELS + return LABELS; + 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.LABELS}; + 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.LABELS, new org.apache.thrift.meta_data.FieldMetaData("labels", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TAuthorization.class, metaDataMap); + } + + public TAuthorization() { + } + + /** + * Performs a deep copy on other. + */ + public TAuthorization(TAuthorization other) { + if (other.isSetLabels()) { + List __this__labels = new ArrayList(other.labels); + this.labels = __this__labels; + } + } + + public TAuthorization deepCopy() { + return new TAuthorization(this); + } + + @Override + public void clear() { + this.labels = null; + } + + public int getLabelsSize() { + return (this.labels == null) ? 0 : this.labels.size(); + } + + public java.util.Iterator getLabelsIterator() { + return (this.labels == null) ? null : this.labels.iterator(); + } + + public void addToLabels(String elem) { + if (this.labels == null) { + this.labels = new ArrayList(); + } + this.labels.add(elem); + } + + public List getLabels() { + return this.labels; + } + + public TAuthorization setLabels(List labels) { + this.labels = labels; + return this; + } + + public void unsetLabels() { + this.labels = null; + } + + /** Returns true if field labels is set (has been assigned a value) and false otherwise */ + public boolean isSetLabels() { + return this.labels != null; + } + + public void setLabelsIsSet(boolean value) { + if (!value) { + this.labels = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case LABELS: + if (value == null) { + unsetLabels(); + } else { + setLabels((List)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case LABELS: + return getLabels(); + + } + 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 LABELS: + return isSetLabels(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TAuthorization) + return this.equals((TAuthorization)that); + return false; + } + + public boolean equals(TAuthorization that) { + if (that == null) + return false; + + boolean this_present_labels = true && this.isSetLabels(); + boolean that_present_labels = true && that.isSetLabels(); + if (this_present_labels || that_present_labels) { + if (!(this_present_labels && that_present_labels)) + return false; + if (!this.labels.equals(that.labels)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_labels = true && (isSetLabels()); + list.add(present_labels); + if (present_labels) + list.add(labels); + + return list.hashCode(); + } + + @Override + public int compareTo(TAuthorization other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetLabels()).compareTo(other.isSetLabels()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetLabels()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.labels, other.labels); + 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("TAuthorization("); + boolean first = true; + + if (isSetLabels()) { + sb.append("labels:"); + if (this.labels == null) { + sb.append("null"); + } else { + sb.append(this.labels); + } + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 TAuthorizationStandardSchemeFactory implements SchemeFactory { + public TAuthorizationStandardScheme getScheme() { + return new TAuthorizationStandardScheme(); + } + } + + private static class TAuthorizationStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TAuthorization 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: // LABELS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list8 = iprot.readListBegin(); + struct.labels = new ArrayList(_list8.size); + String _elem9; + for (int _i10 = 0; _i10 < _list8.size; ++_i10) + { + _elem9 = iprot.readString(); + struct.labels.add(_elem9); + } + iprot.readListEnd(); + } + struct.setLabelsIsSet(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, TAuthorization struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.labels != null) { + if (struct.isSetLabels()) { + oprot.writeFieldBegin(LABELS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.labels.size())); + for (String _iter11 : struct.labels) + { + oprot.writeString(_iter11); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TAuthorizationTupleSchemeFactory implements SchemeFactory { + public TAuthorizationTupleScheme getScheme() { + return new TAuthorizationTupleScheme(); + } + } + + private static class TAuthorizationTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TAuthorization struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetLabels()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetLabels()) { + { + oprot.writeI32(struct.labels.size()); + for (String _iter12 : struct.labels) + { + oprot.writeString(_iter12); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TAuthorization struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list13 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.labels = new ArrayList(_list13.size); + String _elem14; + for (int _i15 = 0; _i15 < _list13.size; ++_i15) + { + _elem14 = iprot.readString(); + struct.labels.add(_elem14); + } + } + struct.setLabelsIsSet(true); + } + } + } + +} + diff --git "a/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TCellVisibility.java" "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TCellVisibility.java" new file mode 100644 index 00000000000..7da4dda48be --- /dev/null +++ "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TCellVisibility.java" @@ -0,0 +1,396 @@ +/** + * 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 = "2016-05-25") +public class TCellVisibility implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCellVisibility"); + + private static final org.apache.thrift.protocol.TField EXPRESSION_FIELD_DESC = new org.apache.thrift.protocol.TField("expression", org.apache.thrift.protocol.TType.STRING, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TCellVisibilityStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TCellVisibilityTupleSchemeFactory()); + } + + public String expression; // 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 { + EXPRESSION((short)1, "expression"); + + private static final Map byName = new HashMap(); + + 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: // EXPRESSION + return EXPRESSION; + 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.EXPRESSION}; + 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.EXPRESSION, new org.apache.thrift.meta_data.FieldMetaData("expression", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCellVisibility.class, metaDataMap); + } + + public TCellVisibility() { + } + + /** + * Performs a deep copy on other. + */ + public TCellVisibility(TCellVisibility other) { + if (other.isSetExpression()) { + this.expression = other.expression; + } + } + + public TCellVisibility deepCopy() { + return new TCellVisibility(this); + } + + @Override + public void clear() { + this.expression = null; + } + + public String getExpression() { + return this.expression; + } + + public TCellVisibility setExpression(String expression) { + this.expression = expression; + return this; + } + + public void unsetExpression() { + this.expression = null; + } + + /** Returns true if field expression is set (has been assigned a value) and false otherwise */ + public boolean isSetExpression() { + return this.expression != null; + } + + public void setExpressionIsSet(boolean value) { + if (!value) { + this.expression = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case EXPRESSION: + if (value == null) { + unsetExpression(); + } else { + setExpression((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case EXPRESSION: + return getExpression(); + + } + 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 EXPRESSION: + return isSetExpression(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TCellVisibility) + return this.equals((TCellVisibility)that); + return false; + } + + public boolean equals(TCellVisibility that) { + if (that == null) + return false; + + boolean this_present_expression = true && this.isSetExpression(); + boolean that_present_expression = true && that.isSetExpression(); + if (this_present_expression || that_present_expression) { + if (!(this_present_expression && that_present_expression)) + return false; + if (!this.expression.equals(that.expression)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_expression = true && (isSetExpression()); + list.add(present_expression); + if (present_expression) + list.add(expression); + + return list.hashCode(); + } + + @Override + public int compareTo(TCellVisibility other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetExpression()).compareTo(other.isSetExpression()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetExpression()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.expression, other.expression); + 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("TCellVisibility("); + boolean first = true; + + if (isSetExpression()) { + sb.append("expression:"); + if (this.expression == null) { + sb.append("null"); + } else { + sb.append(this.expression); + } + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 TCellVisibilityStandardSchemeFactory implements SchemeFactory { + public TCellVisibilityStandardScheme getScheme() { + return new TCellVisibilityStandardScheme(); + } + } + + private static class TCellVisibilityStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TCellVisibility 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: // EXPRESSION + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.expression = iprot.readString(); + struct.setExpressionIsSet(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, TCellVisibility struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.expression != null) { + if (struct.isSetExpression()) { + oprot.writeFieldBegin(EXPRESSION_FIELD_DESC); + oprot.writeString(struct.expression); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TCellVisibilityTupleSchemeFactory implements SchemeFactory { + public TCellVisibilityTupleScheme getScheme() { + return new TCellVisibilityTupleScheme(); + } + } + + private static class TCellVisibilityTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TCellVisibility struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetExpression()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetExpression()) { + oprot.writeString(struct.expression); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TCellVisibility struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.expression = iprot.readString(); + struct.setExpressionIsSet(true); + } + } + } + +} + diff --git "a/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TColumn.java" "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TColumn.java" new file mode 100644 index 00000000000..d0d336c0632 --- /dev/null +++ "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TColumn.java" @@ -0,0 +1,631 @@ +/** + * 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"}) +/** + * Addresses a single cell or multiple cells + * 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") +public class TColumn implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TColumn"); + + private static final org.apache.thrift.protocol.TField FAMILY_FIELD_DESC = new org.apache.thrift.protocol.TField("family", 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 org.apache.thrift.protocol.TField TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("timestamp", org.apache.thrift.protocol.TType.I64, (short)3); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TColumnStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TColumnTupleSchemeFactory()); + } + + public ByteBuffer family; // required + public ByteBuffer qualifier; // optional + public long timestamp; // 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 { + FAMILY((short)1, "family"), + QUALIFIER((short)2, "qualifier"), + TIMESTAMP((short)3, "timestamp"); + + private static final Map byName = new HashMap(); + + 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: // FAMILY + return FAMILY; + case 2: // QUALIFIER + return QUALIFIER; + case 3: // TIMESTAMP + return TIMESTAMP; + 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 int __TIMESTAMP_ISSET_ID = 0; + private byte __isset_bitfield = 0; + private static final _Fields optionals[] = {_Fields.QUALIFIER,_Fields.TIMESTAMP}; + 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.FAMILY, new org.apache.thrift.meta_data.FieldMetaData("family", 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.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + tmpMap.put(_Fields.TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("timestamp", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TColumn.class, metaDataMap); + } + + public TColumn() { + } + + public TColumn( + ByteBuffer family) + { + this(); + this.family = org.apache.thrift.TBaseHelper.copyBinary(family); + } + + /** + * Performs a deep copy on other. + */ + public TColumn(TColumn other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetFamily()) { + this.family = org.apache.thrift.TBaseHelper.copyBinary(other.family); + } + if (other.isSetQualifier()) { + this.qualifier = org.apache.thrift.TBaseHelper.copyBinary(other.qualifier); + } + this.timestamp = other.timestamp; + } + + public TColumn deepCopy() { + return new TColumn(this); + } + + @Override + public void clear() { + this.family = null; + this.qualifier = null; + setTimestampIsSet(false); + this.timestamp = 0; + } + + public byte[] getFamily() { + setFamily(org.apache.thrift.TBaseHelper.rightSize(family)); + return family == null ? null : family.array(); + } + + public ByteBuffer bufferForFamily() { + return org.apache.thrift.TBaseHelper.copyBinary(family); + } + + public TColumn setFamily(byte[] family) { + this.family = family == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(family, family.length)); + return this; + } + + public TColumn setFamily(ByteBuffer family) { + this.family = org.apache.thrift.TBaseHelper.copyBinary(family); + return this; + } + + public void unsetFamily() { + this.family = null; + } + + /** Returns true if field family is set (has been assigned a value) and false otherwise */ + public boolean isSetFamily() { + return this.family != null; + } + + public void setFamilyIsSet(boolean value) { + if (!value) { + this.family = 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 TColumn setQualifier(byte[] qualifier) { + this.qualifier = qualifier == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(qualifier, qualifier.length)); + return this; + } + + public TColumn 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 long getTimestamp() { + return this.timestamp; + } + + public TColumn setTimestamp(long timestamp) { + this.timestamp = timestamp; + setTimestampIsSet(true); + return this; + } + + public void unsetTimestamp() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); + } + + /** Returns true if field timestamp is set (has been assigned a value) and false otherwise */ + public boolean isSetTimestamp() { + return EncodingUtils.testBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); + } + + public void setTimestampIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TIMESTAMP_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case FAMILY: + if (value == null) { + unsetFamily(); + } else { + setFamily((ByteBuffer)value); + } + break; + + case QUALIFIER: + if (value == null) { + unsetQualifier(); + } else { + setQualifier((ByteBuffer)value); + } + break; + + case TIMESTAMP: + if (value == null) { + unsetTimestamp(); + } else { + setTimestamp((Long)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case FAMILY: + return getFamily(); + + case QUALIFIER: + return getQualifier(); + + case TIMESTAMP: + return getTimestamp(); + + } + 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 FAMILY: + return isSetFamily(); + case QUALIFIER: + return isSetQualifier(); + case TIMESTAMP: + return isSetTimestamp(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TColumn) + return this.equals((TColumn)that); + return false; + } + + public boolean equals(TColumn that) { + if (that == null) + return false; + + boolean this_present_family = true && this.isSetFamily(); + boolean that_present_family = true && that.isSetFamily(); + if (this_present_family || that_present_family) { + if (!(this_present_family && that_present_family)) + return false; + if (!this.family.equals(that.family)) + 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; + } + + boolean this_present_timestamp = true && this.isSetTimestamp(); + boolean that_present_timestamp = true && that.isSetTimestamp(); + if (this_present_timestamp || that_present_timestamp) { + if (!(this_present_timestamp && that_present_timestamp)) + return false; + if (this.timestamp != that.timestamp) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_family = true && (isSetFamily()); + list.add(present_family); + if (present_family) + list.add(family); + + boolean present_qualifier = true && (isSetQualifier()); + list.add(present_qualifier); + if (present_qualifier) + list.add(qualifier); + + boolean present_timestamp = true && (isSetTimestamp()); + list.add(present_timestamp); + if (present_timestamp) + list.add(timestamp); + + return list.hashCode(); + } + + @Override + public int compareTo(TColumn other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetFamily()).compareTo(other.isSetFamily()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetFamily()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.family, other.family); + 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; + } + } + lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(other.isSetTimestamp()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTimestamp()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timestamp, other.timestamp); + 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("TColumn("); + boolean first = true; + + sb.append("family:"); + if (this.family == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.family, sb); + } + first = false; + if (isSetQualifier()) { + 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; + } + if (isSetTimestamp()) { + if (!first) sb.append(", "); + sb.append("timestamp:"); + sb.append(this.timestamp); + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (family == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'family' 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 { + // 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); + } + } + + private static class TColumnStandardSchemeFactory implements SchemeFactory { + public TColumnStandardScheme getScheme() { + return new TColumnStandardScheme(); + } + } + + private static class TColumnStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TColumn 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: // FAMILY + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.family = iprot.readBinary(); + struct.setFamilyIsSet(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; + case 3: // TIMESTAMP + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.timestamp = iprot.readI64(); + struct.setTimestampIsSet(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, TColumn struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.family != null) { + oprot.writeFieldBegin(FAMILY_FIELD_DESC); + oprot.writeBinary(struct.family); + oprot.writeFieldEnd(); + } + if (struct.qualifier != null) { + if (struct.isSetQualifier()) { + oprot.writeFieldBegin(QUALIFIER_FIELD_DESC); + oprot.writeBinary(struct.qualifier); + oprot.writeFieldEnd(); + } + } + if (struct.isSetTimestamp()) { + oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC); + oprot.writeI64(struct.timestamp); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TColumnTupleSchemeFactory implements SchemeFactory { + public TColumnTupleScheme getScheme() { + return new TColumnTupleScheme(); + } + } + + private static class TColumnTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TColumn struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeBinary(struct.family); + BitSet optionals = new BitSet(); + if (struct.isSetQualifier()) { + optionals.set(0); + } + if (struct.isSetTimestamp()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetQualifier()) { + oprot.writeBinary(struct.qualifier); + } + if (struct.isSetTimestamp()) { + oprot.writeI64(struct.timestamp); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TColumn struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.family = iprot.readBinary(); + struct.setFamilyIsSet(true); + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.qualifier = iprot.readBinary(); + struct.setQualifierIsSet(true); + } + if (incoming.get(1)) { + struct.timestamp = iprot.readI64(); + struct.setTimestampIsSet(true); + } + } + } + +} + diff --git "a/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TColumnIncrement.java" "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TColumnIncrement.java" new file mode 100644 index 00000000000..2fb3f762a76 --- /dev/null +++ "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TColumnIncrement.java" @@ -0,0 +1,625 @@ +/** + * 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"}) +/** + * Represents a single cell and the amount to increment it by + */ +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-25") +public class TColumnIncrement implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TColumnIncrement"); + + private static final org.apache.thrift.protocol.TField FAMILY_FIELD_DESC = new org.apache.thrift.protocol.TField("family", 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 org.apache.thrift.protocol.TField AMOUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("amount", org.apache.thrift.protocol.TType.I64, (short)3); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TColumnIncrementStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TColumnIncrementTupleSchemeFactory()); + } + + public ByteBuffer family; // required + public ByteBuffer qualifier; // required + public long amount; // 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 { + FAMILY((short)1, "family"), + QUALIFIER((short)2, "qualifier"), + AMOUNT((short)3, "amount"); + + private static final Map byName = new HashMap(); + + 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: // FAMILY + return FAMILY; + case 2: // QUALIFIER + return QUALIFIER; + case 3: // AMOUNT + return AMOUNT; + 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 int __AMOUNT_ISSET_ID = 0; + private byte __isset_bitfield = 0; + private static final _Fields optionals[] = {_Fields.AMOUNT}; + 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.FAMILY, new org.apache.thrift.meta_data.FieldMetaData("family", 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))); + tmpMap.put(_Fields.AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("amount", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TColumnIncrement.class, metaDataMap); + } + + public TColumnIncrement() { + this.amount = 1L; + + } + + public TColumnIncrement( + ByteBuffer family, + ByteBuffer qualifier) + { + this(); + this.family = org.apache.thrift.TBaseHelper.copyBinary(family); + this.qualifier = org.apache.thrift.TBaseHelper.copyBinary(qualifier); + } + + /** + * Performs a deep copy on other. + */ + public TColumnIncrement(TColumnIncrement other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetFamily()) { + this.family = org.apache.thrift.TBaseHelper.copyBinary(other.family); + } + if (other.isSetQualifier()) { + this.qualifier = org.apache.thrift.TBaseHelper.copyBinary(other.qualifier); + } + this.amount = other.amount; + } + + public TColumnIncrement deepCopy() { + return new TColumnIncrement(this); + } + + @Override + public void clear() { + this.family = null; + this.qualifier = null; + this.amount = 1L; + + } + + public byte[] getFamily() { + setFamily(org.apache.thrift.TBaseHelper.rightSize(family)); + return family == null ? null : family.array(); + } + + public ByteBuffer bufferForFamily() { + return org.apache.thrift.TBaseHelper.copyBinary(family); + } + + public TColumnIncrement setFamily(byte[] family) { + this.family = family == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(family, family.length)); + return this; + } + + public TColumnIncrement setFamily(ByteBuffer family) { + this.family = org.apache.thrift.TBaseHelper.copyBinary(family); + return this; + } + + public void unsetFamily() { + this.family = null; + } + + /** Returns true if field family is set (has been assigned a value) and false otherwise */ + public boolean isSetFamily() { + return this.family != null; + } + + public void setFamilyIsSet(boolean value) { + if (!value) { + this.family = 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 TColumnIncrement setQualifier(byte[] qualifier) { + this.qualifier = qualifier == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(qualifier, qualifier.length)); + return this; + } + + public TColumnIncrement 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 long getAmount() { + return this.amount; + } + + public TColumnIncrement setAmount(long amount) { + this.amount = amount; + setAmountIsSet(true); + return this; + } + + public void unsetAmount() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __AMOUNT_ISSET_ID); + } + + /** Returns true if field amount is set (has been assigned a value) and false otherwise */ + public boolean isSetAmount() { + return EncodingUtils.testBit(__isset_bitfield, __AMOUNT_ISSET_ID); + } + + public void setAmountIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __AMOUNT_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case FAMILY: + if (value == null) { + unsetFamily(); + } else { + setFamily((ByteBuffer)value); + } + break; + + case QUALIFIER: + if (value == null) { + unsetQualifier(); + } else { + setQualifier((ByteBuffer)value); + } + break; + + case AMOUNT: + if (value == null) { + unsetAmount(); + } else { + setAmount((Long)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case FAMILY: + return getFamily(); + + case QUALIFIER: + return getQualifier(); + + case AMOUNT: + return getAmount(); + + } + 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 FAMILY: + return isSetFamily(); + case QUALIFIER: + return isSetQualifier(); + case AMOUNT: + return isSetAmount(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TColumnIncrement) + return this.equals((TColumnIncrement)that); + return false; + } + + public boolean equals(TColumnIncrement that) { + if (that == null) + return false; + + boolean this_present_family = true && this.isSetFamily(); + boolean that_present_family = true && that.isSetFamily(); + if (this_present_family || that_present_family) { + if (!(this_present_family && that_present_family)) + return false; + if (!this.family.equals(that.family)) + 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; + } + + boolean this_present_amount = true && this.isSetAmount(); + boolean that_present_amount = true && that.isSetAmount(); + if (this_present_amount || that_present_amount) { + if (!(this_present_amount && that_present_amount)) + return false; + if (this.amount != that.amount) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_family = true && (isSetFamily()); + list.add(present_family); + if (present_family) + list.add(family); + + boolean present_qualifier = true && (isSetQualifier()); + list.add(present_qualifier); + if (present_qualifier) + list.add(qualifier); + + boolean present_amount = true && (isSetAmount()); + list.add(present_amount); + if (present_amount) + list.add(amount); + + return list.hashCode(); + } + + @Override + public int compareTo(TColumnIncrement other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetFamily()).compareTo(other.isSetFamily()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetFamily()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.family, other.family); + 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; + } + } + lastComparison = Boolean.valueOf(isSetAmount()).compareTo(other.isSetAmount()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetAmount()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.amount, other.amount); + 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("TColumnIncrement("); + boolean first = true; + + sb.append("family:"); + if (this.family == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.family, 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; + if (isSetAmount()) { + if (!first) sb.append(", "); + sb.append("amount:"); + sb.append(this.amount); + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (family == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'family' 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 { + // 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); + } + } + + private static class TColumnIncrementStandardSchemeFactory implements SchemeFactory { + public TColumnIncrementStandardScheme getScheme() { + return new TColumnIncrementStandardScheme(); + } + } + + private static class TColumnIncrementStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TColumnIncrement 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: // FAMILY + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.family = iprot.readBinary(); + struct.setFamilyIsSet(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; + case 3: // AMOUNT + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.amount = iprot.readI64(); + struct.setAmountIsSet(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, TColumnIncrement struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.family != null) { + oprot.writeFieldBegin(FAMILY_FIELD_DESC); + oprot.writeBinary(struct.family); + oprot.writeFieldEnd(); + } + if (struct.qualifier != null) { + oprot.writeFieldBegin(QUALIFIER_FIELD_DESC); + oprot.writeBinary(struct.qualifier); + oprot.writeFieldEnd(); + } + if (struct.isSetAmount()) { + oprot.writeFieldBegin(AMOUNT_FIELD_DESC); + oprot.writeI64(struct.amount); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TColumnIncrementTupleSchemeFactory implements SchemeFactory { + public TColumnIncrementTupleScheme getScheme() { + return new TColumnIncrementTupleScheme(); + } + } + + private static class TColumnIncrementTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TColumnIncrement struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeBinary(struct.family); + oprot.writeBinary(struct.qualifier); + BitSet optionals = new BitSet(); + if (struct.isSetAmount()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetAmount()) { + oprot.writeI64(struct.amount); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TColumnIncrement struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.family = iprot.readBinary(); + struct.setFamilyIsSet(true); + struct.qualifier = iprot.readBinary(); + struct.setQualifierIsSet(true); + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.amount = iprot.readI64(); + struct.setAmountIsSet(true); + } + } + } + +} + diff --git "a/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TColumnValue.java" "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TColumnValue.java" new file mode 100644 index 00000000000..3ceb4c019ea --- /dev/null +++ "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TColumnValue.java" @@ -0,0 +1,851 @@ +/** + * 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"}) +/** + * Represents a single cell and its value. + */ +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-25") +public class TColumnValue implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TColumnValue"); + + private static final org.apache.thrift.protocol.TField FAMILY_FIELD_DESC = new org.apache.thrift.protocol.TField("family", 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 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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TColumnValueStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TColumnValueTupleSchemeFactory()); + } + + public ByteBuffer family; // required + public ByteBuffer qualifier; // required + public ByteBuffer value; // required + public long timestamp; // optional + public ByteBuffer tags; // 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 { + FAMILY((short)1, "family"), + QUALIFIER((short)2, "qualifier"), + VALUE((short)3, "value"), + TIMESTAMP((short)4, "timestamp"), + TAGS((short)5, "tags"); + + private static final Map byName = new HashMap(); + + 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: // FAMILY + return FAMILY; + case 2: // QUALIFIER + return QUALIFIER; + case 3: // VALUE + return VALUE; + case 4: // TIMESTAMP + return TIMESTAMP; + case 5: // TAGS + return TAGS; + 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 int __TIMESTAMP_ISSET_ID = 0; + private byte __isset_bitfield = 0; + private static final _Fields optionals[] = {_Fields.TIMESTAMP,_Fields.TAGS}; + 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.FAMILY, new org.apache.thrift.meta_data.FieldMetaData("family", 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))); + tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + tmpMap.put(_Fields.TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("timestamp", org.apache.thrift.TFieldRequirementType.OPTIONAL, + 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))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TColumnValue.class, metaDataMap); + } + + public TColumnValue() { + } + + public TColumnValue( + ByteBuffer family, + ByteBuffer qualifier, + ByteBuffer value) + { + this(); + this.family = org.apache.thrift.TBaseHelper.copyBinary(family); + this.qualifier = org.apache.thrift.TBaseHelper.copyBinary(qualifier); + this.value = org.apache.thrift.TBaseHelper.copyBinary(value); + } + + /** + * Performs a deep copy on other. + */ + public TColumnValue(TColumnValue other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetFamily()) { + this.family = org.apache.thrift.TBaseHelper.copyBinary(other.family); + } + if (other.isSetQualifier()) { + this.qualifier = org.apache.thrift.TBaseHelper.copyBinary(other.qualifier); + } + if (other.isSetValue()) { + this.value = org.apache.thrift.TBaseHelper.copyBinary(other.value); + } + this.timestamp = other.timestamp; + if (other.isSetTags()) { + this.tags = org.apache.thrift.TBaseHelper.copyBinary(other.tags); + } + } + + public TColumnValue deepCopy() { + return new TColumnValue(this); + } + + @Override + public void clear() { + this.family = null; + this.qualifier = null; + this.value = null; + setTimestampIsSet(false); + this.timestamp = 0; + this.tags = null; + } + + public byte[] getFamily() { + setFamily(org.apache.thrift.TBaseHelper.rightSize(family)); + return family == null ? null : family.array(); + } + + public ByteBuffer bufferForFamily() { + return org.apache.thrift.TBaseHelper.copyBinary(family); + } + + public TColumnValue setFamily(byte[] family) { + this.family = family == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(family, family.length)); + return this; + } + + public TColumnValue setFamily(ByteBuffer family) { + this.family = org.apache.thrift.TBaseHelper.copyBinary(family); + return this; + } + + public void unsetFamily() { + this.family = null; + } + + /** Returns true if field family is set (has been assigned a value) and false otherwise */ + public boolean isSetFamily() { + return this.family != null; + } + + public void setFamilyIsSet(boolean value) { + if (!value) { + this.family = 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 TColumnValue setQualifier(byte[] qualifier) { + this.qualifier = qualifier == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(qualifier, qualifier.length)); + return this; + } + + public TColumnValue 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 byte[] getValue() { + setValue(org.apache.thrift.TBaseHelper.rightSize(value)); + return value == null ? null : value.array(); + } + + public ByteBuffer bufferForValue() { + return org.apache.thrift.TBaseHelper.copyBinary(value); + } + + public TColumnValue setValue(byte[] value) { + this.value = value == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(value, value.length)); + return this; + } + + public TColumnValue setValue(ByteBuffer value) { + this.value = org.apache.thrift.TBaseHelper.copyBinary(value); + return this; + } + + public void unsetValue() { + this.value = null; + } + + /** Returns true if field value is set (has been assigned a value) and false otherwise */ + public boolean isSetValue() { + return this.value != null; + } + + public void setValueIsSet(boolean value) { + if (!value) { + this.value = null; + } + } + + public long getTimestamp() { + return this.timestamp; + } + + public TColumnValue setTimestamp(long timestamp) { + this.timestamp = timestamp; + setTimestampIsSet(true); + return this; + } + + public void unsetTimestamp() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); + } + + /** Returns true if field timestamp is set (has been assigned a value) and false otherwise */ + public boolean isSetTimestamp() { + return EncodingUtils.testBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); + } + + public void setTimestampIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TIMESTAMP_ISSET_ID, value); + } + + public byte[] getTags() { + setTags(org.apache.thrift.TBaseHelper.rightSize(tags)); + return tags == null ? null : tags.array(); + } + + public ByteBuffer bufferForTags() { + return org.apache.thrift.TBaseHelper.copyBinary(tags); + } + + public TColumnValue setTags(byte[] tags) { + this.tags = tags == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(tags, tags.length)); + return this; + } + + public TColumnValue setTags(ByteBuffer tags) { + this.tags = org.apache.thrift.TBaseHelper.copyBinary(tags); + return this; + } + + public void unsetTags() { + this.tags = null; + } + + /** Returns true if field tags is set (has been assigned a value) and false otherwise */ + public boolean isSetTags() { + return this.tags != null; + } + + public void setTagsIsSet(boolean value) { + if (!value) { + this.tags = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case FAMILY: + if (value == null) { + unsetFamily(); + } else { + setFamily((ByteBuffer)value); + } + break; + + case QUALIFIER: + if (value == null) { + unsetQualifier(); + } else { + setQualifier((ByteBuffer)value); + } + break; + + case VALUE: + if (value == null) { + unsetValue(); + } else { + setValue((ByteBuffer)value); + } + break; + + case TIMESTAMP: + if (value == null) { + unsetTimestamp(); + } else { + setTimestamp((Long)value); + } + break; + + case TAGS: + if (value == null) { + unsetTags(); + } else { + setTags((ByteBuffer)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case FAMILY: + return getFamily(); + + case QUALIFIER: + return getQualifier(); + + case VALUE: + return getValue(); + + case TIMESTAMP: + return getTimestamp(); + + case TAGS: + return getTags(); + + } + 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 FAMILY: + return isSetFamily(); + case QUALIFIER: + return isSetQualifier(); + case VALUE: + return isSetValue(); + case TIMESTAMP: + return isSetTimestamp(); + case TAGS: + return isSetTags(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TColumnValue) + return this.equals((TColumnValue)that); + return false; + } + + public boolean equals(TColumnValue that) { + if (that == null) + return false; + + boolean this_present_family = true && this.isSetFamily(); + boolean that_present_family = true && that.isSetFamily(); + if (this_present_family || that_present_family) { + if (!(this_present_family && that_present_family)) + return false; + if (!this.family.equals(that.family)) + 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; + } + + boolean this_present_value = true && this.isSetValue(); + boolean that_present_value = true && that.isSetValue(); + if (this_present_value || that_present_value) { + if (!(this_present_value && that_present_value)) + return false; + if (!this.value.equals(that.value)) + return false; + } + + boolean this_present_timestamp = true && this.isSetTimestamp(); + boolean that_present_timestamp = true && that.isSetTimestamp(); + if (this_present_timestamp || that_present_timestamp) { + if (!(this_present_timestamp && that_present_timestamp)) + return false; + if (this.timestamp != that.timestamp) + return false; + } + + boolean this_present_tags = true && this.isSetTags(); + boolean that_present_tags = true && that.isSetTags(); + if (this_present_tags || that_present_tags) { + if (!(this_present_tags && that_present_tags)) + return false; + if (!this.tags.equals(that.tags)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_family = true && (isSetFamily()); + list.add(present_family); + if (present_family) + list.add(family); + + boolean present_qualifier = true && (isSetQualifier()); + list.add(present_qualifier); + if (present_qualifier) + list.add(qualifier); + + boolean present_value = true && (isSetValue()); + list.add(present_value); + if (present_value) + list.add(value); + + boolean present_timestamp = true && (isSetTimestamp()); + list.add(present_timestamp); + if (present_timestamp) + list.add(timestamp); + + boolean present_tags = true && (isSetTags()); + list.add(present_tags); + if (present_tags) + list.add(tags); + + return list.hashCode(); + } + + @Override + public int compareTo(TColumnValue other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetFamily()).compareTo(other.isSetFamily()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetFamily()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.family, other.family); + 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; + } + } + lastComparison = Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValue()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, other.value); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(other.isSetTimestamp()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTimestamp()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timestamp, other.timestamp); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetTags()).compareTo(other.isSetTags()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTags()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tags, other.tags); + 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("TColumnValue("); + boolean first = true; + + sb.append("family:"); + if (this.family == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.family, 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; + if (!first) sb.append(", "); + sb.append("value:"); + if (this.value == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.value, sb); + } + first = false; + if (isSetTimestamp()) { + if (!first) sb.append(", "); + sb.append("timestamp:"); + sb.append(this.timestamp); + first = false; + } + if (isSetTags()) { + if (!first) sb.append(", "); + sb.append("tags:"); + if (this.tags == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.tags, sb); + } + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (family == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'family' was not present! Struct: " + toString()); + } + if (qualifier == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'qualifier' was not present! Struct: " + toString()); + } + if (value == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'value' 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 { + // 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); + } + } + + private static class TColumnValueStandardSchemeFactory implements SchemeFactory { + public TColumnValueStandardScheme getScheme() { + return new TColumnValueStandardScheme(); + } + } + + private static class TColumnValueStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TColumnValue 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: // FAMILY + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.family = iprot.readBinary(); + struct.setFamilyIsSet(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; + case 3: // VALUE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.value = iprot.readBinary(); + struct.setValueIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // TIMESTAMP + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.timestamp = iprot.readI64(); + struct.setTimestampIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // TAGS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.tags = iprot.readBinary(); + struct.setTagsIsSet(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, TColumnValue struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.family != null) { + oprot.writeFieldBegin(FAMILY_FIELD_DESC); + oprot.writeBinary(struct.family); + oprot.writeFieldEnd(); + } + if (struct.qualifier != null) { + oprot.writeFieldBegin(QUALIFIER_FIELD_DESC); + oprot.writeBinary(struct.qualifier); + oprot.writeFieldEnd(); + } + if (struct.value != null) { + oprot.writeFieldBegin(VALUE_FIELD_DESC); + oprot.writeBinary(struct.value); + oprot.writeFieldEnd(); + } + if (struct.isSetTimestamp()) { + oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC); + oprot.writeI64(struct.timestamp); + oprot.writeFieldEnd(); + } + if (struct.tags != null) { + if (struct.isSetTags()) { + oprot.writeFieldBegin(TAGS_FIELD_DESC); + oprot.writeBinary(struct.tags); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TColumnValueTupleSchemeFactory implements SchemeFactory { + public TColumnValueTupleScheme getScheme() { + return new TColumnValueTupleScheme(); + } + } + + private static class TColumnValueTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TColumnValue struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeBinary(struct.family); + oprot.writeBinary(struct.qualifier); + oprot.writeBinary(struct.value); + BitSet optionals = new BitSet(); + if (struct.isSetTimestamp()) { + optionals.set(0); + } + if (struct.isSetTags()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetTimestamp()) { + oprot.writeI64(struct.timestamp); + } + if (struct.isSetTags()) { + oprot.writeBinary(struct.tags); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TColumnValue struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.family = iprot.readBinary(); + struct.setFamilyIsSet(true); + struct.qualifier = iprot.readBinary(); + struct.setQualifierIsSet(true); + struct.value = iprot.readBinary(); + struct.setValueIsSet(true); + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.timestamp = iprot.readI64(); + struct.setTimestampIsSet(true); + } + if (incoming.get(1)) { + struct.tags = iprot.readBinary(); + struct.setTagsIsSet(true); + } + } + } + +} + diff --git "a/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TCompareOp.java" "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TCompareOp.java" new file mode 100644 index 00000000000..efbba09cbee --- /dev/null +++ "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TCompareOp.java" @@ -0,0 +1,64 @@ +/** + * 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; + +/** + * Thrift wrapper around + * org.apache.hadoop.hbase.filter.CompareFilter$CompareOp. + */ +public enum TCompareOp implements org.apache.thrift.TEnum { + LESS(0), + LESS_OR_EQUAL(1), + EQUAL(2), + NOT_EQUAL(3), + GREATER_OR_EQUAL(4), + GREATER(5), + NO_OP(6); + + private final int value; + + private TCompareOp(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 TCompareOp findByValue(int value) { + switch (value) { + case 0: + return LESS; + case 1: + return LESS_OR_EQUAL; + case 2: + return EQUAL; + case 3: + return NOT_EQUAL; + case 4: + return GREATER_OR_EQUAL; + case 5: + return GREATER; + case 6: + return NO_OP; + default: + return null; + } + } +} diff --git "a/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TDelete.java" "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TDelete.java" new file mode 100644 index 00000000000..8f7f119363c --- /dev/null +++ "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TDelete.java" @@ -0,0 +1,1104 @@ +/** + * 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"}) +/** + * Used to perform Delete operations on a single row. + * + * The scope can be further narrowed down by specifying a list of + * columns or column families as TColumns. + * + * Specifying only a family in a TColumn will delete the whole family. + * If a timestamp is specified all versions with a timestamp less than + * or equal to this will be deleted. If no timestamp is specified the + * current time will be used. + * + * Specifying a family and a column qualifier in a TColumn will delete only + * this qualifier. If a timestamp is specified only versions equal + * to this timestamp will be deleted. If no timestamp is specified the + * most recent version will be deleted. To delete all previous versions, + * specify the DELETE_COLUMNS TDeleteType. + * + * The top level timestamp is only used if a complete row should be deleted + * (i.e. no columns are passed) and if it is specified it works the same way + * as if you had added a TColumn for every column family and this timestamp + * (i.e. all versions older than or equal in all column families will be deleted) + * + * You can specify how this Delete should be written to the write-ahead Log (WAL) + * 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") +public class TDelete implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TDelete"); + + 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 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 TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("timestamp", org.apache.thrift.protocol.TType.I64, (short)3); + private static final org.apache.thrift.protocol.TField DELETE_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("deleteType", org.apache.thrift.protocol.TType.I32, (short)4); + 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)6); + 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)7); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TDeleteStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TDeleteTupleSchemeFactory()); + } + + public ByteBuffer row; // required + public List columns; // optional + public long timestamp; // optional + /** + * + * @see TDeleteType + */ + public TDeleteType deleteType; // optional + public Map 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 { + ROW((short)1, "row"), + COLUMNS((short)2, "columns"), + TIMESTAMP((short)3, "timestamp"), + /** + * + * @see TDeleteType + */ + DELETE_TYPE((short)4, "deleteType"), + ATTRIBUTES((short)6, "attributes"), + /** + * + * @see TDurability + */ + DURABILITY((short)7, "durability"); + + private static final Map byName = new HashMap(); + + 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: // ROW + return ROW; + case 2: // COLUMNS + return COLUMNS; + case 3: // TIMESTAMP + return TIMESTAMP; + case 4: // DELETE_TYPE + return DELETE_TYPE; + case 6: // ATTRIBUTES + return ATTRIBUTES; + case 7: // 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 int __TIMESTAMP_ISSET_ID = 0; + private byte __isset_bitfield = 0; + private static final _Fields optionals[] = {_Fields.COLUMNS,_Fields.TIMESTAMP,_Fields.DELETE_TYPE,_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.ROW, new org.apache.thrift.meta_data.FieldMetaData("row", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + 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, TColumn.class)))); + tmpMap.put(_Fields.TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("timestamp", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.DELETE_TYPE, new org.apache.thrift.meta_data.FieldMetaData("deleteType", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TDeleteType.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(TDelete.class, metaDataMap); + } + + public TDelete() { + this.deleteType = org.apache.hadoop.hbase.thrift2.generated.TDeleteType.DELETE_COLUMNS; + + } + + public TDelete( + ByteBuffer row) + { + this(); + this.row = org.apache.thrift.TBaseHelper.copyBinary(row); + } + + /** + * Performs a deep copy on other. + */ + public TDelete(TDelete other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetRow()) { + this.row = org.apache.thrift.TBaseHelper.copyBinary(other.row); + } + if (other.isSetColumns()) { + List __this__columns = new ArrayList(other.columns.size()); + for (TColumn other_element : other.columns) { + __this__columns.add(new TColumn(other_element)); + } + this.columns = __this__columns; + } + this.timestamp = other.timestamp; + if (other.isSetDeleteType()) { + this.deleteType = other.deleteType; + } + if (other.isSetAttributes()) { + Map __this__attributes = new HashMap(other.attributes); + this.attributes = __this__attributes; + } + if (other.isSetDurability()) { + this.durability = other.durability; + } + } + + public TDelete deepCopy() { + return new TDelete(this); + } + + @Override + public void clear() { + this.row = null; + this.columns = null; + setTimestampIsSet(false); + this.timestamp = 0; + this.deleteType = org.apache.hadoop.hbase.thrift2.generated.TDeleteType.DELETE_COLUMNS; + + this.attributes = null; + this.durability = null; + } + + public byte[] getRow() { + setRow(org.apache.thrift.TBaseHelper.rightSize(row)); + return row == null ? null : row.array(); + } + + public ByteBuffer bufferForRow() { + return org.apache.thrift.TBaseHelper.copyBinary(row); + } + + public TDelete setRow(byte[] row) { + this.row = row == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(row, row.length)); + return this; + } + + public TDelete setRow(ByteBuffer row) { + this.row = org.apache.thrift.TBaseHelper.copyBinary(row); + return this; + } + + public void unsetRow() { + this.row = null; + } + + /** Returns true if field row is set (has been assigned a value) and false otherwise */ + public boolean isSetRow() { + return this.row != null; + } + + public void setRowIsSet(boolean value) { + if (!value) { + this.row = null; + } + } + + public int getColumnsSize() { + return (this.columns == null) ? 0 : this.columns.size(); + } + + public java.util.Iterator getColumnsIterator() { + return (this.columns == null) ? null : this.columns.iterator(); + } + + public void addToColumns(TColumn elem) { + if (this.columns == null) { + this.columns = new ArrayList(); + } + this.columns.add(elem); + } + + public List getColumns() { + return this.columns; + } + + public TDelete setColumns(List 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 long getTimestamp() { + return this.timestamp; + } + + public TDelete setTimestamp(long timestamp) { + this.timestamp = timestamp; + setTimestampIsSet(true); + return this; + } + + public void unsetTimestamp() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); + } + + /** Returns true if field timestamp is set (has been assigned a value) and false otherwise */ + public boolean isSetTimestamp() { + return EncodingUtils.testBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); + } + + public void setTimestampIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TIMESTAMP_ISSET_ID, value); + } + + /** + * + * @see TDeleteType + */ + public TDeleteType getDeleteType() { + return this.deleteType; + } + + /** + * + * @see TDeleteType + */ + public TDelete setDeleteType(TDeleteType deleteType) { + this.deleteType = deleteType; + return this; + } + + public void unsetDeleteType() { + this.deleteType = null; + } + + /** Returns true if field deleteType is set (has been assigned a value) and false otherwise */ + public boolean isSetDeleteType() { + return this.deleteType != null; + } + + public void setDeleteTypeIsSet(boolean value) { + if (!value) { + this.deleteType = 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(); + } + this.attributes.put(key, val); + } + + public Map getAttributes() { + return this.attributes; + } + + public TDelete setAttributes(Map 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 TDelete 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 ROW: + if (value == null) { + unsetRow(); + } else { + setRow((ByteBuffer)value); + } + break; + + case COLUMNS: + if (value == null) { + unsetColumns(); + } else { + setColumns((List)value); + } + break; + + case TIMESTAMP: + if (value == null) { + unsetTimestamp(); + } else { + setTimestamp((Long)value); + } + break; + + case DELETE_TYPE: + if (value == null) { + unsetDeleteType(); + } else { + setDeleteType((TDeleteType)value); + } + break; + + case ATTRIBUTES: + if (value == null) { + unsetAttributes(); + } else { + setAttributes((Map)value); + } + break; + + case DURABILITY: + if (value == null) { + unsetDurability(); + } else { + setDurability((TDurability)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case ROW: + return getRow(); + + case COLUMNS: + return getColumns(); + + case TIMESTAMP: + return getTimestamp(); + + case DELETE_TYPE: + return getDeleteType(); + + 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 ROW: + return isSetRow(); + case COLUMNS: + return isSetColumns(); + case TIMESTAMP: + return isSetTimestamp(); + case DELETE_TYPE: + return isSetDeleteType(); + 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 TDelete) + return this.equals((TDelete)that); + return false; + } + + public boolean equals(TDelete that) { + if (that == null) + return false; + + boolean this_present_row = true && this.isSetRow(); + boolean that_present_row = true && that.isSetRow(); + if (this_present_row || that_present_row) { + if (!(this_present_row && that_present_row)) + return false; + if (!this.row.equals(that.row)) + 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_timestamp = true && this.isSetTimestamp(); + boolean that_present_timestamp = true && that.isSetTimestamp(); + if (this_present_timestamp || that_present_timestamp) { + if (!(this_present_timestamp && that_present_timestamp)) + return false; + if (this.timestamp != that.timestamp) + return false; + } + + boolean this_present_deleteType = true && this.isSetDeleteType(); + boolean that_present_deleteType = true && that.isSetDeleteType(); + if (this_present_deleteType || that_present_deleteType) { + if (!(this_present_deleteType && that_present_deleteType)) + return false; + if (!this.deleteType.equals(that.deleteType)) + 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 list = new ArrayList(); + + boolean present_row = true && (isSetRow()); + list.add(present_row); + if (present_row) + list.add(row); + + boolean present_columns = true && (isSetColumns()); + list.add(present_columns); + if (present_columns) + list.add(columns); + + boolean present_timestamp = true && (isSetTimestamp()); + list.add(present_timestamp); + if (present_timestamp) + list.add(timestamp); + + boolean present_deleteType = true && (isSetDeleteType()); + list.add(present_deleteType); + if (present_deleteType) + list.add(deleteType.getValue()); + + 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(TDelete other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetRow()).compareTo(other.isSetRow()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRow()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.row, other.row); + 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(isSetTimestamp()).compareTo(other.isSetTimestamp()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTimestamp()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timestamp, other.timestamp); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetDeleteType()).compareTo(other.isSetDeleteType()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetDeleteType()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.deleteType, other.deleteType); + 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("TDelete("); + boolean first = true; + + sb.append("row:"); + if (this.row == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.row, sb); + } + 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 (isSetTimestamp()) { + if (!first) sb.append(", "); + sb.append("timestamp:"); + sb.append(this.timestamp); + first = false; + } + if (isSetDeleteType()) { + if (!first) sb.append(", "); + sb.append("deleteType:"); + if (this.deleteType == null) { + sb.append("null"); + } else { + sb.append(this.deleteType); + } + 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 (row == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'row' 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 { + // 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); + } + } + + private static class TDeleteStandardSchemeFactory implements SchemeFactory { + public TDeleteStandardScheme getScheme() { + return new TDeleteStandardScheme(); + } + } + + private static class TDeleteStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TDelete 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: // ROW + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.row = iprot.readBinary(); + struct.setRowIsSet(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 _list52 = iprot.readListBegin(); + struct.columns = new ArrayList(_list52.size); + TColumn _elem53; + for (int _i54 = 0; _i54 < _list52.size; ++_i54) + { + _elem53 = new TColumn(); + _elem53.read(iprot); + struct.columns.add(_elem53); + } + iprot.readListEnd(); + } + struct.setColumnsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // TIMESTAMP + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.timestamp = iprot.readI64(); + struct.setTimestampIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // DELETE_TYPE + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.deleteType = org.apache.hadoop.hbase.thrift2.generated.TDeleteType.findByValue(iprot.readI32()); + struct.setDeleteTypeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 6: // ATTRIBUTES + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map55 = iprot.readMapBegin(); + struct.attributes = new HashMap(2*_map55.size); + ByteBuffer _key56; + ByteBuffer _val57; + for (int _i58 = 0; _i58 < _map55.size; ++_i58) + { + _key56 = iprot.readBinary(); + _val57 = iprot.readBinary(); + struct.attributes.put(_key56, _val57); + } + iprot.readMapEnd(); + } + struct.setAttributesIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 7: // 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, TDelete struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.row != null) { + oprot.writeFieldBegin(ROW_FIELD_DESC); + oprot.writeBinary(struct.row); + 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 (TColumn _iter59 : struct.columns) + { + _iter59.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + } + if (struct.isSetTimestamp()) { + oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC); + oprot.writeI64(struct.timestamp); + oprot.writeFieldEnd(); + } + if (struct.deleteType != null) { + if (struct.isSetDeleteType()) { + oprot.writeFieldBegin(DELETE_TYPE_FIELD_DESC); + oprot.writeI32(struct.deleteType.getValue()); + 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 _iter60 : struct.attributes.entrySet()) + { + oprot.writeBinary(_iter60.getKey()); + oprot.writeBinary(_iter60.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 TDeleteTupleSchemeFactory implements SchemeFactory { + public TDeleteTupleScheme getScheme() { + return new TDeleteTupleScheme(); + } + } + + private static class TDeleteTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TDelete struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeBinary(struct.row); + BitSet optionals = new BitSet(); + if (struct.isSetColumns()) { + optionals.set(0); + } + if (struct.isSetTimestamp()) { + optionals.set(1); + } + if (struct.isSetDeleteType()) { + optionals.set(2); + } + if (struct.isSetAttributes()) { + optionals.set(3); + } + if (struct.isSetDurability()) { + optionals.set(4); + } + oprot.writeBitSet(optionals, 5); + if (struct.isSetColumns()) { + { + oprot.writeI32(struct.columns.size()); + for (TColumn _iter61 : struct.columns) + { + _iter61.write(oprot); + } + } + } + if (struct.isSetTimestamp()) { + oprot.writeI64(struct.timestamp); + } + if (struct.isSetDeleteType()) { + oprot.writeI32(struct.deleteType.getValue()); + } + if (struct.isSetAttributes()) { + { + oprot.writeI32(struct.attributes.size()); + for (Map.Entry _iter62 : struct.attributes.entrySet()) + { + oprot.writeBinary(_iter62.getKey()); + oprot.writeBinary(_iter62.getValue()); + } + } + } + if (struct.isSetDurability()) { + oprot.writeI32(struct.durability.getValue()); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TDelete struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.row = iprot.readBinary(); + struct.setRowIsSet(true); + BitSet incoming = iprot.readBitSet(5); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list63 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.columns = new ArrayList(_list63.size); + TColumn _elem64; + for (int _i65 = 0; _i65 < _list63.size; ++_i65) + { + _elem64 = new TColumn(); + _elem64.read(iprot); + struct.columns.add(_elem64); + } + } + struct.setColumnsIsSet(true); + } + if (incoming.get(1)) { + struct.timestamp = iprot.readI64(); + struct.setTimestampIsSet(true); + } + if (incoming.get(2)) { + struct.deleteType = org.apache.hadoop.hbase.thrift2.generated.TDeleteType.findByValue(iprot.readI32()); + struct.setDeleteTypeIsSet(true); + } + if (incoming.get(3)) { + { + org.apache.thrift.protocol.TMap _map66 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.attributes = new HashMap(2*_map66.size); + ByteBuffer _key67; + ByteBuffer _val68; + for (int _i69 = 0; _i69 < _map66.size; ++_i69) + { + _key67 = iprot.readBinary(); + _val68 = iprot.readBinary(); + struct.attributes.put(_key67, _val68); + } + } + struct.setAttributesIsSet(true); + } + if (incoming.get(4)) { + struct.durability = org.apache.hadoop.hbase.thrift2.generated.TDurability.findByValue(iprot.readI32()); + struct.setDurabilityIsSet(true); + } + } + } + +} + diff --git "a/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TDeleteType.java" "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TDeleteType.java" new file mode 100644 index 00000000000..5d47508a716 --- /dev/null +++ "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TDeleteType.java" @@ -0,0 +1,50 @@ +/** + * 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; + +/** + * Specify type of delete: + * - DELETE_COLUMN means exactly one version will be removed, + * - DELETE_COLUMNS means previous versions will also be removed. + */ +public enum TDeleteType implements org.apache.thrift.TEnum { + DELETE_COLUMN(0), + DELETE_COLUMNS(1); + + private final int value; + + private TDeleteType(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 TDeleteType findByValue(int value) { + switch (value) { + case 0: + return DELETE_COLUMN; + case 1: + return DELETE_COLUMNS; + default: + return null; + } + } +} diff --git "a/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TDurability.java" "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TDurability.java" new file mode 100644 index 00000000000..c1144f307ad --- /dev/null +++ "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TDurability.java" @@ -0,0 +1,58 @@ +/** + * 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; + +/** + * Specify Durability: + * - SKIP_WAL means do not write the Mutation to the WAL. + * - ASYNC_WAL means write the Mutation to the WAL asynchronously, + * - SYNC_WAL means write the Mutation to the WAL synchronously, + * - FSYNC_WAL means Write the Mutation to the WAL synchronously and force the entries to disk. + */ +public enum TDurability implements org.apache.thrift.TEnum { + SKIP_WAL(1), + ASYNC_WAL(2), + SYNC_WAL(3), + FSYNC_WAL(4); + + private final int value; + + private TDurability(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 TDurability findByValue(int value) { + switch (value) { + case 1: + return SKIP_WAL; + case 2: + return ASYNC_WAL; + case 3: + return SYNC_WAL; + case 4: + return FSYNC_WAL; + default: + return null; + } + } +} diff --git "a/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TGet.java" "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TGet.java" new file mode 100644 index 00000000000..a493bd95d98 --- /dev/null +++ "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TGet.java" @@ -0,0 +1,1283 @@ +/** + * 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"}) +/** + * Used to perform Get operations on a single row. + * + * The scope can be further narrowed down by specifying a list of + * columns or column families. + * + * To get everything for a row, instantiate a Get object with just the row to get. + * To further define the scope of what to get you can add a timestamp or time range + * with an optional maximum number of versions to return. + * + * 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 = "2016-05-25") +public class TGet implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGet"); + + 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 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 TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("timestamp", org.apache.thrift.protocol.TType.I64, (short)3); + private static final org.apache.thrift.protocol.TField TIME_RANGE_FIELD_DESC = new org.apache.thrift.protocol.TField("timeRange", org.apache.thrift.protocol.TType.STRUCT, (short)4); + private static final org.apache.thrift.protocol.TField MAX_VERSIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("maxVersions", org.apache.thrift.protocol.TType.I32, (short)5); + private static final org.apache.thrift.protocol.TField FILTER_STRING_FIELD_DESC = new org.apache.thrift.protocol.TField("filterString", org.apache.thrift.protocol.TType.STRING, (short)6); + 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)7); + 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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TGetStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TGetTupleSchemeFactory()); + } + + public ByteBuffer row; // required + public List columns; // optional + public long timestamp; // optional + public TTimeRange timeRange; // optional + public int maxVersions; // optional + public ByteBuffer filterString; // optional + public Map attributes; // optional + public TAuthorization authorizations; // 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"), + COLUMNS((short)2, "columns"), + TIMESTAMP((short)3, "timestamp"), + TIME_RANGE((short)4, "timeRange"), + MAX_VERSIONS((short)5, "maxVersions"), + FILTER_STRING((short)6, "filterString"), + ATTRIBUTES((short)7, "attributes"), + AUTHORIZATIONS((short)8, "authorizations"); + + private static final Map byName = new HashMap(); + + 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: // ROW + return ROW; + case 2: // COLUMNS + return COLUMNS; + case 3: // TIMESTAMP + return TIMESTAMP; + case 4: // TIME_RANGE + return TIME_RANGE; + case 5: // MAX_VERSIONS + return MAX_VERSIONS; + case 6: // FILTER_STRING + return FILTER_STRING; + case 7: // ATTRIBUTES + return ATTRIBUTES; + case 8: // AUTHORIZATIONS + return AUTHORIZATIONS; + 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 int __TIMESTAMP_ISSET_ID = 0; + private static final int __MAXVERSIONS_ISSET_ID = 1; + 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}; + 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.ROW, new org.apache.thrift.meta_data.FieldMetaData("row", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + 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, TColumn.class)))); + tmpMap.put(_Fields.TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("timestamp", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.TIME_RANGE, new org.apache.thrift.meta_data.FieldMetaData("timeRange", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TTimeRange.class))); + tmpMap.put(_Fields.MAX_VERSIONS, new org.apache.thrift.meta_data.FieldMetaData("maxVersions", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.FILTER_STRING, new org.apache.thrift.meta_data.FieldMetaData("filterString", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + 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.AUTHORIZATIONS, new org.apache.thrift.meta_data.FieldMetaData("authorizations", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TAuthorization.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGet.class, metaDataMap); + } + + public TGet() { + } + + public TGet( + ByteBuffer row) + { + this(); + this.row = org.apache.thrift.TBaseHelper.copyBinary(row); + } + + /** + * Performs a deep copy on other. + */ + public TGet(TGet other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetRow()) { + this.row = org.apache.thrift.TBaseHelper.copyBinary(other.row); + } + if (other.isSetColumns()) { + List __this__columns = new ArrayList(other.columns.size()); + for (TColumn other_element : other.columns) { + __this__columns.add(new TColumn(other_element)); + } + this.columns = __this__columns; + } + this.timestamp = other.timestamp; + if (other.isSetTimeRange()) { + this.timeRange = new TTimeRange(other.timeRange); + } + this.maxVersions = other.maxVersions; + if (other.isSetFilterString()) { + this.filterString = org.apache.thrift.TBaseHelper.copyBinary(other.filterString); + } + if (other.isSetAttributes()) { + Map __this__attributes = new HashMap(other.attributes); + this.attributes = __this__attributes; + } + if (other.isSetAuthorizations()) { + this.authorizations = new TAuthorization(other.authorizations); + } + } + + public TGet deepCopy() { + return new TGet(this); + } + + @Override + public void clear() { + this.row = null; + this.columns = null; + setTimestampIsSet(false); + this.timestamp = 0; + this.timeRange = null; + setMaxVersionsIsSet(false); + this.maxVersions = 0; + this.filterString = null; + this.attributes = null; + this.authorizations = null; + } + + public byte[] getRow() { + setRow(org.apache.thrift.TBaseHelper.rightSize(row)); + return row == null ? null : row.array(); + } + + public ByteBuffer bufferForRow() { + return org.apache.thrift.TBaseHelper.copyBinary(row); + } + + public TGet setRow(byte[] row) { + this.row = row == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(row, row.length)); + return this; + } + + public TGet setRow(ByteBuffer row) { + this.row = org.apache.thrift.TBaseHelper.copyBinary(row); + return this; + } + + public void unsetRow() { + this.row = null; + } + + /** Returns true if field row is set (has been assigned a value) and false otherwise */ + public boolean isSetRow() { + return this.row != null; + } + + public void setRowIsSet(boolean value) { + if (!value) { + this.row = null; + } + } + + public int getColumnsSize() { + return (this.columns == null) ? 0 : this.columns.size(); + } + + public java.util.Iterator getColumnsIterator() { + return (this.columns == null) ? null : this.columns.iterator(); + } + + public void addToColumns(TColumn elem) { + if (this.columns == null) { + this.columns = new ArrayList(); + } + this.columns.add(elem); + } + + public List getColumns() { + return this.columns; + } + + public TGet setColumns(List 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 long getTimestamp() { + return this.timestamp; + } + + public TGet setTimestamp(long timestamp) { + this.timestamp = timestamp; + setTimestampIsSet(true); + return this; + } + + public void unsetTimestamp() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); + } + + /** Returns true if field timestamp is set (has been assigned a value) and false otherwise */ + public boolean isSetTimestamp() { + return EncodingUtils.testBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); + } + + public void setTimestampIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TIMESTAMP_ISSET_ID, value); + } + + public TTimeRange getTimeRange() { + return this.timeRange; + } + + public TGet setTimeRange(TTimeRange timeRange) { + this.timeRange = timeRange; + return this; + } + + public void unsetTimeRange() { + this.timeRange = null; + } + + /** Returns true if field timeRange is set (has been assigned a value) and false otherwise */ + public boolean isSetTimeRange() { + return this.timeRange != null; + } + + public void setTimeRangeIsSet(boolean value) { + if (!value) { + this.timeRange = null; + } + } + + public int getMaxVersions() { + return this.maxVersions; + } + + public TGet setMaxVersions(int maxVersions) { + this.maxVersions = maxVersions; + setMaxVersionsIsSet(true); + return this; + } + + public void unsetMaxVersions() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MAXVERSIONS_ISSET_ID); + } + + /** Returns true if field maxVersions is set (has been assigned a value) and false otherwise */ + public boolean isSetMaxVersions() { + return EncodingUtils.testBit(__isset_bitfield, __MAXVERSIONS_ISSET_ID); + } + + public void setMaxVersionsIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MAXVERSIONS_ISSET_ID, value); + } + + public byte[] getFilterString() { + setFilterString(org.apache.thrift.TBaseHelper.rightSize(filterString)); + return filterString == null ? null : filterString.array(); + } + + public ByteBuffer bufferForFilterString() { + return org.apache.thrift.TBaseHelper.copyBinary(filterString); + } + + public TGet setFilterString(byte[] filterString) { + this.filterString = filterString == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(filterString, filterString.length)); + return this; + } + + public TGet setFilterString(ByteBuffer filterString) { + this.filterString = org.apache.thrift.TBaseHelper.copyBinary(filterString); + return this; + } + + public void unsetFilterString() { + this.filterString = null; + } + + /** Returns true if field filterString is set (has been assigned a value) and false otherwise */ + public boolean isSetFilterString() { + return this.filterString != null; + } + + public void setFilterStringIsSet(boolean value) { + if (!value) { + this.filterString = 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(); + } + this.attributes.put(key, val); + } + + public Map getAttributes() { + return this.attributes; + } + + public TGet setAttributes(Map 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; + } + } + + public TAuthorization getAuthorizations() { + return this.authorizations; + } + + public TGet setAuthorizations(TAuthorization authorizations) { + this.authorizations = authorizations; + return this; + } + + public void unsetAuthorizations() { + this.authorizations = null; + } + + /** Returns true if field authorizations is set (has been assigned a value) and false otherwise */ + public boolean isSetAuthorizations() { + return this.authorizations != null; + } + + public void setAuthorizationsIsSet(boolean value) { + if (!value) { + this.authorizations = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case ROW: + if (value == null) { + unsetRow(); + } else { + setRow((ByteBuffer)value); + } + break; + + case COLUMNS: + if (value == null) { + unsetColumns(); + } else { + setColumns((List)value); + } + break; + + case TIMESTAMP: + if (value == null) { + unsetTimestamp(); + } else { + setTimestamp((Long)value); + } + break; + + case TIME_RANGE: + if (value == null) { + unsetTimeRange(); + } else { + setTimeRange((TTimeRange)value); + } + break; + + case MAX_VERSIONS: + if (value == null) { + unsetMaxVersions(); + } else { + setMaxVersions((Integer)value); + } + break; + + case FILTER_STRING: + if (value == null) { + unsetFilterString(); + } else { + setFilterString((ByteBuffer)value); + } + break; + + case ATTRIBUTES: + if (value == null) { + unsetAttributes(); + } else { + setAttributes((Map)value); + } + break; + + case AUTHORIZATIONS: + if (value == null) { + unsetAuthorizations(); + } else { + setAuthorizations((TAuthorization)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case ROW: + return getRow(); + + case COLUMNS: + return getColumns(); + + case TIMESTAMP: + return getTimestamp(); + + case TIME_RANGE: + return getTimeRange(); + + case MAX_VERSIONS: + return getMaxVersions(); + + case FILTER_STRING: + return getFilterString(); + + case ATTRIBUTES: + return getAttributes(); + + case AUTHORIZATIONS: + return getAuthorizations(); + + } + 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 ROW: + return isSetRow(); + case COLUMNS: + return isSetColumns(); + case TIMESTAMP: + return isSetTimestamp(); + case TIME_RANGE: + return isSetTimeRange(); + case MAX_VERSIONS: + return isSetMaxVersions(); + case FILTER_STRING: + return isSetFilterString(); + case ATTRIBUTES: + return isSetAttributes(); + case AUTHORIZATIONS: + return isSetAuthorizations(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TGet) + return this.equals((TGet)that); + return false; + } + + public boolean equals(TGet that) { + if (that == null) + return false; + + boolean this_present_row = true && this.isSetRow(); + boolean that_present_row = true && that.isSetRow(); + if (this_present_row || that_present_row) { + if (!(this_present_row && that_present_row)) + return false; + if (!this.row.equals(that.row)) + 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_timestamp = true && this.isSetTimestamp(); + boolean that_present_timestamp = true && that.isSetTimestamp(); + if (this_present_timestamp || that_present_timestamp) { + if (!(this_present_timestamp && that_present_timestamp)) + return false; + if (this.timestamp != that.timestamp) + return false; + } + + boolean this_present_timeRange = true && this.isSetTimeRange(); + boolean that_present_timeRange = true && that.isSetTimeRange(); + if (this_present_timeRange || that_present_timeRange) { + if (!(this_present_timeRange && that_present_timeRange)) + return false; + if (!this.timeRange.equals(that.timeRange)) + return false; + } + + boolean this_present_maxVersions = true && this.isSetMaxVersions(); + boolean that_present_maxVersions = true && that.isSetMaxVersions(); + if (this_present_maxVersions || that_present_maxVersions) { + if (!(this_present_maxVersions && that_present_maxVersions)) + return false; + if (this.maxVersions != that.maxVersions) + return false; + } + + boolean this_present_filterString = true && this.isSetFilterString(); + boolean that_present_filterString = true && that.isSetFilterString(); + if (this_present_filterString || that_present_filterString) { + if (!(this_present_filterString && that_present_filterString)) + return false; + if (!this.filterString.equals(that.filterString)) + 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_authorizations = true && this.isSetAuthorizations(); + boolean that_present_authorizations = true && that.isSetAuthorizations(); + if (this_present_authorizations || that_present_authorizations) { + if (!(this_present_authorizations && that_present_authorizations)) + return false; + if (!this.authorizations.equals(that.authorizations)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_row = true && (isSetRow()); + list.add(present_row); + if (present_row) + list.add(row); + + boolean present_columns = true && (isSetColumns()); + list.add(present_columns); + if (present_columns) + list.add(columns); + + boolean present_timestamp = true && (isSetTimestamp()); + list.add(present_timestamp); + if (present_timestamp) + list.add(timestamp); + + boolean present_timeRange = true && (isSetTimeRange()); + list.add(present_timeRange); + if (present_timeRange) + list.add(timeRange); + + boolean present_maxVersions = true && (isSetMaxVersions()); + list.add(present_maxVersions); + if (present_maxVersions) + list.add(maxVersions); + + boolean present_filterString = true && (isSetFilterString()); + list.add(present_filterString); + if (present_filterString) + list.add(filterString); + + boolean present_attributes = true && (isSetAttributes()); + list.add(present_attributes); + if (present_attributes) + list.add(attributes); + + boolean present_authorizations = true && (isSetAuthorizations()); + list.add(present_authorizations); + if (present_authorizations) + list.add(authorizations); + + return list.hashCode(); + } + + @Override + public int compareTo(TGet other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetRow()).compareTo(other.isSetRow()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRow()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.row, other.row); + 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(isSetTimestamp()).compareTo(other.isSetTimestamp()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTimestamp()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timestamp, other.timestamp); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetTimeRange()).compareTo(other.isSetTimeRange()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTimeRange()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timeRange, other.timeRange); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetMaxVersions()).compareTo(other.isSetMaxVersions()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetMaxVersions()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.maxVersions, other.maxVersions); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetFilterString()).compareTo(other.isSetFilterString()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetFilterString()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.filterString, other.filterString); + 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(isSetAuthorizations()).compareTo(other.isSetAuthorizations()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetAuthorizations()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.authorizations, other.authorizations); + 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("TGet("); + boolean first = true; + + sb.append("row:"); + if (this.row == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.row, sb); + } + 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 (isSetTimestamp()) { + if (!first) sb.append(", "); + sb.append("timestamp:"); + sb.append(this.timestamp); + first = false; + } + if (isSetTimeRange()) { + if (!first) sb.append(", "); + sb.append("timeRange:"); + if (this.timeRange == null) { + sb.append("null"); + } else { + sb.append(this.timeRange); + } + first = false; + } + if (isSetMaxVersions()) { + if (!first) sb.append(", "); + sb.append("maxVersions:"); + sb.append(this.maxVersions); + first = false; + } + if (isSetFilterString()) { + if (!first) sb.append(", "); + sb.append("filterString:"); + if (this.filterString == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.filterString, sb); + } + 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 (isSetAuthorizations()) { + if (!first) sb.append(", "); + sb.append("authorizations:"); + if (this.authorizations == null) { + sb.append("null"); + } else { + sb.append(this.authorizations); + } + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (row == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'row' was not present! Struct: " + toString()); + } + // check for sub-struct validity + if (timeRange != null) { + timeRange.validate(); + } + if (authorizations != null) { + authorizations.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 { + // 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); + } + } + + private static class TGetStandardSchemeFactory implements SchemeFactory { + public TGetStandardScheme getScheme() { + return new TGetStandardScheme(); + } + } + + private static class TGetStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TGet 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: // ROW + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.row = iprot.readBinary(); + struct.setRowIsSet(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 _list16 = iprot.readListBegin(); + struct.columns = new ArrayList(_list16.size); + TColumn _elem17; + for (int _i18 = 0; _i18 < _list16.size; ++_i18) + { + _elem17 = new TColumn(); + _elem17.read(iprot); + struct.columns.add(_elem17); + } + iprot.readListEnd(); + } + struct.setColumnsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // TIMESTAMP + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.timestamp = iprot.readI64(); + struct.setTimestampIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // TIME_RANGE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.timeRange = new TTimeRange(); + struct.timeRange.read(iprot); + struct.setTimeRangeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // MAX_VERSIONS + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.maxVersions = iprot.readI32(); + struct.setMaxVersionsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 6: // FILTER_STRING + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.filterString = iprot.readBinary(); + struct.setFilterStringIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 7: // ATTRIBUTES + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map19 = iprot.readMapBegin(); + struct.attributes = new HashMap(2*_map19.size); + ByteBuffer _key20; + ByteBuffer _val21; + for (int _i22 = 0; _i22 < _map19.size; ++_i22) + { + _key20 = iprot.readBinary(); + _val21 = iprot.readBinary(); + struct.attributes.put(_key20, _val21); + } + iprot.readMapEnd(); + } + struct.setAttributesIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 8: // AUTHORIZATIONS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.authorizations = new TAuthorization(); + struct.authorizations.read(iprot); + struct.setAuthorizationsIsSet(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, TGet struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.row != null) { + oprot.writeFieldBegin(ROW_FIELD_DESC); + oprot.writeBinary(struct.row); + 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 (TColumn _iter23 : struct.columns) + { + _iter23.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + } + if (struct.isSetTimestamp()) { + oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC); + oprot.writeI64(struct.timestamp); + oprot.writeFieldEnd(); + } + if (struct.timeRange != null) { + if (struct.isSetTimeRange()) { + oprot.writeFieldBegin(TIME_RANGE_FIELD_DESC); + struct.timeRange.write(oprot); + oprot.writeFieldEnd(); + } + } + if (struct.isSetMaxVersions()) { + oprot.writeFieldBegin(MAX_VERSIONS_FIELD_DESC); + oprot.writeI32(struct.maxVersions); + oprot.writeFieldEnd(); + } + if (struct.filterString != null) { + if (struct.isSetFilterString()) { + oprot.writeFieldBegin(FILTER_STRING_FIELD_DESC); + oprot.writeBinary(struct.filterString); + 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 _iter24 : struct.attributes.entrySet()) + { + oprot.writeBinary(_iter24.getKey()); + oprot.writeBinary(_iter24.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + } + if (struct.authorizations != null) { + if (struct.isSetAuthorizations()) { + oprot.writeFieldBegin(AUTHORIZATIONS_FIELD_DESC); + struct.authorizations.write(oprot); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TGetTupleSchemeFactory implements SchemeFactory { + public TGetTupleScheme getScheme() { + return new TGetTupleScheme(); + } + } + + private static class TGetTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TGet struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeBinary(struct.row); + BitSet optionals = new BitSet(); + if (struct.isSetColumns()) { + optionals.set(0); + } + if (struct.isSetTimestamp()) { + optionals.set(1); + } + if (struct.isSetTimeRange()) { + optionals.set(2); + } + if (struct.isSetMaxVersions()) { + optionals.set(3); + } + if (struct.isSetFilterString()) { + optionals.set(4); + } + if (struct.isSetAttributes()) { + optionals.set(5); + } + if (struct.isSetAuthorizations()) { + optionals.set(6); + } + oprot.writeBitSet(optionals, 7); + if (struct.isSetColumns()) { + { + oprot.writeI32(struct.columns.size()); + for (TColumn _iter25 : struct.columns) + { + _iter25.write(oprot); + } + } + } + if (struct.isSetTimestamp()) { + oprot.writeI64(struct.timestamp); + } + if (struct.isSetTimeRange()) { + struct.timeRange.write(oprot); + } + if (struct.isSetMaxVersions()) { + oprot.writeI32(struct.maxVersions); + } + if (struct.isSetFilterString()) { + oprot.writeBinary(struct.filterString); + } + if (struct.isSetAttributes()) { + { + oprot.writeI32(struct.attributes.size()); + for (Map.Entry _iter26 : struct.attributes.entrySet()) + { + oprot.writeBinary(_iter26.getKey()); + oprot.writeBinary(_iter26.getValue()); + } + } + } + if (struct.isSetAuthorizations()) { + struct.authorizations.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TGet struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.row = iprot.readBinary(); + struct.setRowIsSet(true); + BitSet incoming = iprot.readBitSet(7); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list27 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.columns = new ArrayList(_list27.size); + TColumn _elem28; + for (int _i29 = 0; _i29 < _list27.size; ++_i29) + { + _elem28 = new TColumn(); + _elem28.read(iprot); + struct.columns.add(_elem28); + } + } + struct.setColumnsIsSet(true); + } + if (incoming.get(1)) { + struct.timestamp = iprot.readI64(); + struct.setTimestampIsSet(true); + } + if (incoming.get(2)) { + struct.timeRange = new TTimeRange(); + struct.timeRange.read(iprot); + struct.setTimeRangeIsSet(true); + } + if (incoming.get(3)) { + struct.maxVersions = iprot.readI32(); + struct.setMaxVersionsIsSet(true); + } + if (incoming.get(4)) { + struct.filterString = iprot.readBinary(); + struct.setFilterStringIsSet(true); + } + if (incoming.get(5)) { + { + org.apache.thrift.protocol.TMap _map30 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.attributes = new HashMap(2*_map30.size); + ByteBuffer _key31; + ByteBuffer _val32; + for (int _i33 = 0; _i33 < _map30.size; ++_i33) + { + _key31 = iprot.readBinary(); + _val32 = iprot.readBinary(); + struct.attributes.put(_key31, _val32); + } + } + struct.setAttributesIsSet(true); + } + if (incoming.get(6)) { + struct.authorizations = new TAuthorization(); + struct.authorizations.read(iprot); + struct.setAuthorizationsIsSet(true); + } + } + } + +} + diff --git "a/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/THBaseService.java" "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/THBaseService.java" new file mode 100644 index 00000000000..c0108063108 --- /dev/null +++ "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/THBaseService.java" @@ -0,0 +1,23215 @@ +/** + * 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 = "2016-05-25") +public class THBaseService { + + public interface Iface { + + /** + * Test for the existence of columns in the table, as specified in the TGet. + * + * @return true if the specified TGet matches one or more keys, false if not + * + * @param table the table to check on + * + * @param tget the TGet to check for + */ + public boolean exists(ByteBuffer table, TGet tget) throws TIOError, org.apache.thrift.TException; + + /** + * Method for getting data from a row. + * + * If the row cannot be found an empty Result is returned. + * This can be checked by the empty field of the TResult + * + * @return the result + * + * @param table the table to get from + * + * @param tget the TGet to fetch + */ + public TResult get(ByteBuffer table, TGet tget) throws TIOError, org.apache.thrift.TException; + + /** + * Method for getting multiple rows. + * + * If a row cannot be found there will be a null + * value in the result list for that TGet at the + * same position. + * + * So the Results are in the same order as the TGets. + * + * @param table the table to get from + * + * @param tgets a list of TGets to fetch, the Result list + * will have the Results at corresponding positions + * or null if there was an error + */ + public List getMultiple(ByteBuffer table, List tgets) throws TIOError, org.apache.thrift.TException; + + /** + * Commit a TPut to a table. + * + * @param table the table to put data in + * + * @param tput the TPut to put + */ + public void put(ByteBuffer table, TPut tput) throws TIOError, org.apache.thrift.TException; + + /** + * Atomically checks if a row/family/qualifier value matches the expected + * value. If it does, it adds the TPut. + * + * @return true if the new put was executed, false otherwise + * + * @param table to check in and put to + * + * @param row row to check + * + * @param family column family to check + * + * @param qualifier column qualifier to check + * + * @param value the expected value, if not provided the + * check is for the non-existence of the + * column in question + * + * @param tput the TPut to put if the check succeeds + */ + public boolean checkAndPut(ByteBuffer table, ByteBuffer row, ByteBuffer family, ByteBuffer qualifier, ByteBuffer value, TPut tput) throws TIOError, org.apache.thrift.TException; + + /** + * Commit a List of Puts to the table. + * + * @param table the table to put data in + * + * @param tputs a list of TPuts to commit + */ + public void putMultiple(ByteBuffer table, List tputs) throws TIOError, org.apache.thrift.TException; + + /** + * Deletes as specified by the TDelete. + * + * Note: "delete" is a reserved keyword and cannot be used in Thrift + * thus the inconsistent naming scheme from the other functions. + * + * @param table the table to delete from + * + * @param tdelete the TDelete to delete + */ + public void deleteSingle(ByteBuffer table, TDelete tdelete) throws TIOError, org.apache.thrift.TException; + + /** + * Bulk commit a List of TDeletes to the table. + * + * Throws a TIOError if any of the deletes fail. + * + * Always returns an empty list for backwards compatibility. + * + * @param table the table to delete from + * + * @param tdeletes list of TDeletes to delete + */ + public List deleteMultiple(ByteBuffer table, List tdeletes) throws TIOError, org.apache.thrift.TException; + + /** + * Atomically checks if a row/family/qualifier value matches the expected + * value. If it does, it adds the delete. + * + * @return true if the new delete was executed, false otherwise + * + * @param table to check in and delete from + * + * @param row row to check + * + * @param family column family to check + * + * @param qualifier column qualifier to check + * + * @param value the expected value, if not provided the + * check is for the non-existence of the + * column in question + * + * @param tdelete the TDelete to execute if the check succeeds + */ + public boolean checkAndDelete(ByteBuffer table, ByteBuffer row, ByteBuffer family, ByteBuffer qualifier, ByteBuffer value, TDelete tdelete) throws TIOError, org.apache.thrift.TException; + + public TResult increment(ByteBuffer table, TIncrement tincrement) throws TIOError, org.apache.thrift.TException; + + public TResult append(ByteBuffer table, TAppend tappend) throws TIOError, org.apache.thrift.TException; + + /** + * Get a Scanner for the provided TScan object. + * + * @return Scanner Id to be used with other scanner procedures + * + * @param table the table to get the Scanner for + * + * @param tscan the scan object to get a Scanner for + */ + public int openScanner(ByteBuffer table, TScan tscan) throws TIOError, org.apache.thrift.TException; + + /** + * Grabs multiple rows from a Scanner. + * + * @return Between zero and numRows TResults + * + * @param scannerId the Id of the Scanner to return rows from. This is an Id returned from the openScanner function. + * + * @param numRows number of rows to return + */ + public List getScannerRows(int scannerId, int numRows) throws TIOError, TIllegalArgument, org.apache.thrift.TException; + + /** + * Closes the scanner. Should be called to free server side resources timely. + * Typically close once the scanner is not needed anymore, i.e. after looping + * over it to get all the required rows. + * + * @param scannerId the Id of the Scanner to close * + */ + public void closeScanner(int scannerId) throws TIOError, TIllegalArgument, org.apache.thrift.TException; + + /** + * mutateRow performs multiple mutations atomically on a single row. + * + * @param table table to apply the mutations + * + * @param trowMutations mutations to apply + */ + public void mutateRow(ByteBuffer table, TRowMutations trowMutations) throws TIOError, org.apache.thrift.TException; + + /** + * Get results for the provided TScan object. + * This helper function opens a scanner, get the results and close the scanner. + * + * @return between zero and numRows TResults + * + * @param table the table to get the Scanner for + * + * @param tscan the scan object to get a Scanner for + * + * @param numRows number of rows to return + */ + public List getScannerResults(ByteBuffer table, TScan tscan, int numRows) throws TIOError, org.apache.thrift.TException; + + /** + * Given a table and a row get the location of the region that + * would contain the given row key. + * + * reload = true means the cache will be cleared and the location + * will be fetched from meta. + * + * @param table + * @param row + * @param reload + */ + public THRegionLocation getRegionLocation(ByteBuffer table, ByteBuffer row, boolean reload) throws TIOError, org.apache.thrift.TException; + + /** + * Get all of the region locations for a given table. + * + * + * @param table + */ + public List getAllRegionLocations(ByteBuffer table) throws TIOError, org.apache.thrift.TException; + + /** + * Atomically checks if a row/family/qualifier value matches the expected + * value. If it does, it mutates the row. + * + * @return true if the row was mutated, false otherwise + * + * @param table to check in and delete from + * + * @param row row to check + * + * @param family column family to check + * + * @param qualifier column qualifier to check + * + * @param compareOp comparison to make on the value + * + * @param value the expected value to be compared against, if not provided the + * check is for the non-existence of the column in question + * + * @param rowMutations row mutations to execute if the value matches + */ + public boolean checkAndMutate(ByteBuffer table, ByteBuffer row, ByteBuffer family, ByteBuffer qualifier, TCompareOp compareOp, ByteBuffer value, TRowMutations rowMutations) throws TIOError, org.apache.thrift.TException; + + } + + public interface AsyncIface { + + public void exists(ByteBuffer table, TGet tget, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void get(ByteBuffer table, TGet tget, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void getMultiple(ByteBuffer table, List tgets, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void put(ByteBuffer table, TPut tput, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void checkAndPut(ByteBuffer table, ByteBuffer row, ByteBuffer family, ByteBuffer qualifier, ByteBuffer value, TPut tput, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void putMultiple(ByteBuffer table, List tputs, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void deleteSingle(ByteBuffer table, TDelete tdelete, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void deleteMultiple(ByteBuffer table, List tdeletes, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void checkAndDelete(ByteBuffer table, ByteBuffer row, ByteBuffer family, ByteBuffer qualifier, ByteBuffer value, TDelete tdelete, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void increment(ByteBuffer table, TIncrement tincrement, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void append(ByteBuffer table, TAppend tappend, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void openScanner(ByteBuffer table, TScan tscan, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void getScannerRows(int scannerId, int numRows, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void closeScanner(int scannerId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void mutateRow(ByteBuffer table, TRowMutations trowMutations, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void getScannerResults(ByteBuffer table, TScan tscan, int numRows, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void getRegionLocation(ByteBuffer table, ByteBuffer row, boolean reload, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void getAllRegionLocations(ByteBuffer table, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void checkAndMutate(ByteBuffer table, ByteBuffer row, ByteBuffer family, ByteBuffer qualifier, TCompareOp compareOp, ByteBuffer value, TRowMutations rowMutations, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + } + + public static class Client extends org.apache.thrift.TServiceClient implements Iface { + public static class Factory implements org.apache.thrift.TServiceClientFactory { + public Factory() {} + public Client getClient(org.apache.thrift.protocol.TProtocol prot) { + return new Client(prot); + } + public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { + return new Client(iprot, oprot); + } + } + + public Client(org.apache.thrift.protocol.TProtocol prot) + { + super(prot, prot); + } + + public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { + super(iprot, oprot); + } + + public boolean exists(ByteBuffer table, TGet tget) throws TIOError, org.apache.thrift.TException + { + send_exists(table, tget); + return recv_exists(); + } + + public void send_exists(ByteBuffer table, TGet tget) throws org.apache.thrift.TException + { + exists_args args = new exists_args(); + args.setTable(table); + args.setTget(tget); + sendBase("exists", args); + } + + public boolean recv_exists() throws TIOError, org.apache.thrift.TException + { + exists_result result = new exists_result(); + receiveBase(result, "exists"); + if (result.isSetSuccess()) { + return result.success; + } + if (result.io != null) { + throw result.io; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "exists failed: unknown result"); + } + + public TResult get(ByteBuffer table, TGet tget) throws TIOError, org.apache.thrift.TException + { + send_get(table, tget); + return recv_get(); + } + + public void send_get(ByteBuffer table, TGet tget) throws org.apache.thrift.TException + { + get_args args = new get_args(); + args.setTable(table); + args.setTget(tget); + sendBase("get", args); + } + + public TResult recv_get() throws TIOError, org.apache.thrift.TException + { + get_result result = new get_result(); + receiveBase(result, "get"); + if (result.isSetSuccess()) { + return result.success; + } + if (result.io != null) { + throw result.io; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "get failed: unknown result"); + } + + public List getMultiple(ByteBuffer table, List tgets) throws TIOError, org.apache.thrift.TException + { + send_getMultiple(table, tgets); + return recv_getMultiple(); + } + + public void send_getMultiple(ByteBuffer table, List tgets) throws org.apache.thrift.TException + { + getMultiple_args args = new getMultiple_args(); + args.setTable(table); + args.setTgets(tgets); + sendBase("getMultiple", args); + } + + public List recv_getMultiple() throws TIOError, org.apache.thrift.TException + { + getMultiple_result result = new getMultiple_result(); + receiveBase(result, "getMultiple"); + if (result.isSetSuccess()) { + return result.success; + } + if (result.io != null) { + throw result.io; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getMultiple failed: unknown result"); + } + + public void put(ByteBuffer table, TPut tput) throws TIOError, org.apache.thrift.TException + { + send_put(table, tput); + recv_put(); + } + + public void send_put(ByteBuffer table, TPut tput) throws org.apache.thrift.TException + { + put_args args = new put_args(); + args.setTable(table); + args.setTput(tput); + sendBase("put", args); + } + + public void recv_put() throws TIOError, org.apache.thrift.TException + { + put_result result = new put_result(); + receiveBase(result, "put"); + if (result.io != null) { + throw result.io; + } + return; + } + + public boolean checkAndPut(ByteBuffer table, ByteBuffer row, ByteBuffer family, ByteBuffer qualifier, ByteBuffer value, TPut tput) throws TIOError, org.apache.thrift.TException + { + send_checkAndPut(table, row, family, qualifier, value, tput); + return recv_checkAndPut(); + } + + public void send_checkAndPut(ByteBuffer table, ByteBuffer row, ByteBuffer family, ByteBuffer qualifier, ByteBuffer value, TPut tput) throws org.apache.thrift.TException + { + checkAndPut_args args = new checkAndPut_args(); + args.setTable(table); + args.setRow(row); + args.setFamily(family); + args.setQualifier(qualifier); + args.setValue(value); + args.setTput(tput); + sendBase("checkAndPut", args); + } + + public boolean recv_checkAndPut() throws TIOError, org.apache.thrift.TException + { + checkAndPut_result result = new checkAndPut_result(); + receiveBase(result, "checkAndPut"); + if (result.isSetSuccess()) { + return result.success; + } + if (result.io != null) { + throw result.io; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "checkAndPut failed: unknown result"); + } + + public void putMultiple(ByteBuffer table, List tputs) throws TIOError, org.apache.thrift.TException + { + send_putMultiple(table, tputs); + recv_putMultiple(); + } + + public void send_putMultiple(ByteBuffer table, List tputs) throws org.apache.thrift.TException + { + putMultiple_args args = new putMultiple_args(); + args.setTable(table); + args.setTputs(tputs); + sendBase("putMultiple", args); + } + + public void recv_putMultiple() throws TIOError, org.apache.thrift.TException + { + putMultiple_result result = new putMultiple_result(); + receiveBase(result, "putMultiple"); + if (result.io != null) { + throw result.io; + } + return; + } + + public void deleteSingle(ByteBuffer table, TDelete tdelete) throws TIOError, org.apache.thrift.TException + { + send_deleteSingle(table, tdelete); + recv_deleteSingle(); + } + + public void send_deleteSingle(ByteBuffer table, TDelete tdelete) throws org.apache.thrift.TException + { + deleteSingle_args args = new deleteSingle_args(); + args.setTable(table); + args.setTdelete(tdelete); + sendBase("deleteSingle", args); + } + + public void recv_deleteSingle() throws TIOError, org.apache.thrift.TException + { + deleteSingle_result result = new deleteSingle_result(); + receiveBase(result, "deleteSingle"); + if (result.io != null) { + throw result.io; + } + return; + } + + public List deleteMultiple(ByteBuffer table, List tdeletes) throws TIOError, org.apache.thrift.TException + { + send_deleteMultiple(table, tdeletes); + return recv_deleteMultiple(); + } + + public void send_deleteMultiple(ByteBuffer table, List tdeletes) throws org.apache.thrift.TException + { + deleteMultiple_args args = new deleteMultiple_args(); + args.setTable(table); + args.setTdeletes(tdeletes); + sendBase("deleteMultiple", args); + } + + public List recv_deleteMultiple() throws TIOError, org.apache.thrift.TException + { + deleteMultiple_result result = new deleteMultiple_result(); + receiveBase(result, "deleteMultiple"); + if (result.isSetSuccess()) { + return result.success; + } + if (result.io != null) { + throw result.io; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "deleteMultiple failed: unknown result"); + } + + public boolean checkAndDelete(ByteBuffer table, ByteBuffer row, ByteBuffer family, ByteBuffer qualifier, ByteBuffer value, TDelete tdelete) throws TIOError, org.apache.thrift.TException + { + send_checkAndDelete(table, row, family, qualifier, value, tdelete); + return recv_checkAndDelete(); + } + + public void send_checkAndDelete(ByteBuffer table, ByteBuffer row, ByteBuffer family, ByteBuffer qualifier, ByteBuffer value, TDelete tdelete) throws org.apache.thrift.TException + { + checkAndDelete_args args = new checkAndDelete_args(); + args.setTable(table); + args.setRow(row); + args.setFamily(family); + args.setQualifier(qualifier); + args.setValue(value); + args.setTdelete(tdelete); + sendBase("checkAndDelete", args); + } + + public boolean recv_checkAndDelete() throws TIOError, org.apache.thrift.TException + { + checkAndDelete_result result = new checkAndDelete_result(); + receiveBase(result, "checkAndDelete"); + if (result.isSetSuccess()) { + return result.success; + } + if (result.io != null) { + throw result.io; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "checkAndDelete failed: unknown result"); + } + + public TResult increment(ByteBuffer table, TIncrement tincrement) throws TIOError, org.apache.thrift.TException + { + send_increment(table, tincrement); + return recv_increment(); + } + + public void send_increment(ByteBuffer table, TIncrement tincrement) throws org.apache.thrift.TException + { + increment_args args = new increment_args(); + args.setTable(table); + args.setTincrement(tincrement); + sendBase("increment", args); + } + + public TResult recv_increment() throws TIOError, org.apache.thrift.TException + { + increment_result result = new increment_result(); + receiveBase(result, "increment"); + if (result.isSetSuccess()) { + return result.success; + } + if (result.io != null) { + throw result.io; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "increment failed: unknown result"); + } + + public TResult append(ByteBuffer table, TAppend tappend) throws TIOError, org.apache.thrift.TException + { + send_append(table, tappend); + return recv_append(); + } + + public void send_append(ByteBuffer table, TAppend tappend) throws org.apache.thrift.TException + { + append_args args = new append_args(); + args.setTable(table); + args.setTappend(tappend); + sendBase("append", args); + } + + public TResult recv_append() throws TIOError, org.apache.thrift.TException + { + append_result result = new append_result(); + receiveBase(result, "append"); + if (result.isSetSuccess()) { + return result.success; + } + if (result.io != null) { + throw result.io; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "append failed: unknown result"); + } + + public int openScanner(ByteBuffer table, TScan tscan) throws TIOError, org.apache.thrift.TException + { + send_openScanner(table, tscan); + return recv_openScanner(); + } + + public void send_openScanner(ByteBuffer table, TScan tscan) throws org.apache.thrift.TException + { + openScanner_args args = new openScanner_args(); + args.setTable(table); + args.setTscan(tscan); + sendBase("openScanner", args); + } + + public int recv_openScanner() throws TIOError, org.apache.thrift.TException + { + openScanner_result result = new openScanner_result(); + receiveBase(result, "openScanner"); + if (result.isSetSuccess()) { + return result.success; + } + if (result.io != null) { + throw result.io; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "openScanner failed: unknown result"); + } + + public List getScannerRows(int scannerId, int numRows) throws TIOError, TIllegalArgument, org.apache.thrift.TException + { + send_getScannerRows(scannerId, numRows); + return recv_getScannerRows(); + } + + public void send_getScannerRows(int scannerId, int numRows) throws org.apache.thrift.TException + { + getScannerRows_args args = new getScannerRows_args(); + args.setScannerId(scannerId); + args.setNumRows(numRows); + sendBase("getScannerRows", args); + } + + public List recv_getScannerRows() throws TIOError, TIllegalArgument, org.apache.thrift.TException + { + getScannerRows_result result = new getScannerRows_result(); + receiveBase(result, "getScannerRows"); + if (result.isSetSuccess()) { + return result.success; + } + if (result.io != null) { + throw result.io; + } + if (result.ia != null) { + throw result.ia; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getScannerRows failed: unknown result"); + } + + public void closeScanner(int scannerId) throws TIOError, TIllegalArgument, org.apache.thrift.TException + { + send_closeScanner(scannerId); + recv_closeScanner(); + } + + public void send_closeScanner(int scannerId) throws org.apache.thrift.TException + { + closeScanner_args args = new closeScanner_args(); + args.setScannerId(scannerId); + sendBase("closeScanner", args); + } + + public void recv_closeScanner() throws TIOError, TIllegalArgument, org.apache.thrift.TException + { + closeScanner_result result = new closeScanner_result(); + receiveBase(result, "closeScanner"); + if (result.io != null) { + throw result.io; + } + if (result.ia != null) { + throw result.ia; + } + return; + } + + public void mutateRow(ByteBuffer table, TRowMutations trowMutations) throws TIOError, org.apache.thrift.TException + { + send_mutateRow(table, trowMutations); + recv_mutateRow(); + } + + public void send_mutateRow(ByteBuffer table, TRowMutations trowMutations) throws org.apache.thrift.TException + { + mutateRow_args args = new mutateRow_args(); + args.setTable(table); + args.setTrowMutations(trowMutations); + sendBase("mutateRow", args); + } + + public void recv_mutateRow() throws TIOError, org.apache.thrift.TException + { + mutateRow_result result = new mutateRow_result(); + receiveBase(result, "mutateRow"); + if (result.io != null) { + throw result.io; + } + return; + } + + public List getScannerResults(ByteBuffer table, TScan tscan, int numRows) throws TIOError, org.apache.thrift.TException + { + send_getScannerResults(table, tscan, numRows); + return recv_getScannerResults(); + } + + public void send_getScannerResults(ByteBuffer table, TScan tscan, int numRows) throws org.apache.thrift.TException + { + getScannerResults_args args = new getScannerResults_args(); + args.setTable(table); + args.setTscan(tscan); + args.setNumRows(numRows); + sendBase("getScannerResults", args); + } + + public List recv_getScannerResults() throws TIOError, org.apache.thrift.TException + { + getScannerResults_result result = new getScannerResults_result(); + receiveBase(result, "getScannerResults"); + if (result.isSetSuccess()) { + return result.success; + } + if (result.io != null) { + throw result.io; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getScannerResults failed: unknown result"); + } + + public THRegionLocation getRegionLocation(ByteBuffer table, ByteBuffer row, boolean reload) throws TIOError, org.apache.thrift.TException + { + send_getRegionLocation(table, row, reload); + return recv_getRegionLocation(); + } + + public void send_getRegionLocation(ByteBuffer table, ByteBuffer row, boolean reload) throws org.apache.thrift.TException + { + getRegionLocation_args args = new getRegionLocation_args(); + args.setTable(table); + args.setRow(row); + args.setReload(reload); + sendBase("getRegionLocation", args); + } + + public THRegionLocation recv_getRegionLocation() throws TIOError, org.apache.thrift.TException + { + getRegionLocation_result result = new getRegionLocation_result(); + receiveBase(result, "getRegionLocation"); + if (result.isSetSuccess()) { + return result.success; + } + if (result.io != null) { + throw result.io; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getRegionLocation failed: unknown result"); + } + + public List getAllRegionLocations(ByteBuffer table) throws TIOError, org.apache.thrift.TException + { + send_getAllRegionLocations(table); + return recv_getAllRegionLocations(); + } + + public void send_getAllRegionLocations(ByteBuffer table) throws org.apache.thrift.TException + { + getAllRegionLocations_args args = new getAllRegionLocations_args(); + args.setTable(table); + sendBase("getAllRegionLocations", args); + } + + public List recv_getAllRegionLocations() throws TIOError, org.apache.thrift.TException + { + getAllRegionLocations_result result = new getAllRegionLocations_result(); + receiveBase(result, "getAllRegionLocations"); + if (result.isSetSuccess()) { + return result.success; + } + if (result.io != null) { + throw result.io; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllRegionLocations failed: unknown result"); + } + + public boolean checkAndMutate(ByteBuffer table, ByteBuffer row, ByteBuffer family, ByteBuffer qualifier, TCompareOp compareOp, ByteBuffer value, TRowMutations rowMutations) throws TIOError, org.apache.thrift.TException + { + send_checkAndMutate(table, row, family, qualifier, compareOp, value, rowMutations); + return recv_checkAndMutate(); + } + + public void send_checkAndMutate(ByteBuffer table, ByteBuffer row, ByteBuffer family, ByteBuffer qualifier, TCompareOp compareOp, ByteBuffer value, TRowMutations rowMutations) throws org.apache.thrift.TException + { + checkAndMutate_args args = new checkAndMutate_args(); + args.setTable(table); + args.setRow(row); + args.setFamily(family); + args.setQualifier(qualifier); + args.setCompareOp(compareOp); + args.setValue(value); + args.setRowMutations(rowMutations); + sendBase("checkAndMutate", args); + } + + public boolean recv_checkAndMutate() throws TIOError, org.apache.thrift.TException + { + checkAndMutate_result result = new checkAndMutate_result(); + receiveBase(result, "checkAndMutate"); + if (result.isSetSuccess()) { + return result.success; + } + if (result.io != null) { + throw result.io; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "checkAndMutate failed: unknown result"); + } + + } + public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface { + public static class Factory implements org.apache.thrift.async.TAsyncClientFactory { + private org.apache.thrift.async.TAsyncClientManager clientManager; + private org.apache.thrift.protocol.TProtocolFactory protocolFactory; + public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) { + this.clientManager = clientManager; + this.protocolFactory = protocolFactory; + } + public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) { + return new AsyncClient(protocolFactory, clientManager, transport); + } + } + + public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) { + super(protocolFactory, clientManager, transport); + } + + public void exists(ByteBuffer table, TGet tget, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + exists_call method_call = new exists_call(table, tget, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class exists_call extends org.apache.thrift.async.TAsyncMethodCall { + private ByteBuffer table; + private TGet tget; + public exists_call(ByteBuffer table, TGet tget, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.table = table; + this.tget = tget; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("exists", org.apache.thrift.protocol.TMessageType.CALL, 0)); + exists_args args = new exists_args(); + args.setTable(table); + args.setTget(tget); + args.write(prot); + prot.writeMessageEnd(); + } + + public boolean getResult() throws TIOError, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_exists(); + } + } + + public void get(ByteBuffer table, TGet tget, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + get_call method_call = new get_call(table, tget, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class get_call extends org.apache.thrift.async.TAsyncMethodCall { + private ByteBuffer table; + private TGet tget; + public get_call(ByteBuffer table, TGet tget, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.table = table; + this.tget = tget; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("get", org.apache.thrift.protocol.TMessageType.CALL, 0)); + get_args args = new get_args(); + args.setTable(table); + args.setTget(tget); + args.write(prot); + prot.writeMessageEnd(); + } + + public TResult getResult() throws TIOError, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_get(); + } + } + + public void getMultiple(ByteBuffer table, List tgets, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + getMultiple_call method_call = new getMultiple_call(table, tgets, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class getMultiple_call extends org.apache.thrift.async.TAsyncMethodCall { + private ByteBuffer table; + private List tgets; + public getMultiple_call(ByteBuffer table, List tgets, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.table = table; + this.tgets = tgets; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getMultiple", org.apache.thrift.protocol.TMessageType.CALL, 0)); + getMultiple_args args = new getMultiple_args(); + args.setTable(table); + args.setTgets(tgets); + args.write(prot); + prot.writeMessageEnd(); + } + + public List getResult() throws TIOError, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_getMultiple(); + } + } + + public void put(ByteBuffer table, TPut tput, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + put_call method_call = new put_call(table, tput, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class put_call extends org.apache.thrift.async.TAsyncMethodCall { + private ByteBuffer table; + private TPut tput; + public put_call(ByteBuffer table, TPut tput, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.table = table; + this.tput = tput; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("put", org.apache.thrift.protocol.TMessageType.CALL, 0)); + put_args args = new put_args(); + args.setTable(table); + args.setTput(tput); + args.write(prot); + prot.writeMessageEnd(); + } + + public void getResult() throws TIOError, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + (new Client(prot)).recv_put(); + } + } + + public void checkAndPut(ByteBuffer table, ByteBuffer row, ByteBuffer family, ByteBuffer qualifier, ByteBuffer value, TPut tput, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + checkAndPut_call method_call = new checkAndPut_call(table, row, family, qualifier, value, tput, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class checkAndPut_call extends org.apache.thrift.async.TAsyncMethodCall { + private ByteBuffer table; + private ByteBuffer row; + private ByteBuffer family; + private ByteBuffer qualifier; + private ByteBuffer value; + private TPut tput; + public checkAndPut_call(ByteBuffer table, ByteBuffer row, ByteBuffer family, ByteBuffer qualifier, ByteBuffer value, TPut tput, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.table = table; + this.row = row; + this.family = family; + this.qualifier = qualifier; + this.value = value; + this.tput = tput; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("checkAndPut", org.apache.thrift.protocol.TMessageType.CALL, 0)); + checkAndPut_args args = new checkAndPut_args(); + args.setTable(table); + args.setRow(row); + args.setFamily(family); + args.setQualifier(qualifier); + args.setValue(value); + args.setTput(tput); + args.write(prot); + prot.writeMessageEnd(); + } + + public boolean getResult() throws TIOError, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_checkAndPut(); + } + } + + public void putMultiple(ByteBuffer table, List tputs, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + putMultiple_call method_call = new putMultiple_call(table, tputs, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class putMultiple_call extends org.apache.thrift.async.TAsyncMethodCall { + private ByteBuffer table; + private List tputs; + public putMultiple_call(ByteBuffer table, List tputs, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.table = table; + this.tputs = tputs; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("putMultiple", org.apache.thrift.protocol.TMessageType.CALL, 0)); + putMultiple_args args = new putMultiple_args(); + args.setTable(table); + args.setTputs(tputs); + args.write(prot); + prot.writeMessageEnd(); + } + + public void getResult() throws TIOError, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + (new Client(prot)).recv_putMultiple(); + } + } + + public void deleteSingle(ByteBuffer table, TDelete tdelete, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + deleteSingle_call method_call = new deleteSingle_call(table, tdelete, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class deleteSingle_call extends org.apache.thrift.async.TAsyncMethodCall { + private ByteBuffer table; + private TDelete tdelete; + public deleteSingle_call(ByteBuffer table, TDelete tdelete, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.table = table; + this.tdelete = tdelete; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("deleteSingle", org.apache.thrift.protocol.TMessageType.CALL, 0)); + deleteSingle_args args = new deleteSingle_args(); + args.setTable(table); + args.setTdelete(tdelete); + args.write(prot); + prot.writeMessageEnd(); + } + + public void getResult() throws TIOError, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + (new Client(prot)).recv_deleteSingle(); + } + } + + public void deleteMultiple(ByteBuffer table, List tdeletes, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + deleteMultiple_call method_call = new deleteMultiple_call(table, tdeletes, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class deleteMultiple_call extends org.apache.thrift.async.TAsyncMethodCall { + private ByteBuffer table; + private List tdeletes; + public deleteMultiple_call(ByteBuffer table, List tdeletes, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.table = table; + this.tdeletes = tdeletes; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("deleteMultiple", org.apache.thrift.protocol.TMessageType.CALL, 0)); + deleteMultiple_args args = new deleteMultiple_args(); + args.setTable(table); + args.setTdeletes(tdeletes); + args.write(prot); + prot.writeMessageEnd(); + } + + public List getResult() throws TIOError, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_deleteMultiple(); + } + } + + public void checkAndDelete(ByteBuffer table, ByteBuffer row, ByteBuffer family, ByteBuffer qualifier, ByteBuffer value, TDelete tdelete, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + checkAndDelete_call method_call = new checkAndDelete_call(table, row, family, qualifier, value, tdelete, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class checkAndDelete_call extends org.apache.thrift.async.TAsyncMethodCall { + private ByteBuffer table; + private ByteBuffer row; + private ByteBuffer family; + private ByteBuffer qualifier; + private ByteBuffer value; + private TDelete tdelete; + public checkAndDelete_call(ByteBuffer table, ByteBuffer row, ByteBuffer family, ByteBuffer qualifier, ByteBuffer value, TDelete tdelete, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.table = table; + this.row = row; + this.family = family; + this.qualifier = qualifier; + this.value = value; + this.tdelete = tdelete; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("checkAndDelete", org.apache.thrift.protocol.TMessageType.CALL, 0)); + checkAndDelete_args args = new checkAndDelete_args(); + args.setTable(table); + args.setRow(row); + args.setFamily(family); + args.setQualifier(qualifier); + args.setValue(value); + args.setTdelete(tdelete); + args.write(prot); + prot.writeMessageEnd(); + } + + public boolean getResult() throws TIOError, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_checkAndDelete(); + } + } + + public void increment(ByteBuffer table, TIncrement tincrement, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + increment_call method_call = new increment_call(table, tincrement, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class increment_call extends org.apache.thrift.async.TAsyncMethodCall { + private ByteBuffer table; + private TIncrement tincrement; + public increment_call(ByteBuffer table, TIncrement tincrement, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.table = table; + this.tincrement = tincrement; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("increment", org.apache.thrift.protocol.TMessageType.CALL, 0)); + increment_args args = new increment_args(); + args.setTable(table); + args.setTincrement(tincrement); + args.write(prot); + prot.writeMessageEnd(); + } + + public TResult getResult() throws TIOError, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_increment(); + } + } + + public void append(ByteBuffer table, TAppend tappend, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + append_call method_call = new append_call(table, tappend, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class append_call extends org.apache.thrift.async.TAsyncMethodCall { + private ByteBuffer table; + private TAppend tappend; + public append_call(ByteBuffer table, TAppend tappend, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.table = table; + this.tappend = tappend; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("append", org.apache.thrift.protocol.TMessageType.CALL, 0)); + append_args args = new append_args(); + args.setTable(table); + args.setTappend(tappend); + args.write(prot); + prot.writeMessageEnd(); + } + + public TResult getResult() throws TIOError, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_append(); + } + } + + public void openScanner(ByteBuffer table, TScan tscan, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + openScanner_call method_call = new openScanner_call(table, tscan, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class openScanner_call extends org.apache.thrift.async.TAsyncMethodCall { + private ByteBuffer table; + private TScan tscan; + public openScanner_call(ByteBuffer table, TScan tscan, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.table = table; + this.tscan = tscan; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("openScanner", org.apache.thrift.protocol.TMessageType.CALL, 0)); + openScanner_args args = new openScanner_args(); + args.setTable(table); + args.setTscan(tscan); + args.write(prot); + prot.writeMessageEnd(); + } + + public int getResult() throws TIOError, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_openScanner(); + } + } + + public void getScannerRows(int scannerId, int numRows, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + getScannerRows_call method_call = new getScannerRows_call(scannerId, numRows, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class getScannerRows_call extends org.apache.thrift.async.TAsyncMethodCall { + private int scannerId; + private int numRows; + public getScannerRows_call(int scannerId, int numRows, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.scannerId = scannerId; + this.numRows = numRows; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getScannerRows", org.apache.thrift.protocol.TMessageType.CALL, 0)); + getScannerRows_args args = new getScannerRows_args(); + args.setScannerId(scannerId); + args.setNumRows(numRows); + args.write(prot); + prot.writeMessageEnd(); + } + + public List getResult() throws TIOError, TIllegalArgument, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_getScannerRows(); + } + } + + public void closeScanner(int scannerId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + closeScanner_call method_call = new closeScanner_call(scannerId, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class closeScanner_call extends org.apache.thrift.async.TAsyncMethodCall { + private int scannerId; + public closeScanner_call(int scannerId, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.scannerId = scannerId; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("closeScanner", org.apache.thrift.protocol.TMessageType.CALL, 0)); + closeScanner_args args = new closeScanner_args(); + args.setScannerId(scannerId); + args.write(prot); + prot.writeMessageEnd(); + } + + public void getResult() throws TIOError, TIllegalArgument, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + (new Client(prot)).recv_closeScanner(); + } + } + + public void mutateRow(ByteBuffer table, TRowMutations trowMutations, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + mutateRow_call method_call = new mutateRow_call(table, trowMutations, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class mutateRow_call extends org.apache.thrift.async.TAsyncMethodCall { + private ByteBuffer table; + private TRowMutations trowMutations; + public mutateRow_call(ByteBuffer table, TRowMutations trowMutations, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.table = table; + this.trowMutations = trowMutations; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("mutateRow", org.apache.thrift.protocol.TMessageType.CALL, 0)); + mutateRow_args args = new mutateRow_args(); + args.setTable(table); + args.setTrowMutations(trowMutations); + args.write(prot); + prot.writeMessageEnd(); + } + + public void getResult() throws TIOError, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + (new Client(prot)).recv_mutateRow(); + } + } + + public void getScannerResults(ByteBuffer table, TScan tscan, int numRows, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + getScannerResults_call method_call = new getScannerResults_call(table, tscan, numRows, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class getScannerResults_call extends org.apache.thrift.async.TAsyncMethodCall { + private ByteBuffer table; + private TScan tscan; + private int numRows; + public getScannerResults_call(ByteBuffer table, TScan tscan, int numRows, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.table = table; + this.tscan = tscan; + this.numRows = numRows; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getScannerResults", org.apache.thrift.protocol.TMessageType.CALL, 0)); + getScannerResults_args args = new getScannerResults_args(); + args.setTable(table); + args.setTscan(tscan); + args.setNumRows(numRows); + args.write(prot); + prot.writeMessageEnd(); + } + + public List getResult() throws TIOError, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_getScannerResults(); + } + } + + public void getRegionLocation(ByteBuffer table, ByteBuffer row, boolean reload, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + getRegionLocation_call method_call = new getRegionLocation_call(table, row, reload, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class getRegionLocation_call extends org.apache.thrift.async.TAsyncMethodCall { + private ByteBuffer table; + private ByteBuffer row; + private boolean reload; + public getRegionLocation_call(ByteBuffer table, ByteBuffer row, boolean reload, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.table = table; + this.row = row; + this.reload = reload; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getRegionLocation", org.apache.thrift.protocol.TMessageType.CALL, 0)); + getRegionLocation_args args = new getRegionLocation_args(); + args.setTable(table); + args.setRow(row); + args.setReload(reload); + args.write(prot); + prot.writeMessageEnd(); + } + + public THRegionLocation getResult() throws TIOError, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_getRegionLocation(); + } + } + + public void getAllRegionLocations(ByteBuffer table, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + getAllRegionLocations_call method_call = new getAllRegionLocations_call(table, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class getAllRegionLocations_call extends org.apache.thrift.async.TAsyncMethodCall { + private ByteBuffer table; + public getAllRegionLocations_call(ByteBuffer table, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.table = table; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getAllRegionLocations", org.apache.thrift.protocol.TMessageType.CALL, 0)); + getAllRegionLocations_args args = new getAllRegionLocations_args(); + args.setTable(table); + args.write(prot); + prot.writeMessageEnd(); + } + + public List getResult() throws TIOError, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_getAllRegionLocations(); + } + } + + public void checkAndMutate(ByteBuffer table, ByteBuffer row, ByteBuffer family, ByteBuffer qualifier, TCompareOp compareOp, ByteBuffer value, TRowMutations rowMutations, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + checkAndMutate_call method_call = new checkAndMutate_call(table, row, family, qualifier, compareOp, value, rowMutations, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class checkAndMutate_call extends org.apache.thrift.async.TAsyncMethodCall { + private ByteBuffer table; + private ByteBuffer row; + private ByteBuffer family; + private ByteBuffer qualifier; + private TCompareOp compareOp; + private ByteBuffer value; + private TRowMutations rowMutations; + public checkAndMutate_call(ByteBuffer table, ByteBuffer row, ByteBuffer family, ByteBuffer qualifier, TCompareOp compareOp, ByteBuffer value, TRowMutations rowMutations, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.table = table; + this.row = row; + this.family = family; + this.qualifier = qualifier; + this.compareOp = compareOp; + this.value = value; + this.rowMutations = rowMutations; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("checkAndMutate", org.apache.thrift.protocol.TMessageType.CALL, 0)); + checkAndMutate_args args = new checkAndMutate_args(); + args.setTable(table); + args.setRow(row); + args.setFamily(family); + args.setQualifier(qualifier); + args.setCompareOp(compareOp); + args.setValue(value); + args.setRowMutations(rowMutations); + args.write(prot); + prot.writeMessageEnd(); + } + + public boolean getResult() throws TIOError, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_checkAndMutate(); + } + } + + } + + public static class Processor extends org.apache.thrift.TBaseProcessor implements org.apache.thrift.TProcessor { + private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName()); + public Processor(I iface) { + super(iface, getProcessMap(new HashMap>())); + } + + protected Processor(I iface, Map> processMap) { + super(iface, getProcessMap(processMap)); + } + + private static Map> getProcessMap(Map> processMap) { + processMap.put("exists", new exists()); + processMap.put("get", new get()); + processMap.put("getMultiple", new getMultiple()); + processMap.put("put", new put()); + processMap.put("checkAndPut", new checkAndPut()); + processMap.put("putMultiple", new putMultiple()); + processMap.put("deleteSingle", new deleteSingle()); + processMap.put("deleteMultiple", new deleteMultiple()); + processMap.put("checkAndDelete", new checkAndDelete()); + processMap.put("increment", new increment()); + processMap.put("append", new append()); + processMap.put("openScanner", new openScanner()); + processMap.put("getScannerRows", new getScannerRows()); + processMap.put("closeScanner", new closeScanner()); + processMap.put("mutateRow", new mutateRow()); + processMap.put("getScannerResults", new getScannerResults()); + processMap.put("getRegionLocation", new getRegionLocation()); + processMap.put("getAllRegionLocations", new getAllRegionLocations()); + processMap.put("checkAndMutate", new checkAndMutate()); + return processMap; + } + + public static class exists extends org.apache.thrift.ProcessFunction { + public exists() { + super("exists"); + } + + public exists_args getEmptyArgsInstance() { + return new exists_args(); + } + + protected boolean isOneway() { + return false; + } + + public exists_result getResult(I iface, exists_args args) throws org.apache.thrift.TException { + exists_result result = new exists_result(); + try { + result.success = iface.exists(args.table, args.tget); + result.setSuccessIsSet(true); + } catch (TIOError io) { + result.io = io; + } + return result; + } + } + + public static class get extends org.apache.thrift.ProcessFunction { + public get() { + super("get"); + } + + public get_args getEmptyArgsInstance() { + return new get_args(); + } + + protected boolean isOneway() { + return false; + } + + public get_result getResult(I iface, get_args args) throws org.apache.thrift.TException { + get_result result = new get_result(); + try { + result.success = iface.get(args.table, args.tget); + } catch (TIOError io) { + result.io = io; + } + return result; + } + } + + public static class getMultiple extends org.apache.thrift.ProcessFunction { + public getMultiple() { + super("getMultiple"); + } + + public getMultiple_args getEmptyArgsInstance() { + return new getMultiple_args(); + } + + protected boolean isOneway() { + return false; + } + + public getMultiple_result getResult(I iface, getMultiple_args args) throws org.apache.thrift.TException { + getMultiple_result result = new getMultiple_result(); + try { + result.success = iface.getMultiple(args.table, args.tgets); + } catch (TIOError io) { + result.io = io; + } + return result; + } + } + + public static class put extends org.apache.thrift.ProcessFunction { + public put() { + super("put"); + } + + public put_args getEmptyArgsInstance() { + return new put_args(); + } + + protected boolean isOneway() { + return false; + } + + public put_result getResult(I iface, put_args args) throws org.apache.thrift.TException { + put_result result = new put_result(); + try { + iface.put(args.table, args.tput); + } catch (TIOError io) { + result.io = io; + } + return result; + } + } + + public static class checkAndPut extends org.apache.thrift.ProcessFunction { + public checkAndPut() { + super("checkAndPut"); + } + + public checkAndPut_args getEmptyArgsInstance() { + return new checkAndPut_args(); + } + + protected boolean isOneway() { + return false; + } + + public checkAndPut_result getResult(I iface, checkAndPut_args args) throws org.apache.thrift.TException { + checkAndPut_result result = new checkAndPut_result(); + try { + result.success = iface.checkAndPut(args.table, args.row, args.family, args.qualifier, args.value, args.tput); + result.setSuccessIsSet(true); + } catch (TIOError io) { + result.io = io; + } + return result; + } + } + + public static class putMultiple extends org.apache.thrift.ProcessFunction { + public putMultiple() { + super("putMultiple"); + } + + public putMultiple_args getEmptyArgsInstance() { + return new putMultiple_args(); + } + + protected boolean isOneway() { + return false; + } + + public putMultiple_result getResult(I iface, putMultiple_args args) throws org.apache.thrift.TException { + putMultiple_result result = new putMultiple_result(); + try { + iface.putMultiple(args.table, args.tputs); + } catch (TIOError io) { + result.io = io; + } + return result; + } + } + + public static class deleteSingle extends org.apache.thrift.ProcessFunction { + public deleteSingle() { + super("deleteSingle"); + } + + public deleteSingle_args getEmptyArgsInstance() { + return new deleteSingle_args(); + } + + protected boolean isOneway() { + return false; + } + + public deleteSingle_result getResult(I iface, deleteSingle_args args) throws org.apache.thrift.TException { + deleteSingle_result result = new deleteSingle_result(); + try { + iface.deleteSingle(args.table, args.tdelete); + } catch (TIOError io) { + result.io = io; + } + return result; + } + } + + public static class deleteMultiple extends org.apache.thrift.ProcessFunction { + public deleteMultiple() { + super("deleteMultiple"); + } + + public deleteMultiple_args getEmptyArgsInstance() { + return new deleteMultiple_args(); + } + + protected boolean isOneway() { + return false; + } + + public deleteMultiple_result getResult(I iface, deleteMultiple_args args) throws org.apache.thrift.TException { + deleteMultiple_result result = new deleteMultiple_result(); + try { + result.success = iface.deleteMultiple(args.table, args.tdeletes); + } catch (TIOError io) { + result.io = io; + } + return result; + } + } + + public static class checkAndDelete extends org.apache.thrift.ProcessFunction { + public checkAndDelete() { + super("checkAndDelete"); + } + + public checkAndDelete_args getEmptyArgsInstance() { + return new checkAndDelete_args(); + } + + protected boolean isOneway() { + return false; + } + + public checkAndDelete_result getResult(I iface, checkAndDelete_args args) throws org.apache.thrift.TException { + checkAndDelete_result result = new checkAndDelete_result(); + try { + result.success = iface.checkAndDelete(args.table, args.row, args.family, args.qualifier, args.value, args.tdelete); + result.setSuccessIsSet(true); + } catch (TIOError io) { + result.io = io; + } + return result; + } + } + + public static class increment extends org.apache.thrift.ProcessFunction { + public increment() { + super("increment"); + } + + public increment_args getEmptyArgsInstance() { + return new increment_args(); + } + + protected boolean isOneway() { + return false; + } + + public increment_result getResult(I iface, increment_args args) throws org.apache.thrift.TException { + increment_result result = new increment_result(); + try { + result.success = iface.increment(args.table, args.tincrement); + } catch (TIOError io) { + result.io = io; + } + return result; + } + } + + public static class append extends org.apache.thrift.ProcessFunction { + public append() { + super("append"); + } + + public append_args getEmptyArgsInstance() { + return new append_args(); + } + + protected boolean isOneway() { + return false; + } + + public append_result getResult(I iface, append_args args) throws org.apache.thrift.TException { + append_result result = new append_result(); + try { + result.success = iface.append(args.table, args.tappend); + } catch (TIOError io) { + result.io = io; + } + return result; + } + } + + public static class openScanner extends org.apache.thrift.ProcessFunction { + public openScanner() { + super("openScanner"); + } + + public openScanner_args getEmptyArgsInstance() { + return new openScanner_args(); + } + + protected boolean isOneway() { + return false; + } + + public openScanner_result getResult(I iface, openScanner_args args) throws org.apache.thrift.TException { + openScanner_result result = new openScanner_result(); + try { + result.success = iface.openScanner(args.table, args.tscan); + result.setSuccessIsSet(true); + } catch (TIOError io) { + result.io = io; + } + return result; + } + } + + public static class getScannerRows extends org.apache.thrift.ProcessFunction { + public getScannerRows() { + super("getScannerRows"); + } + + public getScannerRows_args getEmptyArgsInstance() { + return new getScannerRows_args(); + } + + protected boolean isOneway() { + return false; + } + + public getScannerRows_result getResult(I iface, getScannerRows_args args) throws org.apache.thrift.TException { + getScannerRows_result result = new getScannerRows_result(); + try { + result.success = iface.getScannerRows(args.scannerId, args.numRows); + } catch (TIOError io) { + result.io = io; + } catch (TIllegalArgument ia) { + result.ia = ia; + } + return result; + } + } + + public static class closeScanner extends org.apache.thrift.ProcessFunction { + public closeScanner() { + super("closeScanner"); + } + + public closeScanner_args getEmptyArgsInstance() { + return new closeScanner_args(); + } + + protected boolean isOneway() { + return false; + } + + public closeScanner_result getResult(I iface, closeScanner_args args) throws org.apache.thrift.TException { + closeScanner_result result = new closeScanner_result(); + try { + iface.closeScanner(args.scannerId); + } catch (TIOError io) { + result.io = io; + } catch (TIllegalArgument ia) { + result.ia = ia; + } + return result; + } + } + + public static class mutateRow extends org.apache.thrift.ProcessFunction { + public mutateRow() { + super("mutateRow"); + } + + public mutateRow_args getEmptyArgsInstance() { + return new mutateRow_args(); + } + + protected boolean isOneway() { + return false; + } + + public mutateRow_result getResult(I iface, mutateRow_args args) throws org.apache.thrift.TException { + mutateRow_result result = new mutateRow_result(); + try { + iface.mutateRow(args.table, args.trowMutations); + } catch (TIOError io) { + result.io = io; + } + return result; + } + } + + public static class getScannerResults extends org.apache.thrift.ProcessFunction { + public getScannerResults() { + super("getScannerResults"); + } + + public getScannerResults_args getEmptyArgsInstance() { + return new getScannerResults_args(); + } + + protected boolean isOneway() { + return false; + } + + public getScannerResults_result getResult(I iface, getScannerResults_args args) throws org.apache.thrift.TException { + getScannerResults_result result = new getScannerResults_result(); + try { + result.success = iface.getScannerResults(args.table, args.tscan, args.numRows); + } catch (TIOError io) { + result.io = io; + } + return result; + } + } + + public static class getRegionLocation extends org.apache.thrift.ProcessFunction { + public getRegionLocation() { + super("getRegionLocation"); + } + + public getRegionLocation_args getEmptyArgsInstance() { + return new getRegionLocation_args(); + } + + protected boolean isOneway() { + return false; + } + + public getRegionLocation_result getResult(I iface, getRegionLocation_args args) throws org.apache.thrift.TException { + getRegionLocation_result result = new getRegionLocation_result(); + try { + result.success = iface.getRegionLocation(args.table, args.row, args.reload); + } catch (TIOError io) { + result.io = io; + } + return result; + } + } + + public static class getAllRegionLocations extends org.apache.thrift.ProcessFunction { + public getAllRegionLocations() { + super("getAllRegionLocations"); + } + + public getAllRegionLocations_args getEmptyArgsInstance() { + return new getAllRegionLocations_args(); + } + + protected boolean isOneway() { + return false; + } + + public getAllRegionLocations_result getResult(I iface, getAllRegionLocations_args args) throws org.apache.thrift.TException { + getAllRegionLocations_result result = new getAllRegionLocations_result(); + try { + result.success = iface.getAllRegionLocations(args.table); + } catch (TIOError io) { + result.io = io; + } + return result; + } + } + + public static class checkAndMutate extends org.apache.thrift.ProcessFunction { + public checkAndMutate() { + super("checkAndMutate"); + } + + public checkAndMutate_args getEmptyArgsInstance() { + return new checkAndMutate_args(); + } + + protected boolean isOneway() { + return false; + } + + public checkAndMutate_result getResult(I iface, checkAndMutate_args args) throws org.apache.thrift.TException { + checkAndMutate_result result = new checkAndMutate_result(); + try { + result.success = iface.checkAndMutate(args.table, args.row, args.family, args.qualifier, args.compareOp, args.value, args.rowMutations); + result.setSuccessIsSet(true); + } catch (TIOError io) { + result.io = io; + } + return result; + } + } + + } + + public static class AsyncProcessor extends org.apache.thrift.TBaseAsyncProcessor { + private static final Logger LOGGER = LoggerFactory.getLogger(AsyncProcessor.class.getName()); + public AsyncProcessor(I iface) { + super(iface, getProcessMap(new HashMap>())); + } + + protected AsyncProcessor(I iface, Map> processMap) { + super(iface, getProcessMap(processMap)); + } + + private static Map> getProcessMap(Map> processMap) { + processMap.put("exists", new exists()); + processMap.put("get", new get()); + processMap.put("getMultiple", new getMultiple()); + processMap.put("put", new put()); + processMap.put("checkAndPut", new checkAndPut()); + processMap.put("putMultiple", new putMultiple()); + processMap.put("deleteSingle", new deleteSingle()); + processMap.put("deleteMultiple", new deleteMultiple()); + processMap.put("checkAndDelete", new checkAndDelete()); + processMap.put("increment", new increment()); + processMap.put("append", new append()); + processMap.put("openScanner", new openScanner()); + processMap.put("getScannerRows", new getScannerRows()); + processMap.put("closeScanner", new closeScanner()); + processMap.put("mutateRow", new mutateRow()); + processMap.put("getScannerResults", new getScannerResults()); + processMap.put("getRegionLocation", new getRegionLocation()); + processMap.put("getAllRegionLocations", new getAllRegionLocations()); + processMap.put("checkAndMutate", new checkAndMutate()); + return processMap; + } + + public static class exists extends org.apache.thrift.AsyncProcessFunction { + public exists() { + super("exists"); + } + + public exists_args getEmptyArgsInstance() { + return new exists_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(Boolean o) { + exists_result result = new exists_result(); + result.success = o; + result.setSuccessIsSet(true); + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + exists_result result = new exists_result(); + if (e instanceof TIOError) { + result.io = (TIOError) e; + result.setIoIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, exists_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.exists(args.table, args.tget,resultHandler); + } + } + + public static class get extends org.apache.thrift.AsyncProcessFunction { + public get() { + super("get"); + } + + public get_args getEmptyArgsInstance() { + return new get_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(TResult o) { + get_result result = new get_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + get_result result = new get_result(); + if (e instanceof TIOError) { + result.io = (TIOError) e; + result.setIoIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, get_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.get(args.table, args.tget,resultHandler); + } + } + + public static class getMultiple extends org.apache.thrift.AsyncProcessFunction> { + public getMultiple() { + super("getMultiple"); + } + + public getMultiple_args getEmptyArgsInstance() { + return new getMultiple_args(); + } + + public AsyncMethodCallback> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback>() { + public void onComplete(List o) { + getMultiple_result result = new getMultiple_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + getMultiple_result result = new getMultiple_result(); + if (e instanceof TIOError) { + result.io = (TIOError) e; + result.setIoIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, getMultiple_args args, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws TException { + iface.getMultiple(args.table, args.tgets,resultHandler); + } + } + + public static class put extends org.apache.thrift.AsyncProcessFunction { + public put() { + super("put"); + } + + public put_args getEmptyArgsInstance() { + return new put_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(Void o) { + put_result result = new put_result(); + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + put_result result = new put_result(); + if (e instanceof TIOError) { + result.io = (TIOError) e; + result.setIoIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, put_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.put(args.table, args.tput,resultHandler); + } + } + + public static class checkAndPut extends org.apache.thrift.AsyncProcessFunction { + public checkAndPut() { + super("checkAndPut"); + } + + public checkAndPut_args getEmptyArgsInstance() { + return new checkAndPut_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(Boolean o) { + checkAndPut_result result = new checkAndPut_result(); + result.success = o; + result.setSuccessIsSet(true); + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + checkAndPut_result result = new checkAndPut_result(); + if (e instanceof TIOError) { + result.io = (TIOError) e; + result.setIoIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, checkAndPut_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.checkAndPut(args.table, args.row, args.family, args.qualifier, args.value, args.tput,resultHandler); + } + } + + public static class putMultiple extends org.apache.thrift.AsyncProcessFunction { + public putMultiple() { + super("putMultiple"); + } + + public putMultiple_args getEmptyArgsInstance() { + return new putMultiple_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(Void o) { + putMultiple_result result = new putMultiple_result(); + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + putMultiple_result result = new putMultiple_result(); + if (e instanceof TIOError) { + result.io = (TIOError) e; + result.setIoIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, putMultiple_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.putMultiple(args.table, args.tputs,resultHandler); + } + } + + public static class deleteSingle extends org.apache.thrift.AsyncProcessFunction { + public deleteSingle() { + super("deleteSingle"); + } + + public deleteSingle_args getEmptyArgsInstance() { + return new deleteSingle_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(Void o) { + deleteSingle_result result = new deleteSingle_result(); + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + deleteSingle_result result = new deleteSingle_result(); + if (e instanceof TIOError) { + result.io = (TIOError) e; + result.setIoIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, deleteSingle_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.deleteSingle(args.table, args.tdelete,resultHandler); + } + } + + public static class deleteMultiple extends org.apache.thrift.AsyncProcessFunction> { + public deleteMultiple() { + super("deleteMultiple"); + } + + public deleteMultiple_args getEmptyArgsInstance() { + return new deleteMultiple_args(); + } + + public AsyncMethodCallback> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback>() { + public void onComplete(List o) { + deleteMultiple_result result = new deleteMultiple_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + deleteMultiple_result result = new deleteMultiple_result(); + if (e instanceof TIOError) { + result.io = (TIOError) e; + result.setIoIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, deleteMultiple_args args, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws TException { + iface.deleteMultiple(args.table, args.tdeletes,resultHandler); + } + } + + public static class checkAndDelete extends org.apache.thrift.AsyncProcessFunction { + public checkAndDelete() { + super("checkAndDelete"); + } + + public checkAndDelete_args getEmptyArgsInstance() { + return new checkAndDelete_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(Boolean o) { + checkAndDelete_result result = new checkAndDelete_result(); + result.success = o; + result.setSuccessIsSet(true); + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + checkAndDelete_result result = new checkAndDelete_result(); + if (e instanceof TIOError) { + result.io = (TIOError) e; + result.setIoIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, checkAndDelete_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.checkAndDelete(args.table, args.row, args.family, args.qualifier, args.value, args.tdelete,resultHandler); + } + } + + public static class increment extends org.apache.thrift.AsyncProcessFunction { + public increment() { + super("increment"); + } + + public increment_args getEmptyArgsInstance() { + return new increment_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(TResult o) { + increment_result result = new increment_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + increment_result result = new increment_result(); + if (e instanceof TIOError) { + result.io = (TIOError) e; + result.setIoIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, increment_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.increment(args.table, args.tincrement,resultHandler); + } + } + + public static class append extends org.apache.thrift.AsyncProcessFunction { + public append() { + super("append"); + } + + public append_args getEmptyArgsInstance() { + return new append_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(TResult o) { + append_result result = new append_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + append_result result = new append_result(); + if (e instanceof TIOError) { + result.io = (TIOError) e; + result.setIoIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, append_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.append(args.table, args.tappend,resultHandler); + } + } + + public static class openScanner extends org.apache.thrift.AsyncProcessFunction { + public openScanner() { + super("openScanner"); + } + + public openScanner_args getEmptyArgsInstance() { + return new openScanner_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(Integer o) { + openScanner_result result = new openScanner_result(); + result.success = o; + result.setSuccessIsSet(true); + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + openScanner_result result = new openScanner_result(); + if (e instanceof TIOError) { + result.io = (TIOError) e; + result.setIoIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, openScanner_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.openScanner(args.table, args.tscan,resultHandler); + } + } + + public static class getScannerRows extends org.apache.thrift.AsyncProcessFunction> { + public getScannerRows() { + super("getScannerRows"); + } + + public getScannerRows_args getEmptyArgsInstance() { + return new getScannerRows_args(); + } + + public AsyncMethodCallback> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback>() { + public void onComplete(List o) { + getScannerRows_result result = new getScannerRows_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + getScannerRows_result result = new getScannerRows_result(); + if (e instanceof TIOError) { + result.io = (TIOError) e; + result.setIoIsSet(true); + msg = result; + } + else if (e instanceof TIllegalArgument) { + result.ia = (TIllegalArgument) e; + result.setIaIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, getScannerRows_args args, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws TException { + iface.getScannerRows(args.scannerId, args.numRows,resultHandler); + } + } + + public static class closeScanner extends org.apache.thrift.AsyncProcessFunction { + public closeScanner() { + super("closeScanner"); + } + + public closeScanner_args getEmptyArgsInstance() { + return new closeScanner_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(Void o) { + closeScanner_result result = new closeScanner_result(); + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + closeScanner_result result = new closeScanner_result(); + if (e instanceof TIOError) { + result.io = (TIOError) e; + result.setIoIsSet(true); + msg = result; + } + else if (e instanceof TIllegalArgument) { + result.ia = (TIllegalArgument) e; + result.setIaIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, closeScanner_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.closeScanner(args.scannerId,resultHandler); + } + } + + public static class mutateRow extends org.apache.thrift.AsyncProcessFunction { + public mutateRow() { + super("mutateRow"); + } + + public mutateRow_args getEmptyArgsInstance() { + return new mutateRow_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(Void o) { + mutateRow_result result = new mutateRow_result(); + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + mutateRow_result result = new mutateRow_result(); + if (e instanceof TIOError) { + result.io = (TIOError) e; + result.setIoIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, mutateRow_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.mutateRow(args.table, args.trowMutations,resultHandler); + } + } + + public static class getScannerResults extends org.apache.thrift.AsyncProcessFunction> { + public getScannerResults() { + super("getScannerResults"); + } + + public getScannerResults_args getEmptyArgsInstance() { + return new getScannerResults_args(); + } + + public AsyncMethodCallback> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback>() { + public void onComplete(List o) { + getScannerResults_result result = new getScannerResults_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + getScannerResults_result result = new getScannerResults_result(); + if (e instanceof TIOError) { + result.io = (TIOError) e; + result.setIoIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, getScannerResults_args args, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws TException { + iface.getScannerResults(args.table, args.tscan, args.numRows,resultHandler); + } + } + + public static class getRegionLocation extends org.apache.thrift.AsyncProcessFunction { + public getRegionLocation() { + super("getRegionLocation"); + } + + public getRegionLocation_args getEmptyArgsInstance() { + return new getRegionLocation_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(THRegionLocation o) { + getRegionLocation_result result = new getRegionLocation_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + getRegionLocation_result result = new getRegionLocation_result(); + if (e instanceof TIOError) { + result.io = (TIOError) e; + result.setIoIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, getRegionLocation_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.getRegionLocation(args.table, args.row, args.reload,resultHandler); + } + } + + public static class getAllRegionLocations extends org.apache.thrift.AsyncProcessFunction> { + public getAllRegionLocations() { + super("getAllRegionLocations"); + } + + public getAllRegionLocations_args getEmptyArgsInstance() { + return new getAllRegionLocations_args(); + } + + public AsyncMethodCallback> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback>() { + public void onComplete(List o) { + getAllRegionLocations_result result = new getAllRegionLocations_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + getAllRegionLocations_result result = new getAllRegionLocations_result(); + if (e instanceof TIOError) { + result.io = (TIOError) e; + result.setIoIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, getAllRegionLocations_args args, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws TException { + iface.getAllRegionLocations(args.table,resultHandler); + } + } + + public static class checkAndMutate extends org.apache.thrift.AsyncProcessFunction { + public checkAndMutate() { + super("checkAndMutate"); + } + + public checkAndMutate_args getEmptyArgsInstance() { + return new checkAndMutate_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(Boolean o) { + checkAndMutate_result result = new checkAndMutate_result(); + result.success = o; + result.setSuccessIsSet(true); + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + checkAndMutate_result result = new checkAndMutate_result(); + if (e instanceof TIOError) { + result.io = (TIOError) e; + result.setIoIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, checkAndMutate_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.checkAndMutate(args.table, args.row, args.family, args.qualifier, args.compareOp, args.value, args.rowMutations,resultHandler); + } + } + + } + + public static class exists_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("exists_args"); + + private static final org.apache.thrift.protocol.TField TABLE_FIELD_DESC = new org.apache.thrift.protocol.TField("table", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField TGET_FIELD_DESC = new org.apache.thrift.protocol.TField("tget", org.apache.thrift.protocol.TType.STRUCT, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new exists_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new exists_argsTupleSchemeFactory()); + } + + /** + * the table to check on + */ + public ByteBuffer table; // required + /** + * the TGet to check for + */ + public TGet tget; // 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 { + /** + * the table to check on + */ + TABLE((short)1, "table"), + /** + * the TGet to check for + */ + TGET((short)2, "tget"); + + private static final Map byName = new HashMap(); + + 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 + return TABLE; + case 2: // TGET + return TGET; + 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.TABLE, new org.apache.thrift.meta_data.FieldMetaData("table", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + tmpMap.put(_Fields.TGET, new org.apache.thrift.meta_data.FieldMetaData("tget", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TGet.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(exists_args.class, metaDataMap); + } + + public exists_args() { + } + + public exists_args( + ByteBuffer table, + TGet tget) + { + this(); + this.table = org.apache.thrift.TBaseHelper.copyBinary(table); + this.tget = tget; + } + + /** + * Performs a deep copy on other. + */ + public exists_args(exists_args other) { + if (other.isSetTable()) { + this.table = org.apache.thrift.TBaseHelper.copyBinary(other.table); + } + if (other.isSetTget()) { + this.tget = new TGet(other.tget); + } + } + + public exists_args deepCopy() { + return new exists_args(this); + } + + @Override + public void clear() { + this.table = null; + this.tget = null; + } + + /** + * the table to check on + */ + public byte[] getTable() { + setTable(org.apache.thrift.TBaseHelper.rightSize(table)); + return table == null ? null : table.array(); + } + + public ByteBuffer bufferForTable() { + return org.apache.thrift.TBaseHelper.copyBinary(table); + } + + /** + * the table to check on + */ + public exists_args setTable(byte[] table) { + this.table = table == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(table, table.length)); + return this; + } + + public exists_args setTable(ByteBuffer table) { + this.table = org.apache.thrift.TBaseHelper.copyBinary(table); + return this; + } + + public void unsetTable() { + this.table = null; + } + + /** Returns true if field table is set (has been assigned a value) and false otherwise */ + public boolean isSetTable() { + return this.table != null; + } + + public void setTableIsSet(boolean value) { + if (!value) { + this.table = null; + } + } + + /** + * the TGet to check for + */ + public TGet getTget() { + return this.tget; + } + + /** + * the TGet to check for + */ + public exists_args setTget(TGet tget) { + this.tget = tget; + return this; + } + + public void unsetTget() { + this.tget = null; + } + + /** Returns true if field tget is set (has been assigned a value) and false otherwise */ + public boolean isSetTget() { + return this.tget != null; + } + + public void setTgetIsSet(boolean value) { + if (!value) { + this.tget = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case TABLE: + if (value == null) { + unsetTable(); + } else { + setTable((ByteBuffer)value); + } + break; + + case TGET: + if (value == null) { + unsetTget(); + } else { + setTget((TGet)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case TABLE: + return getTable(); + + case TGET: + return getTget(); + + } + 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: + return isSetTable(); + case TGET: + return isSetTget(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof exists_args) + return this.equals((exists_args)that); + return false; + } + + public boolean equals(exists_args that) { + if (that == null) + return false; + + boolean this_present_table = true && this.isSetTable(); + boolean that_present_table = true && that.isSetTable(); + if (this_present_table || that_present_table) { + if (!(this_present_table && that_present_table)) + return false; + if (!this.table.equals(that.table)) + return false; + } + + boolean this_present_tget = true && this.isSetTget(); + boolean that_present_tget = true && that.isSetTget(); + if (this_present_tget || that_present_tget) { + if (!(this_present_tget && that_present_tget)) + return false; + if (!this.tget.equals(that.tget)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_table = true && (isSetTable()); + list.add(present_table); + if (present_table) + list.add(table); + + boolean present_tget = true && (isSetTget()); + list.add(present_tget); + if (present_tget) + list.add(tget); + + return list.hashCode(); + } + + @Override + public int compareTo(exists_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetTable()).compareTo(other.isSetTable()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTable()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.table, other.table); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetTget()).compareTo(other.isSetTget()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTget()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tget, other.tget); + 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("exists_args("); + boolean first = true; + + sb.append("table:"); + if (this.table == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.table, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("tget:"); + if (this.tget == null) { + sb.append("null"); + } else { + sb.append(this.tget); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (table == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'table' was not present! Struct: " + toString()); + } + if (tget == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'tget' was not present! Struct: " + toString()); + } + // check for sub-struct validity + if (tget != null) { + tget.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 exists_argsStandardSchemeFactory implements SchemeFactory { + public exists_argsStandardScheme getScheme() { + return new exists_argsStandardScheme(); + } + } + + private static class exists_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, exists_args 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 + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.table = iprot.readBinary(); + struct.setTableIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // TGET + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.tget = new TGet(); + struct.tget.read(iprot); + struct.setTgetIsSet(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, exists_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.table != null) { + oprot.writeFieldBegin(TABLE_FIELD_DESC); + oprot.writeBinary(struct.table); + oprot.writeFieldEnd(); + } + if (struct.tget != null) { + oprot.writeFieldBegin(TGET_FIELD_DESC); + struct.tget.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class exists_argsTupleSchemeFactory implements SchemeFactory { + public exists_argsTupleScheme getScheme() { + return new exists_argsTupleScheme(); + } + } + + private static class exists_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, exists_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeBinary(struct.table); + struct.tget.write(oprot); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, exists_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.table = iprot.readBinary(); + struct.setTableIsSet(true); + struct.tget = new TGet(); + struct.tget.read(iprot); + struct.setTgetIsSet(true); + } + } + + } + + public static class exists_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("exists_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0); + private static final org.apache.thrift.protocol.TField IO_FIELD_DESC = new org.apache.thrift.protocol.TField("io", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new exists_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new exists_resultTupleSchemeFactory()); + } + + public boolean success; // required + public TIOError io; // 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 { + SUCCESS((short)0, "success"), + IO((short)1, "io"); + + private static final Map byName = new HashMap(); + + 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 0: // SUCCESS + return SUCCESS; + case 1: // IO + return IO; + 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 int __SUCCESS_ISSET_ID = 0; + private byte __isset_bitfield = 0; + 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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + tmpMap.put(_Fields.IO, new org.apache.thrift.meta_data.FieldMetaData("io", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(exists_result.class, metaDataMap); + } + + public exists_result() { + } + + public exists_result( + boolean success, + TIOError io) + { + this(); + this.success = success; + setSuccessIsSet(true); + this.io = io; + } + + /** + * Performs a deep copy on other. + */ + public exists_result(exists_result other) { + __isset_bitfield = other.__isset_bitfield; + this.success = other.success; + if (other.isSetIo()) { + this.io = new TIOError(other.io); + } + } + + public exists_result deepCopy() { + return new exists_result(this); + } + + @Override + public void clear() { + setSuccessIsSet(false); + this.success = false; + this.io = null; + } + + public boolean isSuccess() { + return this.success; + } + + public exists_result setSuccess(boolean success) { + this.success = success; + setSuccessIsSet(true); + return this; + } + + public void unsetSuccess() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + public void setSuccessIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); + } + + public TIOError getIo() { + return this.io; + } + + public exists_result setIo(TIOError io) { + this.io = io; + return this; + } + + public void unsetIo() { + this.io = null; + } + + /** Returns true if field io is set (has been assigned a value) and false otherwise */ + public boolean isSetIo() { + return this.io != null; + } + + public void setIoIsSet(boolean value) { + if (!value) { + this.io = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((Boolean)value); + } + break; + + case IO: + if (value == null) { + unsetIo(); + } else { + setIo((TIOError)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return isSuccess(); + + case IO: + return getIo(); + + } + 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 SUCCESS: + return isSetSuccess(); + case IO: + return isSetIo(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof exists_result) + return this.equals((exists_result)that); + return false; + } + + public boolean equals(exists_result that) { + if (that == null) + return false; + + boolean this_present_success = true; + boolean that_present_success = true; + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (this.success != that.success) + return false; + } + + boolean this_present_io = true && this.isSetIo(); + boolean that_present_io = true && that.isSetIo(); + if (this_present_io || that_present_io) { + if (!(this_present_io && that_present_io)) + return false; + if (!this.io.equals(that.io)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true; + list.add(present_success); + if (present_success) + list.add(success); + + boolean present_io = true && (isSetIo()); + list.add(present_io); + if (present_io) + list.add(io); + + return list.hashCode(); + } + + @Override + public int compareTo(exists_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIo()).compareTo(other.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, other.io); + 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("exists_result("); + boolean first = true; + + sb.append("success:"); + sb.append(this.success); + first = false; + if (!first) sb.append(", "); + sb.append("io:"); + if (this.io == null) { + sb.append("null"); + } else { + sb.append(this.io); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 { + // 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); + } + } + + private static class exists_resultStandardSchemeFactory implements SchemeFactory { + public exists_resultStandardScheme getScheme() { + return new exists_resultStandardScheme(); + } + } + + private static class exists_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, exists_result 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 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IO + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.io = new TIOError(); + struct.io.read(iprot); + struct.setIoIsSet(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, exists_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeBool(struct.success); + oprot.writeFieldEnd(); + } + if (struct.io != null) { + oprot.writeFieldBegin(IO_FIELD_DESC); + struct.io.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class exists_resultTupleSchemeFactory implements SchemeFactory { + public exists_resultTupleScheme getScheme() { + return new exists_resultTupleScheme(); + } + } + + private static class exists_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, exists_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIo()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + oprot.writeBool(struct.success); + } + if (struct.isSetIo()) { + struct.io.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, exists_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.io = new TIOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } + } + } + + } + + public static class get_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("get_args"); + + private static final org.apache.thrift.protocol.TField TABLE_FIELD_DESC = new org.apache.thrift.protocol.TField("table", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField TGET_FIELD_DESC = new org.apache.thrift.protocol.TField("tget", org.apache.thrift.protocol.TType.STRUCT, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new get_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new get_argsTupleSchemeFactory()); + } + + /** + * the table to get from + */ + public ByteBuffer table; // required + /** + * the TGet to fetch + */ + public TGet tget; // 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 { + /** + * the table to get from + */ + TABLE((short)1, "table"), + /** + * the TGet to fetch + */ + TGET((short)2, "tget"); + + private static final Map byName = new HashMap(); + + 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 + return TABLE; + case 2: // TGET + return TGET; + 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.TABLE, new org.apache.thrift.meta_data.FieldMetaData("table", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + tmpMap.put(_Fields.TGET, new org.apache.thrift.meta_data.FieldMetaData("tget", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TGet.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(get_args.class, metaDataMap); + } + + public get_args() { + } + + public get_args( + ByteBuffer table, + TGet tget) + { + this(); + this.table = org.apache.thrift.TBaseHelper.copyBinary(table); + this.tget = tget; + } + + /** + * Performs a deep copy on other. + */ + public get_args(get_args other) { + if (other.isSetTable()) { + this.table = org.apache.thrift.TBaseHelper.copyBinary(other.table); + } + if (other.isSetTget()) { + this.tget = new TGet(other.tget); + } + } + + public get_args deepCopy() { + return new get_args(this); + } + + @Override + public void clear() { + this.table = null; + this.tget = null; + } + + /** + * the table to get from + */ + public byte[] getTable() { + setTable(org.apache.thrift.TBaseHelper.rightSize(table)); + return table == null ? null : table.array(); + } + + public ByteBuffer bufferForTable() { + return org.apache.thrift.TBaseHelper.copyBinary(table); + } + + /** + * the table to get from + */ + public get_args setTable(byte[] table) { + this.table = table == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(table, table.length)); + return this; + } + + public get_args setTable(ByteBuffer table) { + this.table = org.apache.thrift.TBaseHelper.copyBinary(table); + return this; + } + + public void unsetTable() { + this.table = null; + } + + /** Returns true if field table is set (has been assigned a value) and false otherwise */ + public boolean isSetTable() { + return this.table != null; + } + + public void setTableIsSet(boolean value) { + if (!value) { + this.table = null; + } + } + + /** + * the TGet to fetch + */ + public TGet getTget() { + return this.tget; + } + + /** + * the TGet to fetch + */ + public get_args setTget(TGet tget) { + this.tget = tget; + return this; + } + + public void unsetTget() { + this.tget = null; + } + + /** Returns true if field tget is set (has been assigned a value) and false otherwise */ + public boolean isSetTget() { + return this.tget != null; + } + + public void setTgetIsSet(boolean value) { + if (!value) { + this.tget = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case TABLE: + if (value == null) { + unsetTable(); + } else { + setTable((ByteBuffer)value); + } + break; + + case TGET: + if (value == null) { + unsetTget(); + } else { + setTget((TGet)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case TABLE: + return getTable(); + + case TGET: + return getTget(); + + } + 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: + return isSetTable(); + case TGET: + return isSetTget(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof get_args) + return this.equals((get_args)that); + return false; + } + + public boolean equals(get_args that) { + if (that == null) + return false; + + boolean this_present_table = true && this.isSetTable(); + boolean that_present_table = true && that.isSetTable(); + if (this_present_table || that_present_table) { + if (!(this_present_table && that_present_table)) + return false; + if (!this.table.equals(that.table)) + return false; + } + + boolean this_present_tget = true && this.isSetTget(); + boolean that_present_tget = true && that.isSetTget(); + if (this_present_tget || that_present_tget) { + if (!(this_present_tget && that_present_tget)) + return false; + if (!this.tget.equals(that.tget)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_table = true && (isSetTable()); + list.add(present_table); + if (present_table) + list.add(table); + + boolean present_tget = true && (isSetTget()); + list.add(present_tget); + if (present_tget) + list.add(tget); + + return list.hashCode(); + } + + @Override + public int compareTo(get_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetTable()).compareTo(other.isSetTable()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTable()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.table, other.table); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetTget()).compareTo(other.isSetTget()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTget()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tget, other.tget); + 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("get_args("); + boolean first = true; + + sb.append("table:"); + if (this.table == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.table, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("tget:"); + if (this.tget == null) { + sb.append("null"); + } else { + sb.append(this.tget); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (table == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'table' was not present! Struct: " + toString()); + } + if (tget == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'tget' was not present! Struct: " + toString()); + } + // check for sub-struct validity + if (tget != null) { + tget.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 get_argsStandardSchemeFactory implements SchemeFactory { + public get_argsStandardScheme getScheme() { + return new get_argsStandardScheme(); + } + } + + private static class get_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, get_args 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 + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.table = iprot.readBinary(); + struct.setTableIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // TGET + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.tget = new TGet(); + struct.tget.read(iprot); + struct.setTgetIsSet(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, get_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.table != null) { + oprot.writeFieldBegin(TABLE_FIELD_DESC); + oprot.writeBinary(struct.table); + oprot.writeFieldEnd(); + } + if (struct.tget != null) { + oprot.writeFieldBegin(TGET_FIELD_DESC); + struct.tget.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class get_argsTupleSchemeFactory implements SchemeFactory { + public get_argsTupleScheme getScheme() { + return new get_argsTupleScheme(); + } + } + + private static class get_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, get_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeBinary(struct.table); + struct.tget.write(oprot); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, get_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.table = iprot.readBinary(); + struct.setTableIsSet(true); + struct.tget = new TGet(); + struct.tget.read(iprot); + struct.setTgetIsSet(true); + } + } + + } + + public static class get_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("get_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); + private static final org.apache.thrift.protocol.TField IO_FIELD_DESC = new org.apache.thrift.protocol.TField("io", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new get_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new get_resultTupleSchemeFactory()); + } + + public TResult success; // required + public TIOError io; // 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 { + SUCCESS((short)0, "success"), + IO((short)1, "io"); + + private static final Map byName = new HashMap(); + + 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 0: // SUCCESS + return SUCCESS; + case 1: // IO + return IO; + 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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TResult.class))); + tmpMap.put(_Fields.IO, new org.apache.thrift.meta_data.FieldMetaData("io", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(get_result.class, metaDataMap); + } + + public get_result() { + } + + public get_result( + TResult success, + TIOError io) + { + this(); + this.success = success; + this.io = io; + } + + /** + * Performs a deep copy on other. + */ + public get_result(get_result other) { + if (other.isSetSuccess()) { + this.success = new TResult(other.success); + } + if (other.isSetIo()) { + this.io = new TIOError(other.io); + } + } + + public get_result deepCopy() { + return new get_result(this); + } + + @Override + public void clear() { + this.success = null; + this.io = null; + } + + public TResult getSuccess() { + return this.success; + } + + public get_result setSuccess(TResult success) { + this.success = success; + return this; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public TIOError getIo() { + return this.io; + } + + public get_result setIo(TIOError io) { + this.io = io; + return this; + } + + public void unsetIo() { + this.io = null; + } + + /** Returns true if field io is set (has been assigned a value) and false otherwise */ + public boolean isSetIo() { + return this.io != null; + } + + public void setIoIsSet(boolean value) { + if (!value) { + this.io = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((TResult)value); + } + break; + + case IO: + if (value == null) { + unsetIo(); + } else { + setIo((TIOError)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + case IO: + return getIo(); + + } + 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 SUCCESS: + return isSetSuccess(); + case IO: + return isSetIo(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof get_result) + return this.equals((get_result)that); + return false; + } + + public boolean equals(get_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + boolean this_present_io = true && this.isSetIo(); + boolean that_present_io = true && that.isSetIo(); + if (this_present_io || that_present_io) { + if (!(this_present_io && that_present_io)) + return false; + if (!this.io.equals(that.io)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + boolean present_io = true && (isSetIo()); + list.add(present_io); + if (present_io) + list.add(io); + + return list.hashCode(); + } + + @Override + public int compareTo(get_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIo()).compareTo(other.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, other.io); + 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("get_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + if (!first) sb.append(", "); + sb.append("io:"); + if (this.io == null) { + sb.append("null"); + } else { + sb.append(this.io); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + if (success != null) { + success.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 get_resultStandardSchemeFactory implements SchemeFactory { + public get_resultStandardScheme getScheme() { + return new get_resultStandardScheme(); + } + } + + private static class get_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, get_result 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 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.success = new TResult(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IO + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.io = new TIOError(); + struct.io.read(iprot); + struct.setIoIsSet(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, get_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + struct.success.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.io != null) { + oprot.writeFieldBegin(IO_FIELD_DESC); + struct.io.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class get_resultTupleSchemeFactory implements SchemeFactory { + public get_resultTupleScheme getScheme() { + return new get_resultTupleScheme(); + } + } + + private static class get_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, get_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIo()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + struct.success.write(oprot); + } + if (struct.isSetIo()) { + struct.io.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, get_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.success = new TResult(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.io = new TIOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } + } + } + + } + + public static class getMultiple_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getMultiple_args"); + + private static final org.apache.thrift.protocol.TField TABLE_FIELD_DESC = new org.apache.thrift.protocol.TField("table", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField TGETS_FIELD_DESC = new org.apache.thrift.protocol.TField("tgets", org.apache.thrift.protocol.TType.LIST, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getMultiple_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getMultiple_argsTupleSchemeFactory()); + } + + /** + * the table to get from + */ + public ByteBuffer table; // required + /** + * a list of TGets to fetch, the Result list + * will have the Results at corresponding positions + * or null if there was an error + */ + public List tgets; // 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 { + /** + * the table to get from + */ + TABLE((short)1, "table"), + /** + * a list of TGets to fetch, the Result list + * will have the Results at corresponding positions + * or null if there was an error + */ + TGETS((short)2, "tgets"); + + private static final Map byName = new HashMap(); + + 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 + return TABLE; + case 2: // TGETS + return TGETS; + 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.TABLE, new org.apache.thrift.meta_data.FieldMetaData("table", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + tmpMap.put(_Fields.TGETS, new org.apache.thrift.meta_data.FieldMetaData("tgets", org.apache.thrift.TFieldRequirementType.REQUIRED, + 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, TGet.class)))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getMultiple_args.class, metaDataMap); + } + + public getMultiple_args() { + } + + public getMultiple_args( + ByteBuffer table, + List tgets) + { + this(); + this.table = org.apache.thrift.TBaseHelper.copyBinary(table); + this.tgets = tgets; + } + + /** + * Performs a deep copy on other. + */ + public getMultiple_args(getMultiple_args other) { + if (other.isSetTable()) { + this.table = org.apache.thrift.TBaseHelper.copyBinary(other.table); + } + if (other.isSetTgets()) { + List __this__tgets = new ArrayList(other.tgets.size()); + for (TGet other_element : other.tgets) { + __this__tgets.add(new TGet(other_element)); + } + this.tgets = __this__tgets; + } + } + + public getMultiple_args deepCopy() { + return new getMultiple_args(this); + } + + @Override + public void clear() { + this.table = null; + this.tgets = null; + } + + /** + * the table to get from + */ + public byte[] getTable() { + setTable(org.apache.thrift.TBaseHelper.rightSize(table)); + return table == null ? null : table.array(); + } + + public ByteBuffer bufferForTable() { + return org.apache.thrift.TBaseHelper.copyBinary(table); + } + + /** + * the table to get from + */ + public getMultiple_args setTable(byte[] table) { + this.table = table == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(table, table.length)); + return this; + } + + public getMultiple_args setTable(ByteBuffer table) { + this.table = org.apache.thrift.TBaseHelper.copyBinary(table); + return this; + } + + public void unsetTable() { + this.table = null; + } + + /** Returns true if field table is set (has been assigned a value) and false otherwise */ + public boolean isSetTable() { + return this.table != null; + } + + public void setTableIsSet(boolean value) { + if (!value) { + this.table = null; + } + } + + public int getTgetsSize() { + return (this.tgets == null) ? 0 : this.tgets.size(); + } + + public java.util.Iterator getTgetsIterator() { + return (this.tgets == null) ? null : this.tgets.iterator(); + } + + public void addToTgets(TGet elem) { + if (this.tgets == null) { + this.tgets = new ArrayList(); + } + this.tgets.add(elem); + } + + /** + * a list of TGets to fetch, the Result list + * will have the Results at corresponding positions + * or null if there was an error + */ + public List getTgets() { + return this.tgets; + } + + /** + * a list of TGets to fetch, the Result list + * will have the Results at corresponding positions + * or null if there was an error + */ + public getMultiple_args setTgets(List tgets) { + this.tgets = tgets; + return this; + } + + public void unsetTgets() { + this.tgets = null; + } + + /** Returns true if field tgets is set (has been assigned a value) and false otherwise */ + public boolean isSetTgets() { + return this.tgets != null; + } + + public void setTgetsIsSet(boolean value) { + if (!value) { + this.tgets = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case TABLE: + if (value == null) { + unsetTable(); + } else { + setTable((ByteBuffer)value); + } + break; + + case TGETS: + if (value == null) { + unsetTgets(); + } else { + setTgets((List)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case TABLE: + return getTable(); + + case TGETS: + return getTgets(); + + } + 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: + return isSetTable(); + case TGETS: + return isSetTgets(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getMultiple_args) + return this.equals((getMultiple_args)that); + return false; + } + + public boolean equals(getMultiple_args that) { + if (that == null) + return false; + + boolean this_present_table = true && this.isSetTable(); + boolean that_present_table = true && that.isSetTable(); + if (this_present_table || that_present_table) { + if (!(this_present_table && that_present_table)) + return false; + if (!this.table.equals(that.table)) + return false; + } + + boolean this_present_tgets = true && this.isSetTgets(); + boolean that_present_tgets = true && that.isSetTgets(); + if (this_present_tgets || that_present_tgets) { + if (!(this_present_tgets && that_present_tgets)) + return false; + if (!this.tgets.equals(that.tgets)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_table = true && (isSetTable()); + list.add(present_table); + if (present_table) + list.add(table); + + boolean present_tgets = true && (isSetTgets()); + list.add(present_tgets); + if (present_tgets) + list.add(tgets); + + return list.hashCode(); + } + + @Override + public int compareTo(getMultiple_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetTable()).compareTo(other.isSetTable()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTable()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.table, other.table); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetTgets()).compareTo(other.isSetTgets()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTgets()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tgets, other.tgets); + 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("getMultiple_args("); + boolean first = true; + + sb.append("table:"); + if (this.table == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.table, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("tgets:"); + if (this.tgets == null) { + sb.append("null"); + } else { + sb.append(this.tgets); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (table == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'table' was not present! Struct: " + toString()); + } + if (tgets == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'tgets' 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 getMultiple_argsStandardSchemeFactory implements SchemeFactory { + public getMultiple_argsStandardScheme getScheme() { + return new getMultiple_argsStandardScheme(); + } + } + + private static class getMultiple_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getMultiple_args 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 + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.table = iprot.readBinary(); + struct.setTableIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // TGETS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list132 = iprot.readListBegin(); + struct.tgets = new ArrayList(_list132.size); + TGet _elem133; + for (int _i134 = 0; _i134 < _list132.size; ++_i134) + { + _elem133 = new TGet(); + _elem133.read(iprot); + struct.tgets.add(_elem133); + } + iprot.readListEnd(); + } + struct.setTgetsIsSet(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, getMultiple_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.table != null) { + oprot.writeFieldBegin(TABLE_FIELD_DESC); + oprot.writeBinary(struct.table); + oprot.writeFieldEnd(); + } + if (struct.tgets != null) { + oprot.writeFieldBegin(TGETS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.tgets.size())); + for (TGet _iter135 : struct.tgets) + { + _iter135.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getMultiple_argsTupleSchemeFactory implements SchemeFactory { + public getMultiple_argsTupleScheme getScheme() { + return new getMultiple_argsTupleScheme(); + } + } + + private static class getMultiple_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getMultiple_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeBinary(struct.table); + { + oprot.writeI32(struct.tgets.size()); + for (TGet _iter136 : struct.tgets) + { + _iter136.write(oprot); + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getMultiple_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.table = iprot.readBinary(); + struct.setTableIsSet(true); + { + org.apache.thrift.protocol.TList _list137 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.tgets = new ArrayList(_list137.size); + TGet _elem138; + for (int _i139 = 0; _i139 < _list137.size; ++_i139) + { + _elem138 = new TGet(); + _elem138.read(iprot); + struct.tgets.add(_elem138); + } + } + struct.setTgetsIsSet(true); + } + } + + } + + public static class getMultiple_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getMultiple_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0); + private static final org.apache.thrift.protocol.TField IO_FIELD_DESC = new org.apache.thrift.protocol.TField("io", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getMultiple_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getMultiple_resultTupleSchemeFactory()); + } + + public List success; // required + public TIOError io; // 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 { + SUCCESS((short)0, "success"), + IO((short)1, "io"); + + private static final Map byName = new HashMap(); + + 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 0: // SUCCESS + return SUCCESS; + case 1: // IO + return IO; + 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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + 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, TResult.class)))); + tmpMap.put(_Fields.IO, new org.apache.thrift.meta_data.FieldMetaData("io", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getMultiple_result.class, metaDataMap); + } + + public getMultiple_result() { + } + + public getMultiple_result( + List success, + TIOError io) + { + this(); + this.success = success; + this.io = io; + } + + /** + * Performs a deep copy on other. + */ + public getMultiple_result(getMultiple_result other) { + if (other.isSetSuccess()) { + List __this__success = new ArrayList(other.success.size()); + for (TResult other_element : other.success) { + __this__success.add(new TResult(other_element)); + } + this.success = __this__success; + } + if (other.isSetIo()) { + this.io = new TIOError(other.io); + } + } + + public getMultiple_result deepCopy() { + return new getMultiple_result(this); + } + + @Override + public void clear() { + this.success = null; + this.io = null; + } + + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + public java.util.Iterator getSuccessIterator() { + return (this.success == null) ? null : this.success.iterator(); + } + + public void addToSuccess(TResult elem) { + if (this.success == null) { + this.success = new ArrayList(); + } + this.success.add(elem); + } + + public List getSuccess() { + return this.success; + } + + public getMultiple_result setSuccess(List success) { + this.success = success; + return this; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public TIOError getIo() { + return this.io; + } + + public getMultiple_result setIo(TIOError io) { + this.io = io; + return this; + } + + public void unsetIo() { + this.io = null; + } + + /** Returns true if field io is set (has been assigned a value) and false otherwise */ + public boolean isSetIo() { + return this.io != null; + } + + public void setIoIsSet(boolean value) { + if (!value) { + this.io = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((List)value); + } + break; + + case IO: + if (value == null) { + unsetIo(); + } else { + setIo((TIOError)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + case IO: + return getIo(); + + } + 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 SUCCESS: + return isSetSuccess(); + case IO: + return isSetIo(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getMultiple_result) + return this.equals((getMultiple_result)that); + return false; + } + + public boolean equals(getMultiple_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + boolean this_present_io = true && this.isSetIo(); + boolean that_present_io = true && that.isSetIo(); + if (this_present_io || that_present_io) { + if (!(this_present_io && that_present_io)) + return false; + if (!this.io.equals(that.io)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + boolean present_io = true && (isSetIo()); + list.add(present_io); + if (present_io) + list.add(io); + + return list.hashCode(); + } + + @Override + public int compareTo(getMultiple_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIo()).compareTo(other.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, other.io); + 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("getMultiple_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + if (!first) sb.append(", "); + sb.append("io:"); + if (this.io == null) { + sb.append("null"); + } else { + sb.append(this.io); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 getMultiple_resultStandardSchemeFactory implements SchemeFactory { + public getMultiple_resultStandardScheme getScheme() { + return new getMultiple_resultStandardScheme(); + } + } + + private static class getMultiple_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getMultiple_result 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 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list140 = iprot.readListBegin(); + struct.success = new ArrayList(_list140.size); + TResult _elem141; + for (int _i142 = 0; _i142 < _list140.size; ++_i142) + { + _elem141 = new TResult(); + _elem141.read(iprot); + struct.success.add(_elem141); + } + iprot.readListEnd(); + } + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IO + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.io = new TIOError(); + struct.io.read(iprot); + struct.setIoIsSet(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, getMultiple_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); + for (TResult _iter143 : struct.success) + { + _iter143.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.io != null) { + oprot.writeFieldBegin(IO_FIELD_DESC); + struct.io.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getMultiple_resultTupleSchemeFactory implements SchemeFactory { + public getMultiple_resultTupleScheme getScheme() { + return new getMultiple_resultTupleScheme(); + } + } + + private static class getMultiple_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getMultiple_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIo()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + { + oprot.writeI32(struct.success.size()); + for (TResult _iter144 : struct.success) + { + _iter144.write(oprot); + } + } + } + if (struct.isSetIo()) { + struct.io.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getMultiple_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list145 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new ArrayList(_list145.size); + TResult _elem146; + for (int _i147 = 0; _i147 < _list145.size; ++_i147) + { + _elem146 = new TResult(); + _elem146.read(iprot); + struct.success.add(_elem146); + } + } + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.io = new TIOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } + } + } + + } + + public static class put_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("put_args"); + + private static final org.apache.thrift.protocol.TField TABLE_FIELD_DESC = new org.apache.thrift.protocol.TField("table", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField TPUT_FIELD_DESC = new org.apache.thrift.protocol.TField("tput", org.apache.thrift.protocol.TType.STRUCT, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new put_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new put_argsTupleSchemeFactory()); + } + + /** + * the table to put data in + */ + public ByteBuffer table; // required + /** + * the TPut to put + */ + public TPut tput; // 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 { + /** + * the table to put data in + */ + TABLE((short)1, "table"), + /** + * the TPut to put + */ + TPUT((short)2, "tput"); + + private static final Map byName = new HashMap(); + + 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 + return TABLE; + case 2: // TPUT + return TPUT; + 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.TABLE, new org.apache.thrift.meta_data.FieldMetaData("table", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + tmpMap.put(_Fields.TPUT, new org.apache.thrift.meta_data.FieldMetaData("tput", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TPut.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(put_args.class, metaDataMap); + } + + public put_args() { + } + + public put_args( + ByteBuffer table, + TPut tput) + { + this(); + this.table = org.apache.thrift.TBaseHelper.copyBinary(table); + this.tput = tput; + } + + /** + * Performs a deep copy on other. + */ + public put_args(put_args other) { + if (other.isSetTable()) { + this.table = org.apache.thrift.TBaseHelper.copyBinary(other.table); + } + if (other.isSetTput()) { + this.tput = new TPut(other.tput); + } + } + + public put_args deepCopy() { + return new put_args(this); + } + + @Override + public void clear() { + this.table = null; + this.tput = null; + } + + /** + * the table to put data in + */ + public byte[] getTable() { + setTable(org.apache.thrift.TBaseHelper.rightSize(table)); + return table == null ? null : table.array(); + } + + public ByteBuffer bufferForTable() { + return org.apache.thrift.TBaseHelper.copyBinary(table); + } + + /** + * the table to put data in + */ + public put_args setTable(byte[] table) { + this.table = table == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(table, table.length)); + return this; + } + + public put_args setTable(ByteBuffer table) { + this.table = org.apache.thrift.TBaseHelper.copyBinary(table); + return this; + } + + public void unsetTable() { + this.table = null; + } + + /** Returns true if field table is set (has been assigned a value) and false otherwise */ + public boolean isSetTable() { + return this.table != null; + } + + public void setTableIsSet(boolean value) { + if (!value) { + this.table = null; + } + } + + /** + * the TPut to put + */ + public TPut getTput() { + return this.tput; + } + + /** + * the TPut to put + */ + public put_args setTput(TPut tput) { + this.tput = tput; + return this; + } + + public void unsetTput() { + this.tput = null; + } + + /** Returns true if field tput is set (has been assigned a value) and false otherwise */ + public boolean isSetTput() { + return this.tput != null; + } + + public void setTputIsSet(boolean value) { + if (!value) { + this.tput = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case TABLE: + if (value == null) { + unsetTable(); + } else { + setTable((ByteBuffer)value); + } + break; + + case TPUT: + if (value == null) { + unsetTput(); + } else { + setTput((TPut)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case TABLE: + return getTable(); + + case TPUT: + return getTput(); + + } + 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: + return isSetTable(); + case TPUT: + return isSetTput(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof put_args) + return this.equals((put_args)that); + return false; + } + + public boolean equals(put_args that) { + if (that == null) + return false; + + boolean this_present_table = true && this.isSetTable(); + boolean that_present_table = true && that.isSetTable(); + if (this_present_table || that_present_table) { + if (!(this_present_table && that_present_table)) + return false; + if (!this.table.equals(that.table)) + return false; + } + + boolean this_present_tput = true && this.isSetTput(); + boolean that_present_tput = true && that.isSetTput(); + if (this_present_tput || that_present_tput) { + if (!(this_present_tput && that_present_tput)) + return false; + if (!this.tput.equals(that.tput)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_table = true && (isSetTable()); + list.add(present_table); + if (present_table) + list.add(table); + + boolean present_tput = true && (isSetTput()); + list.add(present_tput); + if (present_tput) + list.add(tput); + + return list.hashCode(); + } + + @Override + public int compareTo(put_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetTable()).compareTo(other.isSetTable()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTable()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.table, other.table); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetTput()).compareTo(other.isSetTput()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTput()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tput, other.tput); + 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("put_args("); + boolean first = true; + + sb.append("table:"); + if (this.table == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.table, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("tput:"); + if (this.tput == null) { + sb.append("null"); + } else { + sb.append(this.tput); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (table == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'table' was not present! Struct: " + toString()); + } + if (tput == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'tput' was not present! Struct: " + toString()); + } + // check for sub-struct validity + if (tput != null) { + tput.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 put_argsStandardSchemeFactory implements SchemeFactory { + public put_argsStandardScheme getScheme() { + return new put_argsStandardScheme(); + } + } + + private static class put_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, put_args 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 + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.table = iprot.readBinary(); + struct.setTableIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // TPUT + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.tput = new TPut(); + struct.tput.read(iprot); + struct.setTputIsSet(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, put_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.table != null) { + oprot.writeFieldBegin(TABLE_FIELD_DESC); + oprot.writeBinary(struct.table); + oprot.writeFieldEnd(); + } + if (struct.tput != null) { + oprot.writeFieldBegin(TPUT_FIELD_DESC); + struct.tput.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class put_argsTupleSchemeFactory implements SchemeFactory { + public put_argsTupleScheme getScheme() { + return new put_argsTupleScheme(); + } + } + + private static class put_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, put_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeBinary(struct.table); + struct.tput.write(oprot); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, put_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.table = iprot.readBinary(); + struct.setTableIsSet(true); + struct.tput = new TPut(); + struct.tput.read(iprot); + struct.setTputIsSet(true); + } + } + + } + + public static class put_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("put_result"); + + private static final org.apache.thrift.protocol.TField IO_FIELD_DESC = new org.apache.thrift.protocol.TField("io", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new put_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new put_resultTupleSchemeFactory()); + } + + public TIOError io; // 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 { + IO((short)1, "io"); + + private static final Map byName = new HashMap(); + + 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: // IO + return IO; + 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.IO, new org.apache.thrift.meta_data.FieldMetaData("io", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(put_result.class, metaDataMap); + } + + public put_result() { + } + + public put_result( + TIOError io) + { + this(); + this.io = io; + } + + /** + * Performs a deep copy on other. + */ + public put_result(put_result other) { + if (other.isSetIo()) { + this.io = new TIOError(other.io); + } + } + + public put_result deepCopy() { + return new put_result(this); + } + + @Override + public void clear() { + this.io = null; + } + + public TIOError getIo() { + return this.io; + } + + public put_result setIo(TIOError io) { + this.io = io; + return this; + } + + public void unsetIo() { + this.io = null; + } + + /** Returns true if field io is set (has been assigned a value) and false otherwise */ + public boolean isSetIo() { + return this.io != null; + } + + public void setIoIsSet(boolean value) { + if (!value) { + this.io = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case IO: + if (value == null) { + unsetIo(); + } else { + setIo((TIOError)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case IO: + return getIo(); + + } + 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 IO: + return isSetIo(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof put_result) + return this.equals((put_result)that); + return false; + } + + public boolean equals(put_result that) { + if (that == null) + return false; + + boolean this_present_io = true && this.isSetIo(); + boolean that_present_io = true && that.isSetIo(); + if (this_present_io || that_present_io) { + if (!(this_present_io && that_present_io)) + return false; + if (!this.io.equals(that.io)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_io = true && (isSetIo()); + list.add(present_io); + if (present_io) + list.add(io); + + return list.hashCode(); + } + + @Override + public int compareTo(put_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetIo()).compareTo(other.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, other.io); + 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("put_result("); + boolean first = true; + + sb.append("io:"); + if (this.io == null) { + sb.append("null"); + } else { + sb.append(this.io); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 put_resultStandardSchemeFactory implements SchemeFactory { + public put_resultStandardScheme getScheme() { + return new put_resultStandardScheme(); + } + } + + private static class put_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, put_result 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: // IO + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.io = new TIOError(); + struct.io.read(iprot); + struct.setIoIsSet(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, put_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.io != null) { + oprot.writeFieldBegin(IO_FIELD_DESC); + struct.io.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class put_resultTupleSchemeFactory implements SchemeFactory { + public put_resultTupleScheme getScheme() { + return new put_resultTupleScheme(); + } + } + + private static class put_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, put_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetIo()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetIo()) { + struct.io.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, put_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.io = new TIOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } + } + } + + } + + public static class checkAndPut_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("checkAndPut_args"); + + private static final org.apache.thrift.protocol.TField TABLE_FIELD_DESC = new org.apache.thrift.protocol.TField("table", org.apache.thrift.protocol.TType.STRING, (short)1); + 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)2); + private static final org.apache.thrift.protocol.TField FAMILY_FIELD_DESC = new org.apache.thrift.protocol.TField("family", org.apache.thrift.protocol.TType.STRING, (short)3); + 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)4); + 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)5); + private static final org.apache.thrift.protocol.TField TPUT_FIELD_DESC = new org.apache.thrift.protocol.TField("tput", org.apache.thrift.protocol.TType.STRUCT, (short)6); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new checkAndPut_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new checkAndPut_argsTupleSchemeFactory()); + } + + /** + * to check in and put to + */ + public ByteBuffer table; // required + /** + * row to check + */ + public ByteBuffer row; // required + /** + * column family to check + */ + public ByteBuffer family; // required + /** + * column qualifier to check + */ + public ByteBuffer qualifier; // required + /** + * the expected value, if not provided the + * check is for the non-existence of the + * column in question + */ + public ByteBuffer value; // required + /** + * the TPut to put if the check succeeds + */ + public TPut tput; // 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 { + /** + * to check in and put to + */ + TABLE((short)1, "table"), + /** + * row to check + */ + ROW((short)2, "row"), + /** + * column family to check + */ + FAMILY((short)3, "family"), + /** + * column qualifier to check + */ + QUALIFIER((short)4, "qualifier"), + /** + * the expected value, if not provided the + * check is for the non-existence of the + * column in question + */ + VALUE((short)5, "value"), + /** + * the TPut to put if the check succeeds + */ + TPUT((short)6, "tput"); + + private static final Map byName = new HashMap(); + + 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 + return TABLE; + case 2: // ROW + return ROW; + case 3: // FAMILY + return FAMILY; + case 4: // QUALIFIER + return QUALIFIER; + case 5: // VALUE + return VALUE; + case 6: // TPUT + return TPUT; + 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.TABLE, new org.apache.thrift.meta_data.FieldMetaData("table", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + tmpMap.put(_Fields.ROW, new org.apache.thrift.meta_data.FieldMetaData("row", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + tmpMap.put(_Fields.FAMILY, new org.apache.thrift.meta_data.FieldMetaData("family", 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))); + tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + tmpMap.put(_Fields.TPUT, new org.apache.thrift.meta_data.FieldMetaData("tput", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TPut.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(checkAndPut_args.class, metaDataMap); + } + + public checkAndPut_args() { + } + + public checkAndPut_args( + ByteBuffer table, + ByteBuffer row, + ByteBuffer family, + ByteBuffer qualifier, + ByteBuffer value, + TPut tput) + { + this(); + this.table = org.apache.thrift.TBaseHelper.copyBinary(table); + this.row = org.apache.thrift.TBaseHelper.copyBinary(row); + this.family = org.apache.thrift.TBaseHelper.copyBinary(family); + this.qualifier = org.apache.thrift.TBaseHelper.copyBinary(qualifier); + this.value = org.apache.thrift.TBaseHelper.copyBinary(value); + this.tput = tput; + } + + /** + * Performs a deep copy on other. + */ + public checkAndPut_args(checkAndPut_args other) { + if (other.isSetTable()) { + this.table = org.apache.thrift.TBaseHelper.copyBinary(other.table); + } + if (other.isSetRow()) { + this.row = org.apache.thrift.TBaseHelper.copyBinary(other.row); + } + if (other.isSetFamily()) { + this.family = org.apache.thrift.TBaseHelper.copyBinary(other.family); + } + if (other.isSetQualifier()) { + this.qualifier = org.apache.thrift.TBaseHelper.copyBinary(other.qualifier); + } + if (other.isSetValue()) { + this.value = org.apache.thrift.TBaseHelper.copyBinary(other.value); + } + if (other.isSetTput()) { + this.tput = new TPut(other.tput); + } + } + + public checkAndPut_args deepCopy() { + return new checkAndPut_args(this); + } + + @Override + public void clear() { + this.table = null; + this.row = null; + this.family = null; + this.qualifier = null; + this.value = null; + this.tput = null; + } + + /** + * to check in and put to + */ + public byte[] getTable() { + setTable(org.apache.thrift.TBaseHelper.rightSize(table)); + return table == null ? null : table.array(); + } + + public ByteBuffer bufferForTable() { + return org.apache.thrift.TBaseHelper.copyBinary(table); + } + + /** + * to check in and put to + */ + public checkAndPut_args setTable(byte[] table) { + this.table = table == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(table, table.length)); + return this; + } + + public checkAndPut_args setTable(ByteBuffer table) { + this.table = org.apache.thrift.TBaseHelper.copyBinary(table); + return this; + } + + public void unsetTable() { + this.table = null; + } + + /** Returns true if field table is set (has been assigned a value) and false otherwise */ + public boolean isSetTable() { + return this.table != null; + } + + public void setTableIsSet(boolean value) { + if (!value) { + this.table = null; + } + } + + /** + * row to check + */ + public byte[] getRow() { + setRow(org.apache.thrift.TBaseHelper.rightSize(row)); + return row == null ? null : row.array(); + } + + public ByteBuffer bufferForRow() { + return org.apache.thrift.TBaseHelper.copyBinary(row); + } + + /** + * row to check + */ + public checkAndPut_args setRow(byte[] row) { + this.row = row == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(row, row.length)); + return this; + } + + public checkAndPut_args setRow(ByteBuffer row) { + this.row = org.apache.thrift.TBaseHelper.copyBinary(row); + return this; + } + + public void unsetRow() { + this.row = null; + } + + /** Returns true if field row is set (has been assigned a value) and false otherwise */ + public boolean isSetRow() { + return this.row != null; + } + + public void setRowIsSet(boolean value) { + if (!value) { + this.row = null; + } + } + + /** + * column family to check + */ + public byte[] getFamily() { + setFamily(org.apache.thrift.TBaseHelper.rightSize(family)); + return family == null ? null : family.array(); + } + + public ByteBuffer bufferForFamily() { + return org.apache.thrift.TBaseHelper.copyBinary(family); + } + + /** + * column family to check + */ + public checkAndPut_args setFamily(byte[] family) { + this.family = family == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(family, family.length)); + return this; + } + + public checkAndPut_args setFamily(ByteBuffer family) { + this.family = org.apache.thrift.TBaseHelper.copyBinary(family); + return this; + } + + public void unsetFamily() { + this.family = null; + } + + /** Returns true if field family is set (has been assigned a value) and false otherwise */ + public boolean isSetFamily() { + return this.family != null; + } + + public void setFamilyIsSet(boolean value) { + if (!value) { + this.family = null; + } + } + + /** + * column qualifier to check + */ + 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); + } + + /** + * column qualifier to check + */ + public checkAndPut_args setQualifier(byte[] qualifier) { + this.qualifier = qualifier == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(qualifier, qualifier.length)); + return this; + } + + public checkAndPut_args 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; + } + } + + /** + * the expected value, if not provided the + * check is for the non-existence of the + * column in question + */ + public byte[] getValue() { + setValue(org.apache.thrift.TBaseHelper.rightSize(value)); + return value == null ? null : value.array(); + } + + public ByteBuffer bufferForValue() { + return org.apache.thrift.TBaseHelper.copyBinary(value); + } + + /** + * the expected value, if not provided the + * check is for the non-existence of the + * column in question + */ + public checkAndPut_args setValue(byte[] value) { + this.value = value == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(value, value.length)); + return this; + } + + public checkAndPut_args setValue(ByteBuffer value) { + this.value = org.apache.thrift.TBaseHelper.copyBinary(value); + return this; + } + + public void unsetValue() { + this.value = null; + } + + /** Returns true if field value is set (has been assigned a value) and false otherwise */ + public boolean isSetValue() { + return this.value != null; + } + + public void setValueIsSet(boolean value) { + if (!value) { + this.value = null; + } + } + + /** + * the TPut to put if the check succeeds + */ + public TPut getTput() { + return this.tput; + } + + /** + * the TPut to put if the check succeeds + */ + public checkAndPut_args setTput(TPut tput) { + this.tput = tput; + return this; + } + + public void unsetTput() { + this.tput = null; + } + + /** Returns true if field tput is set (has been assigned a value) and false otherwise */ + public boolean isSetTput() { + return this.tput != null; + } + + public void setTputIsSet(boolean value) { + if (!value) { + this.tput = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case TABLE: + if (value == null) { + unsetTable(); + } else { + setTable((ByteBuffer)value); + } + break; + + case ROW: + if (value == null) { + unsetRow(); + } else { + setRow((ByteBuffer)value); + } + break; + + case FAMILY: + if (value == null) { + unsetFamily(); + } else { + setFamily((ByteBuffer)value); + } + break; + + case QUALIFIER: + if (value == null) { + unsetQualifier(); + } else { + setQualifier((ByteBuffer)value); + } + break; + + case VALUE: + if (value == null) { + unsetValue(); + } else { + setValue((ByteBuffer)value); + } + break; + + case TPUT: + if (value == null) { + unsetTput(); + } else { + setTput((TPut)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case TABLE: + return getTable(); + + case ROW: + return getRow(); + + case FAMILY: + return getFamily(); + + case QUALIFIER: + return getQualifier(); + + case VALUE: + return getValue(); + + case TPUT: + return getTput(); + + } + 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: + return isSetTable(); + case ROW: + return isSetRow(); + case FAMILY: + return isSetFamily(); + case QUALIFIER: + return isSetQualifier(); + case VALUE: + return isSetValue(); + case TPUT: + return isSetTput(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof checkAndPut_args) + return this.equals((checkAndPut_args)that); + return false; + } + + public boolean equals(checkAndPut_args that) { + if (that == null) + return false; + + boolean this_present_table = true && this.isSetTable(); + boolean that_present_table = true && that.isSetTable(); + if (this_present_table || that_present_table) { + if (!(this_present_table && that_present_table)) + return false; + if (!this.table.equals(that.table)) + return false; + } + + boolean this_present_row = true && this.isSetRow(); + boolean that_present_row = true && that.isSetRow(); + if (this_present_row || that_present_row) { + if (!(this_present_row && that_present_row)) + return false; + if (!this.row.equals(that.row)) + return false; + } + + boolean this_present_family = true && this.isSetFamily(); + boolean that_present_family = true && that.isSetFamily(); + if (this_present_family || that_present_family) { + if (!(this_present_family && that_present_family)) + return false; + if (!this.family.equals(that.family)) + 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; + } + + boolean this_present_value = true && this.isSetValue(); + boolean that_present_value = true && that.isSetValue(); + if (this_present_value || that_present_value) { + if (!(this_present_value && that_present_value)) + return false; + if (!this.value.equals(that.value)) + return false; + } + + boolean this_present_tput = true && this.isSetTput(); + boolean that_present_tput = true && that.isSetTput(); + if (this_present_tput || that_present_tput) { + if (!(this_present_tput && that_present_tput)) + return false; + if (!this.tput.equals(that.tput)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_table = true && (isSetTable()); + list.add(present_table); + if (present_table) + list.add(table); + + boolean present_row = true && (isSetRow()); + list.add(present_row); + if (present_row) + list.add(row); + + boolean present_family = true && (isSetFamily()); + list.add(present_family); + if (present_family) + list.add(family); + + boolean present_qualifier = true && (isSetQualifier()); + list.add(present_qualifier); + if (present_qualifier) + list.add(qualifier); + + boolean present_value = true && (isSetValue()); + list.add(present_value); + if (present_value) + list.add(value); + + boolean present_tput = true && (isSetTput()); + list.add(present_tput); + if (present_tput) + list.add(tput); + + return list.hashCode(); + } + + @Override + public int compareTo(checkAndPut_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetTable()).compareTo(other.isSetTable()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTable()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.table, other.table); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetRow()).compareTo(other.isSetRow()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRow()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.row, other.row); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetFamily()).compareTo(other.isSetFamily()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetFamily()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.family, other.family); + 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; + } + } + lastComparison = Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValue()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, other.value); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetTput()).compareTo(other.isSetTput()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTput()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tput, other.tput); + 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("checkAndPut_args("); + boolean first = true; + + sb.append("table:"); + if (this.table == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.table, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("row:"); + if (this.row == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.row, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("family:"); + if (this.family == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.family, 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; + if (!first) sb.append(", "); + sb.append("value:"); + if (this.value == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.value, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("tput:"); + if (this.tput == null) { + sb.append("null"); + } else { + sb.append(this.tput); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (table == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'table' was not present! Struct: " + toString()); + } + if (row == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'row' was not present! Struct: " + toString()); + } + if (family == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'family' was not present! Struct: " + toString()); + } + if (qualifier == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'qualifier' was not present! Struct: " + toString()); + } + if (tput == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'tput' was not present! Struct: " + toString()); + } + // check for sub-struct validity + if (tput != null) { + tput.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 checkAndPut_argsStandardSchemeFactory implements SchemeFactory { + public checkAndPut_argsStandardScheme getScheme() { + return new checkAndPut_argsStandardScheme(); + } + } + + private static class checkAndPut_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, checkAndPut_args 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 + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.table = iprot.readBinary(); + struct.setTableIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // ROW + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.row = iprot.readBinary(); + struct.setRowIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // FAMILY + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.family = iprot.readBinary(); + struct.setFamilyIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // 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; + case 5: // VALUE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.value = iprot.readBinary(); + struct.setValueIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 6: // TPUT + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.tput = new TPut(); + struct.tput.read(iprot); + struct.setTputIsSet(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, checkAndPut_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.table != null) { + oprot.writeFieldBegin(TABLE_FIELD_DESC); + oprot.writeBinary(struct.table); + oprot.writeFieldEnd(); + } + if (struct.row != null) { + oprot.writeFieldBegin(ROW_FIELD_DESC); + oprot.writeBinary(struct.row); + oprot.writeFieldEnd(); + } + if (struct.family != null) { + oprot.writeFieldBegin(FAMILY_FIELD_DESC); + oprot.writeBinary(struct.family); + oprot.writeFieldEnd(); + } + if (struct.qualifier != null) { + oprot.writeFieldBegin(QUALIFIER_FIELD_DESC); + oprot.writeBinary(struct.qualifier); + oprot.writeFieldEnd(); + } + if (struct.value != null) { + oprot.writeFieldBegin(VALUE_FIELD_DESC); + oprot.writeBinary(struct.value); + oprot.writeFieldEnd(); + } + if (struct.tput != null) { + oprot.writeFieldBegin(TPUT_FIELD_DESC); + struct.tput.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class checkAndPut_argsTupleSchemeFactory implements SchemeFactory { + public checkAndPut_argsTupleScheme getScheme() { + return new checkAndPut_argsTupleScheme(); + } + } + + private static class checkAndPut_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, checkAndPut_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeBinary(struct.table); + oprot.writeBinary(struct.row); + oprot.writeBinary(struct.family); + oprot.writeBinary(struct.qualifier); + struct.tput.write(oprot); + BitSet optionals = new BitSet(); + if (struct.isSetValue()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetValue()) { + oprot.writeBinary(struct.value); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, checkAndPut_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.table = iprot.readBinary(); + struct.setTableIsSet(true); + struct.row = iprot.readBinary(); + struct.setRowIsSet(true); + struct.family = iprot.readBinary(); + struct.setFamilyIsSet(true); + struct.qualifier = iprot.readBinary(); + struct.setQualifierIsSet(true); + struct.tput = new TPut(); + struct.tput.read(iprot); + struct.setTputIsSet(true); + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.value = iprot.readBinary(); + struct.setValueIsSet(true); + } + } + } + + } + + public static class checkAndPut_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("checkAndPut_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0); + private static final org.apache.thrift.protocol.TField IO_FIELD_DESC = new org.apache.thrift.protocol.TField("io", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new checkAndPut_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new checkAndPut_resultTupleSchemeFactory()); + } + + public boolean success; // required + public TIOError io; // 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 { + SUCCESS((short)0, "success"), + IO((short)1, "io"); + + private static final Map byName = new HashMap(); + + 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 0: // SUCCESS + return SUCCESS; + case 1: // IO + return IO; + 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 int __SUCCESS_ISSET_ID = 0; + private byte __isset_bitfield = 0; + 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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + tmpMap.put(_Fields.IO, new org.apache.thrift.meta_data.FieldMetaData("io", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(checkAndPut_result.class, metaDataMap); + } + + public checkAndPut_result() { + } + + public checkAndPut_result( + boolean success, + TIOError io) + { + this(); + this.success = success; + setSuccessIsSet(true); + this.io = io; + } + + /** + * Performs a deep copy on other. + */ + public checkAndPut_result(checkAndPut_result other) { + __isset_bitfield = other.__isset_bitfield; + this.success = other.success; + if (other.isSetIo()) { + this.io = new TIOError(other.io); + } + } + + public checkAndPut_result deepCopy() { + return new checkAndPut_result(this); + } + + @Override + public void clear() { + setSuccessIsSet(false); + this.success = false; + this.io = null; + } + + public boolean isSuccess() { + return this.success; + } + + public checkAndPut_result setSuccess(boolean success) { + this.success = success; + setSuccessIsSet(true); + return this; + } + + public void unsetSuccess() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + public void setSuccessIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); + } + + public TIOError getIo() { + return this.io; + } + + public checkAndPut_result setIo(TIOError io) { + this.io = io; + return this; + } + + public void unsetIo() { + this.io = null; + } + + /** Returns true if field io is set (has been assigned a value) and false otherwise */ + public boolean isSetIo() { + return this.io != null; + } + + public void setIoIsSet(boolean value) { + if (!value) { + this.io = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((Boolean)value); + } + break; + + case IO: + if (value == null) { + unsetIo(); + } else { + setIo((TIOError)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return isSuccess(); + + case IO: + return getIo(); + + } + 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 SUCCESS: + return isSetSuccess(); + case IO: + return isSetIo(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof checkAndPut_result) + return this.equals((checkAndPut_result)that); + return false; + } + + public boolean equals(checkAndPut_result that) { + if (that == null) + return false; + + boolean this_present_success = true; + boolean that_present_success = true; + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (this.success != that.success) + return false; + } + + boolean this_present_io = true && this.isSetIo(); + boolean that_present_io = true && that.isSetIo(); + if (this_present_io || that_present_io) { + if (!(this_present_io && that_present_io)) + return false; + if (!this.io.equals(that.io)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true; + list.add(present_success); + if (present_success) + list.add(success); + + boolean present_io = true && (isSetIo()); + list.add(present_io); + if (present_io) + list.add(io); + + return list.hashCode(); + } + + @Override + public int compareTo(checkAndPut_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIo()).compareTo(other.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, other.io); + 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("checkAndPut_result("); + boolean first = true; + + sb.append("success:"); + sb.append(this.success); + first = false; + if (!first) sb.append(", "); + sb.append("io:"); + if (this.io == null) { + sb.append("null"); + } else { + sb.append(this.io); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 { + // 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); + } + } + + private static class checkAndPut_resultStandardSchemeFactory implements SchemeFactory { + public checkAndPut_resultStandardScheme getScheme() { + return new checkAndPut_resultStandardScheme(); + } + } + + private static class checkAndPut_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, checkAndPut_result 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 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IO + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.io = new TIOError(); + struct.io.read(iprot); + struct.setIoIsSet(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, checkAndPut_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeBool(struct.success); + oprot.writeFieldEnd(); + } + if (struct.io != null) { + oprot.writeFieldBegin(IO_FIELD_DESC); + struct.io.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class checkAndPut_resultTupleSchemeFactory implements SchemeFactory { + public checkAndPut_resultTupleScheme getScheme() { + return new checkAndPut_resultTupleScheme(); + } + } + + private static class checkAndPut_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, checkAndPut_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIo()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + oprot.writeBool(struct.success); + } + if (struct.isSetIo()) { + struct.io.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, checkAndPut_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.io = new TIOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } + } + } + + } + + public static class putMultiple_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("putMultiple_args"); + + private static final org.apache.thrift.protocol.TField TABLE_FIELD_DESC = new org.apache.thrift.protocol.TField("table", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField TPUTS_FIELD_DESC = new org.apache.thrift.protocol.TField("tputs", org.apache.thrift.protocol.TType.LIST, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new putMultiple_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new putMultiple_argsTupleSchemeFactory()); + } + + /** + * the table to put data in + */ + public ByteBuffer table; // required + /** + * a list of TPuts to commit + */ + public List tputs; // 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 { + /** + * the table to put data in + */ + TABLE((short)1, "table"), + /** + * a list of TPuts to commit + */ + TPUTS((short)2, "tputs"); + + private static final Map byName = new HashMap(); + + 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 + return TABLE; + case 2: // TPUTS + return TPUTS; + 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.TABLE, new org.apache.thrift.meta_data.FieldMetaData("table", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + tmpMap.put(_Fields.TPUTS, new org.apache.thrift.meta_data.FieldMetaData("tputs", org.apache.thrift.TFieldRequirementType.REQUIRED, + 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, TPut.class)))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(putMultiple_args.class, metaDataMap); + } + + public putMultiple_args() { + } + + public putMultiple_args( + ByteBuffer table, + List tputs) + { + this(); + this.table = org.apache.thrift.TBaseHelper.copyBinary(table); + this.tputs = tputs; + } + + /** + * Performs a deep copy on other. + */ + public putMultiple_args(putMultiple_args other) { + if (other.isSetTable()) { + this.table = org.apache.thrift.TBaseHelper.copyBinary(other.table); + } + if (other.isSetTputs()) { + List __this__tputs = new ArrayList(other.tputs.size()); + for (TPut other_element : other.tputs) { + __this__tputs.add(new TPut(other_element)); + } + this.tputs = __this__tputs; + } + } + + public putMultiple_args deepCopy() { + return new putMultiple_args(this); + } + + @Override + public void clear() { + this.table = null; + this.tputs = null; + } + + /** + * the table to put data in + */ + public byte[] getTable() { + setTable(org.apache.thrift.TBaseHelper.rightSize(table)); + return table == null ? null : table.array(); + } + + public ByteBuffer bufferForTable() { + return org.apache.thrift.TBaseHelper.copyBinary(table); + } + + /** + * the table to put data in + */ + public putMultiple_args setTable(byte[] table) { + this.table = table == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(table, table.length)); + return this; + } + + public putMultiple_args setTable(ByteBuffer table) { + this.table = org.apache.thrift.TBaseHelper.copyBinary(table); + return this; + } + + public void unsetTable() { + this.table = null; + } + + /** Returns true if field table is set (has been assigned a value) and false otherwise */ + public boolean isSetTable() { + return this.table != null; + } + + public void setTableIsSet(boolean value) { + if (!value) { + this.table = null; + } + } + + public int getTputsSize() { + return (this.tputs == null) ? 0 : this.tputs.size(); + } + + public java.util.Iterator getTputsIterator() { + return (this.tputs == null) ? null : this.tputs.iterator(); + } + + public void addToTputs(TPut elem) { + if (this.tputs == null) { + this.tputs = new ArrayList(); + } + this.tputs.add(elem); + } + + /** + * a list of TPuts to commit + */ + public List getTputs() { + return this.tputs; + } + + /** + * a list of TPuts to commit + */ + public putMultiple_args setTputs(List tputs) { + this.tputs = tputs; + return this; + } + + public void unsetTputs() { + this.tputs = null; + } + + /** Returns true if field tputs is set (has been assigned a value) and false otherwise */ + public boolean isSetTputs() { + return this.tputs != null; + } + + public void setTputsIsSet(boolean value) { + if (!value) { + this.tputs = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case TABLE: + if (value == null) { + unsetTable(); + } else { + setTable((ByteBuffer)value); + } + break; + + case TPUTS: + if (value == null) { + unsetTputs(); + } else { + setTputs((List)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case TABLE: + return getTable(); + + case TPUTS: + return getTputs(); + + } + 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: + return isSetTable(); + case TPUTS: + return isSetTputs(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof putMultiple_args) + return this.equals((putMultiple_args)that); + return false; + } + + public boolean equals(putMultiple_args that) { + if (that == null) + return false; + + boolean this_present_table = true && this.isSetTable(); + boolean that_present_table = true && that.isSetTable(); + if (this_present_table || that_present_table) { + if (!(this_present_table && that_present_table)) + return false; + if (!this.table.equals(that.table)) + return false; + } + + boolean this_present_tputs = true && this.isSetTputs(); + boolean that_present_tputs = true && that.isSetTputs(); + if (this_present_tputs || that_present_tputs) { + if (!(this_present_tputs && that_present_tputs)) + return false; + if (!this.tputs.equals(that.tputs)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_table = true && (isSetTable()); + list.add(present_table); + if (present_table) + list.add(table); + + boolean present_tputs = true && (isSetTputs()); + list.add(present_tputs); + if (present_tputs) + list.add(tputs); + + return list.hashCode(); + } + + @Override + public int compareTo(putMultiple_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetTable()).compareTo(other.isSetTable()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTable()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.table, other.table); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetTputs()).compareTo(other.isSetTputs()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTputs()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tputs, other.tputs); + 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("putMultiple_args("); + boolean first = true; + + sb.append("table:"); + if (this.table == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.table, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("tputs:"); + if (this.tputs == null) { + sb.append("null"); + } else { + sb.append(this.tputs); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (table == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'table' was not present! Struct: " + toString()); + } + if (tputs == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'tputs' 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 putMultiple_argsStandardSchemeFactory implements SchemeFactory { + public putMultiple_argsStandardScheme getScheme() { + return new putMultiple_argsStandardScheme(); + } + } + + private static class putMultiple_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, putMultiple_args 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 + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.table = iprot.readBinary(); + struct.setTableIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // TPUTS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list148 = iprot.readListBegin(); + struct.tputs = new ArrayList(_list148.size); + TPut _elem149; + for (int _i150 = 0; _i150 < _list148.size; ++_i150) + { + _elem149 = new TPut(); + _elem149.read(iprot); + struct.tputs.add(_elem149); + } + iprot.readListEnd(); + } + struct.setTputsIsSet(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, putMultiple_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.table != null) { + oprot.writeFieldBegin(TABLE_FIELD_DESC); + oprot.writeBinary(struct.table); + oprot.writeFieldEnd(); + } + if (struct.tputs != null) { + oprot.writeFieldBegin(TPUTS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.tputs.size())); + for (TPut _iter151 : struct.tputs) + { + _iter151.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class putMultiple_argsTupleSchemeFactory implements SchemeFactory { + public putMultiple_argsTupleScheme getScheme() { + return new putMultiple_argsTupleScheme(); + } + } + + private static class putMultiple_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, putMultiple_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeBinary(struct.table); + { + oprot.writeI32(struct.tputs.size()); + for (TPut _iter152 : struct.tputs) + { + _iter152.write(oprot); + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, putMultiple_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.table = iprot.readBinary(); + struct.setTableIsSet(true); + { + org.apache.thrift.protocol.TList _list153 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.tputs = new ArrayList(_list153.size); + TPut _elem154; + for (int _i155 = 0; _i155 < _list153.size; ++_i155) + { + _elem154 = new TPut(); + _elem154.read(iprot); + struct.tputs.add(_elem154); + } + } + struct.setTputsIsSet(true); + } + } + + } + + public static class putMultiple_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("putMultiple_result"); + + private static final org.apache.thrift.protocol.TField IO_FIELD_DESC = new org.apache.thrift.protocol.TField("io", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new putMultiple_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new putMultiple_resultTupleSchemeFactory()); + } + + public TIOError io; // 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 { + IO((short)1, "io"); + + private static final Map byName = new HashMap(); + + 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: // IO + return IO; + 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.IO, new org.apache.thrift.meta_data.FieldMetaData("io", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(putMultiple_result.class, metaDataMap); + } + + public putMultiple_result() { + } + + public putMultiple_result( + TIOError io) + { + this(); + this.io = io; + } + + /** + * Performs a deep copy on other. + */ + public putMultiple_result(putMultiple_result other) { + if (other.isSetIo()) { + this.io = new TIOError(other.io); + } + } + + public putMultiple_result deepCopy() { + return new putMultiple_result(this); + } + + @Override + public void clear() { + this.io = null; + } + + public TIOError getIo() { + return this.io; + } + + public putMultiple_result setIo(TIOError io) { + this.io = io; + return this; + } + + public void unsetIo() { + this.io = null; + } + + /** Returns true if field io is set (has been assigned a value) and false otherwise */ + public boolean isSetIo() { + return this.io != null; + } + + public void setIoIsSet(boolean value) { + if (!value) { + this.io = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case IO: + if (value == null) { + unsetIo(); + } else { + setIo((TIOError)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case IO: + return getIo(); + + } + 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 IO: + return isSetIo(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof putMultiple_result) + return this.equals((putMultiple_result)that); + return false; + } + + public boolean equals(putMultiple_result that) { + if (that == null) + return false; + + boolean this_present_io = true && this.isSetIo(); + boolean that_present_io = true && that.isSetIo(); + if (this_present_io || that_present_io) { + if (!(this_present_io && that_present_io)) + return false; + if (!this.io.equals(that.io)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_io = true && (isSetIo()); + list.add(present_io); + if (present_io) + list.add(io); + + return list.hashCode(); + } + + @Override + public int compareTo(putMultiple_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetIo()).compareTo(other.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, other.io); + 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("putMultiple_result("); + boolean first = true; + + sb.append("io:"); + if (this.io == null) { + sb.append("null"); + } else { + sb.append(this.io); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 putMultiple_resultStandardSchemeFactory implements SchemeFactory { + public putMultiple_resultStandardScheme getScheme() { + return new putMultiple_resultStandardScheme(); + } + } + + private static class putMultiple_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, putMultiple_result 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: // IO + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.io = new TIOError(); + struct.io.read(iprot); + struct.setIoIsSet(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, putMultiple_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.io != null) { + oprot.writeFieldBegin(IO_FIELD_DESC); + struct.io.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class putMultiple_resultTupleSchemeFactory implements SchemeFactory { + public putMultiple_resultTupleScheme getScheme() { + return new putMultiple_resultTupleScheme(); + } + } + + private static class putMultiple_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, putMultiple_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetIo()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetIo()) { + struct.io.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, putMultiple_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.io = new TIOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } + } + } + + } + + public static class deleteSingle_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteSingle_args"); + + private static final org.apache.thrift.protocol.TField TABLE_FIELD_DESC = new org.apache.thrift.protocol.TField("table", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField TDELETE_FIELD_DESC = new org.apache.thrift.protocol.TField("tdelete", org.apache.thrift.protocol.TType.STRUCT, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new deleteSingle_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new deleteSingle_argsTupleSchemeFactory()); + } + + /** + * the table to delete from + */ + public ByteBuffer table; // required + /** + * the TDelete to delete + */ + public TDelete tdelete; // 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 { + /** + * the table to delete from + */ + TABLE((short)1, "table"), + /** + * the TDelete to delete + */ + TDELETE((short)2, "tdelete"); + + private static final Map byName = new HashMap(); + + 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 + return TABLE; + case 2: // TDELETE + return TDELETE; + 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.TABLE, new org.apache.thrift.meta_data.FieldMetaData("table", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + tmpMap.put(_Fields.TDELETE, new org.apache.thrift.meta_data.FieldMetaData("tdelete", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TDelete.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteSingle_args.class, metaDataMap); + } + + public deleteSingle_args() { + } + + public deleteSingle_args( + ByteBuffer table, + TDelete tdelete) + { + this(); + this.table = org.apache.thrift.TBaseHelper.copyBinary(table); + this.tdelete = tdelete; + } + + /** + * Performs a deep copy on other. + */ + public deleteSingle_args(deleteSingle_args other) { + if (other.isSetTable()) { + this.table = org.apache.thrift.TBaseHelper.copyBinary(other.table); + } + if (other.isSetTdelete()) { + this.tdelete = new TDelete(other.tdelete); + } + } + + public deleteSingle_args deepCopy() { + return new deleteSingle_args(this); + } + + @Override + public void clear() { + this.table = null; + this.tdelete = null; + } + + /** + * the table to delete from + */ + public byte[] getTable() { + setTable(org.apache.thrift.TBaseHelper.rightSize(table)); + return table == null ? null : table.array(); + } + + public ByteBuffer bufferForTable() { + return org.apache.thrift.TBaseHelper.copyBinary(table); + } + + /** + * the table to delete from + */ + public deleteSingle_args setTable(byte[] table) { + this.table = table == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(table, table.length)); + return this; + } + + public deleteSingle_args setTable(ByteBuffer table) { + this.table = org.apache.thrift.TBaseHelper.copyBinary(table); + return this; + } + + public void unsetTable() { + this.table = null; + } + + /** Returns true if field table is set (has been assigned a value) and false otherwise */ + public boolean isSetTable() { + return this.table != null; + } + + public void setTableIsSet(boolean value) { + if (!value) { + this.table = null; + } + } + + /** + * the TDelete to delete + */ + public TDelete getTdelete() { + return this.tdelete; + } + + /** + * the TDelete to delete + */ + public deleteSingle_args setTdelete(TDelete tdelete) { + this.tdelete = tdelete; + return this; + } + + public void unsetTdelete() { + this.tdelete = null; + } + + /** Returns true if field tdelete is set (has been assigned a value) and false otherwise */ + public boolean isSetTdelete() { + return this.tdelete != null; + } + + public void setTdeleteIsSet(boolean value) { + if (!value) { + this.tdelete = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case TABLE: + if (value == null) { + unsetTable(); + } else { + setTable((ByteBuffer)value); + } + break; + + case TDELETE: + if (value == null) { + unsetTdelete(); + } else { + setTdelete((TDelete)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case TABLE: + return getTable(); + + case TDELETE: + return getTdelete(); + + } + 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: + return isSetTable(); + case TDELETE: + return isSetTdelete(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof deleteSingle_args) + return this.equals((deleteSingle_args)that); + return false; + } + + public boolean equals(deleteSingle_args that) { + if (that == null) + return false; + + boolean this_present_table = true && this.isSetTable(); + boolean that_present_table = true && that.isSetTable(); + if (this_present_table || that_present_table) { + if (!(this_present_table && that_present_table)) + return false; + if (!this.table.equals(that.table)) + return false; + } + + boolean this_present_tdelete = true && this.isSetTdelete(); + boolean that_present_tdelete = true && that.isSetTdelete(); + if (this_present_tdelete || that_present_tdelete) { + if (!(this_present_tdelete && that_present_tdelete)) + return false; + if (!this.tdelete.equals(that.tdelete)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_table = true && (isSetTable()); + list.add(present_table); + if (present_table) + list.add(table); + + boolean present_tdelete = true && (isSetTdelete()); + list.add(present_tdelete); + if (present_tdelete) + list.add(tdelete); + + return list.hashCode(); + } + + @Override + public int compareTo(deleteSingle_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetTable()).compareTo(other.isSetTable()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTable()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.table, other.table); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetTdelete()).compareTo(other.isSetTdelete()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTdelete()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tdelete, other.tdelete); + 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("deleteSingle_args("); + boolean first = true; + + sb.append("table:"); + if (this.table == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.table, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("tdelete:"); + if (this.tdelete == null) { + sb.append("null"); + } else { + sb.append(this.tdelete); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (table == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'table' was not present! Struct: " + toString()); + } + if (tdelete == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'tdelete' was not present! Struct: " + toString()); + } + // check for sub-struct validity + if (tdelete != null) { + tdelete.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 deleteSingle_argsStandardSchemeFactory implements SchemeFactory { + public deleteSingle_argsStandardScheme getScheme() { + return new deleteSingle_argsStandardScheme(); + } + } + + private static class deleteSingle_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, deleteSingle_args 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 + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.table = iprot.readBinary(); + struct.setTableIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // TDELETE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.tdelete = new TDelete(); + struct.tdelete.read(iprot); + struct.setTdeleteIsSet(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, deleteSingle_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.table != null) { + oprot.writeFieldBegin(TABLE_FIELD_DESC); + oprot.writeBinary(struct.table); + oprot.writeFieldEnd(); + } + if (struct.tdelete != null) { + oprot.writeFieldBegin(TDELETE_FIELD_DESC); + struct.tdelete.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class deleteSingle_argsTupleSchemeFactory implements SchemeFactory { + public deleteSingle_argsTupleScheme getScheme() { + return new deleteSingle_argsTupleScheme(); + } + } + + private static class deleteSingle_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, deleteSingle_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeBinary(struct.table); + struct.tdelete.write(oprot); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, deleteSingle_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.table = iprot.readBinary(); + struct.setTableIsSet(true); + struct.tdelete = new TDelete(); + struct.tdelete.read(iprot); + struct.setTdeleteIsSet(true); + } + } + + } + + public static class deleteSingle_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteSingle_result"); + + private static final org.apache.thrift.protocol.TField IO_FIELD_DESC = new org.apache.thrift.protocol.TField("io", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new deleteSingle_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new deleteSingle_resultTupleSchemeFactory()); + } + + public TIOError io; // 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 { + IO((short)1, "io"); + + private static final Map byName = new HashMap(); + + 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: // IO + return IO; + 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.IO, new org.apache.thrift.meta_data.FieldMetaData("io", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteSingle_result.class, metaDataMap); + } + + public deleteSingle_result() { + } + + public deleteSingle_result( + TIOError io) + { + this(); + this.io = io; + } + + /** + * Performs a deep copy on other. + */ + public deleteSingle_result(deleteSingle_result other) { + if (other.isSetIo()) { + this.io = new TIOError(other.io); + } + } + + public deleteSingle_result deepCopy() { + return new deleteSingle_result(this); + } + + @Override + public void clear() { + this.io = null; + } + + public TIOError getIo() { + return this.io; + } + + public deleteSingle_result setIo(TIOError io) { + this.io = io; + return this; + } + + public void unsetIo() { + this.io = null; + } + + /** Returns true if field io is set (has been assigned a value) and false otherwise */ + public boolean isSetIo() { + return this.io != null; + } + + public void setIoIsSet(boolean value) { + if (!value) { + this.io = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case IO: + if (value == null) { + unsetIo(); + } else { + setIo((TIOError)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case IO: + return getIo(); + + } + 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 IO: + return isSetIo(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof deleteSingle_result) + return this.equals((deleteSingle_result)that); + return false; + } + + public boolean equals(deleteSingle_result that) { + if (that == null) + return false; + + boolean this_present_io = true && this.isSetIo(); + boolean that_present_io = true && that.isSetIo(); + if (this_present_io || that_present_io) { + if (!(this_present_io && that_present_io)) + return false; + if (!this.io.equals(that.io)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_io = true && (isSetIo()); + list.add(present_io); + if (present_io) + list.add(io); + + return list.hashCode(); + } + + @Override + public int compareTo(deleteSingle_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetIo()).compareTo(other.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, other.io); + 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("deleteSingle_result("); + boolean first = true; + + sb.append("io:"); + if (this.io == null) { + sb.append("null"); + } else { + sb.append(this.io); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 deleteSingle_resultStandardSchemeFactory implements SchemeFactory { + public deleteSingle_resultStandardScheme getScheme() { + return new deleteSingle_resultStandardScheme(); + } + } + + private static class deleteSingle_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, deleteSingle_result 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: // IO + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.io = new TIOError(); + struct.io.read(iprot); + struct.setIoIsSet(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, deleteSingle_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.io != null) { + oprot.writeFieldBegin(IO_FIELD_DESC); + struct.io.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class deleteSingle_resultTupleSchemeFactory implements SchemeFactory { + public deleteSingle_resultTupleScheme getScheme() { + return new deleteSingle_resultTupleScheme(); + } + } + + private static class deleteSingle_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, deleteSingle_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetIo()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetIo()) { + struct.io.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, deleteSingle_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.io = new TIOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } + } + } + + } + + public static class deleteMultiple_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteMultiple_args"); + + private static final org.apache.thrift.protocol.TField TABLE_FIELD_DESC = new org.apache.thrift.protocol.TField("table", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField TDELETES_FIELD_DESC = new org.apache.thrift.protocol.TField("tdeletes", org.apache.thrift.protocol.TType.LIST, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new deleteMultiple_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new deleteMultiple_argsTupleSchemeFactory()); + } + + /** + * the table to delete from + */ + public ByteBuffer table; // required + /** + * list of TDeletes to delete + */ + public List tdeletes; // 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 { + /** + * the table to delete from + */ + TABLE((short)1, "table"), + /** + * list of TDeletes to delete + */ + TDELETES((short)2, "tdeletes"); + + private static final Map byName = new HashMap(); + + 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 + return TABLE; + case 2: // TDELETES + return TDELETES; + 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.TABLE, new org.apache.thrift.meta_data.FieldMetaData("table", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + tmpMap.put(_Fields.TDELETES, new org.apache.thrift.meta_data.FieldMetaData("tdeletes", org.apache.thrift.TFieldRequirementType.REQUIRED, + 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, TDelete.class)))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteMultiple_args.class, metaDataMap); + } + + public deleteMultiple_args() { + } + + public deleteMultiple_args( + ByteBuffer table, + List tdeletes) + { + this(); + this.table = org.apache.thrift.TBaseHelper.copyBinary(table); + this.tdeletes = tdeletes; + } + + /** + * Performs a deep copy on other. + */ + public deleteMultiple_args(deleteMultiple_args other) { + if (other.isSetTable()) { + this.table = org.apache.thrift.TBaseHelper.copyBinary(other.table); + } + if (other.isSetTdeletes()) { + List __this__tdeletes = new ArrayList(other.tdeletes.size()); + for (TDelete other_element : other.tdeletes) { + __this__tdeletes.add(new TDelete(other_element)); + } + this.tdeletes = __this__tdeletes; + } + } + + public deleteMultiple_args deepCopy() { + return new deleteMultiple_args(this); + } + + @Override + public void clear() { + this.table = null; + this.tdeletes = null; + } + + /** + * the table to delete from + */ + public byte[] getTable() { + setTable(org.apache.thrift.TBaseHelper.rightSize(table)); + return table == null ? null : table.array(); + } + + public ByteBuffer bufferForTable() { + return org.apache.thrift.TBaseHelper.copyBinary(table); + } + + /** + * the table to delete from + */ + public deleteMultiple_args setTable(byte[] table) { + this.table = table == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(table, table.length)); + return this; + } + + public deleteMultiple_args setTable(ByteBuffer table) { + this.table = org.apache.thrift.TBaseHelper.copyBinary(table); + return this; + } + + public void unsetTable() { + this.table = null; + } + + /** Returns true if field table is set (has been assigned a value) and false otherwise */ + public boolean isSetTable() { + return this.table != null; + } + + public void setTableIsSet(boolean value) { + if (!value) { + this.table = null; + } + } + + public int getTdeletesSize() { + return (this.tdeletes == null) ? 0 : this.tdeletes.size(); + } + + public java.util.Iterator getTdeletesIterator() { + return (this.tdeletes == null) ? null : this.tdeletes.iterator(); + } + + public void addToTdeletes(TDelete elem) { + if (this.tdeletes == null) { + this.tdeletes = new ArrayList(); + } + this.tdeletes.add(elem); + } + + /** + * list of TDeletes to delete + */ + public List getTdeletes() { + return this.tdeletes; + } + + /** + * list of TDeletes to delete + */ + public deleteMultiple_args setTdeletes(List tdeletes) { + this.tdeletes = tdeletes; + return this; + } + + public void unsetTdeletes() { + this.tdeletes = null; + } + + /** Returns true if field tdeletes is set (has been assigned a value) and false otherwise */ + public boolean isSetTdeletes() { + return this.tdeletes != null; + } + + public void setTdeletesIsSet(boolean value) { + if (!value) { + this.tdeletes = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case TABLE: + if (value == null) { + unsetTable(); + } else { + setTable((ByteBuffer)value); + } + break; + + case TDELETES: + if (value == null) { + unsetTdeletes(); + } else { + setTdeletes((List)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case TABLE: + return getTable(); + + case TDELETES: + return getTdeletes(); + + } + 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: + return isSetTable(); + case TDELETES: + return isSetTdeletes(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof deleteMultiple_args) + return this.equals((deleteMultiple_args)that); + return false; + } + + public boolean equals(deleteMultiple_args that) { + if (that == null) + return false; + + boolean this_present_table = true && this.isSetTable(); + boolean that_present_table = true && that.isSetTable(); + if (this_present_table || that_present_table) { + if (!(this_present_table && that_present_table)) + return false; + if (!this.table.equals(that.table)) + return false; + } + + boolean this_present_tdeletes = true && this.isSetTdeletes(); + boolean that_present_tdeletes = true && that.isSetTdeletes(); + if (this_present_tdeletes || that_present_tdeletes) { + if (!(this_present_tdeletes && that_present_tdeletes)) + return false; + if (!this.tdeletes.equals(that.tdeletes)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_table = true && (isSetTable()); + list.add(present_table); + if (present_table) + list.add(table); + + boolean present_tdeletes = true && (isSetTdeletes()); + list.add(present_tdeletes); + if (present_tdeletes) + list.add(tdeletes); + + return list.hashCode(); + } + + @Override + public int compareTo(deleteMultiple_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetTable()).compareTo(other.isSetTable()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTable()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.table, other.table); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetTdeletes()).compareTo(other.isSetTdeletes()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTdeletes()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tdeletes, other.tdeletes); + 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("deleteMultiple_args("); + boolean first = true; + + sb.append("table:"); + if (this.table == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.table, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("tdeletes:"); + if (this.tdeletes == null) { + sb.append("null"); + } else { + sb.append(this.tdeletes); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (table == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'table' was not present! Struct: " + toString()); + } + if (tdeletes == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'tdeletes' 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 deleteMultiple_argsStandardSchemeFactory implements SchemeFactory { + public deleteMultiple_argsStandardScheme getScheme() { + return new deleteMultiple_argsStandardScheme(); + } + } + + private static class deleteMultiple_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, deleteMultiple_args 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 + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.table = iprot.readBinary(); + struct.setTableIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // TDELETES + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list156 = iprot.readListBegin(); + struct.tdeletes = new ArrayList(_list156.size); + TDelete _elem157; + for (int _i158 = 0; _i158 < _list156.size; ++_i158) + { + _elem157 = new TDelete(); + _elem157.read(iprot); + struct.tdeletes.add(_elem157); + } + iprot.readListEnd(); + } + struct.setTdeletesIsSet(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, deleteMultiple_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.table != null) { + oprot.writeFieldBegin(TABLE_FIELD_DESC); + oprot.writeBinary(struct.table); + oprot.writeFieldEnd(); + } + if (struct.tdeletes != null) { + oprot.writeFieldBegin(TDELETES_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.tdeletes.size())); + for (TDelete _iter159 : struct.tdeletes) + { + _iter159.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class deleteMultiple_argsTupleSchemeFactory implements SchemeFactory { + public deleteMultiple_argsTupleScheme getScheme() { + return new deleteMultiple_argsTupleScheme(); + } + } + + private static class deleteMultiple_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, deleteMultiple_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeBinary(struct.table); + { + oprot.writeI32(struct.tdeletes.size()); + for (TDelete _iter160 : struct.tdeletes) + { + _iter160.write(oprot); + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, deleteMultiple_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.table = iprot.readBinary(); + struct.setTableIsSet(true); + { + org.apache.thrift.protocol.TList _list161 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.tdeletes = new ArrayList(_list161.size); + TDelete _elem162; + for (int _i163 = 0; _i163 < _list161.size; ++_i163) + { + _elem162 = new TDelete(); + _elem162.read(iprot); + struct.tdeletes.add(_elem162); + } + } + struct.setTdeletesIsSet(true); + } + } + + } + + public static class deleteMultiple_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteMultiple_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0); + private static final org.apache.thrift.protocol.TField IO_FIELD_DESC = new org.apache.thrift.protocol.TField("io", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new deleteMultiple_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new deleteMultiple_resultTupleSchemeFactory()); + } + + public List success; // required + public TIOError io; // 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 { + SUCCESS((short)0, "success"), + IO((short)1, "io"); + + private static final Map byName = new HashMap(); + + 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 0: // SUCCESS + return SUCCESS; + case 1: // IO + return IO; + 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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + 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, TDelete.class)))); + tmpMap.put(_Fields.IO, new org.apache.thrift.meta_data.FieldMetaData("io", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteMultiple_result.class, metaDataMap); + } + + public deleteMultiple_result() { + } + + public deleteMultiple_result( + List success, + TIOError io) + { + this(); + this.success = success; + this.io = io; + } + + /** + * Performs a deep copy on other. + */ + public deleteMultiple_result(deleteMultiple_result other) { + if (other.isSetSuccess()) { + List __this__success = new ArrayList(other.success.size()); + for (TDelete other_element : other.success) { + __this__success.add(new TDelete(other_element)); + } + this.success = __this__success; + } + if (other.isSetIo()) { + this.io = new TIOError(other.io); + } + } + + public deleteMultiple_result deepCopy() { + return new deleteMultiple_result(this); + } + + @Override + public void clear() { + this.success = null; + this.io = null; + } + + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + public java.util.Iterator getSuccessIterator() { + return (this.success == null) ? null : this.success.iterator(); + } + + public void addToSuccess(TDelete elem) { + if (this.success == null) { + this.success = new ArrayList(); + } + this.success.add(elem); + } + + public List getSuccess() { + return this.success; + } + + public deleteMultiple_result setSuccess(List success) { + this.success = success; + return this; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public TIOError getIo() { + return this.io; + } + + public deleteMultiple_result setIo(TIOError io) { + this.io = io; + return this; + } + + public void unsetIo() { + this.io = null; + } + + /** Returns true if field io is set (has been assigned a value) and false otherwise */ + public boolean isSetIo() { + return this.io != null; + } + + public void setIoIsSet(boolean value) { + if (!value) { + this.io = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((List)value); + } + break; + + case IO: + if (value == null) { + unsetIo(); + } else { + setIo((TIOError)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + case IO: + return getIo(); + + } + 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 SUCCESS: + return isSetSuccess(); + case IO: + return isSetIo(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof deleteMultiple_result) + return this.equals((deleteMultiple_result)that); + return false; + } + + public boolean equals(deleteMultiple_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + boolean this_present_io = true && this.isSetIo(); + boolean that_present_io = true && that.isSetIo(); + if (this_present_io || that_present_io) { + if (!(this_present_io && that_present_io)) + return false; + if (!this.io.equals(that.io)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + boolean present_io = true && (isSetIo()); + list.add(present_io); + if (present_io) + list.add(io); + + return list.hashCode(); + } + + @Override + public int compareTo(deleteMultiple_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIo()).compareTo(other.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, other.io); + 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("deleteMultiple_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + if (!first) sb.append(", "); + sb.append("io:"); + if (this.io == null) { + sb.append("null"); + } else { + sb.append(this.io); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 deleteMultiple_resultStandardSchemeFactory implements SchemeFactory { + public deleteMultiple_resultStandardScheme getScheme() { + return new deleteMultiple_resultStandardScheme(); + } + } + + private static class deleteMultiple_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, deleteMultiple_result 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 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list164 = iprot.readListBegin(); + struct.success = new ArrayList(_list164.size); + TDelete _elem165; + for (int _i166 = 0; _i166 < _list164.size; ++_i166) + { + _elem165 = new TDelete(); + _elem165.read(iprot); + struct.success.add(_elem165); + } + iprot.readListEnd(); + } + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IO + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.io = new TIOError(); + struct.io.read(iprot); + struct.setIoIsSet(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, deleteMultiple_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); + for (TDelete _iter167 : struct.success) + { + _iter167.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.io != null) { + oprot.writeFieldBegin(IO_FIELD_DESC); + struct.io.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class deleteMultiple_resultTupleSchemeFactory implements SchemeFactory { + public deleteMultiple_resultTupleScheme getScheme() { + return new deleteMultiple_resultTupleScheme(); + } + } + + private static class deleteMultiple_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, deleteMultiple_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIo()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + { + oprot.writeI32(struct.success.size()); + for (TDelete _iter168 : struct.success) + { + _iter168.write(oprot); + } + } + } + if (struct.isSetIo()) { + struct.io.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, deleteMultiple_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list169 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new ArrayList(_list169.size); + TDelete _elem170; + for (int _i171 = 0; _i171 < _list169.size; ++_i171) + { + _elem170 = new TDelete(); + _elem170.read(iprot); + struct.success.add(_elem170); + } + } + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.io = new TIOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } + } + } + + } + + public static class checkAndDelete_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("checkAndDelete_args"); + + private static final org.apache.thrift.protocol.TField TABLE_FIELD_DESC = new org.apache.thrift.protocol.TField("table", org.apache.thrift.protocol.TType.STRING, (short)1); + 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)2); + private static final org.apache.thrift.protocol.TField FAMILY_FIELD_DESC = new org.apache.thrift.protocol.TField("family", org.apache.thrift.protocol.TType.STRING, (short)3); + 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)4); + 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)5); + private static final org.apache.thrift.protocol.TField TDELETE_FIELD_DESC = new org.apache.thrift.protocol.TField("tdelete", org.apache.thrift.protocol.TType.STRUCT, (short)6); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new checkAndDelete_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new checkAndDelete_argsTupleSchemeFactory()); + } + + /** + * to check in and delete from + */ + public ByteBuffer table; // required + /** + * row to check + */ + public ByteBuffer row; // required + /** + * column family to check + */ + public ByteBuffer family; // required + /** + * column qualifier to check + */ + public ByteBuffer qualifier; // required + /** + * the expected value, if not provided the + * check is for the non-existence of the + * column in question + */ + public ByteBuffer value; // required + /** + * the TDelete to execute if the check succeeds + */ + public TDelete tdelete; // 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 { + /** + * to check in and delete from + */ + TABLE((short)1, "table"), + /** + * row to check + */ + ROW((short)2, "row"), + /** + * column family to check + */ + FAMILY((short)3, "family"), + /** + * column qualifier to check + */ + QUALIFIER((short)4, "qualifier"), + /** + * the expected value, if not provided the + * check is for the non-existence of the + * column in question + */ + VALUE((short)5, "value"), + /** + * the TDelete to execute if the check succeeds + */ + TDELETE((short)6, "tdelete"); + + private static final Map byName = new HashMap(); + + 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 + return TABLE; + case 2: // ROW + return ROW; + case 3: // FAMILY + return FAMILY; + case 4: // QUALIFIER + return QUALIFIER; + case 5: // VALUE + return VALUE; + case 6: // TDELETE + return TDELETE; + 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.TABLE, new org.apache.thrift.meta_data.FieldMetaData("table", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + tmpMap.put(_Fields.ROW, new org.apache.thrift.meta_data.FieldMetaData("row", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + tmpMap.put(_Fields.FAMILY, new org.apache.thrift.meta_data.FieldMetaData("family", 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))); + tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + tmpMap.put(_Fields.TDELETE, new org.apache.thrift.meta_data.FieldMetaData("tdelete", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TDelete.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(checkAndDelete_args.class, metaDataMap); + } + + public checkAndDelete_args() { + } + + public checkAndDelete_args( + ByteBuffer table, + ByteBuffer row, + ByteBuffer family, + ByteBuffer qualifier, + ByteBuffer value, + TDelete tdelete) + { + this(); + this.table = org.apache.thrift.TBaseHelper.copyBinary(table); + this.row = org.apache.thrift.TBaseHelper.copyBinary(row); + this.family = org.apache.thrift.TBaseHelper.copyBinary(family); + this.qualifier = org.apache.thrift.TBaseHelper.copyBinary(qualifier); + this.value = org.apache.thrift.TBaseHelper.copyBinary(value); + this.tdelete = tdelete; + } + + /** + * Performs a deep copy on other. + */ + public checkAndDelete_args(checkAndDelete_args other) { + if (other.isSetTable()) { + this.table = org.apache.thrift.TBaseHelper.copyBinary(other.table); + } + if (other.isSetRow()) { + this.row = org.apache.thrift.TBaseHelper.copyBinary(other.row); + } + if (other.isSetFamily()) { + this.family = org.apache.thrift.TBaseHelper.copyBinary(other.family); + } + if (other.isSetQualifier()) { + this.qualifier = org.apache.thrift.TBaseHelper.copyBinary(other.qualifier); + } + if (other.isSetValue()) { + this.value = org.apache.thrift.TBaseHelper.copyBinary(other.value); + } + if (other.isSetTdelete()) { + this.tdelete = new TDelete(other.tdelete); + } + } + + public checkAndDelete_args deepCopy() { + return new checkAndDelete_args(this); + } + + @Override + public void clear() { + this.table = null; + this.row = null; + this.family = null; + this.qualifier = null; + this.value = null; + this.tdelete = null; + } + + /** + * to check in and delete from + */ + public byte[] getTable() { + setTable(org.apache.thrift.TBaseHelper.rightSize(table)); + return table == null ? null : table.array(); + } + + public ByteBuffer bufferForTable() { + return org.apache.thrift.TBaseHelper.copyBinary(table); + } + + /** + * to check in and delete from + */ + public checkAndDelete_args setTable(byte[] table) { + this.table = table == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(table, table.length)); + return this; + } + + public checkAndDelete_args setTable(ByteBuffer table) { + this.table = org.apache.thrift.TBaseHelper.copyBinary(table); + return this; + } + + public void unsetTable() { + this.table = null; + } + + /** Returns true if field table is set (has been assigned a value) and false otherwise */ + public boolean isSetTable() { + return this.table != null; + } + + public void setTableIsSet(boolean value) { + if (!value) { + this.table = null; + } + } + + /** + * row to check + */ + public byte[] getRow() { + setRow(org.apache.thrift.TBaseHelper.rightSize(row)); + return row == null ? null : row.array(); + } + + public ByteBuffer bufferForRow() { + return org.apache.thrift.TBaseHelper.copyBinary(row); + } + + /** + * row to check + */ + public checkAndDelete_args setRow(byte[] row) { + this.row = row == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(row, row.length)); + return this; + } + + public checkAndDelete_args setRow(ByteBuffer row) { + this.row = org.apache.thrift.TBaseHelper.copyBinary(row); + return this; + } + + public void unsetRow() { + this.row = null; + } + + /** Returns true if field row is set (has been assigned a value) and false otherwise */ + public boolean isSetRow() { + return this.row != null; + } + + public void setRowIsSet(boolean value) { + if (!value) { + this.row = null; + } + } + + /** + * column family to check + */ + public byte[] getFamily() { + setFamily(org.apache.thrift.TBaseHelper.rightSize(family)); + return family == null ? null : family.array(); + } + + public ByteBuffer bufferForFamily() { + return org.apache.thrift.TBaseHelper.copyBinary(family); + } + + /** + * column family to check + */ + public checkAndDelete_args setFamily(byte[] family) { + this.family = family == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(family, family.length)); + return this; + } + + public checkAndDelete_args setFamily(ByteBuffer family) { + this.family = org.apache.thrift.TBaseHelper.copyBinary(family); + return this; + } + + public void unsetFamily() { + this.family = null; + } + + /** Returns true if field family is set (has been assigned a value) and false otherwise */ + public boolean isSetFamily() { + return this.family != null; + } + + public void setFamilyIsSet(boolean value) { + if (!value) { + this.family = null; + } + } + + /** + * column qualifier to check + */ + 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); + } + + /** + * column qualifier to check + */ + public checkAndDelete_args setQualifier(byte[] qualifier) { + this.qualifier = qualifier == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(qualifier, qualifier.length)); + return this; + } + + public checkAndDelete_args 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; + } + } + + /** + * the expected value, if not provided the + * check is for the non-existence of the + * column in question + */ + public byte[] getValue() { + setValue(org.apache.thrift.TBaseHelper.rightSize(value)); + return value == null ? null : value.array(); + } + + public ByteBuffer bufferForValue() { + return org.apache.thrift.TBaseHelper.copyBinary(value); + } + + /** + * the expected value, if not provided the + * check is for the non-existence of the + * column in question + */ + public checkAndDelete_args setValue(byte[] value) { + this.value = value == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(value, value.length)); + return this; + } + + public checkAndDelete_args setValue(ByteBuffer value) { + this.value = org.apache.thrift.TBaseHelper.copyBinary(value); + return this; + } + + public void unsetValue() { + this.value = null; + } + + /** Returns true if field value is set (has been assigned a value) and false otherwise */ + public boolean isSetValue() { + return this.value != null; + } + + public void setValueIsSet(boolean value) { + if (!value) { + this.value = null; + } + } + + /** + * the TDelete to execute if the check succeeds + */ + public TDelete getTdelete() { + return this.tdelete; + } + + /** + * the TDelete to execute if the check succeeds + */ + public checkAndDelete_args setTdelete(TDelete tdelete) { + this.tdelete = tdelete; + return this; + } + + public void unsetTdelete() { + this.tdelete = null; + } + + /** Returns true if field tdelete is set (has been assigned a value) and false otherwise */ + public boolean isSetTdelete() { + return this.tdelete != null; + } + + public void setTdeleteIsSet(boolean value) { + if (!value) { + this.tdelete = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case TABLE: + if (value == null) { + unsetTable(); + } else { + setTable((ByteBuffer)value); + } + break; + + case ROW: + if (value == null) { + unsetRow(); + } else { + setRow((ByteBuffer)value); + } + break; + + case FAMILY: + if (value == null) { + unsetFamily(); + } else { + setFamily((ByteBuffer)value); + } + break; + + case QUALIFIER: + if (value == null) { + unsetQualifier(); + } else { + setQualifier((ByteBuffer)value); + } + break; + + case VALUE: + if (value == null) { + unsetValue(); + } else { + setValue((ByteBuffer)value); + } + break; + + case TDELETE: + if (value == null) { + unsetTdelete(); + } else { + setTdelete((TDelete)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case TABLE: + return getTable(); + + case ROW: + return getRow(); + + case FAMILY: + return getFamily(); + + case QUALIFIER: + return getQualifier(); + + case VALUE: + return getValue(); + + case TDELETE: + return getTdelete(); + + } + 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: + return isSetTable(); + case ROW: + return isSetRow(); + case FAMILY: + return isSetFamily(); + case QUALIFIER: + return isSetQualifier(); + case VALUE: + return isSetValue(); + case TDELETE: + return isSetTdelete(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof checkAndDelete_args) + return this.equals((checkAndDelete_args)that); + return false; + } + + public boolean equals(checkAndDelete_args that) { + if (that == null) + return false; + + boolean this_present_table = true && this.isSetTable(); + boolean that_present_table = true && that.isSetTable(); + if (this_present_table || that_present_table) { + if (!(this_present_table && that_present_table)) + return false; + if (!this.table.equals(that.table)) + return false; + } + + boolean this_present_row = true && this.isSetRow(); + boolean that_present_row = true && that.isSetRow(); + if (this_present_row || that_present_row) { + if (!(this_present_row && that_present_row)) + return false; + if (!this.row.equals(that.row)) + return false; + } + + boolean this_present_family = true && this.isSetFamily(); + boolean that_present_family = true && that.isSetFamily(); + if (this_present_family || that_present_family) { + if (!(this_present_family && that_present_family)) + return false; + if (!this.family.equals(that.family)) + 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; + } + + boolean this_present_value = true && this.isSetValue(); + boolean that_present_value = true && that.isSetValue(); + if (this_present_value || that_present_value) { + if (!(this_present_value && that_present_value)) + return false; + if (!this.value.equals(that.value)) + return false; + } + + boolean this_present_tdelete = true && this.isSetTdelete(); + boolean that_present_tdelete = true && that.isSetTdelete(); + if (this_present_tdelete || that_present_tdelete) { + if (!(this_present_tdelete && that_present_tdelete)) + return false; + if (!this.tdelete.equals(that.tdelete)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_table = true && (isSetTable()); + list.add(present_table); + if (present_table) + list.add(table); + + boolean present_row = true && (isSetRow()); + list.add(present_row); + if (present_row) + list.add(row); + + boolean present_family = true && (isSetFamily()); + list.add(present_family); + if (present_family) + list.add(family); + + boolean present_qualifier = true && (isSetQualifier()); + list.add(present_qualifier); + if (present_qualifier) + list.add(qualifier); + + boolean present_value = true && (isSetValue()); + list.add(present_value); + if (present_value) + list.add(value); + + boolean present_tdelete = true && (isSetTdelete()); + list.add(present_tdelete); + if (present_tdelete) + list.add(tdelete); + + return list.hashCode(); + } + + @Override + public int compareTo(checkAndDelete_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetTable()).compareTo(other.isSetTable()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTable()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.table, other.table); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetRow()).compareTo(other.isSetRow()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRow()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.row, other.row); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetFamily()).compareTo(other.isSetFamily()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetFamily()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.family, other.family); + 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; + } + } + lastComparison = Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValue()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, other.value); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetTdelete()).compareTo(other.isSetTdelete()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTdelete()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tdelete, other.tdelete); + 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("checkAndDelete_args("); + boolean first = true; + + sb.append("table:"); + if (this.table == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.table, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("row:"); + if (this.row == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.row, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("family:"); + if (this.family == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.family, 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; + if (!first) sb.append(", "); + sb.append("value:"); + if (this.value == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.value, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("tdelete:"); + if (this.tdelete == null) { + sb.append("null"); + } else { + sb.append(this.tdelete); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (table == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'table' was not present! Struct: " + toString()); + } + if (row == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'row' was not present! Struct: " + toString()); + } + if (family == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'family' was not present! Struct: " + toString()); + } + if (qualifier == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'qualifier' was not present! Struct: " + toString()); + } + if (tdelete == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'tdelete' was not present! Struct: " + toString()); + } + // check for sub-struct validity + if (tdelete != null) { + tdelete.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 checkAndDelete_argsStandardSchemeFactory implements SchemeFactory { + public checkAndDelete_argsStandardScheme getScheme() { + return new checkAndDelete_argsStandardScheme(); + } + } + + private static class checkAndDelete_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, checkAndDelete_args 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 + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.table = iprot.readBinary(); + struct.setTableIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // ROW + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.row = iprot.readBinary(); + struct.setRowIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // FAMILY + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.family = iprot.readBinary(); + struct.setFamilyIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // 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; + case 5: // VALUE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.value = iprot.readBinary(); + struct.setValueIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 6: // TDELETE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.tdelete = new TDelete(); + struct.tdelete.read(iprot); + struct.setTdeleteIsSet(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, checkAndDelete_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.table != null) { + oprot.writeFieldBegin(TABLE_FIELD_DESC); + oprot.writeBinary(struct.table); + oprot.writeFieldEnd(); + } + if (struct.row != null) { + oprot.writeFieldBegin(ROW_FIELD_DESC); + oprot.writeBinary(struct.row); + oprot.writeFieldEnd(); + } + if (struct.family != null) { + oprot.writeFieldBegin(FAMILY_FIELD_DESC); + oprot.writeBinary(struct.family); + oprot.writeFieldEnd(); + } + if (struct.qualifier != null) { + oprot.writeFieldBegin(QUALIFIER_FIELD_DESC); + oprot.writeBinary(struct.qualifier); + oprot.writeFieldEnd(); + } + if (struct.value != null) { + oprot.writeFieldBegin(VALUE_FIELD_DESC); + oprot.writeBinary(struct.value); + oprot.writeFieldEnd(); + } + if (struct.tdelete != null) { + oprot.writeFieldBegin(TDELETE_FIELD_DESC); + struct.tdelete.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class checkAndDelete_argsTupleSchemeFactory implements SchemeFactory { + public checkAndDelete_argsTupleScheme getScheme() { + return new checkAndDelete_argsTupleScheme(); + } + } + + private static class checkAndDelete_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, checkAndDelete_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeBinary(struct.table); + oprot.writeBinary(struct.row); + oprot.writeBinary(struct.family); + oprot.writeBinary(struct.qualifier); + struct.tdelete.write(oprot); + BitSet optionals = new BitSet(); + if (struct.isSetValue()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetValue()) { + oprot.writeBinary(struct.value); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, checkAndDelete_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.table = iprot.readBinary(); + struct.setTableIsSet(true); + struct.row = iprot.readBinary(); + struct.setRowIsSet(true); + struct.family = iprot.readBinary(); + struct.setFamilyIsSet(true); + struct.qualifier = iprot.readBinary(); + struct.setQualifierIsSet(true); + struct.tdelete = new TDelete(); + struct.tdelete.read(iprot); + struct.setTdeleteIsSet(true); + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.value = iprot.readBinary(); + struct.setValueIsSet(true); + } + } + } + + } + + public static class checkAndDelete_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("checkAndDelete_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0); + private static final org.apache.thrift.protocol.TField IO_FIELD_DESC = new org.apache.thrift.protocol.TField("io", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new checkAndDelete_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new checkAndDelete_resultTupleSchemeFactory()); + } + + public boolean success; // required + public TIOError io; // 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 { + SUCCESS((short)0, "success"), + IO((short)1, "io"); + + private static final Map byName = new HashMap(); + + 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 0: // SUCCESS + return SUCCESS; + case 1: // IO + return IO; + 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 int __SUCCESS_ISSET_ID = 0; + private byte __isset_bitfield = 0; + 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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + tmpMap.put(_Fields.IO, new org.apache.thrift.meta_data.FieldMetaData("io", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(checkAndDelete_result.class, metaDataMap); + } + + public checkAndDelete_result() { + } + + public checkAndDelete_result( + boolean success, + TIOError io) + { + this(); + this.success = success; + setSuccessIsSet(true); + this.io = io; + } + + /** + * Performs a deep copy on other. + */ + public checkAndDelete_result(checkAndDelete_result other) { + __isset_bitfield = other.__isset_bitfield; + this.success = other.success; + if (other.isSetIo()) { + this.io = new TIOError(other.io); + } + } + + public checkAndDelete_result deepCopy() { + return new checkAndDelete_result(this); + } + + @Override + public void clear() { + setSuccessIsSet(false); + this.success = false; + this.io = null; + } + + public boolean isSuccess() { + return this.success; + } + + public checkAndDelete_result setSuccess(boolean success) { + this.success = success; + setSuccessIsSet(true); + return this; + } + + public void unsetSuccess() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + public void setSuccessIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); + } + + public TIOError getIo() { + return this.io; + } + + public checkAndDelete_result setIo(TIOError io) { + this.io = io; + return this; + } + + public void unsetIo() { + this.io = null; + } + + /** Returns true if field io is set (has been assigned a value) and false otherwise */ + public boolean isSetIo() { + return this.io != null; + } + + public void setIoIsSet(boolean value) { + if (!value) { + this.io = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((Boolean)value); + } + break; + + case IO: + if (value == null) { + unsetIo(); + } else { + setIo((TIOError)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return isSuccess(); + + case IO: + return getIo(); + + } + 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 SUCCESS: + return isSetSuccess(); + case IO: + return isSetIo(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof checkAndDelete_result) + return this.equals((checkAndDelete_result)that); + return false; + } + + public boolean equals(checkAndDelete_result that) { + if (that == null) + return false; + + boolean this_present_success = true; + boolean that_present_success = true; + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (this.success != that.success) + return false; + } + + boolean this_present_io = true && this.isSetIo(); + boolean that_present_io = true && that.isSetIo(); + if (this_present_io || that_present_io) { + if (!(this_present_io && that_present_io)) + return false; + if (!this.io.equals(that.io)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true; + list.add(present_success); + if (present_success) + list.add(success); + + boolean present_io = true && (isSetIo()); + list.add(present_io); + if (present_io) + list.add(io); + + return list.hashCode(); + } + + @Override + public int compareTo(checkAndDelete_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIo()).compareTo(other.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, other.io); + 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("checkAndDelete_result("); + boolean first = true; + + sb.append("success:"); + sb.append(this.success); + first = false; + if (!first) sb.append(", "); + sb.append("io:"); + if (this.io == null) { + sb.append("null"); + } else { + sb.append(this.io); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 { + // 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); + } + } + + private static class checkAndDelete_resultStandardSchemeFactory implements SchemeFactory { + public checkAndDelete_resultStandardScheme getScheme() { + return new checkAndDelete_resultStandardScheme(); + } + } + + private static class checkAndDelete_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, checkAndDelete_result 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 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IO + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.io = new TIOError(); + struct.io.read(iprot); + struct.setIoIsSet(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, checkAndDelete_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeBool(struct.success); + oprot.writeFieldEnd(); + } + if (struct.io != null) { + oprot.writeFieldBegin(IO_FIELD_DESC); + struct.io.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class checkAndDelete_resultTupleSchemeFactory implements SchemeFactory { + public checkAndDelete_resultTupleScheme getScheme() { + return new checkAndDelete_resultTupleScheme(); + } + } + + private static class checkAndDelete_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, checkAndDelete_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIo()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + oprot.writeBool(struct.success); + } + if (struct.isSetIo()) { + struct.io.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, checkAndDelete_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.io = new TIOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } + } + } + + } + + public static class increment_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("increment_args"); + + private static final org.apache.thrift.protocol.TField TABLE_FIELD_DESC = new org.apache.thrift.protocol.TField("table", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField TINCREMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("tincrement", org.apache.thrift.protocol.TType.STRUCT, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new increment_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new increment_argsTupleSchemeFactory()); + } + + /** + * the table to increment the value on + */ + public ByteBuffer table; // required + /** + * the TIncrement to increment + */ + public TIncrement tincrement; // 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 { + /** + * the table to increment the value on + */ + TABLE((short)1, "table"), + /** + * the TIncrement to increment + */ + TINCREMENT((short)2, "tincrement"); + + private static final Map byName = new HashMap(); + + 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 + return TABLE; + case 2: // TINCREMENT + return TINCREMENT; + 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.TABLE, new org.apache.thrift.meta_data.FieldMetaData("table", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + tmpMap.put(_Fields.TINCREMENT, new org.apache.thrift.meta_data.FieldMetaData("tincrement", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TIncrement.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(increment_args.class, metaDataMap); + } + + public increment_args() { + } + + public increment_args( + ByteBuffer table, + TIncrement tincrement) + { + this(); + this.table = org.apache.thrift.TBaseHelper.copyBinary(table); + this.tincrement = tincrement; + } + + /** + * Performs a deep copy on other. + */ + public increment_args(increment_args other) { + if (other.isSetTable()) { + this.table = org.apache.thrift.TBaseHelper.copyBinary(other.table); + } + if (other.isSetTincrement()) { + this.tincrement = new TIncrement(other.tincrement); + } + } + + public increment_args deepCopy() { + return new increment_args(this); + } + + @Override + public void clear() { + this.table = null; + this.tincrement = null; + } + + /** + * the table to increment the value on + */ + public byte[] getTable() { + setTable(org.apache.thrift.TBaseHelper.rightSize(table)); + return table == null ? null : table.array(); + } + + public ByteBuffer bufferForTable() { + return org.apache.thrift.TBaseHelper.copyBinary(table); + } + + /** + * the table to increment the value on + */ + public increment_args setTable(byte[] table) { + this.table = table == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(table, table.length)); + return this; + } + + public increment_args setTable(ByteBuffer table) { + this.table = org.apache.thrift.TBaseHelper.copyBinary(table); + return this; + } + + public void unsetTable() { + this.table = null; + } + + /** Returns true if field table is set (has been assigned a value) and false otherwise */ + public boolean isSetTable() { + return this.table != null; + } + + public void setTableIsSet(boolean value) { + if (!value) { + this.table = null; + } + } + + /** + * the TIncrement to increment + */ + public TIncrement getTincrement() { + return this.tincrement; + } + + /** + * the TIncrement to increment + */ + public increment_args setTincrement(TIncrement tincrement) { + this.tincrement = tincrement; + return this; + } + + public void unsetTincrement() { + this.tincrement = null; + } + + /** Returns true if field tincrement is set (has been assigned a value) and false otherwise */ + public boolean isSetTincrement() { + return this.tincrement != null; + } + + public void setTincrementIsSet(boolean value) { + if (!value) { + this.tincrement = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case TABLE: + if (value == null) { + unsetTable(); + } else { + setTable((ByteBuffer)value); + } + break; + + case TINCREMENT: + if (value == null) { + unsetTincrement(); + } else { + setTincrement((TIncrement)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case TABLE: + return getTable(); + + case TINCREMENT: + return getTincrement(); + + } + 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: + return isSetTable(); + case TINCREMENT: + return isSetTincrement(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof increment_args) + return this.equals((increment_args)that); + return false; + } + + public boolean equals(increment_args that) { + if (that == null) + return false; + + boolean this_present_table = true && this.isSetTable(); + boolean that_present_table = true && that.isSetTable(); + if (this_present_table || that_present_table) { + if (!(this_present_table && that_present_table)) + return false; + if (!this.table.equals(that.table)) + return false; + } + + boolean this_present_tincrement = true && this.isSetTincrement(); + boolean that_present_tincrement = true && that.isSetTincrement(); + if (this_present_tincrement || that_present_tincrement) { + if (!(this_present_tincrement && that_present_tincrement)) + return false; + if (!this.tincrement.equals(that.tincrement)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_table = true && (isSetTable()); + list.add(present_table); + if (present_table) + list.add(table); + + boolean present_tincrement = true && (isSetTincrement()); + list.add(present_tincrement); + if (present_tincrement) + list.add(tincrement); + + return list.hashCode(); + } + + @Override + public int compareTo(increment_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetTable()).compareTo(other.isSetTable()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTable()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.table, other.table); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetTincrement()).compareTo(other.isSetTincrement()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTincrement()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tincrement, other.tincrement); + 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("increment_args("); + boolean first = true; + + sb.append("table:"); + if (this.table == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.table, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("tincrement:"); + if (this.tincrement == null) { + sb.append("null"); + } else { + sb.append(this.tincrement); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (table == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'table' was not present! Struct: " + toString()); + } + if (tincrement == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'tincrement' was not present! Struct: " + toString()); + } + // check for sub-struct validity + if (tincrement != null) { + tincrement.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 increment_argsStandardSchemeFactory implements SchemeFactory { + public increment_argsStandardScheme getScheme() { + return new increment_argsStandardScheme(); + } + } + + private static class increment_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, increment_args 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 + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.table = iprot.readBinary(); + struct.setTableIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // TINCREMENT + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.tincrement = new TIncrement(); + struct.tincrement.read(iprot); + struct.setTincrementIsSet(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, increment_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.table != null) { + oprot.writeFieldBegin(TABLE_FIELD_DESC); + oprot.writeBinary(struct.table); + oprot.writeFieldEnd(); + } + if (struct.tincrement != null) { + oprot.writeFieldBegin(TINCREMENT_FIELD_DESC); + struct.tincrement.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class increment_argsTupleSchemeFactory implements SchemeFactory { + public increment_argsTupleScheme getScheme() { + return new increment_argsTupleScheme(); + } + } + + private static class increment_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, increment_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeBinary(struct.table); + struct.tincrement.write(oprot); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, increment_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.table = iprot.readBinary(); + struct.setTableIsSet(true); + struct.tincrement = new TIncrement(); + struct.tincrement.read(iprot); + struct.setTincrementIsSet(true); + } + } + + } + + public static class increment_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("increment_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); + private static final org.apache.thrift.protocol.TField IO_FIELD_DESC = new org.apache.thrift.protocol.TField("io", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new increment_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new increment_resultTupleSchemeFactory()); + } + + public TResult success; // required + public TIOError io; // 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 { + SUCCESS((short)0, "success"), + IO((short)1, "io"); + + private static final Map byName = new HashMap(); + + 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 0: // SUCCESS + return SUCCESS; + case 1: // IO + return IO; + 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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TResult.class))); + tmpMap.put(_Fields.IO, new org.apache.thrift.meta_data.FieldMetaData("io", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(increment_result.class, metaDataMap); + } + + public increment_result() { + } + + public increment_result( + TResult success, + TIOError io) + { + this(); + this.success = success; + this.io = io; + } + + /** + * Performs a deep copy on other. + */ + public increment_result(increment_result other) { + if (other.isSetSuccess()) { + this.success = new TResult(other.success); + } + if (other.isSetIo()) { + this.io = new TIOError(other.io); + } + } + + public increment_result deepCopy() { + return new increment_result(this); + } + + @Override + public void clear() { + this.success = null; + this.io = null; + } + + public TResult getSuccess() { + return this.success; + } + + public increment_result setSuccess(TResult success) { + this.success = success; + return this; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public TIOError getIo() { + return this.io; + } + + public increment_result setIo(TIOError io) { + this.io = io; + return this; + } + + public void unsetIo() { + this.io = null; + } + + /** Returns true if field io is set (has been assigned a value) and false otherwise */ + public boolean isSetIo() { + return this.io != null; + } + + public void setIoIsSet(boolean value) { + if (!value) { + this.io = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((TResult)value); + } + break; + + case IO: + if (value == null) { + unsetIo(); + } else { + setIo((TIOError)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + case IO: + return getIo(); + + } + 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 SUCCESS: + return isSetSuccess(); + case IO: + return isSetIo(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof increment_result) + return this.equals((increment_result)that); + return false; + } + + public boolean equals(increment_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + boolean this_present_io = true && this.isSetIo(); + boolean that_present_io = true && that.isSetIo(); + if (this_present_io || that_present_io) { + if (!(this_present_io && that_present_io)) + return false; + if (!this.io.equals(that.io)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + boolean present_io = true && (isSetIo()); + list.add(present_io); + if (present_io) + list.add(io); + + return list.hashCode(); + } + + @Override + public int compareTo(increment_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIo()).compareTo(other.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, other.io); + 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("increment_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + if (!first) sb.append(", "); + sb.append("io:"); + if (this.io == null) { + sb.append("null"); + } else { + sb.append(this.io); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + if (success != null) { + success.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 increment_resultStandardSchemeFactory implements SchemeFactory { + public increment_resultStandardScheme getScheme() { + return new increment_resultStandardScheme(); + } + } + + private static class increment_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, increment_result 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 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.success = new TResult(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IO + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.io = new TIOError(); + struct.io.read(iprot); + struct.setIoIsSet(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, increment_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + struct.success.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.io != null) { + oprot.writeFieldBegin(IO_FIELD_DESC); + struct.io.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class increment_resultTupleSchemeFactory implements SchemeFactory { + public increment_resultTupleScheme getScheme() { + return new increment_resultTupleScheme(); + } + } + + private static class increment_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, increment_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIo()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + struct.success.write(oprot); + } + if (struct.isSetIo()) { + struct.io.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, increment_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.success = new TResult(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.io = new TIOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } + } + } + + } + + public static class append_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("append_args"); + + private static final org.apache.thrift.protocol.TField TABLE_FIELD_DESC = new org.apache.thrift.protocol.TField("table", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField TAPPEND_FIELD_DESC = new org.apache.thrift.protocol.TField("tappend", org.apache.thrift.protocol.TType.STRUCT, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new append_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new append_argsTupleSchemeFactory()); + } + + /** + * the table to append the value on + */ + public ByteBuffer table; // required + /** + * the TAppend to append + */ + public TAppend tappend; // 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 { + /** + * the table to append the value on + */ + TABLE((short)1, "table"), + /** + * the TAppend to append + */ + TAPPEND((short)2, "tappend"); + + private static final Map byName = new HashMap(); + + 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 + return TABLE; + case 2: // TAPPEND + return TAPPEND; + 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.TABLE, new org.apache.thrift.meta_data.FieldMetaData("table", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + tmpMap.put(_Fields.TAPPEND, new org.apache.thrift.meta_data.FieldMetaData("tappend", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TAppend.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(append_args.class, metaDataMap); + } + + public append_args() { + } + + public append_args( + ByteBuffer table, + TAppend tappend) + { + this(); + this.table = org.apache.thrift.TBaseHelper.copyBinary(table); + this.tappend = tappend; + } + + /** + * Performs a deep copy on other. + */ + public append_args(append_args other) { + if (other.isSetTable()) { + this.table = org.apache.thrift.TBaseHelper.copyBinary(other.table); + } + if (other.isSetTappend()) { + this.tappend = new TAppend(other.tappend); + } + } + + public append_args deepCopy() { + return new append_args(this); + } + + @Override + public void clear() { + this.table = null; + this.tappend = null; + } + + /** + * the table to append the value on + */ + public byte[] getTable() { + setTable(org.apache.thrift.TBaseHelper.rightSize(table)); + return table == null ? null : table.array(); + } + + public ByteBuffer bufferForTable() { + return org.apache.thrift.TBaseHelper.copyBinary(table); + } + + /** + * the table to append the value on + */ + public append_args setTable(byte[] table) { + this.table = table == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(table, table.length)); + return this; + } + + public append_args setTable(ByteBuffer table) { + this.table = org.apache.thrift.TBaseHelper.copyBinary(table); + return this; + } + + public void unsetTable() { + this.table = null; + } + + /** Returns true if field table is set (has been assigned a value) and false otherwise */ + public boolean isSetTable() { + return this.table != null; + } + + public void setTableIsSet(boolean value) { + if (!value) { + this.table = null; + } + } + + /** + * the TAppend to append + */ + public TAppend getTappend() { + return this.tappend; + } + + /** + * the TAppend to append + */ + public append_args setTappend(TAppend tappend) { + this.tappend = tappend; + return this; + } + + public void unsetTappend() { + this.tappend = null; + } + + /** Returns true if field tappend is set (has been assigned a value) and false otherwise */ + public boolean isSetTappend() { + return this.tappend != null; + } + + public void setTappendIsSet(boolean value) { + if (!value) { + this.tappend = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case TABLE: + if (value == null) { + unsetTable(); + } else { + setTable((ByteBuffer)value); + } + break; + + case TAPPEND: + if (value == null) { + unsetTappend(); + } else { + setTappend((TAppend)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case TABLE: + return getTable(); + + case TAPPEND: + return getTappend(); + + } + 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: + return isSetTable(); + case TAPPEND: + return isSetTappend(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof append_args) + return this.equals((append_args)that); + return false; + } + + public boolean equals(append_args that) { + if (that == null) + return false; + + boolean this_present_table = true && this.isSetTable(); + boolean that_present_table = true && that.isSetTable(); + if (this_present_table || that_present_table) { + if (!(this_present_table && that_present_table)) + return false; + if (!this.table.equals(that.table)) + return false; + } + + boolean this_present_tappend = true && this.isSetTappend(); + boolean that_present_tappend = true && that.isSetTappend(); + if (this_present_tappend || that_present_tappend) { + if (!(this_present_tappend && that_present_tappend)) + return false; + if (!this.tappend.equals(that.tappend)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_table = true && (isSetTable()); + list.add(present_table); + if (present_table) + list.add(table); + + boolean present_tappend = true && (isSetTappend()); + list.add(present_tappend); + if (present_tappend) + list.add(tappend); + + return list.hashCode(); + } + + @Override + public int compareTo(append_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetTable()).compareTo(other.isSetTable()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTable()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.table, other.table); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetTappend()).compareTo(other.isSetTappend()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTappend()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tappend, other.tappend); + 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("append_args("); + boolean first = true; + + sb.append("table:"); + if (this.table == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.table, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("tappend:"); + if (this.tappend == null) { + sb.append("null"); + } else { + sb.append(this.tappend); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (table == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'table' was not present! Struct: " + toString()); + } + if (tappend == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'tappend' was not present! Struct: " + toString()); + } + // check for sub-struct validity + if (tappend != null) { + tappend.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 append_argsStandardSchemeFactory implements SchemeFactory { + public append_argsStandardScheme getScheme() { + return new append_argsStandardScheme(); + } + } + + private static class append_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, append_args 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 + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.table = iprot.readBinary(); + struct.setTableIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // TAPPEND + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.tappend = new TAppend(); + struct.tappend.read(iprot); + struct.setTappendIsSet(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, append_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.table != null) { + oprot.writeFieldBegin(TABLE_FIELD_DESC); + oprot.writeBinary(struct.table); + oprot.writeFieldEnd(); + } + if (struct.tappend != null) { + oprot.writeFieldBegin(TAPPEND_FIELD_DESC); + struct.tappend.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class append_argsTupleSchemeFactory implements SchemeFactory { + public append_argsTupleScheme getScheme() { + return new append_argsTupleScheme(); + } + } + + private static class append_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, append_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeBinary(struct.table); + struct.tappend.write(oprot); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, append_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.table = iprot.readBinary(); + struct.setTableIsSet(true); + struct.tappend = new TAppend(); + struct.tappend.read(iprot); + struct.setTappendIsSet(true); + } + } + + } + + public static class append_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("append_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); + private static final org.apache.thrift.protocol.TField IO_FIELD_DESC = new org.apache.thrift.protocol.TField("io", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new append_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new append_resultTupleSchemeFactory()); + } + + public TResult success; // required + public TIOError io; // 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 { + SUCCESS((short)0, "success"), + IO((short)1, "io"); + + private static final Map byName = new HashMap(); + + 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 0: // SUCCESS + return SUCCESS; + case 1: // IO + return IO; + 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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TResult.class))); + tmpMap.put(_Fields.IO, new org.apache.thrift.meta_data.FieldMetaData("io", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(append_result.class, metaDataMap); + } + + public append_result() { + } + + public append_result( + TResult success, + TIOError io) + { + this(); + this.success = success; + this.io = io; + } + + /** + * Performs a deep copy on other. + */ + public append_result(append_result other) { + if (other.isSetSuccess()) { + this.success = new TResult(other.success); + } + if (other.isSetIo()) { + this.io = new TIOError(other.io); + } + } + + public append_result deepCopy() { + return new append_result(this); + } + + @Override + public void clear() { + this.success = null; + this.io = null; + } + + public TResult getSuccess() { + return this.success; + } + + public append_result setSuccess(TResult success) { + this.success = success; + return this; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public TIOError getIo() { + return this.io; + } + + public append_result setIo(TIOError io) { + this.io = io; + return this; + } + + public void unsetIo() { + this.io = null; + } + + /** Returns true if field io is set (has been assigned a value) and false otherwise */ + public boolean isSetIo() { + return this.io != null; + } + + public void setIoIsSet(boolean value) { + if (!value) { + this.io = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((TResult)value); + } + break; + + case IO: + if (value == null) { + unsetIo(); + } else { + setIo((TIOError)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + case IO: + return getIo(); + + } + 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 SUCCESS: + return isSetSuccess(); + case IO: + return isSetIo(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof append_result) + return this.equals((append_result)that); + return false; + } + + public boolean equals(append_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + boolean this_present_io = true && this.isSetIo(); + boolean that_present_io = true && that.isSetIo(); + if (this_present_io || that_present_io) { + if (!(this_present_io && that_present_io)) + return false; + if (!this.io.equals(that.io)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + boolean present_io = true && (isSetIo()); + list.add(present_io); + if (present_io) + list.add(io); + + return list.hashCode(); + } + + @Override + public int compareTo(append_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIo()).compareTo(other.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, other.io); + 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("append_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + if (!first) sb.append(", "); + sb.append("io:"); + if (this.io == null) { + sb.append("null"); + } else { + sb.append(this.io); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + if (success != null) { + success.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 append_resultStandardSchemeFactory implements SchemeFactory { + public append_resultStandardScheme getScheme() { + return new append_resultStandardScheme(); + } + } + + private static class append_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, append_result 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 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.success = new TResult(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IO + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.io = new TIOError(); + struct.io.read(iprot); + struct.setIoIsSet(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, append_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + struct.success.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.io != null) { + oprot.writeFieldBegin(IO_FIELD_DESC); + struct.io.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class append_resultTupleSchemeFactory implements SchemeFactory { + public append_resultTupleScheme getScheme() { + return new append_resultTupleScheme(); + } + } + + private static class append_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, append_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIo()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + struct.success.write(oprot); + } + if (struct.isSetIo()) { + struct.io.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, append_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.success = new TResult(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.io = new TIOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } + } + } + + } + + public static class openScanner_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("openScanner_args"); + + private static final org.apache.thrift.protocol.TField TABLE_FIELD_DESC = new org.apache.thrift.protocol.TField("table", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField TSCAN_FIELD_DESC = new org.apache.thrift.protocol.TField("tscan", org.apache.thrift.protocol.TType.STRUCT, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new openScanner_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new openScanner_argsTupleSchemeFactory()); + } + + /** + * the table to get the Scanner for + */ + public ByteBuffer table; // required + /** + * the scan object to get a Scanner for + */ + public TScan tscan; // 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 { + /** + * the table to get the Scanner for + */ + TABLE((short)1, "table"), + /** + * the scan object to get a Scanner for + */ + TSCAN((short)2, "tscan"); + + private static final Map byName = new HashMap(); + + 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 + return TABLE; + case 2: // TSCAN + return TSCAN; + 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.TABLE, new org.apache.thrift.meta_data.FieldMetaData("table", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + tmpMap.put(_Fields.TSCAN, new org.apache.thrift.meta_data.FieldMetaData("tscan", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TScan.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(openScanner_args.class, metaDataMap); + } + + public openScanner_args() { + } + + public openScanner_args( + ByteBuffer table, + TScan tscan) + { + this(); + this.table = org.apache.thrift.TBaseHelper.copyBinary(table); + this.tscan = tscan; + } + + /** + * Performs a deep copy on other. + */ + public openScanner_args(openScanner_args other) { + if (other.isSetTable()) { + this.table = org.apache.thrift.TBaseHelper.copyBinary(other.table); + } + if (other.isSetTscan()) { + this.tscan = new TScan(other.tscan); + } + } + + public openScanner_args deepCopy() { + return new openScanner_args(this); + } + + @Override + public void clear() { + this.table = null; + this.tscan = null; + } + + /** + * the table to get the Scanner for + */ + public byte[] getTable() { + setTable(org.apache.thrift.TBaseHelper.rightSize(table)); + return table == null ? null : table.array(); + } + + public ByteBuffer bufferForTable() { + return org.apache.thrift.TBaseHelper.copyBinary(table); + } + + /** + * the table to get the Scanner for + */ + public openScanner_args setTable(byte[] table) { + this.table = table == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(table, table.length)); + return this; + } + + public openScanner_args setTable(ByteBuffer table) { + this.table = org.apache.thrift.TBaseHelper.copyBinary(table); + return this; + } + + public void unsetTable() { + this.table = null; + } + + /** Returns true if field table is set (has been assigned a value) and false otherwise */ + public boolean isSetTable() { + return this.table != null; + } + + public void setTableIsSet(boolean value) { + if (!value) { + this.table = null; + } + } + + /** + * the scan object to get a Scanner for + */ + public TScan getTscan() { + return this.tscan; + } + + /** + * the scan object to get a Scanner for + */ + public openScanner_args setTscan(TScan tscan) { + this.tscan = tscan; + return this; + } + + public void unsetTscan() { + this.tscan = null; + } + + /** Returns true if field tscan is set (has been assigned a value) and false otherwise */ + public boolean isSetTscan() { + return this.tscan != null; + } + + public void setTscanIsSet(boolean value) { + if (!value) { + this.tscan = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case TABLE: + if (value == null) { + unsetTable(); + } else { + setTable((ByteBuffer)value); + } + break; + + case TSCAN: + if (value == null) { + unsetTscan(); + } else { + setTscan((TScan)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case TABLE: + return getTable(); + + case TSCAN: + return getTscan(); + + } + 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: + return isSetTable(); + case TSCAN: + return isSetTscan(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof openScanner_args) + return this.equals((openScanner_args)that); + return false; + } + + public boolean equals(openScanner_args that) { + if (that == null) + return false; + + boolean this_present_table = true && this.isSetTable(); + boolean that_present_table = true && that.isSetTable(); + if (this_present_table || that_present_table) { + if (!(this_present_table && that_present_table)) + return false; + if (!this.table.equals(that.table)) + return false; + } + + boolean this_present_tscan = true && this.isSetTscan(); + boolean that_present_tscan = true && that.isSetTscan(); + if (this_present_tscan || that_present_tscan) { + if (!(this_present_tscan && that_present_tscan)) + return false; + if (!this.tscan.equals(that.tscan)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_table = true && (isSetTable()); + list.add(present_table); + if (present_table) + list.add(table); + + boolean present_tscan = true && (isSetTscan()); + list.add(present_tscan); + if (present_tscan) + list.add(tscan); + + return list.hashCode(); + } + + @Override + public int compareTo(openScanner_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetTable()).compareTo(other.isSetTable()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTable()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.table, other.table); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetTscan()).compareTo(other.isSetTscan()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTscan()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tscan, other.tscan); + 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("openScanner_args("); + boolean first = true; + + sb.append("table:"); + if (this.table == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.table, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("tscan:"); + if (this.tscan == null) { + sb.append("null"); + } else { + sb.append(this.tscan); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (table == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'table' was not present! Struct: " + toString()); + } + if (tscan == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'tscan' was not present! Struct: " + toString()); + } + // check for sub-struct validity + if (tscan != null) { + tscan.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 openScanner_argsStandardSchemeFactory implements SchemeFactory { + public openScanner_argsStandardScheme getScheme() { + return new openScanner_argsStandardScheme(); + } + } + + private static class openScanner_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, openScanner_args 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 + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.table = iprot.readBinary(); + struct.setTableIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // TSCAN + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.tscan = new TScan(); + struct.tscan.read(iprot); + struct.setTscanIsSet(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, openScanner_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.table != null) { + oprot.writeFieldBegin(TABLE_FIELD_DESC); + oprot.writeBinary(struct.table); + oprot.writeFieldEnd(); + } + if (struct.tscan != null) { + oprot.writeFieldBegin(TSCAN_FIELD_DESC); + struct.tscan.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class openScanner_argsTupleSchemeFactory implements SchemeFactory { + public openScanner_argsTupleScheme getScheme() { + return new openScanner_argsTupleScheme(); + } + } + + private static class openScanner_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, openScanner_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeBinary(struct.table); + struct.tscan.write(oprot); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, openScanner_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.table = iprot.readBinary(); + struct.setTableIsSet(true); + struct.tscan = new TScan(); + struct.tscan.read(iprot); + struct.setTscanIsSet(true); + } + } + + } + + public static class openScanner_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("openScanner_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I32, (short)0); + private static final org.apache.thrift.protocol.TField IO_FIELD_DESC = new org.apache.thrift.protocol.TField("io", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new openScanner_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new openScanner_resultTupleSchemeFactory()); + } + + public int success; // required + public TIOError io; // 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 { + SUCCESS((short)0, "success"), + IO((short)1, "io"); + + private static final Map byName = new HashMap(); + + 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 0: // SUCCESS + return SUCCESS; + case 1: // IO + return IO; + 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 int __SUCCESS_ISSET_ID = 0; + private byte __isset_bitfield = 0; + 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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.IO, new org.apache.thrift.meta_data.FieldMetaData("io", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(openScanner_result.class, metaDataMap); + } + + public openScanner_result() { + } + + public openScanner_result( + int success, + TIOError io) + { + this(); + this.success = success; + setSuccessIsSet(true); + this.io = io; + } + + /** + * Performs a deep copy on other. + */ + public openScanner_result(openScanner_result other) { + __isset_bitfield = other.__isset_bitfield; + this.success = other.success; + if (other.isSetIo()) { + this.io = new TIOError(other.io); + } + } + + public openScanner_result deepCopy() { + return new openScanner_result(this); + } + + @Override + public void clear() { + setSuccessIsSet(false); + this.success = 0; + this.io = null; + } + + public int getSuccess() { + return this.success; + } + + public openScanner_result setSuccess(int success) { + this.success = success; + setSuccessIsSet(true); + return this; + } + + public void unsetSuccess() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + public void setSuccessIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); + } + + public TIOError getIo() { + return this.io; + } + + public openScanner_result setIo(TIOError io) { + this.io = io; + return this; + } + + public void unsetIo() { + this.io = null; + } + + /** Returns true if field io is set (has been assigned a value) and false otherwise */ + public boolean isSetIo() { + return this.io != null; + } + + public void setIoIsSet(boolean value) { + if (!value) { + this.io = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((Integer)value); + } + break; + + case IO: + if (value == null) { + unsetIo(); + } else { + setIo((TIOError)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + case IO: + return getIo(); + + } + 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 SUCCESS: + return isSetSuccess(); + case IO: + return isSetIo(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof openScanner_result) + return this.equals((openScanner_result)that); + return false; + } + + public boolean equals(openScanner_result that) { + if (that == null) + return false; + + boolean this_present_success = true; + boolean that_present_success = true; + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (this.success != that.success) + return false; + } + + boolean this_present_io = true && this.isSetIo(); + boolean that_present_io = true && that.isSetIo(); + if (this_present_io || that_present_io) { + if (!(this_present_io && that_present_io)) + return false; + if (!this.io.equals(that.io)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true; + list.add(present_success); + if (present_success) + list.add(success); + + boolean present_io = true && (isSetIo()); + list.add(present_io); + if (present_io) + list.add(io); + + return list.hashCode(); + } + + @Override + public int compareTo(openScanner_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIo()).compareTo(other.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, other.io); + 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("openScanner_result("); + boolean first = true; + + sb.append("success:"); + sb.append(this.success); + first = false; + if (!first) sb.append(", "); + sb.append("io:"); + if (this.io == null) { + sb.append("null"); + } else { + sb.append(this.io); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 { + // 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); + } + } + + private static class openScanner_resultStandardSchemeFactory implements SchemeFactory { + public openScanner_resultStandardScheme getScheme() { + return new openScanner_resultStandardScheme(); + } + } + + private static class openScanner_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, openScanner_result 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 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.success = iprot.readI32(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IO + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.io = new TIOError(); + struct.io.read(iprot); + struct.setIoIsSet(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, openScanner_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeI32(struct.success); + oprot.writeFieldEnd(); + } + if (struct.io != null) { + oprot.writeFieldBegin(IO_FIELD_DESC); + struct.io.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class openScanner_resultTupleSchemeFactory implements SchemeFactory { + public openScanner_resultTupleScheme getScheme() { + return new openScanner_resultTupleScheme(); + } + } + + private static class openScanner_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, openScanner_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIo()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + oprot.writeI32(struct.success); + } + if (struct.isSetIo()) { + struct.io.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, openScanner_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.success = iprot.readI32(); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.io = new TIOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } + } + } + + } + + public static class getScannerRows_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getScannerRows_args"); + + private static final org.apache.thrift.protocol.TField SCANNER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("scannerId", org.apache.thrift.protocol.TType.I32, (short)1); + private static final org.apache.thrift.protocol.TField NUM_ROWS_FIELD_DESC = new org.apache.thrift.protocol.TField("numRows", org.apache.thrift.protocol.TType.I32, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getScannerRows_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getScannerRows_argsTupleSchemeFactory()); + } + + /** + * the Id of the Scanner to return rows from. This is an Id returned from the openScanner function. + */ + public int scannerId; // required + /** + * number of rows to return + */ + public int numRows; // 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 { + /** + * the Id of the Scanner to return rows from. This is an Id returned from the openScanner function. + */ + SCANNER_ID((short)1, "scannerId"), + /** + * number of rows to return + */ + NUM_ROWS((short)2, "numRows"); + + private static final Map byName = new HashMap(); + + 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: // SCANNER_ID + return SCANNER_ID; + case 2: // NUM_ROWS + return NUM_ROWS; + 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 int __SCANNERID_ISSET_ID = 0; + private static final int __NUMROWS_ISSET_ID = 1; + private byte __isset_bitfield = 0; + 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.SCANNER_ID, new org.apache.thrift.meta_data.FieldMetaData("scannerId", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.NUM_ROWS, new org.apache.thrift.meta_data.FieldMetaData("numRows", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getScannerRows_args.class, metaDataMap); + } + + public getScannerRows_args() { + this.numRows = 1; + + } + + public getScannerRows_args( + int scannerId, + int numRows) + { + this(); + this.scannerId = scannerId; + setScannerIdIsSet(true); + this.numRows = numRows; + setNumRowsIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public getScannerRows_args(getScannerRows_args other) { + __isset_bitfield = other.__isset_bitfield; + this.scannerId = other.scannerId; + this.numRows = other.numRows; + } + + public getScannerRows_args deepCopy() { + return new getScannerRows_args(this); + } + + @Override + public void clear() { + setScannerIdIsSet(false); + this.scannerId = 0; + this.numRows = 1; + + } + + /** + * the Id of the Scanner to return rows from. This is an Id returned from the openScanner function. + */ + public int getScannerId() { + return this.scannerId; + } + + /** + * the Id of the Scanner to return rows from. This is an Id returned from the openScanner function. + */ + public getScannerRows_args setScannerId(int scannerId) { + this.scannerId = scannerId; + setScannerIdIsSet(true); + return this; + } + + public void unsetScannerId() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SCANNERID_ISSET_ID); + } + + /** Returns true if field scannerId is set (has been assigned a value) and false otherwise */ + public boolean isSetScannerId() { + return EncodingUtils.testBit(__isset_bitfield, __SCANNERID_ISSET_ID); + } + + public void setScannerIdIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SCANNERID_ISSET_ID, value); + } + + /** + * number of rows to return + */ + public int getNumRows() { + return this.numRows; + } + + /** + * number of rows to return + */ + public getScannerRows_args setNumRows(int numRows) { + this.numRows = numRows; + setNumRowsIsSet(true); + return this; + } + + public void unsetNumRows() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __NUMROWS_ISSET_ID); + } + + /** Returns true if field numRows is set (has been assigned a value) and false otherwise */ + public boolean isSetNumRows() { + return EncodingUtils.testBit(__isset_bitfield, __NUMROWS_ISSET_ID); + } + + public void setNumRowsIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __NUMROWS_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SCANNER_ID: + if (value == null) { + unsetScannerId(); + } else { + setScannerId((Integer)value); + } + break; + + case NUM_ROWS: + if (value == null) { + unsetNumRows(); + } else { + setNumRows((Integer)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SCANNER_ID: + return getScannerId(); + + case NUM_ROWS: + return getNumRows(); + + } + 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 SCANNER_ID: + return isSetScannerId(); + case NUM_ROWS: + return isSetNumRows(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getScannerRows_args) + return this.equals((getScannerRows_args)that); + return false; + } + + public boolean equals(getScannerRows_args that) { + if (that == null) + return false; + + boolean this_present_scannerId = true; + boolean that_present_scannerId = true; + if (this_present_scannerId || that_present_scannerId) { + if (!(this_present_scannerId && that_present_scannerId)) + return false; + if (this.scannerId != that.scannerId) + return false; + } + + boolean this_present_numRows = true; + boolean that_present_numRows = true; + if (this_present_numRows || that_present_numRows) { + if (!(this_present_numRows && that_present_numRows)) + return false; + if (this.numRows != that.numRows) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_scannerId = true; + list.add(present_scannerId); + if (present_scannerId) + list.add(scannerId); + + boolean present_numRows = true; + list.add(present_numRows); + if (present_numRows) + list.add(numRows); + + return list.hashCode(); + } + + @Override + public int compareTo(getScannerRows_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetScannerId()).compareTo(other.isSetScannerId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetScannerId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.scannerId, other.scannerId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetNumRows()).compareTo(other.isSetNumRows()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetNumRows()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.numRows, other.numRows); + 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("getScannerRows_args("); + boolean first = true; + + sb.append("scannerId:"); + sb.append(this.scannerId); + first = false; + if (!first) sb.append(", "); + sb.append("numRows:"); + sb.append(this.numRows); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // alas, we cannot check 'scannerId' because it's a primitive and you chose the non-beans generator. + // 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 { + // 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); + } + } + + private static class getScannerRows_argsStandardSchemeFactory implements SchemeFactory { + public getScannerRows_argsStandardScheme getScheme() { + return new getScannerRows_argsStandardScheme(); + } + } + + private static class getScannerRows_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getScannerRows_args 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: // SCANNER_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.scannerId = iprot.readI32(); + struct.setScannerIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // NUM_ROWS + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.numRows = iprot.readI32(); + struct.setNumRowsIsSet(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 + if (!struct.isSetScannerId()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'scannerId' was not found in serialized data! Struct: " + toString()); + } + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, getScannerRows_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(SCANNER_ID_FIELD_DESC); + oprot.writeI32(struct.scannerId); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(NUM_ROWS_FIELD_DESC); + oprot.writeI32(struct.numRows); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getScannerRows_argsTupleSchemeFactory implements SchemeFactory { + public getScannerRows_argsTupleScheme getScheme() { + return new getScannerRows_argsTupleScheme(); + } + } + + private static class getScannerRows_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getScannerRows_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeI32(struct.scannerId); + BitSet optionals = new BitSet(); + if (struct.isSetNumRows()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetNumRows()) { + oprot.writeI32(struct.numRows); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getScannerRows_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.scannerId = iprot.readI32(); + struct.setScannerIdIsSet(true); + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.numRows = iprot.readI32(); + struct.setNumRowsIsSet(true); + } + } + } + + } + + public static class getScannerRows_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getScannerRows_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0); + private static final org.apache.thrift.protocol.TField IO_FIELD_DESC = new org.apache.thrift.protocol.TField("io", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final org.apache.thrift.protocol.TField IA_FIELD_DESC = new org.apache.thrift.protocol.TField("ia", org.apache.thrift.protocol.TType.STRUCT, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getScannerRows_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getScannerRows_resultTupleSchemeFactory()); + } + + public List success; // required + public TIOError io; // required + /** + * if the scannerId is invalid + */ + public TIllegalArgument ia; // 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 { + SUCCESS((short)0, "success"), + IO((short)1, "io"), + /** + * if the scannerId is invalid + */ + IA((short)2, "ia"); + + private static final Map byName = new HashMap(); + + 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 0: // SUCCESS + return SUCCESS; + case 1: // IO + return IO; + case 2: // IA + return IA; + 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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + 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, TResult.class)))); + tmpMap.put(_Fields.IO, new org.apache.thrift.meta_data.FieldMetaData("io", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + tmpMap.put(_Fields.IA, new org.apache.thrift.meta_data.FieldMetaData("ia", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getScannerRows_result.class, metaDataMap); + } + + public getScannerRows_result() { + } + + public getScannerRows_result( + List success, + TIOError io, + TIllegalArgument ia) + { + this(); + this.success = success; + this.io = io; + this.ia = ia; + } + + /** + * Performs a deep copy on other. + */ + public getScannerRows_result(getScannerRows_result other) { + if (other.isSetSuccess()) { + List __this__success = new ArrayList(other.success.size()); + for (TResult other_element : other.success) { + __this__success.add(new TResult(other_element)); + } + this.success = __this__success; + } + if (other.isSetIo()) { + this.io = new TIOError(other.io); + } + if (other.isSetIa()) { + this.ia = new TIllegalArgument(other.ia); + } + } + + public getScannerRows_result deepCopy() { + return new getScannerRows_result(this); + } + + @Override + public void clear() { + this.success = null; + this.io = null; + this.ia = null; + } + + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + public java.util.Iterator getSuccessIterator() { + return (this.success == null) ? null : this.success.iterator(); + } + + public void addToSuccess(TResult elem) { + if (this.success == null) { + this.success = new ArrayList(); + } + this.success.add(elem); + } + + public List getSuccess() { + return this.success; + } + + public getScannerRows_result setSuccess(List success) { + this.success = success; + return this; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public TIOError getIo() { + return this.io; + } + + public getScannerRows_result setIo(TIOError io) { + this.io = io; + return this; + } + + public void unsetIo() { + this.io = null; + } + + /** Returns true if field io is set (has been assigned a value) and false otherwise */ + public boolean isSetIo() { + return this.io != null; + } + + public void setIoIsSet(boolean value) { + if (!value) { + this.io = null; + } + } + + /** + * if the scannerId is invalid + */ + public TIllegalArgument getIa() { + return this.ia; + } + + /** + * if the scannerId is invalid + */ + public getScannerRows_result setIa(TIllegalArgument ia) { + this.ia = ia; + return this; + } + + public void unsetIa() { + this.ia = null; + } + + /** Returns true if field ia is set (has been assigned a value) and false otherwise */ + public boolean isSetIa() { + return this.ia != null; + } + + public void setIaIsSet(boolean value) { + if (!value) { + this.ia = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((List)value); + } + break; + + case IO: + if (value == null) { + unsetIo(); + } else { + setIo((TIOError)value); + } + break; + + case IA: + if (value == null) { + unsetIa(); + } else { + setIa((TIllegalArgument)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + case IO: + return getIo(); + + case IA: + return getIa(); + + } + 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 SUCCESS: + return isSetSuccess(); + case IO: + return isSetIo(); + case IA: + return isSetIa(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getScannerRows_result) + return this.equals((getScannerRows_result)that); + return false; + } + + public boolean equals(getScannerRows_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + boolean this_present_io = true && this.isSetIo(); + boolean that_present_io = true && that.isSetIo(); + if (this_present_io || that_present_io) { + if (!(this_present_io && that_present_io)) + return false; + if (!this.io.equals(that.io)) + return false; + } + + boolean this_present_ia = true && this.isSetIa(); + boolean that_present_ia = true && that.isSetIa(); + if (this_present_ia || that_present_ia) { + if (!(this_present_ia && that_present_ia)) + return false; + if (!this.ia.equals(that.ia)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + boolean present_io = true && (isSetIo()); + list.add(present_io); + if (present_io) + list.add(io); + + boolean present_ia = true && (isSetIa()); + list.add(present_ia); + if (present_ia) + list.add(ia); + + return list.hashCode(); + } + + @Override + public int compareTo(getScannerRows_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIo()).compareTo(other.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, other.io); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIa()).compareTo(other.isSetIa()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIa()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ia, other.ia); + 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("getScannerRows_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + if (!first) sb.append(", "); + sb.append("io:"); + if (this.io == null) { + sb.append("null"); + } else { + sb.append(this.io); + } + first = false; + if (!first) sb.append(", "); + sb.append("ia:"); + if (this.ia == null) { + sb.append("null"); + } else { + sb.append(this.ia); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 getScannerRows_resultStandardSchemeFactory implements SchemeFactory { + public getScannerRows_resultStandardScheme getScheme() { + return new getScannerRows_resultStandardScheme(); + } + } + + private static class getScannerRows_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getScannerRows_result 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 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list172 = iprot.readListBegin(); + struct.success = new ArrayList(_list172.size); + TResult _elem173; + for (int _i174 = 0; _i174 < _list172.size; ++_i174) + { + _elem173 = new TResult(); + _elem173.read(iprot); + struct.success.add(_elem173); + } + iprot.readListEnd(); + } + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IO + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.io = new TIOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // IA + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ia = new TIllegalArgument(); + struct.ia.read(iprot); + struct.setIaIsSet(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, getScannerRows_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); + for (TResult _iter175 : struct.success) + { + _iter175.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.io != null) { + oprot.writeFieldBegin(IO_FIELD_DESC); + struct.io.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.ia != null) { + oprot.writeFieldBegin(IA_FIELD_DESC); + struct.ia.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getScannerRows_resultTupleSchemeFactory implements SchemeFactory { + public getScannerRows_resultTupleScheme getScheme() { + return new getScannerRows_resultTupleScheme(); + } + } + + private static class getScannerRows_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getScannerRows_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIo()) { + optionals.set(1); + } + if (struct.isSetIa()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetSuccess()) { + { + oprot.writeI32(struct.success.size()); + for (TResult _iter176 : struct.success) + { + _iter176.write(oprot); + } + } + } + if (struct.isSetIo()) { + struct.io.write(oprot); + } + if (struct.isSetIa()) { + struct.ia.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getScannerRows_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list177 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new ArrayList(_list177.size); + TResult _elem178; + for (int _i179 = 0; _i179 < _list177.size; ++_i179) + { + _elem178 = new TResult(); + _elem178.read(iprot); + struct.success.add(_elem178); + } + } + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.io = new TIOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } + if (incoming.get(2)) { + struct.ia = new TIllegalArgument(); + struct.ia.read(iprot); + struct.setIaIsSet(true); + } + } + } + + } + + public static class closeScanner_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("closeScanner_args"); + + private static final org.apache.thrift.protocol.TField SCANNER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("scannerId", org.apache.thrift.protocol.TType.I32, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new closeScanner_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new closeScanner_argsTupleSchemeFactory()); + } + + /** + * the Id of the Scanner to close * + */ + public int scannerId; // 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 { + /** + * the Id of the Scanner to close * + */ + SCANNER_ID((short)1, "scannerId"); + + private static final Map byName = new HashMap(); + + 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: // SCANNER_ID + return SCANNER_ID; + 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 int __SCANNERID_ISSET_ID = 0; + private byte __isset_bitfield = 0; + 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.SCANNER_ID, new org.apache.thrift.meta_data.FieldMetaData("scannerId", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(closeScanner_args.class, metaDataMap); + } + + public closeScanner_args() { + } + + public closeScanner_args( + int scannerId) + { + this(); + this.scannerId = scannerId; + setScannerIdIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public closeScanner_args(closeScanner_args other) { + __isset_bitfield = other.__isset_bitfield; + this.scannerId = other.scannerId; + } + + public closeScanner_args deepCopy() { + return new closeScanner_args(this); + } + + @Override + public void clear() { + setScannerIdIsSet(false); + this.scannerId = 0; + } + + /** + * the Id of the Scanner to close * + */ + public int getScannerId() { + return this.scannerId; + } + + /** + * the Id of the Scanner to close * + */ + public closeScanner_args setScannerId(int scannerId) { + this.scannerId = scannerId; + setScannerIdIsSet(true); + return this; + } + + public void unsetScannerId() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SCANNERID_ISSET_ID); + } + + /** Returns true if field scannerId is set (has been assigned a value) and false otherwise */ + public boolean isSetScannerId() { + return EncodingUtils.testBit(__isset_bitfield, __SCANNERID_ISSET_ID); + } + + public void setScannerIdIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SCANNERID_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SCANNER_ID: + if (value == null) { + unsetScannerId(); + } else { + setScannerId((Integer)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SCANNER_ID: + return getScannerId(); + + } + 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 SCANNER_ID: + return isSetScannerId(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof closeScanner_args) + return this.equals((closeScanner_args)that); + return false; + } + + public boolean equals(closeScanner_args that) { + if (that == null) + return false; + + boolean this_present_scannerId = true; + boolean that_present_scannerId = true; + if (this_present_scannerId || that_present_scannerId) { + if (!(this_present_scannerId && that_present_scannerId)) + return false; + if (this.scannerId != that.scannerId) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_scannerId = true; + list.add(present_scannerId); + if (present_scannerId) + list.add(scannerId); + + return list.hashCode(); + } + + @Override + public int compareTo(closeScanner_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetScannerId()).compareTo(other.isSetScannerId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetScannerId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.scannerId, other.scannerId); + 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("closeScanner_args("); + boolean first = true; + + sb.append("scannerId:"); + sb.append(this.scannerId); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // alas, we cannot check 'scannerId' because it's a primitive and you chose the non-beans generator. + // 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 { + // 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); + } + } + + private static class closeScanner_argsStandardSchemeFactory implements SchemeFactory { + public closeScanner_argsStandardScheme getScheme() { + return new closeScanner_argsStandardScheme(); + } + } + + private static class closeScanner_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, closeScanner_args 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: // SCANNER_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.scannerId = iprot.readI32(); + struct.setScannerIdIsSet(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 + if (!struct.isSetScannerId()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'scannerId' was not found in serialized data! Struct: " + toString()); + } + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, closeScanner_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(SCANNER_ID_FIELD_DESC); + oprot.writeI32(struct.scannerId); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class closeScanner_argsTupleSchemeFactory implements SchemeFactory { + public closeScanner_argsTupleScheme getScheme() { + return new closeScanner_argsTupleScheme(); + } + } + + private static class closeScanner_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, closeScanner_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeI32(struct.scannerId); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, closeScanner_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.scannerId = iprot.readI32(); + struct.setScannerIdIsSet(true); + } + } + + } + + public static class closeScanner_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("closeScanner_result"); + + private static final org.apache.thrift.protocol.TField IO_FIELD_DESC = new org.apache.thrift.protocol.TField("io", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final org.apache.thrift.protocol.TField IA_FIELD_DESC = new org.apache.thrift.protocol.TField("ia", org.apache.thrift.protocol.TType.STRUCT, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new closeScanner_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new closeScanner_resultTupleSchemeFactory()); + } + + public TIOError io; // required + /** + * if the scannerId is invalid + */ + public TIllegalArgument ia; // 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 { + IO((short)1, "io"), + /** + * if the scannerId is invalid + */ + IA((short)2, "ia"); + + private static final Map byName = new HashMap(); + + 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: // IO + return IO; + case 2: // IA + return IA; + 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.IO, new org.apache.thrift.meta_data.FieldMetaData("io", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + tmpMap.put(_Fields.IA, new org.apache.thrift.meta_data.FieldMetaData("ia", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(closeScanner_result.class, metaDataMap); + } + + public closeScanner_result() { + } + + public closeScanner_result( + TIOError io, + TIllegalArgument ia) + { + this(); + this.io = io; + this.ia = ia; + } + + /** + * Performs a deep copy on other. + */ + public closeScanner_result(closeScanner_result other) { + if (other.isSetIo()) { + this.io = new TIOError(other.io); + } + if (other.isSetIa()) { + this.ia = new TIllegalArgument(other.ia); + } + } + + public closeScanner_result deepCopy() { + return new closeScanner_result(this); + } + + @Override + public void clear() { + this.io = null; + this.ia = null; + } + + public TIOError getIo() { + return this.io; + } + + public closeScanner_result setIo(TIOError io) { + this.io = io; + return this; + } + + public void unsetIo() { + this.io = null; + } + + /** Returns true if field io is set (has been assigned a value) and false otherwise */ + public boolean isSetIo() { + return this.io != null; + } + + public void setIoIsSet(boolean value) { + if (!value) { + this.io = null; + } + } + + /** + * if the scannerId is invalid + */ + public TIllegalArgument getIa() { + return this.ia; + } + + /** + * if the scannerId is invalid + */ + public closeScanner_result setIa(TIllegalArgument ia) { + this.ia = ia; + return this; + } + + public void unsetIa() { + this.ia = null; + } + + /** Returns true if field ia is set (has been assigned a value) and false otherwise */ + public boolean isSetIa() { + return this.ia != null; + } + + public void setIaIsSet(boolean value) { + if (!value) { + this.ia = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case IO: + if (value == null) { + unsetIo(); + } else { + setIo((TIOError)value); + } + break; + + case IA: + if (value == null) { + unsetIa(); + } else { + setIa((TIllegalArgument)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case IO: + return getIo(); + + case IA: + return getIa(); + + } + 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 IO: + return isSetIo(); + case IA: + return isSetIa(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof closeScanner_result) + return this.equals((closeScanner_result)that); + return false; + } + + public boolean equals(closeScanner_result that) { + if (that == null) + return false; + + boolean this_present_io = true && this.isSetIo(); + boolean that_present_io = true && that.isSetIo(); + if (this_present_io || that_present_io) { + if (!(this_present_io && that_present_io)) + return false; + if (!this.io.equals(that.io)) + return false; + } + + boolean this_present_ia = true && this.isSetIa(); + boolean that_present_ia = true && that.isSetIa(); + if (this_present_ia || that_present_ia) { + if (!(this_present_ia && that_present_ia)) + return false; + if (!this.ia.equals(that.ia)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_io = true && (isSetIo()); + list.add(present_io); + if (present_io) + list.add(io); + + boolean present_ia = true && (isSetIa()); + list.add(present_ia); + if (present_ia) + list.add(ia); + + return list.hashCode(); + } + + @Override + public int compareTo(closeScanner_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetIo()).compareTo(other.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, other.io); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIa()).compareTo(other.isSetIa()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIa()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ia, other.ia); + 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("closeScanner_result("); + boolean first = true; + + sb.append("io:"); + if (this.io == null) { + sb.append("null"); + } else { + sb.append(this.io); + } + first = false; + if (!first) sb.append(", "); + sb.append("ia:"); + if (this.ia == null) { + sb.append("null"); + } else { + sb.append(this.ia); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 closeScanner_resultStandardSchemeFactory implements SchemeFactory { + public closeScanner_resultStandardScheme getScheme() { + return new closeScanner_resultStandardScheme(); + } + } + + private static class closeScanner_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, closeScanner_result 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: // IO + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.io = new TIOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // IA + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ia = new TIllegalArgument(); + struct.ia.read(iprot); + struct.setIaIsSet(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, closeScanner_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.io != null) { + oprot.writeFieldBegin(IO_FIELD_DESC); + struct.io.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.ia != null) { + oprot.writeFieldBegin(IA_FIELD_DESC); + struct.ia.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class closeScanner_resultTupleSchemeFactory implements SchemeFactory { + public closeScanner_resultTupleScheme getScheme() { + return new closeScanner_resultTupleScheme(); + } + } + + private static class closeScanner_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, closeScanner_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetIo()) { + optionals.set(0); + } + if (struct.isSetIa()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetIo()) { + struct.io.write(oprot); + } + if (struct.isSetIa()) { + struct.ia.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, closeScanner_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.io = new TIOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } + if (incoming.get(1)) { + struct.ia = new TIllegalArgument(); + struct.ia.read(iprot); + struct.setIaIsSet(true); + } + } + } + + } + + public static class mutateRow_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("mutateRow_args"); + + private static final org.apache.thrift.protocol.TField TABLE_FIELD_DESC = new org.apache.thrift.protocol.TField("table", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField TROW_MUTATIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("trowMutations", org.apache.thrift.protocol.TType.STRUCT, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new mutateRow_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new mutateRow_argsTupleSchemeFactory()); + } + + /** + * table to apply the mutations + */ + public ByteBuffer table; // required + /** + * mutations to apply + */ + public TRowMutations trowMutations; // 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 { + /** + * table to apply the mutations + */ + TABLE((short)1, "table"), + /** + * mutations to apply + */ + TROW_MUTATIONS((short)2, "trowMutations"); + + private static final Map byName = new HashMap(); + + 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 + return TABLE; + case 2: // TROW_MUTATIONS + return TROW_MUTATIONS; + 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.TABLE, new org.apache.thrift.meta_data.FieldMetaData("table", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + tmpMap.put(_Fields.TROW_MUTATIONS, new org.apache.thrift.meta_data.FieldMetaData("trowMutations", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TRowMutations.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(mutateRow_args.class, metaDataMap); + } + + public mutateRow_args() { + } + + public mutateRow_args( + ByteBuffer table, + TRowMutations trowMutations) + { + this(); + this.table = org.apache.thrift.TBaseHelper.copyBinary(table); + this.trowMutations = trowMutations; + } + + /** + * Performs a deep copy on other. + */ + public mutateRow_args(mutateRow_args other) { + if (other.isSetTable()) { + this.table = org.apache.thrift.TBaseHelper.copyBinary(other.table); + } + if (other.isSetTrowMutations()) { + this.trowMutations = new TRowMutations(other.trowMutations); + } + } + + public mutateRow_args deepCopy() { + return new mutateRow_args(this); + } + + @Override + public void clear() { + this.table = null; + this.trowMutations = null; + } + + /** + * table to apply the mutations + */ + public byte[] getTable() { + setTable(org.apache.thrift.TBaseHelper.rightSize(table)); + return table == null ? null : table.array(); + } + + public ByteBuffer bufferForTable() { + return org.apache.thrift.TBaseHelper.copyBinary(table); + } + + /** + * table to apply the mutations + */ + public mutateRow_args setTable(byte[] table) { + this.table = table == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(table, table.length)); + return this; + } + + public mutateRow_args setTable(ByteBuffer table) { + this.table = org.apache.thrift.TBaseHelper.copyBinary(table); + return this; + } + + public void unsetTable() { + this.table = null; + } + + /** Returns true if field table is set (has been assigned a value) and false otherwise */ + public boolean isSetTable() { + return this.table != null; + } + + public void setTableIsSet(boolean value) { + if (!value) { + this.table = null; + } + } + + /** + * mutations to apply + */ + public TRowMutations getTrowMutations() { + return this.trowMutations; + } + + /** + * mutations to apply + */ + public mutateRow_args setTrowMutations(TRowMutations trowMutations) { + this.trowMutations = trowMutations; + return this; + } + + public void unsetTrowMutations() { + this.trowMutations = null; + } + + /** Returns true if field trowMutations is set (has been assigned a value) and false otherwise */ + public boolean isSetTrowMutations() { + return this.trowMutations != null; + } + + public void setTrowMutationsIsSet(boolean value) { + if (!value) { + this.trowMutations = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case TABLE: + if (value == null) { + unsetTable(); + } else { + setTable((ByteBuffer)value); + } + break; + + case TROW_MUTATIONS: + if (value == null) { + unsetTrowMutations(); + } else { + setTrowMutations((TRowMutations)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case TABLE: + return getTable(); + + case TROW_MUTATIONS: + return getTrowMutations(); + + } + 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: + return isSetTable(); + case TROW_MUTATIONS: + return isSetTrowMutations(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof mutateRow_args) + return this.equals((mutateRow_args)that); + return false; + } + + public boolean equals(mutateRow_args that) { + if (that == null) + return false; + + boolean this_present_table = true && this.isSetTable(); + boolean that_present_table = true && that.isSetTable(); + if (this_present_table || that_present_table) { + if (!(this_present_table && that_present_table)) + return false; + if (!this.table.equals(that.table)) + return false; + } + + boolean this_present_trowMutations = true && this.isSetTrowMutations(); + boolean that_present_trowMutations = true && that.isSetTrowMutations(); + if (this_present_trowMutations || that_present_trowMutations) { + if (!(this_present_trowMutations && that_present_trowMutations)) + return false; + if (!this.trowMutations.equals(that.trowMutations)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_table = true && (isSetTable()); + list.add(present_table); + if (present_table) + list.add(table); + + boolean present_trowMutations = true && (isSetTrowMutations()); + list.add(present_trowMutations); + if (present_trowMutations) + list.add(trowMutations); + + return list.hashCode(); + } + + @Override + public int compareTo(mutateRow_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetTable()).compareTo(other.isSetTable()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTable()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.table, other.table); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetTrowMutations()).compareTo(other.isSetTrowMutations()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTrowMutations()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.trowMutations, other.trowMutations); + 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("mutateRow_args("); + boolean first = true; + + sb.append("table:"); + if (this.table == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.table, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("trowMutations:"); + if (this.trowMutations == null) { + sb.append("null"); + } else { + sb.append(this.trowMutations); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (table == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'table' was not present! Struct: " + toString()); + } + if (trowMutations == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'trowMutations' was not present! Struct: " + toString()); + } + // check for sub-struct validity + if (trowMutations != null) { + trowMutations.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 mutateRow_argsStandardSchemeFactory implements SchemeFactory { + public mutateRow_argsStandardScheme getScheme() { + return new mutateRow_argsStandardScheme(); + } + } + + private static class mutateRow_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, mutateRow_args 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 + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.table = iprot.readBinary(); + struct.setTableIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // TROW_MUTATIONS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.trowMutations = new TRowMutations(); + struct.trowMutations.read(iprot); + struct.setTrowMutationsIsSet(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, mutateRow_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.table != null) { + oprot.writeFieldBegin(TABLE_FIELD_DESC); + oprot.writeBinary(struct.table); + oprot.writeFieldEnd(); + } + if (struct.trowMutations != null) { + oprot.writeFieldBegin(TROW_MUTATIONS_FIELD_DESC); + struct.trowMutations.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class mutateRow_argsTupleSchemeFactory implements SchemeFactory { + public mutateRow_argsTupleScheme getScheme() { + return new mutateRow_argsTupleScheme(); + } + } + + private static class mutateRow_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, mutateRow_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeBinary(struct.table); + struct.trowMutations.write(oprot); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, mutateRow_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.table = iprot.readBinary(); + struct.setTableIsSet(true); + struct.trowMutations = new TRowMutations(); + struct.trowMutations.read(iprot); + struct.setTrowMutationsIsSet(true); + } + } + + } + + public static class mutateRow_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("mutateRow_result"); + + private static final org.apache.thrift.protocol.TField IO_FIELD_DESC = new org.apache.thrift.protocol.TField("io", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new mutateRow_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new mutateRow_resultTupleSchemeFactory()); + } + + public TIOError io; // 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 { + IO((short)1, "io"); + + private static final Map byName = new HashMap(); + + 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: // IO + return IO; + 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.IO, new org.apache.thrift.meta_data.FieldMetaData("io", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(mutateRow_result.class, metaDataMap); + } + + public mutateRow_result() { + } + + public mutateRow_result( + TIOError io) + { + this(); + this.io = io; + } + + /** + * Performs a deep copy on other. + */ + public mutateRow_result(mutateRow_result other) { + if (other.isSetIo()) { + this.io = new TIOError(other.io); + } + } + + public mutateRow_result deepCopy() { + return new mutateRow_result(this); + } + + @Override + public void clear() { + this.io = null; + } + + public TIOError getIo() { + return this.io; + } + + public mutateRow_result setIo(TIOError io) { + this.io = io; + return this; + } + + public void unsetIo() { + this.io = null; + } + + /** Returns true if field io is set (has been assigned a value) and false otherwise */ + public boolean isSetIo() { + return this.io != null; + } + + public void setIoIsSet(boolean value) { + if (!value) { + this.io = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case IO: + if (value == null) { + unsetIo(); + } else { + setIo((TIOError)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case IO: + return getIo(); + + } + 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 IO: + return isSetIo(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof mutateRow_result) + return this.equals((mutateRow_result)that); + return false; + } + + public boolean equals(mutateRow_result that) { + if (that == null) + return false; + + boolean this_present_io = true && this.isSetIo(); + boolean that_present_io = true && that.isSetIo(); + if (this_present_io || that_present_io) { + if (!(this_present_io && that_present_io)) + return false; + if (!this.io.equals(that.io)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_io = true && (isSetIo()); + list.add(present_io); + if (present_io) + list.add(io); + + return list.hashCode(); + } + + @Override + public int compareTo(mutateRow_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetIo()).compareTo(other.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, other.io); + 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("mutateRow_result("); + boolean first = true; + + sb.append("io:"); + if (this.io == null) { + sb.append("null"); + } else { + sb.append(this.io); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 mutateRow_resultStandardSchemeFactory implements SchemeFactory { + public mutateRow_resultStandardScheme getScheme() { + return new mutateRow_resultStandardScheme(); + } + } + + private static class mutateRow_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, mutateRow_result 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: // IO + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.io = new TIOError(); + struct.io.read(iprot); + struct.setIoIsSet(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, mutateRow_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.io != null) { + oprot.writeFieldBegin(IO_FIELD_DESC); + struct.io.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class mutateRow_resultTupleSchemeFactory implements SchemeFactory { + public mutateRow_resultTupleScheme getScheme() { + return new mutateRow_resultTupleScheme(); + } + } + + private static class mutateRow_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, mutateRow_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetIo()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetIo()) { + struct.io.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, mutateRow_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.io = new TIOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } + } + } + + } + + public static class getScannerResults_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getScannerResults_args"); + + private static final org.apache.thrift.protocol.TField TABLE_FIELD_DESC = new org.apache.thrift.protocol.TField("table", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField TSCAN_FIELD_DESC = new org.apache.thrift.protocol.TField("tscan", org.apache.thrift.protocol.TType.STRUCT, (short)2); + private static final org.apache.thrift.protocol.TField NUM_ROWS_FIELD_DESC = new org.apache.thrift.protocol.TField("numRows", org.apache.thrift.protocol.TType.I32, (short)3); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getScannerResults_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getScannerResults_argsTupleSchemeFactory()); + } + + /** + * the table to get the Scanner for + */ + public ByteBuffer table; // required + /** + * the scan object to get a Scanner for + */ + public TScan tscan; // required + /** + * number of rows to return + */ + public int numRows; // 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 { + /** + * the table to get the Scanner for + */ + TABLE((short)1, "table"), + /** + * the scan object to get a Scanner for + */ + TSCAN((short)2, "tscan"), + /** + * number of rows to return + */ + NUM_ROWS((short)3, "numRows"); + + private static final Map byName = new HashMap(); + + 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 + return TABLE; + case 2: // TSCAN + return TSCAN; + case 3: // NUM_ROWS + return NUM_ROWS; + 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 int __NUMROWS_ISSET_ID = 0; + private byte __isset_bitfield = 0; + 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, new org.apache.thrift.meta_data.FieldMetaData("table", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + tmpMap.put(_Fields.TSCAN, new org.apache.thrift.meta_data.FieldMetaData("tscan", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TScan.class))); + tmpMap.put(_Fields.NUM_ROWS, new org.apache.thrift.meta_data.FieldMetaData("numRows", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getScannerResults_args.class, metaDataMap); + } + + public getScannerResults_args() { + this.numRows = 1; + + } + + public getScannerResults_args( + ByteBuffer table, + TScan tscan, + int numRows) + { + this(); + this.table = org.apache.thrift.TBaseHelper.copyBinary(table); + this.tscan = tscan; + this.numRows = numRows; + setNumRowsIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public getScannerResults_args(getScannerResults_args other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetTable()) { + this.table = org.apache.thrift.TBaseHelper.copyBinary(other.table); + } + if (other.isSetTscan()) { + this.tscan = new TScan(other.tscan); + } + this.numRows = other.numRows; + } + + public getScannerResults_args deepCopy() { + return new getScannerResults_args(this); + } + + @Override + public void clear() { + this.table = null; + this.tscan = null; + this.numRows = 1; + + } + + /** + * the table to get the Scanner for + */ + public byte[] getTable() { + setTable(org.apache.thrift.TBaseHelper.rightSize(table)); + return table == null ? null : table.array(); + } + + public ByteBuffer bufferForTable() { + return org.apache.thrift.TBaseHelper.copyBinary(table); + } + + /** + * the table to get the Scanner for + */ + public getScannerResults_args setTable(byte[] table) { + this.table = table == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(table, table.length)); + return this; + } + + public getScannerResults_args setTable(ByteBuffer table) { + this.table = org.apache.thrift.TBaseHelper.copyBinary(table); + return this; + } + + public void unsetTable() { + this.table = null; + } + + /** Returns true if field table is set (has been assigned a value) and false otherwise */ + public boolean isSetTable() { + return this.table != null; + } + + public void setTableIsSet(boolean value) { + if (!value) { + this.table = null; + } + } + + /** + * the scan object to get a Scanner for + */ + public TScan getTscan() { + return this.tscan; + } + + /** + * the scan object to get a Scanner for + */ + public getScannerResults_args setTscan(TScan tscan) { + this.tscan = tscan; + return this; + } + + public void unsetTscan() { + this.tscan = null; + } + + /** Returns true if field tscan is set (has been assigned a value) and false otherwise */ + public boolean isSetTscan() { + return this.tscan != null; + } + + public void setTscanIsSet(boolean value) { + if (!value) { + this.tscan = null; + } + } + + /** + * number of rows to return + */ + public int getNumRows() { + return this.numRows; + } + + /** + * number of rows to return + */ + public getScannerResults_args setNumRows(int numRows) { + this.numRows = numRows; + setNumRowsIsSet(true); + return this; + } + + public void unsetNumRows() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __NUMROWS_ISSET_ID); + } + + /** Returns true if field numRows is set (has been assigned a value) and false otherwise */ + public boolean isSetNumRows() { + return EncodingUtils.testBit(__isset_bitfield, __NUMROWS_ISSET_ID); + } + + public void setNumRowsIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __NUMROWS_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case TABLE: + if (value == null) { + unsetTable(); + } else { + setTable((ByteBuffer)value); + } + break; + + case TSCAN: + if (value == null) { + unsetTscan(); + } else { + setTscan((TScan)value); + } + break; + + case NUM_ROWS: + if (value == null) { + unsetNumRows(); + } else { + setNumRows((Integer)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case TABLE: + return getTable(); + + case TSCAN: + return getTscan(); + + case NUM_ROWS: + return getNumRows(); + + } + 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: + return isSetTable(); + case TSCAN: + return isSetTscan(); + case NUM_ROWS: + return isSetNumRows(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getScannerResults_args) + return this.equals((getScannerResults_args)that); + return false; + } + + public boolean equals(getScannerResults_args that) { + if (that == null) + return false; + + boolean this_present_table = true && this.isSetTable(); + boolean that_present_table = true && that.isSetTable(); + if (this_present_table || that_present_table) { + if (!(this_present_table && that_present_table)) + return false; + if (!this.table.equals(that.table)) + return false; + } + + boolean this_present_tscan = true && this.isSetTscan(); + boolean that_present_tscan = true && that.isSetTscan(); + if (this_present_tscan || that_present_tscan) { + if (!(this_present_tscan && that_present_tscan)) + return false; + if (!this.tscan.equals(that.tscan)) + return false; + } + + boolean this_present_numRows = true; + boolean that_present_numRows = true; + if (this_present_numRows || that_present_numRows) { + if (!(this_present_numRows && that_present_numRows)) + return false; + if (this.numRows != that.numRows) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_table = true && (isSetTable()); + list.add(present_table); + if (present_table) + list.add(table); + + boolean present_tscan = true && (isSetTscan()); + list.add(present_tscan); + if (present_tscan) + list.add(tscan); + + boolean present_numRows = true; + list.add(present_numRows); + if (present_numRows) + list.add(numRows); + + return list.hashCode(); + } + + @Override + public int compareTo(getScannerResults_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetTable()).compareTo(other.isSetTable()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTable()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.table, other.table); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetTscan()).compareTo(other.isSetTscan()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTscan()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tscan, other.tscan); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetNumRows()).compareTo(other.isSetNumRows()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetNumRows()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.numRows, other.numRows); + 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("getScannerResults_args("); + boolean first = true; + + sb.append("table:"); + if (this.table == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.table, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("tscan:"); + if (this.tscan == null) { + sb.append("null"); + } else { + sb.append(this.tscan); + } + first = false; + if (!first) sb.append(", "); + sb.append("numRows:"); + sb.append(this.numRows); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (table == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'table' was not present! Struct: " + toString()); + } + if (tscan == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'tscan' was not present! Struct: " + toString()); + } + // check for sub-struct validity + if (tscan != null) { + tscan.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 { + // 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); + } + } + + private static class getScannerResults_argsStandardSchemeFactory implements SchemeFactory { + public getScannerResults_argsStandardScheme getScheme() { + return new getScannerResults_argsStandardScheme(); + } + } + + private static class getScannerResults_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getScannerResults_args 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 + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.table = iprot.readBinary(); + struct.setTableIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // TSCAN + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.tscan = new TScan(); + struct.tscan.read(iprot); + struct.setTscanIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // NUM_ROWS + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.numRows = iprot.readI32(); + struct.setNumRowsIsSet(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, getScannerResults_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.table != null) { + oprot.writeFieldBegin(TABLE_FIELD_DESC); + oprot.writeBinary(struct.table); + oprot.writeFieldEnd(); + } + if (struct.tscan != null) { + oprot.writeFieldBegin(TSCAN_FIELD_DESC); + struct.tscan.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(NUM_ROWS_FIELD_DESC); + oprot.writeI32(struct.numRows); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getScannerResults_argsTupleSchemeFactory implements SchemeFactory { + public getScannerResults_argsTupleScheme getScheme() { + return new getScannerResults_argsTupleScheme(); + } + } + + private static class getScannerResults_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getScannerResults_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeBinary(struct.table); + struct.tscan.write(oprot); + BitSet optionals = new BitSet(); + if (struct.isSetNumRows()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetNumRows()) { + oprot.writeI32(struct.numRows); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getScannerResults_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.table = iprot.readBinary(); + struct.setTableIsSet(true); + struct.tscan = new TScan(); + struct.tscan.read(iprot); + struct.setTscanIsSet(true); + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.numRows = iprot.readI32(); + struct.setNumRowsIsSet(true); + } + } + } + + } + + public static class getScannerResults_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getScannerResults_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0); + private static final org.apache.thrift.protocol.TField IO_FIELD_DESC = new org.apache.thrift.protocol.TField("io", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getScannerResults_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getScannerResults_resultTupleSchemeFactory()); + } + + public List success; // required + public TIOError io; // 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 { + SUCCESS((short)0, "success"), + IO((short)1, "io"); + + private static final Map byName = new HashMap(); + + 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 0: // SUCCESS + return SUCCESS; + case 1: // IO + return IO; + 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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + 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, TResult.class)))); + tmpMap.put(_Fields.IO, new org.apache.thrift.meta_data.FieldMetaData("io", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getScannerResults_result.class, metaDataMap); + } + + public getScannerResults_result() { + } + + public getScannerResults_result( + List success, + TIOError io) + { + this(); + this.success = success; + this.io = io; + } + + /** + * Performs a deep copy on other. + */ + public getScannerResults_result(getScannerResults_result other) { + if (other.isSetSuccess()) { + List __this__success = new ArrayList(other.success.size()); + for (TResult other_element : other.success) { + __this__success.add(new TResult(other_element)); + } + this.success = __this__success; + } + if (other.isSetIo()) { + this.io = new TIOError(other.io); + } + } + + public getScannerResults_result deepCopy() { + return new getScannerResults_result(this); + } + + @Override + public void clear() { + this.success = null; + this.io = null; + } + + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + public java.util.Iterator getSuccessIterator() { + return (this.success == null) ? null : this.success.iterator(); + } + + public void addToSuccess(TResult elem) { + if (this.success == null) { + this.success = new ArrayList(); + } + this.success.add(elem); + } + + public List getSuccess() { + return this.success; + } + + public getScannerResults_result setSuccess(List success) { + this.success = success; + return this; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public TIOError getIo() { + return this.io; + } + + public getScannerResults_result setIo(TIOError io) { + this.io = io; + return this; + } + + public void unsetIo() { + this.io = null; + } + + /** Returns true if field io is set (has been assigned a value) and false otherwise */ + public boolean isSetIo() { + return this.io != null; + } + + public void setIoIsSet(boolean value) { + if (!value) { + this.io = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((List)value); + } + break; + + case IO: + if (value == null) { + unsetIo(); + } else { + setIo((TIOError)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + case IO: + return getIo(); + + } + 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 SUCCESS: + return isSetSuccess(); + case IO: + return isSetIo(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getScannerResults_result) + return this.equals((getScannerResults_result)that); + return false; + } + + public boolean equals(getScannerResults_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + boolean this_present_io = true && this.isSetIo(); + boolean that_present_io = true && that.isSetIo(); + if (this_present_io || that_present_io) { + if (!(this_present_io && that_present_io)) + return false; + if (!this.io.equals(that.io)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + boolean present_io = true && (isSetIo()); + list.add(present_io); + if (present_io) + list.add(io); + + return list.hashCode(); + } + + @Override + public int compareTo(getScannerResults_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIo()).compareTo(other.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, other.io); + 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("getScannerResults_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + if (!first) sb.append(", "); + sb.append("io:"); + if (this.io == null) { + sb.append("null"); + } else { + sb.append(this.io); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 getScannerResults_resultStandardSchemeFactory implements SchemeFactory { + public getScannerResults_resultStandardScheme getScheme() { + return new getScannerResults_resultStandardScheme(); + } + } + + private static class getScannerResults_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getScannerResults_result 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 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list180 = iprot.readListBegin(); + struct.success = new ArrayList(_list180.size); + TResult _elem181; + for (int _i182 = 0; _i182 < _list180.size; ++_i182) + { + _elem181 = new TResult(); + _elem181.read(iprot); + struct.success.add(_elem181); + } + iprot.readListEnd(); + } + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IO + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.io = new TIOError(); + struct.io.read(iprot); + struct.setIoIsSet(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, getScannerResults_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); + for (TResult _iter183 : struct.success) + { + _iter183.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.io != null) { + oprot.writeFieldBegin(IO_FIELD_DESC); + struct.io.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getScannerResults_resultTupleSchemeFactory implements SchemeFactory { + public getScannerResults_resultTupleScheme getScheme() { + return new getScannerResults_resultTupleScheme(); + } + } + + private static class getScannerResults_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getScannerResults_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIo()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + { + oprot.writeI32(struct.success.size()); + for (TResult _iter184 : struct.success) + { + _iter184.write(oprot); + } + } + } + if (struct.isSetIo()) { + struct.io.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getScannerResults_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list185 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new ArrayList(_list185.size); + TResult _elem186; + for (int _i187 = 0; _i187 < _list185.size; ++_i187) + { + _elem186 = new TResult(); + _elem186.read(iprot); + struct.success.add(_elem186); + } + } + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.io = new TIOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } + } + } + + } + + public static class getRegionLocation_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getRegionLocation_args"); + + private static final org.apache.thrift.protocol.TField TABLE_FIELD_DESC = new org.apache.thrift.protocol.TField("table", org.apache.thrift.protocol.TType.STRING, (short)1); + 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)2); + private static final org.apache.thrift.protocol.TField RELOAD_FIELD_DESC = new org.apache.thrift.protocol.TField("reload", org.apache.thrift.protocol.TType.BOOL, (short)3); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getRegionLocation_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getRegionLocation_argsTupleSchemeFactory()); + } + + public ByteBuffer table; // required + public ByteBuffer row; // required + public boolean reload; // 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 { + TABLE((short)1, "table"), + ROW((short)2, "row"), + RELOAD((short)3, "reload"); + + private static final Map byName = new HashMap(); + + 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 + return TABLE; + case 2: // ROW + return ROW; + case 3: // RELOAD + return RELOAD; + 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 int __RELOAD_ISSET_ID = 0; + private byte __isset_bitfield = 0; + 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, new org.apache.thrift.meta_data.FieldMetaData("table", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + tmpMap.put(_Fields.ROW, new org.apache.thrift.meta_data.FieldMetaData("row", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + tmpMap.put(_Fields.RELOAD, new org.apache.thrift.meta_data.FieldMetaData("reload", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRegionLocation_args.class, metaDataMap); + } + + public getRegionLocation_args() { + } + + public getRegionLocation_args( + ByteBuffer table, + ByteBuffer row, + boolean reload) + { + this(); + this.table = org.apache.thrift.TBaseHelper.copyBinary(table); + this.row = org.apache.thrift.TBaseHelper.copyBinary(row); + this.reload = reload; + setReloadIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public getRegionLocation_args(getRegionLocation_args other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetTable()) { + this.table = org.apache.thrift.TBaseHelper.copyBinary(other.table); + } + if (other.isSetRow()) { + this.row = org.apache.thrift.TBaseHelper.copyBinary(other.row); + } + this.reload = other.reload; + } + + public getRegionLocation_args deepCopy() { + return new getRegionLocation_args(this); + } + + @Override + public void clear() { + this.table = null; + this.row = null; + setReloadIsSet(false); + this.reload = false; + } + + public byte[] getTable() { + setTable(org.apache.thrift.TBaseHelper.rightSize(table)); + return table == null ? null : table.array(); + } + + public ByteBuffer bufferForTable() { + return org.apache.thrift.TBaseHelper.copyBinary(table); + } + + public getRegionLocation_args setTable(byte[] table) { + this.table = table == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(table, table.length)); + return this; + } + + public getRegionLocation_args setTable(ByteBuffer table) { + this.table = org.apache.thrift.TBaseHelper.copyBinary(table); + return this; + } + + public void unsetTable() { + this.table = null; + } + + /** Returns true if field table is set (has been assigned a value) and false otherwise */ + public boolean isSetTable() { + return this.table != null; + } + + public void setTableIsSet(boolean value) { + if (!value) { + this.table = null; + } + } + + public byte[] getRow() { + setRow(org.apache.thrift.TBaseHelper.rightSize(row)); + return row == null ? null : row.array(); + } + + public ByteBuffer bufferForRow() { + return org.apache.thrift.TBaseHelper.copyBinary(row); + } + + public getRegionLocation_args setRow(byte[] row) { + this.row = row == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(row, row.length)); + return this; + } + + public getRegionLocation_args setRow(ByteBuffer row) { + this.row = org.apache.thrift.TBaseHelper.copyBinary(row); + return this; + } + + public void unsetRow() { + this.row = null; + } + + /** Returns true if field row is set (has been assigned a value) and false otherwise */ + public boolean isSetRow() { + return this.row != null; + } + + public void setRowIsSet(boolean value) { + if (!value) { + this.row = null; + } + } + + public boolean isReload() { + return this.reload; + } + + public getRegionLocation_args setReload(boolean reload) { + this.reload = reload; + setReloadIsSet(true); + return this; + } + + public void unsetReload() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __RELOAD_ISSET_ID); + } + + /** Returns true if field reload is set (has been assigned a value) and false otherwise */ + public boolean isSetReload() { + return EncodingUtils.testBit(__isset_bitfield, __RELOAD_ISSET_ID); + } + + public void setReloadIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __RELOAD_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case TABLE: + if (value == null) { + unsetTable(); + } else { + setTable((ByteBuffer)value); + } + break; + + case ROW: + if (value == null) { + unsetRow(); + } else { + setRow((ByteBuffer)value); + } + break; + + case RELOAD: + if (value == null) { + unsetReload(); + } else { + setReload((Boolean)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case TABLE: + return getTable(); + + case ROW: + return getRow(); + + case RELOAD: + return isReload(); + + } + 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: + return isSetTable(); + case ROW: + return isSetRow(); + case RELOAD: + return isSetReload(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getRegionLocation_args) + return this.equals((getRegionLocation_args)that); + return false; + } + + public boolean equals(getRegionLocation_args that) { + if (that == null) + return false; + + boolean this_present_table = true && this.isSetTable(); + boolean that_present_table = true && that.isSetTable(); + if (this_present_table || that_present_table) { + if (!(this_present_table && that_present_table)) + return false; + if (!this.table.equals(that.table)) + return false; + } + + boolean this_present_row = true && this.isSetRow(); + boolean that_present_row = true && that.isSetRow(); + if (this_present_row || that_present_row) { + if (!(this_present_row && that_present_row)) + return false; + if (!this.row.equals(that.row)) + return false; + } + + boolean this_present_reload = true; + boolean that_present_reload = true; + if (this_present_reload || that_present_reload) { + if (!(this_present_reload && that_present_reload)) + return false; + if (this.reload != that.reload) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_table = true && (isSetTable()); + list.add(present_table); + if (present_table) + list.add(table); + + boolean present_row = true && (isSetRow()); + list.add(present_row); + if (present_row) + list.add(row); + + boolean present_reload = true; + list.add(present_reload); + if (present_reload) + list.add(reload); + + return list.hashCode(); + } + + @Override + public int compareTo(getRegionLocation_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetTable()).compareTo(other.isSetTable()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTable()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.table, other.table); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetRow()).compareTo(other.isSetRow()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRow()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.row, other.row); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetReload()).compareTo(other.isSetReload()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetReload()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.reload, other.reload); + 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("getRegionLocation_args("); + boolean first = true; + + sb.append("table:"); + if (this.table == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.table, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("row:"); + if (this.row == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.row, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("reload:"); + sb.append(this.reload); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (table == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'table' was not present! Struct: " + toString()); + } + if (row == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'row' 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 { + // 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); + } + } + + private static class getRegionLocation_argsStandardSchemeFactory implements SchemeFactory { + public getRegionLocation_argsStandardScheme getScheme() { + return new getRegionLocation_argsStandardScheme(); + } + } + + private static class getRegionLocation_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getRegionLocation_args 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 + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.table = iprot.readBinary(); + struct.setTableIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // ROW + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.row = iprot.readBinary(); + struct.setRowIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // RELOAD + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.reload = iprot.readBool(); + struct.setReloadIsSet(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, getRegionLocation_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.table != null) { + oprot.writeFieldBegin(TABLE_FIELD_DESC); + oprot.writeBinary(struct.table); + oprot.writeFieldEnd(); + } + if (struct.row != null) { + oprot.writeFieldBegin(ROW_FIELD_DESC); + oprot.writeBinary(struct.row); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(RELOAD_FIELD_DESC); + oprot.writeBool(struct.reload); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getRegionLocation_argsTupleSchemeFactory implements SchemeFactory { + public getRegionLocation_argsTupleScheme getScheme() { + return new getRegionLocation_argsTupleScheme(); + } + } + + private static class getRegionLocation_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getRegionLocation_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeBinary(struct.table); + oprot.writeBinary(struct.row); + BitSet optionals = new BitSet(); + if (struct.isSetReload()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetReload()) { + oprot.writeBool(struct.reload); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getRegionLocation_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.table = iprot.readBinary(); + struct.setTableIsSet(true); + struct.row = iprot.readBinary(); + struct.setRowIsSet(true); + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.reload = iprot.readBool(); + struct.setReloadIsSet(true); + } + } + } + + } + + public static class getRegionLocation_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getRegionLocation_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); + private static final org.apache.thrift.protocol.TField IO_FIELD_DESC = new org.apache.thrift.protocol.TField("io", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getRegionLocation_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getRegionLocation_resultTupleSchemeFactory()); + } + + public THRegionLocation success; // required + public TIOError io; // 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 { + SUCCESS((short)0, "success"), + IO((short)1, "io"); + + private static final Map byName = new HashMap(); + + 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 0: // SUCCESS + return SUCCESS; + case 1: // IO + return IO; + 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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, THRegionLocation.class))); + tmpMap.put(_Fields.IO, new org.apache.thrift.meta_data.FieldMetaData("io", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRegionLocation_result.class, metaDataMap); + } + + public getRegionLocation_result() { + } + + public getRegionLocation_result( + THRegionLocation success, + TIOError io) + { + this(); + this.success = success; + this.io = io; + } + + /** + * Performs a deep copy on other. + */ + public getRegionLocation_result(getRegionLocation_result other) { + if (other.isSetSuccess()) { + this.success = new THRegionLocation(other.success); + } + if (other.isSetIo()) { + this.io = new TIOError(other.io); + } + } + + public getRegionLocation_result deepCopy() { + return new getRegionLocation_result(this); + } + + @Override + public void clear() { + this.success = null; + this.io = null; + } + + public THRegionLocation getSuccess() { + return this.success; + } + + public getRegionLocation_result setSuccess(THRegionLocation success) { + this.success = success; + return this; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public TIOError getIo() { + return this.io; + } + + public getRegionLocation_result setIo(TIOError io) { + this.io = io; + return this; + } + + public void unsetIo() { + this.io = null; + } + + /** Returns true if field io is set (has been assigned a value) and false otherwise */ + public boolean isSetIo() { + return this.io != null; + } + + public void setIoIsSet(boolean value) { + if (!value) { + this.io = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((THRegionLocation)value); + } + break; + + case IO: + if (value == null) { + unsetIo(); + } else { + setIo((TIOError)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + case IO: + return getIo(); + + } + 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 SUCCESS: + return isSetSuccess(); + case IO: + return isSetIo(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getRegionLocation_result) + return this.equals((getRegionLocation_result)that); + return false; + } + + public boolean equals(getRegionLocation_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + boolean this_present_io = true && this.isSetIo(); + boolean that_present_io = true && that.isSetIo(); + if (this_present_io || that_present_io) { + if (!(this_present_io && that_present_io)) + return false; + if (!this.io.equals(that.io)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + boolean present_io = true && (isSetIo()); + list.add(present_io); + if (present_io) + list.add(io); + + return list.hashCode(); + } + + @Override + public int compareTo(getRegionLocation_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIo()).compareTo(other.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, other.io); + 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("getRegionLocation_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + if (!first) sb.append(", "); + sb.append("io:"); + if (this.io == null) { + sb.append("null"); + } else { + sb.append(this.io); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + if (success != null) { + success.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 getRegionLocation_resultStandardSchemeFactory implements SchemeFactory { + public getRegionLocation_resultStandardScheme getScheme() { + return new getRegionLocation_resultStandardScheme(); + } + } + + private static class getRegionLocation_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getRegionLocation_result 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 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.success = new THRegionLocation(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IO + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.io = new TIOError(); + struct.io.read(iprot); + struct.setIoIsSet(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, getRegionLocation_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + struct.success.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.io != null) { + oprot.writeFieldBegin(IO_FIELD_DESC); + struct.io.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getRegionLocation_resultTupleSchemeFactory implements SchemeFactory { + public getRegionLocation_resultTupleScheme getScheme() { + return new getRegionLocation_resultTupleScheme(); + } + } + + private static class getRegionLocation_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getRegionLocation_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIo()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + struct.success.write(oprot); + } + if (struct.isSetIo()) { + struct.io.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getRegionLocation_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.success = new THRegionLocation(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.io = new TIOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } + } + } + + } + + public static class getAllRegionLocations_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllRegionLocations_args"); + + private static final org.apache.thrift.protocol.TField TABLE_FIELD_DESC = new org.apache.thrift.protocol.TField("table", org.apache.thrift.protocol.TType.STRING, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getAllRegionLocations_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getAllRegionLocations_argsTupleSchemeFactory()); + } + + public ByteBuffer table; // 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 { + TABLE((short)1, "table"); + + private static final Map byName = new HashMap(); + + 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 + return TABLE; + 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.TABLE, new org.apache.thrift.meta_data.FieldMetaData("table", 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(getAllRegionLocations_args.class, metaDataMap); + } + + public getAllRegionLocations_args() { + } + + public getAllRegionLocations_args( + ByteBuffer table) + { + this(); + this.table = org.apache.thrift.TBaseHelper.copyBinary(table); + } + + /** + * Performs a deep copy on other. + */ + public getAllRegionLocations_args(getAllRegionLocations_args other) { + if (other.isSetTable()) { + this.table = org.apache.thrift.TBaseHelper.copyBinary(other.table); + } + } + + public getAllRegionLocations_args deepCopy() { + return new getAllRegionLocations_args(this); + } + + @Override + public void clear() { + this.table = null; + } + + public byte[] getTable() { + setTable(org.apache.thrift.TBaseHelper.rightSize(table)); + return table == null ? null : table.array(); + } + + public ByteBuffer bufferForTable() { + return org.apache.thrift.TBaseHelper.copyBinary(table); + } + + public getAllRegionLocations_args setTable(byte[] table) { + this.table = table == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(table, table.length)); + return this; + } + + public getAllRegionLocations_args setTable(ByteBuffer table) { + this.table = org.apache.thrift.TBaseHelper.copyBinary(table); + return this; + } + + public void unsetTable() { + this.table = null; + } + + /** Returns true if field table is set (has been assigned a value) and false otherwise */ + public boolean isSetTable() { + return this.table != null; + } + + public void setTableIsSet(boolean value) { + if (!value) { + this.table = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case TABLE: + if (value == null) { + unsetTable(); + } else { + setTable((ByteBuffer)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case TABLE: + return getTable(); + + } + 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: + return isSetTable(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getAllRegionLocations_args) + return this.equals((getAllRegionLocations_args)that); + return false; + } + + public boolean equals(getAllRegionLocations_args that) { + if (that == null) + return false; + + boolean this_present_table = true && this.isSetTable(); + boolean that_present_table = true && that.isSetTable(); + if (this_present_table || that_present_table) { + if (!(this_present_table && that_present_table)) + return false; + if (!this.table.equals(that.table)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_table = true && (isSetTable()); + list.add(present_table); + if (present_table) + list.add(table); + + return list.hashCode(); + } + + @Override + public int compareTo(getAllRegionLocations_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetTable()).compareTo(other.isSetTable()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTable()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.table, other.table); + 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("getAllRegionLocations_args("); + boolean first = true; + + sb.append("table:"); + if (this.table == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.table, sb); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (table == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'table' 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 getAllRegionLocations_argsStandardSchemeFactory implements SchemeFactory { + public getAllRegionLocations_argsStandardScheme getScheme() { + return new getAllRegionLocations_argsStandardScheme(); + } + } + + private static class getAllRegionLocations_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getAllRegionLocations_args 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 + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.table = iprot.readBinary(); + struct.setTableIsSet(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, getAllRegionLocations_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.table != null) { + oprot.writeFieldBegin(TABLE_FIELD_DESC); + oprot.writeBinary(struct.table); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getAllRegionLocations_argsTupleSchemeFactory implements SchemeFactory { + public getAllRegionLocations_argsTupleScheme getScheme() { + return new getAllRegionLocations_argsTupleScheme(); + } + } + + private static class getAllRegionLocations_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getAllRegionLocations_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeBinary(struct.table); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getAllRegionLocations_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.table = iprot.readBinary(); + struct.setTableIsSet(true); + } + } + + } + + public static class getAllRegionLocations_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllRegionLocations_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0); + private static final org.apache.thrift.protocol.TField IO_FIELD_DESC = new org.apache.thrift.protocol.TField("io", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getAllRegionLocations_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getAllRegionLocations_resultTupleSchemeFactory()); + } + + public List success; // required + public TIOError io; // 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 { + SUCCESS((short)0, "success"), + IO((short)1, "io"); + + private static final Map byName = new HashMap(); + + 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 0: // SUCCESS + return SUCCESS; + case 1: // IO + return IO; + 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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + 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, THRegionLocation.class)))); + tmpMap.put(_Fields.IO, new org.apache.thrift.meta_data.FieldMetaData("io", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllRegionLocations_result.class, metaDataMap); + } + + public getAllRegionLocations_result() { + } + + public getAllRegionLocations_result( + List success, + TIOError io) + { + this(); + this.success = success; + this.io = io; + } + + /** + * Performs a deep copy on other. + */ + public getAllRegionLocations_result(getAllRegionLocations_result other) { + if (other.isSetSuccess()) { + List __this__success = new ArrayList(other.success.size()); + for (THRegionLocation other_element : other.success) { + __this__success.add(new THRegionLocation(other_element)); + } + this.success = __this__success; + } + if (other.isSetIo()) { + this.io = new TIOError(other.io); + } + } + + public getAllRegionLocations_result deepCopy() { + return new getAllRegionLocations_result(this); + } + + @Override + public void clear() { + this.success = null; + this.io = null; + } + + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + public java.util.Iterator getSuccessIterator() { + return (this.success == null) ? null : this.success.iterator(); + } + + public void addToSuccess(THRegionLocation elem) { + if (this.success == null) { + this.success = new ArrayList(); + } + this.success.add(elem); + } + + public List getSuccess() { + return this.success; + } + + public getAllRegionLocations_result setSuccess(List success) { + this.success = success; + return this; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public TIOError getIo() { + return this.io; + } + + public getAllRegionLocations_result setIo(TIOError io) { + this.io = io; + return this; + } + + public void unsetIo() { + this.io = null; + } + + /** Returns true if field io is set (has been assigned a value) and false otherwise */ + public boolean isSetIo() { + return this.io != null; + } + + public void setIoIsSet(boolean value) { + if (!value) { + this.io = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((List)value); + } + break; + + case IO: + if (value == null) { + unsetIo(); + } else { + setIo((TIOError)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + case IO: + return getIo(); + + } + 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 SUCCESS: + return isSetSuccess(); + case IO: + return isSetIo(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getAllRegionLocations_result) + return this.equals((getAllRegionLocations_result)that); + return false; + } + + public boolean equals(getAllRegionLocations_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + boolean this_present_io = true && this.isSetIo(); + boolean that_present_io = true && that.isSetIo(); + if (this_present_io || that_present_io) { + if (!(this_present_io && that_present_io)) + return false; + if (!this.io.equals(that.io)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + boolean present_io = true && (isSetIo()); + list.add(present_io); + if (present_io) + list.add(io); + + return list.hashCode(); + } + + @Override + public int compareTo(getAllRegionLocations_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIo()).compareTo(other.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, other.io); + 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("getAllRegionLocations_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + if (!first) sb.append(", "); + sb.append("io:"); + if (this.io == null) { + sb.append("null"); + } else { + sb.append(this.io); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 getAllRegionLocations_resultStandardSchemeFactory implements SchemeFactory { + public getAllRegionLocations_resultStandardScheme getScheme() { + return new getAllRegionLocations_resultStandardScheme(); + } + } + + private static class getAllRegionLocations_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getAllRegionLocations_result 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 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list188 = iprot.readListBegin(); + struct.success = new ArrayList(_list188.size); + THRegionLocation _elem189; + for (int _i190 = 0; _i190 < _list188.size; ++_i190) + { + _elem189 = new THRegionLocation(); + _elem189.read(iprot); + struct.success.add(_elem189); + } + iprot.readListEnd(); + } + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IO + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.io = new TIOError(); + struct.io.read(iprot); + struct.setIoIsSet(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, getAllRegionLocations_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); + for (THRegionLocation _iter191 : struct.success) + { + _iter191.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.io != null) { + oprot.writeFieldBegin(IO_FIELD_DESC); + struct.io.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getAllRegionLocations_resultTupleSchemeFactory implements SchemeFactory { + public getAllRegionLocations_resultTupleScheme getScheme() { + return new getAllRegionLocations_resultTupleScheme(); + } + } + + private static class getAllRegionLocations_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getAllRegionLocations_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIo()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + { + oprot.writeI32(struct.success.size()); + for (THRegionLocation _iter192 : struct.success) + { + _iter192.write(oprot); + } + } + } + if (struct.isSetIo()) { + struct.io.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getAllRegionLocations_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list193 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new ArrayList(_list193.size); + THRegionLocation _elem194; + for (int _i195 = 0; _i195 < _list193.size; ++_i195) + { + _elem194 = new THRegionLocation(); + _elem194.read(iprot); + struct.success.add(_elem194); + } + } + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.io = new TIOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } + } + } + + } + + public static class checkAndMutate_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("checkAndMutate_args"); + + private static final org.apache.thrift.protocol.TField TABLE_FIELD_DESC = new org.apache.thrift.protocol.TField("table", org.apache.thrift.protocol.TType.STRING, (short)1); + 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)2); + private static final org.apache.thrift.protocol.TField FAMILY_FIELD_DESC = new org.apache.thrift.protocol.TField("family", org.apache.thrift.protocol.TType.STRING, (short)3); + 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)4); + private static final org.apache.thrift.protocol.TField COMPARE_OP_FIELD_DESC = new org.apache.thrift.protocol.TField("compareOp", org.apache.thrift.protocol.TType.I32, (short)5); + 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)6); + private static final org.apache.thrift.protocol.TField ROW_MUTATIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("rowMutations", org.apache.thrift.protocol.TType.STRUCT, (short)7); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new checkAndMutate_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new checkAndMutate_argsTupleSchemeFactory()); + } + + /** + * to check in and delete from + */ + public ByteBuffer table; // required + /** + * row to check + */ + public ByteBuffer row; // required + /** + * column family to check + */ + public ByteBuffer family; // required + /** + * column qualifier to check + */ + public ByteBuffer qualifier; // required + /** + * comparison to make on the value + * + * @see TCompareOp + */ + public TCompareOp compareOp; // required + /** + * the expected value to be compared against, if not provided the + * check is for the non-existence of the column in question + */ + public ByteBuffer value; // required + /** + * row mutations to execute if the value matches + */ + public TRowMutations rowMutations; // 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 { + /** + * to check in and delete from + */ + TABLE((short)1, "table"), + /** + * row to check + */ + ROW((short)2, "row"), + /** + * column family to check + */ + FAMILY((short)3, "family"), + /** + * column qualifier to check + */ + QUALIFIER((short)4, "qualifier"), + /** + * comparison to make on the value + * + * @see TCompareOp + */ + COMPARE_OP((short)5, "compareOp"), + /** + * the expected value to be compared against, if not provided the + * check is for the non-existence of the column in question + */ + VALUE((short)6, "value"), + /** + * row mutations to execute if the value matches + */ + ROW_MUTATIONS((short)7, "rowMutations"); + + private static final Map byName = new HashMap(); + + 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 + return TABLE; + case 2: // ROW + return ROW; + case 3: // FAMILY + return FAMILY; + case 4: // QUALIFIER + return QUALIFIER; + case 5: // COMPARE_OP + return COMPARE_OP; + case 6: // VALUE + return VALUE; + case 7: // ROW_MUTATIONS + return ROW_MUTATIONS; + 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.TABLE, new org.apache.thrift.meta_data.FieldMetaData("table", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + tmpMap.put(_Fields.ROW, new org.apache.thrift.meta_data.FieldMetaData("row", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + tmpMap.put(_Fields.FAMILY, new org.apache.thrift.meta_data.FieldMetaData("family", 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))); + tmpMap.put(_Fields.COMPARE_OP, new org.apache.thrift.meta_data.FieldMetaData("compareOp", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TCompareOp.class))); + tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + tmpMap.put(_Fields.ROW_MUTATIONS, new org.apache.thrift.meta_data.FieldMetaData("rowMutations", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TRowMutations.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(checkAndMutate_args.class, metaDataMap); + } + + public checkAndMutate_args() { + } + + public checkAndMutate_args( + ByteBuffer table, + ByteBuffer row, + ByteBuffer family, + ByteBuffer qualifier, + TCompareOp compareOp, + ByteBuffer value, + TRowMutations rowMutations) + { + this(); + this.table = org.apache.thrift.TBaseHelper.copyBinary(table); + this.row = org.apache.thrift.TBaseHelper.copyBinary(row); + this.family = org.apache.thrift.TBaseHelper.copyBinary(family); + this.qualifier = org.apache.thrift.TBaseHelper.copyBinary(qualifier); + this.compareOp = compareOp; + this.value = org.apache.thrift.TBaseHelper.copyBinary(value); + this.rowMutations = rowMutations; + } + + /** + * Performs a deep copy on other. + */ + public checkAndMutate_args(checkAndMutate_args other) { + if (other.isSetTable()) { + this.table = org.apache.thrift.TBaseHelper.copyBinary(other.table); + } + if (other.isSetRow()) { + this.row = org.apache.thrift.TBaseHelper.copyBinary(other.row); + } + if (other.isSetFamily()) { + this.family = org.apache.thrift.TBaseHelper.copyBinary(other.family); + } + if (other.isSetQualifier()) { + this.qualifier = org.apache.thrift.TBaseHelper.copyBinary(other.qualifier); + } + if (other.isSetCompareOp()) { + this.compareOp = other.compareOp; + } + if (other.isSetValue()) { + this.value = org.apache.thrift.TBaseHelper.copyBinary(other.value); + } + if (other.isSetRowMutations()) { + this.rowMutations = new TRowMutations(other.rowMutations); + } + } + + public checkAndMutate_args deepCopy() { + return new checkAndMutate_args(this); + } + + @Override + public void clear() { + this.table = null; + this.row = null; + this.family = null; + this.qualifier = null; + this.compareOp = null; + this.value = null; + this.rowMutations = null; + } + + /** + * to check in and delete from + */ + public byte[] getTable() { + setTable(org.apache.thrift.TBaseHelper.rightSize(table)); + return table == null ? null : table.array(); + } + + public ByteBuffer bufferForTable() { + return org.apache.thrift.TBaseHelper.copyBinary(table); + } + + /** + * to check in and delete from + */ + public checkAndMutate_args setTable(byte[] table) { + this.table = table == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(table, table.length)); + return this; + } + + public checkAndMutate_args setTable(ByteBuffer table) { + this.table = org.apache.thrift.TBaseHelper.copyBinary(table); + return this; + } + + public void unsetTable() { + this.table = null; + } + + /** Returns true if field table is set (has been assigned a value) and false otherwise */ + public boolean isSetTable() { + return this.table != null; + } + + public void setTableIsSet(boolean value) { + if (!value) { + this.table = null; + } + } + + /** + * row to check + */ + public byte[] getRow() { + setRow(org.apache.thrift.TBaseHelper.rightSize(row)); + return row == null ? null : row.array(); + } + + public ByteBuffer bufferForRow() { + return org.apache.thrift.TBaseHelper.copyBinary(row); + } + + /** + * row to check + */ + public checkAndMutate_args setRow(byte[] row) { + this.row = row == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(row, row.length)); + return this; + } + + public checkAndMutate_args setRow(ByteBuffer row) { + this.row = org.apache.thrift.TBaseHelper.copyBinary(row); + return this; + } + + public void unsetRow() { + this.row = null; + } + + /** Returns true if field row is set (has been assigned a value) and false otherwise */ + public boolean isSetRow() { + return this.row != null; + } + + public void setRowIsSet(boolean value) { + if (!value) { + this.row = null; + } + } + + /** + * column family to check + */ + public byte[] getFamily() { + setFamily(org.apache.thrift.TBaseHelper.rightSize(family)); + return family == null ? null : family.array(); + } + + public ByteBuffer bufferForFamily() { + return org.apache.thrift.TBaseHelper.copyBinary(family); + } + + /** + * column family to check + */ + public checkAndMutate_args setFamily(byte[] family) { + this.family = family == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(family, family.length)); + return this; + } + + public checkAndMutate_args setFamily(ByteBuffer family) { + this.family = org.apache.thrift.TBaseHelper.copyBinary(family); + return this; + } + + public void unsetFamily() { + this.family = null; + } + + /** Returns true if field family is set (has been assigned a value) and false otherwise */ + public boolean isSetFamily() { + return this.family != null; + } + + public void setFamilyIsSet(boolean value) { + if (!value) { + this.family = null; + } + } + + /** + * column qualifier to check + */ + 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); + } + + /** + * column qualifier to check + */ + public checkAndMutate_args setQualifier(byte[] qualifier) { + this.qualifier = qualifier == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(qualifier, qualifier.length)); + return this; + } + + public checkAndMutate_args 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; + } + } + + /** + * comparison to make on the value + * + * @see TCompareOp + */ + public TCompareOp getCompareOp() { + return this.compareOp; + } + + /** + * comparison to make on the value + * + * @see TCompareOp + */ + public checkAndMutate_args setCompareOp(TCompareOp compareOp) { + this.compareOp = compareOp; + return this; + } + + public void unsetCompareOp() { + this.compareOp = null; + } + + /** Returns true if field compareOp is set (has been assigned a value) and false otherwise */ + public boolean isSetCompareOp() { + return this.compareOp != null; + } + + public void setCompareOpIsSet(boolean value) { + if (!value) { + this.compareOp = null; + } + } + + /** + * the expected value to be compared against, if not provided the + * check is for the non-existence of the column in question + */ + public byte[] getValue() { + setValue(org.apache.thrift.TBaseHelper.rightSize(value)); + return value == null ? null : value.array(); + } + + public ByteBuffer bufferForValue() { + return org.apache.thrift.TBaseHelper.copyBinary(value); + } + + /** + * the expected value to be compared against, if not provided the + * check is for the non-existence of the column in question + */ + public checkAndMutate_args setValue(byte[] value) { + this.value = value == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(value, value.length)); + return this; + } + + public checkAndMutate_args setValue(ByteBuffer value) { + this.value = org.apache.thrift.TBaseHelper.copyBinary(value); + return this; + } + + public void unsetValue() { + this.value = null; + } + + /** Returns true if field value is set (has been assigned a value) and false otherwise */ + public boolean isSetValue() { + return this.value != null; + } + + public void setValueIsSet(boolean value) { + if (!value) { + this.value = null; + } + } + + /** + * row mutations to execute if the value matches + */ + public TRowMutations getRowMutations() { + return this.rowMutations; + } + + /** + * row mutations to execute if the value matches + */ + public checkAndMutate_args setRowMutations(TRowMutations rowMutations) { + this.rowMutations = rowMutations; + return this; + } + + public void unsetRowMutations() { + this.rowMutations = null; + } + + /** Returns true if field rowMutations is set (has been assigned a value) and false otherwise */ + public boolean isSetRowMutations() { + return this.rowMutations != null; + } + + public void setRowMutationsIsSet(boolean value) { + if (!value) { + this.rowMutations = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case TABLE: + if (value == null) { + unsetTable(); + } else { + setTable((ByteBuffer)value); + } + break; + + case ROW: + if (value == null) { + unsetRow(); + } else { + setRow((ByteBuffer)value); + } + break; + + case FAMILY: + if (value == null) { + unsetFamily(); + } else { + setFamily((ByteBuffer)value); + } + break; + + case QUALIFIER: + if (value == null) { + unsetQualifier(); + } else { + setQualifier((ByteBuffer)value); + } + break; + + case COMPARE_OP: + if (value == null) { + unsetCompareOp(); + } else { + setCompareOp((TCompareOp)value); + } + break; + + case VALUE: + if (value == null) { + unsetValue(); + } else { + setValue((ByteBuffer)value); + } + break; + + case ROW_MUTATIONS: + if (value == null) { + unsetRowMutations(); + } else { + setRowMutations((TRowMutations)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case TABLE: + return getTable(); + + case ROW: + return getRow(); + + case FAMILY: + return getFamily(); + + case QUALIFIER: + return getQualifier(); + + case COMPARE_OP: + return getCompareOp(); + + case VALUE: + return getValue(); + + case ROW_MUTATIONS: + return getRowMutations(); + + } + 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: + return isSetTable(); + case ROW: + return isSetRow(); + case FAMILY: + return isSetFamily(); + case QUALIFIER: + return isSetQualifier(); + case COMPARE_OP: + return isSetCompareOp(); + case VALUE: + return isSetValue(); + case ROW_MUTATIONS: + return isSetRowMutations(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof checkAndMutate_args) + return this.equals((checkAndMutate_args)that); + return false; + } + + public boolean equals(checkAndMutate_args that) { + if (that == null) + return false; + + boolean this_present_table = true && this.isSetTable(); + boolean that_present_table = true && that.isSetTable(); + if (this_present_table || that_present_table) { + if (!(this_present_table && that_present_table)) + return false; + if (!this.table.equals(that.table)) + return false; + } + + boolean this_present_row = true && this.isSetRow(); + boolean that_present_row = true && that.isSetRow(); + if (this_present_row || that_present_row) { + if (!(this_present_row && that_present_row)) + return false; + if (!this.row.equals(that.row)) + return false; + } + + boolean this_present_family = true && this.isSetFamily(); + boolean that_present_family = true && that.isSetFamily(); + if (this_present_family || that_present_family) { + if (!(this_present_family && that_present_family)) + return false; + if (!this.family.equals(that.family)) + 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; + } + + boolean this_present_compareOp = true && this.isSetCompareOp(); + boolean that_present_compareOp = true && that.isSetCompareOp(); + if (this_present_compareOp || that_present_compareOp) { + if (!(this_present_compareOp && that_present_compareOp)) + return false; + if (!this.compareOp.equals(that.compareOp)) + return false; + } + + boolean this_present_value = true && this.isSetValue(); + boolean that_present_value = true && that.isSetValue(); + if (this_present_value || that_present_value) { + if (!(this_present_value && that_present_value)) + return false; + if (!this.value.equals(that.value)) + return false; + } + + boolean this_present_rowMutations = true && this.isSetRowMutations(); + boolean that_present_rowMutations = true && that.isSetRowMutations(); + if (this_present_rowMutations || that_present_rowMutations) { + if (!(this_present_rowMutations && that_present_rowMutations)) + return false; + if (!this.rowMutations.equals(that.rowMutations)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_table = true && (isSetTable()); + list.add(present_table); + if (present_table) + list.add(table); + + boolean present_row = true && (isSetRow()); + list.add(present_row); + if (present_row) + list.add(row); + + boolean present_family = true && (isSetFamily()); + list.add(present_family); + if (present_family) + list.add(family); + + boolean present_qualifier = true && (isSetQualifier()); + list.add(present_qualifier); + if (present_qualifier) + list.add(qualifier); + + boolean present_compareOp = true && (isSetCompareOp()); + list.add(present_compareOp); + if (present_compareOp) + list.add(compareOp.getValue()); + + boolean present_value = true && (isSetValue()); + list.add(present_value); + if (present_value) + list.add(value); + + boolean present_rowMutations = true && (isSetRowMutations()); + list.add(present_rowMutations); + if (present_rowMutations) + list.add(rowMutations); + + return list.hashCode(); + } + + @Override + public int compareTo(checkAndMutate_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetTable()).compareTo(other.isSetTable()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTable()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.table, other.table); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetRow()).compareTo(other.isSetRow()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRow()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.row, other.row); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetFamily()).compareTo(other.isSetFamily()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetFamily()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.family, other.family); + 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; + } + } + lastComparison = Boolean.valueOf(isSetCompareOp()).compareTo(other.isSetCompareOp()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetCompareOp()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.compareOp, other.compareOp); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValue()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, other.value); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetRowMutations()).compareTo(other.isSetRowMutations()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRowMutations()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.rowMutations, other.rowMutations); + 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("checkAndMutate_args("); + boolean first = true; + + sb.append("table:"); + if (this.table == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.table, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("row:"); + if (this.row == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.row, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("family:"); + if (this.family == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.family, 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; + if (!first) sb.append(", "); + sb.append("compareOp:"); + if (this.compareOp == null) { + sb.append("null"); + } else { + sb.append(this.compareOp); + } + first = false; + if (!first) sb.append(", "); + sb.append("value:"); + if (this.value == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.value, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("rowMutations:"); + if (this.rowMutations == null) { + sb.append("null"); + } else { + sb.append(this.rowMutations); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (table == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'table' was not present! Struct: " + toString()); + } + if (row == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'row' was not present! Struct: " + toString()); + } + if (family == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'family' was not present! Struct: " + toString()); + } + if (qualifier == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'qualifier' was not present! Struct: " + toString()); + } + if (compareOp == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'compareOp' was not present! Struct: " + toString()); + } + if (rowMutations == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'rowMutations' was not present! Struct: " + toString()); + } + // check for sub-struct validity + if (rowMutations != null) { + rowMutations.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 checkAndMutate_argsStandardSchemeFactory implements SchemeFactory { + public checkAndMutate_argsStandardScheme getScheme() { + return new checkAndMutate_argsStandardScheme(); + } + } + + private static class checkAndMutate_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, checkAndMutate_args 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 + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.table = iprot.readBinary(); + struct.setTableIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // ROW + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.row = iprot.readBinary(); + struct.setRowIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // FAMILY + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.family = iprot.readBinary(); + struct.setFamilyIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // 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; + case 5: // COMPARE_OP + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.compareOp = org.apache.hadoop.hbase.thrift2.generated.TCompareOp.findByValue(iprot.readI32()); + struct.setCompareOpIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 6: // VALUE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.value = iprot.readBinary(); + struct.setValueIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 7: // ROW_MUTATIONS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.rowMutations = new TRowMutations(); + struct.rowMutations.read(iprot); + struct.setRowMutationsIsSet(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, checkAndMutate_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.table != null) { + oprot.writeFieldBegin(TABLE_FIELD_DESC); + oprot.writeBinary(struct.table); + oprot.writeFieldEnd(); + } + if (struct.row != null) { + oprot.writeFieldBegin(ROW_FIELD_DESC); + oprot.writeBinary(struct.row); + oprot.writeFieldEnd(); + } + if (struct.family != null) { + oprot.writeFieldBegin(FAMILY_FIELD_DESC); + oprot.writeBinary(struct.family); + oprot.writeFieldEnd(); + } + if (struct.qualifier != null) { + oprot.writeFieldBegin(QUALIFIER_FIELD_DESC); + oprot.writeBinary(struct.qualifier); + oprot.writeFieldEnd(); + } + if (struct.compareOp != null) { + oprot.writeFieldBegin(COMPARE_OP_FIELD_DESC); + oprot.writeI32(struct.compareOp.getValue()); + oprot.writeFieldEnd(); + } + if (struct.value != null) { + oprot.writeFieldBegin(VALUE_FIELD_DESC); + oprot.writeBinary(struct.value); + oprot.writeFieldEnd(); + } + if (struct.rowMutations != null) { + oprot.writeFieldBegin(ROW_MUTATIONS_FIELD_DESC); + struct.rowMutations.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class checkAndMutate_argsTupleSchemeFactory implements SchemeFactory { + public checkAndMutate_argsTupleScheme getScheme() { + return new checkAndMutate_argsTupleScheme(); + } + } + + private static class checkAndMutate_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, checkAndMutate_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeBinary(struct.table); + oprot.writeBinary(struct.row); + oprot.writeBinary(struct.family); + oprot.writeBinary(struct.qualifier); + oprot.writeI32(struct.compareOp.getValue()); + struct.rowMutations.write(oprot); + BitSet optionals = new BitSet(); + if (struct.isSetValue()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetValue()) { + oprot.writeBinary(struct.value); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, checkAndMutate_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.table = iprot.readBinary(); + struct.setTableIsSet(true); + struct.row = iprot.readBinary(); + struct.setRowIsSet(true); + struct.family = iprot.readBinary(); + struct.setFamilyIsSet(true); + struct.qualifier = iprot.readBinary(); + struct.setQualifierIsSet(true); + struct.compareOp = org.apache.hadoop.hbase.thrift2.generated.TCompareOp.findByValue(iprot.readI32()); + struct.setCompareOpIsSet(true); + struct.rowMutations = new TRowMutations(); + struct.rowMutations.read(iprot); + struct.setRowMutationsIsSet(true); + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.value = iprot.readBinary(); + struct.setValueIsSet(true); + } + } + } + + } + + public static class checkAndMutate_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("checkAndMutate_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0); + private static final org.apache.thrift.protocol.TField IO_FIELD_DESC = new org.apache.thrift.protocol.TField("io", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new checkAndMutate_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new checkAndMutate_resultTupleSchemeFactory()); + } + + public boolean success; // required + public TIOError io; // 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 { + SUCCESS((short)0, "success"), + IO((short)1, "io"); + + private static final Map byName = new HashMap(); + + 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 0: // SUCCESS + return SUCCESS; + case 1: // IO + return IO; + 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 int __SUCCESS_ISSET_ID = 0; + private byte __isset_bitfield = 0; + 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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + tmpMap.put(_Fields.IO, new org.apache.thrift.meta_data.FieldMetaData("io", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(checkAndMutate_result.class, metaDataMap); + } + + public checkAndMutate_result() { + } + + public checkAndMutate_result( + boolean success, + TIOError io) + { + this(); + this.success = success; + setSuccessIsSet(true); + this.io = io; + } + + /** + * Performs a deep copy on other. + */ + public checkAndMutate_result(checkAndMutate_result other) { + __isset_bitfield = other.__isset_bitfield; + this.success = other.success; + if (other.isSetIo()) { + this.io = new TIOError(other.io); + } + } + + public checkAndMutate_result deepCopy() { + return new checkAndMutate_result(this); + } + + @Override + public void clear() { + setSuccessIsSet(false); + this.success = false; + this.io = null; + } + + public boolean isSuccess() { + return this.success; + } + + public checkAndMutate_result setSuccess(boolean success) { + this.success = success; + setSuccessIsSet(true); + return this; + } + + public void unsetSuccess() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + public void setSuccessIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); + } + + public TIOError getIo() { + return this.io; + } + + public checkAndMutate_result setIo(TIOError io) { + this.io = io; + return this; + } + + public void unsetIo() { + this.io = null; + } + + /** Returns true if field io is set (has been assigned a value) and false otherwise */ + public boolean isSetIo() { + return this.io != null; + } + + public void setIoIsSet(boolean value) { + if (!value) { + this.io = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((Boolean)value); + } + break; + + case IO: + if (value == null) { + unsetIo(); + } else { + setIo((TIOError)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return isSuccess(); + + case IO: + return getIo(); + + } + 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 SUCCESS: + return isSetSuccess(); + case IO: + return isSetIo(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof checkAndMutate_result) + return this.equals((checkAndMutate_result)that); + return false; + } + + public boolean equals(checkAndMutate_result that) { + if (that == null) + return false; + + boolean this_present_success = true; + boolean that_present_success = true; + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (this.success != that.success) + return false; + } + + boolean this_present_io = true && this.isSetIo(); + boolean that_present_io = true && that.isSetIo(); + if (this_present_io || that_present_io) { + if (!(this_present_io && that_present_io)) + return false; + if (!this.io.equals(that.io)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true; + list.add(present_success); + if (present_success) + list.add(success); + + boolean present_io = true && (isSetIo()); + list.add(present_io); + if (present_io) + list.add(io); + + return list.hashCode(); + } + + @Override + public int compareTo(checkAndMutate_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIo()).compareTo(other.isSetIo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, other.io); + 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("checkAndMutate_result("); + boolean first = true; + + sb.append("success:"); + sb.append(this.success); + first = false; + if (!first) sb.append(", "); + sb.append("io:"); + if (this.io == null) { + sb.append("null"); + } else { + sb.append(this.io); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 { + // 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); + } + } + + private static class checkAndMutate_resultStandardSchemeFactory implements SchemeFactory { + public checkAndMutate_resultStandardScheme getScheme() { + return new checkAndMutate_resultStandardScheme(); + } + } + + private static class checkAndMutate_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, checkAndMutate_result 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 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IO + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.io = new TIOError(); + struct.io.read(iprot); + struct.setIoIsSet(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, checkAndMutate_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeBool(struct.success); + oprot.writeFieldEnd(); + } + if (struct.io != null) { + oprot.writeFieldBegin(IO_FIELD_DESC); + struct.io.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class checkAndMutate_resultTupleSchemeFactory implements SchemeFactory { + public checkAndMutate_resultTupleScheme getScheme() { + return new checkAndMutate_resultTupleScheme(); + } + } + + private static class checkAndMutate_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, checkAndMutate_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIo()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + oprot.writeBool(struct.success); + } + if (struct.isSetIo()) { + struct.io.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, checkAndMutate_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.io = new TIOError(); + struct.io.read(iprot); + struct.setIoIsSet(true); + } + } + } + + } + +} diff --git "a/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/THRegionInfo.java" "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/THRegionInfo.java" new file mode 100644 index 00000000000..129ab2e96e2 --- /dev/null +++ "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/THRegionInfo.java" @@ -0,0 +1,1039 @@ +/** + * 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 = "2016-05-25") +public class THRegionInfo implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("THRegionInfo"); + + private static final org.apache.thrift.protocol.TField REGION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("regionId", org.apache.thrift.protocol.TType.I64, (short)1); + private static final org.apache.thrift.protocol.TField TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tableName", org.apache.thrift.protocol.TType.STRING, (short)2); + private static final org.apache.thrift.protocol.TField START_KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("startKey", org.apache.thrift.protocol.TType.STRING, (short)3); + private static final org.apache.thrift.protocol.TField END_KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("endKey", org.apache.thrift.protocol.TType.STRING, (short)4); + private static final org.apache.thrift.protocol.TField OFFLINE_FIELD_DESC = new org.apache.thrift.protocol.TField("offline", org.apache.thrift.protocol.TType.BOOL, (short)5); + private static final org.apache.thrift.protocol.TField SPLIT_FIELD_DESC = new org.apache.thrift.protocol.TField("split", org.apache.thrift.protocol.TType.BOOL, (short)6); + private static final org.apache.thrift.protocol.TField REPLICA_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("replicaId", org.apache.thrift.protocol.TType.I32, (short)7); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new THRegionInfoStandardSchemeFactory()); + schemes.put(TupleScheme.class, new THRegionInfoTupleSchemeFactory()); + } + + public long regionId; // required + public ByteBuffer tableName; // required + public ByteBuffer startKey; // optional + public ByteBuffer endKey; // optional + public boolean offline; // optional + public boolean split; // optional + public int replicaId; // 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 { + REGION_ID((short)1, "regionId"), + TABLE_NAME((short)2, "tableName"), + START_KEY((short)3, "startKey"), + END_KEY((short)4, "endKey"), + OFFLINE((short)5, "offline"), + SPLIT((short)6, "split"), + REPLICA_ID((short)7, "replicaId"); + + private static final Map byName = new HashMap(); + + 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: // REGION_ID + return REGION_ID; + case 2: // TABLE_NAME + return TABLE_NAME; + case 3: // START_KEY + return START_KEY; + case 4: // END_KEY + return END_KEY; + case 5: // OFFLINE + return OFFLINE; + case 6: // SPLIT + return SPLIT; + case 7: // REPLICA_ID + return REPLICA_ID; + 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 int __REGIONID_ISSET_ID = 0; + private static final int __OFFLINE_ISSET_ID = 1; + private static final int __SPLIT_ISSET_ID = 2; + private static final int __REPLICAID_ISSET_ID = 3; + private byte __isset_bitfield = 0; + private static final _Fields optionals[] = {_Fields.START_KEY,_Fields.END_KEY,_Fields.OFFLINE,_Fields.SPLIT,_Fields.REPLICA_ID}; + 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.REGION_ID, new org.apache.thrift.meta_data.FieldMetaData("regionId", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.TABLE_NAME, new org.apache.thrift.meta_data.FieldMetaData("tableName", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + tmpMap.put(_Fields.START_KEY, new org.apache.thrift.meta_data.FieldMetaData("startKey", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + tmpMap.put(_Fields.END_KEY, new org.apache.thrift.meta_data.FieldMetaData("endKey", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + tmpMap.put(_Fields.OFFLINE, new org.apache.thrift.meta_data.FieldMetaData("offline", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + tmpMap.put(_Fields.SPLIT, new org.apache.thrift.meta_data.FieldMetaData("split", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + tmpMap.put(_Fields.REPLICA_ID, new org.apache.thrift.meta_data.FieldMetaData("replicaId", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(THRegionInfo.class, metaDataMap); + } + + public THRegionInfo() { + } + + public THRegionInfo( + long regionId, + ByteBuffer tableName) + { + this(); + this.regionId = regionId; + setRegionIdIsSet(true); + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(tableName); + } + + /** + * Performs a deep copy on other. + */ + public THRegionInfo(THRegionInfo other) { + __isset_bitfield = other.__isset_bitfield; + this.regionId = other.regionId; + if (other.isSetTableName()) { + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(other.tableName); + } + if (other.isSetStartKey()) { + this.startKey = org.apache.thrift.TBaseHelper.copyBinary(other.startKey); + } + if (other.isSetEndKey()) { + this.endKey = org.apache.thrift.TBaseHelper.copyBinary(other.endKey); + } + this.offline = other.offline; + this.split = other.split; + this.replicaId = other.replicaId; + } + + public THRegionInfo deepCopy() { + return new THRegionInfo(this); + } + + @Override + public void clear() { + setRegionIdIsSet(false); + this.regionId = 0; + this.tableName = null; + this.startKey = null; + this.endKey = null; + setOfflineIsSet(false); + this.offline = false; + setSplitIsSet(false); + this.split = false; + setReplicaIdIsSet(false); + this.replicaId = 0; + } + + public long getRegionId() { + return this.regionId; + } + + public THRegionInfo setRegionId(long regionId) { + this.regionId = regionId; + setRegionIdIsSet(true); + return this; + } + + public void unsetRegionId() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __REGIONID_ISSET_ID); + } + + /** Returns true if field regionId is set (has been assigned a value) and false otherwise */ + public boolean isSetRegionId() { + return EncodingUtils.testBit(__isset_bitfield, __REGIONID_ISSET_ID); + } + + public void setRegionIdIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __REGIONID_ISSET_ID, value); + } + + public byte[] getTableName() { + setTableName(org.apache.thrift.TBaseHelper.rightSize(tableName)); + return tableName == null ? null : tableName.array(); + } + + public ByteBuffer bufferForTableName() { + return org.apache.thrift.TBaseHelper.copyBinary(tableName); + } + + public THRegionInfo setTableName(byte[] tableName) { + this.tableName = tableName == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(tableName, tableName.length)); + return this; + } + + public THRegionInfo setTableName(ByteBuffer tableName) { + this.tableName = org.apache.thrift.TBaseHelper.copyBinary(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 byte[] getStartKey() { + setStartKey(org.apache.thrift.TBaseHelper.rightSize(startKey)); + return startKey == null ? null : startKey.array(); + } + + public ByteBuffer bufferForStartKey() { + return org.apache.thrift.TBaseHelper.copyBinary(startKey); + } + + public THRegionInfo setStartKey(byte[] startKey) { + this.startKey = startKey == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(startKey, startKey.length)); + return this; + } + + public THRegionInfo setStartKey(ByteBuffer startKey) { + this.startKey = org.apache.thrift.TBaseHelper.copyBinary(startKey); + return this; + } + + public void unsetStartKey() { + this.startKey = null; + } + + /** Returns true if field startKey is set (has been assigned a value) and false otherwise */ + public boolean isSetStartKey() { + return this.startKey != null; + } + + public void setStartKeyIsSet(boolean value) { + if (!value) { + this.startKey = null; + } + } + + public byte[] getEndKey() { + setEndKey(org.apache.thrift.TBaseHelper.rightSize(endKey)); + return endKey == null ? null : endKey.array(); + } + + public ByteBuffer bufferForEndKey() { + return org.apache.thrift.TBaseHelper.copyBinary(endKey); + } + + public THRegionInfo setEndKey(byte[] endKey) { + this.endKey = endKey == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(endKey, endKey.length)); + return this; + } + + public THRegionInfo setEndKey(ByteBuffer endKey) { + this.endKey = org.apache.thrift.TBaseHelper.copyBinary(endKey); + return this; + } + + public void unsetEndKey() { + this.endKey = null; + } + + /** Returns true if field endKey is set (has been assigned a value) and false otherwise */ + public boolean isSetEndKey() { + return this.endKey != null; + } + + public void setEndKeyIsSet(boolean value) { + if (!value) { + this.endKey = null; + } + } + + public boolean isOffline() { + return this.offline; + } + + public THRegionInfo setOffline(boolean offline) { + this.offline = offline; + setOfflineIsSet(true); + return this; + } + + public void unsetOffline() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __OFFLINE_ISSET_ID); + } + + /** Returns true if field offline is set (has been assigned a value) and false otherwise */ + public boolean isSetOffline() { + return EncodingUtils.testBit(__isset_bitfield, __OFFLINE_ISSET_ID); + } + + public void setOfflineIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __OFFLINE_ISSET_ID, value); + } + + public boolean isSplit() { + return this.split; + } + + public THRegionInfo setSplit(boolean split) { + this.split = split; + setSplitIsSet(true); + return this; + } + + public void unsetSplit() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SPLIT_ISSET_ID); + } + + /** Returns true if field split is set (has been assigned a value) and false otherwise */ + public boolean isSetSplit() { + return EncodingUtils.testBit(__isset_bitfield, __SPLIT_ISSET_ID); + } + + public void setSplitIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SPLIT_ISSET_ID, value); + } + + public int getReplicaId() { + return this.replicaId; + } + + public THRegionInfo setReplicaId(int replicaId) { + this.replicaId = replicaId; + setReplicaIdIsSet(true); + return this; + } + + public void unsetReplicaId() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __REPLICAID_ISSET_ID); + } + + /** Returns true if field replicaId is set (has been assigned a value) and false otherwise */ + public boolean isSetReplicaId() { + return EncodingUtils.testBit(__isset_bitfield, __REPLICAID_ISSET_ID); + } + + public void setReplicaIdIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __REPLICAID_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case REGION_ID: + if (value == null) { + unsetRegionId(); + } else { + setRegionId((Long)value); + } + break; + + case TABLE_NAME: + if (value == null) { + unsetTableName(); + } else { + setTableName((ByteBuffer)value); + } + break; + + case START_KEY: + if (value == null) { + unsetStartKey(); + } else { + setStartKey((ByteBuffer)value); + } + break; + + case END_KEY: + if (value == null) { + unsetEndKey(); + } else { + setEndKey((ByteBuffer)value); + } + break; + + case OFFLINE: + if (value == null) { + unsetOffline(); + } else { + setOffline((Boolean)value); + } + break; + + case SPLIT: + if (value == null) { + unsetSplit(); + } else { + setSplit((Boolean)value); + } + break; + + case REPLICA_ID: + if (value == null) { + unsetReplicaId(); + } else { + setReplicaId((Integer)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case REGION_ID: + return getRegionId(); + + case TABLE_NAME: + return getTableName(); + + case START_KEY: + return getStartKey(); + + case END_KEY: + return getEndKey(); + + case OFFLINE: + return isOffline(); + + case SPLIT: + return isSplit(); + + case REPLICA_ID: + return getReplicaId(); + + } + 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 REGION_ID: + return isSetRegionId(); + case TABLE_NAME: + return isSetTableName(); + case START_KEY: + return isSetStartKey(); + case END_KEY: + return isSetEndKey(); + case OFFLINE: + return isSetOffline(); + case SPLIT: + return isSetSplit(); + case REPLICA_ID: + return isSetReplicaId(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof THRegionInfo) + return this.equals((THRegionInfo)that); + return false; + } + + public boolean equals(THRegionInfo that) { + if (that == null) + return false; + + boolean this_present_regionId = true; + boolean that_present_regionId = true; + if (this_present_regionId || that_present_regionId) { + if (!(this_present_regionId && that_present_regionId)) + return false; + if (this.regionId != that.regionId) + 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_startKey = true && this.isSetStartKey(); + boolean that_present_startKey = true && that.isSetStartKey(); + if (this_present_startKey || that_present_startKey) { + if (!(this_present_startKey && that_present_startKey)) + return false; + if (!this.startKey.equals(that.startKey)) + return false; + } + + boolean this_present_endKey = true && this.isSetEndKey(); + boolean that_present_endKey = true && that.isSetEndKey(); + if (this_present_endKey || that_present_endKey) { + if (!(this_present_endKey && that_present_endKey)) + return false; + if (!this.endKey.equals(that.endKey)) + return false; + } + + boolean this_present_offline = true && this.isSetOffline(); + boolean that_present_offline = true && that.isSetOffline(); + if (this_present_offline || that_present_offline) { + if (!(this_present_offline && that_present_offline)) + return false; + if (this.offline != that.offline) + return false; + } + + boolean this_present_split = true && this.isSetSplit(); + boolean that_present_split = true && that.isSetSplit(); + if (this_present_split || that_present_split) { + if (!(this_present_split && that_present_split)) + return false; + if (this.split != that.split) + return false; + } + + boolean this_present_replicaId = true && this.isSetReplicaId(); + boolean that_present_replicaId = true && that.isSetReplicaId(); + if (this_present_replicaId || that_present_replicaId) { + if (!(this_present_replicaId && that_present_replicaId)) + return false; + if (this.replicaId != that.replicaId) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_regionId = true; + list.add(present_regionId); + if (present_regionId) + list.add(regionId); + + boolean present_tableName = true && (isSetTableName()); + list.add(present_tableName); + if (present_tableName) + list.add(tableName); + + boolean present_startKey = true && (isSetStartKey()); + list.add(present_startKey); + if (present_startKey) + list.add(startKey); + + boolean present_endKey = true && (isSetEndKey()); + list.add(present_endKey); + if (present_endKey) + list.add(endKey); + + boolean present_offline = true && (isSetOffline()); + list.add(present_offline); + if (present_offline) + list.add(offline); + + boolean present_split = true && (isSetSplit()); + list.add(present_split); + if (present_split) + list.add(split); + + boolean present_replicaId = true && (isSetReplicaId()); + list.add(present_replicaId); + if (present_replicaId) + list.add(replicaId); + + return list.hashCode(); + } + + @Override + public int compareTo(THRegionInfo other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetRegionId()).compareTo(other.isSetRegionId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRegionId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.regionId, other.regionId); + if (lastComparison != 0) { + return lastComparison; + } + } + 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(isSetStartKey()).compareTo(other.isSetStartKey()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStartKey()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startKey, other.startKey); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetEndKey()).compareTo(other.isSetEndKey()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetEndKey()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endKey, other.endKey); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetOffline()).compareTo(other.isSetOffline()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetOffline()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.offline, other.offline); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetSplit()).compareTo(other.isSetSplit()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSplit()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.split, other.split); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetReplicaId()).compareTo(other.isSetReplicaId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetReplicaId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.replicaId, other.replicaId); + 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("THRegionInfo("); + boolean first = true; + + sb.append("regionId:"); + sb.append(this.regionId); + first = false; + if (!first) sb.append(", "); + sb.append("tableName:"); + if (this.tableName == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.tableName, sb); + } + first = false; + if (isSetStartKey()) { + if (!first) sb.append(", "); + sb.append("startKey:"); + if (this.startKey == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.startKey, sb); + } + first = false; + } + if (isSetEndKey()) { + if (!first) sb.append(", "); + sb.append("endKey:"); + if (this.endKey == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.endKey, sb); + } + first = false; + } + if (isSetOffline()) { + if (!first) sb.append(", "); + sb.append("offline:"); + sb.append(this.offline); + first = false; + } + if (isSetSplit()) { + if (!first) sb.append(", "); + sb.append("split:"); + sb.append(this.split); + first = false; + } + if (isSetReplicaId()) { + if (!first) sb.append(", "); + sb.append("replicaId:"); + sb.append(this.replicaId); + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // alas, we cannot check 'regionId' because it's a primitive and you chose the non-beans generator. + if (tableName == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'tableName' 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 { + // 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); + } + } + + private static class THRegionInfoStandardSchemeFactory implements SchemeFactory { + public THRegionInfoStandardScheme getScheme() { + return new THRegionInfoStandardScheme(); + } + } + + private static class THRegionInfoStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, THRegionInfo 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: // REGION_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.regionId = iprot.readI64(); + struct.setRegionIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // TABLE_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // START_KEY + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.startKey = iprot.readBinary(); + struct.setStartKeyIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // END_KEY + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.endKey = iprot.readBinary(); + struct.setEndKeyIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // OFFLINE + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.offline = iprot.readBool(); + struct.setOfflineIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 6: // SPLIT + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.split = iprot.readBool(); + struct.setSplitIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 7: // REPLICA_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.replicaId = iprot.readI32(); + struct.setReplicaIdIsSet(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 + if (!struct.isSetRegionId()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'regionId' was not found in serialized data! Struct: " + toString()); + } + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, THRegionInfo struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(REGION_ID_FIELD_DESC); + oprot.writeI64(struct.regionId); + oprot.writeFieldEnd(); + if (struct.tableName != null) { + oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC); + oprot.writeBinary(struct.tableName); + oprot.writeFieldEnd(); + } + if (struct.startKey != null) { + if (struct.isSetStartKey()) { + oprot.writeFieldBegin(START_KEY_FIELD_DESC); + oprot.writeBinary(struct.startKey); + oprot.writeFieldEnd(); + } + } + if (struct.endKey != null) { + if (struct.isSetEndKey()) { + oprot.writeFieldBegin(END_KEY_FIELD_DESC); + oprot.writeBinary(struct.endKey); + oprot.writeFieldEnd(); + } + } + if (struct.isSetOffline()) { + oprot.writeFieldBegin(OFFLINE_FIELD_DESC); + oprot.writeBool(struct.offline); + oprot.writeFieldEnd(); + } + if (struct.isSetSplit()) { + oprot.writeFieldBegin(SPLIT_FIELD_DESC); + oprot.writeBool(struct.split); + oprot.writeFieldEnd(); + } + if (struct.isSetReplicaId()) { + oprot.writeFieldBegin(REPLICA_ID_FIELD_DESC); + oprot.writeI32(struct.replicaId); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class THRegionInfoTupleSchemeFactory implements SchemeFactory { + public THRegionInfoTupleScheme getScheme() { + return new THRegionInfoTupleScheme(); + } + } + + private static class THRegionInfoTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, THRegionInfo struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeI64(struct.regionId); + oprot.writeBinary(struct.tableName); + BitSet optionals = new BitSet(); + if (struct.isSetStartKey()) { + optionals.set(0); + } + if (struct.isSetEndKey()) { + optionals.set(1); + } + if (struct.isSetOffline()) { + optionals.set(2); + } + if (struct.isSetSplit()) { + optionals.set(3); + } + if (struct.isSetReplicaId()) { + optionals.set(4); + } + oprot.writeBitSet(optionals, 5); + if (struct.isSetStartKey()) { + oprot.writeBinary(struct.startKey); + } + if (struct.isSetEndKey()) { + oprot.writeBinary(struct.endKey); + } + if (struct.isSetOffline()) { + oprot.writeBool(struct.offline); + } + if (struct.isSetSplit()) { + oprot.writeBool(struct.split); + } + if (struct.isSetReplicaId()) { + oprot.writeI32(struct.replicaId); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, THRegionInfo struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.regionId = iprot.readI64(); + struct.setRegionIdIsSet(true); + struct.tableName = iprot.readBinary(); + struct.setTableNameIsSet(true); + BitSet incoming = iprot.readBitSet(5); + if (incoming.get(0)) { + struct.startKey = iprot.readBinary(); + struct.setStartKeyIsSet(true); + } + if (incoming.get(1)) { + struct.endKey = iprot.readBinary(); + struct.setEndKeyIsSet(true); + } + if (incoming.get(2)) { + struct.offline = iprot.readBool(); + struct.setOfflineIsSet(true); + } + if (incoming.get(3)) { + struct.split = iprot.readBool(); + struct.setSplitIsSet(true); + } + if (incoming.get(4)) { + struct.replicaId = iprot.readI32(); + struct.setReplicaIdIsSet(true); + } + } + } + +} + diff --git "a/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/THRegionLocation.java" "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/THRegionLocation.java" new file mode 100644 index 00000000000..94b25ff6875 --- /dev/null +++ "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/THRegionLocation.java" @@ -0,0 +1,502 @@ +/** + * 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 = "2016-05-25") +public class THRegionLocation implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("THRegionLocation"); + + private static final org.apache.thrift.protocol.TField SERVER_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("serverName", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final org.apache.thrift.protocol.TField REGION_INFO_FIELD_DESC = new org.apache.thrift.protocol.TField("regionInfo", org.apache.thrift.protocol.TType.STRUCT, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new THRegionLocationStandardSchemeFactory()); + schemes.put(TupleScheme.class, new THRegionLocationTupleSchemeFactory()); + } + + public TServerName serverName; // required + public THRegionInfo regionInfo; // 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 { + SERVER_NAME((short)1, "serverName"), + REGION_INFO((short)2, "regionInfo"); + + private static final Map byName = new HashMap(); + + 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: // SERVER_NAME + return SERVER_NAME; + case 2: // REGION_INFO + return REGION_INFO; + 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.SERVER_NAME, new org.apache.thrift.meta_data.FieldMetaData("serverName", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TServerName.class))); + tmpMap.put(_Fields.REGION_INFO, new org.apache.thrift.meta_data.FieldMetaData("regionInfo", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, THRegionInfo.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(THRegionLocation.class, metaDataMap); + } + + public THRegionLocation() { + } + + public THRegionLocation( + TServerName serverName, + THRegionInfo regionInfo) + { + this(); + this.serverName = serverName; + this.regionInfo = regionInfo; + } + + /** + * Performs a deep copy on other. + */ + public THRegionLocation(THRegionLocation other) { + if (other.isSetServerName()) { + this.serverName = new TServerName(other.serverName); + } + if (other.isSetRegionInfo()) { + this.regionInfo = new THRegionInfo(other.regionInfo); + } + } + + public THRegionLocation deepCopy() { + return new THRegionLocation(this); + } + + @Override + public void clear() { + this.serverName = null; + this.regionInfo = null; + } + + public TServerName getServerName() { + return this.serverName; + } + + public THRegionLocation setServerName(TServerName serverName) { + this.serverName = serverName; + return this; + } + + public void unsetServerName() { + this.serverName = null; + } + + /** Returns true if field serverName is set (has been assigned a value) and false otherwise */ + public boolean isSetServerName() { + return this.serverName != null; + } + + public void setServerNameIsSet(boolean value) { + if (!value) { + this.serverName = null; + } + } + + public THRegionInfo getRegionInfo() { + return this.regionInfo; + } + + public THRegionLocation setRegionInfo(THRegionInfo regionInfo) { + this.regionInfo = regionInfo; + return this; + } + + public void unsetRegionInfo() { + this.regionInfo = null; + } + + /** Returns true if field regionInfo is set (has been assigned a value) and false otherwise */ + public boolean isSetRegionInfo() { + return this.regionInfo != null; + } + + public void setRegionInfoIsSet(boolean value) { + if (!value) { + this.regionInfo = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SERVER_NAME: + if (value == null) { + unsetServerName(); + } else { + setServerName((TServerName)value); + } + break; + + case REGION_INFO: + if (value == null) { + unsetRegionInfo(); + } else { + setRegionInfo((THRegionInfo)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SERVER_NAME: + return getServerName(); + + case REGION_INFO: + return getRegionInfo(); + + } + 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 SERVER_NAME: + return isSetServerName(); + case REGION_INFO: + return isSetRegionInfo(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof THRegionLocation) + return this.equals((THRegionLocation)that); + return false; + } + + public boolean equals(THRegionLocation that) { + if (that == null) + return false; + + boolean this_present_serverName = true && this.isSetServerName(); + boolean that_present_serverName = true && that.isSetServerName(); + if (this_present_serverName || that_present_serverName) { + if (!(this_present_serverName && that_present_serverName)) + return false; + if (!this.serverName.equals(that.serverName)) + return false; + } + + boolean this_present_regionInfo = true && this.isSetRegionInfo(); + boolean that_present_regionInfo = true && that.isSetRegionInfo(); + if (this_present_regionInfo || that_present_regionInfo) { + if (!(this_present_regionInfo && that_present_regionInfo)) + return false; + if (!this.regionInfo.equals(that.regionInfo)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_serverName = true && (isSetServerName()); + list.add(present_serverName); + if (present_serverName) + list.add(serverName); + + boolean present_regionInfo = true && (isSetRegionInfo()); + list.add(present_regionInfo); + if (present_regionInfo) + list.add(regionInfo); + + return list.hashCode(); + } + + @Override + public int compareTo(THRegionLocation other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetServerName()).compareTo(other.isSetServerName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetServerName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serverName, other.serverName); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetRegionInfo()).compareTo(other.isSetRegionInfo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRegionInfo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.regionInfo, other.regionInfo); + 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("THRegionLocation("); + boolean first = true; + + sb.append("serverName:"); + if (this.serverName == null) { + sb.append("null"); + } else { + sb.append(this.serverName); + } + first = false; + if (!first) sb.append(", "); + sb.append("regionInfo:"); + if (this.regionInfo == null) { + sb.append("null"); + } else { + sb.append(this.regionInfo); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (serverName == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'serverName' was not present! Struct: " + toString()); + } + if (regionInfo == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'regionInfo' was not present! Struct: " + toString()); + } + // check for sub-struct validity + if (serverName != null) { + serverName.validate(); + } + if (regionInfo != null) { + regionInfo.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 THRegionLocationStandardSchemeFactory implements SchemeFactory { + public THRegionLocationStandardScheme getScheme() { + return new THRegionLocationStandardScheme(); + } + } + + private static class THRegionLocationStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, THRegionLocation 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: // SERVER_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.serverName = new TServerName(); + struct.serverName.read(iprot); + struct.setServerNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // REGION_INFO + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.regionInfo = new THRegionInfo(); + struct.regionInfo.read(iprot); + struct.setRegionInfoIsSet(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, THRegionLocation struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.serverName != null) { + oprot.writeFieldBegin(SERVER_NAME_FIELD_DESC); + struct.serverName.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.regionInfo != null) { + oprot.writeFieldBegin(REGION_INFO_FIELD_DESC); + struct.regionInfo.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class THRegionLocationTupleSchemeFactory implements SchemeFactory { + public THRegionLocationTupleScheme getScheme() { + return new THRegionLocationTupleScheme(); + } + } + + private static class THRegionLocationTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, THRegionLocation struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + struct.serverName.write(oprot); + struct.regionInfo.write(oprot); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, THRegionLocation struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.serverName = new TServerName(); + struct.serverName.read(iprot); + struct.setServerNameIsSet(true); + struct.regionInfo = new THRegionInfo(); + struct.regionInfo.read(iprot); + struct.setRegionInfoIsSet(true); + } + } + +} + diff --git "a/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TIOError.java" "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TIOError.java" new file mode 100644 index 00000000000..2e50d3d6c1f --- /dev/null +++ "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TIOError.java" @@ -0,0 +1,401 @@ +/** + * 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"}) +/** + * A TIOError exception signals that an error occurred communicating + * 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") +public class TIOError extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TIOError"); + + private static final org.apache.thrift.protocol.TField MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("message", org.apache.thrift.protocol.TType.STRING, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TIOErrorStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TIOErrorTupleSchemeFactory()); + } + + public String message; // 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 { + MESSAGE((short)1, "message"); + + private static final Map byName = new HashMap(); + + 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: // MESSAGE + return MESSAGE; + 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.MESSAGE}; + 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.MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("message", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TIOError.class, metaDataMap); + } + + public TIOError() { + } + + /** + * Performs a deep copy on other. + */ + public TIOError(TIOError other) { + if (other.isSetMessage()) { + this.message = other.message; + } + } + + public TIOError deepCopy() { + return new TIOError(this); + } + + @Override + public void clear() { + this.message = null; + } + + public String getMessage() { + return this.message; + } + + public TIOError setMessage(String message) { + this.message = message; + return this; + } + + public void unsetMessage() { + this.message = null; + } + + /** Returns true if field message is set (has been assigned a value) and false otherwise */ + public boolean isSetMessage() { + return this.message != null; + } + + public void setMessageIsSet(boolean value) { + if (!value) { + this.message = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case MESSAGE: + if (value == null) { + unsetMessage(); + } else { + setMessage((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case MESSAGE: + return getMessage(); + + } + 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 MESSAGE: + return isSetMessage(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TIOError) + return this.equals((TIOError)that); + return false; + } + + public boolean equals(TIOError that) { + if (that == null) + return false; + + boolean this_present_message = true && this.isSetMessage(); + boolean that_present_message = true && that.isSetMessage(); + if (this_present_message || that_present_message) { + if (!(this_present_message && that_present_message)) + return false; + if (!this.message.equals(that.message)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_message = true && (isSetMessage()); + list.add(present_message); + if (present_message) + list.add(message); + + return list.hashCode(); + } + + @Override + public int compareTo(TIOError other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetMessage()).compareTo(other.isSetMessage()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetMessage()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.message, other.message); + 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("TIOError("); + boolean first = true; + + if (isSetMessage()) { + sb.append("message:"); + if (this.message == null) { + sb.append("null"); + } else { + sb.append(this.message); + } + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 TIOErrorStandardSchemeFactory implements SchemeFactory { + public TIOErrorStandardScheme getScheme() { + return new TIOErrorStandardScheme(); + } + } + + private static class TIOErrorStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TIOError 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: // MESSAGE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.message = iprot.readString(); + struct.setMessageIsSet(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, TIOError struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.message != null) { + if (struct.isSetMessage()) { + oprot.writeFieldBegin(MESSAGE_FIELD_DESC); + oprot.writeString(struct.message); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TIOErrorTupleSchemeFactory implements SchemeFactory { + public TIOErrorTupleScheme getScheme() { + return new TIOErrorTupleScheme(); + } + } + + private static class TIOErrorTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TIOError struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetMessage()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetMessage()) { + oprot.writeString(struct.message); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TIOError struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.message = iprot.readString(); + struct.setMessageIsSet(true); + } + } + } + +} + diff --git "a/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TIllegalArgument.java" "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TIllegalArgument.java" new file mode 100644 index 00000000000..9387429f732 --- /dev/null +++ "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TIllegalArgument.java" @@ -0,0 +1,400 @@ +/** + * 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"}) +/** + * 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") +public class TIllegalArgument extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TIllegalArgument"); + + private static final org.apache.thrift.protocol.TField MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("message", org.apache.thrift.protocol.TType.STRING, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TIllegalArgumentStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TIllegalArgumentTupleSchemeFactory()); + } + + public String message; // 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 { + MESSAGE((short)1, "message"); + + private static final Map byName = new HashMap(); + + 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: // MESSAGE + return MESSAGE; + 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.MESSAGE}; + 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.MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("message", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TIllegalArgument.class, metaDataMap); + } + + public TIllegalArgument() { + } + + /** + * Performs a deep copy on other. + */ + public TIllegalArgument(TIllegalArgument other) { + if (other.isSetMessage()) { + this.message = other.message; + } + } + + public TIllegalArgument deepCopy() { + return new TIllegalArgument(this); + } + + @Override + public void clear() { + this.message = null; + } + + public String getMessage() { + return this.message; + } + + public TIllegalArgument setMessage(String message) { + this.message = message; + return this; + } + + public void unsetMessage() { + this.message = null; + } + + /** Returns true if field message is set (has been assigned a value) and false otherwise */ + public boolean isSetMessage() { + return this.message != null; + } + + public void setMessageIsSet(boolean value) { + if (!value) { + this.message = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case MESSAGE: + if (value == null) { + unsetMessage(); + } else { + setMessage((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case MESSAGE: + return getMessage(); + + } + 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 MESSAGE: + return isSetMessage(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TIllegalArgument) + return this.equals((TIllegalArgument)that); + return false; + } + + public boolean equals(TIllegalArgument that) { + if (that == null) + return false; + + boolean this_present_message = true && this.isSetMessage(); + boolean that_present_message = true && that.isSetMessage(); + if (this_present_message || that_present_message) { + if (!(this_present_message && that_present_message)) + return false; + if (!this.message.equals(that.message)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_message = true && (isSetMessage()); + list.add(present_message); + if (present_message) + list.add(message); + + return list.hashCode(); + } + + @Override + public int compareTo(TIllegalArgument other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetMessage()).compareTo(other.isSetMessage()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetMessage()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.message, other.message); + 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("TIllegalArgument("); + boolean first = true; + + if (isSetMessage()) { + sb.append("message:"); + if (this.message == null) { + sb.append("null"); + } else { + sb.append(this.message); + } + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // 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 TIllegalArgumentStandardSchemeFactory implements SchemeFactory { + public TIllegalArgumentStandardScheme getScheme() { + return new TIllegalArgumentStandardScheme(); + } + } + + private static class TIllegalArgumentStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TIllegalArgument 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: // MESSAGE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.message = iprot.readString(); + struct.setMessageIsSet(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, TIllegalArgument struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.message != null) { + if (struct.isSetMessage()) { + oprot.writeFieldBegin(MESSAGE_FIELD_DESC); + oprot.writeString(struct.message); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TIllegalArgumentTupleSchemeFactory implements SchemeFactory { + public TIllegalArgumentTupleScheme getScheme() { + return new TIllegalArgumentTupleScheme(); + } + } + + private static class TIllegalArgumentTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TIllegalArgument struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetMessage()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetMessage()) { + oprot.writeString(struct.message); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TIllegalArgument struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.message = iprot.readString(); + struct.setMessageIsSet(true); + } + } + } + +} + diff --git "a/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TIncrement.java" "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TIncrement.java" new file mode 100644 index 00000000000..8d62eb50221 --- /dev/null +++ "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TIncrement.java" @@ -0,0 +1,961 @@ +/** + * 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"}) +/** + * Used to perform Increment operations for a single row. + * + * You can specify how this Increment should be written to the write-ahead Log (WAL) + * 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") +public class TIncrement implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TIncrement"); + + 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 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)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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TIncrementStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TIncrementTupleSchemeFactory()); + } + + public ByteBuffer row; // required + public List columns; // required + public Map attributes; // optional + /** + * + * @see TDurability + */ + public TDurability durability; // optional + public TCellVisibility cellVisibility; // 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"), + COLUMNS((short)2, "columns"), + ATTRIBUTES((short)4, "attributes"), + /** + * + * @see TDurability + */ + DURABILITY((short)5, "durability"), + CELL_VISIBILITY((short)6, "cellVisibility"); + + private static final Map byName = new HashMap(); + + 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: // ROW + return ROW; + case 2: // COLUMNS + return COLUMNS; + case 4: // ATTRIBUTES + return ATTRIBUTES; + case 5: // DURABILITY + return DURABILITY; + case 6: // CELL_VISIBILITY + return CELL_VISIBILITY; + 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.ATTRIBUTES,_Fields.DURABILITY,_Fields.CELL_VISIBILITY}; + 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.ROW, new org.apache.thrift.meta_data.FieldMetaData("row", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + tmpMap.put(_Fields.COLUMNS, new org.apache.thrift.meta_data.FieldMetaData("columns", org.apache.thrift.TFieldRequirementType.REQUIRED, + 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, TColumnIncrement.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))); + 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))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TIncrement.class, metaDataMap); + } + + public TIncrement() { + } + + public TIncrement( + ByteBuffer row, + List columns) + { + this(); + this.row = org.apache.thrift.TBaseHelper.copyBinary(row); + this.columns = columns; + } + + /** + * Performs a deep copy on other. + */ + public TIncrement(TIncrement other) { + if (other.isSetRow()) { + this.row = org.apache.thrift.TBaseHelper.copyBinary(other.row); + } + if (other.isSetColumns()) { + List __this__columns = new ArrayList(other.columns.size()); + for (TColumnIncrement other_element : other.columns) { + __this__columns.add(new TColumnIncrement(other_element)); + } + this.columns = __this__columns; + } + if (other.isSetAttributes()) { + Map __this__attributes = new HashMap(other.attributes); + this.attributes = __this__attributes; + } + if (other.isSetDurability()) { + this.durability = other.durability; + } + if (other.isSetCellVisibility()) { + this.cellVisibility = new TCellVisibility(other.cellVisibility); + } + } + + public TIncrement deepCopy() { + return new TIncrement(this); + } + + @Override + public void clear() { + this.row = null; + this.columns = null; + this.attributes = null; + this.durability = null; + this.cellVisibility = null; + } + + public byte[] getRow() { + setRow(org.apache.thrift.TBaseHelper.rightSize(row)); + return row == null ? null : row.array(); + } + + public ByteBuffer bufferForRow() { + return org.apache.thrift.TBaseHelper.copyBinary(row); + } + + public TIncrement setRow(byte[] row) { + this.row = row == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(row, row.length)); + return this; + } + + public TIncrement setRow(ByteBuffer row) { + this.row = org.apache.thrift.TBaseHelper.copyBinary(row); + return this; + } + + public void unsetRow() { + this.row = null; + } + + /** Returns true if field row is set (has been assigned a value) and false otherwise */ + public boolean isSetRow() { + return this.row != null; + } + + public void setRowIsSet(boolean value) { + if (!value) { + this.row = null; + } + } + + public int getColumnsSize() { + return (this.columns == null) ? 0 : this.columns.size(); + } + + public java.util.Iterator getColumnsIterator() { + return (this.columns == null) ? null : this.columns.iterator(); + } + + public void addToColumns(TColumnIncrement elem) { + if (this.columns == null) { + this.columns = new ArrayList(); + } + this.columns.add(elem); + } + + public List getColumns() { + return this.columns; + } + + public TIncrement setColumns(List 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(); + } + this.attributes.put(key, val); + } + + public Map getAttributes() { + return this.attributes; + } + + public TIncrement setAttributes(Map 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 TIncrement 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 TCellVisibility getCellVisibility() { + return this.cellVisibility; + } + + public TIncrement setCellVisibility(TCellVisibility cellVisibility) { + this.cellVisibility = cellVisibility; + return this; + } + + public void unsetCellVisibility() { + this.cellVisibility = null; + } + + /** Returns true if field cellVisibility is set (has been assigned a value) and false otherwise */ + public boolean isSetCellVisibility() { + return this.cellVisibility != null; + } + + public void setCellVisibilityIsSet(boolean value) { + if (!value) { + this.cellVisibility = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case ROW: + if (value == null) { + unsetRow(); + } else { + setRow((ByteBuffer)value); + } + break; + + case COLUMNS: + if (value == null) { + unsetColumns(); + } else { + setColumns((List)value); + } + break; + + case ATTRIBUTES: + if (value == null) { + unsetAttributes(); + } else { + setAttributes((Map)value); + } + break; + + case DURABILITY: + if (value == null) { + unsetDurability(); + } else { + setDurability((TDurability)value); + } + break; + + case CELL_VISIBILITY: + if (value == null) { + unsetCellVisibility(); + } else { + setCellVisibility((TCellVisibility)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case ROW: + return getRow(); + + case COLUMNS: + return getColumns(); + + case ATTRIBUTES: + return getAttributes(); + + case DURABILITY: + return getDurability(); + + case CELL_VISIBILITY: + return getCellVisibility(); + + } + 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 ROW: + return isSetRow(); + case COLUMNS: + return isSetColumns(); + case ATTRIBUTES: + return isSetAttributes(); + case DURABILITY: + return isSetDurability(); + case CELL_VISIBILITY: + return isSetCellVisibility(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TIncrement) + return this.equals((TIncrement)that); + return false; + } + + public boolean equals(TIncrement that) { + if (that == null) + return false; + + boolean this_present_row = true && this.isSetRow(); + boolean that_present_row = true && that.isSetRow(); + if (this_present_row || that_present_row) { + if (!(this_present_row && that_present_row)) + return false; + if (!this.row.equals(that.row)) + 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; + } + + boolean this_present_cellVisibility = true && this.isSetCellVisibility(); + boolean that_present_cellVisibility = true && that.isSetCellVisibility(); + if (this_present_cellVisibility || that_present_cellVisibility) { + if (!(this_present_cellVisibility && that_present_cellVisibility)) + return false; + if (!this.cellVisibility.equals(that.cellVisibility)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_row = true && (isSetRow()); + list.add(present_row); + if (present_row) + list.add(row); + + 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()); + + boolean present_cellVisibility = true && (isSetCellVisibility()); + list.add(present_cellVisibility); + if (present_cellVisibility) + list.add(cellVisibility); + + return list.hashCode(); + } + + @Override + public int compareTo(TIncrement other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetRow()).compareTo(other.isSetRow()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRow()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.row, other.row); + 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; + } + } + lastComparison = Boolean.valueOf(isSetCellVisibility()).compareTo(other.isSetCellVisibility()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetCellVisibility()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cellVisibility, other.cellVisibility); + 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("TIncrement("); + boolean first = true; + + sb.append("row:"); + if (this.row == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.row, sb); + } + first = false; + 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; + } + if (isSetCellVisibility()) { + if (!first) sb.append(", "); + sb.append("cellVisibility:"); + if (this.cellVisibility == null) { + sb.append("null"); + } else { + sb.append(this.cellVisibility); + } + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (row == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'row' was not present! Struct: " + toString()); + } + if (columns == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'columns' was not present! Struct: " + toString()); + } + // check for sub-struct validity + if (cellVisibility != null) { + cellVisibility.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 TIncrementStandardSchemeFactory implements SchemeFactory { + public TIncrementStandardScheme getScheme() { + return new TIncrementStandardScheme(); + } + } + + private static class TIncrementStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TIncrement 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: // ROW + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.row = iprot.readBinary(); + struct.setRowIsSet(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 _list70 = iprot.readListBegin(); + struct.columns = new ArrayList(_list70.size); + TColumnIncrement _elem71; + for (int _i72 = 0; _i72 < _list70.size; ++_i72) + { + _elem71 = new TColumnIncrement(); + _elem71.read(iprot); + struct.columns.add(_elem71); + } + iprot.readListEnd(); + } + struct.setColumnsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // ATTRIBUTES + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map73 = iprot.readMapBegin(); + struct.attributes = new HashMap(2*_map73.size); + ByteBuffer _key74; + ByteBuffer _val75; + for (int _i76 = 0; _i76 < _map73.size; ++_i76) + { + _key74 = iprot.readBinary(); + _val75 = iprot.readBinary(); + struct.attributes.put(_key74, _val75); + } + iprot.readMapEnd(); + } + struct.setAttributesIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // 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; + case 6: // CELL_VISIBILITY + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.cellVisibility = new TCellVisibility(); + struct.cellVisibility.read(iprot); + struct.setCellVisibilityIsSet(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, TIncrement struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.row != null) { + oprot.writeFieldBegin(ROW_FIELD_DESC); + oprot.writeBinary(struct.row); + oprot.writeFieldEnd(); + } + if (struct.columns != null) { + oprot.writeFieldBegin(COLUMNS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.columns.size())); + for (TColumnIncrement _iter77 : struct.columns) + { + _iter77.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 _iter78 : struct.attributes.entrySet()) + { + oprot.writeBinary(_iter78.getKey()); + oprot.writeBinary(_iter78.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + } + if (struct.durability != null) { + if (struct.isSetDurability()) { + oprot.writeFieldBegin(DURABILITY_FIELD_DESC); + oprot.writeI32(struct.durability.getValue()); + oprot.writeFieldEnd(); + } + } + if (struct.cellVisibility != null) { + if (struct.isSetCellVisibility()) { + oprot.writeFieldBegin(CELL_VISIBILITY_FIELD_DESC); + struct.cellVisibility.write(oprot); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TIncrementTupleSchemeFactory implements SchemeFactory { + public TIncrementTupleScheme getScheme() { + return new TIncrementTupleScheme(); + } + } + + private static class TIncrementTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TIncrement struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeBinary(struct.row); + { + oprot.writeI32(struct.columns.size()); + for (TColumnIncrement _iter79 : struct.columns) + { + _iter79.write(oprot); + } + } + BitSet optionals = new BitSet(); + if (struct.isSetAttributes()) { + optionals.set(0); + } + if (struct.isSetDurability()) { + optionals.set(1); + } + if (struct.isSetCellVisibility()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetAttributes()) { + { + oprot.writeI32(struct.attributes.size()); + for (Map.Entry _iter80 : struct.attributes.entrySet()) + { + oprot.writeBinary(_iter80.getKey()); + oprot.writeBinary(_iter80.getValue()); + } + } + } + if (struct.isSetDurability()) { + oprot.writeI32(struct.durability.getValue()); + } + if (struct.isSetCellVisibility()) { + struct.cellVisibility.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TIncrement struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.row = iprot.readBinary(); + struct.setRowIsSet(true); + { + org.apache.thrift.protocol.TList _list81 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.columns = new ArrayList(_list81.size); + TColumnIncrement _elem82; + for (int _i83 = 0; _i83 < _list81.size; ++_i83) + { + _elem82 = new TColumnIncrement(); + _elem82.read(iprot); + struct.columns.add(_elem82); + } + } + struct.setColumnsIsSet(true); + BitSet incoming = iprot.readBitSet(3); + 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()); + struct.attributes = new HashMap(2*_map84.size); + ByteBuffer _key85; + ByteBuffer _val86; + for (int _i87 = 0; _i87 < _map84.size; ++_i87) + { + _key85 = iprot.readBinary(); + _val86 = iprot.readBinary(); + struct.attributes.put(_key85, _val86); + } + } + struct.setAttributesIsSet(true); + } + if (incoming.get(1)) { + struct.durability = org.apache.hadoop.hbase.thrift2.generated.TDurability.findByValue(iprot.readI32()); + struct.setDurabilityIsSet(true); + } + if (incoming.get(2)) { + struct.cellVisibility = new TCellVisibility(); + struct.cellVisibility.read(iprot); + struct.setCellVisibilityIsSet(true); + } + } + } + +} + diff --git "a/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TMutation.java" "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TMutation.java" new file mode 100644 index 00000000000..39379d1d0ae --- /dev/null +++ "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TMutation.java" @@ -0,0 +1,373 @@ +/** + * 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"}) +/** + * Atomic mutation for the specified row. It can be either Put or Delete. + */ +public class TMutation extends org.apache.thrift.TUnion { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TMutation"); + private static final org.apache.thrift.protocol.TField PUT_FIELD_DESC = new org.apache.thrift.protocol.TField("put", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final org.apache.thrift.protocol.TField DELETE_SINGLE_FIELD_DESC = new org.apache.thrift.protocol.TField("deleteSingle", org.apache.thrift.protocol.TType.STRUCT, (short)2); + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + PUT((short)1, "put"), + DELETE_SINGLE((short)2, "deleteSingle"); + + private static final Map byName = new HashMap(); + + 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: // PUT + return PUT; + case 2: // DELETE_SINGLE + return DELETE_SINGLE; + 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; + } + } + + 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.PUT, new org.apache.thrift.meta_data.FieldMetaData("put", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TPut.class))); + tmpMap.put(_Fields.DELETE_SINGLE, new org.apache.thrift.meta_data.FieldMetaData("deleteSingle", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TDelete.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TMutation.class, metaDataMap); + } + + public TMutation() { + super(); + } + + public TMutation(_Fields setField, Object value) { + super(setField, value); + } + + public TMutation(TMutation other) { + super(other); + } + public TMutation deepCopy() { + return new TMutation(this); + } + + public static TMutation put(TPut value) { + TMutation x = new TMutation(); + x.setPut(value); + return x; + } + + public static TMutation deleteSingle(TDelete value) { + TMutation x = new TMutation(); + x.setDeleteSingle(value); + return x; + } + + + @Override + protected void checkType(_Fields setField, Object value) throws ClassCastException { + switch (setField) { + case PUT: + if (value instanceof TPut) { + break; + } + throw new ClassCastException("Was expecting value of type TPut for field 'put', but got " + value.getClass().getSimpleName()); + case DELETE_SINGLE: + if (value instanceof TDelete) { + break; + } + throw new ClassCastException("Was expecting value of type TDelete for field 'deleteSingle', but got " + value.getClass().getSimpleName()); + default: + throw new IllegalArgumentException("Unknown field id " + setField); + } + } + + @Override + protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException { + _Fields setField = _Fields.findByThriftId(field.id); + if (setField != null) { + switch (setField) { + case PUT: + if (field.type == PUT_FIELD_DESC.type) { + TPut put; + put = new TPut(); + put.read(iprot); + return put; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + case DELETE_SINGLE: + if (field.type == DELETE_SINGLE_FIELD_DESC.type) { + TDelete deleteSingle; + deleteSingle = new TDelete(); + deleteSingle.read(iprot); + return deleteSingle; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + default: + throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); + } + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + } + + @Override + protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + switch (setField_) { + case PUT: + TPut put = (TPut)value_; + put.write(oprot); + return; + case DELETE_SINGLE: + TDelete deleteSingle = (TDelete)value_; + deleteSingle.write(oprot); + return; + default: + throw new IllegalStateException("Cannot write union with unknown field " + setField_); + } + } + + @Override + protected Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException { + _Fields setField = _Fields.findByThriftId(fieldID); + if (setField != null) { + switch (setField) { + case PUT: + TPut put; + put = new TPut(); + put.read(iprot); + return put; + case DELETE_SINGLE: + TDelete deleteSingle; + deleteSingle = new TDelete(); + deleteSingle.read(iprot); + return deleteSingle; + default: + throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); + } + } else { + throw new TProtocolException("Couldn't find a field with field id " + fieldID); + } + } + + @Override + protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + switch (setField_) { + case PUT: + TPut put = (TPut)value_; + put.write(oprot); + return; + case DELETE_SINGLE: + TDelete deleteSingle = (TDelete)value_; + deleteSingle.write(oprot); + return; + default: + throw new IllegalStateException("Cannot write union with unknown field " + setField_); + } + } + + @Override + protected org.apache.thrift.protocol.TField getFieldDesc(_Fields setField) { + switch (setField) { + case PUT: + return PUT_FIELD_DESC; + case DELETE_SINGLE: + return DELETE_SINGLE_FIELD_DESC; + default: + throw new IllegalArgumentException("Unknown field id " + setField); + } + } + + @Override + protected org.apache.thrift.protocol.TStruct getStructDesc() { + return STRUCT_DESC; + } + + @Override + protected _Fields enumForId(short id) { + return _Fields.findByThriftIdOrThrow(id); + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + + public TPut getPut() { + if (getSetField() == _Fields.PUT) { + return (TPut)getFieldValue(); + } else { + throw new RuntimeException("Cannot get field 'put' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void setPut(TPut value) { + if (value == null) throw new NullPointerException(); + setField_ = _Fields.PUT; + value_ = value; + } + + public TDelete getDeleteSingle() { + if (getSetField() == _Fields.DELETE_SINGLE) { + return (TDelete)getFieldValue(); + } else { + throw new RuntimeException("Cannot get field 'deleteSingle' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void setDeleteSingle(TDelete value) { + if (value == null) throw new NullPointerException(); + setField_ = _Fields.DELETE_SINGLE; + value_ = value; + } + + public boolean isSetPut() { + return setField_ == _Fields.PUT; + } + + + public boolean isSetDeleteSingle() { + return setField_ == _Fields.DELETE_SINGLE; + } + + + public boolean equals(Object other) { + if (other instanceof TMutation) { + return equals((TMutation)other); + } else { + return false; + } + } + + public boolean equals(TMutation other) { + return other != null && getSetField() == other.getSetField() && getFieldValue().equals(other.getFieldValue()); + } + + @Override + public int compareTo(TMutation other) { + int lastComparison = org.apache.thrift.TBaseHelper.compareTo(getSetField(), other.getSetField()); + if (lastComparison == 0) { + return org.apache.thrift.TBaseHelper.compareTo(getFieldValue(), other.getFieldValue()); + } + return lastComparison; + } + + + @Override + public int hashCode() { + List list = new ArrayList(); + list.add(this.getClass().getName()); + org.apache.thrift.TFieldIdEnum setField = getSetField(); + if (setField != null) { + list.add(setField.getThriftFieldId()); + Object value = getFieldValue(); + if (value instanceof org.apache.thrift.TEnum) { + list.add(((org.apache.thrift.TEnum)getFieldValue()).getValue()); + } else { + list.add(value); + } + } + return list.hashCode(); + } + 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); + } + } + + +} diff --git "a/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TPut.java" "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TPut.java" new file mode 100644 index 00000000000..552e3d48d67 --- /dev/null +++ "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TPut.java" @@ -0,0 +1,1070 @@ +/** + * 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"}) +/** + * Used to perform Put operations for a single row. + * + * Add column values to this object and they'll be added. + * You can provide a default timestamp if the column values + * don't have one. If you don't provide a default timestamp + * the current time is inserted. + * + * You can specify how this Put should be written to the write-ahead Log (WAL) + * 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") +public class TPut implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TPut"); + + 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 TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("timestamp", org.apache.thrift.protocol.TType.I64, (short)3); + 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)5); + 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)6); + 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)7); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TPutStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TPutTupleSchemeFactory()); + } + + public ByteBuffer row; // required + public List columnValues; // required + public long timestamp; // optional + public Map attributes; // optional + /** + * + * @see TDurability + */ + public TDurability durability; // optional + public TCellVisibility cellVisibility; // 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"), + TIMESTAMP((short)3, "timestamp"), + ATTRIBUTES((short)5, "attributes"), + /** + * + * @see TDurability + */ + DURABILITY((short)6, "durability"), + CELL_VISIBILITY((short)7, "cellVisibility"); + + private static final Map byName = new HashMap(); + + 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: // ROW + return ROW; + case 2: // COLUMN_VALUES + return COLUMN_VALUES; + case 3: // TIMESTAMP + return TIMESTAMP; + case 5: // ATTRIBUTES + return ATTRIBUTES; + case 6: // DURABILITY + return DURABILITY; + case 7: // CELL_VISIBILITY + return CELL_VISIBILITY; + 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 int __TIMESTAMP_ISSET_ID = 0; + private byte __isset_bitfield = 0; + private static final _Fields optionals[] = {_Fields.TIMESTAMP,_Fields.ATTRIBUTES,_Fields.DURABILITY,_Fields.CELL_VISIBILITY}; + 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.ROW, new org.apache.thrift.meta_data.FieldMetaData("row", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + tmpMap.put(_Fields.COLUMN_VALUES, new org.apache.thrift.meta_data.FieldMetaData("columnValues", org.apache.thrift.TFieldRequirementType.REQUIRED, + 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, TColumnValue.class)))); + tmpMap.put(_Fields.TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("timestamp", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + 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))); + 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))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TPut.class, metaDataMap); + } + + public TPut() { + } + + public TPut( + ByteBuffer row, + List columnValues) + { + this(); + this.row = org.apache.thrift.TBaseHelper.copyBinary(row); + this.columnValues = columnValues; + } + + /** + * Performs a deep copy on other. + */ + public TPut(TPut other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetRow()) { + this.row = org.apache.thrift.TBaseHelper.copyBinary(other.row); + } + if (other.isSetColumnValues()) { + List __this__columnValues = new ArrayList(other.columnValues.size()); + for (TColumnValue other_element : other.columnValues) { + __this__columnValues.add(new TColumnValue(other_element)); + } + this.columnValues = __this__columnValues; + } + this.timestamp = other.timestamp; + if (other.isSetAttributes()) { + Map __this__attributes = new HashMap(other.attributes); + this.attributes = __this__attributes; + } + if (other.isSetDurability()) { + this.durability = other.durability; + } + if (other.isSetCellVisibility()) { + this.cellVisibility = new TCellVisibility(other.cellVisibility); + } + } + + public TPut deepCopy() { + return new TPut(this); + } + + @Override + public void clear() { + this.row = null; + this.columnValues = null; + setTimestampIsSet(false); + this.timestamp = 0; + this.attributes = null; + this.durability = null; + this.cellVisibility = null; + } + + public byte[] getRow() { + setRow(org.apache.thrift.TBaseHelper.rightSize(row)); + return row == null ? null : row.array(); + } + + public ByteBuffer bufferForRow() { + return org.apache.thrift.TBaseHelper.copyBinary(row); + } + + public TPut setRow(byte[] row) { + this.row = row == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(row, row.length)); + return this; + } + + public TPut setRow(ByteBuffer row) { + this.row = org.apache.thrift.TBaseHelper.copyBinary(row); + return this; + } + + public void unsetRow() { + this.row = null; + } + + /** Returns true if field row is set (has been assigned a value) and false otherwise */ + public boolean isSetRow() { + return this.row != null; + } + + public void setRowIsSet(boolean value) { + if (!value) { + this.row = null; + } + } + + public int getColumnValuesSize() { + return (this.columnValues == null) ? 0 : this.columnValues.size(); + } + + public java.util.Iterator getColumnValuesIterator() { + return (this.columnValues == null) ? null : this.columnValues.iterator(); + } + + public void addToColumnValues(TColumnValue elem) { + if (this.columnValues == null) { + this.columnValues = new ArrayList(); + } + this.columnValues.add(elem); + } + + public List getColumnValues() { + return this.columnValues; + } + + public TPut setColumnValues(List columnValues) { + this.columnValues = columnValues; + return this; + } + + public void unsetColumnValues() { + this.columnValues = null; + } + + /** Returns true if field columnValues is set (has been assigned a value) and false otherwise */ + public boolean isSetColumnValues() { + return this.columnValues != null; + } + + public void setColumnValuesIsSet(boolean value) { + if (!value) { + this.columnValues = null; + } + } + + public long getTimestamp() { + return this.timestamp; + } + + public TPut setTimestamp(long timestamp) { + this.timestamp = timestamp; + setTimestampIsSet(true); + return this; + } + + public void unsetTimestamp() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); + } + + /** Returns true if field timestamp is set (has been assigned a value) and false otherwise */ + public boolean isSetTimestamp() { + return EncodingUtils.testBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); + } + + public void setTimestampIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TIMESTAMP_ISSET_ID, value); + } + + 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(); + } + this.attributes.put(key, val); + } + + public Map getAttributes() { + return this.attributes; + } + + public TPut setAttributes(Map 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 TPut 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 TCellVisibility getCellVisibility() { + return this.cellVisibility; + } + + public TPut setCellVisibility(TCellVisibility cellVisibility) { + this.cellVisibility = cellVisibility; + return this; + } + + public void unsetCellVisibility() { + this.cellVisibility = null; + } + + /** Returns true if field cellVisibility is set (has been assigned a value) and false otherwise */ + public boolean isSetCellVisibility() { + return this.cellVisibility != null; + } + + public void setCellVisibilityIsSet(boolean value) { + if (!value) { + this.cellVisibility = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case ROW: + if (value == null) { + unsetRow(); + } else { + setRow((ByteBuffer)value); + } + break; + + case COLUMN_VALUES: + if (value == null) { + unsetColumnValues(); + } else { + setColumnValues((List)value); + } + break; + + case TIMESTAMP: + if (value == null) { + unsetTimestamp(); + } else { + setTimestamp((Long)value); + } + break; + + case ATTRIBUTES: + if (value == null) { + unsetAttributes(); + } else { + setAttributes((Map)value); + } + break; + + case DURABILITY: + if (value == null) { + unsetDurability(); + } else { + setDurability((TDurability)value); + } + break; + + case CELL_VISIBILITY: + if (value == null) { + unsetCellVisibility(); + } else { + setCellVisibility((TCellVisibility)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case ROW: + return getRow(); + + case COLUMN_VALUES: + return getColumnValues(); + + case TIMESTAMP: + return getTimestamp(); + + case ATTRIBUTES: + return getAttributes(); + + case DURABILITY: + return getDurability(); + + case CELL_VISIBILITY: + return getCellVisibility(); + + } + 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 ROW: + return isSetRow(); + case COLUMN_VALUES: + return isSetColumnValues(); + case TIMESTAMP: + return isSetTimestamp(); + case ATTRIBUTES: + return isSetAttributes(); + case DURABILITY: + return isSetDurability(); + case CELL_VISIBILITY: + return isSetCellVisibility(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TPut) + return this.equals((TPut)that); + return false; + } + + public boolean equals(TPut that) { + if (that == null) + return false; + + boolean this_present_row = true && this.isSetRow(); + boolean that_present_row = true && that.isSetRow(); + if (this_present_row || that_present_row) { + if (!(this_present_row && that_present_row)) + return false; + if (!this.row.equals(that.row)) + return false; + } + + boolean this_present_columnValues = true && this.isSetColumnValues(); + boolean that_present_columnValues = true && that.isSetColumnValues(); + if (this_present_columnValues || that_present_columnValues) { + if (!(this_present_columnValues && that_present_columnValues)) + return false; + if (!this.columnValues.equals(that.columnValues)) + return false; + } + + boolean this_present_timestamp = true && this.isSetTimestamp(); + boolean that_present_timestamp = true && that.isSetTimestamp(); + if (this_present_timestamp || that_present_timestamp) { + if (!(this_present_timestamp && that_present_timestamp)) + return false; + if (this.timestamp != that.timestamp) + 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; + } + + boolean this_present_cellVisibility = true && this.isSetCellVisibility(); + boolean that_present_cellVisibility = true && that.isSetCellVisibility(); + if (this_present_cellVisibility || that_present_cellVisibility) { + if (!(this_present_cellVisibility && that_present_cellVisibility)) + return false; + if (!this.cellVisibility.equals(that.cellVisibility)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_row = true && (isSetRow()); + list.add(present_row); + if (present_row) + list.add(row); + + boolean present_columnValues = true && (isSetColumnValues()); + list.add(present_columnValues); + if (present_columnValues) + list.add(columnValues); + + boolean present_timestamp = true && (isSetTimestamp()); + list.add(present_timestamp); + if (present_timestamp) + list.add(timestamp); + + 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()); + + boolean present_cellVisibility = true && (isSetCellVisibility()); + list.add(present_cellVisibility); + if (present_cellVisibility) + list.add(cellVisibility); + + return list.hashCode(); + } + + @Override + public int compareTo(TPut other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetRow()).compareTo(other.isSetRow()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRow()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.row, other.row); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetColumnValues()).compareTo(other.isSetColumnValues()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetColumnValues()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columnValues, other.columnValues); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(other.isSetTimestamp()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTimestamp()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timestamp, other.timestamp); + 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; + } + } + lastComparison = Boolean.valueOf(isSetCellVisibility()).compareTo(other.isSetCellVisibility()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetCellVisibility()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cellVisibility, other.cellVisibility); + 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("TPut("); + boolean first = true; + + sb.append("row:"); + if (this.row == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.row, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("columnValues:"); + if (this.columnValues == null) { + sb.append("null"); + } else { + sb.append(this.columnValues); + } + first = false; + if (isSetTimestamp()) { + if (!first) sb.append(", "); + sb.append("timestamp:"); + sb.append(this.timestamp); + 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; + } + if (isSetCellVisibility()) { + if (!first) sb.append(", "); + sb.append("cellVisibility:"); + if (this.cellVisibility == null) { + sb.append("null"); + } else { + sb.append(this.cellVisibility); + } + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (row == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'row' was not present! Struct: " + toString()); + } + if (columnValues == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'columnValues' was not present! Struct: " + toString()); + } + // check for sub-struct validity + if (cellVisibility != null) { + cellVisibility.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 { + // 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); + } + } + + private static class TPutStandardSchemeFactory implements SchemeFactory { + public TPutStandardScheme getScheme() { + return new TPutStandardScheme(); + } + } + + private static class TPutStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TPut 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: // ROW + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.row = iprot.readBinary(); + struct.setRowIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // COLUMN_VALUES + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list34 = iprot.readListBegin(); + struct.columnValues = new ArrayList(_list34.size); + TColumnValue _elem35; + for (int _i36 = 0; _i36 < _list34.size; ++_i36) + { + _elem35 = new TColumnValue(); + _elem35.read(iprot); + struct.columnValues.add(_elem35); + } + iprot.readListEnd(); + } + struct.setColumnValuesIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // TIMESTAMP + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.timestamp = iprot.readI64(); + struct.setTimestampIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // ATTRIBUTES + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map37 = iprot.readMapBegin(); + struct.attributes = new HashMap(2*_map37.size); + ByteBuffer _key38; + ByteBuffer _val39; + for (int _i40 = 0; _i40 < _map37.size; ++_i40) + { + _key38 = iprot.readBinary(); + _val39 = iprot.readBinary(); + struct.attributes.put(_key38, _val39); + } + iprot.readMapEnd(); + } + struct.setAttributesIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 6: // 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; + case 7: // CELL_VISIBILITY + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.cellVisibility = new TCellVisibility(); + struct.cellVisibility.read(iprot); + struct.setCellVisibilityIsSet(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, TPut struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.row != null) { + oprot.writeFieldBegin(ROW_FIELD_DESC); + oprot.writeBinary(struct.row); + oprot.writeFieldEnd(); + } + if (struct.columnValues != null) { + oprot.writeFieldBegin(COLUMN_VALUES_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.columnValues.size())); + for (TColumnValue _iter41 : struct.columnValues) + { + _iter41.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.isSetTimestamp()) { + oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC); + oprot.writeI64(struct.timestamp); + 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 _iter42 : struct.attributes.entrySet()) + { + oprot.writeBinary(_iter42.getKey()); + oprot.writeBinary(_iter42.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + } + if (struct.durability != null) { + if (struct.isSetDurability()) { + oprot.writeFieldBegin(DURABILITY_FIELD_DESC); + oprot.writeI32(struct.durability.getValue()); + oprot.writeFieldEnd(); + } + } + if (struct.cellVisibility != null) { + if (struct.isSetCellVisibility()) { + oprot.writeFieldBegin(CELL_VISIBILITY_FIELD_DESC); + struct.cellVisibility.write(oprot); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TPutTupleSchemeFactory implements SchemeFactory { + public TPutTupleScheme getScheme() { + return new TPutTupleScheme(); + } + } + + private static class TPutTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TPut struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeBinary(struct.row); + { + oprot.writeI32(struct.columnValues.size()); + for (TColumnValue _iter43 : struct.columnValues) + { + _iter43.write(oprot); + } + } + BitSet optionals = new BitSet(); + if (struct.isSetTimestamp()) { + optionals.set(0); + } + if (struct.isSetAttributes()) { + optionals.set(1); + } + if (struct.isSetDurability()) { + optionals.set(2); + } + if (struct.isSetCellVisibility()) { + optionals.set(3); + } + oprot.writeBitSet(optionals, 4); + if (struct.isSetTimestamp()) { + oprot.writeI64(struct.timestamp); + } + if (struct.isSetAttributes()) { + { + oprot.writeI32(struct.attributes.size()); + for (Map.Entry _iter44 : struct.attributes.entrySet()) + { + oprot.writeBinary(_iter44.getKey()); + oprot.writeBinary(_iter44.getValue()); + } + } + } + if (struct.isSetDurability()) { + oprot.writeI32(struct.durability.getValue()); + } + if (struct.isSetCellVisibility()) { + struct.cellVisibility.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TPut struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.row = iprot.readBinary(); + struct.setRowIsSet(true); + { + org.apache.thrift.protocol.TList _list45 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.columnValues = new ArrayList(_list45.size); + TColumnValue _elem46; + for (int _i47 = 0; _i47 < _list45.size; ++_i47) + { + _elem46 = new TColumnValue(); + _elem46.read(iprot); + struct.columnValues.add(_elem46); + } + } + struct.setColumnValuesIsSet(true); + BitSet incoming = iprot.readBitSet(4); + if (incoming.get(0)) { + struct.timestamp = iprot.readI64(); + struct.setTimestampIsSet(true); + } + if (incoming.get(1)) { + { + org.apache.thrift.protocol.TMap _map48 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.attributes = new HashMap(2*_map48.size); + ByteBuffer _key49; + ByteBuffer _val50; + for (int _i51 = 0; _i51 < _map48.size; ++_i51) + { + _key49 = iprot.readBinary(); + _val50 = iprot.readBinary(); + struct.attributes.put(_key49, _val50); + } + } + struct.setAttributesIsSet(true); + } + if (incoming.get(2)) { + struct.durability = org.apache.hadoop.hbase.thrift2.generated.TDurability.findByValue(iprot.readI32()); + struct.setDurabilityIsSet(true); + } + if (incoming.get(3)) { + struct.cellVisibility = new TCellVisibility(); + struct.cellVisibility.read(iprot); + struct.setCellVisibilityIsSet(true); + } + } + } + +} + diff --git "a/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TResult.java" "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TResult.java" new file mode 100644 index 00000000000..8c16012ddb9 --- /dev/null +++ "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TResult.java" @@ -0,0 +1,569 @@ +/** + * 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"}) +/** + * if no Result is found, row and columnValues will not be set. + */ +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-25") +public class TResult implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + 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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TResultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TResultTupleSchemeFactory()); + } + + public ByteBuffer row; // optional + public List columnValues; // 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 { + ROW((short)1, "row"), + COLUMN_VALUES((short)2, "columnValues"); + + private static final Map byName = new HashMap(); + + 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: // ROW + return ROW; + case 2: // COLUMN_VALUES + return COLUMN_VALUES; + 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.ROW}; + 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.ROW, new org.apache.thrift.meta_data.FieldMetaData("row", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + tmpMap.put(_Fields.COLUMN_VALUES, new org.apache.thrift.meta_data.FieldMetaData("columnValues", org.apache.thrift.TFieldRequirementType.REQUIRED, + 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, TColumnValue.class)))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TResult.class, metaDataMap); + } + + public TResult() { + } + + public TResult( + List columnValues) + { + this(); + this.columnValues = columnValues; + } + + /** + * Performs a deep copy on other. + */ + public TResult(TResult other) { + if (other.isSetRow()) { + this.row = org.apache.thrift.TBaseHelper.copyBinary(other.row); + } + if (other.isSetColumnValues()) { + List __this__columnValues = new ArrayList(other.columnValues.size()); + for (TColumnValue other_element : other.columnValues) { + __this__columnValues.add(new TColumnValue(other_element)); + } + this.columnValues = __this__columnValues; + } + } + + public TResult deepCopy() { + return new TResult(this); + } + + @Override + public void clear() { + this.row = null; + this.columnValues = null; + } + + public byte[] getRow() { + setRow(org.apache.thrift.TBaseHelper.rightSize(row)); + return row == null ? null : row.array(); + } + + public ByteBuffer bufferForRow() { + return org.apache.thrift.TBaseHelper.copyBinary(row); + } + + public TResult setRow(byte[] row) { + this.row = row == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(row, row.length)); + return this; + } + + public TResult setRow(ByteBuffer row) { + this.row = org.apache.thrift.TBaseHelper.copyBinary(row); + return this; + } + + public void unsetRow() { + this.row = null; + } + + /** Returns true if field row is set (has been assigned a value) and false otherwise */ + public boolean isSetRow() { + return this.row != null; + } + + public void setRowIsSet(boolean value) { + if (!value) { + this.row = null; + } + } + + public int getColumnValuesSize() { + return (this.columnValues == null) ? 0 : this.columnValues.size(); + } + + public java.util.Iterator getColumnValuesIterator() { + return (this.columnValues == null) ? null : this.columnValues.iterator(); + } + + public void addToColumnValues(TColumnValue elem) { + if (this.columnValues == null) { + this.columnValues = new ArrayList(); + } + this.columnValues.add(elem); + } + + public List getColumnValues() { + return this.columnValues; + } + + public TResult setColumnValues(List columnValues) { + this.columnValues = columnValues; + return this; + } + + public void unsetColumnValues() { + this.columnValues = null; + } + + /** Returns true if field columnValues is set (has been assigned a value) and false otherwise */ + public boolean isSetColumnValues() { + return this.columnValues != null; + } + + public void setColumnValuesIsSet(boolean value) { + if (!value) { + this.columnValues = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case ROW: + if (value == null) { + unsetRow(); + } else { + setRow((ByteBuffer)value); + } + break; + + case COLUMN_VALUES: + if (value == null) { + unsetColumnValues(); + } else { + setColumnValues((List)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case ROW: + return getRow(); + + case COLUMN_VALUES: + return getColumnValues(); + + } + 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 ROW: + return isSetRow(); + case COLUMN_VALUES: + return isSetColumnValues(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TResult) + return this.equals((TResult)that); + return false; + } + + public boolean equals(TResult that) { + if (that == null) + return false; + + boolean this_present_row = true && this.isSetRow(); + boolean that_present_row = true && that.isSetRow(); + if (this_present_row || that_present_row) { + if (!(this_present_row && that_present_row)) + return false; + if (!this.row.equals(that.row)) + return false; + } + + boolean this_present_columnValues = true && this.isSetColumnValues(); + boolean that_present_columnValues = true && that.isSetColumnValues(); + if (this_present_columnValues || that_present_columnValues) { + if (!(this_present_columnValues && that_present_columnValues)) + return false; + if (!this.columnValues.equals(that.columnValues)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_row = true && (isSetRow()); + list.add(present_row); + if (present_row) + list.add(row); + + boolean present_columnValues = true && (isSetColumnValues()); + list.add(present_columnValues); + if (present_columnValues) + list.add(columnValues); + + return list.hashCode(); + } + + @Override + public int compareTo(TResult other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetRow()).compareTo(other.isSetRow()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRow()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.row, other.row); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetColumnValues()).compareTo(other.isSetColumnValues()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetColumnValues()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columnValues, other.columnValues); + 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("TResult("); + boolean first = true; + + if (isSetRow()) { + sb.append("row:"); + if (this.row == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.row, sb); + } + first = false; + } + if (!first) sb.append(", "); + sb.append("columnValues:"); + if (this.columnValues == null) { + sb.append("null"); + } else { + sb.append(this.columnValues); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (columnValues == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'columnValues' 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 TResultStandardSchemeFactory implements SchemeFactory { + public TResultStandardScheme getScheme() { + return new TResultStandardScheme(); + } + } + + private static class TResultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TResult 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: // ROW + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.row = iprot.readBinary(); + struct.setRowIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // COLUMN_VALUES + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list0 = iprot.readListBegin(); + struct.columnValues = new ArrayList(_list0.size); + TColumnValue _elem1; + for (int _i2 = 0; _i2 < _list0.size; ++_i2) + { + _elem1 = new TColumnValue(); + _elem1.read(iprot); + struct.columnValues.add(_elem1); + } + iprot.readListEnd(); + } + struct.setColumnValuesIsSet(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, TResult struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.row != null) { + if (struct.isSetRow()) { + oprot.writeFieldBegin(ROW_FIELD_DESC); + oprot.writeBinary(struct.row); + oprot.writeFieldEnd(); + } + } + if (struct.columnValues != null) { + oprot.writeFieldBegin(COLUMN_VALUES_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.columnValues.size())); + for (TColumnValue _iter3 : struct.columnValues) + { + _iter3.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TResultTupleSchemeFactory implements SchemeFactory { + public TResultTupleScheme getScheme() { + return new TResultTupleScheme(); + } + } + + private static class TResultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TResult struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + { + oprot.writeI32(struct.columnValues.size()); + for (TColumnValue _iter4 : struct.columnValues) + { + _iter4.write(oprot); + } + } + BitSet optionals = new BitSet(); + if (struct.isSetRow()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetRow()) { + oprot.writeBinary(struct.row); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TResult struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + { + org.apache.thrift.protocol.TList _list5 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.columnValues = new ArrayList(_list5.size); + TColumnValue _elem6; + for (int _i7 = 0; _i7 < _list5.size; ++_i7) + { + _elem6 = new TColumnValue(); + _elem6.read(iprot); + struct.columnValues.add(_elem6); + } + } + struct.setColumnValuesIsSet(true); + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.row = iprot.readBinary(); + struct.setRowIsSet(true); + } + } + } + +} + diff --git "a/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TRowMutations.java" "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TRowMutations.java" new file mode 100644 index 00000000000..dfa06ff22a6 --- /dev/null +++ "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TRowMutations.java" @@ -0,0 +1,559 @@ +/** + * 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"}) +/** + * 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") +public class TRowMutations implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TRowMutations"); + + 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 MUTATIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("mutations", org.apache.thrift.protocol.TType.LIST, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TRowMutationsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TRowMutationsTupleSchemeFactory()); + } + + public ByteBuffer row; // required + public List mutations; // 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 { + ROW((short)1, "row"), + MUTATIONS((short)2, "mutations"); + + private static final Map byName = new HashMap(); + + 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: // ROW + return ROW; + case 2: // MUTATIONS + return MUTATIONS; + 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.ROW, new org.apache.thrift.meta_data.FieldMetaData("row", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + tmpMap.put(_Fields.MUTATIONS, new org.apache.thrift.meta_data.FieldMetaData("mutations", org.apache.thrift.TFieldRequirementType.REQUIRED, + 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, TMutation.class)))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TRowMutations.class, metaDataMap); + } + + public TRowMutations() { + } + + public TRowMutations( + ByteBuffer row, + List mutations) + { + this(); + this.row = org.apache.thrift.TBaseHelper.copyBinary(row); + this.mutations = mutations; + } + + /** + * Performs a deep copy on other. + */ + public TRowMutations(TRowMutations other) { + if (other.isSetRow()) { + this.row = org.apache.thrift.TBaseHelper.copyBinary(other.row); + } + if (other.isSetMutations()) { + List __this__mutations = new ArrayList(other.mutations.size()); + for (TMutation other_element : other.mutations) { + __this__mutations.add(new TMutation(other_element)); + } + this.mutations = __this__mutations; + } + } + + public TRowMutations deepCopy() { + return new TRowMutations(this); + } + + @Override + public void clear() { + this.row = null; + this.mutations = null; + } + + public byte[] getRow() { + setRow(org.apache.thrift.TBaseHelper.rightSize(row)); + return row == null ? null : row.array(); + } + + public ByteBuffer bufferForRow() { + return org.apache.thrift.TBaseHelper.copyBinary(row); + } + + public TRowMutations setRow(byte[] row) { + this.row = row == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(row, row.length)); + return this; + } + + public TRowMutations setRow(ByteBuffer row) { + this.row = org.apache.thrift.TBaseHelper.copyBinary(row); + return this; + } + + public void unsetRow() { + this.row = null; + } + + /** Returns true if field row is set (has been assigned a value) and false otherwise */ + public boolean isSetRow() { + return this.row != null; + } + + public void setRowIsSet(boolean value) { + if (!value) { + this.row = null; + } + } + + public int getMutationsSize() { + return (this.mutations == null) ? 0 : this.mutations.size(); + } + + public java.util.Iterator getMutationsIterator() { + return (this.mutations == null) ? null : this.mutations.iterator(); + } + + public void addToMutations(TMutation elem) { + if (this.mutations == null) { + this.mutations = new ArrayList(); + } + this.mutations.add(elem); + } + + public List getMutations() { + return this.mutations; + } + + public TRowMutations setMutations(List mutations) { + this.mutations = mutations; + return this; + } + + public void unsetMutations() { + this.mutations = null; + } + + /** Returns true if field mutations is set (has been assigned a value) and false otherwise */ + public boolean isSetMutations() { + return this.mutations != null; + } + + public void setMutationsIsSet(boolean value) { + if (!value) { + this.mutations = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case ROW: + if (value == null) { + unsetRow(); + } else { + setRow((ByteBuffer)value); + } + break; + + case MUTATIONS: + if (value == null) { + unsetMutations(); + } else { + setMutations((List)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case ROW: + return getRow(); + + case MUTATIONS: + return getMutations(); + + } + 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 ROW: + return isSetRow(); + case MUTATIONS: + return isSetMutations(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TRowMutations) + return this.equals((TRowMutations)that); + return false; + } + + public boolean equals(TRowMutations that) { + if (that == null) + return false; + + boolean this_present_row = true && this.isSetRow(); + boolean that_present_row = true && that.isSetRow(); + if (this_present_row || that_present_row) { + if (!(this_present_row && that_present_row)) + return false; + if (!this.row.equals(that.row)) + return false; + } + + boolean this_present_mutations = true && this.isSetMutations(); + boolean that_present_mutations = true && that.isSetMutations(); + if (this_present_mutations || that_present_mutations) { + if (!(this_present_mutations && that_present_mutations)) + return false; + if (!this.mutations.equals(that.mutations)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_row = true && (isSetRow()); + list.add(present_row); + if (present_row) + list.add(row); + + boolean present_mutations = true && (isSetMutations()); + list.add(present_mutations); + if (present_mutations) + list.add(mutations); + + return list.hashCode(); + } + + @Override + public int compareTo(TRowMutations other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetRow()).compareTo(other.isSetRow()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRow()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.row, other.row); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetMutations()).compareTo(other.isSetMutations()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetMutations()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.mutations, other.mutations); + 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("TRowMutations("); + boolean first = true; + + sb.append("row:"); + if (this.row == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.row, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("mutations:"); + if (this.mutations == null) { + sb.append("null"); + } else { + sb.append(this.mutations); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (row == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'row' was not present! Struct: " + toString()); + } + if (mutations == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'mutations' 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 TRowMutationsStandardSchemeFactory implements SchemeFactory { + public TRowMutationsStandardScheme getScheme() { + return new TRowMutationsStandardScheme(); + } + } + + private static class TRowMutationsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TRowMutations 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: // ROW + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.row = iprot.readBinary(); + struct.setRowIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // MUTATIONS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list124 = iprot.readListBegin(); + struct.mutations = new ArrayList(_list124.size); + TMutation _elem125; + for (int _i126 = 0; _i126 < _list124.size; ++_i126) + { + _elem125 = new TMutation(); + _elem125.read(iprot); + struct.mutations.add(_elem125); + } + iprot.readListEnd(); + } + struct.setMutationsIsSet(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, TRowMutations struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.row != null) { + oprot.writeFieldBegin(ROW_FIELD_DESC); + oprot.writeBinary(struct.row); + oprot.writeFieldEnd(); + } + if (struct.mutations != null) { + 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) + { + _iter127.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TRowMutationsTupleSchemeFactory implements SchemeFactory { + public TRowMutationsTupleScheme getScheme() { + return new TRowMutationsTupleScheme(); + } + } + + private static class TRowMutationsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TRowMutations struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeBinary(struct.row); + { + oprot.writeI32(struct.mutations.size()); + for (TMutation _iter128 : struct.mutations) + { + _iter128.write(oprot); + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TRowMutations struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + 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(_list129.size); + TMutation _elem130; + for (int _i131 = 0; _i131 < _list129.size; ++_i131) + { + _elem130 = new TMutation(); + _elem130.read(iprot); + struct.mutations.add(_elem130); + } + } + struct.setMutationsIsSet(true); + } + } + +} + diff --git "a/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TScan.java" "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TScan.java" new file mode 100644 index 00000000000..e0bcb554925 --- /dev/null +++ "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TScan.java" @@ -0,0 +1,1694 @@ +/** + * 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"}) +/** + * Any timestamps in the columns are ignored, use timeRange to select by timestamp. + * Max versions defaults to 1. + */ +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-25") +public class TScan implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TScan"); + + private static final org.apache.thrift.protocol.TField START_ROW_FIELD_DESC = new org.apache.thrift.protocol.TField("startRow", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField STOP_ROW_FIELD_DESC = new org.apache.thrift.protocol.TField("stopRow", org.apache.thrift.protocol.TType.STRING, (short)2); + 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)3); + private static final org.apache.thrift.protocol.TField CACHING_FIELD_DESC = new org.apache.thrift.protocol.TField("caching", org.apache.thrift.protocol.TType.I32, (short)4); + private static final org.apache.thrift.protocol.TField MAX_VERSIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("maxVersions", org.apache.thrift.protocol.TType.I32, (short)5); + private static final org.apache.thrift.protocol.TField TIME_RANGE_FIELD_DESC = new org.apache.thrift.protocol.TField("timeRange", org.apache.thrift.protocol.TType.STRUCT, (short)6); + private static final org.apache.thrift.protocol.TField FILTER_STRING_FIELD_DESC = new org.apache.thrift.protocol.TField("filterString", org.apache.thrift.protocol.TType.STRING, (short)7); + private static final org.apache.thrift.protocol.TField BATCH_SIZE_FIELD_DESC = new org.apache.thrift.protocol.TField("batchSize", org.apache.thrift.protocol.TType.I32, (short)8); + 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)9); + 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)10); + private static final org.apache.thrift.protocol.TField REVERSED_FIELD_DESC = new org.apache.thrift.protocol.TField("reversed", org.apache.thrift.protocol.TType.BOOL, (short)11); + 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)12); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TScanStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TScanTupleSchemeFactory()); + } + + public ByteBuffer startRow; // optional + public ByteBuffer stopRow; // optional + public List columns; // optional + public int caching; // optional + public int maxVersions; // optional + public TTimeRange timeRange; // optional + public ByteBuffer filterString; // optional + public int batchSize; // optional + public Map attributes; // optional + public TAuthorization authorizations; // optional + public boolean reversed; // optional + public boolean cacheBlocks; // 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 { + START_ROW((short)1, "startRow"), + STOP_ROW((short)2, "stopRow"), + COLUMNS((short)3, "columns"), + CACHING((short)4, "caching"), + MAX_VERSIONS((short)5, "maxVersions"), + TIME_RANGE((short)6, "timeRange"), + FILTER_STRING((short)7, "filterString"), + BATCH_SIZE((short)8, "batchSize"), + ATTRIBUTES((short)9, "attributes"), + AUTHORIZATIONS((short)10, "authorizations"), + REVERSED((short)11, "reversed"), + CACHE_BLOCKS((short)12, "cacheBlocks"); + + private static final Map byName = new HashMap(); + + 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: // START_ROW + return START_ROW; + case 2: // STOP_ROW + return STOP_ROW; + case 3: // COLUMNS + return COLUMNS; + case 4: // CACHING + return CACHING; + case 5: // MAX_VERSIONS + return MAX_VERSIONS; + case 6: // TIME_RANGE + return TIME_RANGE; + case 7: // FILTER_STRING + return FILTER_STRING; + case 8: // BATCH_SIZE + return BATCH_SIZE; + case 9: // ATTRIBUTES + return ATTRIBUTES; + case 10: // AUTHORIZATIONS + return AUTHORIZATIONS; + case 11: // REVERSED + return REVERSED; + case 12: // CACHE_BLOCKS + return CACHE_BLOCKS; + 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 int __CACHING_ISSET_ID = 0; + private static final int __MAXVERSIONS_ISSET_ID = 1; + private static final int __BATCHSIZE_ISSET_ID = 2; + private static final int __REVERSED_ISSET_ID = 3; + private static final int __CACHEBLOCKS_ISSET_ID = 4; + private byte __isset_bitfield = 0; + private static final _Fields optionals[] = {_Fields.START_ROW,_Fields.STOP_ROW,_Fields.COLUMNS,_Fields.CACHING,_Fields.MAX_VERSIONS,_Fields.TIME_RANGE,_Fields.FILTER_STRING,_Fields.BATCH_SIZE,_Fields.ATTRIBUTES,_Fields.AUTHORIZATIONS,_Fields.REVERSED,_Fields.CACHE_BLOCKS}; + 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.START_ROW, new org.apache.thrift.meta_data.FieldMetaData("startRow", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + tmpMap.put(_Fields.STOP_ROW, new org.apache.thrift.meta_data.FieldMetaData("stopRow", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + 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, TColumn.class)))); + tmpMap.put(_Fields.CACHING, new org.apache.thrift.meta_data.FieldMetaData("caching", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.MAX_VERSIONS, new org.apache.thrift.meta_data.FieldMetaData("maxVersions", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.TIME_RANGE, new org.apache.thrift.meta_data.FieldMetaData("timeRange", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TTimeRange.class))); + tmpMap.put(_Fields.FILTER_STRING, new org.apache.thrift.meta_data.FieldMetaData("filterString", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + tmpMap.put(_Fields.BATCH_SIZE, new org.apache.thrift.meta_data.FieldMetaData("batchSize", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + 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.AUTHORIZATIONS, new org.apache.thrift.meta_data.FieldMetaData("authorizations", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TAuthorization.class))); + tmpMap.put(_Fields.REVERSED, new org.apache.thrift.meta_data.FieldMetaData("reversed", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + 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))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TScan.class, metaDataMap); + } + + public TScan() { + this.maxVersions = 1; + + } + + /** + * Performs a deep copy on other. + */ + public TScan(TScan other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetStartRow()) { + this.startRow = org.apache.thrift.TBaseHelper.copyBinary(other.startRow); + } + if (other.isSetStopRow()) { + this.stopRow = org.apache.thrift.TBaseHelper.copyBinary(other.stopRow); + } + if (other.isSetColumns()) { + List __this__columns = new ArrayList(other.columns.size()); + for (TColumn other_element : other.columns) { + __this__columns.add(new TColumn(other_element)); + } + this.columns = __this__columns; + } + this.caching = other.caching; + this.maxVersions = other.maxVersions; + if (other.isSetTimeRange()) { + this.timeRange = new TTimeRange(other.timeRange); + } + if (other.isSetFilterString()) { + this.filterString = org.apache.thrift.TBaseHelper.copyBinary(other.filterString); + } + this.batchSize = other.batchSize; + if (other.isSetAttributes()) { + Map __this__attributes = new HashMap(other.attributes); + this.attributes = __this__attributes; + } + if (other.isSetAuthorizations()) { + this.authorizations = new TAuthorization(other.authorizations); + } + this.reversed = other.reversed; + this.cacheBlocks = other.cacheBlocks; + } + + public TScan deepCopy() { + return new TScan(this); + } + + @Override + public void clear() { + this.startRow = null; + this.stopRow = null; + this.columns = null; + setCachingIsSet(false); + this.caching = 0; + this.maxVersions = 1; + + this.timeRange = null; + this.filterString = null; + setBatchSizeIsSet(false); + this.batchSize = 0; + this.attributes = null; + this.authorizations = null; + setReversedIsSet(false); + this.reversed = false; + setCacheBlocksIsSet(false); + this.cacheBlocks = false; + } + + public byte[] getStartRow() { + setStartRow(org.apache.thrift.TBaseHelper.rightSize(startRow)); + return startRow == null ? null : startRow.array(); + } + + public ByteBuffer bufferForStartRow() { + return org.apache.thrift.TBaseHelper.copyBinary(startRow); + } + + public TScan setStartRow(byte[] startRow) { + this.startRow = startRow == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(startRow, startRow.length)); + return this; + } + + public TScan setStartRow(ByteBuffer startRow) { + this.startRow = org.apache.thrift.TBaseHelper.copyBinary(startRow); + return this; + } + + public void unsetStartRow() { + this.startRow = null; + } + + /** Returns true if field startRow is set (has been assigned a value) and false otherwise */ + public boolean isSetStartRow() { + return this.startRow != null; + } + + public void setStartRowIsSet(boolean value) { + if (!value) { + this.startRow = null; + } + } + + public byte[] getStopRow() { + setStopRow(org.apache.thrift.TBaseHelper.rightSize(stopRow)); + return stopRow == null ? null : stopRow.array(); + } + + public ByteBuffer bufferForStopRow() { + return org.apache.thrift.TBaseHelper.copyBinary(stopRow); + } + + public TScan setStopRow(byte[] stopRow) { + this.stopRow = stopRow == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(stopRow, stopRow.length)); + return this; + } + + public TScan setStopRow(ByteBuffer stopRow) { + this.stopRow = org.apache.thrift.TBaseHelper.copyBinary(stopRow); + return this; + } + + public void unsetStopRow() { + this.stopRow = null; + } + + /** Returns true if field stopRow is set (has been assigned a value) and false otherwise */ + public boolean isSetStopRow() { + return this.stopRow != null; + } + + public void setStopRowIsSet(boolean value) { + if (!value) { + this.stopRow = null; + } + } + + public int getColumnsSize() { + return (this.columns == null) ? 0 : this.columns.size(); + } + + public java.util.Iterator getColumnsIterator() { + return (this.columns == null) ? null : this.columns.iterator(); + } + + public void addToColumns(TColumn elem) { + if (this.columns == null) { + this.columns = new ArrayList(); + } + this.columns.add(elem); + } + + public List getColumns() { + return this.columns; + } + + public TScan setColumns(List 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 getCaching() { + return this.caching; + } + + public TScan setCaching(int caching) { + this.caching = caching; + setCachingIsSet(true); + return this; + } + + public void unsetCaching() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CACHING_ISSET_ID); + } + + /** Returns true if field caching is set (has been assigned a value) and false otherwise */ + public boolean isSetCaching() { + return EncodingUtils.testBit(__isset_bitfield, __CACHING_ISSET_ID); + } + + public void setCachingIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CACHING_ISSET_ID, value); + } + + public int getMaxVersions() { + return this.maxVersions; + } + + public TScan setMaxVersions(int maxVersions) { + this.maxVersions = maxVersions; + setMaxVersionsIsSet(true); + return this; + } + + public void unsetMaxVersions() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MAXVERSIONS_ISSET_ID); + } + + /** Returns true if field maxVersions is set (has been assigned a value) and false otherwise */ + public boolean isSetMaxVersions() { + return EncodingUtils.testBit(__isset_bitfield, __MAXVERSIONS_ISSET_ID); + } + + public void setMaxVersionsIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MAXVERSIONS_ISSET_ID, value); + } + + public TTimeRange getTimeRange() { + return this.timeRange; + } + + public TScan setTimeRange(TTimeRange timeRange) { + this.timeRange = timeRange; + return this; + } + + public void unsetTimeRange() { + this.timeRange = null; + } + + /** Returns true if field timeRange is set (has been assigned a value) and false otherwise */ + public boolean isSetTimeRange() { + return this.timeRange != null; + } + + public void setTimeRangeIsSet(boolean value) { + if (!value) { + this.timeRange = null; + } + } + + public byte[] getFilterString() { + setFilterString(org.apache.thrift.TBaseHelper.rightSize(filterString)); + return filterString == null ? null : filterString.array(); + } + + public ByteBuffer bufferForFilterString() { + return org.apache.thrift.TBaseHelper.copyBinary(filterString); + } + + public TScan setFilterString(byte[] filterString) { + this.filterString = filterString == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(filterString, filterString.length)); + return this; + } + + public TScan setFilterString(ByteBuffer filterString) { + this.filterString = org.apache.thrift.TBaseHelper.copyBinary(filterString); + return this; + } + + public void unsetFilterString() { + this.filterString = null; + } + + /** Returns true if field filterString is set (has been assigned a value) and false otherwise */ + public boolean isSetFilterString() { + return this.filterString != null; + } + + public void setFilterStringIsSet(boolean value) { + if (!value) { + this.filterString = null; + } + } + + public int getBatchSize() { + return this.batchSize; + } + + public TScan setBatchSize(int batchSize) { + this.batchSize = batchSize; + setBatchSizeIsSet(true); + return this; + } + + public void unsetBatchSize() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __BATCHSIZE_ISSET_ID); + } + + /** Returns true if field batchSize is set (has been assigned a value) and false otherwise */ + public boolean isSetBatchSize() { + return EncodingUtils.testBit(__isset_bitfield, __BATCHSIZE_ISSET_ID); + } + + public void setBatchSizeIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __BATCHSIZE_ISSET_ID, value); + } + + 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(); + } + this.attributes.put(key, val); + } + + public Map getAttributes() { + return this.attributes; + } + + public TScan setAttributes(Map 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; + } + } + + public TAuthorization getAuthorizations() { + return this.authorizations; + } + + public TScan setAuthorizations(TAuthorization authorizations) { + this.authorizations = authorizations; + return this; + } + + public void unsetAuthorizations() { + this.authorizations = null; + } + + /** Returns true if field authorizations is set (has been assigned a value) and false otherwise */ + public boolean isSetAuthorizations() { + return this.authorizations != null; + } + + public void setAuthorizationsIsSet(boolean value) { + if (!value) { + this.authorizations = null; + } + } + + public boolean isReversed() { + return this.reversed; + } + + public TScan setReversed(boolean reversed) { + this.reversed = reversed; + setReversedIsSet(true); + return this; + } + + public void unsetReversed() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __REVERSED_ISSET_ID); + } + + /** Returns true if field reversed is set (has been assigned a value) and false otherwise */ + public boolean isSetReversed() { + return EncodingUtils.testBit(__isset_bitfield, __REVERSED_ISSET_ID); + } + + public void setReversedIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __REVERSED_ISSET_ID, value); + } + + public boolean isCacheBlocks() { + return this.cacheBlocks; + } + + public TScan 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 void setFieldValue(_Fields field, Object value) { + switch (field) { + case START_ROW: + if (value == null) { + unsetStartRow(); + } else { + setStartRow((ByteBuffer)value); + } + break; + + case STOP_ROW: + if (value == null) { + unsetStopRow(); + } else { + setStopRow((ByteBuffer)value); + } + break; + + case COLUMNS: + if (value == null) { + unsetColumns(); + } else { + setColumns((List)value); + } + break; + + case CACHING: + if (value == null) { + unsetCaching(); + } else { + setCaching((Integer)value); + } + break; + + case MAX_VERSIONS: + if (value == null) { + unsetMaxVersions(); + } else { + setMaxVersions((Integer)value); + } + break; + + case TIME_RANGE: + if (value == null) { + unsetTimeRange(); + } else { + setTimeRange((TTimeRange)value); + } + break; + + case FILTER_STRING: + if (value == null) { + unsetFilterString(); + } else { + setFilterString((ByteBuffer)value); + } + break; + + case BATCH_SIZE: + if (value == null) { + unsetBatchSize(); + } else { + setBatchSize((Integer)value); + } + break; + + case ATTRIBUTES: + if (value == null) { + unsetAttributes(); + } else { + setAttributes((Map)value); + } + break; + + case AUTHORIZATIONS: + if (value == null) { + unsetAuthorizations(); + } else { + setAuthorizations((TAuthorization)value); + } + break; + + case REVERSED: + if (value == null) { + unsetReversed(); + } else { + setReversed((Boolean)value); + } + break; + + case CACHE_BLOCKS: + if (value == null) { + unsetCacheBlocks(); + } else { + setCacheBlocks((Boolean)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case START_ROW: + return getStartRow(); + + case STOP_ROW: + return getStopRow(); + + case COLUMNS: + return getColumns(); + + case CACHING: + return getCaching(); + + case MAX_VERSIONS: + return getMaxVersions(); + + case TIME_RANGE: + return getTimeRange(); + + case FILTER_STRING: + return getFilterString(); + + case BATCH_SIZE: + return getBatchSize(); + + case ATTRIBUTES: + return getAttributes(); + + case AUTHORIZATIONS: + return getAuthorizations(); + + case REVERSED: + return isReversed(); + + case CACHE_BLOCKS: + return isCacheBlocks(); + + } + 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 START_ROW: + return isSetStartRow(); + case STOP_ROW: + return isSetStopRow(); + case COLUMNS: + return isSetColumns(); + case CACHING: + return isSetCaching(); + case MAX_VERSIONS: + return isSetMaxVersions(); + case TIME_RANGE: + return isSetTimeRange(); + case FILTER_STRING: + return isSetFilterString(); + case BATCH_SIZE: + return isSetBatchSize(); + case ATTRIBUTES: + return isSetAttributes(); + case AUTHORIZATIONS: + return isSetAuthorizations(); + case REVERSED: + return isSetReversed(); + case CACHE_BLOCKS: + return isSetCacheBlocks(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TScan) + return this.equals((TScan)that); + return false; + } + + public boolean equals(TScan that) { + if (that == null) + return false; + + boolean this_present_startRow = true && this.isSetStartRow(); + boolean that_present_startRow = true && that.isSetStartRow(); + if (this_present_startRow || that_present_startRow) { + if (!(this_present_startRow && that_present_startRow)) + return false; + if (!this.startRow.equals(that.startRow)) + return false; + } + + boolean this_present_stopRow = true && this.isSetStopRow(); + boolean that_present_stopRow = true && that.isSetStopRow(); + if (this_present_stopRow || that_present_stopRow) { + if (!(this_present_stopRow && that_present_stopRow)) + return false; + if (!this.stopRow.equals(that.stopRow)) + 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_caching = true && this.isSetCaching(); + boolean that_present_caching = true && that.isSetCaching(); + if (this_present_caching || that_present_caching) { + if (!(this_present_caching && that_present_caching)) + return false; + if (this.caching != that.caching) + return false; + } + + boolean this_present_maxVersions = true && this.isSetMaxVersions(); + boolean that_present_maxVersions = true && that.isSetMaxVersions(); + if (this_present_maxVersions || that_present_maxVersions) { + if (!(this_present_maxVersions && that_present_maxVersions)) + return false; + if (this.maxVersions != that.maxVersions) + return false; + } + + boolean this_present_timeRange = true && this.isSetTimeRange(); + boolean that_present_timeRange = true && that.isSetTimeRange(); + if (this_present_timeRange || that_present_timeRange) { + if (!(this_present_timeRange && that_present_timeRange)) + return false; + if (!this.timeRange.equals(that.timeRange)) + return false; + } + + boolean this_present_filterString = true && this.isSetFilterString(); + boolean that_present_filterString = true && that.isSetFilterString(); + if (this_present_filterString || that_present_filterString) { + if (!(this_present_filterString && that_present_filterString)) + return false; + if (!this.filterString.equals(that.filterString)) + return false; + } + + boolean this_present_batchSize = true && this.isSetBatchSize(); + boolean that_present_batchSize = true && that.isSetBatchSize(); + if (this_present_batchSize || that_present_batchSize) { + if (!(this_present_batchSize && that_present_batchSize)) + return false; + if (this.batchSize != that.batchSize) + 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_authorizations = true && this.isSetAuthorizations(); + boolean that_present_authorizations = true && that.isSetAuthorizations(); + if (this_present_authorizations || that_present_authorizations) { + if (!(this_present_authorizations && that_present_authorizations)) + return false; + if (!this.authorizations.equals(that.authorizations)) + return false; + } + + boolean this_present_reversed = true && this.isSetReversed(); + boolean that_present_reversed = true && that.isSetReversed(); + if (this_present_reversed || that_present_reversed) { + if (!(this_present_reversed && that_present_reversed)) + return false; + if (this.reversed != that.reversed) + 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; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_startRow = true && (isSetStartRow()); + list.add(present_startRow); + if (present_startRow) + list.add(startRow); + + boolean present_stopRow = true && (isSetStopRow()); + list.add(present_stopRow); + if (present_stopRow) + list.add(stopRow); + + boolean present_columns = true && (isSetColumns()); + list.add(present_columns); + if (present_columns) + list.add(columns); + + boolean present_caching = true && (isSetCaching()); + list.add(present_caching); + if (present_caching) + list.add(caching); + + boolean present_maxVersions = true && (isSetMaxVersions()); + list.add(present_maxVersions); + if (present_maxVersions) + list.add(maxVersions); + + boolean present_timeRange = true && (isSetTimeRange()); + list.add(present_timeRange); + if (present_timeRange) + list.add(timeRange); + + boolean present_filterString = true && (isSetFilterString()); + list.add(present_filterString); + if (present_filterString) + list.add(filterString); + + boolean present_batchSize = true && (isSetBatchSize()); + list.add(present_batchSize); + if (present_batchSize) + list.add(batchSize); + + boolean present_attributes = true && (isSetAttributes()); + list.add(present_attributes); + if (present_attributes) + list.add(attributes); + + boolean present_authorizations = true && (isSetAuthorizations()); + list.add(present_authorizations); + if (present_authorizations) + list.add(authorizations); + + boolean present_reversed = true && (isSetReversed()); + list.add(present_reversed); + if (present_reversed) + list.add(reversed); + + boolean present_cacheBlocks = true && (isSetCacheBlocks()); + list.add(present_cacheBlocks); + if (present_cacheBlocks) + list.add(cacheBlocks); + + return list.hashCode(); + } + + @Override + public int compareTo(TScan other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetStartRow()).compareTo(other.isSetStartRow()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStartRow()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startRow, other.startRow); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetStopRow()).compareTo(other.isSetStopRow()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStopRow()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stopRow, other.stopRow); + 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(isSetCaching()).compareTo(other.isSetCaching()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetCaching()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.caching, other.caching); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetMaxVersions()).compareTo(other.isSetMaxVersions()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetMaxVersions()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.maxVersions, other.maxVersions); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetTimeRange()).compareTo(other.isSetTimeRange()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTimeRange()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timeRange, other.timeRange); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetFilterString()).compareTo(other.isSetFilterString()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetFilterString()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.filterString, other.filterString); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetBatchSize()).compareTo(other.isSetBatchSize()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetBatchSize()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.batchSize, other.batchSize); + 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(isSetAuthorizations()).compareTo(other.isSetAuthorizations()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetAuthorizations()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.authorizations, other.authorizations); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetReversed()).compareTo(other.isSetReversed()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetReversed()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.reversed, other.reversed); + if (lastComparison != 0) { + 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; + } + } + 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("TScan("); + boolean first = true; + + if (isSetStartRow()) { + sb.append("startRow:"); + if (this.startRow == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.startRow, sb); + } + first = false; + } + if (isSetStopRow()) { + if (!first) sb.append(", "); + sb.append("stopRow:"); + if (this.stopRow == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.stopRow, sb); + } + 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 (isSetCaching()) { + if (!first) sb.append(", "); + sb.append("caching:"); + sb.append(this.caching); + first = false; + } + if (isSetMaxVersions()) { + if (!first) sb.append(", "); + sb.append("maxVersions:"); + sb.append(this.maxVersions); + first = false; + } + if (isSetTimeRange()) { + if (!first) sb.append(", "); + sb.append("timeRange:"); + if (this.timeRange == null) { + sb.append("null"); + } else { + sb.append(this.timeRange); + } + first = false; + } + if (isSetFilterString()) { + if (!first) sb.append(", "); + sb.append("filterString:"); + if (this.filterString == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.filterString, sb); + } + first = false; + } + if (isSetBatchSize()) { + if (!first) sb.append(", "); + sb.append("batchSize:"); + sb.append(this.batchSize); + 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 (isSetAuthorizations()) { + if (!first) sb.append(", "); + sb.append("authorizations:"); + if (this.authorizations == null) { + sb.append("null"); + } else { + sb.append(this.authorizations); + } + first = false; + } + if (isSetReversed()) { + if (!first) sb.append(", "); + sb.append("reversed:"); + sb.append(this.reversed); + first = false; + } + if (isSetCacheBlocks()) { + if (!first) sb.append(", "); + sb.append("cacheBlocks:"); + sb.append(this.cacheBlocks); + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + if (timeRange != null) { + timeRange.validate(); + } + if (authorizations != null) { + authorizations.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 { + // 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); + } + } + + private static class TScanStandardSchemeFactory implements SchemeFactory { + public TScanStandardScheme getScheme() { + return new TScanStandardScheme(); + } + } + + private static class TScanStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TScan 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: // START_ROW + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.startRow = iprot.readBinary(); + struct.setStartRowIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // STOP_ROW + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.stopRow = iprot.readBinary(); + struct.setStopRowIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // COLUMNS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list106 = iprot.readListBegin(); + struct.columns = new ArrayList(_list106.size); + TColumn _elem107; + for (int _i108 = 0; _i108 < _list106.size; ++_i108) + { + _elem107 = new TColumn(); + _elem107.read(iprot); + struct.columns.add(_elem107); + } + iprot.readListEnd(); + } + struct.setColumnsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // CACHING + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.caching = iprot.readI32(); + struct.setCachingIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // MAX_VERSIONS + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.maxVersions = iprot.readI32(); + struct.setMaxVersionsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 6: // TIME_RANGE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.timeRange = new TTimeRange(); + struct.timeRange.read(iprot); + struct.setTimeRangeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 7: // FILTER_STRING + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.filterString = iprot.readBinary(); + struct.setFilterStringIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 8: // BATCH_SIZE + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.batchSize = iprot.readI32(); + struct.setBatchSizeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 9: // ATTRIBUTES + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map109 = iprot.readMapBegin(); + struct.attributes = new HashMap(2*_map109.size); + ByteBuffer _key110; + ByteBuffer _val111; + for (int _i112 = 0; _i112 < _map109.size; ++_i112) + { + _key110 = iprot.readBinary(); + _val111 = iprot.readBinary(); + struct.attributes.put(_key110, _val111); + } + iprot.readMapEnd(); + } + struct.setAttributesIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 10: // AUTHORIZATIONS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.authorizations = new TAuthorization(); + struct.authorizations.read(iprot); + struct.setAuthorizationsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 11: // REVERSED + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.reversed = iprot.readBool(); + struct.setReversedIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 12: // 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; + 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, TScan struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.startRow != null) { + if (struct.isSetStartRow()) { + oprot.writeFieldBegin(START_ROW_FIELD_DESC); + oprot.writeBinary(struct.startRow); + oprot.writeFieldEnd(); + } + } + if (struct.stopRow != null) { + if (struct.isSetStopRow()) { + oprot.writeFieldBegin(STOP_ROW_FIELD_DESC); + oprot.writeBinary(struct.stopRow); + 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 (TColumn _iter113 : struct.columns) + { + _iter113.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + } + if (struct.isSetCaching()) { + oprot.writeFieldBegin(CACHING_FIELD_DESC); + oprot.writeI32(struct.caching); + oprot.writeFieldEnd(); + } + if (struct.isSetMaxVersions()) { + oprot.writeFieldBegin(MAX_VERSIONS_FIELD_DESC); + oprot.writeI32(struct.maxVersions); + oprot.writeFieldEnd(); + } + if (struct.timeRange != null) { + if (struct.isSetTimeRange()) { + oprot.writeFieldBegin(TIME_RANGE_FIELD_DESC); + struct.timeRange.write(oprot); + oprot.writeFieldEnd(); + } + } + if (struct.filterString != null) { + if (struct.isSetFilterString()) { + oprot.writeFieldBegin(FILTER_STRING_FIELD_DESC); + oprot.writeBinary(struct.filterString); + oprot.writeFieldEnd(); + } + } + if (struct.isSetBatchSize()) { + oprot.writeFieldBegin(BATCH_SIZE_FIELD_DESC); + oprot.writeI32(struct.batchSize); + 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 _iter114 : struct.attributes.entrySet()) + { + oprot.writeBinary(_iter114.getKey()); + oprot.writeBinary(_iter114.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + } + if (struct.authorizations != null) { + if (struct.isSetAuthorizations()) { + oprot.writeFieldBegin(AUTHORIZATIONS_FIELD_DESC); + struct.authorizations.write(oprot); + oprot.writeFieldEnd(); + } + } + if (struct.isSetReversed()) { + oprot.writeFieldBegin(REVERSED_FIELD_DESC); + oprot.writeBool(struct.reversed); + oprot.writeFieldEnd(); + } + if (struct.isSetCacheBlocks()) { + oprot.writeFieldBegin(CACHE_BLOCKS_FIELD_DESC); + oprot.writeBool(struct.cacheBlocks); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TScanTupleSchemeFactory implements SchemeFactory { + public TScanTupleScheme getScheme() { + return new TScanTupleScheme(); + } + } + + private static class TScanTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TScan struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetStartRow()) { + optionals.set(0); + } + if (struct.isSetStopRow()) { + optionals.set(1); + } + if (struct.isSetColumns()) { + optionals.set(2); + } + if (struct.isSetCaching()) { + optionals.set(3); + } + if (struct.isSetMaxVersions()) { + optionals.set(4); + } + if (struct.isSetTimeRange()) { + optionals.set(5); + } + if (struct.isSetFilterString()) { + optionals.set(6); + } + if (struct.isSetBatchSize()) { + optionals.set(7); + } + if (struct.isSetAttributes()) { + optionals.set(8); + } + if (struct.isSetAuthorizations()) { + optionals.set(9); + } + if (struct.isSetReversed()) { + optionals.set(10); + } + if (struct.isSetCacheBlocks()) { + optionals.set(11); + } + oprot.writeBitSet(optionals, 12); + if (struct.isSetStartRow()) { + oprot.writeBinary(struct.startRow); + } + if (struct.isSetStopRow()) { + oprot.writeBinary(struct.stopRow); + } + if (struct.isSetColumns()) { + { + oprot.writeI32(struct.columns.size()); + for (TColumn _iter115 : struct.columns) + { + _iter115.write(oprot); + } + } + } + if (struct.isSetCaching()) { + oprot.writeI32(struct.caching); + } + if (struct.isSetMaxVersions()) { + oprot.writeI32(struct.maxVersions); + } + if (struct.isSetTimeRange()) { + struct.timeRange.write(oprot); + } + if (struct.isSetFilterString()) { + oprot.writeBinary(struct.filterString); + } + if (struct.isSetBatchSize()) { + oprot.writeI32(struct.batchSize); + } + if (struct.isSetAttributes()) { + { + oprot.writeI32(struct.attributes.size()); + for (Map.Entry _iter116 : struct.attributes.entrySet()) + { + oprot.writeBinary(_iter116.getKey()); + oprot.writeBinary(_iter116.getValue()); + } + } + } + if (struct.isSetAuthorizations()) { + struct.authorizations.write(oprot); + } + if (struct.isSetReversed()) { + oprot.writeBool(struct.reversed); + } + if (struct.isSetCacheBlocks()) { + oprot.writeBool(struct.cacheBlocks); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TScan struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(12); + if (incoming.get(0)) { + struct.startRow = iprot.readBinary(); + struct.setStartRowIsSet(true); + } + if (incoming.get(1)) { + struct.stopRow = iprot.readBinary(); + struct.setStopRowIsSet(true); + } + if (incoming.get(2)) { + { + org.apache.thrift.protocol.TList _list117 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.columns = new ArrayList(_list117.size); + TColumn _elem118; + for (int _i119 = 0; _i119 < _list117.size; ++_i119) + { + _elem118 = new TColumn(); + _elem118.read(iprot); + struct.columns.add(_elem118); + } + } + struct.setColumnsIsSet(true); + } + if (incoming.get(3)) { + struct.caching = iprot.readI32(); + struct.setCachingIsSet(true); + } + if (incoming.get(4)) { + struct.maxVersions = iprot.readI32(); + struct.setMaxVersionsIsSet(true); + } + if (incoming.get(5)) { + struct.timeRange = new TTimeRange(); + struct.timeRange.read(iprot); + struct.setTimeRangeIsSet(true); + } + if (incoming.get(6)) { + struct.filterString = iprot.readBinary(); + struct.setFilterStringIsSet(true); + } + if (incoming.get(7)) { + struct.batchSize = iprot.readI32(); + struct.setBatchSizeIsSet(true); + } + if (incoming.get(8)) { + { + org.apache.thrift.protocol.TMap _map120 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.attributes = new HashMap(2*_map120.size); + ByteBuffer _key121; + ByteBuffer _val122; + for (int _i123 = 0; _i123 < _map120.size; ++_i123) + { + _key121 = iprot.readBinary(); + _val122 = iprot.readBinary(); + struct.attributes.put(_key121, _val122); + } + } + struct.setAttributesIsSet(true); + } + if (incoming.get(9)) { + struct.authorizations = new TAuthorization(); + struct.authorizations.read(iprot); + struct.setAuthorizationsIsSet(true); + } + if (incoming.get(10)) { + struct.reversed = iprot.readBool(); + struct.setReversedIsSet(true); + } + if (incoming.get(11)) { + struct.cacheBlocks = iprot.readBool(); + struct.setCacheBlocksIsSet(true); + } + } + } + +} + diff --git "a/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TServerName.java" "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TServerName.java" new file mode 100644 index 00000000000..27188e9744f --- /dev/null +++ "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TServerName.java" @@ -0,0 +1,599 @@ +/** + * 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 = "2016-05-25") +public class TServerName implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TServerName"); + + private static final org.apache.thrift.protocol.TField HOST_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("hostName", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField PORT_FIELD_DESC = new org.apache.thrift.protocol.TField("port", org.apache.thrift.protocol.TType.I32, (short)2); + private static final org.apache.thrift.protocol.TField START_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("startCode", org.apache.thrift.protocol.TType.I64, (short)3); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TServerNameStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TServerNameTupleSchemeFactory()); + } + + public String hostName; // required + public int port; // optional + public long startCode; // 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 { + HOST_NAME((short)1, "hostName"), + PORT((short)2, "port"), + START_CODE((short)3, "startCode"); + + private static final Map byName = new HashMap(); + + 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: // HOST_NAME + return HOST_NAME; + case 2: // PORT + return PORT; + case 3: // START_CODE + return START_CODE; + 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 int __PORT_ISSET_ID = 0; + private static final int __STARTCODE_ISSET_ID = 1; + private byte __isset_bitfield = 0; + private static final _Fields optionals[] = {_Fields.PORT,_Fields.START_CODE}; + 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.HOST_NAME, new org.apache.thrift.meta_data.FieldMetaData("hostName", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.PORT, new org.apache.thrift.meta_data.FieldMetaData("port", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.START_CODE, new org.apache.thrift.meta_data.FieldMetaData("startCode", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TServerName.class, metaDataMap); + } + + public TServerName() { + } + + public TServerName( + String hostName) + { + this(); + this.hostName = hostName; + } + + /** + * Performs a deep copy on other. + */ + public TServerName(TServerName other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetHostName()) { + this.hostName = other.hostName; + } + this.port = other.port; + this.startCode = other.startCode; + } + + public TServerName deepCopy() { + return new TServerName(this); + } + + @Override + public void clear() { + this.hostName = null; + setPortIsSet(false); + this.port = 0; + setStartCodeIsSet(false); + this.startCode = 0; + } + + public String getHostName() { + return this.hostName; + } + + public TServerName setHostName(String hostName) { + this.hostName = hostName; + return this; + } + + public void unsetHostName() { + this.hostName = null; + } + + /** Returns true if field hostName is set (has been assigned a value) and false otherwise */ + public boolean isSetHostName() { + return this.hostName != null; + } + + public void setHostNameIsSet(boolean value) { + if (!value) { + this.hostName = null; + } + } + + public int getPort() { + return this.port; + } + + public TServerName setPort(int port) { + this.port = port; + setPortIsSet(true); + return this; + } + + public void unsetPort() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PORT_ISSET_ID); + } + + /** Returns true if field port is set (has been assigned a value) and false otherwise */ + public boolean isSetPort() { + return EncodingUtils.testBit(__isset_bitfield, __PORT_ISSET_ID); + } + + public void setPortIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PORT_ISSET_ID, value); + } + + public long getStartCode() { + return this.startCode; + } + + public TServerName setStartCode(long startCode) { + this.startCode = startCode; + setStartCodeIsSet(true); + return this; + } + + public void unsetStartCode() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __STARTCODE_ISSET_ID); + } + + /** Returns true if field startCode is set (has been assigned a value) and false otherwise */ + public boolean isSetStartCode() { + return EncodingUtils.testBit(__isset_bitfield, __STARTCODE_ISSET_ID); + } + + public void setStartCodeIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __STARTCODE_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case HOST_NAME: + if (value == null) { + unsetHostName(); + } else { + setHostName((String)value); + } + break; + + case PORT: + if (value == null) { + unsetPort(); + } else { + setPort((Integer)value); + } + break; + + case START_CODE: + if (value == null) { + unsetStartCode(); + } else { + setStartCode((Long)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case HOST_NAME: + return getHostName(); + + case PORT: + return getPort(); + + case START_CODE: + return getStartCode(); + + } + 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 HOST_NAME: + return isSetHostName(); + case PORT: + return isSetPort(); + case START_CODE: + return isSetStartCode(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TServerName) + return this.equals((TServerName)that); + return false; + } + + public boolean equals(TServerName that) { + if (that == null) + return false; + + boolean this_present_hostName = true && this.isSetHostName(); + boolean that_present_hostName = true && that.isSetHostName(); + if (this_present_hostName || that_present_hostName) { + if (!(this_present_hostName && that_present_hostName)) + return false; + if (!this.hostName.equals(that.hostName)) + return false; + } + + boolean this_present_port = true && this.isSetPort(); + boolean that_present_port = true && that.isSetPort(); + if (this_present_port || that_present_port) { + if (!(this_present_port && that_present_port)) + return false; + if (this.port != that.port) + return false; + } + + boolean this_present_startCode = true && this.isSetStartCode(); + boolean that_present_startCode = true && that.isSetStartCode(); + if (this_present_startCode || that_present_startCode) { + if (!(this_present_startCode && that_present_startCode)) + return false; + if (this.startCode != that.startCode) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_hostName = true && (isSetHostName()); + list.add(present_hostName); + if (present_hostName) + list.add(hostName); + + boolean present_port = true && (isSetPort()); + list.add(present_port); + if (present_port) + list.add(port); + + boolean present_startCode = true && (isSetStartCode()); + list.add(present_startCode); + if (present_startCode) + list.add(startCode); + + return list.hashCode(); + } + + @Override + public int compareTo(TServerName other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetHostName()).compareTo(other.isSetHostName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetHostName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.hostName, other.hostName); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetPort()).compareTo(other.isSetPort()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetPort()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.port, other.port); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetStartCode()).compareTo(other.isSetStartCode()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStartCode()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startCode, other.startCode); + 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("TServerName("); + boolean first = true; + + sb.append("hostName:"); + if (this.hostName == null) { + sb.append("null"); + } else { + sb.append(this.hostName); + } + first = false; + if (isSetPort()) { + if (!first) sb.append(", "); + sb.append("port:"); + sb.append(this.port); + first = false; + } + if (isSetStartCode()) { + if (!first) sb.append(", "); + sb.append("startCode:"); + sb.append(this.startCode); + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (hostName == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'hostName' 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 { + // 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); + } + } + + private static class TServerNameStandardSchemeFactory implements SchemeFactory { + public TServerNameStandardScheme getScheme() { + return new TServerNameStandardScheme(); + } + } + + private static class TServerNameStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TServerName 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: // HOST_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.hostName = iprot.readString(); + struct.setHostNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // PORT + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.port = iprot.readI32(); + struct.setPortIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // START_CODE + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.startCode = iprot.readI64(); + struct.setStartCodeIsSet(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, TServerName struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.hostName != null) { + oprot.writeFieldBegin(HOST_NAME_FIELD_DESC); + oprot.writeString(struct.hostName); + oprot.writeFieldEnd(); + } + if (struct.isSetPort()) { + oprot.writeFieldBegin(PORT_FIELD_DESC); + oprot.writeI32(struct.port); + oprot.writeFieldEnd(); + } + if (struct.isSetStartCode()) { + oprot.writeFieldBegin(START_CODE_FIELD_DESC); + oprot.writeI64(struct.startCode); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TServerNameTupleSchemeFactory implements SchemeFactory { + public TServerNameTupleScheme getScheme() { + return new TServerNameTupleScheme(); + } + } + + private static class TServerNameTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TServerName struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeString(struct.hostName); + BitSet optionals = new BitSet(); + if (struct.isSetPort()) { + optionals.set(0); + } + if (struct.isSetStartCode()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetPort()) { + oprot.writeI32(struct.port); + } + if (struct.isSetStartCode()) { + oprot.writeI64(struct.startCode); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TServerName struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.hostName = iprot.readString(); + struct.setHostNameIsSet(true); + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.port = iprot.readI32(); + struct.setPortIsSet(true); + } + if (incoming.get(1)) { + struct.startCode = iprot.readI64(); + struct.setStartCodeIsSet(true); + } + } + } + +} + diff --git "a/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TTimeRange.java" "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TTimeRange.java" new file mode 100644 index 00000000000..74c72553adf --- /dev/null +++ "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/generated/TTimeRange.java" @@ -0,0 +1,486 @@ +/** + * 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 = "2016-05-25") +public class TTimeRange implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TTimeRange"); + + private static final org.apache.thrift.protocol.TField MIN_STAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("minStamp", org.apache.thrift.protocol.TType.I64, (short)1); + private static final org.apache.thrift.protocol.TField MAX_STAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("maxStamp", org.apache.thrift.protocol.TType.I64, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TTimeRangeStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TTimeRangeTupleSchemeFactory()); + } + + public long minStamp; // required + public long maxStamp; // 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 { + MIN_STAMP((short)1, "minStamp"), + MAX_STAMP((short)2, "maxStamp"); + + private static final Map byName = new HashMap(); + + 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: // MIN_STAMP + return MIN_STAMP; + case 2: // MAX_STAMP + return MAX_STAMP; + 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 int __MINSTAMP_ISSET_ID = 0; + private static final int __MAXSTAMP_ISSET_ID = 1; + private byte __isset_bitfield = 0; + 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.MIN_STAMP, new org.apache.thrift.meta_data.FieldMetaData("minStamp", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.MAX_STAMP, new org.apache.thrift.meta_data.FieldMetaData("maxStamp", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TTimeRange.class, metaDataMap); + } + + public TTimeRange() { + } + + public TTimeRange( + long minStamp, + long maxStamp) + { + this(); + this.minStamp = minStamp; + setMinStampIsSet(true); + this.maxStamp = maxStamp; + setMaxStampIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public TTimeRange(TTimeRange other) { + __isset_bitfield = other.__isset_bitfield; + this.minStamp = other.minStamp; + this.maxStamp = other.maxStamp; + } + + public TTimeRange deepCopy() { + return new TTimeRange(this); + } + + @Override + public void clear() { + setMinStampIsSet(false); + this.minStamp = 0; + setMaxStampIsSet(false); + this.maxStamp = 0; + } + + public long getMinStamp() { + return this.minStamp; + } + + public TTimeRange setMinStamp(long minStamp) { + this.minStamp = minStamp; + setMinStampIsSet(true); + return this; + } + + public void unsetMinStamp() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MINSTAMP_ISSET_ID); + } + + /** Returns true if field minStamp is set (has been assigned a value) and false otherwise */ + public boolean isSetMinStamp() { + return EncodingUtils.testBit(__isset_bitfield, __MINSTAMP_ISSET_ID); + } + + public void setMinStampIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MINSTAMP_ISSET_ID, value); + } + + public long getMaxStamp() { + return this.maxStamp; + } + + public TTimeRange setMaxStamp(long maxStamp) { + this.maxStamp = maxStamp; + setMaxStampIsSet(true); + return this; + } + + public void unsetMaxStamp() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MAXSTAMP_ISSET_ID); + } + + /** Returns true if field maxStamp is set (has been assigned a value) and false otherwise */ + public boolean isSetMaxStamp() { + return EncodingUtils.testBit(__isset_bitfield, __MAXSTAMP_ISSET_ID); + } + + public void setMaxStampIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MAXSTAMP_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case MIN_STAMP: + if (value == null) { + unsetMinStamp(); + } else { + setMinStamp((Long)value); + } + break; + + case MAX_STAMP: + if (value == null) { + unsetMaxStamp(); + } else { + setMaxStamp((Long)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case MIN_STAMP: + return getMinStamp(); + + case MAX_STAMP: + return getMaxStamp(); + + } + 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 MIN_STAMP: + return isSetMinStamp(); + case MAX_STAMP: + return isSetMaxStamp(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TTimeRange) + return this.equals((TTimeRange)that); + return false; + } + + public boolean equals(TTimeRange that) { + if (that == null) + return false; + + boolean this_present_minStamp = true; + boolean that_present_minStamp = true; + if (this_present_minStamp || that_present_minStamp) { + if (!(this_present_minStamp && that_present_minStamp)) + return false; + if (this.minStamp != that.minStamp) + return false; + } + + boolean this_present_maxStamp = true; + boolean that_present_maxStamp = true; + if (this_present_maxStamp || that_present_maxStamp) { + if (!(this_present_maxStamp && that_present_maxStamp)) + return false; + if (this.maxStamp != that.maxStamp) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_minStamp = true; + list.add(present_minStamp); + if (present_minStamp) + list.add(minStamp); + + boolean present_maxStamp = true; + list.add(present_maxStamp); + if (present_maxStamp) + list.add(maxStamp); + + return list.hashCode(); + } + + @Override + public int compareTo(TTimeRange other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetMinStamp()).compareTo(other.isSetMinStamp()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetMinStamp()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.minStamp, other.minStamp); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetMaxStamp()).compareTo(other.isSetMaxStamp()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetMaxStamp()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.maxStamp, other.maxStamp); + 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("TTimeRange("); + boolean first = true; + + sb.append("minStamp:"); + sb.append(this.minStamp); + first = false; + if (!first) sb.append(", "); + sb.append("maxStamp:"); + sb.append(this.maxStamp); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // alas, we cannot check 'minStamp' because it's a primitive and you chose the non-beans generator. + // alas, we cannot check 'maxStamp' because it's a primitive and you chose the non-beans generator. + // 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 { + // 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); + } + } + + private static class TTimeRangeStandardSchemeFactory implements SchemeFactory { + public TTimeRangeStandardScheme getScheme() { + return new TTimeRangeStandardScheme(); + } + } + + private static class TTimeRangeStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TTimeRange 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: // MIN_STAMP + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.minStamp = iprot.readI64(); + struct.setMinStampIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // MAX_STAMP + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.maxStamp = iprot.readI64(); + struct.setMaxStampIsSet(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 + if (!struct.isSetMinStamp()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'minStamp' was not found in serialized data! Struct: " + toString()); + } + if (!struct.isSetMaxStamp()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'maxStamp' was not found in serialized data! Struct: " + toString()); + } + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, TTimeRange struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(MIN_STAMP_FIELD_DESC); + oprot.writeI64(struct.minStamp); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(MAX_STAMP_FIELD_DESC); + oprot.writeI64(struct.maxStamp); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TTimeRangeTupleSchemeFactory implements SchemeFactory { + public TTimeRangeTupleScheme getScheme() { + return new TTimeRangeTupleScheme(); + } + } + + private static class TTimeRangeTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TTimeRange struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeI64(struct.minStamp); + oprot.writeI64(struct.maxStamp); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TTimeRange struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.minStamp = iprot.readI64(); + struct.setMinStampIsSet(true); + struct.maxStamp = iprot.readI64(); + struct.setMaxStampIsSet(true); + } + } + +} + diff --git "a/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/package.html" "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/package.html" new file mode 100644 index 00000000000..5c7ca9461eb --- /dev/null +++ "b/hbase-thrift\036src/main/java/org/apache/hadoop/hbase/thrift2/package.html" @@ -0,0 +1,103 @@ + + + + + + + +Provides an HBase Thrift +service. + +This package contains a Thrift interface definition file for an HBase RPC +service and a Java server implementation. + +There are currently 2 thrift server implementations in HBase, the packages: + +
    +
  • org.apache.hadoop.hbase.thrift: This may one day be marked as depreceated.
  • +
  • org.apache.hadoop.hbase.thrift2: i.e. this package. This is intended to closely match to the HTable interface and + to one day supercede the older thrift (the old thrift mimics an API HBase no longer has).
  • +
+ +

What is Thrift?

+ + +

"Thrift is a software framework for scalable cross-language services +development. It combines a software stack with a code generation engine to +build services that work efficiently and seamlessly between C++, Java, Python, +PHP, Ruby, Erlang, Perl, Haskell, C#, Cocoa, JavaScript, Node.js, Smalltalk, +and OCaml. Originally developed at Facebook, Thrift was open sourced in April +2007 and entered the Apache Incubator in May, 2008". +From http://thrift.apache.org/

+ +

Description

+ +

The HBase API is defined in the +file hbase.thrift. A server-side implementation of the API is in +org.apache.hadoop.hbase.thrift2.ThriftHBaseServiceHandler with the +server boiler plate in org.apache.hadoop.hbase.thrift2.ThriftServer. +The generated interfaces, types, and RPC utility files are checked into SVN under the +org.apache.hadoop.hbase.thrift2.generated directory. +

+

To stop, use: +

+  ./bin/hbase-daemon.sh stop thrift2
+
+ +These are the command line arguments the Thrift server understands in addition to start and stop: +
+
-b, --bind
+
Address to bind the Thrift server to. Not supported by the Nonblocking and HsHa server [default: 0.0.0.0]
+ +
-p, --port
+
Port to bind to [default: 9090]
+ +
-f, --framed
+
Use framed transport (implied when using one of the non-blocking servers)
+ +
-c, --compact
+
Use the compact protocol [default: binary protocol]
+ +
-h, --help
+
Displays usage information for the Thrift server
+ +
-threadpool
+
Use the TThreadPoolServer. This is the default.
+ +
-hsha
+
Use the THsHaServer. This implies the framed transport.
+ +
-nonblocking
+
Use the TNonblockingServer. This implies the framed transport.
+
+ +

Details

+ +

HBase currently uses version 0.9.0 of Apache Thrift.

+

The files were generated by running the commands under the hbase checkout dir: +

+  mvn compile -Pcompile-thrift
+
+ +

The 'thrift' binary is the Thrift compiler, and it is distributed separately from HBase +in a Thrift release. Additionally, specific language runtime libraries are a +part of a Thrift release. A version of the Java runtime is included in HBase via maven. +

+ + +