Index: bin/hbase =================================================================== --- bin/hbase (revision 1471070) +++ bin/hbase (working copy) @@ -84,7 +84,6 @@ echo " zookeeper run a Zookeeper server" echo " rest run an HBase REST server" echo " thrift run the HBase Thrift server" - echo " thrift2 run the HBase Thrift2 server" echo "" echo "PACKAGE MANAGEMENT" echo " classpath dump hbase CLASSPATH" @@ -237,7 +236,7 @@ unset IFS #Set the right GC options based on the what we are running -declare -a server_cmds=("master" "regionserver" "thrift" "thrift2" "rest" "avro" "zookeeper") +declare -a server_cmds=("master" "regionserver" "thrift" "rest" "avro" "zookeeper") for cmd in ${server_cmds[@]}; do if [[ $cmd == $COMMAND ]]; then server=true @@ -291,11 +290,6 @@ if [ "$1" != "stop" ] ; then HBASE_OPTS="$HBASE_OPTS $HBASE_THRIFT_OPTS" fi -elif [ "$COMMAND" = "thrift2" ] ; then - CLASS='org.apache.hadoop.hbase.thrift2.ThriftServer' - if [ "$1" != "stop" ] ; then - HBASE_OPTS="$HBASE_OPTS $HBASE_THRIFT_OPTS" - fi elif [ "$COMMAND" = "rest" ] ; then CLASS='org.apache.hadoop.hbase.rest.RESTServer' if [ "$1" != "stop" ] ; then Index: bin/hbase.cmd =================================================================== --- bin/hbase.cmd (revision 1471070) +++ bin/hbase.cmd (working copy) @@ -197,7 +197,7 @@ set hbase-command-arguments=%_hbasearguments% @rem figure out which class to run -set corecommands=shell master regionserver thrift thrift2 rest avro hlog hbck hfile zookeeper zkcli +set corecommands=shell master regionserver thrift rest avro hlog hbck hfile zookeeper zkcli for %%i in ( %corecommands% ) do ( if "%hbase-command%"=="%%i" set corecommand=true ) @@ -296,13 +296,6 @@ ) goto :eof -:thrift2 - set CLASS=org.apache.hadoop.hbase.thrift2.ThriftServer - if NOT "%1" == "stop" ( - set HBASE_OPTS=%HBASE_OPTS% %HBASE_THRIFT_OPTS% - ) - goto :eof - :rest set CLASS=org.apache.hadoop.hbase.rest.Main if NOT "%1"=="stop" ( @@ -369,7 +362,6 @@ echo zookeeper run a Zookeeper server echo rest run an HBase REST server echo thrift run the HBase Thrift server - echo thrift2 run the HBase Thrift2 server echo avro run an HBase Avro server echo. echo PACKAGE MANAGEMENT Index: dev-support/findbugs-exclude.xml =================================================================== --- dev-support/findbugs-exclude.xml (revision 1471070) +++ dev-support/findbugs-exclude.xml (working copy) @@ -17,10 +17,6 @@ - - - - Index: hbase-examples/thrift2/DemoClient.java =================================================================== --- hbase-examples/thrift2/DemoClient.java (revision 1471070) +++ hbase-examples/thrift2/DemoClient.java (working copy) @@ -1,89 +0,0 @@ -/** - * - * 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.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; - -import org.apache.hadoop.hbase.thrift2.generated.TColumnValue; -import org.apache.hadoop.hbase.thrift2.generated.TGet; -import org.apache.hadoop.hbase.thrift2.generated.THBaseService; -import org.apache.hadoop.hbase.thrift2.generated.TIOError; -import org.apache.hadoop.hbase.thrift2.generated.TPut; -import org.apache.hadoop.hbase.thrift2.generated.TResult; -import org.apache.thrift.TException; -import org.apache.thrift.protocol.TBinaryProtocol; -import org.apache.thrift.protocol.TProtocol; -import org.apache.thrift.transport.TFramedTransport; -import org.apache.thrift.transport.TSocket; -import org.apache.thrift.transport.TTransport; - -public class DemoClient { - public static void main(String[] args) throws TIOError, TException { - System.out.println("Thrift2 Demo"); - System.out.println("This demo assumes you have a table called \"example\" with a column family called \"family1\""); - - String host = "localhost"; - int port = 9090; - int timeout = 10000; - boolean framed = false; - - TTransport transport = new TSocket(host, port, timeout); - if (framed) { - transport = new TFramedTransport(transport); - } - TProtocol protocol = new TBinaryProtocol(transport); - // This is our thrift client. - THBaseService.Iface client = new THBaseService.Client(protocol); - - // open the transport - transport.open(); - - ByteBuffer table = ByteBuffer.wrap("example".getBytes()); - - TPut put = new TPut(); - put.setRow("row1".getBytes()); - - TColumnValue columnValue = new TColumnValue(); - columnValue.setFamily("family1".getBytes()); - columnValue.setQualifier("qualifier1".getBytes()); - columnValue.setValue("value1".getBytes()); - List columnValues = new ArrayList(); - columnValues.add(columnValue); - put.setColumnValues(columnValues); - - client.put(table, put); - - TGet get = new TGet(); - get.setRow("row1".getBytes()); - - TResult result = client.get(table, get); - - System.out.print("row = " + new String(result.getRow())); - for (TColumnValue resultColumnValue : result.getColumnValues()) { - System.out.print("family = " + new String(resultColumnValue.getFamily())); - System.out.print("qualifier = " + new String(resultColumnValue.getFamily())); - System.out.print("value = " + new String(resultColumnValue.getValue())); - System.out.print("timestamp = " + resultColumnValue.getTimestamp()); - } - - transport.close(); - } -} Index: hbase-examples/thrift2/DemoClient.py =================================================================== --- hbase-examples/thrift2/DemoClient.py (revision 1471070) +++ hbase-examples/thrift2/DemoClient.py (working copy) @@ -1,68 +0,0 @@ -""" - - 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. -""" -# Instructions: -# 1. Run Thrift to generate the python module hbase -# thrift --gen py ../../../src/main/resources/org/apache/hadoop/hbase/thrift2/hbase.thrift -# 2. Create a directory of your choosing that contains: -# a. This file (DemoClient.py). -# b. The directory gen-py/hbase (generated by instruction step 1). -# 3. pip install thrift==0.7.0 -# 4. Create a table call "example", with a family called "family1" using the hbase shell. -# 5. Start the hbase thrift2 server -# bin/hbase thrift2 start -# 6. Execute {python DemoClient.py}. - -from thrift.transport import TTransport -from thrift.transport import TSocket -from thrift.transport import THttpClient -from thrift.protocol import TBinaryProtocol - -from hbase import THBaseService -from hbase.ttypes import * - -print "Thrift2 Demo" -print "This demo assumes you have a table called \"example\" with a column family called \"family1\"" - -host = "localhost" -port = 9090 -framed = False - -socket = TSocket.TSocket(host, port) -if framed: - transport = TTransport.TFramedTransport(socket) -else: - transport = TTransport.TBufferedTransport(socket) -protocol = TBinaryProtocol.TBinaryProtocol(transport) -client = THBaseService.Client(protocol) - -transport.open() - -table = "example" - -put = TPut(row="row1", columnValues=[TColumnValue(family="family1",qualifier="qualifier1",value="value1")]) -print "Putting:", put -client.put(table, put) - -get = TGet(row="row1") -print "Getting:", get -result = client.get(table, get) - -print "Result:", result - -transport.close() Index: hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/ThriftHBaseServiceHandler.java =================================================================== --- hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/ThriftHBaseServiceHandler.java (revision 1471070) +++ hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/ThriftHBaseServiceHandler.java (working copy) @@ -1,343 +0,0 @@ -/** - * - * 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.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.scanFromThrift; - -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.classification.InterfaceAudience; -import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.hbase.client.Delete; -import org.apache.hadoop.hbase.client.HTableInterface; -import org.apache.hadoop.hbase.client.HTablePool; -import org.apache.hadoop.hbase.client.ResultScanner; -import org.apache.hadoop.hbase.thrift.ThriftMetrics; -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.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.TScan; -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 - * HTableInterface. - */ -@InterfaceAudience.Private -public class ThriftHBaseServiceHandler implements THBaseService.Iface { - - // TODO: Size of pool configuraple - private final HTablePool htablePool; - 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(); - - public static THBaseService.Iface newInstance( - Configuration conf, ThriftMetrics metrics) { - THBaseService.Iface handler = new ThriftHBaseServiceHandler(conf); - return (THBaseService.Iface) Proxy.newProxyInstance( - handler.getClass().getClassLoader(), - new Class[]{THBaseService.Iface.class}, - new THBaseServiceMetricsProxy(handler, metrics)); - } - - private static 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(Configuration conf) { - htablePool = new HTablePool(conf, Integer.MAX_VALUE); - } - - private HTableInterface getTable(byte[] tableName) { - return htablePool.getTable(tableName); - } - - private void closeTable(HTableInterface 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); - } - - /** - * 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 { - HTableInterface htable = getTable(table.array()); - 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 { - HTableInterface htable = getTable(table.array()); - 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 { - HTableInterface htable = getTable(table.array()); - 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 { - HTableInterface htable = getTable(table.array()); - 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 { - HTableInterface htable = getTable(table.array()); - try { - return htable.checkAndPut(row.array(), family.array(), qualifier.array(), (value == null) ? null : value.array(), putFromThrift(put)); - } catch (IOException e) { - throw getTIOError(e); - } finally { - closeTable(htable); - } - } - - @Override - public void putMultiple(ByteBuffer table, List puts) throws TIOError, TException { - HTableInterface htable = getTable(table.array()); - 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 { - HTableInterface htable = getTable(table.array()); - 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 { - HTableInterface htable = getTable(table.array()); - try { - htable.delete(deletesFromThrift(deletes)); - } catch (IOException e) { - throw getTIOError(e); - } finally { - closeTable(htable); - } - return Collections.emptyList(); - } - - @Override - public boolean checkAndDelete(ByteBuffer table, ByteBuffer row, ByteBuffer family, ByteBuffer qualifier, ByteBuffer value, - TDelete deleteSingle) throws TIOError, TException { - HTableInterface htable = getTable(table.array()); - - try { - if (value == null) { - return htable.checkAndDelete(row.array(), family.array(), qualifier.array(), null, deleteFromThrift(deleteSingle)); - } else { - return htable.checkAndDelete(row.array(), family.array(), qualifier.array(), value.array(), deleteFromThrift(deleteSingle)); - } - } catch (IOException e) { - throw getTIOError(e); - } finally { - closeTable(htable); - } - } - - @Override - public TResult increment(ByteBuffer table, TIncrement increment) throws TIOError, TException { - HTableInterface htable = getTable(table.array()); - try { - return resultFromHBase(htable.increment(incrementFromThrift(increment))); - } catch (IOException e) { - throw getTIOError(e); - } finally { - closeTable(htable); - } - } - - @Override - public int openScanner(ByteBuffer table, TScan scan) throws TIOError, TException { - HTableInterface htable = getTable(table.array()); - 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 { - return resultsFromHBase(scanner.next(numRows)); - } catch (IOException e) { - throw getTIOError(e); - } - } - - @Override - public void closeScanner(int scannerId) throws TIOError, TIllegalArgument, TException { - if (removeScanner(scannerId) == null) { - TIllegalArgument ex = new TIllegalArgument(); - ex.setMessage("Invalid scanner Id"); - throw ex; - } - } - -} Index: hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/ThriftServer.java =================================================================== --- hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/ThriftServer.java (revision 1471070) +++ hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/ThriftServer.java (working copy) @@ -1,291 +0,0 @@ -/** - * - * 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.net.InetAddress; -import java.net.InetSocketAddress; -import java.net.UnknownHostException; -import java.util.List; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.LinkedBlockingQueue; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; - -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.classification.InterfaceAudience; -import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.hbase.HBaseConfiguration; -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.InfoServer; -import org.apache.thrift.protocol.TBinaryProtocol; -import org.apache.thrift.protocol.TCompactProtocol; -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.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.Private -@SuppressWarnings({ "rawtypes", "unchecked" }) -public class ThriftServer { - private static final Log log = LogFactory.getLog(ThriftServer.class); - - public static final String DEFAULT_LISTEN_PORT = "9090"; - - 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("h", "help", false, "Print help information"); - options.addOption(null, "infoport", true, "Port for web UI"); - - 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(Options options, String[] args) throws ParseException { - 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(boolean framed) { - if (framed) { - log.debug("Using framed transport"); - return new TFramedTransport.Factory(); - } else { - return new TTransportFactory(); - } - } - - /* - * 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, THBaseService.Processor 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, - THBaseService.Processor processor, TTransportFactory transportFactory, - 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); - ExecutorService executorService = createExecutor( - serverArgs.getWorkerThreads(), metrics); - serverArgs.executorService(executorService); - serverArgs.processor(processor); - serverArgs.transportFactory(transportFactory); - serverArgs.protocolFactory(protocolFactory); - return new THsHaServer(serverArgs); - } - - private static ExecutorService createExecutor( - int workerThreads, ThriftMetrics metrics) { - CallQueue callQueue = new CallQueue( - new LinkedBlockingQueue(), metrics); - ThreadFactoryBuilder tfb = new ThreadFactoryBuilder(); - tfb.setDaemon(true); - tfb.setNameFormat("thrift2-worker-%d"); - return new ThreadPoolExecutor(workerThreads, workerThreads, - Long.MAX_VALUE, TimeUnit.SECONDS, callQueue, tfb.build()); - } - - private static TServer getTThreadPoolServer(TProtocolFactory protocolFactory, THBaseService.Processor processor, - TTransportFactory transportFactory, InetSocketAddress inetSocketAddress) throws TTransportException { - TServerTransport serverTransport = new TServerSocket(inetSocketAddress); - 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); - return new TThreadPoolServer(serverArgs); - } - - /** - * Start up the Thrift2 server. - * - * @param args - */ - public static void main(String[] args) throws Exception { - TServer server = null; - Options options = getOptions(); - try { - CommandLine cmd = parseArguments(options, args); - - /** - * 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(); - System.exit(1); - } - - // Get port to bind to - int listenPort = 0; - try { - listenPort = Integer.parseInt(cmd.getOptionValue("port", DEFAULT_LISTEN_PORT)); - } catch (NumberFormatException e) { - throw new RuntimeException("Could not parse the value provided for the port option", e); - } - - boolean nonblocking = cmd.hasOption("nonblocking"); - boolean hsha = cmd.hasOption("hsha"); - - Configuration conf = HBaseConfiguration.create(); - ThriftMetrics metrics = new ThriftMetrics(conf, ThriftMetrics.ThriftServerType.TWO); - - 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); - - // Construct correct ProtocolFactory - boolean compact = cmd.hasOption("compact"); - TProtocolFactory protocolFactory = getTProtocolFactory(compact); - THBaseService.Iface handler = - ThriftHBaseServiceHandler.newInstance(conf, metrics); - THBaseService.Processor processor = new THBaseService.Processor(handler); - conf.setBoolean("hbase.regionserver.thrift.compact", compact); - - boolean framed = cmd.hasOption("framed") || nonblocking || hsha; - TTransportFactory transportFactory = getTTransportFactory(framed); - InetSocketAddress inetSocketAddress = bindToPort(cmd.getOptionValue("bind"), listenPort); - conf.setBoolean("hbase.regionserver.thrift.framed", framed); - - // 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.valueOf(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, inetSocketAddress, metrics); - } else { - server = getTThreadPoolServer(protocolFactory, processor, transportFactory, inetSocketAddress); - } - } catch (Exception e) { - log.error(e.getMessage(), e); - printUsage(); - System.exit(1); - } - server.serve(); - } -} Index: hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/ThriftUtilities.java =================================================================== --- hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/ThriftUtilities.java (revision 1471070) +++ hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/ThriftUtilities.java (working copy) @@ -1,328 +0,0 @@ -/** - * - * 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 org.apache.hadoop.classification.InterfaceAudience; -import org.apache.hadoop.hbase.HConstants; -import org.apache.hadoop.hbase.KeyValue; -import org.apache.hadoop.hbase.KeyValueUtil; -import org.apache.hadoop.hbase.client.*; -import org.apache.hadoop.hbase.thrift2.generated.*; - -import java.io.IOException; -import java.nio.ByteBuffer; -import java.util.*; - -@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.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) { - KeyValue[] raw = in.raw(); - TResult out = new TResult(); - byte[] row = in.getRow(); - if (row != null) { - out.setRow(in.getRow()); - } - List columnValues = new ArrayList(); - for (KeyValue kv : raw) { - TColumnValue col = new TColumnValue(); - col.setFamily(kv.getFamily()); - col.setQualifier(kv.getQualifier()); - col.setTimestamp(kv.getTimestamp()); - col.setValue(kv.getValue()); - 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()); - } - - out.setDurability(in.isWriteToWal() ? Durability.SYNC_WAL : Durability.SKIP_WAL); - - for (TColumnValue columnValue : in.getColumnValues()) { - if (columnValue.isSetTimestamp()) { - out.add(columnValue.getFamily(), columnValue.getQualifier(), columnValue.getTimestamp(), - columnValue.getValue()); - } else { - out.add(columnValue.getFamily(), columnValue.getQualifier(), columnValue.getValue()); - } - } - - 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.deleteColumns(column.getFamily(), column.getQualifier(), column.getTimestamp()); - else - out.deleteColumn(column.getFamily(), column.getQualifier(), column.getTimestamp()); - } else { - if (in.isSetDeleteType() && - in.getDeleteType().equals(TDeleteType.DELETE_COLUMNS)) - out.deleteColumns(column.getFamily(), column.getQualifier()); - else - out.deleteColumn(column.getFamily(), column.getQualifier()); - } - - } else { - if (column.isSetTimestamp()) { - out.deleteFamily(column.getFamily(), column.getTimestamp()); - } else { - out.deleteFamily(column.getFamily()); - } - } - } - } else { - if (in.isSetTimestamp()) { - out = new Delete(in.getRow(), in.getTimestamp()); - } else { - out = new Delete(in.getRow()); - } - } - out.setDurability(in.isWriteToWal() ? Durability.SYNC_WAL : Durability.SKIP_WAL); - 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.getFamilyMap().entrySet()) { - TColumn column = new TColumn(ByteBuffer.wrap(familyEntry.getKey())); - for (org.apache.hadoop.hbase.Cell cell: familyEntry.getValue()) { - KeyValue kv = KeyValueUtil.ensureKeyValue(cell); - byte[] family = kv.getFamily(); - byte[] qualifier = kv.getQualifier(); - long timestamp = kv.getTimestamp(); - if (family != null) { - column.setFamily(family); - } - if (qualifier != null) { - column.setQualifier(qualifier); - } - if (timestamp != HConstants.LATEST_TIMESTAMP) { - column.setTimestamp(kv.getTimestamp()); - } - } - columns.add(column); - } - out.setColumns(columns); - - 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()); - } - - 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()); - } - out.setDurability(in.isWriteToWal() ? Durability.SYNC_WAL : Durability.SKIP_WAL); - return out; - } -} Index: hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TColumn.java =================================================================== --- hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TColumn.java (revision 1471070) +++ hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TColumn.java (working copy) @@ -1,611 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * 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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Addresses a single cell or multiple cells - * in a HBase table by column family and optionally - * a column qualifier and timestamp - */ -public class TColumn implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - 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 _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 = 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 family; - } - - public TColumn setFamily(byte[] family) { - setFamily(family == null ? (ByteBuffer)null : ByteBuffer.wrap(family)); - return this; - } - - public TColumn setFamily(ByteBuffer family) { - this.family = 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 qualifier; - } - - public TColumn setQualifier(byte[] qualifier) { - setQualifier(qualifier == null ? (ByteBuffer)null : ByteBuffer.wrap(qualifier)); - return this; - } - - public TColumn setQualifier(ByteBuffer qualifier) { - this.qualifier = 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 Long.valueOf(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() { - return 0; - } - - public int compareTo(TColumn other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TColumn typedOther = (TColumn)other; - - lastComparison = Boolean.valueOf(isSetFamily()).compareTo(typedOther.isSetFamily()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetFamily()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.family, typedOther.family); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetQualifier()).compareTo(typedOther.isSetQualifier()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetQualifier()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.qualifier, typedOther.qualifier); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(typedOther.isSetTimestamp()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetTimestamp()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timestamp, typedOther.timestamp); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(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); - } - } - } - -} - Index: hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TColumnIncrement.java =================================================================== --- hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TColumnIncrement.java (revision 1471070) +++ hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TColumnIncrement.java (working copy) @@ -1,605 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * 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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Represents a single cell and the amount to increment it by - */ -public class TColumnIncrement implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - 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 _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 = family; - this.qualifier = 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 family; - } - - public TColumnIncrement setFamily(byte[] family) { - setFamily(family == null ? (ByteBuffer)null : ByteBuffer.wrap(family)); - return this; - } - - public TColumnIncrement setFamily(ByteBuffer family) { - this.family = 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 qualifier; - } - - public TColumnIncrement setQualifier(byte[] qualifier) { - setQualifier(qualifier == null ? (ByteBuffer)null : ByteBuffer.wrap(qualifier)); - return this; - } - - public TColumnIncrement setQualifier(ByteBuffer qualifier) { - this.qualifier = 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 Long.valueOf(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() { - return 0; - } - - public int compareTo(TColumnIncrement other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TColumnIncrement typedOther = (TColumnIncrement)other; - - lastComparison = Boolean.valueOf(isSetFamily()).compareTo(typedOther.isSetFamily()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetFamily()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.family, typedOther.family); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetQualifier()).compareTo(typedOther.isSetQualifier()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetQualifier()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.qualifier, typedOther.qualifier); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetAmount()).compareTo(typedOther.isSetAmount()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetAmount()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.amount, typedOther.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); - } - } - } - -} - Index: hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TColumnValue.java =================================================================== --- hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TColumnValue.java (revision 1471070) +++ hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TColumnValue.java (working copy) @@ -1,710 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * 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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Represents a single cell and its value. - */ -public class TColumnValue implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - 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 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 - - /** 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"); - - 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; - 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 _Fields optionals[] = {_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.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))); - 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 = family; - this.qualifier = qualifier; - this.value = 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; - } - - 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; - } - - public byte[] getFamily() { - setFamily(org.apache.thrift.TBaseHelper.rightSize(family)); - return family == null ? null : family.array(); - } - - public ByteBuffer bufferForFamily() { - return family; - } - - public TColumnValue setFamily(byte[] family) { - setFamily(family == null ? (ByteBuffer)null : ByteBuffer.wrap(family)); - return this; - } - - public TColumnValue setFamily(ByteBuffer family) { - this.family = 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 qualifier; - } - - public TColumnValue setQualifier(byte[] qualifier) { - setQualifier(qualifier == null ? (ByteBuffer)null : ByteBuffer.wrap(qualifier)); - return this; - } - - public TColumnValue setQualifier(ByteBuffer qualifier) { - this.qualifier = 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 value; - } - - public TColumnValue setValue(byte[] value) { - setValue(value == null ? (ByteBuffer)null : ByteBuffer.wrap(value)); - return this; - } - - public TColumnValue setValue(ByteBuffer value) { - this.value = 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 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; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case FAMILY: - return getFamily(); - - case QUALIFIER: - return getQualifier(); - - case VALUE: - return getValue(); - - case TIMESTAMP: - return Long.valueOf(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 VALUE: - return isSetValue(); - case TIMESTAMP: - return isSetTimestamp(); - } - 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; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - public int compareTo(TColumnValue other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TColumnValue typedOther = (TColumnValue)other; - - lastComparison = Boolean.valueOf(isSetFamily()).compareTo(typedOther.isSetFamily()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetFamily()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.family, typedOther.family); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetQualifier()).compareTo(typedOther.isSetQualifier()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetQualifier()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.qualifier, typedOther.qualifier); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetValue()).compareTo(typedOther.isSetValue()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetValue()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, typedOther.value); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(typedOther.isSetTimestamp()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetTimestamp()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timestamp, typedOther.timestamp); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(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; - } - 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; - 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(); - } - 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); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetTimestamp()) { - oprot.writeI64(struct.timestamp); - } - } - - @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(1); - if (incoming.get(0)) { - struct.timestamp = iprot.readI64(); - struct.setTimestampIsSet(true); - } - } - } - -} - Index: hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TDelete.java =================================================================== --- hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TDelete.java (revision 1471070) +++ hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TDelete.java (working copy) @@ -1,890 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * 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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * 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) - * - */ -public class TDelete implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - 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 WRITE_TO_WAL_FIELD_DESC = new org.apache.thrift.protocol.TField("writeToWal", org.apache.thrift.protocol.TType.BOOL, (short)5); - - 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 boolean writeToWal; // 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"), - WRITE_TO_WAL((short)5, "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: // ROW - return ROW; - case 2: // COLUMNS - return COLUMNS; - case 3: // TIMESTAMP - return TIMESTAMP; - case 4: // DELETE_TYPE - return DELETE_TYPE; - case 5: // 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 __TIMESTAMP_ISSET_ID = 0; - private static final int __WRITETOWAL_ISSET_ID = 1; - private byte __isset_bitfield = 0; - private _Fields optionals[] = {_Fields.COLUMNS,_Fields.TIMESTAMP,_Fields.DELETE_TYPE,_Fields.WRITE_TO_WAL}; - 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.WRITE_TO_WAL, new org.apache.thrift.meta_data.FieldMetaData("writeToWal", 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(TDelete.class, metaDataMap); - } - - public TDelete() { - this.deleteType = org.apache.hadoop.hbase.thrift2.generated.TDeleteType.DELETE_COLUMNS; - - this.writeToWal = true; - - } - - public TDelete( - ByteBuffer row) - { - this(); - this.row = 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(); - 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; - } - this.writeToWal = other.writeToWal; - } - - 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.writeToWal = true; - - } - - public byte[] getRow() { - setRow(org.apache.thrift.TBaseHelper.rightSize(row)); - return row == null ? null : row.array(); - } - - public ByteBuffer bufferForRow() { - return row; - } - - public TDelete setRow(byte[] row) { - setRow(row == null ? (ByteBuffer)null : ByteBuffer.wrap(row)); - return this; - } - - public TDelete setRow(ByteBuffer row) { - this.row = 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 boolean isWriteToWal() { - return this.writeToWal; - } - - public TDelete 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 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 WRITE_TO_WAL: - if (value == null) { - unsetWriteToWal(); - } else { - setWriteToWal((Boolean)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case ROW: - return getRow(); - - case COLUMNS: - return getColumns(); - - case TIMESTAMP: - return Long.valueOf(getTimestamp()); - - case DELETE_TYPE: - return getDeleteType(); - - case WRITE_TO_WAL: - return Boolean.valueOf(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 ROW: - return isSetRow(); - case COLUMNS: - return isSetColumns(); - case TIMESTAMP: - return isSetTimestamp(); - case DELETE_TYPE: - return isSetDeleteType(); - case WRITE_TO_WAL: - return isSetWriteToWal(); - } - 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_writeToWal = true && this.isSetWriteToWal(); - boolean that_present_writeToWal = true && that.isSetWriteToWal(); - 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() { - return 0; - } - - public int compareTo(TDelete other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TDelete typedOther = (TDelete)other; - - lastComparison = Boolean.valueOf(isSetRow()).compareTo(typedOther.isSetRow()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetRow()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.row, typedOther.row); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetColumns()).compareTo(typedOther.isSetColumns()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetColumns()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columns, typedOther.columns); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(typedOther.isSetTimestamp()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetTimestamp()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timestamp, typedOther.timestamp); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetDeleteType()).compareTo(typedOther.isSetDeleteType()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetDeleteType()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.deleteType, typedOther.deleteType); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetWriteToWal()).compareTo(typedOther.isSetWriteToWal()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetWriteToWal()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.writeToWal, typedOther.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("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 (isSetWriteToWal()) { - 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 - 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 _list24 = iprot.readListBegin(); - struct.columns = new ArrayList(_list24.size); - for (int _i25 = 0; _i25 < _list24.size; ++_i25) - { - TColumn _elem26; // required - _elem26 = new TColumn(); - _elem26.read(iprot); - struct.columns.add(_elem26); - } - 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 = TDeleteType.findByValue(iprot.readI32()); - struct.setDeleteTypeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 5: // 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, 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 _iter27 : struct.columns) - { - _iter27.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.isSetWriteToWal()) { - oprot.writeFieldBegin(WRITE_TO_WAL_FIELD_DESC); - oprot.writeBool(struct.writeToWal); - 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.isSetWriteToWal()) { - optionals.set(3); - } - oprot.writeBitSet(optionals, 4); - if (struct.isSetColumns()) { - { - oprot.writeI32(struct.columns.size()); - for (TColumn _iter28 : struct.columns) - { - _iter28.write(oprot); - } - } - } - if (struct.isSetTimestamp()) { - oprot.writeI64(struct.timestamp); - } - if (struct.isSetDeleteType()) { - oprot.writeI32(struct.deleteType.getValue()); - } - if (struct.isSetWriteToWal()) { - oprot.writeBool(struct.writeToWal); - } - } - - @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(4); - if (incoming.get(0)) { - { - org.apache.thrift.protocol.TList _list29 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.columns = new ArrayList(_list29.size); - for (int _i30 = 0; _i30 < _list29.size; ++_i30) - { - TColumn _elem31; // required - _elem31 = new TColumn(); - _elem31.read(iprot); - struct.columns.add(_elem31); - } - } - struct.setColumnsIsSet(true); - } - if (incoming.get(1)) { - struct.timestamp = iprot.readI64(); - struct.setTimestampIsSet(true); - } - if (incoming.get(2)) { - struct.deleteType = TDeleteType.findByValue(iprot.readI32()); - struct.setDeleteTypeIsSet(true); - } - if (incoming.get(3)) { - struct.writeToWal = iprot.readBool(); - struct.setWriteToWalIsSet(true); - } - } - } - -} - Index: hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TDeleteType.java =================================================================== --- hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TDeleteType.java (revision 1471070) +++ hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TDeleteType.java (working copy) @@ -1,50 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * 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; - } - } -} Index: hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TGet.java =================================================================== --- hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TGet.java (revision 1471070) +++ hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TGet.java (working copy) @@ -1,866 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * 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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * 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. - * - * TODO: Filter, Locks - */ -public class TGet implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - 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 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 - - /** 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"); - - 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; - 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 _Fields optionals[] = {_Fields.COLUMNS,_Fields.TIMESTAMP,_Fields.TIME_RANGE,_Fields.MAX_VERSIONS}; - 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))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGet.class, metaDataMap); - } - - public TGet() { - } - - public TGet( - ByteBuffer row) - { - this(); - this.row = 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(); - 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; - } - - 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; - } - - public byte[] getRow() { - setRow(org.apache.thrift.TBaseHelper.rightSize(row)); - return row == null ? null : row.array(); - } - - public ByteBuffer bufferForRow() { - return row; - } - - public TGet setRow(byte[] row) { - setRow(row == null ? (ByteBuffer)null : ByteBuffer.wrap(row)); - return this; - } - - public TGet setRow(ByteBuffer row) { - this.row = 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 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; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case ROW: - return getRow(); - - case COLUMNS: - return getColumns(); - - case TIMESTAMP: - return Long.valueOf(getTimestamp()); - - case TIME_RANGE: - return getTimeRange(); - - case MAX_VERSIONS: - return Integer.valueOf(getMaxVersions()); - - } - 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(); - } - 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; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - public int compareTo(TGet other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TGet typedOther = (TGet)other; - - lastComparison = Boolean.valueOf(isSetRow()).compareTo(typedOther.isSetRow()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetRow()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.row, typedOther.row); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetColumns()).compareTo(typedOther.isSetColumns()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetColumns()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columns, typedOther.columns); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(typedOther.isSetTimestamp()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetTimestamp()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timestamp, typedOther.timestamp); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetTimeRange()).compareTo(typedOther.isSetTimeRange()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetTimeRange()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timeRange, typedOther.timeRange); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetMaxVersions()).compareTo(typedOther.isSetMaxVersions()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetMaxVersions()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.maxVersions, typedOther.maxVersions); - 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; - } - 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(); - } - } - - 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 _list8 = iprot.readListBegin(); - struct.columns = new ArrayList(_list8.size); - for (int _i9 = 0; _i9 < _list8.size; ++_i9) - { - TColumn _elem10; // required - _elem10 = new TColumn(); - _elem10.read(iprot); - struct.columns.add(_elem10); - } - 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; - 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 _iter11 : struct.columns) - { - _iter11.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(); - } - 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); - } - oprot.writeBitSet(optionals, 4); - if (struct.isSetColumns()) { - { - oprot.writeI32(struct.columns.size()); - for (TColumn _iter12 : struct.columns) - { - _iter12.write(oprot); - } - } - } - if (struct.isSetTimestamp()) { - oprot.writeI64(struct.timestamp); - } - if (struct.isSetTimeRange()) { - struct.timeRange.write(oprot); - } - if (struct.isSetMaxVersions()) { - oprot.writeI32(struct.maxVersions); - } - } - - @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(4); - if (incoming.get(0)) { - { - org.apache.thrift.protocol.TList _list13 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.columns = new ArrayList(_list13.size); - for (int _i14 = 0; _i14 < _list13.size; ++_i14) - { - TColumn _elem15; // required - _elem15 = new TColumn(); - _elem15.read(iprot); - struct.columns.add(_elem15); - } - } - 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); - } - } - } - -} - Index: hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/generated/THBaseService.java =================================================================== --- hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/generated/THBaseService.java (revision 1471070) +++ hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/generated/THBaseService.java (working copy) @@ -1,14654 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * 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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -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 get the TGet to check for - */ - public boolean exists(ByteBuffer table, TGet get) 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 get the TGet to fetch - */ - public TResult get(ByteBuffer table, TGet get) 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 gets 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 gets) throws TIOError, org.apache.thrift.TException; - - /** - * Commit a TPut to a table. - * - * @param table the table to put data in - * - * @param put the TPut to put - */ - public void put(ByteBuffer table, TPut put) 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 put the TPut to put if the check succeeds - */ - public boolean checkAndPut(ByteBuffer table, ByteBuffer row, ByteBuffer family, ByteBuffer qualifier, ByteBuffer value, TPut put) throws TIOError, org.apache.thrift.TException; - - /** - * Commit a List of Puts to the table. - * - * @param table the table to put data in - * - * @param puts a list of TPuts to commit - */ - public void putMultiple(ByteBuffer table, List puts) 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 deleteSingle the TDelete to delete - */ - public void deleteSingle(ByteBuffer table, TDelete deleteSingle) throws TIOError, org.apache.thrift.TException; - - /** - * Bulk commit a List of TDeletes to the table. - * - * This returns a list of TDeletes that were not - * executed. So if everything succeeds you'll - * receive an empty list. - * - * @param table the table to delete from - * - * @param deletes list of TDeletes to delete - */ - public List deleteMultiple(ByteBuffer table, List deletes) 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 deleteSingle the TDelete to execute if the check succeeds - */ - public boolean checkAndDelete(ByteBuffer table, ByteBuffer row, ByteBuffer family, ByteBuffer qualifier, ByteBuffer value, TDelete deleteSingle) throws TIOError, org.apache.thrift.TException; - - public TResult increment(ByteBuffer table, TIncrement increment) 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 scan the scan object to get a Scanner for - */ - public int openScanner(ByteBuffer table, TScan scan) 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 if you need to close - * the Scanner before all results are read. - * - * Exhausted scanners are closed automatically. - * - * @param scannerId the Id of the Scanner to close * - */ - public void closeScanner(int scannerId) throws TIOError, TIllegalArgument, org.apache.thrift.TException; - - } - - public interface AsyncIface { - - public void exists(ByteBuffer table, TGet get, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void get(ByteBuffer table, TGet get, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void getMultiple(ByteBuffer table, List gets, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void put(ByteBuffer table, TPut put, 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 put, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void putMultiple(ByteBuffer table, List puts, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void deleteSingle(ByteBuffer table, TDelete deleteSingle, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void deleteMultiple(ByteBuffer table, List deletes, 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 deleteSingle, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void increment(ByteBuffer table, TIncrement increment, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void openScanner(ByteBuffer table, TScan scan, 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 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 get) throws TIOError, org.apache.thrift.TException - { - send_exists(table, get); - return recv_exists(); - } - - public void send_exists(ByteBuffer table, TGet get) throws org.apache.thrift.TException - { - exists_args args = new exists_args(); - args.setTable(table); - args.setGet(get); - 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 get) throws TIOError, org.apache.thrift.TException - { - send_get(table, get); - return recv_get(); - } - - public void send_get(ByteBuffer table, TGet get) throws org.apache.thrift.TException - { - get_args args = new get_args(); - args.setTable(table); - args.setGet(get); - 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 gets) throws TIOError, org.apache.thrift.TException - { - send_getMultiple(table, gets); - return recv_getMultiple(); - } - - public void send_getMultiple(ByteBuffer table, List gets) throws org.apache.thrift.TException - { - getMultiple_args args = new getMultiple_args(); - args.setTable(table); - args.setGets(gets); - 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 put) throws TIOError, org.apache.thrift.TException - { - send_put(table, put); - recv_put(); - } - - public void send_put(ByteBuffer table, TPut put) throws org.apache.thrift.TException - { - put_args args = new put_args(); - args.setTable(table); - args.setPut(put); - 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 put) throws TIOError, org.apache.thrift.TException - { - send_checkAndPut(table, row, family, qualifier, value, put); - return recv_checkAndPut(); - } - - public void send_checkAndPut(ByteBuffer table, ByteBuffer row, ByteBuffer family, ByteBuffer qualifier, ByteBuffer value, TPut put) 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.setPut(put); - 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 puts) throws TIOError, org.apache.thrift.TException - { - send_putMultiple(table, puts); - recv_putMultiple(); - } - - public void send_putMultiple(ByteBuffer table, List puts) throws org.apache.thrift.TException - { - putMultiple_args args = new putMultiple_args(); - args.setTable(table); - args.setPuts(puts); - 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 deleteSingle) throws TIOError, org.apache.thrift.TException - { - send_deleteSingle(table, deleteSingle); - recv_deleteSingle(); - } - - public void send_deleteSingle(ByteBuffer table, TDelete deleteSingle) throws org.apache.thrift.TException - { - deleteSingle_args args = new deleteSingle_args(); - args.setTable(table); - args.setDeleteSingle(deleteSingle); - 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 deletes) throws TIOError, org.apache.thrift.TException - { - send_deleteMultiple(table, deletes); - return recv_deleteMultiple(); - } - - public void send_deleteMultiple(ByteBuffer table, List deletes) throws org.apache.thrift.TException - { - deleteMultiple_args args = new deleteMultiple_args(); - args.setTable(table); - args.setDeletes(deletes); - 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 deleteSingle) throws TIOError, org.apache.thrift.TException - { - send_checkAndDelete(table, row, family, qualifier, value, deleteSingle); - return recv_checkAndDelete(); - } - - public void send_checkAndDelete(ByteBuffer table, ByteBuffer row, ByteBuffer family, ByteBuffer qualifier, ByteBuffer value, TDelete deleteSingle) 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.setDeleteSingle(deleteSingle); - 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 increment) throws TIOError, org.apache.thrift.TException - { - send_increment(table, increment); - return recv_increment(); - } - - public void send_increment(ByteBuffer table, TIncrement increment) throws org.apache.thrift.TException - { - increment_args args = new increment_args(); - args.setTable(table); - args.setIncrement(increment); - 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 int openScanner(ByteBuffer table, TScan scan) throws TIOError, org.apache.thrift.TException - { - send_openScanner(table, scan); - return recv_openScanner(); - } - - public void send_openScanner(ByteBuffer table, TScan scan) throws org.apache.thrift.TException - { - openScanner_args args = new openScanner_args(); - args.setTable(table); - args.setScan(scan); - 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 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 get, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - exists_call method_call = new exists_call(table, get, 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 get; - public exists_call(ByteBuffer table, TGet get, 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.get = get; - } - - 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.setGet(get); - 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 get, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - get_call method_call = new get_call(table, get, 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 get; - public get_call(ByteBuffer table, TGet get, 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.get = get; - } - - 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.setGet(get); - 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 gets, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - getMultiple_call method_call = new getMultiple_call(table, gets, 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 gets; - public getMultiple_call(ByteBuffer table, List gets, 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.gets = gets; - } - - 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.setGets(gets); - 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 put, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - put_call method_call = new put_call(table, put, 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 put; - public put_call(ByteBuffer table, TPut put, 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.put = put; - } - - 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.setPut(put); - 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 put, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - checkAndPut_call method_call = new checkAndPut_call(table, row, family, qualifier, value, put, 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 put; - public checkAndPut_call(ByteBuffer table, ByteBuffer row, ByteBuffer family, ByteBuffer qualifier, ByteBuffer value, TPut put, 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.put = put; - } - - 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.setPut(put); - 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 puts, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - putMultiple_call method_call = new putMultiple_call(table, puts, 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 puts; - public putMultiple_call(ByteBuffer table, List puts, 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.puts = puts; - } - - 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.setPuts(puts); - 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 deleteSingle, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - deleteSingle_call method_call = new deleteSingle_call(table, deleteSingle, 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 deleteSingle; - public deleteSingle_call(ByteBuffer table, TDelete deleteSingle, 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.deleteSingle = deleteSingle; - } - - 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.setDeleteSingle(deleteSingle); - 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 deletes, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - deleteMultiple_call method_call = new deleteMultiple_call(table, deletes, 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 deletes; - public deleteMultiple_call(ByteBuffer table, List deletes, 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.deletes = deletes; - } - - 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.setDeletes(deletes); - 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 deleteSingle, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - checkAndDelete_call method_call = new checkAndDelete_call(table, row, family, qualifier, value, deleteSingle, 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 deleteSingle; - public checkAndDelete_call(ByteBuffer table, ByteBuffer row, ByteBuffer family, ByteBuffer qualifier, ByteBuffer value, TDelete deleteSingle, 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.deleteSingle = deleteSingle; - } - - 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.setDeleteSingle(deleteSingle); - 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 increment, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - increment_call method_call = new increment_call(table, 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 ByteBuffer table; - private TIncrement increment; - public increment_call(ByteBuffer table, 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.table = table; - 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.setTable(table); - args.setIncrement(increment); - 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 openScanner(ByteBuffer table, TScan scan, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - openScanner_call method_call = new openScanner_call(table, scan, 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 scan; - public openScanner_call(ByteBuffer table, TScan scan, 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.scan = scan; - } - - 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.setScan(scan); - 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 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("openScanner", new openScanner()); - processMap.put("getScannerRows", new getScannerRows()); - processMap.put("closeScanner", new closeScanner()); - 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.get); - 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.get); - } 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.gets); - } 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.put); - } 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.put); - 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.puts); - } 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.deleteSingle); - } 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.deletes); - } 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.deleteSingle); - 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.increment); - } 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.scan); - 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 exists_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - 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 GET_FIELD_DESC = new org.apache.thrift.protocol.TField("get", 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 get; // 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 - */ - GET((short)2, "get"); - - 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: // GET - return GET; - 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.GET, new org.apache.thrift.meta_data.FieldMetaData("get", 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 get) - { - this(); - this.table = table; - this.get = get; - } - - /** - * 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.isSetGet()) { - this.get = new TGet(other.get); - } - } - - public exists_args deepCopy() { - return new exists_args(this); - } - - @Override - public void clear() { - this.table = null; - this.get = 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 table; - } - - /** - * the table to check on - */ - public exists_args setTable(byte[] table) { - setTable(table == null ? (ByteBuffer)null : ByteBuffer.wrap(table)); - return this; - } - - public exists_args setTable(ByteBuffer table) { - this.table = 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 getGet() { - return this.get; - } - - /** - * the TGet to check for - */ - public exists_args setGet(TGet get) { - this.get = get; - return this; - } - - public void unsetGet() { - this.get = null; - } - - /** Returns true if field get is set (has been assigned a value) and false otherwise */ - public boolean isSetGet() { - return this.get != null; - } - - public void setGetIsSet(boolean value) { - if (!value) { - this.get = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case TABLE: - if (value == null) { - unsetTable(); - } else { - setTable((ByteBuffer)value); - } - break; - - case GET: - if (value == null) { - unsetGet(); - } else { - setGet((TGet)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case TABLE: - return getTable(); - - case GET: - return getGet(); - - } - 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 GET: - return isSetGet(); - } - 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_get = true && this.isSetGet(); - boolean that_present_get = true && that.isSetGet(); - if (this_present_get || that_present_get) { - if (!(this_present_get && that_present_get)) - return false; - if (!this.get.equals(that.get)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - public int compareTo(exists_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - exists_args typedOther = (exists_args)other; - - lastComparison = Boolean.valueOf(isSetTable()).compareTo(typedOther.isSetTable()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetTable()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.table, typedOther.table); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetGet()).compareTo(typedOther.isSetGet()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetGet()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.get, typedOther.get); - 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("get:"); - if (this.get == null) { - sb.append("null"); - } else { - sb.append(this.get); - } - 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 (get == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'get' was not present! Struct: " + toString()); - } - // check for sub-struct validity - if (get != null) { - get.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: // GET - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.get = new TGet(); - struct.get.read(iprot); - struct.setGetIsSet(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.get != null) { - oprot.writeFieldBegin(GET_FIELD_DESC); - struct.get.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.get.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.get = new TGet(); - struct.get.read(iprot); - struct.setGetIsSet(true); - } - } - - } - - public static class exists_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - 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 Boolean.valueOf(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() { - return 0; - } - - public int compareTo(exists_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - exists_result typedOther = (exists_result)other; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetIo()).compareTo(typedOther.isSetIo()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetIo()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, typedOther.io); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(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 { - 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 GET_FIELD_DESC = new org.apache.thrift.protocol.TField("get", 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 get; // 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 - */ - GET((short)2, "get"); - - 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: // GET - return GET; - 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.GET, new org.apache.thrift.meta_data.FieldMetaData("get", 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 get) - { - this(); - this.table = table; - this.get = get; - } - - /** - * 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.isSetGet()) { - this.get = new TGet(other.get); - } - } - - public get_args deepCopy() { - return new get_args(this); - } - - @Override - public void clear() { - this.table = null; - this.get = 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 table; - } - - /** - * the table to get from - */ - public get_args setTable(byte[] table) { - setTable(table == null ? (ByteBuffer)null : ByteBuffer.wrap(table)); - return this; - } - - public get_args setTable(ByteBuffer table) { - this.table = 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 getGet() { - return this.get; - } - - /** - * the TGet to fetch - */ - public get_args setGet(TGet get) { - this.get = get; - return this; - } - - public void unsetGet() { - this.get = null; - } - - /** Returns true if field get is set (has been assigned a value) and false otherwise */ - public boolean isSetGet() { - return this.get != null; - } - - public void setGetIsSet(boolean value) { - if (!value) { - this.get = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case TABLE: - if (value == null) { - unsetTable(); - } else { - setTable((ByteBuffer)value); - } - break; - - case GET: - if (value == null) { - unsetGet(); - } else { - setGet((TGet)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case TABLE: - return getTable(); - - case GET: - return getGet(); - - } - 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 GET: - return isSetGet(); - } - 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_get = true && this.isSetGet(); - boolean that_present_get = true && that.isSetGet(); - if (this_present_get || that_present_get) { - if (!(this_present_get && that_present_get)) - return false; - if (!this.get.equals(that.get)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - public int compareTo(get_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - get_args typedOther = (get_args)other; - - lastComparison = Boolean.valueOf(isSetTable()).compareTo(typedOther.isSetTable()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetTable()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.table, typedOther.table); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetGet()).compareTo(typedOther.isSetGet()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetGet()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.get, typedOther.get); - 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("get:"); - if (this.get == null) { - sb.append("null"); - } else { - sb.append(this.get); - } - 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 (get == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'get' was not present! Struct: " + toString()); - } - // check for sub-struct validity - if (get != null) { - get.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: // GET - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.get = new TGet(); - struct.get.read(iprot); - struct.setGetIsSet(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.get != null) { - oprot.writeFieldBegin(GET_FIELD_DESC); - struct.get.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.get.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.get = new TGet(); - struct.get.read(iprot); - struct.setGetIsSet(true); - } - } - - } - - public static class get_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - 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() { - return 0; - } - - public int compareTo(get_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - get_result typedOther = (get_result)other; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetIo()).compareTo(typedOther.isSetIo()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetIo()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, typedOther.io); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(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 { - 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 GETS_FIELD_DESC = new org.apache.thrift.protocol.TField("gets", 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 gets; // 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 - */ - GETS((short)2, "gets"); - - 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: // GETS - return GETS; - 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.GETS, new org.apache.thrift.meta_data.FieldMetaData("gets", 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 gets) - { - this(); - this.table = table; - this.gets = gets; - } - - /** - * 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.isSetGets()) { - List __this__gets = new ArrayList(); - for (TGet other_element : other.gets) { - __this__gets.add(new TGet(other_element)); - } - this.gets = __this__gets; - } - } - - public getMultiple_args deepCopy() { - return new getMultiple_args(this); - } - - @Override - public void clear() { - this.table = null; - this.gets = 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 table; - } - - /** - * the table to get from - */ - public getMultiple_args setTable(byte[] table) { - setTable(table == null ? (ByteBuffer)null : ByteBuffer.wrap(table)); - return this; - } - - public getMultiple_args setTable(ByteBuffer table) { - this.table = 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 getGetsSize() { - return (this.gets == null) ? 0 : this.gets.size(); - } - - public java.util.Iterator getGetsIterator() { - return (this.gets == null) ? null : this.gets.iterator(); - } - - public void addToGets(TGet elem) { - if (this.gets == null) { - this.gets = new ArrayList(); - } - this.gets.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 getGets() { - return this.gets; - } - - /** - * 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 setGets(List gets) { - this.gets = gets; - return this; - } - - public void unsetGets() { - this.gets = null; - } - - /** Returns true if field gets is set (has been assigned a value) and false otherwise */ - public boolean isSetGets() { - return this.gets != null; - } - - public void setGetsIsSet(boolean value) { - if (!value) { - this.gets = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case TABLE: - if (value == null) { - unsetTable(); - } else { - setTable((ByteBuffer)value); - } - break; - - case GETS: - if (value == null) { - unsetGets(); - } else { - setGets((List)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case TABLE: - return getTable(); - - case GETS: - return getGets(); - - } - 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 GETS: - return isSetGets(); - } - 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_gets = true && this.isSetGets(); - boolean that_present_gets = true && that.isSetGets(); - if (this_present_gets || that_present_gets) { - if (!(this_present_gets && that_present_gets)) - return false; - if (!this.gets.equals(that.gets)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - public int compareTo(getMultiple_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - getMultiple_args typedOther = (getMultiple_args)other; - - lastComparison = Boolean.valueOf(isSetTable()).compareTo(typedOther.isSetTable()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetTable()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.table, typedOther.table); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetGets()).compareTo(typedOther.isSetGets()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetGets()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gets, typedOther.gets); - 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("gets:"); - if (this.gets == null) { - sb.append("null"); - } else { - sb.append(this.gets); - } - 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 (gets == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'gets' 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: // GETS - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list48 = iprot.readListBegin(); - struct.gets = new ArrayList(_list48.size); - for (int _i49 = 0; _i49 < _list48.size; ++_i49) - { - TGet _elem50; // required - _elem50 = new TGet(); - _elem50.read(iprot); - struct.gets.add(_elem50); - } - iprot.readListEnd(); - } - struct.setGetsIsSet(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.gets != null) { - oprot.writeFieldBegin(GETS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.gets.size())); - for (TGet _iter51 : struct.gets) - { - _iter51.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.gets.size()); - for (TGet _iter52 : struct.gets) - { - _iter52.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 _list53 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.gets = new ArrayList(_list53.size); - for (int _i54 = 0; _i54 < _list53.size; ++_i54) - { - TGet _elem55; // required - _elem55 = new TGet(); - _elem55.read(iprot); - struct.gets.add(_elem55); - } - } - struct.setGetsIsSet(true); - } - } - - } - - public static class getMultiple_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - 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(); - 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() { - return 0; - } - - public int compareTo(getMultiple_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - getMultiple_result typedOther = (getMultiple_result)other; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetIo()).compareTo(typedOther.isSetIo()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetIo()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, typedOther.io); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(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 _list56 = iprot.readListBegin(); - struct.success = new ArrayList(_list56.size); - for (int _i57 = 0; _i57 < _list56.size; ++_i57) - { - TResult _elem58; // required - _elem58 = new TResult(); - _elem58.read(iprot); - struct.success.add(_elem58); - } - 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 _iter59 : struct.success) - { - _iter59.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 _iter60 : struct.success) - { - _iter60.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 _list61 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.success = new ArrayList(_list61.size); - for (int _i62 = 0; _i62 < _list61.size; ++_i62) - { - TResult _elem63; // required - _elem63 = new TResult(); - _elem63.read(iprot); - struct.success.add(_elem63); - } - } - 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 { - 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 PUT_FIELD_DESC = new org.apache.thrift.protocol.TField("put", 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 put; // 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 - */ - PUT((short)2, "put"); - - 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: // PUT - return PUT; - 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.PUT, new org.apache.thrift.meta_data.FieldMetaData("put", 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 put) - { - this(); - this.table = table; - this.put = put; - } - - /** - * 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.isSetPut()) { - this.put = new TPut(other.put); - } - } - - public put_args deepCopy() { - return new put_args(this); - } - - @Override - public void clear() { - this.table = null; - this.put = 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 table; - } - - /** - * the table to put data in - */ - public put_args setTable(byte[] table) { - setTable(table == null ? (ByteBuffer)null : ByteBuffer.wrap(table)); - return this; - } - - public put_args setTable(ByteBuffer table) { - this.table = 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 getPut() { - return this.put; - } - - /** - * the TPut to put - */ - public put_args setPut(TPut put) { - this.put = put; - return this; - } - - public void unsetPut() { - this.put = null; - } - - /** Returns true if field put is set (has been assigned a value) and false otherwise */ - public boolean isSetPut() { - return this.put != null; - } - - public void setPutIsSet(boolean value) { - if (!value) { - this.put = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case TABLE: - if (value == null) { - unsetTable(); - } else { - setTable((ByteBuffer)value); - } - break; - - case PUT: - if (value == null) { - unsetPut(); - } else { - setPut((TPut)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case TABLE: - return getTable(); - - case PUT: - return getPut(); - - } - 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 PUT: - return isSetPut(); - } - 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_put = true && this.isSetPut(); - boolean that_present_put = true && that.isSetPut(); - if (this_present_put || that_present_put) { - if (!(this_present_put && that_present_put)) - return false; - if (!this.put.equals(that.put)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - public int compareTo(put_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - put_args typedOther = (put_args)other; - - lastComparison = Boolean.valueOf(isSetTable()).compareTo(typedOther.isSetTable()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetTable()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.table, typedOther.table); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetPut()).compareTo(typedOther.isSetPut()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetPut()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.put, typedOther.put); - 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("put:"); - if (this.put == null) { - sb.append("null"); - } else { - sb.append(this.put); - } - 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 (put == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'put' was not present! Struct: " + toString()); - } - // check for sub-struct validity - if (put != null) { - put.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: // PUT - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.put = new TPut(); - struct.put.read(iprot); - struct.setPutIsSet(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.put != null) { - oprot.writeFieldBegin(PUT_FIELD_DESC); - struct.put.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.put.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.put = new TPut(); - struct.put.read(iprot); - struct.setPutIsSet(true); - } - } - - } - - public static class put_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - 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() { - return 0; - } - - public int compareTo(put_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - put_result typedOther = (put_result)other; - - lastComparison = Boolean.valueOf(isSetIo()).compareTo(typedOther.isSetIo()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetIo()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, typedOther.io); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(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 { - 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 PUT_FIELD_DESC = new org.apache.thrift.protocol.TField("put", 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 put; // 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 - */ - PUT((short)6, "put"); - - 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: // PUT - return PUT; - 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.PUT, new org.apache.thrift.meta_data.FieldMetaData("put", 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 put) - { - this(); - this.table = table; - this.row = row; - this.family = family; - this.qualifier = qualifier; - this.value = value; - this.put = put; - } - - /** - * 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.isSetPut()) { - this.put = new TPut(other.put); - } - } - - 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.put = 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 table; - } - - /** - * to check in and put to - */ - public checkAndPut_args setTable(byte[] table) { - setTable(table == null ? (ByteBuffer)null : ByteBuffer.wrap(table)); - return this; - } - - public checkAndPut_args setTable(ByteBuffer table) { - this.table = 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 row; - } - - /** - * row to check - */ - public checkAndPut_args setRow(byte[] row) { - setRow(row == null ? (ByteBuffer)null : ByteBuffer.wrap(row)); - return this; - } - - public checkAndPut_args setRow(ByteBuffer row) { - this.row = 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 family; - } - - /** - * column family to check - */ - public checkAndPut_args setFamily(byte[] family) { - setFamily(family == null ? (ByteBuffer)null : ByteBuffer.wrap(family)); - return this; - } - - public checkAndPut_args setFamily(ByteBuffer family) { - this.family = 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 qualifier; - } - - /** - * column qualifier to check - */ - public checkAndPut_args setQualifier(byte[] qualifier) { - setQualifier(qualifier == null ? (ByteBuffer)null : ByteBuffer.wrap(qualifier)); - return this; - } - - public checkAndPut_args setQualifier(ByteBuffer qualifier) { - this.qualifier = 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 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) { - setValue(value == null ? (ByteBuffer)null : ByteBuffer.wrap(value)); - return this; - } - - public checkAndPut_args setValue(ByteBuffer value) { - this.value = 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 getPut() { - return this.put; - } - - /** - * the TPut to put if the check succeeds - */ - public checkAndPut_args setPut(TPut put) { - this.put = put; - return this; - } - - public void unsetPut() { - this.put = null; - } - - /** Returns true if field put is set (has been assigned a value) and false otherwise */ - public boolean isSetPut() { - return this.put != null; - } - - public void setPutIsSet(boolean value) { - if (!value) { - this.put = 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 PUT: - if (value == null) { - unsetPut(); - } else { - setPut((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 PUT: - return getPut(); - - } - 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 PUT: - return isSetPut(); - } - 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_put = true && this.isSetPut(); - boolean that_present_put = true && that.isSetPut(); - if (this_present_put || that_present_put) { - if (!(this_present_put && that_present_put)) - return false; - if (!this.put.equals(that.put)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - public int compareTo(checkAndPut_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - checkAndPut_args typedOther = (checkAndPut_args)other; - - lastComparison = Boolean.valueOf(isSetTable()).compareTo(typedOther.isSetTable()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetTable()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.table, typedOther.table); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetRow()).compareTo(typedOther.isSetRow()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetRow()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.row, typedOther.row); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetFamily()).compareTo(typedOther.isSetFamily()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetFamily()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.family, typedOther.family); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetQualifier()).compareTo(typedOther.isSetQualifier()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetQualifier()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.qualifier, typedOther.qualifier); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetValue()).compareTo(typedOther.isSetValue()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetValue()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, typedOther.value); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetPut()).compareTo(typedOther.isSetPut()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetPut()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.put, typedOther.put); - 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("put:"); - if (this.put == null) { - sb.append("null"); - } else { - sb.append(this.put); - } - 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 (put == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'put' was not present! Struct: " + toString()); - } - // check for sub-struct validity - if (put != null) { - put.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: // PUT - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.put = new TPut(); - struct.put.read(iprot); - struct.setPutIsSet(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.put != null) { - oprot.writeFieldBegin(PUT_FIELD_DESC); - struct.put.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.put.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.put = new TPut(); - struct.put.read(iprot); - struct.setPutIsSet(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 { - 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 Boolean.valueOf(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() { - return 0; - } - - public int compareTo(checkAndPut_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - checkAndPut_result typedOther = (checkAndPut_result)other; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetIo()).compareTo(typedOther.isSetIo()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetIo()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, typedOther.io); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(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 { - 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 PUTS_FIELD_DESC = new org.apache.thrift.protocol.TField("puts", 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 puts; // 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 - */ - PUTS((short)2, "puts"); - - 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: // PUTS - return PUTS; - 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.PUTS, new org.apache.thrift.meta_data.FieldMetaData("puts", 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 puts) - { - this(); - this.table = table; - this.puts = puts; - } - - /** - * 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.isSetPuts()) { - List __this__puts = new ArrayList(); - for (TPut other_element : other.puts) { - __this__puts.add(new TPut(other_element)); - } - this.puts = __this__puts; - } - } - - public putMultiple_args deepCopy() { - return new putMultiple_args(this); - } - - @Override - public void clear() { - this.table = null; - this.puts = 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 table; - } - - /** - * the table to put data in - */ - public putMultiple_args setTable(byte[] table) { - setTable(table == null ? (ByteBuffer)null : ByteBuffer.wrap(table)); - return this; - } - - public putMultiple_args setTable(ByteBuffer table) { - this.table = 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 getPutsSize() { - return (this.puts == null) ? 0 : this.puts.size(); - } - - public java.util.Iterator getPutsIterator() { - return (this.puts == null) ? null : this.puts.iterator(); - } - - public void addToPuts(TPut elem) { - if (this.puts == null) { - this.puts = new ArrayList(); - } - this.puts.add(elem); - } - - /** - * a list of TPuts to commit - */ - public List getPuts() { - return this.puts; - } - - /** - * a list of TPuts to commit - */ - public putMultiple_args setPuts(List puts) { - this.puts = puts; - return this; - } - - public void unsetPuts() { - this.puts = null; - } - - /** Returns true if field puts is set (has been assigned a value) and false otherwise */ - public boolean isSetPuts() { - return this.puts != null; - } - - public void setPutsIsSet(boolean value) { - if (!value) { - this.puts = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case TABLE: - if (value == null) { - unsetTable(); - } else { - setTable((ByteBuffer)value); - } - break; - - case PUTS: - if (value == null) { - unsetPuts(); - } else { - setPuts((List)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case TABLE: - return getTable(); - - case PUTS: - return getPuts(); - - } - 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 PUTS: - return isSetPuts(); - } - 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_puts = true && this.isSetPuts(); - boolean that_present_puts = true && that.isSetPuts(); - if (this_present_puts || that_present_puts) { - if (!(this_present_puts && that_present_puts)) - return false; - if (!this.puts.equals(that.puts)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - public int compareTo(putMultiple_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - putMultiple_args typedOther = (putMultiple_args)other; - - lastComparison = Boolean.valueOf(isSetTable()).compareTo(typedOther.isSetTable()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetTable()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.table, typedOther.table); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetPuts()).compareTo(typedOther.isSetPuts()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetPuts()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.puts, typedOther.puts); - 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("puts:"); - if (this.puts == null) { - sb.append("null"); - } else { - sb.append(this.puts); - } - 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 (puts == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'puts' 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: // PUTS - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list64 = iprot.readListBegin(); - struct.puts = new ArrayList(_list64.size); - for (int _i65 = 0; _i65 < _list64.size; ++_i65) - { - TPut _elem66; // required - _elem66 = new TPut(); - _elem66.read(iprot); - struct.puts.add(_elem66); - } - iprot.readListEnd(); - } - struct.setPutsIsSet(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.puts != null) { - oprot.writeFieldBegin(PUTS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.puts.size())); - for (TPut _iter67 : struct.puts) - { - _iter67.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.puts.size()); - for (TPut _iter68 : struct.puts) - { - _iter68.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 _list69 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.puts = new ArrayList(_list69.size); - for (int _i70 = 0; _i70 < _list69.size; ++_i70) - { - TPut _elem71; // required - _elem71 = new TPut(); - _elem71.read(iprot); - struct.puts.add(_elem71); - } - } - struct.setPutsIsSet(true); - } - } - - } - - public static class putMultiple_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - 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() { - return 0; - } - - public int compareTo(putMultiple_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - putMultiple_result typedOther = (putMultiple_result)other; - - lastComparison = Boolean.valueOf(isSetIo()).compareTo(typedOther.isSetIo()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetIo()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, typedOther.io); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(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 { - 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 DELETE_SINGLE_FIELD_DESC = new org.apache.thrift.protocol.TField("deleteSingle", 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 deleteSingle; // 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 - */ - 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: // TABLE - return TABLE; - 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; - } - } - - // 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.DELETE_SINGLE, new org.apache.thrift.meta_data.FieldMetaData("deleteSingle", 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 deleteSingle) - { - this(); - this.table = table; - this.deleteSingle = deleteSingle; - } - - /** - * 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.isSetDeleteSingle()) { - this.deleteSingle = new TDelete(other.deleteSingle); - } - } - - public deleteSingle_args deepCopy() { - return new deleteSingle_args(this); - } - - @Override - public void clear() { - this.table = null; - this.deleteSingle = 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 table; - } - - /** - * the table to delete from - */ - public deleteSingle_args setTable(byte[] table) { - setTable(table == null ? (ByteBuffer)null : ByteBuffer.wrap(table)); - return this; - } - - public deleteSingle_args setTable(ByteBuffer table) { - this.table = 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 getDeleteSingle() { - return this.deleteSingle; - } - - /** - * the TDelete to delete - */ - public deleteSingle_args setDeleteSingle(TDelete deleteSingle) { - this.deleteSingle = deleteSingle; - return this; - } - - public void unsetDeleteSingle() { - this.deleteSingle = null; - } - - /** Returns true if field deleteSingle is set (has been assigned a value) and false otherwise */ - public boolean isSetDeleteSingle() { - return this.deleteSingle != null; - } - - public void setDeleteSingleIsSet(boolean value) { - if (!value) { - this.deleteSingle = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case TABLE: - if (value == null) { - unsetTable(); - } else { - setTable((ByteBuffer)value); - } - break; - - case DELETE_SINGLE: - if (value == null) { - unsetDeleteSingle(); - } else { - setDeleteSingle((TDelete)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case TABLE: - return getTable(); - - case DELETE_SINGLE: - return getDeleteSingle(); - - } - 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 DELETE_SINGLE: - return isSetDeleteSingle(); - } - 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_deleteSingle = true && this.isSetDeleteSingle(); - boolean that_present_deleteSingle = true && that.isSetDeleteSingle(); - if (this_present_deleteSingle || that_present_deleteSingle) { - if (!(this_present_deleteSingle && that_present_deleteSingle)) - return false; - if (!this.deleteSingle.equals(that.deleteSingle)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - public int compareTo(deleteSingle_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - deleteSingle_args typedOther = (deleteSingle_args)other; - - lastComparison = Boolean.valueOf(isSetTable()).compareTo(typedOther.isSetTable()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetTable()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.table, typedOther.table); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetDeleteSingle()).compareTo(typedOther.isSetDeleteSingle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetDeleteSingle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.deleteSingle, typedOther.deleteSingle); - 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("deleteSingle:"); - if (this.deleteSingle == null) { - sb.append("null"); - } else { - sb.append(this.deleteSingle); - } - 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 (deleteSingle == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'deleteSingle' was not present! Struct: " + toString()); - } - // check for sub-struct validity - if (deleteSingle != null) { - deleteSingle.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: // DELETE_SINGLE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.deleteSingle = new TDelete(); - struct.deleteSingle.read(iprot); - struct.setDeleteSingleIsSet(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.deleteSingle != null) { - oprot.writeFieldBegin(DELETE_SINGLE_FIELD_DESC); - struct.deleteSingle.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.deleteSingle.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.deleteSingle = new TDelete(); - struct.deleteSingle.read(iprot); - struct.setDeleteSingleIsSet(true); - } - } - - } - - public static class deleteSingle_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - 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() { - return 0; - } - - public int compareTo(deleteSingle_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - deleteSingle_result typedOther = (deleteSingle_result)other; - - lastComparison = Boolean.valueOf(isSetIo()).compareTo(typedOther.isSetIo()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetIo()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, typedOther.io); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(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 { - 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 DELETES_FIELD_DESC = new org.apache.thrift.protocol.TField("deletes", 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 deletes; // 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 - */ - DELETES((short)2, "deletes"); - - 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: // DELETES - return DELETES; - 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.DELETES, new org.apache.thrift.meta_data.FieldMetaData("deletes", 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 deletes) - { - this(); - this.table = table; - this.deletes = deletes; - } - - /** - * 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.isSetDeletes()) { - List __this__deletes = new ArrayList(); - for (TDelete other_element : other.deletes) { - __this__deletes.add(new TDelete(other_element)); - } - this.deletes = __this__deletes; - } - } - - public deleteMultiple_args deepCopy() { - return new deleteMultiple_args(this); - } - - @Override - public void clear() { - this.table = null; - this.deletes = 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 table; - } - - /** - * the table to delete from - */ - public deleteMultiple_args setTable(byte[] table) { - setTable(table == null ? (ByteBuffer)null : ByteBuffer.wrap(table)); - return this; - } - - public deleteMultiple_args setTable(ByteBuffer table) { - this.table = 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 getDeletesSize() { - return (this.deletes == null) ? 0 : this.deletes.size(); - } - - public java.util.Iterator getDeletesIterator() { - return (this.deletes == null) ? null : this.deletes.iterator(); - } - - public void addToDeletes(TDelete elem) { - if (this.deletes == null) { - this.deletes = new ArrayList(); - } - this.deletes.add(elem); - } - - /** - * list of TDeletes to delete - */ - public List getDeletes() { - return this.deletes; - } - - /** - * list of TDeletes to delete - */ - public deleteMultiple_args setDeletes(List deletes) { - this.deletes = deletes; - return this; - } - - public void unsetDeletes() { - this.deletes = null; - } - - /** Returns true if field deletes is set (has been assigned a value) and false otherwise */ - public boolean isSetDeletes() { - return this.deletes != null; - } - - public void setDeletesIsSet(boolean value) { - if (!value) { - this.deletes = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case TABLE: - if (value == null) { - unsetTable(); - } else { - setTable((ByteBuffer)value); - } - break; - - case DELETES: - if (value == null) { - unsetDeletes(); - } else { - setDeletes((List)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case TABLE: - return getTable(); - - case DELETES: - return getDeletes(); - - } - 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 DELETES: - return isSetDeletes(); - } - 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_deletes = true && this.isSetDeletes(); - boolean that_present_deletes = true && that.isSetDeletes(); - if (this_present_deletes || that_present_deletes) { - if (!(this_present_deletes && that_present_deletes)) - return false; - if (!this.deletes.equals(that.deletes)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - public int compareTo(deleteMultiple_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - deleteMultiple_args typedOther = (deleteMultiple_args)other; - - lastComparison = Boolean.valueOf(isSetTable()).compareTo(typedOther.isSetTable()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetTable()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.table, typedOther.table); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetDeletes()).compareTo(typedOther.isSetDeletes()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetDeletes()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.deletes, typedOther.deletes); - 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("deletes:"); - if (this.deletes == null) { - sb.append("null"); - } else { - sb.append(this.deletes); - } - 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 (deletes == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'deletes' 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: // DELETES - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list72 = iprot.readListBegin(); - struct.deletes = new ArrayList(_list72.size); - for (int _i73 = 0; _i73 < _list72.size; ++_i73) - { - TDelete _elem74; // required - _elem74 = new TDelete(); - _elem74.read(iprot); - struct.deletes.add(_elem74); - } - iprot.readListEnd(); - } - struct.setDeletesIsSet(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.deletes != null) { - oprot.writeFieldBegin(DELETES_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.deletes.size())); - for (TDelete _iter75 : struct.deletes) - { - _iter75.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.deletes.size()); - for (TDelete _iter76 : struct.deletes) - { - _iter76.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 _list77 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.deletes = new ArrayList(_list77.size); - for (int _i78 = 0; _i78 < _list77.size; ++_i78) - { - TDelete _elem79; // required - _elem79 = new TDelete(); - _elem79.read(iprot); - struct.deletes.add(_elem79); - } - } - struct.setDeletesIsSet(true); - } - } - - } - - public static class deleteMultiple_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - 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(); - 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() { - return 0; - } - - public int compareTo(deleteMultiple_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - deleteMultiple_result typedOther = (deleteMultiple_result)other; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetIo()).compareTo(typedOther.isSetIo()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetIo()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, typedOther.io); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(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 _list80 = iprot.readListBegin(); - struct.success = new ArrayList(_list80.size); - for (int _i81 = 0; _i81 < _list80.size; ++_i81) - { - TDelete _elem82; // required - _elem82 = new TDelete(); - _elem82.read(iprot); - struct.success.add(_elem82); - } - 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 _iter83 : struct.success) - { - _iter83.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 _iter84 : struct.success) - { - _iter84.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 _list85 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.success = new ArrayList(_list85.size); - for (int _i86 = 0; _i86 < _list85.size; ++_i86) - { - TDelete _elem87; // required - _elem87 = new TDelete(); - _elem87.read(iprot); - struct.success.add(_elem87); - } - } - 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 { - 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 DELETE_SINGLE_FIELD_DESC = new org.apache.thrift.protocol.TField("deleteSingle", 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 deleteSingle; // 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 - */ - DELETE_SINGLE((short)6, "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: // 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: // 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; - } - } - - // 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.DELETE_SINGLE, new org.apache.thrift.meta_data.FieldMetaData("deleteSingle", 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 deleteSingle) - { - this(); - this.table = table; - this.row = row; - this.family = family; - this.qualifier = qualifier; - this.value = value; - this.deleteSingle = deleteSingle; - } - - /** - * 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.isSetDeleteSingle()) { - this.deleteSingle = new TDelete(other.deleteSingle); - } - } - - 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.deleteSingle = 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 table; - } - - /** - * to check in and delete from - */ - public checkAndDelete_args setTable(byte[] table) { - setTable(table == null ? (ByteBuffer)null : ByteBuffer.wrap(table)); - return this; - } - - public checkAndDelete_args setTable(ByteBuffer table) { - this.table = 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 row; - } - - /** - * row to check - */ - public checkAndDelete_args setRow(byte[] row) { - setRow(row == null ? (ByteBuffer)null : ByteBuffer.wrap(row)); - return this; - } - - public checkAndDelete_args setRow(ByteBuffer row) { - this.row = 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 family; - } - - /** - * column family to check - */ - public checkAndDelete_args setFamily(byte[] family) { - setFamily(family == null ? (ByteBuffer)null : ByteBuffer.wrap(family)); - return this; - } - - public checkAndDelete_args setFamily(ByteBuffer family) { - this.family = 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 qualifier; - } - - /** - * column qualifier to check - */ - public checkAndDelete_args setQualifier(byte[] qualifier) { - setQualifier(qualifier == null ? (ByteBuffer)null : ByteBuffer.wrap(qualifier)); - return this; - } - - public checkAndDelete_args setQualifier(ByteBuffer qualifier) { - this.qualifier = 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 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) { - setValue(value == null ? (ByteBuffer)null : ByteBuffer.wrap(value)); - return this; - } - - public checkAndDelete_args setValue(ByteBuffer value) { - this.value = 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 getDeleteSingle() { - return this.deleteSingle; - } - - /** - * the TDelete to execute if the check succeeds - */ - public checkAndDelete_args setDeleteSingle(TDelete deleteSingle) { - this.deleteSingle = deleteSingle; - return this; - } - - public void unsetDeleteSingle() { - this.deleteSingle = null; - } - - /** Returns true if field deleteSingle is set (has been assigned a value) and false otherwise */ - public boolean isSetDeleteSingle() { - return this.deleteSingle != null; - } - - public void setDeleteSingleIsSet(boolean value) { - if (!value) { - this.deleteSingle = 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 DELETE_SINGLE: - if (value == null) { - unsetDeleteSingle(); - } else { - setDeleteSingle((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 DELETE_SINGLE: - return getDeleteSingle(); - - } - 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 DELETE_SINGLE: - return isSetDeleteSingle(); - } - 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_deleteSingle = true && this.isSetDeleteSingle(); - boolean that_present_deleteSingle = true && that.isSetDeleteSingle(); - if (this_present_deleteSingle || that_present_deleteSingle) { - if (!(this_present_deleteSingle && that_present_deleteSingle)) - return false; - if (!this.deleteSingle.equals(that.deleteSingle)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - public int compareTo(checkAndDelete_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - checkAndDelete_args typedOther = (checkAndDelete_args)other; - - lastComparison = Boolean.valueOf(isSetTable()).compareTo(typedOther.isSetTable()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetTable()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.table, typedOther.table); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetRow()).compareTo(typedOther.isSetRow()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetRow()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.row, typedOther.row); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetFamily()).compareTo(typedOther.isSetFamily()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetFamily()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.family, typedOther.family); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetQualifier()).compareTo(typedOther.isSetQualifier()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetQualifier()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.qualifier, typedOther.qualifier); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetValue()).compareTo(typedOther.isSetValue()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetValue()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, typedOther.value); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetDeleteSingle()).compareTo(typedOther.isSetDeleteSingle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetDeleteSingle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.deleteSingle, typedOther.deleteSingle); - 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("deleteSingle:"); - if (this.deleteSingle == null) { - sb.append("null"); - } else { - sb.append(this.deleteSingle); - } - 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 (deleteSingle == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'deleteSingle' was not present! Struct: " + toString()); - } - // check for sub-struct validity - if (deleteSingle != null) { - deleteSingle.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: // DELETE_SINGLE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.deleteSingle = new TDelete(); - struct.deleteSingle.read(iprot); - struct.setDeleteSingleIsSet(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.deleteSingle != null) { - oprot.writeFieldBegin(DELETE_SINGLE_FIELD_DESC); - struct.deleteSingle.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.deleteSingle.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.deleteSingle = new TDelete(); - struct.deleteSingle.read(iprot); - struct.setDeleteSingleIsSet(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 { - 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 Boolean.valueOf(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() { - return 0; - } - - public int compareTo(checkAndDelete_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - checkAndDelete_result typedOther = (checkAndDelete_result)other; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetIo()).compareTo(typedOther.isSetIo()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetIo()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, typedOther.io); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(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 { - 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 INCREMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("increment", 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 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 table to increment the value on - */ - TABLE((short)1, "table"), - /** - * the TIncrement to increment - */ - INCREMENT((short)2, "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: // TABLE - return TABLE; - case 2: // 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.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.INCREMENT, new org.apache.thrift.meta_data.FieldMetaData("increment", 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 increment) - { - this(); - this.table = table; - this.increment = increment; - } - - /** - * 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.isSetIncrement()) { - this.increment = new TIncrement(other.increment); - } - } - - public increment_args deepCopy() { - return new increment_args(this); - } - - @Override - public void clear() { - this.table = null; - this.increment = 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 table; - } - - /** - * the table to increment the value on - */ - public increment_args setTable(byte[] table) { - setTable(table == null ? (ByteBuffer)null : ByteBuffer.wrap(table)); - return this; - } - - public increment_args setTable(ByteBuffer table) { - this.table = 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 getIncrement() { - return this.increment; - } - - /** - * the TIncrement to increment - */ - 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 TABLE: - if (value == null) { - unsetTable(); - } else { - setTable((ByteBuffer)value); - } - break; - - case INCREMENT: - if (value == null) { - unsetIncrement(); - } else { - setIncrement((TIncrement)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case TABLE: - return getTable(); - - 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 TABLE: - return isSetTable(); - 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_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_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() { - return 0; - } - - public int compareTo(increment_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - increment_args typedOther = (increment_args)other; - - lastComparison = Boolean.valueOf(isSetTable()).compareTo(typedOther.isSetTable()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetTable()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.table, typedOther.table); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetIncrement()).compareTo(typedOther.isSetIncrement()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetIncrement()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.increment, typedOther.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("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("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 - if (table == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'table' was not present! Struct: " + toString()); - } - if (increment == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'increment' was not present! Struct: " + toString()); - } - // 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: // 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: // 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.table != null) { - oprot.writeFieldBegin(TABLE_FIELD_DESC); - oprot.writeBinary(struct.table); - oprot.writeFieldEnd(); - } - 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; - oprot.writeBinary(struct.table); - 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; - struct.table = iprot.readBinary(); - struct.setTableIsSet(true); - 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 { - 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() { - return 0; - } - - public int compareTo(increment_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - increment_result typedOther = (increment_result)other; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetIo()).compareTo(typedOther.isSetIo()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetIo()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, typedOther.io); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(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 openScanner_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - 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 SCAN_FIELD_DESC = new org.apache.thrift.protocol.TField("scan", 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 scan; // 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 - */ - SCAN((short)2, "scan"); - - 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: // SCAN - return SCAN; - 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.SCAN, new org.apache.thrift.meta_data.FieldMetaData("scan", 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 scan) - { - this(); - this.table = table; - this.scan = scan; - } - - /** - * 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.isSetScan()) { - this.scan = new TScan(other.scan); - } - } - - public openScanner_args deepCopy() { - return new openScanner_args(this); - } - - @Override - public void clear() { - this.table = null; - this.scan = 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 table; - } - - /** - * the table to get the Scanner for - */ - public openScanner_args setTable(byte[] table) { - setTable(table == null ? (ByteBuffer)null : ByteBuffer.wrap(table)); - return this; - } - - public openScanner_args setTable(ByteBuffer table) { - this.table = 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 getScan() { - return this.scan; - } - - /** - * the scan object to get a Scanner for - */ - public openScanner_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 void setFieldValue(_Fields field, Object value) { - switch (field) { - case TABLE: - if (value == null) { - unsetTable(); - } else { - setTable((ByteBuffer)value); - } - break; - - case SCAN: - if (value == null) { - unsetScan(); - } else { - setScan((TScan)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case TABLE: - return getTable(); - - case SCAN: - return getScan(); - - } - 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 SCAN: - return isSetScan(); - } - 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_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; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - public int compareTo(openScanner_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - openScanner_args typedOther = (openScanner_args)other; - - lastComparison = Boolean.valueOf(isSetTable()).compareTo(typedOther.isSetTable()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetTable()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.table, typedOther.table); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetScan()).compareTo(typedOther.isSetScan()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetScan()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.scan, typedOther.scan); - 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("scan:"); - if (this.scan == null) { - sb.append("null"); - } else { - sb.append(this.scan); - } - 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 (scan == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'scan' was not present! Struct: " + toString()); - } - // 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 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: // 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; - 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.scan != null) { - oprot.writeFieldBegin(SCAN_FIELD_DESC); - struct.scan.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.scan.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.scan = new TScan(); - struct.scan.read(iprot); - struct.setScanIsSet(true); - } - } - - } - - public static class openScanner_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - 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 Integer.valueOf(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() { - return 0; - } - - public int compareTo(openScanner_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - openScanner_result typedOther = (openScanner_result)other; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetIo()).compareTo(typedOther.isSetIo()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetIo()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, typedOther.io); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(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 { - 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 Integer.valueOf(getScannerId()); - - case NUM_ROWS: - return Integer.valueOf(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() { - return 0; - } - - public int compareTo(getScannerRows_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - getScannerRows_args typedOther = (getScannerRows_args)other; - - lastComparison = Boolean.valueOf(isSetScannerId()).compareTo(typedOther.isSetScannerId()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetScannerId()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.scannerId, typedOther.scannerId); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetNumRows()).compareTo(typedOther.isSetNumRows()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetNumRows()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.numRows, typedOther.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 { - 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(); - 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() { - return 0; - } - - public int compareTo(getScannerRows_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - getScannerRows_result typedOther = (getScannerRows_result)other; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetIo()).compareTo(typedOther.isSetIo()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetIo()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, typedOther.io); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetIa()).compareTo(typedOther.isSetIa()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetIa()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ia, typedOther.ia); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(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 _list88 = iprot.readListBegin(); - struct.success = new ArrayList(_list88.size); - for (int _i89 = 0; _i89 < _list88.size; ++_i89) - { - TResult _elem90; // required - _elem90 = new TResult(); - _elem90.read(iprot); - struct.success.add(_elem90); - } - 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 _iter91 : struct.success) - { - _iter91.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 _iter92 : struct.success) - { - _iter92.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 _list93 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.success = new ArrayList(_list93.size); - for (int _i94 = 0; _i94 < _list93.size; ++_i94) - { - TResult _elem95; // required - _elem95 = new TResult(); - _elem95.read(iprot); - struct.success.add(_elem95); - } - } - 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 { - 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 Integer.valueOf(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() { - return 0; - } - - public int compareTo(closeScanner_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - closeScanner_args typedOther = (closeScanner_args)other; - - lastComparison = Boolean.valueOf(isSetScannerId()).compareTo(typedOther.isSetScannerId()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetScannerId()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.scannerId, typedOther.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 { - 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() { - return 0; - } - - public int compareTo(closeScanner_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - closeScanner_result typedOther = (closeScanner_result)other; - - lastComparison = Boolean.valueOf(isSetIo()).compareTo(typedOther.isSetIo()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetIo()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, typedOther.io); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetIa()).compareTo(typedOther.isSetIa()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetIa()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ia, typedOther.ia); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(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); - } - } - } - - } - -} Index: hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TIOError.java =================================================================== --- hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TIOError.java (revision 1471070) +++ hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TIOError.java (working copy) @@ -1,389 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * 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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * 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. - */ -public class TIOError extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - 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 _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() { - return 0; - } - - public int compareTo(TIOError other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TIOError typedOther = (TIOError)other; - - lastComparison = Boolean.valueOf(isSetMessage()).compareTo(typedOther.isSetMessage()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetMessage()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.message, typedOther.message); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(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); - } - } - } - -} - Index: hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TIllegalArgument.java =================================================================== --- hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TIllegalArgument.java (revision 1471070) +++ hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TIllegalArgument.java (working copy) @@ -1,388 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * 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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * A TIllegalArgument exception indicates an illegal or invalid - * argument was passed into a procedure. - */ -public class TIllegalArgument extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - 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 _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() { - return 0; - } - - public int compareTo(TIllegalArgument other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TIllegalArgument typedOther = (TIllegalArgument)other; - - lastComparison = Boolean.valueOf(isSetMessage()).compareTo(typedOther.isSetMessage()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetMessage()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.message, typedOther.message); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(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); - } - } - } - -} - Index: hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TIncrement.java =================================================================== --- hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TIncrement.java (revision 1471070) +++ hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TIncrement.java (working copy) @@ -1,651 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * 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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Used to perform Increment operations for a single row. - * - * You can specify if this Increment should be written - * to the write-ahead Log (WAL) or not. It defaults to true. - */ -public class TIncrement implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - 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 WRITE_TO_WAL_FIELD_DESC = new org.apache.thrift.protocol.TField("writeToWal", org.apache.thrift.protocol.TType.BOOL, (short)3); - - 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 boolean writeToWal; // 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"), - WRITE_TO_WAL((short)3, "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: // ROW - return ROW; - case 2: // COLUMNS - return COLUMNS; - case 3: // 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 __WRITETOWAL_ISSET_ID = 0; - private byte __isset_bitfield = 0; - private _Fields optionals[] = {_Fields.WRITE_TO_WAL}; - 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.WRITE_TO_WAL, new org.apache.thrift.meta_data.FieldMetaData("writeToWal", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TIncrement.class, metaDataMap); - } - - public TIncrement() { - this.writeToWal = true; - - } - - public TIncrement( - ByteBuffer row, - List columns) - { - this(); - this.row = row; - this.columns = columns; - } - - /** - * Performs a deep copy on other. - */ - public TIncrement(TIncrement 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(); - for (TColumnIncrement other_element : other.columns) { - __this__columns.add(new TColumnIncrement(other_element)); - } - this.columns = __this__columns; - } - this.writeToWal = other.writeToWal; - } - - public TIncrement deepCopy() { - return new TIncrement(this); - } - - @Override - public void clear() { - this.row = null; - this.columns = null; - this.writeToWal = true; - - } - - public byte[] getRow() { - setRow(org.apache.thrift.TBaseHelper.rightSize(row)); - return row == null ? null : row.array(); - } - - public ByteBuffer bufferForRow() { - return row; - } - - public TIncrement setRow(byte[] row) { - setRow(row == null ? (ByteBuffer)null : ByteBuffer.wrap(row)); - return this; - } - - public TIncrement setRow(ByteBuffer row) { - this.row = 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 boolean isWriteToWal() { - return this.writeToWal; - } - - public TIncrement 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 ROW: - if (value == null) { - unsetRow(); - } else { - setRow((ByteBuffer)value); - } - break; - - case COLUMNS: - if (value == null) { - unsetColumns(); - } else { - setColumns((List)value); - } - break; - - case WRITE_TO_WAL: - if (value == null) { - unsetWriteToWal(); - } else { - setWriteToWal((Boolean)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case ROW: - return getRow(); - - case COLUMNS: - return getColumns(); - - case WRITE_TO_WAL: - return Boolean.valueOf(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 ROW: - return isSetRow(); - case COLUMNS: - return isSetColumns(); - case WRITE_TO_WAL: - return isSetWriteToWal(); - } - 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_writeToWal = true && this.isSetWriteToWal(); - boolean that_present_writeToWal = true && that.isSetWriteToWal(); - 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() { - return 0; - } - - public int compareTo(TIncrement other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TIncrement typedOther = (TIncrement)other; - - lastComparison = Boolean.valueOf(isSetRow()).compareTo(typedOther.isSetRow()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetRow()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.row, typedOther.row); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetColumns()).compareTo(typedOther.isSetColumns()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetColumns()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columns, typedOther.columns); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetWriteToWal()).compareTo(typedOther.isSetWriteToWal()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetWriteToWal()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.writeToWal, typedOther.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("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 (isSetWriteToWal()) { - 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 - 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 - } - - 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: // 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 _list32 = iprot.readListBegin(); - struct.columns = new ArrayList(_list32.size); - for (int _i33 = 0; _i33 < _list32.size; ++_i33) - { - TColumnIncrement _elem34; // required - _elem34 = new TColumnIncrement(); - _elem34.read(iprot); - struct.columns.add(_elem34); - } - iprot.readListEnd(); - } - struct.setColumnsIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // 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, 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 _iter35 : struct.columns) - { - _iter35.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - if (struct.isSetWriteToWal()) { - oprot.writeFieldBegin(WRITE_TO_WAL_FIELD_DESC); - oprot.writeBool(struct.writeToWal); - 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 _iter36 : struct.columns) - { - _iter36.write(oprot); - } - } - BitSet optionals = new BitSet(); - if (struct.isSetWriteToWal()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetWriteToWal()) { - oprot.writeBool(struct.writeToWal); - } - } - - @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 _list37 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.columns = new ArrayList(_list37.size); - for (int _i38 = 0; _i38 < _list37.size; ++_i38) - { - TColumnIncrement _elem39; // required - _elem39 = new TColumnIncrement(); - _elem39.read(iprot); - struct.columns.add(_elem39); - } - } - struct.setColumnsIsSet(true); - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.writeToWal = iprot.readBool(); - struct.setWriteToWalIsSet(true); - } - } - } - -} - Index: hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TPut.java =================================================================== --- hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TPut.java (revision 1471070) +++ hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TPut.java (working copy) @@ -1,751 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * 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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * 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 also specify if this Put should be written - * to the write-ahead Log (WAL) or not. It defaults to true. - */ -public class TPut implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - 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 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 TPutStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TPutTupleSchemeFactory()); - } - - public ByteBuffer row; // required - public List columnValues; // required - public long timestamp; // optional - public boolean writeToWal; // 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"), - 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: // ROW - return ROW; - case 2: // COLUMN_VALUES - return COLUMN_VALUES; - case 3: // TIMESTAMP - return TIMESTAMP; - 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 __TIMESTAMP_ISSET_ID = 0; - private static final int __WRITETOWAL_ISSET_ID = 1; - private byte __isset_bitfield = 0; - private _Fields optionals[] = {_Fields.TIMESTAMP,_Fields.WRITE_TO_WAL}; - 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.WRITE_TO_WAL, new org.apache.thrift.meta_data.FieldMetaData("writeToWal", 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(TPut.class, metaDataMap); - } - - public TPut() { - this.writeToWal = true; - - } - - public TPut( - ByteBuffer row, - List columnValues) - { - this(); - this.row = 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(); - for (TColumnValue other_element : other.columnValues) { - __this__columnValues.add(new TColumnValue(other_element)); - } - this.columnValues = __this__columnValues; - } - this.timestamp = other.timestamp; - this.writeToWal = other.writeToWal; - } - - public TPut deepCopy() { - return new TPut(this); - } - - @Override - public void clear() { - this.row = null; - this.columnValues = null; - setTimestampIsSet(false); - this.timestamp = 0; - this.writeToWal = true; - - } - - public byte[] getRow() { - setRow(org.apache.thrift.TBaseHelper.rightSize(row)); - return row == null ? null : row.array(); - } - - public ByteBuffer bufferForRow() { - return row; - } - - public TPut setRow(byte[] row) { - setRow(row == null ? (ByteBuffer)null : ByteBuffer.wrap(row)); - return this; - } - - public TPut setRow(ByteBuffer row) { - this.row = 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 boolean isWriteToWal() { - return this.writeToWal; - } - - public TPut 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 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 WRITE_TO_WAL: - if (value == null) { - unsetWriteToWal(); - } else { - setWriteToWal((Boolean)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case ROW: - return getRow(); - - case COLUMN_VALUES: - return getColumnValues(); - - case TIMESTAMP: - return Long.valueOf(getTimestamp()); - - case WRITE_TO_WAL: - return Boolean.valueOf(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 ROW: - return isSetRow(); - case COLUMN_VALUES: - return isSetColumnValues(); - case TIMESTAMP: - return isSetTimestamp(); - case WRITE_TO_WAL: - return isSetWriteToWal(); - } - 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_writeToWal = true && this.isSetWriteToWal(); - boolean that_present_writeToWal = true && that.isSetWriteToWal(); - 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() { - return 0; - } - - public int compareTo(TPut other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TPut typedOther = (TPut)other; - - lastComparison = Boolean.valueOf(isSetRow()).compareTo(typedOther.isSetRow()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetRow()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.row, typedOther.row); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetColumnValues()).compareTo(typedOther.isSetColumnValues()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetColumnValues()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columnValues, typedOther.columnValues); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(typedOther.isSetTimestamp()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetTimestamp()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timestamp, typedOther.timestamp); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetWriteToWal()).compareTo(typedOther.isSetWriteToWal()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetWriteToWal()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.writeToWal, typedOther.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("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 (isSetWriteToWal()) { - 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 - 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 - } - - 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 _list16 = iprot.readListBegin(); - struct.columnValues = new ArrayList(_list16.size); - for (int _i17 = 0; _i17 < _list16.size; ++_i17) - { - TColumnValue _elem18; // required - _elem18 = new TColumnValue(); - _elem18.read(iprot); - struct.columnValues.add(_elem18); - } - 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 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, 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 _iter19 : struct.columnValues) - { - _iter19.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - if (struct.isSetTimestamp()) { - oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC); - oprot.writeI64(struct.timestamp); - oprot.writeFieldEnd(); - } - if (struct.isSetWriteToWal()) { - oprot.writeFieldBegin(WRITE_TO_WAL_FIELD_DESC); - oprot.writeBool(struct.writeToWal); - 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 _iter20 : struct.columnValues) - { - _iter20.write(oprot); - } - } - BitSet optionals = new BitSet(); - if (struct.isSetTimestamp()) { - optionals.set(0); - } - if (struct.isSetWriteToWal()) { - optionals.set(1); - } - oprot.writeBitSet(optionals, 2); - if (struct.isSetTimestamp()) { - oprot.writeI64(struct.timestamp); - } - if (struct.isSetWriteToWal()) { - oprot.writeBool(struct.writeToWal); - } - } - - @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 _list21 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.columnValues = new ArrayList(_list21.size); - for (int _i22 = 0; _i22 < _list21.size; ++_i22) - { - TColumnValue _elem23; // required - _elem23 = new TColumnValue(); - _elem23.read(iprot); - struct.columnValues.add(_elem23); - } - } - struct.setColumnValuesIsSet(true); - BitSet incoming = iprot.readBitSet(2); - if (incoming.get(0)) { - struct.timestamp = iprot.readI64(); - struct.setTimestampIsSet(true); - } - if (incoming.get(1)) { - struct.writeToWal = iprot.readBool(); - struct.setWriteToWalIsSet(true); - } - } - } - -} - Index: hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TResult.java =================================================================== --- hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TResult.java (revision 1471070) +++ hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TResult.java (working copy) @@ -1,553 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * 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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * if no Result is found, row and columnValues will not be set. - */ -public class TResult implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - 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 _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(); - 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 row; - } - - public TResult setRow(byte[] row) { - setRow(row == null ? (ByteBuffer)null : ByteBuffer.wrap(row)); - return this; - } - - public TResult setRow(ByteBuffer row) { - this.row = 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() { - return 0; - } - - public int compareTo(TResult other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TResult typedOther = (TResult)other; - - lastComparison = Boolean.valueOf(isSetRow()).compareTo(typedOther.isSetRow()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetRow()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.row, typedOther.row); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetColumnValues()).compareTo(typedOther.isSetColumnValues()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetColumnValues()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columnValues, typedOther.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); - for (int _i1 = 0; _i1 < _list0.size; ++_i1) - { - TColumnValue _elem2; // required - _elem2 = new TColumnValue(); - _elem2.read(iprot); - struct.columnValues.add(_elem2); - } - 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); - for (int _i6 = 0; _i6 < _list5.size; ++_i6) - { - TColumnValue _elem7; // required - _elem7 = new TColumnValue(); - _elem7.read(iprot); - struct.columnValues.add(_elem7); - } - } - struct.setColumnValuesIsSet(true); - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.row = iprot.readBinary(); - struct.setRowIsSet(true); - } - } - } - -} - Index: hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TScan.java =================================================================== --- hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TScan.java (revision 1471070) +++ hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TScan.java (working copy) @@ -1,971 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * 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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Any timestamps in the columns are ignored, use timeRange to select by timestamp. - * Max versions defaults to 1. - */ -public class TScan implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - 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 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 - - /** 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"); - - 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; - 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 byte __isset_bitfield = 0; - private _Fields optionals[] = {_Fields.START_ROW,_Fields.STOP_ROW,_Fields.COLUMNS,_Fields.CACHING,_Fields.MAX_VERSIONS,_Fields.TIME_RANGE}; - 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))); - 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(); - 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); - } - } - - 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; - } - - public byte[] getStartRow() { - setStartRow(org.apache.thrift.TBaseHelper.rightSize(startRow)); - return startRow == null ? null : startRow.array(); - } - - public ByteBuffer bufferForStartRow() { - return startRow; - } - - public TScan setStartRow(byte[] startRow) { - setStartRow(startRow == null ? (ByteBuffer)null : ByteBuffer.wrap(startRow)); - return this; - } - - public TScan setStartRow(ByteBuffer startRow) { - this.startRow = 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 stopRow; - } - - public TScan setStopRow(byte[] stopRow) { - setStopRow(stopRow == null ? (ByteBuffer)null : ByteBuffer.wrap(stopRow)); - return this; - } - - public TScan setStopRow(ByteBuffer stopRow) { - this.stopRow = 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 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; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case START_ROW: - return getStartRow(); - - case STOP_ROW: - return getStopRow(); - - case COLUMNS: - return getColumns(); - - case CACHING: - return Integer.valueOf(getCaching()); - - case MAX_VERSIONS: - return Integer.valueOf(getMaxVersions()); - - case TIME_RANGE: - return getTimeRange(); - - } - 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(); - } - 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; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - public int compareTo(TScan other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TScan typedOther = (TScan)other; - - lastComparison = Boolean.valueOf(isSetStartRow()).compareTo(typedOther.isSetStartRow()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStartRow()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startRow, typedOther.startRow); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetStopRow()).compareTo(typedOther.isSetStopRow()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStopRow()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stopRow, typedOther.stopRow); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetColumns()).compareTo(typedOther.isSetColumns()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetColumns()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columns, typedOther.columns); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetCaching()).compareTo(typedOther.isSetCaching()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetCaching()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.caching, typedOther.caching); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetMaxVersions()).compareTo(typedOther.isSetMaxVersions()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetMaxVersions()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.maxVersions, typedOther.maxVersions); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetTimeRange()).compareTo(typedOther.isSetTimeRange()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetTimeRange()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timeRange, typedOther.timeRange); - 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; - } - 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(); - } - } - - 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 _list40 = iprot.readListBegin(); - struct.columns = new ArrayList(_list40.size); - for (int _i41 = 0; _i41 < _list40.size; ++_i41) - { - TColumn _elem42; // required - _elem42 = new TColumn(); - _elem42.read(iprot); - struct.columns.add(_elem42); - } - 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; - 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 _iter43 : struct.columns) - { - _iter43.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(); - } - } - 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); - } - oprot.writeBitSet(optionals, 6); - if (struct.isSetStartRow()) { - oprot.writeBinary(struct.startRow); - } - if (struct.isSetStopRow()) { - oprot.writeBinary(struct.stopRow); - } - if (struct.isSetColumns()) { - { - oprot.writeI32(struct.columns.size()); - for (TColumn _iter44 : struct.columns) - { - _iter44.write(oprot); - } - } - } - if (struct.isSetCaching()) { - oprot.writeI32(struct.caching); - } - if (struct.isSetMaxVersions()) { - oprot.writeI32(struct.maxVersions); - } - if (struct.isSetTimeRange()) { - struct.timeRange.write(oprot); - } - } - - @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(6); - 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 _list45 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.columns = new ArrayList(_list45.size); - for (int _i46 = 0; _i46 < _list45.size; ++_i46) - { - TColumn _elem47; // required - _elem47 = new TColumn(); - _elem47.read(iprot); - struct.columns.add(_elem47); - } - } - 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); - } - } - } - -} - Index: hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TTimeRange.java =================================================================== --- hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TTimeRange.java (revision 1471070) +++ hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TTimeRange.java (working copy) @@ -1,469 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * 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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TTimeRange implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - 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 Long.valueOf(getMinStamp()); - - case MAX_STAMP: - return Long.valueOf(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() { - return 0; - } - - public int compareTo(TTimeRange other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TTimeRange typedOther = (TTimeRange)other; - - lastComparison = Boolean.valueOf(isSetMinStamp()).compareTo(typedOther.isSetMinStamp()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetMinStamp()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.minStamp, typedOther.minStamp); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetMaxStamp()).compareTo(typedOther.isSetMaxStamp()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetMaxStamp()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.maxStamp, typedOther.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); - } - } - -} - Index: hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/package.html =================================================================== --- hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/package.html (revision 1471070) +++ hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/package.html (working copy) @@ -1,107 +0,0 @@ - - - - - - - -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 thrift
-
- -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: -

-  thrift -strict --gen java:hashcode ./hbase-server/src/main/resources/org/apache/hadoop/hbase/thrift2/hbase.thrift
-  # Move the generated files into place their expected location under hbase
-  mv gen-java/org/apache/hadoop/hbase/thrift2/generated/* hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/generated/
-  # Remove the gen-java file made by thrift
-  rm -rf gen-java
-
- -

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. -

- - - Index: hbase-server/src/main/javadoc/org/apache/hadoop/hbase/thrift/package.html =================================================================== --- hbase-server/src/main/javadoc/org/apache/hadoop/hbase/thrift/package.html (revision 1471070) +++ hbase-server/src/main/javadoc/org/apache/hadoop/hbase/thrift/package.html (working copy) @@ -35,13 +35,6 @@

Description

-

Important note: We tried to deprecate this Thrift interface and replace it -with the Interface defined over in the thrift2 package only this package will not die. -Folks keep adding to it and fixing it up so its around for another while until someone -takes command and drives this package out of existence replacing it w/ an Interface that -better matches the hbase API (this package was modelled on old HBase API long since dropped). -

-

The org.apache.hadoop.hbase.thrift.generated.Hbase.Iface HBase API is defined in the file Hbase.thrift (Click the former to see the thrift generated documentation of thrift interface). A server-side implementation of the API is in Index: hbase-server/src/main/resources/org/apache/hadoop/hbase/thrift2/hbase.thrift =================================================================== --- hbase-server/src/main/resources/org/apache/hadoop/hbase/thrift2/hbase.thrift (revision 1471070) +++ hbase-server/src/main/resources/org/apache/hadoop/hbase/thrift2/hbase.thrift (working copy) @@ -1,412 +0,0 @@ -/* - * 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. - */ - -// NOTE: The "required" and "optional" keywords for the service methods are purely for documentation - -namespace java org.apache.hadoop.hbase.thrift2.generated -namespace cpp apache.hadoop.hbase.thrift2 -namespace rb Apache.Hadoop.Hbase.Thrift2 -namespace py hbase -namespace perl Hbase - -struct TTimeRange { - 1: required i64 minStamp, - 2: required i64 maxStamp -} - -/** - * Addresses a single cell or multiple cells - * in a HBase table by column family and optionally - * a column qualifier and timestamp - */ -struct TColumn { - 1: required binary family, - 2: optional binary qualifier, - 3: optional i64 timestamp -} - -/** - * Represents a single cell and its value. - */ -struct TColumnValue { - 1: required binary family, - 2: required binary qualifier, - 3: required binary value, - 4: optional i64 timestamp -} - -/** - * Represents a single cell and the amount to increment it by - */ -struct TColumnIncrement { - 1: required binary family, - 2: required binary qualifier, - 3: optional i64 amount = 1 -} - -/** - * if no Result is found, row and columnValues will not be set. - */ -struct TResult { - 1: optional binary row, - 2: required list columnValues -} - -/** - * Specify type of delete: - * - DELETE_COLUMN means exactly one version will be removed, - * - DELETE_COLUMNS means previous versions will also be removed. - */ -enum TDeleteType { - DELETE_COLUMN = 0, - DELETE_COLUMNS = 1 -} - -/** - * 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. - * - * TODO: Filter, Locks - */ -struct TGet { - 1: required binary row, - 2: optional list columns, - - 3: optional i64 timestamp, - 4: optional TTimeRange timeRange, - - 5: optional i32 maxVersions, -} - -/** - * 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 also specify if this Put should be written - * to the write-ahead Log (WAL) or not. It defaults to true. - */ -struct TPut { - 1: required binary row, - 2: required list columnValues - 3: optional i64 timestamp, - 4: optional bool writeToWal = 1 -} - -/** - * 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) - * - */ -struct TDelete { - 1: required binary row, - 2: optional list columns, - 3: optional i64 timestamp, - 4: optional TDeleteType deleteType = 1, - 5: optional bool writeToWal = 1 -} - -/** - * Used to perform Increment operations for a single row. - * - * You can specify if this Increment should be written - * to the write-ahead Log (WAL) or not. It defaults to true. - */ -struct TIncrement { - 1: required binary row, - 2: required list columns, - 3: optional bool writeToWal = 1 -} - -/** - * Any timestamps in the columns are ignored, use timeRange to select by timestamp. - * Max versions defaults to 1. - */ -struct TScan { - 1: optional binary startRow, - 2: optional binary stopRow, - 3: optional list columns - 4: optional i32 caching, - 5: optional i32 maxVersions=1, - 6: optional TTimeRange timeRange, -} - -// -// Exceptions -// - -/** - * 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. - */ -exception TIOError { - 1: optional string message -} - -/** - * A TIllegalArgument exception indicates an illegal or invalid - * argument was passed into a procedure. - */ -exception TIllegalArgument { - 1: optional string message -} - -service THBaseService { - - /** - * 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 - */ - bool exists( - /** the table to check on */ - 1: required binary table, - - /** the TGet to check for */ - 2: required TGet get - ) throws (1:TIOError io) - - /** - * 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 - */ - TResult get( - /** the table to get from */ - 1: required binary table, - - /** the TGet to fetch */ - 2: required TGet get - ) throws (1: TIOError io) - - /** - * 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. - */ - list getMultiple( - /** the table to get from */ - 1: required binary table, - - /** a list of TGets to fetch, the Result list - will have the Results at corresponding positions - or null if there was an error */ - 2: required list gets - ) throws (1: TIOError io) - - /** - * Commit a TPut to a table. - */ - void put( - /** the table to put data in */ - 1: required binary table, - - /** the TPut to put */ - 2: required TPut put - ) throws (1: TIOError io) - - /** - * 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 - */ - bool checkAndPut( - /** to check in and put to */ - 1: required binary table, - - /** row to check */ - 2: required binary row, - - /** column family to check */ - 3: required binary family, - - /** column qualifier to check */ - 4: required binary qualifier, - - /** the expected value, if not provided the - check is for the non-existence of the - column in question */ - 5: binary value, - - /** the TPut to put if the check succeeds */ - 6: required TPut put - ) throws (1: TIOError io) - - /** - * Commit a List of Puts to the table. - */ - void putMultiple( - /** the table to put data in */ - 1: required binary table, - - /** a list of TPuts to commit */ - 2: required list puts - ) throws (1: TIOError io) - - /** - * 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. - */ - void deleteSingle( - /** the table to delete from */ - 1: required binary table, - - /** the TDelete to delete */ - 2: required TDelete deleteSingle - ) throws (1: TIOError io) - - /** - * 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. - */ - list deleteMultiple( - /** the table to delete from */ - 1: required binary table, - - /** list of TDeletes to delete */ - 2: required list deletes - ) throws (1: TIOError io) - - /** - * 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 - */ - bool checkAndDelete( - /** to check in and delete from */ - 1: required binary table, - - /** row to check */ - 2: required binary row, - - /** column family to check */ - 3: required binary family, - - /** column qualifier to check */ - 4: required binary qualifier, - - /** the expected value, if not provided the - check is for the non-existence of the - column in question */ - 5: binary value, - - /** the TDelete to execute if the check succeeds */ - 6: required TDelete deleteSingle - ) throws (1: TIOError io) - - TResult increment( - /** the table to increment the value on */ - 1: required binary table, - - /** the TIncrement to increment */ - 2: required TIncrement increment - ) throws (1: TIOError io) - - /** - * Get a Scanner for the provided TScan object. - * - * @return Scanner Id to be used with other scanner procedures - */ - i32 openScanner( - /** the table to get the Scanner for */ - 1: required binary table, - - /** the scan object to get a Scanner for */ - 2: required TScan scan, - ) throws (1: TIOError io) - - /** - * Grabs multiple rows from a Scanner. - * - * @return Between zero and numRows TResults - */ - list getScannerRows( - /** the Id of the Scanner to return rows from. This is an Id returned from the openScanner function. */ - 1: required i32 scannerId, - - /** number of rows to return */ - 2: i32 numRows = 1 - ) throws ( - 1: TIOError io, - - /** if the scannerId is invalid */ - 2: TIllegalArgument ia - ) - - /** - * Closes the scanner. Should be called if you need to close - * the Scanner before all results are read. - * - * Exhausted scanners are closed automatically. - */ - void closeScanner( - /** the Id of the Scanner to close **/ - 1: required i32 scannerId - ) throws ( - 1: TIOError io, - - /** if the scannerId is invalid */ - 2: TIllegalArgument ia - ) - -} Index: hbase-server/src/test/java/org/apache/hadoop/hbase/thrift2/TestThriftHBaseServiceHandler.java =================================================================== --- hbase-server/src/test/java/org/apache/hadoop/hbase/thrift2/TestThriftHBaseServiceHandler.java (revision 1471070) +++ hbase-server/src/test/java/org/apache/hadoop/hbase/thrift2/TestThriftHBaseServiceHandler.java (working copy) @@ -1,567 +0,0 @@ -/* - * - * 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 org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.hbase.CompatibilityFactory; -import org.apache.hadoop.hbase.HBaseTestingUtility; -import org.apache.hadoop.hbase.HColumnDescriptor; -import org.apache.hadoop.hbase.HTableDescriptor; -import org.apache.hadoop.hbase.MediumTests; -import org.apache.hadoop.hbase.client.HBaseAdmin; -import org.apache.hadoop.hbase.test.MetricsAssertHelper; -import org.apache.hadoop.hbase.thrift.ThriftMetrics; -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.TDelete; -import org.apache.hadoop.hbase.thrift2.generated.TDeleteType; -import org.apache.hadoop.hbase.thrift2.generated.TGet; -import org.apache.hadoop.hbase.thrift2.generated.THBaseService; -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.TScan; -import org.apache.hadoop.hbase.util.Bytes; -import org.apache.thrift.TException; -import org.junit.AfterClass; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; -import org.junit.experimental.categories.Category; - -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.List; - -import static org.junit.Assert.*; - -/** - * Unit testing for ThriftServer.HBaseHandler, a part of the org.apache.hadoop.hbase.thrift2 package. - */ -@Category(MediumTests.class) -public class TestThriftHBaseServiceHandler { - - public static final Log LOG = LogFactory.getLog(TestThriftHBaseServiceHandler.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); - - // Static names for tables, columns, rows, and values - private static byte[] tableAname = Bytes.toBytes("tableA"); - private static byte[] familyAname = Bytes.toBytes("familyA"); - private static byte[] familyBname = Bytes.toBytes("familyB"); - private static byte[] qualifierAname = Bytes.toBytes("qualifierA"); - private static byte[] qualifierBname = Bytes.toBytes("qualifierB"); - private static byte[] valueAname = Bytes.toBytes("valueA"); - private static byte[] valueBname = Bytes.toBytes("valueB"); - private static HColumnDescriptor[] families = new HColumnDescriptor[] { - new HColumnDescriptor(familyAname), - new HColumnDescriptor(familyBname) - .setMaxVersions(2) - }; - - - private static final MetricsAssertHelper metricsHelper = - CompatibilityFactory.getInstance(MetricsAssertHelper.class); - - - public void assertTColumnValuesEqual(List columnValuesA, List columnValuesB) { - assertEquals(columnValuesA.size(), columnValuesB.size()); - Comparator comparator = new Comparator() { - @Override - public int compare(TColumnValue o1, TColumnValue o2) { - return Bytes.compareTo(Bytes.add(o1.getFamily(), o1.getQualifier()), - Bytes.add(o2.getFamily(), o2.getQualifier())); - } - }; - Collections.sort(columnValuesA, comparator); - Collections.sort(columnValuesB, comparator); - - for (int i = 0; i < columnValuesA.size(); i++) { - TColumnValue a = columnValuesA.get(i); - TColumnValue b = columnValuesB.get(i); - assertArrayEquals(a.getFamily(), b.getFamily()); - assertArrayEquals(a.getQualifier(), b.getQualifier()); - assertArrayEquals(a.getValue(), b.getValue()); - } - } - - @BeforeClass - public static void beforeClass() throws Exception { - UTIL.startMiniCluster(); - HBaseAdmin admin = new HBaseAdmin(UTIL.getConfiguration()); - HTableDescriptor tableDescriptor = new HTableDescriptor(tableAname); - for (HColumnDescriptor family : families) { - tableDescriptor.addFamily(family); - } - admin.createTable(tableDescriptor); - } - - @AfterClass - public static void afterClass() throws Exception { - UTIL.shutdownMiniCluster(); - } - - @Before - public void setup() throws Exception { - - } - - private ThriftHBaseServiceHandler createHandler() { - return new ThriftHBaseServiceHandler(UTIL.getConfiguration()); - } - - @Test - public void testExists() throws TIOError, TException { - ThriftHBaseServiceHandler handler = createHandler(); - byte[] rowName = "testExists".getBytes(); - ByteBuffer table = ByteBuffer.wrap(tableAname); - - TGet get = new TGet(ByteBuffer.wrap(rowName)); - assertFalse(handler.exists(table, get)); - - List columnValues = new ArrayList(); - columnValues.add(new TColumnValue(ByteBuffer.wrap(familyAname), ByteBuffer.wrap(qualifierAname), ByteBuffer - .wrap(valueAname))); - columnValues.add(new TColumnValue(ByteBuffer.wrap(familyBname), ByteBuffer.wrap(qualifierBname), ByteBuffer - .wrap(valueBname))); - TPut put = new TPut(ByteBuffer.wrap(rowName), columnValues); - put.setColumnValues(columnValues); - - handler.put(table, put); - - assertTrue(handler.exists(table, get)); - } - - @Test - public void testPutGet() throws Exception { - ThriftHBaseServiceHandler handler = createHandler(); - byte[] rowName = "testPutGet".getBytes(); - ByteBuffer table = ByteBuffer.wrap(tableAname); - - List columnValues = new ArrayList(); - columnValues.add(new TColumnValue(ByteBuffer.wrap(familyAname), ByteBuffer.wrap(qualifierAname), ByteBuffer - .wrap(valueAname))); - columnValues.add(new TColumnValue(ByteBuffer.wrap(familyBname), ByteBuffer.wrap(qualifierBname), ByteBuffer - .wrap(valueBname))); - TPut put = new TPut(ByteBuffer.wrap(rowName), columnValues); - - put.setColumnValues(columnValues); - - handler.put(table, put); - - TGet get = new TGet(ByteBuffer.wrap(rowName)); - - TResult result = handler.get(table, get); - assertArrayEquals(rowName, result.getRow()); - List returnedColumnValues = result.getColumnValues(); - assertTColumnValuesEqual(columnValues, returnedColumnValues); - } - - @Test - public void testPutGetMultiple() throws Exception { - ThriftHBaseServiceHandler handler = createHandler(); - ByteBuffer table = ByteBuffer.wrap(tableAname); - byte[] rowName1 = "testPutGetMultiple1".getBytes(); - byte[] rowName2 = "testPutGetMultiple2".getBytes(); - - List columnValues = new ArrayList(); - columnValues.add(new TColumnValue(ByteBuffer.wrap(familyAname), ByteBuffer.wrap(qualifierAname), ByteBuffer - .wrap(valueAname))); - columnValues.add(new TColumnValue(ByteBuffer.wrap(familyBname), ByteBuffer.wrap(qualifierBname), ByteBuffer - .wrap(valueBname))); - List puts = new ArrayList(); - puts.add(new TPut(ByteBuffer.wrap(rowName1), columnValues)); - puts.add(new TPut(ByteBuffer.wrap(rowName2), columnValues)); - - handler.putMultiple(table, puts); - - List gets = new ArrayList(); - gets.add(new TGet(ByteBuffer.wrap(rowName1))); - gets.add(new TGet(ByteBuffer.wrap(rowName2))); - - List results = handler.getMultiple(table, gets); - assertEquals(2, results.size()); - - assertArrayEquals(rowName1, results.get(0).getRow()); - assertTColumnValuesEqual(columnValues, results.get(0).getColumnValues()); - - assertArrayEquals(rowName2, results.get(1).getRow()); - assertTColumnValuesEqual(columnValues, results.get(1).getColumnValues()); - } - - @Test - public void testDeleteMultiple() throws Exception { - ThriftHBaseServiceHandler handler = createHandler(); - ByteBuffer table = ByteBuffer.wrap(tableAname); - byte[] rowName1 = "testDeleteMultiple1".getBytes(); - byte[] rowName2 = "testDeleteMultiple2".getBytes(); - - List columnValues = new ArrayList(); - columnValues.add(new TColumnValue(ByteBuffer.wrap(familyAname), ByteBuffer.wrap(qualifierAname), ByteBuffer - .wrap(valueAname))); - columnValues.add(new TColumnValue(ByteBuffer.wrap(familyBname), ByteBuffer.wrap(qualifierBname), ByteBuffer - .wrap(valueBname))); - List puts = new ArrayList(); - puts.add(new TPut(ByteBuffer.wrap(rowName1), columnValues)); - puts.add(new TPut(ByteBuffer.wrap(rowName2), columnValues)); - - handler.putMultiple(table, puts); - - List deletes = new ArrayList(); - deletes.add(new TDelete(ByteBuffer.wrap(rowName1))); - deletes.add(new TDelete(ByteBuffer.wrap(rowName2))); - - List deleteResults = handler.deleteMultiple(table, deletes); - // 0 means they were all successfully applies - assertEquals(0, deleteResults.size()); - - assertFalse(handler.exists(table, new TGet(ByteBuffer.wrap(rowName1)))); - assertFalse(handler.exists(table, new TGet(ByteBuffer.wrap(rowName2)))); - } - - @Test - public void testDelete() throws Exception { - ThriftHBaseServiceHandler handler = createHandler(); - byte[] rowName = "testDelete".getBytes(); - ByteBuffer table = ByteBuffer.wrap(tableAname); - - List columnValues = new ArrayList(); - TColumnValue columnValueA = new TColumnValue(ByteBuffer.wrap(familyAname), ByteBuffer.wrap(qualifierAname), - ByteBuffer.wrap(valueAname)); - TColumnValue columnValueB = new TColumnValue(ByteBuffer.wrap(familyBname), ByteBuffer.wrap(qualifierBname), - ByteBuffer.wrap(valueBname)); - columnValues.add(columnValueA); - columnValues.add(columnValueB); - TPut put = new TPut(ByteBuffer.wrap(rowName), columnValues); - - put.setColumnValues(columnValues); - - handler.put(table, put); - - TDelete delete = new TDelete(ByteBuffer.wrap(rowName)); - List deleteColumns = new ArrayList(); - TColumn deleteColumn = new TColumn(ByteBuffer.wrap(familyAname)); - deleteColumn.setQualifier(qualifierAname); - deleteColumns.add(deleteColumn); - delete.setColumns(deleteColumns); - - handler.deleteSingle(table, delete); - - TGet get = new TGet(ByteBuffer.wrap(rowName)); - TResult result = handler.get(table, get); - assertArrayEquals(rowName, result.getRow()); - List returnedColumnValues = result.getColumnValues(); - List expectedColumnValues = new ArrayList(); - expectedColumnValues.add(columnValueB); - assertTColumnValuesEqual(expectedColumnValues, returnedColumnValues); - } - - @Test - public void testDeleteAllTimestamps() throws Exception { - ThriftHBaseServiceHandler handler = createHandler(); - byte[] rowName = "testDeleteAllTimestamps".getBytes(); - ByteBuffer table = ByteBuffer.wrap(tableAname); - - List columnValues = new ArrayList(); - TColumnValue columnValueA = new TColumnValue(ByteBuffer.wrap(familyAname), ByteBuffer.wrap(qualifierAname), - ByteBuffer.wrap(valueAname)); - columnValueA.setTimestamp(System.currentTimeMillis() - 10); - columnValues.add(columnValueA); - TPut put = new TPut(ByteBuffer.wrap(rowName), columnValues); - - put.setColumnValues(columnValues); - - handler.put(table, put); - columnValueA.setTimestamp(System.currentTimeMillis()); - handler.put(table, put); - - TGet get = new TGet(ByteBuffer.wrap(rowName)); - get.setMaxVersions(2); - TResult result = handler.get(table, get); - assertEquals(2, result.getColumnValuesSize()); - - TDelete delete = new TDelete(ByteBuffer.wrap(rowName)); - List deleteColumns = new ArrayList(); - TColumn deleteColumn = new TColumn(ByteBuffer.wrap(familyAname)); - deleteColumn.setQualifier(qualifierAname); - deleteColumns.add(deleteColumn); - delete.setColumns(deleteColumns); - delete.setDeleteType(TDeleteType.DELETE_COLUMNS); // This is the default anyway. - - handler.deleteSingle(table, delete); - - get = new TGet(ByteBuffer.wrap(rowName)); - result = handler.get(table, get); - assertNull(result.getRow()); - assertEquals(0, result.getColumnValuesSize()); - } - - @Test - public void testDeleteSingleTimestamp() throws Exception { - ThriftHBaseServiceHandler handler = createHandler(); - byte[] rowName = "testDeleteSingleTimestamp".getBytes(); - ByteBuffer table = ByteBuffer.wrap(tableAname); - - long timestamp1 = System.currentTimeMillis() - 10; - long timestamp2 = System.currentTimeMillis(); - - List columnValues = new ArrayList(); - TColumnValue columnValueA = new TColumnValue(ByteBuffer.wrap(familyAname), ByteBuffer.wrap(qualifierAname), - ByteBuffer.wrap(valueAname)); - columnValueA.setTimestamp(timestamp1); - columnValues.add(columnValueA); - TPut put = new TPut(ByteBuffer.wrap(rowName), columnValues); - - put.setColumnValues(columnValues); - - handler.put(table, put); - columnValueA.setTimestamp(timestamp2); - handler.put(table, put); - - TGet get = new TGet(ByteBuffer.wrap(rowName)); - get.setMaxVersions(2); - TResult result = handler.get(table, get); - assertEquals(2, result.getColumnValuesSize()); - - TDelete delete = new TDelete(ByteBuffer.wrap(rowName)); - List deleteColumns = new ArrayList(); - TColumn deleteColumn = new TColumn(ByteBuffer.wrap(familyAname)); - deleteColumn.setQualifier(qualifierAname); - deleteColumns.add(deleteColumn); - delete.setColumns(deleteColumns); - delete.setDeleteType(TDeleteType.DELETE_COLUMN); - - handler.deleteSingle(table, delete); - - get = new TGet(ByteBuffer.wrap(rowName)); - result = handler.get(table, get); - assertArrayEquals(rowName, result.getRow()); - assertEquals(1, result.getColumnValuesSize()); - // the older timestamp should remain. - assertEquals(timestamp1, result.getColumnValues().get(0).getTimestamp()); - } - - @Test - public void testIncrement() throws Exception { - ThriftHBaseServiceHandler handler = createHandler(); - byte[] rowName = "testIncrement".getBytes(); - ByteBuffer table = ByteBuffer.wrap(tableAname); - - List columnValues = new ArrayList(); - columnValues.add(new TColumnValue(ByteBuffer.wrap(familyAname), ByteBuffer.wrap(qualifierAname), ByteBuffer - .wrap(Bytes.toBytes(1L)))); - TPut put = new TPut(ByteBuffer.wrap(rowName), columnValues); - put.setColumnValues(columnValues); - handler.put(table, put); - - List incrementColumns = new ArrayList(); - incrementColumns.add(new TColumnIncrement(ByteBuffer.wrap(familyAname), ByteBuffer.wrap(qualifierAname))); - TIncrement increment = new TIncrement(ByteBuffer.wrap(rowName), incrementColumns); - handler.increment(table, increment); - - TGet get = new TGet(ByteBuffer.wrap(rowName)); - TResult result = handler.get(table, get); - - assertArrayEquals(rowName, result.getRow()); - assertEquals(1, result.getColumnValuesSize()); - TColumnValue columnValue = result.getColumnValues().get(0); - assertArrayEquals(Bytes.toBytes(2L), columnValue.getValue()); - } - - /** - * check that checkAndPut fails if the cell does not exist, then put in the cell, then check that the checkAndPut - * succeeds. - * - * @throws Exception - */ - @Test - public void testCheckAndPut() throws Exception { - ThriftHBaseServiceHandler handler = createHandler(); - byte[] rowName = "testCheckAndPut".getBytes(); - ByteBuffer table = ByteBuffer.wrap(tableAname); - - List columnValuesA = new ArrayList(); - TColumnValue columnValueA = new TColumnValue(ByteBuffer.wrap(familyAname), ByteBuffer.wrap(qualifierAname), - ByteBuffer.wrap(valueAname)); - columnValuesA.add(columnValueA); - TPut putA = new TPut(ByteBuffer.wrap(rowName), columnValuesA); - putA.setColumnValues(columnValuesA); - - List columnValuesB = new ArrayList(); - TColumnValue columnValueB = new TColumnValue(ByteBuffer.wrap(familyBname), ByteBuffer.wrap(qualifierBname), - ByteBuffer.wrap(valueBname)); - columnValuesB.add(columnValueB); - TPut putB = new TPut(ByteBuffer.wrap(rowName), columnValuesB); - putB.setColumnValues(columnValuesB); - - assertFalse(handler.checkAndPut(table, ByteBuffer.wrap(rowName), ByteBuffer.wrap(familyAname), - ByteBuffer.wrap(qualifierAname), ByteBuffer.wrap(valueAname), putB)); - - TGet get = new TGet(ByteBuffer.wrap(rowName)); - TResult result = handler.get(table, get); - assertEquals(0, result.getColumnValuesSize()); - - handler.put(table, putA); - - assertTrue(handler.checkAndPut(table, ByteBuffer.wrap(rowName), ByteBuffer.wrap(familyAname), - ByteBuffer.wrap(qualifierAname), ByteBuffer.wrap(valueAname), putB)); - - result = handler.get(table, get); - assertArrayEquals(rowName, result.getRow()); - List returnedColumnValues = result.getColumnValues(); - List expectedColumnValues = new ArrayList(); - expectedColumnValues.add(columnValueA); - expectedColumnValues.add(columnValueB); - assertTColumnValuesEqual(expectedColumnValues, returnedColumnValues); - } - - /** - * check that checkAndDelete fails if the cell does not exist, then put in the cell, then check that the - * checkAndDelete succeeds. - * - * @throws Exception - */ - @Test - public void testCheckAndDelete() throws Exception { - ThriftHBaseServiceHandler handler = createHandler(); - byte[] rowName = "testCheckAndDelete".getBytes(); - ByteBuffer table = ByteBuffer.wrap(tableAname); - - List columnValuesA = new ArrayList(); - TColumnValue columnValueA = new TColumnValue(ByteBuffer.wrap(familyAname), ByteBuffer.wrap(qualifierAname), - ByteBuffer.wrap(valueAname)); - columnValuesA.add(columnValueA); - TPut putA = new TPut(ByteBuffer.wrap(rowName), columnValuesA); - putA.setColumnValues(columnValuesA); - - List columnValuesB = new ArrayList(); - TColumnValue columnValueB = new TColumnValue(ByteBuffer.wrap(familyBname), ByteBuffer.wrap(qualifierBname), - ByteBuffer.wrap(valueBname)); - columnValuesB.add(columnValueB); - TPut putB = new TPut(ByteBuffer.wrap(rowName), columnValuesB); - putB.setColumnValues(columnValuesB); - - // put putB so that we know whether the row has been deleted or not - handler.put(table, putB); - - TDelete delete = new TDelete(ByteBuffer.wrap(rowName)); - - assertFalse(handler.checkAndDelete(table, ByteBuffer.wrap(rowName), ByteBuffer.wrap(familyAname), - ByteBuffer.wrap(qualifierAname), ByteBuffer.wrap(valueAname), delete)); - - TGet get = new TGet(ByteBuffer.wrap(rowName)); - TResult result = handler.get(table, get); - assertArrayEquals(rowName, result.getRow()); - assertTColumnValuesEqual(columnValuesB, result.getColumnValues()); - - handler.put(table, putA); - - assertTrue(handler.checkAndDelete(table, ByteBuffer.wrap(rowName), ByteBuffer.wrap(familyAname), - ByteBuffer.wrap(qualifierAname), ByteBuffer.wrap(valueAname), delete)); - - result = handler.get(table, get); - assertFalse(result.isSetRow()); - assertEquals(0, result.getColumnValuesSize()); - } - - @Test - public void testScan() throws Exception { - ThriftHBaseServiceHandler handler = createHandler(); - ByteBuffer table = ByteBuffer.wrap(tableAname); - - TScan scan = new TScan(); - List columns = new ArrayList(); - TColumn column = new TColumn(); - column.setFamily(familyAname); - column.setQualifier(qualifierAname); - columns.add(column); - scan.setColumns(columns); - scan.setStartRow("testScan".getBytes()); - - TColumnValue columnValue = new TColumnValue(ByteBuffer.wrap(familyAname), ByteBuffer.wrap(qualifierAname), - ByteBuffer.wrap(valueAname)); - List columnValues = new ArrayList(); - columnValues.add(columnValue); - for (int i = 0; i < 10; i++) { - TPut put = new TPut(ByteBuffer.wrap(("testScan" + i).getBytes()), columnValues); - handler.put(table, put); - } - - int scanId = handler.openScanner(table, scan); - List results = handler.getScannerRows(scanId, 10); - assertEquals(10, results.size()); - for (int i = 0; i < 10; i++) { - assertArrayEquals(("testScan" + i).getBytes(), results.get(i).getRow()); - } - - results = handler.getScannerRows(scanId, 10); - assertEquals(0, results.size()); - - handler.closeScanner(scanId); - - try { - handler.getScannerRows(scanId, 10); - fail("Scanner id should be invalid"); - } catch (TIllegalArgument e) { - } - } - - @Test - public void testMetrics() throws Exception { - Configuration conf = UTIL.getConfiguration(); - ThriftMetrics metrics = getMetrics(conf); - THBaseService.Iface handler = - ThriftHBaseServiceHandler.newInstance(conf, metrics); - byte[] rowName = "testMetrics".getBytes(); - ByteBuffer table = ByteBuffer.wrap(tableAname); - - TGet get = new TGet(ByteBuffer.wrap(rowName)); - assertFalse(handler.exists(table, get)); - - List columnValues = new ArrayList(); - columnValues.add(new TColumnValue(ByteBuffer.wrap(familyAname), - ByteBuffer.wrap(qualifierAname), - ByteBuffer.wrap(valueAname))); - columnValues.add(new TColumnValue(ByteBuffer.wrap(familyBname), - ByteBuffer.wrap(qualifierBname), - ByteBuffer.wrap(valueBname))); - TPut put = new TPut(ByteBuffer.wrap(rowName), columnValues); - put.setColumnValues(columnValues); - - handler.put(table, put); - - assertTrue(handler.exists(table, get)); - metricsHelper.assertCounter("put_num_ops", 1, metrics.getSource()); - metricsHelper.assertCounter( "exists_num_ops", 2, metrics.getSource()); - } - - private static ThriftMetrics getMetrics(Configuration conf) throws Exception { - ThriftMetrics m = new ThriftMetrics(conf, ThriftMetrics.ThriftServerType.TWO); - m.getSource().init(); //Clear all the metrics - return m; - } - -} -