diff --git a/.github/workflows/standardization_lint.yaml b/.github/workflows/standardization_lint.yaml index 5b9e5fc265..481c65398b 100644 --- a/.github/workflows/standardization_lint.yaml +++ b/.github/workflows/standardization_lint.yaml @@ -69,7 +69,7 @@ jobs: - uses: hadolint/hadolint-action@v2.1.0 with: recursive: true - ignore: 'DL3033,DL3013,DL3059,SC2086,DL3003,SC2164,DL3008,DL3007,DL3006' + ignore: 'DL3033,DL3013,DL3059,SC2086,DL3003,SC2164,DL3008,DL3007,DL3006,DL4001' license_check: name: Check License diff --git a/.gitignore b/.gitignore index 509dbfb07e..e70e26a5b9 100644 --- a/.gitignore +++ b/.gitignore @@ -136,6 +136,8 @@ java-client/.vscode/ java-client/google-java-format-* java-client/pegasus-* java-client/dependency-reduced-pom.xml +java-client/src/main/java/org/apache/pegasus/apps/* +java-client/src/main/java/org/apache/pegasus/replication/* # Created by .ignore support plugin (hsz.mobi) ### SBT template diff --git a/README.md b/README.md index a80060be7a..820a3bc1b4 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,9 @@ under the License. --> [github-release]: https://github.com/apache/incubator-pegasus/releases + [PacificA]: https://www.microsoft.com/en-us/research/publication/pacifica-replication-in-log-based-distributed-storage-systems/ + [pegasus-rocksdb]: https://github.com/xiaomi/pegasus-rocksdb [hbase]: https://hbase.apache.org/ [website]: https://pegasus.apache.org diff --git a/docker/pegasus-build-env/centos6/Dockerfile b/docker/pegasus-build-env/centos6/Dockerfile index 61e9c5f182..8e6c174018 100644 --- a/docker/pegasus-build-env/centos6/Dockerfile +++ b/docker/pegasus-build-env/centos6/Dockerfile @@ -26,10 +26,10 @@ RUN curl https://www.getpagespeed.com/files/centos6-scl-eol.repo --output /etc/y RUN curl https://www.getpagespeed.com/files/centos6-scl-rh-eol.repo --output /etc/yum.repos.d/CentOS-SCLo-scl-rh.repo # diable gpgcheck, otherwise the repo check will be failed. -RUN sed -i s/"gpgcheck=1"/"gpgcheck=0"/g /etc/yum.repos.d/CentOS-Base.repo -RUN sed -i s/"gpgcheck=1"/"gpgcheck=0"/g /etc/yum.repos.d/epel.repo -RUN sed -i s/"gpgcheck=1"/"gpgcheck=0"/g /etc/yum.repos.d/CentOS-SCLo-scl-rh.repo -RUN sed -i s/"gpgcheck=1"/"gpgcheck=0"/g /etc/yum.repos.d/CentOS-SCLo-scl.repo +RUN sed -i 's/gpgcheck=1/gpgcheck=0/g' /etc/yum.repos.d/CentOS-Base.repo +RUN sed -i 's/gpgcheck=1/gpgcheck=0/g' /etc/yum.repos.d/epel.repo +RUN sed -i 's/gpgcheck=1/gpgcheck=0/g' /etc/yum.repos.d/CentOS-SCLo-scl-rh.repo +RUN sed -i 's/gpgcheck=1/gpgcheck=0/g' /etc/yum.repos.d/CentOS-SCLo-scl.repo RUN yum -y install \ devtoolset-7-gcc \ @@ -42,7 +42,7 @@ RUN yum -y install \ python27 \ python34 \ automake \ - autoconf \ + autoconf \ make \ libtool \ file \ @@ -78,4 +78,10 @@ ENV LD_LIBRARY_PATH=$JAVA_HOME/jre/lib/amd64/server:$PYTHON2_HOME/lib64/:$LD_LIB RUN pip install --no-cache-dir cmake +RUN wget --progress=dot:giga https://github.com/apache/thrift/archive/refs/tags/0.11.0.tar.gz -P /opt/thrift && \ + cd /opt/thrift && tar xzf 0.11.0.tar.gz && cd thrift-0.11.0 && ./bootstrap.sh && \ + ./configure --enable-libs=no && \ + make -j$(($(nproc)/2+1)) && make install && cd - && \ + rm -rf thrift-0.11.0 0.11.0.tar.gz + WORKDIR /root/apache diff --git a/docker/pegasus-build-env/centos7/Dockerfile b/docker/pegasus-build-env/centos7/Dockerfile index beea128ca3..dad92f6f6a 100644 --- a/docker/pegasus-build-env/centos7/Dockerfile +++ b/docker/pegasus-build-env/centos7/Dockerfile @@ -61,6 +61,12 @@ RUN wget --progress=dot:giga https://archive.apache.org/dist/maven/maven-3/3.8.3 && tar -zxf apache-maven-3.8.3-bin.tar.gz \ && rm apache-maven-3.8.3-bin.tar.gz +RUN wget --progress=dot:giga https://github.com/apache/thrift/archive/refs/tags/0.11.0.tar.gz -P /opt/thrift && \ + cd /opt/thrift && tar xzf 0.11.0.tar.gz && cd thrift-0.11.0 && ./bootstrap.sh && \ + ./configure --enable-libs=no && \ + make -j$(($(nproc)/2+1)) && make install && cd - && \ + rm -rf thrift-0.11.0 0.11.0.tar.gz + ENV JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk ENV PATH="/opt/rh/devtoolset-7/root/bin/:${PATH}" ENV PATH="/opt/maven/apache-maven-3.8.3/bin:${PATH}" diff --git a/docker/pegasus-build-env/ubuntu1604/Dockerfile b/docker/pegasus-build-env/ubuntu1604/Dockerfile index 4497470315..30a28b4655 100644 --- a/docker/pegasus-build-env/ubuntu1604/Dockerfile +++ b/docker/pegasus-build-env/ubuntu1604/Dockerfile @@ -60,4 +60,10 @@ RUN add-apt-repository ppa:git-core/ppa -y; \ RUN pip3 install --no-cache-dir cmake +RUN wget --progress=dot:giga https://github.com/apache/thrift/archive/refs/tags/0.11.0.tar.gz -P /opt/thrift && \ + cd /opt/thrift && tar xzf 0.11.0.tar.gz && cd thrift-0.11.0 && ./bootstrap.sh && \ + ./configure --enable-libs=no && \ + make -j$(($(nproc)/2+1)) && make install && cd - && \ + rm -rf thrift-0.11.0 0.11.0.tar.gz + WORKDIR /root/apache diff --git a/docker/pegasus-build-env/ubuntu1804/Dockerfile b/docker/pegasus-build-env/ubuntu1804/Dockerfile index 9c6238aab5..0f18d6f0ab 100644 --- a/docker/pegasus-build-env/ubuntu1804/Dockerfile +++ b/docker/pegasus-build-env/ubuntu1804/Dockerfile @@ -62,6 +62,12 @@ RUN add-apt-repository ppa:git-core/ppa -y; \ RUN pip3 install --no-cache-dir cmake +RUN wget --progress=dot:giga https://github.com/apache/thrift/archive/refs/tags/0.11.0.tar.gz -P /opt/thrift && \ + cd /opt/thrift && tar xzf 0.11.0.tar.gz && cd thrift-0.11.0 && ./bootstrap.sh && \ + ./configure --enable-libs=no && \ + make -j$(($(nproc)/2+1)) && make install && cd - && \ + rm -rf thrift-0.11.0 0.11.0.tar.gz + ENV JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 ENV CLASSPATH=$JAVA_HOME/lib/ ENV PATH=$JAVA_HOME/bin:$PATH diff --git a/docker/pegasus-build-env/ubuntu2004/Dockerfile b/docker/pegasus-build-env/ubuntu2004/Dockerfile index 7457540ab5..6438fb03bf 100644 --- a/docker/pegasus-build-env/ubuntu2004/Dockerfile +++ b/docker/pegasus-build-env/ubuntu2004/Dockerfile @@ -62,6 +62,12 @@ RUN add-apt-repository ppa:git-core/ppa -y; \ RUN pip3 install --no-cache-dir cmake +RUN wget --progress=dot:giga https://github.com/apache/thrift/archive/refs/tags/0.11.0.tar.gz -P /opt/thrift && \ + cd /opt/thrift && tar xzf 0.11.0.tar.gz && cd thrift-0.11.0 && ./bootstrap.sh && \ + ./configure --enable-libs=no && \ + make -j$(($(nproc)/2+1)) && make install && cd - && \ + rm -rf thrift-0.11.0 0.11.0.tar.gz + ENV JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 ENV CLASSPATH=$JAVA_HOME/lib/ ENV PATH=$JAVA_HOME/bin:$PATH diff --git a/java-client/README.md b/java-client/README.md index 370bfb2520..f6683e16d9 100644 --- a/java-client/README.md +++ b/java-client/README.md @@ -24,12 +24,16 @@ under the License. ## Build ``` +cd idl && sh recompile_thrift.sh && cd - +mvn spotless:apply mvn clean package -DskipTests ``` ## Install ``` +cd idl && sh recompile_thrift.sh && cd - +mvn spotless:apply mvn clean install -DskipTests ``` @@ -38,12 +42,16 @@ mvn clean install -DskipTests To run test, you should start pegasus onebox firstly, and run test as: ``` +cd idl && sh recompile_thrift.sh && cd - +mvn spotless:apply mvn clean package ``` or specify one test: ``` +cd idl && sh recompile_thrift.sh && cd - +mvn spotless:apply mvn clean package -Dtest=TestPing ``` diff --git a/java-client/idl/recompile_thrift.sh b/java-client/idl/recompile_thrift.sh index 1da0b97f93..286efd043a 100755 --- a/java-client/idl/recompile_thrift.sh +++ b/java-client/idl/recompile_thrift.sh @@ -19,21 +19,32 @@ # under the License. # -# method to get thrift 0.11.0: -# wget http://mirrors.tuna.tsinghua.edu.cn/apache/thrift/0.11.0/thrift-0.11.0.tar.gz -# tar xvf thrift-0.11.0.tar.gz -# cd thrift-0.11.0 -# ./configure --with-csharp=no --with-java=no --with-python=no --with-erlang=no --with-perl=no \ -# --with-php=no --with-ruby=no --with-haskell=no --with-php_extension=no --with-rs=no --with-go=no -# make -# sudo make install -# -# Note: by default the thrift will be installed in /usr/local. If you'd like to install it somewhere else, -# you'd better provide install path with option `--prefix=xxx'. - +function GenThriftTool() { + set -e + wget --progress=dot:giga https://github.com/apache/thrift/archive/refs/tags/0.11.0.tar.gz -O thrift-0.11.0.tar.gz + tar xzf thrift-0.11.0.tar.gz + pushd thrift-0.11.0 + ./bootstrap.sh + ./configure --enable-libs=no + make -j$(($(nproc)/2+1)) + make install + popd + rm -rf thrift-0.11.0 thrift-0.11.0.tar.gz + set +e +} + +root=`dirname $0` +root=`cd $root; pwd` + thrift=thrift +which thrift +if [ $? -ne 0 ]; then + echo "ERROR: not found thrift, try to get it" + GenThriftTool +fi + if ! $thrift -version | grep "0.11.0" ; then - echo "ERROR: thrift version should be 0.11.0" + echo "ERROR: thrift version should be 0.11.0, please manual fix it" exit 1 fi diff --git a/java-client/scripts/ci-test.sh b/java-client/scripts/ci-test.sh index 5c69ce6e26..9b5cceeb7d 100755 --- a/java-client/scripts/ci-test.sh +++ b/java-client/scripts/ci-test.sh @@ -57,6 +57,13 @@ cd $PEGASUS_PKG ./run.sh start_onebox -w cd ../ + +pushd idl +echo "bash recompile_thrift.sh" +bash recompile_thrift.sh +popd +mvn spotless:apply + if ! mvn clean test then cd $PEGASUS_PKG diff --git a/java-client/src/main/java/org/apache/pegasus/apps/batch_get_request.java b/java-client/src/main/java/org/apache/pegasus/apps/batch_get_request.java deleted file mode 100644 index cf82ffc7ea..0000000000 --- a/java-client/src/main/java/org/apache/pegasus/apps/batch_get_request.java +++ /dev/null @@ -1,469 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.11.0) - * - *

DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * - * @generated - */ -package org.apache.pegasus.apps; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated( - value = "Autogenerated by Thrift Compiler (0.11.0)", - date = "2022-02-12") -public class batch_get_request - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("batch_get_request"); - - private static final org.apache.thrift.protocol.TField KEYS_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "keys", org.apache.thrift.protocol.TType.LIST, (short) 1); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new batch_get_requestStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new batch_get_requestTupleSchemeFactory(); - - public java.util.List keys; // 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 { - KEYS((short) 1, "keys"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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: // KEYS - return KEYS; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put( - _Fields.KEYS, - new org.apache.thrift.meta_data.FieldMetaData( - "keys", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.ListMetaData( - org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.STRUCT, "full_key")))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap( - batch_get_request.class, metaDataMap); - } - - public batch_get_request() {} - - public batch_get_request(java.util.List keys) { - this(); - this.keys = keys; - } - - /** Performs a deep copy on other. */ - public batch_get_request(batch_get_request other) { - if (other.isSetKeys()) { - java.util.List __this__keys = new java.util.ArrayList(other.keys.size()); - for (full_key other_element : other.keys) { - __this__keys.add(new full_key(other_element)); - } - this.keys = __this__keys; - } - } - - public batch_get_request deepCopy() { - return new batch_get_request(this); - } - - @Override - public void clear() { - this.keys = null; - } - - public int getKeysSize() { - return (this.keys == null) ? 0 : this.keys.size(); - } - - public java.util.Iterator getKeysIterator() { - return (this.keys == null) ? null : this.keys.iterator(); - } - - public void addToKeys(full_key elem) { - if (this.keys == null) { - this.keys = new java.util.ArrayList(); - } - this.keys.add(elem); - } - - public java.util.List getKeys() { - return this.keys; - } - - public batch_get_request setKeys(java.util.List keys) { - this.keys = keys; - return this; - } - - public void unsetKeys() { - this.keys = null; - } - - /** Returns true if field keys is set (has been assigned a value) and false otherwise */ - public boolean isSetKeys() { - return this.keys != null; - } - - public void setKeysIsSet(boolean value) { - if (!value) { - this.keys = null; - } - } - - public void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case KEYS: - if (value == null) { - unsetKeys(); - } else { - setKeys((java.util.List) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case KEYS: - return getKeys(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case KEYS: - return isSetKeys(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof batch_get_request) return this.equals((batch_get_request) that); - return false; - } - - public boolean equals(batch_get_request that) { - if (that == null) return false; - if (this == that) return true; - - boolean this_present_keys = true && this.isSetKeys(); - boolean that_present_keys = true && that.isSetKeys(); - if (this_present_keys || that_present_keys) { - if (!(this_present_keys && that_present_keys)) return false; - if (!this.keys.equals(that.keys)) return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetKeys()) ? 131071 : 524287); - if (isSetKeys()) hashCode = hashCode * 8191 + keys.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(batch_get_request other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetKeys()).compareTo(other.isSetKeys()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetKeys()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.keys, other.keys); - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("batch_get_request("); - boolean first = true; - - sb.append("keys:"); - if (this.keys == null) { - sb.append("null"); - } else { - sb.append(this.keys); - } - 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, java.lang.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 batch_get_requestStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public batch_get_requestStandardScheme getScheme() { - return new batch_get_requestStandardScheme(); - } - } - - private static class batch_get_requestStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, batch_get_request 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: // KEYS - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list32 = iprot.readListBegin(); - struct.keys = new java.util.ArrayList(_list32.size); - full_key _elem33; - for (int _i34 = 0; _i34 < _list32.size; ++_i34) { - _elem33 = new full_key(); - _elem33.read(iprot); - struct.keys.add(_elem33); - } - iprot.readListEnd(); - } - struct.setKeysIsSet(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, batch_get_request struct) - throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.keys != null) { - oprot.writeFieldBegin(KEYS_FIELD_DESC); - { - oprot.writeListBegin( - new org.apache.thrift.protocol.TList( - org.apache.thrift.protocol.TType.STRUCT, struct.keys.size())); - for (full_key _iter35 : struct.keys) { - _iter35.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class batch_get_requestTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public batch_get_requestTupleScheme getScheme() { - return new batch_get_requestTupleScheme(); - } - } - - private static class batch_get_requestTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, batch_get_request struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetKeys()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetKeys()) { - { - oprot.writeI32(struct.keys.size()); - for (full_key _iter36 : struct.keys) { - _iter36.write(oprot); - } - } - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, batch_get_request struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - { - org.apache.thrift.protocol.TList _list37 = - new org.apache.thrift.protocol.TList( - org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.keys = new java.util.ArrayList(_list37.size); - full_key _elem38; - for (int _i39 = 0; _i39 < _list37.size; ++_i39) { - _elem38 = new full_key(); - _elem38.read(iprot); - struct.keys.add(_elem38); - } - } - struct.setKeysIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } -} diff --git a/java-client/src/main/java/org/apache/pegasus/apps/batch_get_response.java b/java-client/src/main/java/org/apache/pegasus/apps/batch_get_response.java deleted file mode 100644 index c912a468fe..0000000000 --- a/java-client/src/main/java/org/apache/pegasus/apps/batch_get_response.java +++ /dev/null @@ -1,896 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.11.0) - * - *

DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * - * @generated - */ -package org.apache.pegasus.apps; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated( - value = "Autogenerated by Thrift Compiler (0.11.0)", - date = "2022-02-12") -public class batch_get_response - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("batch_get_response"); - - private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "error", org.apache.thrift.protocol.TType.I32, (short) 1); - private static final org.apache.thrift.protocol.TField DATA_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "data", org.apache.thrift.protocol.TType.LIST, (short) 2); - private static final org.apache.thrift.protocol.TField APP_ID_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "app_id", org.apache.thrift.protocol.TType.I32, (short) 3); - private static final org.apache.thrift.protocol.TField PARTITION_INDEX_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "partition_index", org.apache.thrift.protocol.TType.I32, (short) 4); - private static final org.apache.thrift.protocol.TField SERVER_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "server", org.apache.thrift.protocol.TType.STRING, (short) 6); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new batch_get_responseStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new batch_get_responseTupleSchemeFactory(); - - public int error; // required - public java.util.List data; // required - public int app_id; // required - public int partition_index; // required - public java.lang.String server; // 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 { - ERROR((short) 1, "error"), - DATA((short) 2, "data"), - APP_ID((short) 3, "app_id"), - PARTITION_INDEX((short) 4, "partition_index"), - SERVER((short) 6, "server"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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: // ERROR - return ERROR; - case 2: // DATA - return DATA; - case 3: // APP_ID - return APP_ID; - case 4: // PARTITION_INDEX - return PARTITION_INDEX; - case 6: // SERVER - return SERVER; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __ERROR_ISSET_ID = 0; - private static final int __APP_ID_ISSET_ID = 1; - private static final int __PARTITION_INDEX_ISSET_ID = 2; - private byte __isset_bitfield = 0; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put( - _Fields.ERROR, - new org.apache.thrift.meta_data.FieldMetaData( - "error", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I32))); - tmpMap.put( - _Fields.DATA, - new org.apache.thrift.meta_data.FieldMetaData( - "data", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.ListMetaData( - org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.STRUCT, "full_data")))); - tmpMap.put( - _Fields.APP_ID, - new org.apache.thrift.meta_data.FieldMetaData( - "app_id", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I32))); - tmpMap.put( - _Fields.PARTITION_INDEX, - new org.apache.thrift.meta_data.FieldMetaData( - "partition_index", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I32))); - tmpMap.put( - _Fields.SERVER, - new org.apache.thrift.meta_data.FieldMetaData( - "server", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.STRING))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap( - batch_get_response.class, metaDataMap); - } - - public batch_get_response() {} - - public batch_get_response( - int error, - java.util.List data, - int app_id, - int partition_index, - java.lang.String server) { - this(); - this.error = error; - setErrorIsSet(true); - this.data = data; - this.app_id = app_id; - setApp_idIsSet(true); - this.partition_index = partition_index; - setPartition_indexIsSet(true); - this.server = server; - } - - /** Performs a deep copy on other. */ - public batch_get_response(batch_get_response other) { - __isset_bitfield = other.__isset_bitfield; - this.error = other.error; - if (other.isSetData()) { - java.util.List __this__data = - new java.util.ArrayList(other.data.size()); - for (full_data other_element : other.data) { - __this__data.add(new full_data(other_element)); - } - this.data = __this__data; - } - this.app_id = other.app_id; - this.partition_index = other.partition_index; - if (other.isSetServer()) { - this.server = other.server; - } - } - - public batch_get_response deepCopy() { - return new batch_get_response(this); - } - - @Override - public void clear() { - setErrorIsSet(false); - this.error = 0; - this.data = null; - setApp_idIsSet(false); - this.app_id = 0; - setPartition_indexIsSet(false); - this.partition_index = 0; - this.server = null; - } - - public int getError() { - return this.error; - } - - public batch_get_response setError(int error) { - this.error = error; - setErrorIsSet(true); - return this; - } - - public void unsetError() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ERROR_ISSET_ID); - } - - /** Returns true if field error is set (has been assigned a value) and false otherwise */ - public boolean isSetError() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ERROR_ISSET_ID); - } - - public void setErrorIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ERROR_ISSET_ID, value); - } - - public int getDataSize() { - return (this.data == null) ? 0 : this.data.size(); - } - - public java.util.Iterator getDataIterator() { - return (this.data == null) ? null : this.data.iterator(); - } - - public void addToData(full_data elem) { - if (this.data == null) { - this.data = new java.util.ArrayList(); - } - this.data.add(elem); - } - - public java.util.List getData() { - return this.data; - } - - public batch_get_response setData(java.util.List data) { - this.data = data; - return this; - } - - public void unsetData() { - this.data = null; - } - - /** Returns true if field data is set (has been assigned a value) and false otherwise */ - public boolean isSetData() { - return this.data != null; - } - - public void setDataIsSet(boolean value) { - if (!value) { - this.data = null; - } - } - - public int getApp_id() { - return this.app_id; - } - - public batch_get_response setApp_id(int app_id) { - this.app_id = app_id; - setApp_idIsSet(true); - return this; - } - - public void unsetApp_id() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __APP_ID_ISSET_ID); - } - - /** Returns true if field app_id is set (has been assigned a value) and false otherwise */ - public boolean isSetApp_id() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __APP_ID_ISSET_ID); - } - - public void setApp_idIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __APP_ID_ISSET_ID, value); - } - - public int getPartition_index() { - return this.partition_index; - } - - public batch_get_response setPartition_index(int partition_index) { - this.partition_index = partition_index; - setPartition_indexIsSet(true); - return this; - } - - public void unsetPartition_index() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __PARTITION_INDEX_ISSET_ID); - } - - /** - * Returns true if field partition_index is set (has been assigned a value) and false otherwise - */ - public boolean isSetPartition_index() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __PARTITION_INDEX_ISSET_ID); - } - - public void setPartition_indexIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __PARTITION_INDEX_ISSET_ID, value); - } - - public java.lang.String getServer() { - return this.server; - } - - public batch_get_response setServer(java.lang.String server) { - this.server = server; - return this; - } - - public void unsetServer() { - this.server = null; - } - - /** Returns true if field server is set (has been assigned a value) and false otherwise */ - public boolean isSetServer() { - return this.server != null; - } - - public void setServerIsSet(boolean value) { - if (!value) { - this.server = null; - } - } - - public void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case ERROR: - if (value == null) { - unsetError(); - } else { - setError((java.lang.Integer) value); - } - break; - - case DATA: - if (value == null) { - unsetData(); - } else { - setData((java.util.List) value); - } - break; - - case APP_ID: - if (value == null) { - unsetApp_id(); - } else { - setApp_id((java.lang.Integer) value); - } - break; - - case PARTITION_INDEX: - if (value == null) { - unsetPartition_index(); - } else { - setPartition_index((java.lang.Integer) value); - } - break; - - case SERVER: - if (value == null) { - unsetServer(); - } else { - setServer((java.lang.String) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case ERROR: - return getError(); - - case DATA: - return getData(); - - case APP_ID: - return getApp_id(); - - case PARTITION_INDEX: - return getPartition_index(); - - case SERVER: - return getServer(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case ERROR: - return isSetError(); - case DATA: - return isSetData(); - case APP_ID: - return isSetApp_id(); - case PARTITION_INDEX: - return isSetPartition_index(); - case SERVER: - return isSetServer(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof batch_get_response) return this.equals((batch_get_response) that); - return false; - } - - public boolean equals(batch_get_response that) { - if (that == null) return false; - if (this == that) return true; - - boolean this_present_error = true; - boolean that_present_error = true; - if (this_present_error || that_present_error) { - if (!(this_present_error && that_present_error)) return false; - if (this.error != that.error) return false; - } - - boolean this_present_data = true && this.isSetData(); - boolean that_present_data = true && that.isSetData(); - if (this_present_data || that_present_data) { - if (!(this_present_data && that_present_data)) return false; - if (!this.data.equals(that.data)) return false; - } - - boolean this_present_app_id = true; - boolean that_present_app_id = true; - if (this_present_app_id || that_present_app_id) { - if (!(this_present_app_id && that_present_app_id)) return false; - if (this.app_id != that.app_id) return false; - } - - boolean this_present_partition_index = true; - boolean that_present_partition_index = true; - if (this_present_partition_index || that_present_partition_index) { - if (!(this_present_partition_index && that_present_partition_index)) return false; - if (this.partition_index != that.partition_index) return false; - } - - boolean this_present_server = true && this.isSetServer(); - boolean that_present_server = true && that.isSetServer(); - if (this_present_server || that_present_server) { - if (!(this_present_server && that_present_server)) return false; - if (!this.server.equals(that.server)) return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + error; - - hashCode = hashCode * 8191 + ((isSetData()) ? 131071 : 524287); - if (isSetData()) hashCode = hashCode * 8191 + data.hashCode(); - - hashCode = hashCode * 8191 + app_id; - - hashCode = hashCode * 8191 + partition_index; - - hashCode = hashCode * 8191 + ((isSetServer()) ? 131071 : 524287); - if (isSetServer()) hashCode = hashCode * 8191 + server.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(batch_get_response other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetError()).compareTo(other.isSetError()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetError()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetData()).compareTo(other.isSetData()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetData()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.data, other.data); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetApp_id()).compareTo(other.isSetApp_id()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetApp_id()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.app_id, other.app_id); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetPartition_index()).compareTo(other.isSetPartition_index()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetPartition_index()) { - lastComparison = - org.apache.thrift.TBaseHelper.compareTo(this.partition_index, other.partition_index); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetServer()).compareTo(other.isSetServer()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetServer()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.server, other.server); - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("batch_get_response("); - boolean first = true; - - sb.append("error:"); - sb.append(this.error); - first = false; - if (!first) sb.append(", "); - sb.append("data:"); - if (this.data == null) { - sb.append("null"); - } else { - sb.append(this.data); - } - first = false; - if (!first) sb.append(", "); - sb.append("app_id:"); - sb.append(this.app_id); - first = false; - if (!first) sb.append(", "); - sb.append("partition_index:"); - sb.append(this.partition_index); - first = false; - if (!first) sb.append(", "); - sb.append("server:"); - if (this.server == null) { - sb.append("null"); - } else { - sb.append(this.server); - } - 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, java.lang.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 batch_get_responseStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public batch_get_responseStandardScheme getScheme() { - return new batch_get_responseStandardScheme(); - } - } - - private static class batch_get_responseStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, batch_get_response 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: // ERROR - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.error = iprot.readI32(); - struct.setErrorIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // DATA - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list40 = iprot.readListBegin(); - struct.data = new java.util.ArrayList(_list40.size); - full_data _elem41; - for (int _i42 = 0; _i42 < _list40.size; ++_i42) { - _elem41 = new full_data(); - _elem41.read(iprot); - struct.data.add(_elem41); - } - iprot.readListEnd(); - } - struct.setDataIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // APP_ID - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.app_id = iprot.readI32(); - struct.setApp_idIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // PARTITION_INDEX - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.partition_index = iprot.readI32(); - struct.setPartition_indexIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 6: // SERVER - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.server = iprot.readString(); - struct.setServerIsSet(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, batch_get_response struct) - throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(ERROR_FIELD_DESC); - oprot.writeI32(struct.error); - oprot.writeFieldEnd(); - if (struct.data != null) { - oprot.writeFieldBegin(DATA_FIELD_DESC); - { - oprot.writeListBegin( - new org.apache.thrift.protocol.TList( - org.apache.thrift.protocol.TType.STRUCT, struct.data.size())); - for (full_data _iter43 : struct.data) { - _iter43.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(APP_ID_FIELD_DESC); - oprot.writeI32(struct.app_id); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(PARTITION_INDEX_FIELD_DESC); - oprot.writeI32(struct.partition_index); - oprot.writeFieldEnd(); - if (struct.server != null) { - oprot.writeFieldBegin(SERVER_FIELD_DESC); - oprot.writeString(struct.server); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class batch_get_responseTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public batch_get_responseTupleScheme getScheme() { - return new batch_get_responseTupleScheme(); - } - } - - private static class batch_get_responseTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, batch_get_response struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetError()) { - optionals.set(0); - } - if (struct.isSetData()) { - optionals.set(1); - } - if (struct.isSetApp_id()) { - optionals.set(2); - } - if (struct.isSetPartition_index()) { - optionals.set(3); - } - if (struct.isSetServer()) { - optionals.set(4); - } - oprot.writeBitSet(optionals, 5); - if (struct.isSetError()) { - oprot.writeI32(struct.error); - } - if (struct.isSetData()) { - { - oprot.writeI32(struct.data.size()); - for (full_data _iter44 : struct.data) { - _iter44.write(oprot); - } - } - } - if (struct.isSetApp_id()) { - oprot.writeI32(struct.app_id); - } - if (struct.isSetPartition_index()) { - oprot.writeI32(struct.partition_index); - } - if (struct.isSetServer()) { - oprot.writeString(struct.server); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, batch_get_response struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(5); - if (incoming.get(0)) { - struct.error = iprot.readI32(); - struct.setErrorIsSet(true); - } - if (incoming.get(1)) { - { - org.apache.thrift.protocol.TList _list45 = - new org.apache.thrift.protocol.TList( - org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.data = new java.util.ArrayList(_list45.size); - full_data _elem46; - for (int _i47 = 0; _i47 < _list45.size; ++_i47) { - _elem46 = new full_data(); - _elem46.read(iprot); - struct.data.add(_elem46); - } - } - struct.setDataIsSet(true); - } - if (incoming.get(2)) { - struct.app_id = iprot.readI32(); - struct.setApp_idIsSet(true); - } - if (incoming.get(3)) { - struct.partition_index = iprot.readI32(); - struct.setPartition_indexIsSet(true); - } - if (incoming.get(4)) { - struct.server = iprot.readString(); - struct.setServerIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } -} diff --git a/java-client/src/main/java/org/apache/pegasus/apps/cas_check_type.java b/java-client/src/main/java/org/apache/pegasus/apps/cas_check_type.java deleted file mode 100644 index 62b4744f3d..0000000000 --- a/java-client/src/main/java/org/apache/pegasus/apps/cas_check_type.java +++ /dev/null @@ -1,106 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.11.0) - * - *

DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * - * @generated - */ -package org.apache.pegasus.apps; - -public enum cas_check_type implements org.apache.thrift.TEnum { - CT_NO_CHECK(0), - CT_VALUE_NOT_EXIST(1), - CT_VALUE_NOT_EXIST_OR_EMPTY(2), - CT_VALUE_EXIST(3), - CT_VALUE_NOT_EMPTY(4), - CT_VALUE_MATCH_ANYWHERE(5), - CT_VALUE_MATCH_PREFIX(6), - CT_VALUE_MATCH_POSTFIX(7), - CT_VALUE_BYTES_LESS(8), - CT_VALUE_BYTES_LESS_OR_EQUAL(9), - CT_VALUE_BYTES_EQUAL(10), - CT_VALUE_BYTES_GREATER_OR_EQUAL(11), - CT_VALUE_BYTES_GREATER(12), - CT_VALUE_INT_LESS(13), - CT_VALUE_INT_LESS_OR_EQUAL(14), - CT_VALUE_INT_EQUAL(15), - CT_VALUE_INT_GREATER_OR_EQUAL(16), - CT_VALUE_INT_GREATER(17); - - private final int value; - - private cas_check_type(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 cas_check_type findByValue(int value) { - switch (value) { - case 0: - return CT_NO_CHECK; - case 1: - return CT_VALUE_NOT_EXIST; - case 2: - return CT_VALUE_NOT_EXIST_OR_EMPTY; - case 3: - return CT_VALUE_EXIST; - case 4: - return CT_VALUE_NOT_EMPTY; - case 5: - return CT_VALUE_MATCH_ANYWHERE; - case 6: - return CT_VALUE_MATCH_PREFIX; - case 7: - return CT_VALUE_MATCH_POSTFIX; - case 8: - return CT_VALUE_BYTES_LESS; - case 9: - return CT_VALUE_BYTES_LESS_OR_EQUAL; - case 10: - return CT_VALUE_BYTES_EQUAL; - case 11: - return CT_VALUE_BYTES_GREATER_OR_EQUAL; - case 12: - return CT_VALUE_BYTES_GREATER; - case 13: - return CT_VALUE_INT_LESS; - case 14: - return CT_VALUE_INT_LESS_OR_EQUAL; - case 15: - return CT_VALUE_INT_EQUAL; - case 16: - return CT_VALUE_INT_GREATER_OR_EQUAL; - case 17: - return CT_VALUE_INT_GREATER; - default: - return null; - } - } -} diff --git a/java-client/src/main/java/org/apache/pegasus/apps/check_and_mutate_request.java b/java-client/src/main/java/org/apache/pegasus/apps/check_and_mutate_request.java deleted file mode 100644 index 2abe18af9b..0000000000 --- a/java-client/src/main/java/org/apache/pegasus/apps/check_and_mutate_request.java +++ /dev/null @@ -1,1047 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.11.0) - * - *

DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * - * @generated - */ -package org.apache.pegasus.apps; - -import org.apache.pegasus.base.blob; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated( - value = "Autogenerated by Thrift Compiler (0.11.0)", - date = "2020-04-13") -public class check_and_mutate_request - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("check_and_mutate_request"); - - private static final org.apache.thrift.protocol.TField HASH_KEY_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "hash_key", org.apache.thrift.protocol.TType.STRUCT, (short) 1); - private static final org.apache.thrift.protocol.TField CHECK_SORT_KEY_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "check_sort_key", org.apache.thrift.protocol.TType.STRUCT, (short) 2); - private static final org.apache.thrift.protocol.TField CHECK_TYPE_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "check_type", org.apache.thrift.protocol.TType.I32, (short) 3); - private static final org.apache.thrift.protocol.TField CHECK_OPERAND_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "check_operand", org.apache.thrift.protocol.TType.STRUCT, (short) 4); - private static final org.apache.thrift.protocol.TField MUTATE_LIST_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "mutate_list", org.apache.thrift.protocol.TType.LIST, (short) 5); - private static final org.apache.thrift.protocol.TField RETURN_CHECK_VALUE_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "return_check_value", org.apache.thrift.protocol.TType.BOOL, (short) 6); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new check_and_mutate_requestStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new check_and_mutate_requestTupleSchemeFactory(); - - public blob hash_key; // required - public blob check_sort_key; // required - /** @see cas_check_type */ - public cas_check_type check_type; // required - - public blob check_operand; // required - public java.util.List mutate_list; // required - public boolean return_check_value; // required - - /** - * The set of fields this struct contains, along with convenience methods for finding and - * manipulating them. - */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - HASH_KEY((short) 1, "hash_key"), - CHECK_SORT_KEY((short) 2, "check_sort_key"), - /** @see cas_check_type */ - CHECK_TYPE((short) 3, "check_type"), - CHECK_OPERAND((short) 4, "check_operand"), - MUTATE_LIST((short) 5, "mutate_list"), - RETURN_CHECK_VALUE((short) 6, "return_check_value"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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: // HASH_KEY - return HASH_KEY; - case 2: // CHECK_SORT_KEY - return CHECK_SORT_KEY; - case 3: // CHECK_TYPE - return CHECK_TYPE; - case 4: // CHECK_OPERAND - return CHECK_OPERAND; - case 5: // MUTATE_LIST - return MUTATE_LIST; - case 6: // RETURN_CHECK_VALUE - return RETURN_CHECK_VALUE; - default: - return null; - } - } - - /** Find the _Fields constant that matches fieldId, throwing an exception if it is not found. */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) - throw new java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __RETURN_CHECK_VALUE_ISSET_ID = 0; - private byte __isset_bitfield = 0; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put( - _Fields.HASH_KEY, - new org.apache.thrift.meta_data.FieldMetaData( - "hash_key", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData( - org.apache.thrift.protocol.TType.STRUCT, blob.class))); - tmpMap.put( - _Fields.CHECK_SORT_KEY, - new org.apache.thrift.meta_data.FieldMetaData( - "check_sort_key", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData( - org.apache.thrift.protocol.TType.STRUCT, blob.class))); - tmpMap.put( - _Fields.CHECK_TYPE, - new org.apache.thrift.meta_data.FieldMetaData( - "check_type", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.EnumMetaData( - org.apache.thrift.protocol.TType.ENUM, cas_check_type.class))); - tmpMap.put( - _Fields.CHECK_OPERAND, - new org.apache.thrift.meta_data.FieldMetaData( - "check_operand", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData( - org.apache.thrift.protocol.TType.STRUCT, blob.class))); - tmpMap.put( - _Fields.MUTATE_LIST, - new org.apache.thrift.meta_data.FieldMetaData( - "mutate_list", - 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, mutate.class)))); - tmpMap.put( - _Fields.RETURN_CHECK_VALUE, - new org.apache.thrift.meta_data.FieldMetaData( - "return_check_value", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.BOOL))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap( - check_and_mutate_request.class, metaDataMap); - } - - public check_and_mutate_request() {} - - public check_and_mutate_request( - blob hash_key, - blob check_sort_key, - cas_check_type check_type, - blob check_operand, - java.util.List mutate_list, - boolean return_check_value) { - this(); - this.hash_key = hash_key; - this.check_sort_key = check_sort_key; - this.check_type = check_type; - this.check_operand = check_operand; - this.mutate_list = mutate_list; - this.return_check_value = return_check_value; - setReturn_check_valueIsSet(true); - } - - /** Performs a deep copy on other. */ - public check_and_mutate_request(check_and_mutate_request other) { - __isset_bitfield = other.__isset_bitfield; - if (other.isSetHash_key()) { - this.hash_key = new blob(other.hash_key); - } - if (other.isSetCheck_sort_key()) { - this.check_sort_key = new blob(other.check_sort_key); - } - if (other.isSetCheck_type()) { - this.check_type = other.check_type; - } - if (other.isSetCheck_operand()) { - this.check_operand = new blob(other.check_operand); - } - if (other.isSetMutate_list()) { - java.util.List __this__mutate_list = - new java.util.ArrayList(other.mutate_list.size()); - for (mutate other_element : other.mutate_list) { - __this__mutate_list.add(new mutate(other_element)); - } - this.mutate_list = __this__mutate_list; - } - this.return_check_value = other.return_check_value; - } - - public check_and_mutate_request deepCopy() { - return new check_and_mutate_request(this); - } - - @Override - public void clear() { - this.hash_key = null; - this.check_sort_key = null; - this.check_type = null; - this.check_operand = null; - this.mutate_list = null; - setReturn_check_valueIsSet(false); - this.return_check_value = false; - } - - public blob getHash_key() { - return this.hash_key; - } - - public check_and_mutate_request setHash_key(blob hash_key) { - this.hash_key = hash_key; - return this; - } - - public void unsetHash_key() { - this.hash_key = null; - } - - /** Returns true if field hash_key is set (has been assigned a value) and false otherwise */ - public boolean isSetHash_key() { - return this.hash_key != null; - } - - public void setHash_keyIsSet(boolean value) { - if (!value) { - this.hash_key = null; - } - } - - public blob getCheck_sort_key() { - return this.check_sort_key; - } - - public check_and_mutate_request setCheck_sort_key(blob check_sort_key) { - this.check_sort_key = check_sort_key; - return this; - } - - public void unsetCheck_sort_key() { - this.check_sort_key = null; - } - - /** Returns true if field check_sort_key is set (has been assigned a value) and false otherwise */ - public boolean isSetCheck_sort_key() { - return this.check_sort_key != null; - } - - public void setCheck_sort_keyIsSet(boolean value) { - if (!value) { - this.check_sort_key = null; - } - } - - /** @see cas_check_type */ - public cas_check_type getCheck_type() { - return this.check_type; - } - - /** @see cas_check_type */ - public check_and_mutate_request setCheck_type(cas_check_type check_type) { - this.check_type = check_type; - return this; - } - - public void unsetCheck_type() { - this.check_type = null; - } - - /** Returns true if field check_type is set (has been assigned a value) and false otherwise */ - public boolean isSetCheck_type() { - return this.check_type != null; - } - - public void setCheck_typeIsSet(boolean value) { - if (!value) { - this.check_type = null; - } - } - - public blob getCheck_operand() { - return this.check_operand; - } - - public check_and_mutate_request setCheck_operand(blob check_operand) { - this.check_operand = check_operand; - return this; - } - - public void unsetCheck_operand() { - this.check_operand = null; - } - - /** Returns true if field check_operand is set (has been assigned a value) and false otherwise */ - public boolean isSetCheck_operand() { - return this.check_operand != null; - } - - public void setCheck_operandIsSet(boolean value) { - if (!value) { - this.check_operand = null; - } - } - - public int getMutate_listSize() { - return (this.mutate_list == null) ? 0 : this.mutate_list.size(); - } - - public java.util.Iterator getMutate_listIterator() { - return (this.mutate_list == null) ? null : this.mutate_list.iterator(); - } - - public void addToMutate_list(mutate elem) { - if (this.mutate_list == null) { - this.mutate_list = new java.util.ArrayList(); - } - this.mutate_list.add(elem); - } - - public java.util.List getMutate_list() { - return this.mutate_list; - } - - public check_and_mutate_request setMutate_list(java.util.List mutate_list) { - this.mutate_list = mutate_list; - return this; - } - - public void unsetMutate_list() { - this.mutate_list = null; - } - - /** Returns true if field mutate_list is set (has been assigned a value) and false otherwise */ - public boolean isSetMutate_list() { - return this.mutate_list != null; - } - - public void setMutate_listIsSet(boolean value) { - if (!value) { - this.mutate_list = null; - } - } - - public boolean isReturn_check_value() { - return this.return_check_value; - } - - public check_and_mutate_request setReturn_check_value(boolean return_check_value) { - this.return_check_value = return_check_value; - setReturn_check_valueIsSet(true); - return this; - } - - public void unsetReturn_check_value() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __RETURN_CHECK_VALUE_ISSET_ID); - } - - /** - * Returns true if field return_check_value is set (has been assigned a value) and false otherwise - */ - public boolean isSetReturn_check_value() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __RETURN_CHECK_VALUE_ISSET_ID); - } - - public void setReturn_check_valueIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit( - __isset_bitfield, __RETURN_CHECK_VALUE_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case HASH_KEY: - if (value == null) { - unsetHash_key(); - } else { - setHash_key((blob) value); - } - break; - - case CHECK_SORT_KEY: - if (value == null) { - unsetCheck_sort_key(); - } else { - setCheck_sort_key((blob) value); - } - break; - - case CHECK_TYPE: - if (value == null) { - unsetCheck_type(); - } else { - setCheck_type((cas_check_type) value); - } - break; - - case CHECK_OPERAND: - if (value == null) { - unsetCheck_operand(); - } else { - setCheck_operand((blob) value); - } - break; - - case MUTATE_LIST: - if (value == null) { - unsetMutate_list(); - } else { - setMutate_list((java.util.List) value); - } - break; - - case RETURN_CHECK_VALUE: - if (value == null) { - unsetReturn_check_value(); - } else { - setReturn_check_value((java.lang.Boolean) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case HASH_KEY: - return getHash_key(); - - case CHECK_SORT_KEY: - return getCheck_sort_key(); - - case CHECK_TYPE: - return getCheck_type(); - - case CHECK_OPERAND: - return getCheck_operand(); - - case MUTATE_LIST: - return getMutate_list(); - - case RETURN_CHECK_VALUE: - return isReturn_check_value(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case HASH_KEY: - return isSetHash_key(); - case CHECK_SORT_KEY: - return isSetCheck_sort_key(); - case CHECK_TYPE: - return isSetCheck_type(); - case CHECK_OPERAND: - return isSetCheck_operand(); - case MUTATE_LIST: - return isSetMutate_list(); - case RETURN_CHECK_VALUE: - return isSetReturn_check_value(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof check_and_mutate_request) - return this.equals((check_and_mutate_request) that); - return false; - } - - public boolean equals(check_and_mutate_request that) { - if (that == null) return false; - if (this == that) return true; - - boolean this_present_hash_key = true && this.isSetHash_key(); - boolean that_present_hash_key = true && that.isSetHash_key(); - if (this_present_hash_key || that_present_hash_key) { - if (!(this_present_hash_key && that_present_hash_key)) return false; - if (!this.hash_key.equals(that.hash_key)) return false; - } - - boolean this_present_check_sort_key = true && this.isSetCheck_sort_key(); - boolean that_present_check_sort_key = true && that.isSetCheck_sort_key(); - if (this_present_check_sort_key || that_present_check_sort_key) { - if (!(this_present_check_sort_key && that_present_check_sort_key)) return false; - if (!this.check_sort_key.equals(that.check_sort_key)) return false; - } - - boolean this_present_check_type = true && this.isSetCheck_type(); - boolean that_present_check_type = true && that.isSetCheck_type(); - if (this_present_check_type || that_present_check_type) { - if (!(this_present_check_type && that_present_check_type)) return false; - if (!this.check_type.equals(that.check_type)) return false; - } - - boolean this_present_check_operand = true && this.isSetCheck_operand(); - boolean that_present_check_operand = true && that.isSetCheck_operand(); - if (this_present_check_operand || that_present_check_operand) { - if (!(this_present_check_operand && that_present_check_operand)) return false; - if (!this.check_operand.equals(that.check_operand)) return false; - } - - boolean this_present_mutate_list = true && this.isSetMutate_list(); - boolean that_present_mutate_list = true && that.isSetMutate_list(); - if (this_present_mutate_list || that_present_mutate_list) { - if (!(this_present_mutate_list && that_present_mutate_list)) return false; - if (!this.mutate_list.equals(that.mutate_list)) return false; - } - - boolean this_present_return_check_value = true; - boolean that_present_return_check_value = true; - if (this_present_return_check_value || that_present_return_check_value) { - if (!(this_present_return_check_value && that_present_return_check_value)) return false; - if (this.return_check_value != that.return_check_value) return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetHash_key()) ? 131071 : 524287); - if (isSetHash_key()) hashCode = hashCode * 8191 + hash_key.hashCode(); - - hashCode = hashCode * 8191 + ((isSetCheck_sort_key()) ? 131071 : 524287); - if (isSetCheck_sort_key()) hashCode = hashCode * 8191 + check_sort_key.hashCode(); - - hashCode = hashCode * 8191 + ((isSetCheck_type()) ? 131071 : 524287); - if (isSetCheck_type()) hashCode = hashCode * 8191 + check_type.getValue(); - - hashCode = hashCode * 8191 + ((isSetCheck_operand()) ? 131071 : 524287); - if (isSetCheck_operand()) hashCode = hashCode * 8191 + check_operand.hashCode(); - - hashCode = hashCode * 8191 + ((isSetMutate_list()) ? 131071 : 524287); - if (isSetMutate_list()) hashCode = hashCode * 8191 + mutate_list.hashCode(); - - hashCode = hashCode * 8191 + ((return_check_value) ? 131071 : 524287); - - return hashCode; - } - - @Override - public int compareTo(check_and_mutate_request other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetHash_key()).compareTo(other.isSetHash_key()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetHash_key()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.hash_key, other.hash_key); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetCheck_sort_key()).compareTo(other.isSetCheck_sort_key()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetCheck_sort_key()) { - lastComparison = - org.apache.thrift.TBaseHelper.compareTo(this.check_sort_key, other.check_sort_key); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetCheck_type()).compareTo(other.isSetCheck_type()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetCheck_type()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.check_type, other.check_type); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetCheck_operand()).compareTo(other.isSetCheck_operand()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetCheck_operand()) { - lastComparison = - org.apache.thrift.TBaseHelper.compareTo(this.check_operand, other.check_operand); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetMutate_list()).compareTo(other.isSetMutate_list()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetMutate_list()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.mutate_list, other.mutate_list); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetReturn_check_value()) - .compareTo(other.isSetReturn_check_value()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReturn_check_value()) { - lastComparison = - org.apache.thrift.TBaseHelper.compareTo( - this.return_check_value, other.return_check_value); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("check_and_mutate_request("); - boolean first = true; - - sb.append("hash_key:"); - if (this.hash_key == null) { - sb.append("null"); - } else { - sb.append(this.hash_key); - } - first = false; - if (!first) sb.append(", "); - sb.append("check_sort_key:"); - if (this.check_sort_key == null) { - sb.append("null"); - } else { - sb.append(this.check_sort_key); - } - first = false; - if (!first) sb.append(", "); - sb.append("check_type:"); - if (this.check_type == null) { - sb.append("null"); - } else { - sb.append(this.check_type); - } - first = false; - if (!first) sb.append(", "); - sb.append("check_operand:"); - if (this.check_operand == null) { - sb.append("null"); - } else { - sb.append(this.check_operand); - } - first = false; - if (!first) sb.append(", "); - sb.append("mutate_list:"); - if (this.mutate_list == null) { - sb.append("null"); - } else { - sb.append(this.mutate_list); - } - first = false; - if (!first) sb.append(", "); - sb.append("return_check_value:"); - sb.append(this.return_check_value); - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (hash_key != null) { - hash_key.validate(); - } - if (check_sort_key != null) { - check_sort_key.validate(); - } - if (check_operand != null) { - check_operand.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, java.lang.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 check_and_mutate_requestStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public check_and_mutate_requestStandardScheme getScheme() { - return new check_and_mutate_requestStandardScheme(); - } - } - - private static class check_and_mutate_requestStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, check_and_mutate_request 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: // HASH_KEY - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.hash_key = new blob(); - struct.hash_key.read(iprot); - struct.setHash_keyIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // CHECK_SORT_KEY - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.check_sort_key = new blob(); - struct.check_sort_key.read(iprot); - struct.setCheck_sort_keyIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // CHECK_TYPE - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.check_type = cas_check_type.findByValue(iprot.readI32()); - struct.setCheck_typeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // CHECK_OPERAND - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.check_operand = new blob(); - struct.check_operand.read(iprot); - struct.setCheck_operandIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 5: // MUTATE_LIST - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list32 = iprot.readListBegin(); - struct.mutate_list = new java.util.ArrayList(_list32.size); - mutate _elem33; - for (int _i34 = 0; _i34 < _list32.size; ++_i34) { - _elem33 = new mutate(); - _elem33.read(iprot); - struct.mutate_list.add(_elem33); - } - iprot.readListEnd(); - } - struct.setMutate_listIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 6: // RETURN_CHECK_VALUE - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.return_check_value = iprot.readBool(); - struct.setReturn_check_valueIsSet(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, check_and_mutate_request struct) - throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.hash_key != null) { - oprot.writeFieldBegin(HASH_KEY_FIELD_DESC); - struct.hash_key.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.check_sort_key != null) { - oprot.writeFieldBegin(CHECK_SORT_KEY_FIELD_DESC); - struct.check_sort_key.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.check_type != null) { - oprot.writeFieldBegin(CHECK_TYPE_FIELD_DESC); - oprot.writeI32(struct.check_type.getValue()); - oprot.writeFieldEnd(); - } - if (struct.check_operand != null) { - oprot.writeFieldBegin(CHECK_OPERAND_FIELD_DESC); - struct.check_operand.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.mutate_list != null) { - oprot.writeFieldBegin(MUTATE_LIST_FIELD_DESC); - { - oprot.writeListBegin( - new org.apache.thrift.protocol.TList( - org.apache.thrift.protocol.TType.STRUCT, struct.mutate_list.size())); - for (mutate _iter35 : struct.mutate_list) { - _iter35.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(RETURN_CHECK_VALUE_FIELD_DESC); - oprot.writeBool(struct.return_check_value); - oprot.writeFieldEnd(); - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class check_and_mutate_requestTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public check_and_mutate_requestTupleScheme getScheme() { - return new check_and_mutate_requestTupleScheme(); - } - } - - private static class check_and_mutate_requestTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, check_and_mutate_request struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetHash_key()) { - optionals.set(0); - } - if (struct.isSetCheck_sort_key()) { - optionals.set(1); - } - if (struct.isSetCheck_type()) { - optionals.set(2); - } - if (struct.isSetCheck_operand()) { - optionals.set(3); - } - if (struct.isSetMutate_list()) { - optionals.set(4); - } - if (struct.isSetReturn_check_value()) { - optionals.set(5); - } - oprot.writeBitSet(optionals, 6); - if (struct.isSetHash_key()) { - struct.hash_key.write(oprot); - } - if (struct.isSetCheck_sort_key()) { - struct.check_sort_key.write(oprot); - } - if (struct.isSetCheck_type()) { - oprot.writeI32(struct.check_type.getValue()); - } - if (struct.isSetCheck_operand()) { - struct.check_operand.write(oprot); - } - if (struct.isSetMutate_list()) { - { - oprot.writeI32(struct.mutate_list.size()); - for (mutate _iter36 : struct.mutate_list) { - _iter36.write(oprot); - } - } - } - if (struct.isSetReturn_check_value()) { - oprot.writeBool(struct.return_check_value); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, check_and_mutate_request struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(6); - if (incoming.get(0)) { - struct.hash_key = new blob(); - struct.hash_key.read(iprot); - struct.setHash_keyIsSet(true); - } - if (incoming.get(1)) { - struct.check_sort_key = new blob(); - struct.check_sort_key.read(iprot); - struct.setCheck_sort_keyIsSet(true); - } - if (incoming.get(2)) { - struct.check_type = cas_check_type.findByValue(iprot.readI32()); - struct.setCheck_typeIsSet(true); - } - if (incoming.get(3)) { - struct.check_operand = new blob(); - struct.check_operand.read(iprot); - struct.setCheck_operandIsSet(true); - } - if (incoming.get(4)) { - { - org.apache.thrift.protocol.TList _list37 = - new org.apache.thrift.protocol.TList( - org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.mutate_list = new java.util.ArrayList(_list37.size); - mutate _elem38; - for (int _i39 = 0; _i39 < _list37.size; ++_i39) { - _elem38 = new mutate(); - _elem38.read(iprot); - struct.mutate_list.add(_elem38); - } - } - struct.setMutate_listIsSet(true); - } - if (incoming.get(5)) { - struct.return_check_value = iprot.readBool(); - struct.setReturn_check_valueIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } -} diff --git a/java-client/src/main/java/org/apache/pegasus/apps/check_and_mutate_response.java b/java-client/src/main/java/org/apache/pegasus/apps/check_and_mutate_response.java deleted file mode 100644 index 2f4a0ead48..0000000000 --- a/java-client/src/main/java/org/apache/pegasus/apps/check_and_mutate_response.java +++ /dev/null @@ -1,1174 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.11.0) - * - *

DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * - * @generated - */ -package org.apache.pegasus.apps; - -import org.apache.pegasus.base.blob; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated( - value = "Autogenerated by Thrift Compiler (0.11.0)", - date = "2020-04-13") -public class check_and_mutate_response - implements org.apache.thrift.TBase< - check_and_mutate_response, check_and_mutate_response._Fields>, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("check_and_mutate_response"); - - private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "error", org.apache.thrift.protocol.TType.I32, (short) 1); - private static final org.apache.thrift.protocol.TField CHECK_VALUE_RETURNED_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "check_value_returned", org.apache.thrift.protocol.TType.BOOL, (short) 2); - private static final org.apache.thrift.protocol.TField CHECK_VALUE_EXIST_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "check_value_exist", org.apache.thrift.protocol.TType.BOOL, (short) 3); - private static final org.apache.thrift.protocol.TField CHECK_VALUE_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "check_value", org.apache.thrift.protocol.TType.STRUCT, (short) 4); - private static final org.apache.thrift.protocol.TField APP_ID_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "app_id", org.apache.thrift.protocol.TType.I32, (short) 5); - private static final org.apache.thrift.protocol.TField PARTITION_INDEX_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "partition_index", org.apache.thrift.protocol.TType.I32, (short) 6); - private static final org.apache.thrift.protocol.TField DECREE_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "decree", org.apache.thrift.protocol.TType.I64, (short) 7); - private static final org.apache.thrift.protocol.TField SERVER_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "server", org.apache.thrift.protocol.TType.STRING, (short) 8); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new check_and_mutate_responseStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new check_and_mutate_responseTupleSchemeFactory(); - - public int error; // required - public boolean check_value_returned; // required - public boolean check_value_exist; // required - public blob check_value; // required - public int app_id; // required - public int partition_index; // required - public long decree; // required - public java.lang.String server; // 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 { - ERROR((short) 1, "error"), - CHECK_VALUE_RETURNED((short) 2, "check_value_returned"), - CHECK_VALUE_EXIST((short) 3, "check_value_exist"), - CHECK_VALUE((short) 4, "check_value"), - APP_ID((short) 5, "app_id"), - PARTITION_INDEX((short) 6, "partition_index"), - DECREE((short) 7, "decree"), - SERVER((short) 8, "server"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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: // ERROR - return ERROR; - case 2: // CHECK_VALUE_RETURNED - return CHECK_VALUE_RETURNED; - case 3: // CHECK_VALUE_EXIST - return CHECK_VALUE_EXIST; - case 4: // CHECK_VALUE - return CHECK_VALUE; - case 5: // APP_ID - return APP_ID; - case 6: // PARTITION_INDEX - return PARTITION_INDEX; - case 7: // DECREE - return DECREE; - case 8: // SERVER - return SERVER; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __ERROR_ISSET_ID = 0; - private static final int __CHECK_VALUE_RETURNED_ISSET_ID = 1; - private static final int __CHECK_VALUE_EXIST_ISSET_ID = 2; - private static final int __APP_ID_ISSET_ID = 3; - private static final int __PARTITION_INDEX_ISSET_ID = 4; - private static final int __DECREE_ISSET_ID = 5; - private byte __isset_bitfield = 0; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put( - _Fields.ERROR, - new org.apache.thrift.meta_data.FieldMetaData( - "error", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I32))); - tmpMap.put( - _Fields.CHECK_VALUE_RETURNED, - new org.apache.thrift.meta_data.FieldMetaData( - "check_value_returned", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.BOOL))); - tmpMap.put( - _Fields.CHECK_VALUE_EXIST, - new org.apache.thrift.meta_data.FieldMetaData( - "check_value_exist", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.BOOL))); - tmpMap.put( - _Fields.CHECK_VALUE, - new org.apache.thrift.meta_data.FieldMetaData( - "check_value", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData( - org.apache.thrift.protocol.TType.STRUCT, blob.class))); - tmpMap.put( - _Fields.APP_ID, - new org.apache.thrift.meta_data.FieldMetaData( - "app_id", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I32))); - tmpMap.put( - _Fields.PARTITION_INDEX, - new org.apache.thrift.meta_data.FieldMetaData( - "partition_index", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I32))); - tmpMap.put( - _Fields.DECREE, - new org.apache.thrift.meta_data.FieldMetaData( - "decree", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I64))); - tmpMap.put( - _Fields.SERVER, - new org.apache.thrift.meta_data.FieldMetaData( - "server", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.STRING))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap( - check_and_mutate_response.class, metaDataMap); - } - - public check_and_mutate_response() {} - - public check_and_mutate_response( - int error, - boolean check_value_returned, - boolean check_value_exist, - blob check_value, - int app_id, - int partition_index, - long decree, - java.lang.String server) { - this(); - this.error = error; - setErrorIsSet(true); - this.check_value_returned = check_value_returned; - setCheck_value_returnedIsSet(true); - this.check_value_exist = check_value_exist; - setCheck_value_existIsSet(true); - this.check_value = check_value; - this.app_id = app_id; - setApp_idIsSet(true); - this.partition_index = partition_index; - setPartition_indexIsSet(true); - this.decree = decree; - setDecreeIsSet(true); - this.server = server; - } - - /** Performs a deep copy on other. */ - public check_and_mutate_response(check_and_mutate_response other) { - __isset_bitfield = other.__isset_bitfield; - this.error = other.error; - this.check_value_returned = other.check_value_returned; - this.check_value_exist = other.check_value_exist; - if (other.isSetCheck_value()) { - this.check_value = new blob(other.check_value); - } - this.app_id = other.app_id; - this.partition_index = other.partition_index; - this.decree = other.decree; - if (other.isSetServer()) { - this.server = other.server; - } - } - - public check_and_mutate_response deepCopy() { - return new check_and_mutate_response(this); - } - - @Override - public void clear() { - setErrorIsSet(false); - this.error = 0; - setCheck_value_returnedIsSet(false); - this.check_value_returned = false; - setCheck_value_existIsSet(false); - this.check_value_exist = false; - this.check_value = null; - setApp_idIsSet(false); - this.app_id = 0; - setPartition_indexIsSet(false); - this.partition_index = 0; - setDecreeIsSet(false); - this.decree = 0; - this.server = null; - } - - public int getError() { - return this.error; - } - - public check_and_mutate_response setError(int error) { - this.error = error; - setErrorIsSet(true); - return this; - } - - public void unsetError() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ERROR_ISSET_ID); - } - - /** Returns true if field error is set (has been assigned a value) and false otherwise */ - public boolean isSetError() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ERROR_ISSET_ID); - } - - public void setErrorIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ERROR_ISSET_ID, value); - } - - public boolean isCheck_value_returned() { - return this.check_value_returned; - } - - public check_and_mutate_response setCheck_value_returned(boolean check_value_returned) { - this.check_value_returned = check_value_returned; - setCheck_value_returnedIsSet(true); - return this; - } - - public void unsetCheck_value_returned() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __CHECK_VALUE_RETURNED_ISSET_ID); - } - - /** - * Returns true if field check_value_returned is set (has been assigned a value) and false - * otherwise - */ - public boolean isSetCheck_value_returned() { - return org.apache.thrift.EncodingUtils.testBit( - __isset_bitfield, __CHECK_VALUE_RETURNED_ISSET_ID); - } - - public void setCheck_value_returnedIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit( - __isset_bitfield, __CHECK_VALUE_RETURNED_ISSET_ID, value); - } - - public boolean isCheck_value_exist() { - return this.check_value_exist; - } - - public check_and_mutate_response setCheck_value_exist(boolean check_value_exist) { - this.check_value_exist = check_value_exist; - setCheck_value_existIsSet(true); - return this; - } - - public void unsetCheck_value_exist() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __CHECK_VALUE_EXIST_ISSET_ID); - } - - /** - * Returns true if field check_value_exist is set (has been assigned a value) and false otherwise - */ - public boolean isSetCheck_value_exist() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __CHECK_VALUE_EXIST_ISSET_ID); - } - - public void setCheck_value_existIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit( - __isset_bitfield, __CHECK_VALUE_EXIST_ISSET_ID, value); - } - - public blob getCheck_value() { - return this.check_value; - } - - public check_and_mutate_response setCheck_value(blob check_value) { - this.check_value = check_value; - return this; - } - - public void unsetCheck_value() { - this.check_value = null; - } - - /** Returns true if field check_value is set (has been assigned a value) and false otherwise */ - public boolean isSetCheck_value() { - return this.check_value != null; - } - - public void setCheck_valueIsSet(boolean value) { - if (!value) { - this.check_value = null; - } - } - - public int getApp_id() { - return this.app_id; - } - - public check_and_mutate_response setApp_id(int app_id) { - this.app_id = app_id; - setApp_idIsSet(true); - return this; - } - - public void unsetApp_id() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __APP_ID_ISSET_ID); - } - - /** Returns true if field app_id is set (has been assigned a value) and false otherwise */ - public boolean isSetApp_id() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __APP_ID_ISSET_ID); - } - - public void setApp_idIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __APP_ID_ISSET_ID, value); - } - - public int getPartition_index() { - return this.partition_index; - } - - public check_and_mutate_response setPartition_index(int partition_index) { - this.partition_index = partition_index; - setPartition_indexIsSet(true); - return this; - } - - public void unsetPartition_index() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __PARTITION_INDEX_ISSET_ID); - } - - /** - * Returns true if field partition_index is set (has been assigned a value) and false otherwise - */ - public boolean isSetPartition_index() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __PARTITION_INDEX_ISSET_ID); - } - - public void setPartition_indexIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __PARTITION_INDEX_ISSET_ID, value); - } - - public long getDecree() { - return this.decree; - } - - public check_and_mutate_response setDecree(long decree) { - this.decree = decree; - setDecreeIsSet(true); - return this; - } - - public void unsetDecree() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __DECREE_ISSET_ID); - } - - /** Returns true if field decree is set (has been assigned a value) and false otherwise */ - public boolean isSetDecree() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __DECREE_ISSET_ID); - } - - public void setDecreeIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __DECREE_ISSET_ID, value); - } - - public java.lang.String getServer() { - return this.server; - } - - public check_and_mutate_response setServer(java.lang.String server) { - this.server = server; - return this; - } - - public void unsetServer() { - this.server = null; - } - - /** Returns true if field server is set (has been assigned a value) and false otherwise */ - public boolean isSetServer() { - return this.server != null; - } - - public void setServerIsSet(boolean value) { - if (!value) { - this.server = null; - } - } - - public void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case ERROR: - if (value == null) { - unsetError(); - } else { - setError((java.lang.Integer) value); - } - break; - - case CHECK_VALUE_RETURNED: - if (value == null) { - unsetCheck_value_returned(); - } else { - setCheck_value_returned((java.lang.Boolean) value); - } - break; - - case CHECK_VALUE_EXIST: - if (value == null) { - unsetCheck_value_exist(); - } else { - setCheck_value_exist((java.lang.Boolean) value); - } - break; - - case CHECK_VALUE: - if (value == null) { - unsetCheck_value(); - } else { - setCheck_value((blob) value); - } - break; - - case APP_ID: - if (value == null) { - unsetApp_id(); - } else { - setApp_id((java.lang.Integer) value); - } - break; - - case PARTITION_INDEX: - if (value == null) { - unsetPartition_index(); - } else { - setPartition_index((java.lang.Integer) value); - } - break; - - case DECREE: - if (value == null) { - unsetDecree(); - } else { - setDecree((java.lang.Long) value); - } - break; - - case SERVER: - if (value == null) { - unsetServer(); - } else { - setServer((java.lang.String) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case ERROR: - return getError(); - - case CHECK_VALUE_RETURNED: - return isCheck_value_returned(); - - case CHECK_VALUE_EXIST: - return isCheck_value_exist(); - - case CHECK_VALUE: - return getCheck_value(); - - case APP_ID: - return getApp_id(); - - case PARTITION_INDEX: - return getPartition_index(); - - case DECREE: - return getDecree(); - - case SERVER: - return getServer(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case ERROR: - return isSetError(); - case CHECK_VALUE_RETURNED: - return isSetCheck_value_returned(); - case CHECK_VALUE_EXIST: - return isSetCheck_value_exist(); - case CHECK_VALUE: - return isSetCheck_value(); - case APP_ID: - return isSetApp_id(); - case PARTITION_INDEX: - return isSetPartition_index(); - case DECREE: - return isSetDecree(); - case SERVER: - return isSetServer(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof check_and_mutate_response) - return this.equals((check_and_mutate_response) that); - return false; - } - - public boolean equals(check_and_mutate_response that) { - if (that == null) return false; - if (this == that) return true; - - boolean this_present_error = true; - boolean that_present_error = true; - if (this_present_error || that_present_error) { - if (!(this_present_error && that_present_error)) return false; - if (this.error != that.error) return false; - } - - boolean this_present_check_value_returned = true; - boolean that_present_check_value_returned = true; - if (this_present_check_value_returned || that_present_check_value_returned) { - if (!(this_present_check_value_returned && that_present_check_value_returned)) return false; - if (this.check_value_returned != that.check_value_returned) return false; - } - - boolean this_present_check_value_exist = true; - boolean that_present_check_value_exist = true; - if (this_present_check_value_exist || that_present_check_value_exist) { - if (!(this_present_check_value_exist && that_present_check_value_exist)) return false; - if (this.check_value_exist != that.check_value_exist) return false; - } - - boolean this_present_check_value = true && this.isSetCheck_value(); - boolean that_present_check_value = true && that.isSetCheck_value(); - if (this_present_check_value || that_present_check_value) { - if (!(this_present_check_value && that_present_check_value)) return false; - if (!this.check_value.equals(that.check_value)) return false; - } - - boolean this_present_app_id = true; - boolean that_present_app_id = true; - if (this_present_app_id || that_present_app_id) { - if (!(this_present_app_id && that_present_app_id)) return false; - if (this.app_id != that.app_id) return false; - } - - boolean this_present_partition_index = true; - boolean that_present_partition_index = true; - if (this_present_partition_index || that_present_partition_index) { - if (!(this_present_partition_index && that_present_partition_index)) return false; - if (this.partition_index != that.partition_index) return false; - } - - boolean this_present_decree = true; - boolean that_present_decree = true; - if (this_present_decree || that_present_decree) { - if (!(this_present_decree && that_present_decree)) return false; - if (this.decree != that.decree) return false; - } - - boolean this_present_server = true && this.isSetServer(); - boolean that_present_server = true && that.isSetServer(); - if (this_present_server || that_present_server) { - if (!(this_present_server && that_present_server)) return false; - if (!this.server.equals(that.server)) return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + error; - - hashCode = hashCode * 8191 + ((check_value_returned) ? 131071 : 524287); - - hashCode = hashCode * 8191 + ((check_value_exist) ? 131071 : 524287); - - hashCode = hashCode * 8191 + ((isSetCheck_value()) ? 131071 : 524287); - if (isSetCheck_value()) hashCode = hashCode * 8191 + check_value.hashCode(); - - hashCode = hashCode * 8191 + app_id; - - hashCode = hashCode * 8191 + partition_index; - - hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(decree); - - hashCode = hashCode * 8191 + ((isSetServer()) ? 131071 : 524287); - if (isSetServer()) hashCode = hashCode * 8191 + server.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(check_and_mutate_response other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetError()).compareTo(other.isSetError()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetError()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetCheck_value_returned()) - .compareTo(other.isSetCheck_value_returned()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetCheck_value_returned()) { - lastComparison = - org.apache.thrift.TBaseHelper.compareTo( - this.check_value_returned, other.check_value_returned); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetCheck_value_exist()) - .compareTo(other.isSetCheck_value_exist()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetCheck_value_exist()) { - lastComparison = - org.apache.thrift.TBaseHelper.compareTo(this.check_value_exist, other.check_value_exist); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetCheck_value()).compareTo(other.isSetCheck_value()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetCheck_value()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.check_value, other.check_value); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetApp_id()).compareTo(other.isSetApp_id()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetApp_id()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.app_id, other.app_id); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetPartition_index()).compareTo(other.isSetPartition_index()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetPartition_index()) { - lastComparison = - org.apache.thrift.TBaseHelper.compareTo(this.partition_index, other.partition_index); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetDecree()).compareTo(other.isSetDecree()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetDecree()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.decree, other.decree); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetServer()).compareTo(other.isSetServer()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetServer()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.server, other.server); - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("check_and_mutate_response("); - boolean first = true; - - sb.append("error:"); - sb.append(this.error); - first = false; - if (!first) sb.append(", "); - sb.append("check_value_returned:"); - sb.append(this.check_value_returned); - first = false; - if (!first) sb.append(", "); - sb.append("check_value_exist:"); - sb.append(this.check_value_exist); - first = false; - if (!first) sb.append(", "); - sb.append("check_value:"); - if (this.check_value == null) { - sb.append("null"); - } else { - sb.append(this.check_value); - } - first = false; - if (!first) sb.append(", "); - sb.append("app_id:"); - sb.append(this.app_id); - first = false; - if (!first) sb.append(", "); - sb.append("partition_index:"); - sb.append(this.partition_index); - first = false; - if (!first) sb.append(", "); - sb.append("decree:"); - sb.append(this.decree); - first = false; - if (!first) sb.append(", "); - sb.append("server:"); - if (this.server == null) { - sb.append("null"); - } else { - sb.append(this.server); - } - 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 (check_value != null) { - check_value.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, java.lang.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 check_and_mutate_responseStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public check_and_mutate_responseStandardScheme getScheme() { - return new check_and_mutate_responseStandardScheme(); - } - } - - private static class check_and_mutate_responseStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, check_and_mutate_response 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: // ERROR - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.error = iprot.readI32(); - struct.setErrorIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // CHECK_VALUE_RETURNED - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.check_value_returned = iprot.readBool(); - struct.setCheck_value_returnedIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // CHECK_VALUE_EXIST - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.check_value_exist = iprot.readBool(); - struct.setCheck_value_existIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // CHECK_VALUE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.check_value = new blob(); - struct.check_value.read(iprot); - struct.setCheck_valueIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 5: // APP_ID - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.app_id = iprot.readI32(); - struct.setApp_idIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 6: // PARTITION_INDEX - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.partition_index = iprot.readI32(); - struct.setPartition_indexIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 7: // DECREE - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.decree = iprot.readI64(); - struct.setDecreeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 8: // SERVER - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.server = iprot.readString(); - struct.setServerIsSet(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, check_and_mutate_response struct) - throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(ERROR_FIELD_DESC); - oprot.writeI32(struct.error); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(CHECK_VALUE_RETURNED_FIELD_DESC); - oprot.writeBool(struct.check_value_returned); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(CHECK_VALUE_EXIST_FIELD_DESC); - oprot.writeBool(struct.check_value_exist); - oprot.writeFieldEnd(); - if (struct.check_value != null) { - oprot.writeFieldBegin(CHECK_VALUE_FIELD_DESC); - struct.check_value.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(APP_ID_FIELD_DESC); - oprot.writeI32(struct.app_id); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(PARTITION_INDEX_FIELD_DESC); - oprot.writeI32(struct.partition_index); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(DECREE_FIELD_DESC); - oprot.writeI64(struct.decree); - oprot.writeFieldEnd(); - if (struct.server != null) { - oprot.writeFieldBegin(SERVER_FIELD_DESC); - oprot.writeString(struct.server); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class check_and_mutate_responseTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public check_and_mutate_responseTupleScheme getScheme() { - return new check_and_mutate_responseTupleScheme(); - } - } - - private static class check_and_mutate_responseTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, check_and_mutate_response struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetError()) { - optionals.set(0); - } - if (struct.isSetCheck_value_returned()) { - optionals.set(1); - } - if (struct.isSetCheck_value_exist()) { - optionals.set(2); - } - if (struct.isSetCheck_value()) { - optionals.set(3); - } - if (struct.isSetApp_id()) { - optionals.set(4); - } - if (struct.isSetPartition_index()) { - optionals.set(5); - } - if (struct.isSetDecree()) { - optionals.set(6); - } - if (struct.isSetServer()) { - optionals.set(7); - } - oprot.writeBitSet(optionals, 8); - if (struct.isSetError()) { - oprot.writeI32(struct.error); - } - if (struct.isSetCheck_value_returned()) { - oprot.writeBool(struct.check_value_returned); - } - if (struct.isSetCheck_value_exist()) { - oprot.writeBool(struct.check_value_exist); - } - if (struct.isSetCheck_value()) { - struct.check_value.write(oprot); - } - if (struct.isSetApp_id()) { - oprot.writeI32(struct.app_id); - } - if (struct.isSetPartition_index()) { - oprot.writeI32(struct.partition_index); - } - if (struct.isSetDecree()) { - oprot.writeI64(struct.decree); - } - if (struct.isSetServer()) { - oprot.writeString(struct.server); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, check_and_mutate_response struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(8); - if (incoming.get(0)) { - struct.error = iprot.readI32(); - struct.setErrorIsSet(true); - } - if (incoming.get(1)) { - struct.check_value_returned = iprot.readBool(); - struct.setCheck_value_returnedIsSet(true); - } - if (incoming.get(2)) { - struct.check_value_exist = iprot.readBool(); - struct.setCheck_value_existIsSet(true); - } - if (incoming.get(3)) { - struct.check_value = new blob(); - struct.check_value.read(iprot); - struct.setCheck_valueIsSet(true); - } - if (incoming.get(4)) { - struct.app_id = iprot.readI32(); - struct.setApp_idIsSet(true); - } - if (incoming.get(5)) { - struct.partition_index = iprot.readI32(); - struct.setPartition_indexIsSet(true); - } - if (incoming.get(6)) { - struct.decree = iprot.readI64(); - struct.setDecreeIsSet(true); - } - if (incoming.get(7)) { - struct.server = iprot.readString(); - struct.setServerIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } -} diff --git a/java-client/src/main/java/org/apache/pegasus/apps/check_and_set_request.java b/java-client/src/main/java/org/apache/pegasus/apps/check_and_set_request.java deleted file mode 100644 index 58b355a650..0000000000 --- a/java-client/src/main/java/org/apache/pegasus/apps/check_and_set_request.java +++ /dev/null @@ -1,1331 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.11.0) - * - *

DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * - * @generated - */ -package org.apache.pegasus.apps; - -import org.apache.pegasus.base.blob; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated( - value = "Autogenerated by Thrift Compiler (0.11.0)", - date = "2020-04-13") -public class check_and_set_request - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("check_and_set_request"); - - private static final org.apache.thrift.protocol.TField HASH_KEY_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "hash_key", org.apache.thrift.protocol.TType.STRUCT, (short) 1); - private static final org.apache.thrift.protocol.TField CHECK_SORT_KEY_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "check_sort_key", org.apache.thrift.protocol.TType.STRUCT, (short) 2); - private static final org.apache.thrift.protocol.TField CHECK_TYPE_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "check_type", org.apache.thrift.protocol.TType.I32, (short) 3); - private static final org.apache.thrift.protocol.TField CHECK_OPERAND_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "check_operand", org.apache.thrift.protocol.TType.STRUCT, (short) 4); - private static final org.apache.thrift.protocol.TField SET_DIFF_SORT_KEY_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "set_diff_sort_key", org.apache.thrift.protocol.TType.BOOL, (short) 5); - private static final org.apache.thrift.protocol.TField SET_SORT_KEY_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "set_sort_key", org.apache.thrift.protocol.TType.STRUCT, (short) 6); - private static final org.apache.thrift.protocol.TField SET_VALUE_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "set_value", org.apache.thrift.protocol.TType.STRUCT, (short) 7); - private static final org.apache.thrift.protocol.TField SET_EXPIRE_TS_SECONDS_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "set_expire_ts_seconds", org.apache.thrift.protocol.TType.I32, (short) 8); - private static final org.apache.thrift.protocol.TField RETURN_CHECK_VALUE_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "return_check_value", org.apache.thrift.protocol.TType.BOOL, (short) 9); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new check_and_set_requestStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new check_and_set_requestTupleSchemeFactory(); - - public blob hash_key; // required - public blob check_sort_key; // required - /** @see cas_check_type */ - public cas_check_type check_type; // required - - public blob check_operand; // required - public boolean set_diff_sort_key; // required - public blob set_sort_key; // required - public blob set_value; // required - public int set_expire_ts_seconds; // required - public boolean return_check_value; // required - - /** - * The set of fields this struct contains, along with convenience methods for finding and - * manipulating them. - */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - HASH_KEY((short) 1, "hash_key"), - CHECK_SORT_KEY((short) 2, "check_sort_key"), - /** @see cas_check_type */ - CHECK_TYPE((short) 3, "check_type"), - CHECK_OPERAND((short) 4, "check_operand"), - SET_DIFF_SORT_KEY((short) 5, "set_diff_sort_key"), - SET_SORT_KEY((short) 6, "set_sort_key"), - SET_VALUE((short) 7, "set_value"), - SET_EXPIRE_TS_SECONDS((short) 8, "set_expire_ts_seconds"), - RETURN_CHECK_VALUE((short) 9, "return_check_value"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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: // HASH_KEY - return HASH_KEY; - case 2: // CHECK_SORT_KEY - return CHECK_SORT_KEY; - case 3: // CHECK_TYPE - return CHECK_TYPE; - case 4: // CHECK_OPERAND - return CHECK_OPERAND; - case 5: // SET_DIFF_SORT_KEY - return SET_DIFF_SORT_KEY; - case 6: // SET_SORT_KEY - return SET_SORT_KEY; - case 7: // SET_VALUE - return SET_VALUE; - case 8: // SET_EXPIRE_TS_SECONDS - return SET_EXPIRE_TS_SECONDS; - case 9: // RETURN_CHECK_VALUE - return RETURN_CHECK_VALUE; - default: - return null; - } - } - - /** Find the _Fields constant that matches fieldId, throwing an exception if it is not found. */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) - throw new java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __SET_DIFF_SORT_KEY_ISSET_ID = 0; - private static final int __SET_EXPIRE_TS_SECONDS_ISSET_ID = 1; - private static final int __RETURN_CHECK_VALUE_ISSET_ID = 2; - private byte __isset_bitfield = 0; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put( - _Fields.HASH_KEY, - new org.apache.thrift.meta_data.FieldMetaData( - "hash_key", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData( - org.apache.thrift.protocol.TType.STRUCT, blob.class))); - tmpMap.put( - _Fields.CHECK_SORT_KEY, - new org.apache.thrift.meta_data.FieldMetaData( - "check_sort_key", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData( - org.apache.thrift.protocol.TType.STRUCT, blob.class))); - tmpMap.put( - _Fields.CHECK_TYPE, - new org.apache.thrift.meta_data.FieldMetaData( - "check_type", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.EnumMetaData( - org.apache.thrift.protocol.TType.ENUM, cas_check_type.class))); - tmpMap.put( - _Fields.CHECK_OPERAND, - new org.apache.thrift.meta_data.FieldMetaData( - "check_operand", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData( - org.apache.thrift.protocol.TType.STRUCT, blob.class))); - tmpMap.put( - _Fields.SET_DIFF_SORT_KEY, - new org.apache.thrift.meta_data.FieldMetaData( - "set_diff_sort_key", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.BOOL))); - tmpMap.put( - _Fields.SET_SORT_KEY, - new org.apache.thrift.meta_data.FieldMetaData( - "set_sort_key", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData( - org.apache.thrift.protocol.TType.STRUCT, blob.class))); - tmpMap.put( - _Fields.SET_VALUE, - new org.apache.thrift.meta_data.FieldMetaData( - "set_value", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData( - org.apache.thrift.protocol.TType.STRUCT, blob.class))); - tmpMap.put( - _Fields.SET_EXPIRE_TS_SECONDS, - new org.apache.thrift.meta_data.FieldMetaData( - "set_expire_ts_seconds", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I32))); - tmpMap.put( - _Fields.RETURN_CHECK_VALUE, - new org.apache.thrift.meta_data.FieldMetaData( - "return_check_value", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.BOOL))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap( - check_and_set_request.class, metaDataMap); - } - - public check_and_set_request() {} - - public check_and_set_request( - blob hash_key, - blob check_sort_key, - cas_check_type check_type, - blob check_operand, - boolean set_diff_sort_key, - blob set_sort_key, - blob set_value, - int set_expire_ts_seconds, - boolean return_check_value) { - this(); - this.hash_key = hash_key; - this.check_sort_key = check_sort_key; - this.check_type = check_type; - this.check_operand = check_operand; - this.set_diff_sort_key = set_diff_sort_key; - setSet_diff_sort_keyIsSet(true); - this.set_sort_key = set_sort_key; - this.set_value = set_value; - this.set_expire_ts_seconds = set_expire_ts_seconds; - setSet_expire_ts_secondsIsSet(true); - this.return_check_value = return_check_value; - setReturn_check_valueIsSet(true); - } - - /** Performs a deep copy on other. */ - public check_and_set_request(check_and_set_request other) { - __isset_bitfield = other.__isset_bitfield; - if (other.isSetHash_key()) { - this.hash_key = new blob(other.hash_key); - } - if (other.isSetCheck_sort_key()) { - this.check_sort_key = new blob(other.check_sort_key); - } - if (other.isSetCheck_type()) { - this.check_type = other.check_type; - } - if (other.isSetCheck_operand()) { - this.check_operand = new blob(other.check_operand); - } - this.set_diff_sort_key = other.set_diff_sort_key; - if (other.isSetSet_sort_key()) { - this.set_sort_key = new blob(other.set_sort_key); - } - if (other.isSetSet_value()) { - this.set_value = new blob(other.set_value); - } - this.set_expire_ts_seconds = other.set_expire_ts_seconds; - this.return_check_value = other.return_check_value; - } - - public check_and_set_request deepCopy() { - return new check_and_set_request(this); - } - - @Override - public void clear() { - this.hash_key = null; - this.check_sort_key = null; - this.check_type = null; - this.check_operand = null; - setSet_diff_sort_keyIsSet(false); - this.set_diff_sort_key = false; - this.set_sort_key = null; - this.set_value = null; - setSet_expire_ts_secondsIsSet(false); - this.set_expire_ts_seconds = 0; - setReturn_check_valueIsSet(false); - this.return_check_value = false; - } - - public blob getHash_key() { - return this.hash_key; - } - - public check_and_set_request setHash_key(blob hash_key) { - this.hash_key = hash_key; - return this; - } - - public void unsetHash_key() { - this.hash_key = null; - } - - /** Returns true if field hash_key is set (has been assigned a value) and false otherwise */ - public boolean isSetHash_key() { - return this.hash_key != null; - } - - public void setHash_keyIsSet(boolean value) { - if (!value) { - this.hash_key = null; - } - } - - public blob getCheck_sort_key() { - return this.check_sort_key; - } - - public check_and_set_request setCheck_sort_key(blob check_sort_key) { - this.check_sort_key = check_sort_key; - return this; - } - - public void unsetCheck_sort_key() { - this.check_sort_key = null; - } - - /** Returns true if field check_sort_key is set (has been assigned a value) and false otherwise */ - public boolean isSetCheck_sort_key() { - return this.check_sort_key != null; - } - - public void setCheck_sort_keyIsSet(boolean value) { - if (!value) { - this.check_sort_key = null; - } - } - - /** @see cas_check_type */ - public cas_check_type getCheck_type() { - return this.check_type; - } - - /** @see cas_check_type */ - public check_and_set_request setCheck_type(cas_check_type check_type) { - this.check_type = check_type; - return this; - } - - public void unsetCheck_type() { - this.check_type = null; - } - - /** Returns true if field check_type is set (has been assigned a value) and false otherwise */ - public boolean isSetCheck_type() { - return this.check_type != null; - } - - public void setCheck_typeIsSet(boolean value) { - if (!value) { - this.check_type = null; - } - } - - public blob getCheck_operand() { - return this.check_operand; - } - - public check_and_set_request setCheck_operand(blob check_operand) { - this.check_operand = check_operand; - return this; - } - - public void unsetCheck_operand() { - this.check_operand = null; - } - - /** Returns true if field check_operand is set (has been assigned a value) and false otherwise */ - public boolean isSetCheck_operand() { - return this.check_operand != null; - } - - public void setCheck_operandIsSet(boolean value) { - if (!value) { - this.check_operand = null; - } - } - - public boolean isSet_diff_sort_key() { - return this.set_diff_sort_key; - } - - public check_and_set_request setSet_diff_sort_key(boolean set_diff_sort_key) { - this.set_diff_sort_key = set_diff_sort_key; - setSet_diff_sort_keyIsSet(true); - return this; - } - - public void unsetSet_diff_sort_key() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SET_DIFF_SORT_KEY_ISSET_ID); - } - - /** - * Returns true if field set_diff_sort_key is set (has been assigned a value) and false otherwise - */ - public boolean isSetSet_diff_sort_key() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SET_DIFF_SORT_KEY_ISSET_ID); - } - - public void setSet_diff_sort_keyIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit( - __isset_bitfield, __SET_DIFF_SORT_KEY_ISSET_ID, value); - } - - public blob getSet_sort_key() { - return this.set_sort_key; - } - - public check_and_set_request setSet_sort_key(blob set_sort_key) { - this.set_sort_key = set_sort_key; - return this; - } - - public void unsetSet_sort_key() { - this.set_sort_key = null; - } - - /** Returns true if field set_sort_key is set (has been assigned a value) and false otherwise */ - public boolean isSetSet_sort_key() { - return this.set_sort_key != null; - } - - public void setSet_sort_keyIsSet(boolean value) { - if (!value) { - this.set_sort_key = null; - } - } - - public blob getSet_value() { - return this.set_value; - } - - public check_and_set_request setSet_value(blob set_value) { - this.set_value = set_value; - return this; - } - - public void unsetSet_value() { - this.set_value = null; - } - - /** Returns true if field set_value is set (has been assigned a value) and false otherwise */ - public boolean isSetSet_value() { - return this.set_value != null; - } - - public void setSet_valueIsSet(boolean value) { - if (!value) { - this.set_value = null; - } - } - - public int getSet_expire_ts_seconds() { - return this.set_expire_ts_seconds; - } - - public check_and_set_request setSet_expire_ts_seconds(int set_expire_ts_seconds) { - this.set_expire_ts_seconds = set_expire_ts_seconds; - setSet_expire_ts_secondsIsSet(true); - return this; - } - - public void unsetSet_expire_ts_seconds() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit( - __isset_bitfield, __SET_EXPIRE_TS_SECONDS_ISSET_ID); - } - - /** - * Returns true if field set_expire_ts_seconds is set (has been assigned a value) and false - * otherwise - */ - public boolean isSetSet_expire_ts_seconds() { - return org.apache.thrift.EncodingUtils.testBit( - __isset_bitfield, __SET_EXPIRE_TS_SECONDS_ISSET_ID); - } - - public void setSet_expire_ts_secondsIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit( - __isset_bitfield, __SET_EXPIRE_TS_SECONDS_ISSET_ID, value); - } - - public boolean isReturn_check_value() { - return this.return_check_value; - } - - public check_and_set_request setReturn_check_value(boolean return_check_value) { - this.return_check_value = return_check_value; - setReturn_check_valueIsSet(true); - return this; - } - - public void unsetReturn_check_value() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __RETURN_CHECK_VALUE_ISSET_ID); - } - - /** - * Returns true if field return_check_value is set (has been assigned a value) and false otherwise - */ - public boolean isSetReturn_check_value() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __RETURN_CHECK_VALUE_ISSET_ID); - } - - public void setReturn_check_valueIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit( - __isset_bitfield, __RETURN_CHECK_VALUE_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case HASH_KEY: - if (value == null) { - unsetHash_key(); - } else { - setHash_key((blob) value); - } - break; - - case CHECK_SORT_KEY: - if (value == null) { - unsetCheck_sort_key(); - } else { - setCheck_sort_key((blob) value); - } - break; - - case CHECK_TYPE: - if (value == null) { - unsetCheck_type(); - } else { - setCheck_type((cas_check_type) value); - } - break; - - case CHECK_OPERAND: - if (value == null) { - unsetCheck_operand(); - } else { - setCheck_operand((blob) value); - } - break; - - case SET_DIFF_SORT_KEY: - if (value == null) { - unsetSet_diff_sort_key(); - } else { - setSet_diff_sort_key((java.lang.Boolean) value); - } - break; - - case SET_SORT_KEY: - if (value == null) { - unsetSet_sort_key(); - } else { - setSet_sort_key((blob) value); - } - break; - - case SET_VALUE: - if (value == null) { - unsetSet_value(); - } else { - setSet_value((blob) value); - } - break; - - case SET_EXPIRE_TS_SECONDS: - if (value == null) { - unsetSet_expire_ts_seconds(); - } else { - setSet_expire_ts_seconds((java.lang.Integer) value); - } - break; - - case RETURN_CHECK_VALUE: - if (value == null) { - unsetReturn_check_value(); - } else { - setReturn_check_value((java.lang.Boolean) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case HASH_KEY: - return getHash_key(); - - case CHECK_SORT_KEY: - return getCheck_sort_key(); - - case CHECK_TYPE: - return getCheck_type(); - - case CHECK_OPERAND: - return getCheck_operand(); - - case SET_DIFF_SORT_KEY: - return isSet_diff_sort_key(); - - case SET_SORT_KEY: - return getSet_sort_key(); - - case SET_VALUE: - return getSet_value(); - - case SET_EXPIRE_TS_SECONDS: - return getSet_expire_ts_seconds(); - - case RETURN_CHECK_VALUE: - return isReturn_check_value(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case HASH_KEY: - return isSetHash_key(); - case CHECK_SORT_KEY: - return isSetCheck_sort_key(); - case CHECK_TYPE: - return isSetCheck_type(); - case CHECK_OPERAND: - return isSetCheck_operand(); - case SET_DIFF_SORT_KEY: - return isSetSet_diff_sort_key(); - case SET_SORT_KEY: - return isSetSet_sort_key(); - case SET_VALUE: - return isSetSet_value(); - case SET_EXPIRE_TS_SECONDS: - return isSetSet_expire_ts_seconds(); - case RETURN_CHECK_VALUE: - return isSetReturn_check_value(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof check_and_set_request) return this.equals((check_and_set_request) that); - return false; - } - - public boolean equals(check_and_set_request that) { - if (that == null) return false; - if (this == that) return true; - - boolean this_present_hash_key = true && this.isSetHash_key(); - boolean that_present_hash_key = true && that.isSetHash_key(); - if (this_present_hash_key || that_present_hash_key) { - if (!(this_present_hash_key && that_present_hash_key)) return false; - if (!this.hash_key.equals(that.hash_key)) return false; - } - - boolean this_present_check_sort_key = true && this.isSetCheck_sort_key(); - boolean that_present_check_sort_key = true && that.isSetCheck_sort_key(); - if (this_present_check_sort_key || that_present_check_sort_key) { - if (!(this_present_check_sort_key && that_present_check_sort_key)) return false; - if (!this.check_sort_key.equals(that.check_sort_key)) return false; - } - - boolean this_present_check_type = true && this.isSetCheck_type(); - boolean that_present_check_type = true && that.isSetCheck_type(); - if (this_present_check_type || that_present_check_type) { - if (!(this_present_check_type && that_present_check_type)) return false; - if (!this.check_type.equals(that.check_type)) return false; - } - - boolean this_present_check_operand = true && this.isSetCheck_operand(); - boolean that_present_check_operand = true && that.isSetCheck_operand(); - if (this_present_check_operand || that_present_check_operand) { - if (!(this_present_check_operand && that_present_check_operand)) return false; - if (!this.check_operand.equals(that.check_operand)) return false; - } - - boolean this_present_set_diff_sort_key = true; - boolean that_present_set_diff_sort_key = true; - if (this_present_set_diff_sort_key || that_present_set_diff_sort_key) { - if (!(this_present_set_diff_sort_key && that_present_set_diff_sort_key)) return false; - if (this.set_diff_sort_key != that.set_diff_sort_key) return false; - } - - boolean this_present_set_sort_key = true && this.isSetSet_sort_key(); - boolean that_present_set_sort_key = true && that.isSetSet_sort_key(); - if (this_present_set_sort_key || that_present_set_sort_key) { - if (!(this_present_set_sort_key && that_present_set_sort_key)) return false; - if (!this.set_sort_key.equals(that.set_sort_key)) return false; - } - - boolean this_present_set_value = true && this.isSetSet_value(); - boolean that_present_set_value = true && that.isSetSet_value(); - if (this_present_set_value || that_present_set_value) { - if (!(this_present_set_value && that_present_set_value)) return false; - if (!this.set_value.equals(that.set_value)) return false; - } - - boolean this_present_set_expire_ts_seconds = true; - boolean that_present_set_expire_ts_seconds = true; - if (this_present_set_expire_ts_seconds || that_present_set_expire_ts_seconds) { - if (!(this_present_set_expire_ts_seconds && that_present_set_expire_ts_seconds)) return false; - if (this.set_expire_ts_seconds != that.set_expire_ts_seconds) return false; - } - - boolean this_present_return_check_value = true; - boolean that_present_return_check_value = true; - if (this_present_return_check_value || that_present_return_check_value) { - if (!(this_present_return_check_value && that_present_return_check_value)) return false; - if (this.return_check_value != that.return_check_value) return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetHash_key()) ? 131071 : 524287); - if (isSetHash_key()) hashCode = hashCode * 8191 + hash_key.hashCode(); - - hashCode = hashCode * 8191 + ((isSetCheck_sort_key()) ? 131071 : 524287); - if (isSetCheck_sort_key()) hashCode = hashCode * 8191 + check_sort_key.hashCode(); - - hashCode = hashCode * 8191 + ((isSetCheck_type()) ? 131071 : 524287); - if (isSetCheck_type()) hashCode = hashCode * 8191 + check_type.getValue(); - - hashCode = hashCode * 8191 + ((isSetCheck_operand()) ? 131071 : 524287); - if (isSetCheck_operand()) hashCode = hashCode * 8191 + check_operand.hashCode(); - - hashCode = hashCode * 8191 + ((set_diff_sort_key) ? 131071 : 524287); - - hashCode = hashCode * 8191 + ((isSetSet_sort_key()) ? 131071 : 524287); - if (isSetSet_sort_key()) hashCode = hashCode * 8191 + set_sort_key.hashCode(); - - hashCode = hashCode * 8191 + ((isSetSet_value()) ? 131071 : 524287); - if (isSetSet_value()) hashCode = hashCode * 8191 + set_value.hashCode(); - - hashCode = hashCode * 8191 + set_expire_ts_seconds; - - hashCode = hashCode * 8191 + ((return_check_value) ? 131071 : 524287); - - return hashCode; - } - - @Override - public int compareTo(check_and_set_request other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetHash_key()).compareTo(other.isSetHash_key()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetHash_key()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.hash_key, other.hash_key); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetCheck_sort_key()).compareTo(other.isSetCheck_sort_key()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetCheck_sort_key()) { - lastComparison = - org.apache.thrift.TBaseHelper.compareTo(this.check_sort_key, other.check_sort_key); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetCheck_type()).compareTo(other.isSetCheck_type()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetCheck_type()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.check_type, other.check_type); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetCheck_operand()).compareTo(other.isSetCheck_operand()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetCheck_operand()) { - lastComparison = - org.apache.thrift.TBaseHelper.compareTo(this.check_operand, other.check_operand); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetSet_diff_sort_key()) - .compareTo(other.isSetSet_diff_sort_key()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSet_diff_sort_key()) { - lastComparison = - org.apache.thrift.TBaseHelper.compareTo(this.set_diff_sort_key, other.set_diff_sort_key); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetSet_sort_key()).compareTo(other.isSetSet_sort_key()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSet_sort_key()) { - lastComparison = - org.apache.thrift.TBaseHelper.compareTo(this.set_sort_key, other.set_sort_key); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetSet_value()).compareTo(other.isSetSet_value()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSet_value()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.set_value, other.set_value); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetSet_expire_ts_seconds()) - .compareTo(other.isSetSet_expire_ts_seconds()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSet_expire_ts_seconds()) { - lastComparison = - org.apache.thrift.TBaseHelper.compareTo( - this.set_expire_ts_seconds, other.set_expire_ts_seconds); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetReturn_check_value()) - .compareTo(other.isSetReturn_check_value()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReturn_check_value()) { - lastComparison = - org.apache.thrift.TBaseHelper.compareTo( - this.return_check_value, other.return_check_value); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("check_and_set_request("); - boolean first = true; - - sb.append("hash_key:"); - if (this.hash_key == null) { - sb.append("null"); - } else { - sb.append(this.hash_key); - } - first = false; - if (!first) sb.append(", "); - sb.append("check_sort_key:"); - if (this.check_sort_key == null) { - sb.append("null"); - } else { - sb.append(this.check_sort_key); - } - first = false; - if (!first) sb.append(", "); - sb.append("check_type:"); - if (this.check_type == null) { - sb.append("null"); - } else { - sb.append(this.check_type); - } - first = false; - if (!first) sb.append(", "); - sb.append("check_operand:"); - if (this.check_operand == null) { - sb.append("null"); - } else { - sb.append(this.check_operand); - } - first = false; - if (!first) sb.append(", "); - sb.append("set_diff_sort_key:"); - sb.append(this.set_diff_sort_key); - first = false; - if (!first) sb.append(", "); - sb.append("set_sort_key:"); - if (this.set_sort_key == null) { - sb.append("null"); - } else { - sb.append(this.set_sort_key); - } - first = false; - if (!first) sb.append(", "); - sb.append("set_value:"); - if (this.set_value == null) { - sb.append("null"); - } else { - sb.append(this.set_value); - } - first = false; - if (!first) sb.append(", "); - sb.append("set_expire_ts_seconds:"); - sb.append(this.set_expire_ts_seconds); - first = false; - if (!first) sb.append(", "); - sb.append("return_check_value:"); - sb.append(this.return_check_value); - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (hash_key != null) { - hash_key.validate(); - } - if (check_sort_key != null) { - check_sort_key.validate(); - } - if (check_operand != null) { - check_operand.validate(); - } - if (set_sort_key != null) { - set_sort_key.validate(); - } - if (set_value != null) { - set_value.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, java.lang.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 check_and_set_requestStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public check_and_set_requestStandardScheme getScheme() { - return new check_and_set_requestStandardScheme(); - } - } - - private static class check_and_set_requestStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, check_and_set_request 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: // HASH_KEY - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.hash_key = new blob(); - struct.hash_key.read(iprot); - struct.setHash_keyIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // CHECK_SORT_KEY - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.check_sort_key = new blob(); - struct.check_sort_key.read(iprot); - struct.setCheck_sort_keyIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // CHECK_TYPE - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.check_type = cas_check_type.findByValue(iprot.readI32()); - struct.setCheck_typeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // CHECK_OPERAND - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.check_operand = new blob(); - struct.check_operand.read(iprot); - struct.setCheck_operandIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 5: // SET_DIFF_SORT_KEY - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.set_diff_sort_key = iprot.readBool(); - struct.setSet_diff_sort_keyIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 6: // SET_SORT_KEY - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.set_sort_key = new blob(); - struct.set_sort_key.read(iprot); - struct.setSet_sort_keyIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 7: // SET_VALUE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.set_value = new blob(); - struct.set_value.read(iprot); - struct.setSet_valueIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 8: // SET_EXPIRE_TS_SECONDS - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.set_expire_ts_seconds = iprot.readI32(); - struct.setSet_expire_ts_secondsIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 9: // RETURN_CHECK_VALUE - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.return_check_value = iprot.readBool(); - struct.setReturn_check_valueIsSet(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, check_and_set_request struct) - throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.hash_key != null) { - oprot.writeFieldBegin(HASH_KEY_FIELD_DESC); - struct.hash_key.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.check_sort_key != null) { - oprot.writeFieldBegin(CHECK_SORT_KEY_FIELD_DESC); - struct.check_sort_key.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.check_type != null) { - oprot.writeFieldBegin(CHECK_TYPE_FIELD_DESC); - oprot.writeI32(struct.check_type.getValue()); - oprot.writeFieldEnd(); - } - if (struct.check_operand != null) { - oprot.writeFieldBegin(CHECK_OPERAND_FIELD_DESC); - struct.check_operand.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(SET_DIFF_SORT_KEY_FIELD_DESC); - oprot.writeBool(struct.set_diff_sort_key); - oprot.writeFieldEnd(); - if (struct.set_sort_key != null) { - oprot.writeFieldBegin(SET_SORT_KEY_FIELD_DESC); - struct.set_sort_key.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.set_value != null) { - oprot.writeFieldBegin(SET_VALUE_FIELD_DESC); - struct.set_value.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(SET_EXPIRE_TS_SECONDS_FIELD_DESC); - oprot.writeI32(struct.set_expire_ts_seconds); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(RETURN_CHECK_VALUE_FIELD_DESC); - oprot.writeBool(struct.return_check_value); - oprot.writeFieldEnd(); - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class check_and_set_requestTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public check_and_set_requestTupleScheme getScheme() { - return new check_and_set_requestTupleScheme(); - } - } - - private static class check_and_set_requestTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, check_and_set_request struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetHash_key()) { - optionals.set(0); - } - if (struct.isSetCheck_sort_key()) { - optionals.set(1); - } - if (struct.isSetCheck_type()) { - optionals.set(2); - } - if (struct.isSetCheck_operand()) { - optionals.set(3); - } - if (struct.isSetSet_diff_sort_key()) { - optionals.set(4); - } - if (struct.isSetSet_sort_key()) { - optionals.set(5); - } - if (struct.isSetSet_value()) { - optionals.set(6); - } - if (struct.isSetSet_expire_ts_seconds()) { - optionals.set(7); - } - if (struct.isSetReturn_check_value()) { - optionals.set(8); - } - oprot.writeBitSet(optionals, 9); - if (struct.isSetHash_key()) { - struct.hash_key.write(oprot); - } - if (struct.isSetCheck_sort_key()) { - struct.check_sort_key.write(oprot); - } - if (struct.isSetCheck_type()) { - oprot.writeI32(struct.check_type.getValue()); - } - if (struct.isSetCheck_operand()) { - struct.check_operand.write(oprot); - } - if (struct.isSetSet_diff_sort_key()) { - oprot.writeBool(struct.set_diff_sort_key); - } - if (struct.isSetSet_sort_key()) { - struct.set_sort_key.write(oprot); - } - if (struct.isSetSet_value()) { - struct.set_value.write(oprot); - } - if (struct.isSetSet_expire_ts_seconds()) { - oprot.writeI32(struct.set_expire_ts_seconds); - } - if (struct.isSetReturn_check_value()) { - oprot.writeBool(struct.return_check_value); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, check_and_set_request struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(9); - if (incoming.get(0)) { - struct.hash_key = new blob(); - struct.hash_key.read(iprot); - struct.setHash_keyIsSet(true); - } - if (incoming.get(1)) { - struct.check_sort_key = new blob(); - struct.check_sort_key.read(iprot); - struct.setCheck_sort_keyIsSet(true); - } - if (incoming.get(2)) { - struct.check_type = cas_check_type.findByValue(iprot.readI32()); - struct.setCheck_typeIsSet(true); - } - if (incoming.get(3)) { - struct.check_operand = new blob(); - struct.check_operand.read(iprot); - struct.setCheck_operandIsSet(true); - } - if (incoming.get(4)) { - struct.set_diff_sort_key = iprot.readBool(); - struct.setSet_diff_sort_keyIsSet(true); - } - if (incoming.get(5)) { - struct.set_sort_key = new blob(); - struct.set_sort_key.read(iprot); - struct.setSet_sort_keyIsSet(true); - } - if (incoming.get(6)) { - struct.set_value = new blob(); - struct.set_value.read(iprot); - struct.setSet_valueIsSet(true); - } - if (incoming.get(7)) { - struct.set_expire_ts_seconds = iprot.readI32(); - struct.setSet_expire_ts_secondsIsSet(true); - } - if (incoming.get(8)) { - struct.return_check_value = iprot.readBool(); - struct.setReturn_check_valueIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } -} diff --git a/java-client/src/main/java/org/apache/pegasus/apps/check_and_set_response.java b/java-client/src/main/java/org/apache/pegasus/apps/check_and_set_response.java deleted file mode 100644 index 9d33fed4e9..0000000000 --- a/java-client/src/main/java/org/apache/pegasus/apps/check_and_set_response.java +++ /dev/null @@ -1,1172 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.11.0) - * - *

DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * - * @generated - */ -package org.apache.pegasus.apps; - -import org.apache.pegasus.base.blob; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated( - value = "Autogenerated by Thrift Compiler (0.11.0)", - date = "2020-04-13") -public class check_and_set_response - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("check_and_set_response"); - - private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "error", org.apache.thrift.protocol.TType.I32, (short) 1); - private static final org.apache.thrift.protocol.TField CHECK_VALUE_RETURNED_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "check_value_returned", org.apache.thrift.protocol.TType.BOOL, (short) 2); - private static final org.apache.thrift.protocol.TField CHECK_VALUE_EXIST_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "check_value_exist", org.apache.thrift.protocol.TType.BOOL, (short) 3); - private static final org.apache.thrift.protocol.TField CHECK_VALUE_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "check_value", org.apache.thrift.protocol.TType.STRUCT, (short) 4); - private static final org.apache.thrift.protocol.TField APP_ID_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "app_id", org.apache.thrift.protocol.TType.I32, (short) 5); - private static final org.apache.thrift.protocol.TField PARTITION_INDEX_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "partition_index", org.apache.thrift.protocol.TType.I32, (short) 6); - private static final org.apache.thrift.protocol.TField DECREE_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "decree", org.apache.thrift.protocol.TType.I64, (short) 7); - private static final org.apache.thrift.protocol.TField SERVER_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "server", org.apache.thrift.protocol.TType.STRING, (short) 8); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new check_and_set_responseStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new check_and_set_responseTupleSchemeFactory(); - - public int error; // required - public boolean check_value_returned; // required - public boolean check_value_exist; // required - public blob check_value; // required - public int app_id; // required - public int partition_index; // required - public long decree; // required - public java.lang.String server; // 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 { - ERROR((short) 1, "error"), - CHECK_VALUE_RETURNED((short) 2, "check_value_returned"), - CHECK_VALUE_EXIST((short) 3, "check_value_exist"), - CHECK_VALUE((short) 4, "check_value"), - APP_ID((short) 5, "app_id"), - PARTITION_INDEX((short) 6, "partition_index"), - DECREE((short) 7, "decree"), - SERVER((short) 8, "server"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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: // ERROR - return ERROR; - case 2: // CHECK_VALUE_RETURNED - return CHECK_VALUE_RETURNED; - case 3: // CHECK_VALUE_EXIST - return CHECK_VALUE_EXIST; - case 4: // CHECK_VALUE - return CHECK_VALUE; - case 5: // APP_ID - return APP_ID; - case 6: // PARTITION_INDEX - return PARTITION_INDEX; - case 7: // DECREE - return DECREE; - case 8: // SERVER - return SERVER; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __ERROR_ISSET_ID = 0; - private static final int __CHECK_VALUE_RETURNED_ISSET_ID = 1; - private static final int __CHECK_VALUE_EXIST_ISSET_ID = 2; - private static final int __APP_ID_ISSET_ID = 3; - private static final int __PARTITION_INDEX_ISSET_ID = 4; - private static final int __DECREE_ISSET_ID = 5; - private byte __isset_bitfield = 0; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put( - _Fields.ERROR, - new org.apache.thrift.meta_data.FieldMetaData( - "error", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I32))); - tmpMap.put( - _Fields.CHECK_VALUE_RETURNED, - new org.apache.thrift.meta_data.FieldMetaData( - "check_value_returned", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.BOOL))); - tmpMap.put( - _Fields.CHECK_VALUE_EXIST, - new org.apache.thrift.meta_data.FieldMetaData( - "check_value_exist", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.BOOL))); - tmpMap.put( - _Fields.CHECK_VALUE, - new org.apache.thrift.meta_data.FieldMetaData( - "check_value", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData( - org.apache.thrift.protocol.TType.STRUCT, blob.class))); - tmpMap.put( - _Fields.APP_ID, - new org.apache.thrift.meta_data.FieldMetaData( - "app_id", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I32))); - tmpMap.put( - _Fields.PARTITION_INDEX, - new org.apache.thrift.meta_data.FieldMetaData( - "partition_index", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I32))); - tmpMap.put( - _Fields.DECREE, - new org.apache.thrift.meta_data.FieldMetaData( - "decree", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I64))); - tmpMap.put( - _Fields.SERVER, - new org.apache.thrift.meta_data.FieldMetaData( - "server", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.STRING))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap( - check_and_set_response.class, metaDataMap); - } - - public check_and_set_response() {} - - public check_and_set_response( - int error, - boolean check_value_returned, - boolean check_value_exist, - blob check_value, - int app_id, - int partition_index, - long decree, - java.lang.String server) { - this(); - this.error = error; - setErrorIsSet(true); - this.check_value_returned = check_value_returned; - setCheck_value_returnedIsSet(true); - this.check_value_exist = check_value_exist; - setCheck_value_existIsSet(true); - this.check_value = check_value; - this.app_id = app_id; - setApp_idIsSet(true); - this.partition_index = partition_index; - setPartition_indexIsSet(true); - this.decree = decree; - setDecreeIsSet(true); - this.server = server; - } - - /** Performs a deep copy on other. */ - public check_and_set_response(check_and_set_response other) { - __isset_bitfield = other.__isset_bitfield; - this.error = other.error; - this.check_value_returned = other.check_value_returned; - this.check_value_exist = other.check_value_exist; - if (other.isSetCheck_value()) { - this.check_value = new blob(other.check_value); - } - this.app_id = other.app_id; - this.partition_index = other.partition_index; - this.decree = other.decree; - if (other.isSetServer()) { - this.server = other.server; - } - } - - public check_and_set_response deepCopy() { - return new check_and_set_response(this); - } - - @Override - public void clear() { - setErrorIsSet(false); - this.error = 0; - setCheck_value_returnedIsSet(false); - this.check_value_returned = false; - setCheck_value_existIsSet(false); - this.check_value_exist = false; - this.check_value = null; - setApp_idIsSet(false); - this.app_id = 0; - setPartition_indexIsSet(false); - this.partition_index = 0; - setDecreeIsSet(false); - this.decree = 0; - this.server = null; - } - - public int getError() { - return this.error; - } - - public check_and_set_response setError(int error) { - this.error = error; - setErrorIsSet(true); - return this; - } - - public void unsetError() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ERROR_ISSET_ID); - } - - /** Returns true if field error is set (has been assigned a value) and false otherwise */ - public boolean isSetError() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ERROR_ISSET_ID); - } - - public void setErrorIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ERROR_ISSET_ID, value); - } - - public boolean isCheck_value_returned() { - return this.check_value_returned; - } - - public check_and_set_response setCheck_value_returned(boolean check_value_returned) { - this.check_value_returned = check_value_returned; - setCheck_value_returnedIsSet(true); - return this; - } - - public void unsetCheck_value_returned() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __CHECK_VALUE_RETURNED_ISSET_ID); - } - - /** - * Returns true if field check_value_returned is set (has been assigned a value) and false - * otherwise - */ - public boolean isSetCheck_value_returned() { - return org.apache.thrift.EncodingUtils.testBit( - __isset_bitfield, __CHECK_VALUE_RETURNED_ISSET_ID); - } - - public void setCheck_value_returnedIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit( - __isset_bitfield, __CHECK_VALUE_RETURNED_ISSET_ID, value); - } - - public boolean isCheck_value_exist() { - return this.check_value_exist; - } - - public check_and_set_response setCheck_value_exist(boolean check_value_exist) { - this.check_value_exist = check_value_exist; - setCheck_value_existIsSet(true); - return this; - } - - public void unsetCheck_value_exist() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __CHECK_VALUE_EXIST_ISSET_ID); - } - - /** - * Returns true if field check_value_exist is set (has been assigned a value) and false otherwise - */ - public boolean isSetCheck_value_exist() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __CHECK_VALUE_EXIST_ISSET_ID); - } - - public void setCheck_value_existIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit( - __isset_bitfield, __CHECK_VALUE_EXIST_ISSET_ID, value); - } - - public blob getCheck_value() { - return this.check_value; - } - - public check_and_set_response setCheck_value(blob check_value) { - this.check_value = check_value; - return this; - } - - public void unsetCheck_value() { - this.check_value = null; - } - - /** Returns true if field check_value is set (has been assigned a value) and false otherwise */ - public boolean isSetCheck_value() { - return this.check_value != null; - } - - public void setCheck_valueIsSet(boolean value) { - if (!value) { - this.check_value = null; - } - } - - public int getApp_id() { - return this.app_id; - } - - public check_and_set_response setApp_id(int app_id) { - this.app_id = app_id; - setApp_idIsSet(true); - return this; - } - - public void unsetApp_id() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __APP_ID_ISSET_ID); - } - - /** Returns true if field app_id is set (has been assigned a value) and false otherwise */ - public boolean isSetApp_id() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __APP_ID_ISSET_ID); - } - - public void setApp_idIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __APP_ID_ISSET_ID, value); - } - - public int getPartition_index() { - return this.partition_index; - } - - public check_and_set_response setPartition_index(int partition_index) { - this.partition_index = partition_index; - setPartition_indexIsSet(true); - return this; - } - - public void unsetPartition_index() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __PARTITION_INDEX_ISSET_ID); - } - - /** - * Returns true if field partition_index is set (has been assigned a value) and false otherwise - */ - public boolean isSetPartition_index() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __PARTITION_INDEX_ISSET_ID); - } - - public void setPartition_indexIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __PARTITION_INDEX_ISSET_ID, value); - } - - public long getDecree() { - return this.decree; - } - - public check_and_set_response setDecree(long decree) { - this.decree = decree; - setDecreeIsSet(true); - return this; - } - - public void unsetDecree() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __DECREE_ISSET_ID); - } - - /** Returns true if field decree is set (has been assigned a value) and false otherwise */ - public boolean isSetDecree() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __DECREE_ISSET_ID); - } - - public void setDecreeIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __DECREE_ISSET_ID, value); - } - - public java.lang.String getServer() { - return this.server; - } - - public check_and_set_response setServer(java.lang.String server) { - this.server = server; - return this; - } - - public void unsetServer() { - this.server = null; - } - - /** Returns true if field server is set (has been assigned a value) and false otherwise */ - public boolean isSetServer() { - return this.server != null; - } - - public void setServerIsSet(boolean value) { - if (!value) { - this.server = null; - } - } - - public void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case ERROR: - if (value == null) { - unsetError(); - } else { - setError((java.lang.Integer) value); - } - break; - - case CHECK_VALUE_RETURNED: - if (value == null) { - unsetCheck_value_returned(); - } else { - setCheck_value_returned((java.lang.Boolean) value); - } - break; - - case CHECK_VALUE_EXIST: - if (value == null) { - unsetCheck_value_exist(); - } else { - setCheck_value_exist((java.lang.Boolean) value); - } - break; - - case CHECK_VALUE: - if (value == null) { - unsetCheck_value(); - } else { - setCheck_value((blob) value); - } - break; - - case APP_ID: - if (value == null) { - unsetApp_id(); - } else { - setApp_id((java.lang.Integer) value); - } - break; - - case PARTITION_INDEX: - if (value == null) { - unsetPartition_index(); - } else { - setPartition_index((java.lang.Integer) value); - } - break; - - case DECREE: - if (value == null) { - unsetDecree(); - } else { - setDecree((java.lang.Long) value); - } - break; - - case SERVER: - if (value == null) { - unsetServer(); - } else { - setServer((java.lang.String) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case ERROR: - return getError(); - - case CHECK_VALUE_RETURNED: - return isCheck_value_returned(); - - case CHECK_VALUE_EXIST: - return isCheck_value_exist(); - - case CHECK_VALUE: - return getCheck_value(); - - case APP_ID: - return getApp_id(); - - case PARTITION_INDEX: - return getPartition_index(); - - case DECREE: - return getDecree(); - - case SERVER: - return getServer(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case ERROR: - return isSetError(); - case CHECK_VALUE_RETURNED: - return isSetCheck_value_returned(); - case CHECK_VALUE_EXIST: - return isSetCheck_value_exist(); - case CHECK_VALUE: - return isSetCheck_value(); - case APP_ID: - return isSetApp_id(); - case PARTITION_INDEX: - return isSetPartition_index(); - case DECREE: - return isSetDecree(); - case SERVER: - return isSetServer(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof check_and_set_response) return this.equals((check_and_set_response) that); - return false; - } - - public boolean equals(check_and_set_response that) { - if (that == null) return false; - if (this == that) return true; - - boolean this_present_error = true; - boolean that_present_error = true; - if (this_present_error || that_present_error) { - if (!(this_present_error && that_present_error)) return false; - if (this.error != that.error) return false; - } - - boolean this_present_check_value_returned = true; - boolean that_present_check_value_returned = true; - if (this_present_check_value_returned || that_present_check_value_returned) { - if (!(this_present_check_value_returned && that_present_check_value_returned)) return false; - if (this.check_value_returned != that.check_value_returned) return false; - } - - boolean this_present_check_value_exist = true; - boolean that_present_check_value_exist = true; - if (this_present_check_value_exist || that_present_check_value_exist) { - if (!(this_present_check_value_exist && that_present_check_value_exist)) return false; - if (this.check_value_exist != that.check_value_exist) return false; - } - - boolean this_present_check_value = true && this.isSetCheck_value(); - boolean that_present_check_value = true && that.isSetCheck_value(); - if (this_present_check_value || that_present_check_value) { - if (!(this_present_check_value && that_present_check_value)) return false; - if (!this.check_value.equals(that.check_value)) return false; - } - - boolean this_present_app_id = true; - boolean that_present_app_id = true; - if (this_present_app_id || that_present_app_id) { - if (!(this_present_app_id && that_present_app_id)) return false; - if (this.app_id != that.app_id) return false; - } - - boolean this_present_partition_index = true; - boolean that_present_partition_index = true; - if (this_present_partition_index || that_present_partition_index) { - if (!(this_present_partition_index && that_present_partition_index)) return false; - if (this.partition_index != that.partition_index) return false; - } - - boolean this_present_decree = true; - boolean that_present_decree = true; - if (this_present_decree || that_present_decree) { - if (!(this_present_decree && that_present_decree)) return false; - if (this.decree != that.decree) return false; - } - - boolean this_present_server = true && this.isSetServer(); - boolean that_present_server = true && that.isSetServer(); - if (this_present_server || that_present_server) { - if (!(this_present_server && that_present_server)) return false; - if (!this.server.equals(that.server)) return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + error; - - hashCode = hashCode * 8191 + ((check_value_returned) ? 131071 : 524287); - - hashCode = hashCode * 8191 + ((check_value_exist) ? 131071 : 524287); - - hashCode = hashCode * 8191 + ((isSetCheck_value()) ? 131071 : 524287); - if (isSetCheck_value()) hashCode = hashCode * 8191 + check_value.hashCode(); - - hashCode = hashCode * 8191 + app_id; - - hashCode = hashCode * 8191 + partition_index; - - hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(decree); - - hashCode = hashCode * 8191 + ((isSetServer()) ? 131071 : 524287); - if (isSetServer()) hashCode = hashCode * 8191 + server.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(check_and_set_response other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetError()).compareTo(other.isSetError()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetError()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetCheck_value_returned()) - .compareTo(other.isSetCheck_value_returned()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetCheck_value_returned()) { - lastComparison = - org.apache.thrift.TBaseHelper.compareTo( - this.check_value_returned, other.check_value_returned); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetCheck_value_exist()) - .compareTo(other.isSetCheck_value_exist()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetCheck_value_exist()) { - lastComparison = - org.apache.thrift.TBaseHelper.compareTo(this.check_value_exist, other.check_value_exist); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetCheck_value()).compareTo(other.isSetCheck_value()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetCheck_value()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.check_value, other.check_value); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetApp_id()).compareTo(other.isSetApp_id()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetApp_id()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.app_id, other.app_id); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetPartition_index()).compareTo(other.isSetPartition_index()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetPartition_index()) { - lastComparison = - org.apache.thrift.TBaseHelper.compareTo(this.partition_index, other.partition_index); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetDecree()).compareTo(other.isSetDecree()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetDecree()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.decree, other.decree); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetServer()).compareTo(other.isSetServer()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetServer()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.server, other.server); - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("check_and_set_response("); - boolean first = true; - - sb.append("error:"); - sb.append(this.error); - first = false; - if (!first) sb.append(", "); - sb.append("check_value_returned:"); - sb.append(this.check_value_returned); - first = false; - if (!first) sb.append(", "); - sb.append("check_value_exist:"); - sb.append(this.check_value_exist); - first = false; - if (!first) sb.append(", "); - sb.append("check_value:"); - if (this.check_value == null) { - sb.append("null"); - } else { - sb.append(this.check_value); - } - first = false; - if (!first) sb.append(", "); - sb.append("app_id:"); - sb.append(this.app_id); - first = false; - if (!first) sb.append(", "); - sb.append("partition_index:"); - sb.append(this.partition_index); - first = false; - if (!first) sb.append(", "); - sb.append("decree:"); - sb.append(this.decree); - first = false; - if (!first) sb.append(", "); - sb.append("server:"); - if (this.server == null) { - sb.append("null"); - } else { - sb.append(this.server); - } - 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 (check_value != null) { - check_value.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, java.lang.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 check_and_set_responseStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public check_and_set_responseStandardScheme getScheme() { - return new check_and_set_responseStandardScheme(); - } - } - - private static class check_and_set_responseStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, check_and_set_response 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: // ERROR - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.error = iprot.readI32(); - struct.setErrorIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // CHECK_VALUE_RETURNED - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.check_value_returned = iprot.readBool(); - struct.setCheck_value_returnedIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // CHECK_VALUE_EXIST - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.check_value_exist = iprot.readBool(); - struct.setCheck_value_existIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // CHECK_VALUE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.check_value = new blob(); - struct.check_value.read(iprot); - struct.setCheck_valueIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 5: // APP_ID - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.app_id = iprot.readI32(); - struct.setApp_idIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 6: // PARTITION_INDEX - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.partition_index = iprot.readI32(); - struct.setPartition_indexIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 7: // DECREE - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.decree = iprot.readI64(); - struct.setDecreeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 8: // SERVER - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.server = iprot.readString(); - struct.setServerIsSet(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, check_and_set_response struct) - throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(ERROR_FIELD_DESC); - oprot.writeI32(struct.error); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(CHECK_VALUE_RETURNED_FIELD_DESC); - oprot.writeBool(struct.check_value_returned); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(CHECK_VALUE_EXIST_FIELD_DESC); - oprot.writeBool(struct.check_value_exist); - oprot.writeFieldEnd(); - if (struct.check_value != null) { - oprot.writeFieldBegin(CHECK_VALUE_FIELD_DESC); - struct.check_value.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(APP_ID_FIELD_DESC); - oprot.writeI32(struct.app_id); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(PARTITION_INDEX_FIELD_DESC); - oprot.writeI32(struct.partition_index); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(DECREE_FIELD_DESC); - oprot.writeI64(struct.decree); - oprot.writeFieldEnd(); - if (struct.server != null) { - oprot.writeFieldBegin(SERVER_FIELD_DESC); - oprot.writeString(struct.server); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class check_and_set_responseTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public check_and_set_responseTupleScheme getScheme() { - return new check_and_set_responseTupleScheme(); - } - } - - private static class check_and_set_responseTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, check_and_set_response struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetError()) { - optionals.set(0); - } - if (struct.isSetCheck_value_returned()) { - optionals.set(1); - } - if (struct.isSetCheck_value_exist()) { - optionals.set(2); - } - if (struct.isSetCheck_value()) { - optionals.set(3); - } - if (struct.isSetApp_id()) { - optionals.set(4); - } - if (struct.isSetPartition_index()) { - optionals.set(5); - } - if (struct.isSetDecree()) { - optionals.set(6); - } - if (struct.isSetServer()) { - optionals.set(7); - } - oprot.writeBitSet(optionals, 8); - if (struct.isSetError()) { - oprot.writeI32(struct.error); - } - if (struct.isSetCheck_value_returned()) { - oprot.writeBool(struct.check_value_returned); - } - if (struct.isSetCheck_value_exist()) { - oprot.writeBool(struct.check_value_exist); - } - if (struct.isSetCheck_value()) { - struct.check_value.write(oprot); - } - if (struct.isSetApp_id()) { - oprot.writeI32(struct.app_id); - } - if (struct.isSetPartition_index()) { - oprot.writeI32(struct.partition_index); - } - if (struct.isSetDecree()) { - oprot.writeI64(struct.decree); - } - if (struct.isSetServer()) { - oprot.writeString(struct.server); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, check_and_set_response struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(8); - if (incoming.get(0)) { - struct.error = iprot.readI32(); - struct.setErrorIsSet(true); - } - if (incoming.get(1)) { - struct.check_value_returned = iprot.readBool(); - struct.setCheck_value_returnedIsSet(true); - } - if (incoming.get(2)) { - struct.check_value_exist = iprot.readBool(); - struct.setCheck_value_existIsSet(true); - } - if (incoming.get(3)) { - struct.check_value = new blob(); - struct.check_value.read(iprot); - struct.setCheck_valueIsSet(true); - } - if (incoming.get(4)) { - struct.app_id = iprot.readI32(); - struct.setApp_idIsSet(true); - } - if (incoming.get(5)) { - struct.partition_index = iprot.readI32(); - struct.setPartition_indexIsSet(true); - } - if (incoming.get(6)) { - struct.decree = iprot.readI64(); - struct.setDecreeIsSet(true); - } - if (incoming.get(7)) { - struct.server = iprot.readString(); - struct.setServerIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } -} diff --git a/java-client/src/main/java/org/apache/pegasus/apps/count_response.java b/java-client/src/main/java/org/apache/pegasus/apps/count_response.java deleted file mode 100644 index 429f2ff745..0000000000 --- a/java-client/src/main/java/org/apache/pegasus/apps/count_response.java +++ /dev/null @@ -1,830 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.11.0) - * - *

DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * - * @generated - */ -package org.apache.pegasus.apps; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated( - value = "Autogenerated by Thrift Compiler (0.11.0)", - date = "2020-04-13") -public class count_response - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("count_response"); - - private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "error", org.apache.thrift.protocol.TType.I32, (short) 1); - private static final org.apache.thrift.protocol.TField COUNT_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "count", org.apache.thrift.protocol.TType.I64, (short) 2); - private static final org.apache.thrift.protocol.TField APP_ID_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "app_id", org.apache.thrift.protocol.TType.I32, (short) 3); - private static final org.apache.thrift.protocol.TField PARTITION_INDEX_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "partition_index", org.apache.thrift.protocol.TType.I32, (short) 4); - private static final org.apache.thrift.protocol.TField SERVER_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "server", org.apache.thrift.protocol.TType.STRING, (short) 6); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new count_responseStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new count_responseTupleSchemeFactory(); - - public int error; // required - public long count; // required - public int app_id; // required - public int partition_index; // required - public java.lang.String server; // 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 { - ERROR((short) 1, "error"), - COUNT((short) 2, "count"), - APP_ID((short) 3, "app_id"), - PARTITION_INDEX((short) 4, "partition_index"), - SERVER((short) 6, "server"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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: // ERROR - return ERROR; - case 2: // COUNT - return COUNT; - case 3: // APP_ID - return APP_ID; - case 4: // PARTITION_INDEX - return PARTITION_INDEX; - case 6: // SERVER - return SERVER; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __ERROR_ISSET_ID = 0; - private static final int __COUNT_ISSET_ID = 1; - private static final int __APP_ID_ISSET_ID = 2; - private static final int __PARTITION_INDEX_ISSET_ID = 3; - private byte __isset_bitfield = 0; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put( - _Fields.ERROR, - new org.apache.thrift.meta_data.FieldMetaData( - "error", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I32))); - tmpMap.put( - _Fields.COUNT, - new org.apache.thrift.meta_data.FieldMetaData( - "count", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I64))); - tmpMap.put( - _Fields.APP_ID, - new org.apache.thrift.meta_data.FieldMetaData( - "app_id", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I32))); - tmpMap.put( - _Fields.PARTITION_INDEX, - new org.apache.thrift.meta_data.FieldMetaData( - "partition_index", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I32))); - tmpMap.put( - _Fields.SERVER, - new org.apache.thrift.meta_data.FieldMetaData( - "server", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.STRING))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap( - count_response.class, metaDataMap); - } - - public count_response() {} - - public count_response( - int error, long count, int app_id, int partition_index, java.lang.String server) { - this(); - this.error = error; - setErrorIsSet(true); - this.count = count; - setCountIsSet(true); - this.app_id = app_id; - setApp_idIsSet(true); - this.partition_index = partition_index; - setPartition_indexIsSet(true); - this.server = server; - } - - /** Performs a deep copy on other. */ - public count_response(count_response other) { - __isset_bitfield = other.__isset_bitfield; - this.error = other.error; - this.count = other.count; - this.app_id = other.app_id; - this.partition_index = other.partition_index; - if (other.isSetServer()) { - this.server = other.server; - } - } - - public count_response deepCopy() { - return new count_response(this); - } - - @Override - public void clear() { - setErrorIsSet(false); - this.error = 0; - setCountIsSet(false); - this.count = 0; - setApp_idIsSet(false); - this.app_id = 0; - setPartition_indexIsSet(false); - this.partition_index = 0; - this.server = null; - } - - public int getError() { - return this.error; - } - - public count_response setError(int error) { - this.error = error; - setErrorIsSet(true); - return this; - } - - public void unsetError() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ERROR_ISSET_ID); - } - - /** Returns true if field error is set (has been assigned a value) and false otherwise */ - public boolean isSetError() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ERROR_ISSET_ID); - } - - public void setErrorIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ERROR_ISSET_ID, value); - } - - public long getCount() { - return this.count; - } - - public count_response setCount(long count) { - this.count = count; - setCountIsSet(true); - return this; - } - - public void unsetCount() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __COUNT_ISSET_ID); - } - - /** Returns true if field count is set (has been assigned a value) and false otherwise */ - public boolean isSetCount() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __COUNT_ISSET_ID); - } - - public void setCountIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __COUNT_ISSET_ID, value); - } - - public int getApp_id() { - return this.app_id; - } - - public count_response setApp_id(int app_id) { - this.app_id = app_id; - setApp_idIsSet(true); - return this; - } - - public void unsetApp_id() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __APP_ID_ISSET_ID); - } - - /** Returns true if field app_id is set (has been assigned a value) and false otherwise */ - public boolean isSetApp_id() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __APP_ID_ISSET_ID); - } - - public void setApp_idIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __APP_ID_ISSET_ID, value); - } - - public int getPartition_index() { - return this.partition_index; - } - - public count_response setPartition_index(int partition_index) { - this.partition_index = partition_index; - setPartition_indexIsSet(true); - return this; - } - - public void unsetPartition_index() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __PARTITION_INDEX_ISSET_ID); - } - - /** - * Returns true if field partition_index is set (has been assigned a value) and false otherwise - */ - public boolean isSetPartition_index() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __PARTITION_INDEX_ISSET_ID); - } - - public void setPartition_indexIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __PARTITION_INDEX_ISSET_ID, value); - } - - public java.lang.String getServer() { - return this.server; - } - - public count_response setServer(java.lang.String server) { - this.server = server; - return this; - } - - public void unsetServer() { - this.server = null; - } - - /** Returns true if field server is set (has been assigned a value) and false otherwise */ - public boolean isSetServer() { - return this.server != null; - } - - public void setServerIsSet(boolean value) { - if (!value) { - this.server = null; - } - } - - public void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case ERROR: - if (value == null) { - unsetError(); - } else { - setError((java.lang.Integer) value); - } - break; - - case COUNT: - if (value == null) { - unsetCount(); - } else { - setCount((java.lang.Long) value); - } - break; - - case APP_ID: - if (value == null) { - unsetApp_id(); - } else { - setApp_id((java.lang.Integer) value); - } - break; - - case PARTITION_INDEX: - if (value == null) { - unsetPartition_index(); - } else { - setPartition_index((java.lang.Integer) value); - } - break; - - case SERVER: - if (value == null) { - unsetServer(); - } else { - setServer((java.lang.String) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case ERROR: - return getError(); - - case COUNT: - return getCount(); - - case APP_ID: - return getApp_id(); - - case PARTITION_INDEX: - return getPartition_index(); - - case SERVER: - return getServer(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case ERROR: - return isSetError(); - case COUNT: - return isSetCount(); - case APP_ID: - return isSetApp_id(); - case PARTITION_INDEX: - return isSetPartition_index(); - case SERVER: - return isSetServer(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof count_response) return this.equals((count_response) that); - return false; - } - - public boolean equals(count_response that) { - if (that == null) return false; - if (this == that) return true; - - boolean this_present_error = true; - boolean that_present_error = true; - if (this_present_error || that_present_error) { - if (!(this_present_error && that_present_error)) return false; - if (this.error != that.error) return false; - } - - boolean this_present_count = true; - boolean that_present_count = true; - if (this_present_count || that_present_count) { - if (!(this_present_count && that_present_count)) return false; - if (this.count != that.count) return false; - } - - boolean this_present_app_id = true; - boolean that_present_app_id = true; - if (this_present_app_id || that_present_app_id) { - if (!(this_present_app_id && that_present_app_id)) return false; - if (this.app_id != that.app_id) return false; - } - - boolean this_present_partition_index = true; - boolean that_present_partition_index = true; - if (this_present_partition_index || that_present_partition_index) { - if (!(this_present_partition_index && that_present_partition_index)) return false; - if (this.partition_index != that.partition_index) return false; - } - - boolean this_present_server = true && this.isSetServer(); - boolean that_present_server = true && that.isSetServer(); - if (this_present_server || that_present_server) { - if (!(this_present_server && that_present_server)) return false; - if (!this.server.equals(that.server)) return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + error; - - hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(count); - - hashCode = hashCode * 8191 + app_id; - - hashCode = hashCode * 8191 + partition_index; - - hashCode = hashCode * 8191 + ((isSetServer()) ? 131071 : 524287); - if (isSetServer()) hashCode = hashCode * 8191 + server.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(count_response other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetError()).compareTo(other.isSetError()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetError()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetCount()).compareTo(other.isSetCount()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetCount()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.count, other.count); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetApp_id()).compareTo(other.isSetApp_id()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetApp_id()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.app_id, other.app_id); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetPartition_index()).compareTo(other.isSetPartition_index()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetPartition_index()) { - lastComparison = - org.apache.thrift.TBaseHelper.compareTo(this.partition_index, other.partition_index); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetServer()).compareTo(other.isSetServer()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetServer()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.server, other.server); - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("count_response("); - boolean first = true; - - sb.append("error:"); - sb.append(this.error); - first = false; - if (!first) sb.append(", "); - sb.append("count:"); - sb.append(this.count); - first = false; - if (!first) sb.append(", "); - sb.append("app_id:"); - sb.append(this.app_id); - first = false; - if (!first) sb.append(", "); - sb.append("partition_index:"); - sb.append(this.partition_index); - first = false; - if (!first) sb.append(", "); - sb.append("server:"); - if (this.server == null) { - sb.append("null"); - } else { - sb.append(this.server); - } - 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, java.lang.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 count_responseStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public count_responseStandardScheme getScheme() { - return new count_responseStandardScheme(); - } - } - - private static class count_responseStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, count_response 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: // ERROR - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.error = iprot.readI32(); - struct.setErrorIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // COUNT - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.count = iprot.readI64(); - struct.setCountIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // APP_ID - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.app_id = iprot.readI32(); - struct.setApp_idIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // PARTITION_INDEX - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.partition_index = iprot.readI32(); - struct.setPartition_indexIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 6: // SERVER - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.server = iprot.readString(); - struct.setServerIsSet(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, count_response struct) - throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(ERROR_FIELD_DESC); - oprot.writeI32(struct.error); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(COUNT_FIELD_DESC); - oprot.writeI64(struct.count); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(APP_ID_FIELD_DESC); - oprot.writeI32(struct.app_id); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(PARTITION_INDEX_FIELD_DESC); - oprot.writeI32(struct.partition_index); - oprot.writeFieldEnd(); - if (struct.server != null) { - oprot.writeFieldBegin(SERVER_FIELD_DESC); - oprot.writeString(struct.server); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class count_responseTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public count_responseTupleScheme getScheme() { - return new count_responseTupleScheme(); - } - } - - private static class count_responseTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, count_response struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetError()) { - optionals.set(0); - } - if (struct.isSetCount()) { - optionals.set(1); - } - if (struct.isSetApp_id()) { - optionals.set(2); - } - if (struct.isSetPartition_index()) { - optionals.set(3); - } - if (struct.isSetServer()) { - optionals.set(4); - } - oprot.writeBitSet(optionals, 5); - if (struct.isSetError()) { - oprot.writeI32(struct.error); - } - if (struct.isSetCount()) { - oprot.writeI64(struct.count); - } - if (struct.isSetApp_id()) { - oprot.writeI32(struct.app_id); - } - if (struct.isSetPartition_index()) { - oprot.writeI32(struct.partition_index); - } - if (struct.isSetServer()) { - oprot.writeString(struct.server); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, count_response struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(5); - if (incoming.get(0)) { - struct.error = iprot.readI32(); - struct.setErrorIsSet(true); - } - if (incoming.get(1)) { - struct.count = iprot.readI64(); - struct.setCountIsSet(true); - } - if (incoming.get(2)) { - struct.app_id = iprot.readI32(); - struct.setApp_idIsSet(true); - } - if (incoming.get(3)) { - struct.partition_index = iprot.readI32(); - struct.setPartition_indexIsSet(true); - } - if (incoming.get(4)) { - struct.server = iprot.readString(); - struct.setServerIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } -} diff --git a/java-client/src/main/java/org/apache/pegasus/apps/filter_type.java b/java-client/src/main/java/org/apache/pegasus/apps/filter_type.java deleted file mode 100644 index f17092888c..0000000000 --- a/java-client/src/main/java/org/apache/pegasus/apps/filter_type.java +++ /dev/null @@ -1,64 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.11.0) - * - *

DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * - * @generated - */ -package org.apache.pegasus.apps; - -public enum filter_type implements org.apache.thrift.TEnum { - FT_NO_FILTER(0), - FT_MATCH_ANYWHERE(1), - FT_MATCH_PREFIX(2), - FT_MATCH_POSTFIX(3); - - private final int value; - - private filter_type(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 filter_type findByValue(int value) { - switch (value) { - case 0: - return FT_NO_FILTER; - case 1: - return FT_MATCH_ANYWHERE; - case 2: - return FT_MATCH_PREFIX; - case 3: - return FT_MATCH_POSTFIX; - default: - return null; - } - } -} diff --git a/java-client/src/main/java/org/apache/pegasus/apps/full_data.java b/java-client/src/main/java/org/apache/pegasus/apps/full_data.java deleted file mode 100644 index 205b793713..0000000000 --- a/java-client/src/main/java/org/apache/pegasus/apps/full_data.java +++ /dev/null @@ -1,644 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.11.0) - * - *

DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * - * @generated - */ -package org.apache.pegasus.apps; - -import org.apache.pegasus.base.blob; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated( - value = "Autogenerated by Thrift Compiler (0.11.0)", - date = "2022-02-12") -public class full_data - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("full_data"); - - private static final org.apache.thrift.protocol.TField HASH_KEY_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "hash_key", org.apache.thrift.protocol.TType.STRUCT, (short) 1); - private static final org.apache.thrift.protocol.TField SORT_KEY_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "sort_key", org.apache.thrift.protocol.TType.STRUCT, (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.STRUCT, (short) 3); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new full_dataStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new full_dataTupleSchemeFactory(); - - public blob hash_key; // required - public blob sort_key; // required - public blob value; // required - - /** - * The set of fields this struct contains, along with convenience methods for finding and - * manipulating them. - */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - HASH_KEY((short) 1, "hash_key"), - SORT_KEY((short) 2, "sort_key"), - VALUE((short) 3, "value"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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: // HASH_KEY - return HASH_KEY; - case 2: // SORT_KEY - return SORT_KEY; - case 3: // VALUE - return VALUE; - default: - return null; - } - } - - /** Find the _Fields constant that matches fieldId, throwing an exception if it is not found. */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) - throw new java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put( - _Fields.HASH_KEY, - new org.apache.thrift.meta_data.FieldMetaData( - "hash_key", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData( - org.apache.thrift.protocol.TType.STRUCT, blob.class))); - tmpMap.put( - _Fields.SORT_KEY, - new org.apache.thrift.meta_data.FieldMetaData( - "sort_key", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData( - org.apache.thrift.protocol.TType.STRUCT, blob.class))); - tmpMap.put( - _Fields.VALUE, - new org.apache.thrift.meta_data.FieldMetaData( - "value", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData( - org.apache.thrift.protocol.TType.STRUCT, blob.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(full_data.class, metaDataMap); - } - - public full_data() {} - - public full_data(blob hash_key, blob sort_key, blob value) { - this(); - this.hash_key = hash_key; - this.sort_key = sort_key; - this.value = value; - } - - /** Performs a deep copy on other. */ - public full_data(full_data other) { - if (other.isSetHash_key()) { - this.hash_key = new blob(other.hash_key); - } - if (other.isSetSort_key()) { - this.sort_key = new blob(other.sort_key); - } - if (other.isSetValue()) { - this.value = new blob(other.value); - } - } - - public full_data deepCopy() { - return new full_data(this); - } - - @Override - public void clear() { - this.hash_key = null; - this.sort_key = null; - this.value = null; - } - - public blob getHash_key() { - return this.hash_key; - } - - public full_data setHash_key(blob hash_key) { - this.hash_key = hash_key; - return this; - } - - public void unsetHash_key() { - this.hash_key = null; - } - - /** Returns true if field hash_key is set (has been assigned a value) and false otherwise */ - public boolean isSetHash_key() { - return this.hash_key != null; - } - - public void setHash_keyIsSet(boolean value) { - if (!value) { - this.hash_key = null; - } - } - - public blob getSort_key() { - return this.sort_key; - } - - public full_data setSort_key(blob sort_key) { - this.sort_key = sort_key; - return this; - } - - public void unsetSort_key() { - this.sort_key = null; - } - - /** Returns true if field sort_key is set (has been assigned a value) and false otherwise */ - public boolean isSetSort_key() { - return this.sort_key != null; - } - - public void setSort_keyIsSet(boolean value) { - if (!value) { - this.sort_key = null; - } - } - - public blob getValue() { - return this.value; - } - - public full_data setValue(blob 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 void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case HASH_KEY: - if (value == null) { - unsetHash_key(); - } else { - setHash_key((blob) value); - } - break; - - case SORT_KEY: - if (value == null) { - unsetSort_key(); - } else { - setSort_key((blob) value); - } - break; - - case VALUE: - if (value == null) { - unsetValue(); - } else { - setValue((blob) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case HASH_KEY: - return getHash_key(); - - case SORT_KEY: - return getSort_key(); - - case VALUE: - return getValue(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case HASH_KEY: - return isSetHash_key(); - case SORT_KEY: - return isSetSort_key(); - case VALUE: - return isSetValue(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof full_data) return this.equals((full_data) that); - return false; - } - - public boolean equals(full_data that) { - if (that == null) return false; - if (this == that) return true; - - boolean this_present_hash_key = true && this.isSetHash_key(); - boolean that_present_hash_key = true && that.isSetHash_key(); - if (this_present_hash_key || that_present_hash_key) { - if (!(this_present_hash_key && that_present_hash_key)) return false; - if (!this.hash_key.equals(that.hash_key)) return false; - } - - boolean this_present_sort_key = true && this.isSetSort_key(); - boolean that_present_sort_key = true && that.isSetSort_key(); - if (this_present_sort_key || that_present_sort_key) { - if (!(this_present_sort_key && that_present_sort_key)) return false; - if (!this.sort_key.equals(that.sort_key)) 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; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetHash_key()) ? 131071 : 524287); - if (isSetHash_key()) hashCode = hashCode * 8191 + hash_key.hashCode(); - - hashCode = hashCode * 8191 + ((isSetSort_key()) ? 131071 : 524287); - if (isSetSort_key()) hashCode = hashCode * 8191 + sort_key.hashCode(); - - hashCode = hashCode * 8191 + ((isSetValue()) ? 131071 : 524287); - if (isSetValue()) hashCode = hashCode * 8191 + value.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(full_data other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetHash_key()).compareTo(other.isSetHash_key()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetHash_key()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.hash_key, other.hash_key); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetSort_key()).compareTo(other.isSetSort_key()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSort_key()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sort_key, other.sort_key); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetValue()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, other.value); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("full_data("); - boolean first = true; - - sb.append("hash_key:"); - if (this.hash_key == null) { - sb.append("null"); - } else { - sb.append(this.hash_key); - } - first = false; - if (!first) sb.append(", "); - sb.append("sort_key:"); - if (this.sort_key == null) { - sb.append("null"); - } else { - sb.append(this.sort_key); - } - first = false; - if (!first) sb.append(", "); - sb.append("value:"); - if (this.value == null) { - sb.append("null"); - } else { - sb.append(this.value); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (hash_key != null) { - hash_key.validate(); - } - if (sort_key != null) { - sort_key.validate(); - } - if (value != null) { - value.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, java.lang.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 full_dataStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public full_dataStandardScheme getScheme() { - return new full_dataStandardScheme(); - } - } - - private static class full_dataStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, full_data 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: // HASH_KEY - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.hash_key = new blob(); - struct.hash_key.read(iprot); - struct.setHash_keyIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // SORT_KEY - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.sort_key = new blob(); - struct.sort_key.read(iprot); - struct.setSort_keyIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // VALUE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.value = new blob(); - struct.value.read(iprot); - struct.setValueIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, full_data struct) - throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.hash_key != null) { - oprot.writeFieldBegin(HASH_KEY_FIELD_DESC); - struct.hash_key.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.sort_key != null) { - oprot.writeFieldBegin(SORT_KEY_FIELD_DESC); - struct.sort_key.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.value != null) { - oprot.writeFieldBegin(VALUE_FIELD_DESC); - struct.value.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class full_dataTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public full_dataTupleScheme getScheme() { - return new full_dataTupleScheme(); - } - } - - private static class full_dataTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, full_data struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetHash_key()) { - optionals.set(0); - } - if (struct.isSetSort_key()) { - optionals.set(1); - } - if (struct.isSetValue()) { - optionals.set(2); - } - oprot.writeBitSet(optionals, 3); - if (struct.isSetHash_key()) { - struct.hash_key.write(oprot); - } - if (struct.isSetSort_key()) { - struct.sort_key.write(oprot); - } - if (struct.isSetValue()) { - struct.value.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, full_data struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(3); - if (incoming.get(0)) { - struct.hash_key = new blob(); - struct.hash_key.read(iprot); - struct.setHash_keyIsSet(true); - } - if (incoming.get(1)) { - struct.sort_key = new blob(); - struct.sort_key.read(iprot); - struct.setSort_keyIsSet(true); - } - if (incoming.get(2)) { - struct.value = new blob(); - struct.value.read(iprot); - struct.setValueIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } -} diff --git a/java-client/src/main/java/org/apache/pegasus/apps/full_key.java b/java-client/src/main/java/org/apache/pegasus/apps/full_key.java deleted file mode 100644 index cc8d0ab4ee..0000000000 --- a/java-client/src/main/java/org/apache/pegasus/apps/full_key.java +++ /dev/null @@ -1,531 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.11.0) - * - *

DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * - * @generated - */ -package org.apache.pegasus.apps; - -import org.apache.pegasus.base.blob; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated( - value = "Autogenerated by Thrift Compiler (0.11.0)", - date = "2022-02-12") -public class full_key - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("full_key"); - - private static final org.apache.thrift.protocol.TField HASH_KEY_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "hash_key", org.apache.thrift.protocol.TType.STRUCT, (short) 1); - private static final org.apache.thrift.protocol.TField SORT_KEY_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "sort_key", org.apache.thrift.protocol.TType.STRUCT, (short) 2); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new full_keyStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new full_keyTupleSchemeFactory(); - - public blob hash_key; // required - public blob sort_key; // 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 { - HASH_KEY((short) 1, "hash_key"), - SORT_KEY((short) 2, "sort_key"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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: // HASH_KEY - return HASH_KEY; - case 2: // SORT_KEY - return SORT_KEY; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put( - _Fields.HASH_KEY, - new org.apache.thrift.meta_data.FieldMetaData( - "hash_key", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData( - org.apache.thrift.protocol.TType.STRUCT, blob.class))); - tmpMap.put( - _Fields.SORT_KEY, - new org.apache.thrift.meta_data.FieldMetaData( - "sort_key", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData( - org.apache.thrift.protocol.TType.STRUCT, blob.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(full_key.class, metaDataMap); - } - - public full_key() {} - - public full_key(blob hash_key, blob sort_key) { - this(); - this.hash_key = hash_key; - this.sort_key = sort_key; - } - - /** Performs a deep copy on other. */ - public full_key(full_key other) { - if (other.isSetHash_key()) { - this.hash_key = new blob(other.hash_key); - } - if (other.isSetSort_key()) { - this.sort_key = new blob(other.sort_key); - } - } - - public full_key deepCopy() { - return new full_key(this); - } - - @Override - public void clear() { - this.hash_key = null; - this.sort_key = null; - } - - public blob getHash_key() { - return this.hash_key; - } - - public full_key setHash_key(blob hash_key) { - this.hash_key = hash_key; - return this; - } - - public void unsetHash_key() { - this.hash_key = null; - } - - /** Returns true if field hash_key is set (has been assigned a value) and false otherwise */ - public boolean isSetHash_key() { - return this.hash_key != null; - } - - public void setHash_keyIsSet(boolean value) { - if (!value) { - this.hash_key = null; - } - } - - public blob getSort_key() { - return this.sort_key; - } - - public full_key setSort_key(blob sort_key) { - this.sort_key = sort_key; - return this; - } - - public void unsetSort_key() { - this.sort_key = null; - } - - /** Returns true if field sort_key is set (has been assigned a value) and false otherwise */ - public boolean isSetSort_key() { - return this.sort_key != null; - } - - public void setSort_keyIsSet(boolean value) { - if (!value) { - this.sort_key = null; - } - } - - public void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case HASH_KEY: - if (value == null) { - unsetHash_key(); - } else { - setHash_key((blob) value); - } - break; - - case SORT_KEY: - if (value == null) { - unsetSort_key(); - } else { - setSort_key((blob) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case HASH_KEY: - return getHash_key(); - - case SORT_KEY: - return getSort_key(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case HASH_KEY: - return isSetHash_key(); - case SORT_KEY: - return isSetSort_key(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof full_key) return this.equals((full_key) that); - return false; - } - - public boolean equals(full_key that) { - if (that == null) return false; - if (this == that) return true; - - boolean this_present_hash_key = true && this.isSetHash_key(); - boolean that_present_hash_key = true && that.isSetHash_key(); - if (this_present_hash_key || that_present_hash_key) { - if (!(this_present_hash_key && that_present_hash_key)) return false; - if (!this.hash_key.equals(that.hash_key)) return false; - } - - boolean this_present_sort_key = true && this.isSetSort_key(); - boolean that_present_sort_key = true && that.isSetSort_key(); - if (this_present_sort_key || that_present_sort_key) { - if (!(this_present_sort_key && that_present_sort_key)) return false; - if (!this.sort_key.equals(that.sort_key)) return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetHash_key()) ? 131071 : 524287); - if (isSetHash_key()) hashCode = hashCode * 8191 + hash_key.hashCode(); - - hashCode = hashCode * 8191 + ((isSetSort_key()) ? 131071 : 524287); - if (isSetSort_key()) hashCode = hashCode * 8191 + sort_key.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(full_key other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetHash_key()).compareTo(other.isSetHash_key()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetHash_key()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.hash_key, other.hash_key); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetSort_key()).compareTo(other.isSetSort_key()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSort_key()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sort_key, other.sort_key); - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("full_key("); - boolean first = true; - - sb.append("hash_key:"); - if (this.hash_key == null) { - sb.append("null"); - } else { - sb.append(this.hash_key); - } - first = false; - if (!first) sb.append(", "); - sb.append("sort_key:"); - if (this.sort_key == null) { - sb.append("null"); - } else { - sb.append(this.sort_key); - } - 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 (hash_key != null) { - hash_key.validate(); - } - if (sort_key != null) { - sort_key.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, java.lang.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 full_keyStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public full_keyStandardScheme getScheme() { - return new full_keyStandardScheme(); - } - } - - private static class full_keyStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, full_key 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: // HASH_KEY - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.hash_key = new blob(); - struct.hash_key.read(iprot); - struct.setHash_keyIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // SORT_KEY - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.sort_key = new blob(); - struct.sort_key.read(iprot); - struct.setSort_keyIsSet(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, full_key struct) - throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.hash_key != null) { - oprot.writeFieldBegin(HASH_KEY_FIELD_DESC); - struct.hash_key.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.sort_key != null) { - oprot.writeFieldBegin(SORT_KEY_FIELD_DESC); - struct.sort_key.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class full_keyTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public full_keyTupleScheme getScheme() { - return new full_keyTupleScheme(); - } - } - - private static class full_keyTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, full_key struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetHash_key()) { - optionals.set(0); - } - if (struct.isSetSort_key()) { - optionals.set(1); - } - oprot.writeBitSet(optionals, 2); - if (struct.isSetHash_key()) { - struct.hash_key.write(oprot); - } - if (struct.isSetSort_key()) { - struct.sort_key.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, full_key struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(2); - if (incoming.get(0)) { - struct.hash_key = new blob(); - struct.hash_key.read(iprot); - struct.setHash_keyIsSet(true); - } - if (incoming.get(1)) { - struct.sort_key = new blob(); - struct.sort_key.read(iprot); - struct.setSort_keyIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } -} diff --git a/java-client/src/main/java/org/apache/pegasus/apps/get_scanner_request.java b/java-client/src/main/java/org/apache/pegasus/apps/get_scanner_request.java deleted file mode 100644 index 078f1907a8..0000000000 --- a/java-client/src/main/java/org/apache/pegasus/apps/get_scanner_request.java +++ /dev/null @@ -1,1772 +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. - */ - -/** - * Autogenerated by Thrift Compiler (0.11.0) - * - *

DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * - * @generated - */ -package org.apache.pegasus.apps; - -import org.apache.pegasus.base.blob; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated( - value = "Autogenerated by Thrift Compiler (0.11.0)", - date = "2021-10-15") -public class get_scanner_request - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("get_scanner_request"); - - private static final org.apache.thrift.protocol.TField START_KEY_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "start_key", org.apache.thrift.protocol.TType.STRUCT, (short) 1); - private static final org.apache.thrift.protocol.TField STOP_KEY_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "stop_key", org.apache.thrift.protocol.TType.STRUCT, (short) 2); - private static final org.apache.thrift.protocol.TField START_INCLUSIVE_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "start_inclusive", org.apache.thrift.protocol.TType.BOOL, (short) 3); - private static final org.apache.thrift.protocol.TField STOP_INCLUSIVE_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "stop_inclusive", org.apache.thrift.protocol.TType.BOOL, (short) 4); - private static final org.apache.thrift.protocol.TField BATCH_SIZE_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "batch_size", org.apache.thrift.protocol.TType.I32, (short) 5); - private static final org.apache.thrift.protocol.TField NO_VALUE_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "no_value", org.apache.thrift.protocol.TType.BOOL, (short) 6); - private static final org.apache.thrift.protocol.TField HASH_KEY_FILTER_TYPE_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "hash_key_filter_type", org.apache.thrift.protocol.TType.I32, (short) 7); - private static final org.apache.thrift.protocol.TField HASH_KEY_FILTER_PATTERN_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "hash_key_filter_pattern", org.apache.thrift.protocol.TType.STRUCT, (short) 8); - private static final org.apache.thrift.protocol.TField SORT_KEY_FILTER_TYPE_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "sort_key_filter_type", org.apache.thrift.protocol.TType.I32, (short) 9); - private static final org.apache.thrift.protocol.TField SORT_KEY_FILTER_PATTERN_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "sort_key_filter_pattern", org.apache.thrift.protocol.TType.STRUCT, (short) 10); - private static final org.apache.thrift.protocol.TField NEED_CHECK_HASH_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "need_check_hash", org.apache.thrift.protocol.TType.BOOL, (short) 11); - private static final org.apache.thrift.protocol.TField RETURN_EXPIRE_TS_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "return_expire_ts", org.apache.thrift.protocol.TType.BOOL, (short) 12); - private static final org.apache.thrift.protocol.TField FULL_SCAN_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "full_scan", org.apache.thrift.protocol.TType.BOOL, (short) 13); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new get_scanner_requestStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new get_scanner_requestTupleSchemeFactory(); - - public blob start_key; // required - public blob stop_key; // required - public boolean start_inclusive; // required - public boolean stop_inclusive; // required - public int batch_size; // required - public boolean no_value; // required - /** @see filter_type */ - public filter_type hash_key_filter_type; // required - - public blob hash_key_filter_pattern; // required - /** @see filter_type */ - public filter_type sort_key_filter_type; // required - - public blob sort_key_filter_pattern; // required - public boolean need_check_hash; // optional - public boolean return_expire_ts; // optional - public boolean full_scan; // 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_KEY((short) 1, "start_key"), - STOP_KEY((short) 2, "stop_key"), - START_INCLUSIVE((short) 3, "start_inclusive"), - STOP_INCLUSIVE((short) 4, "stop_inclusive"), - BATCH_SIZE((short) 5, "batch_size"), - NO_VALUE((short) 6, "no_value"), - /** @see filter_type */ - HASH_KEY_FILTER_TYPE((short) 7, "hash_key_filter_type"), - HASH_KEY_FILTER_PATTERN((short) 8, "hash_key_filter_pattern"), - /** @see filter_type */ - SORT_KEY_FILTER_TYPE((short) 9, "sort_key_filter_type"), - SORT_KEY_FILTER_PATTERN((short) 10, "sort_key_filter_pattern"), - NEED_CHECK_HASH((short) 11, "need_check_hash"), - RETURN_EXPIRE_TS((short) 12, "return_expire_ts"), - FULL_SCAN((short) 13, "full_scan"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** Find the _Fields constant that matches fieldId, or null if its not found. */ - public static _Fields findByThriftId(int fieldId) { - switch (fieldId) { - case 1: // START_KEY - return START_KEY; - case 2: // STOP_KEY - return STOP_KEY; - case 3: // START_INCLUSIVE - return START_INCLUSIVE; - case 4: // STOP_INCLUSIVE - return STOP_INCLUSIVE; - case 5: // BATCH_SIZE - return BATCH_SIZE; - case 6: // NO_VALUE - return NO_VALUE; - case 7: // HASH_KEY_FILTER_TYPE - return HASH_KEY_FILTER_TYPE; - case 8: // HASH_KEY_FILTER_PATTERN - return HASH_KEY_FILTER_PATTERN; - case 9: // SORT_KEY_FILTER_TYPE - return SORT_KEY_FILTER_TYPE; - case 10: // SORT_KEY_FILTER_PATTERN - return SORT_KEY_FILTER_PATTERN; - case 11: // NEED_CHECK_HASH - return NEED_CHECK_HASH; - case 12: // RETURN_EXPIRE_TS - return RETURN_EXPIRE_TS; - case 13: // FULL_SCAN - return FULL_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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __START_INCLUSIVE_ISSET_ID = 0; - private static final int __STOP_INCLUSIVE_ISSET_ID = 1; - private static final int __BATCH_SIZE_ISSET_ID = 2; - private static final int __NO_VALUE_ISSET_ID = 3; - private static final int __NEED_CHECK_HASH_ISSET_ID = 4; - private static final int __RETURN_EXPIRE_TS_ISSET_ID = 5; - private static final int __FULL_SCAN_ISSET_ID = 6; - private byte __isset_bitfield = 0; - private static final _Fields optionals[] = { - _Fields.NEED_CHECK_HASH, _Fields.RETURN_EXPIRE_TS, _Fields.FULL_SCAN - }; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put( - _Fields.START_KEY, - new org.apache.thrift.meta_data.FieldMetaData( - "start_key", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData( - org.apache.thrift.protocol.TType.STRUCT, blob.class))); - tmpMap.put( - _Fields.STOP_KEY, - new org.apache.thrift.meta_data.FieldMetaData( - "stop_key", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData( - org.apache.thrift.protocol.TType.STRUCT, blob.class))); - tmpMap.put( - _Fields.START_INCLUSIVE, - new org.apache.thrift.meta_data.FieldMetaData( - "start_inclusive", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.BOOL))); - tmpMap.put( - _Fields.STOP_INCLUSIVE, - new org.apache.thrift.meta_data.FieldMetaData( - "stop_inclusive", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.BOOL))); - tmpMap.put( - _Fields.BATCH_SIZE, - new org.apache.thrift.meta_data.FieldMetaData( - "batch_size", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I32))); - tmpMap.put( - _Fields.NO_VALUE, - new org.apache.thrift.meta_data.FieldMetaData( - "no_value", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.BOOL))); - tmpMap.put( - _Fields.HASH_KEY_FILTER_TYPE, - new org.apache.thrift.meta_data.FieldMetaData( - "hash_key_filter_type", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.EnumMetaData( - org.apache.thrift.protocol.TType.ENUM, filter_type.class))); - tmpMap.put( - _Fields.HASH_KEY_FILTER_PATTERN, - new org.apache.thrift.meta_data.FieldMetaData( - "hash_key_filter_pattern", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData( - org.apache.thrift.protocol.TType.STRUCT, blob.class))); - tmpMap.put( - _Fields.SORT_KEY_FILTER_TYPE, - new org.apache.thrift.meta_data.FieldMetaData( - "sort_key_filter_type", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.EnumMetaData( - org.apache.thrift.protocol.TType.ENUM, filter_type.class))); - tmpMap.put( - _Fields.SORT_KEY_FILTER_PATTERN, - new org.apache.thrift.meta_data.FieldMetaData( - "sort_key_filter_pattern", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData( - org.apache.thrift.protocol.TType.STRUCT, blob.class))); - tmpMap.put( - _Fields.NEED_CHECK_HASH, - new org.apache.thrift.meta_data.FieldMetaData( - "need_check_hash", - org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.BOOL))); - tmpMap.put( - _Fields.RETURN_EXPIRE_TS, - new org.apache.thrift.meta_data.FieldMetaData( - "return_expire_ts", - org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.BOOL))); - tmpMap.put( - _Fields.FULL_SCAN, - new org.apache.thrift.meta_data.FieldMetaData( - "full_scan", - org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.BOOL))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap( - get_scanner_request.class, metaDataMap); - } - - public get_scanner_request() {} - - public get_scanner_request( - blob start_key, - blob stop_key, - boolean start_inclusive, - boolean stop_inclusive, - int batch_size, - boolean no_value, - filter_type hash_key_filter_type, - blob hash_key_filter_pattern, - filter_type sort_key_filter_type, - blob sort_key_filter_pattern) { - this(); - this.start_key = start_key; - this.stop_key = stop_key; - this.start_inclusive = start_inclusive; - setStart_inclusiveIsSet(true); - this.stop_inclusive = stop_inclusive; - setStop_inclusiveIsSet(true); - this.batch_size = batch_size; - setBatch_sizeIsSet(true); - this.no_value = no_value; - setNo_valueIsSet(true); - this.hash_key_filter_type = hash_key_filter_type; - this.hash_key_filter_pattern = hash_key_filter_pattern; - this.sort_key_filter_type = sort_key_filter_type; - this.sort_key_filter_pattern = sort_key_filter_pattern; - } - - /** Performs a deep copy on other. */ - public get_scanner_request(get_scanner_request other) { - __isset_bitfield = other.__isset_bitfield; - if (other.isSetStart_key()) { - this.start_key = new blob(other.start_key); - } - if (other.isSetStop_key()) { - this.stop_key = new blob(other.stop_key); - } - this.start_inclusive = other.start_inclusive; - this.stop_inclusive = other.stop_inclusive; - this.batch_size = other.batch_size; - this.no_value = other.no_value; - if (other.isSetHash_key_filter_type()) { - this.hash_key_filter_type = other.hash_key_filter_type; - } - if (other.isSetHash_key_filter_pattern()) { - this.hash_key_filter_pattern = new blob(other.hash_key_filter_pattern); - } - if (other.isSetSort_key_filter_type()) { - this.sort_key_filter_type = other.sort_key_filter_type; - } - if (other.isSetSort_key_filter_pattern()) { - this.sort_key_filter_pattern = new blob(other.sort_key_filter_pattern); - } - this.need_check_hash = other.need_check_hash; - this.return_expire_ts = other.return_expire_ts; - this.full_scan = other.full_scan; - } - - public get_scanner_request deepCopy() { - return new get_scanner_request(this); - } - - @Override - public void clear() { - this.start_key = null; - this.stop_key = null; - setStart_inclusiveIsSet(false); - this.start_inclusive = false; - setStop_inclusiveIsSet(false); - this.stop_inclusive = false; - setBatch_sizeIsSet(false); - this.batch_size = 0; - setNo_valueIsSet(false); - this.no_value = false; - this.hash_key_filter_type = null; - this.hash_key_filter_pattern = null; - this.sort_key_filter_type = null; - this.sort_key_filter_pattern = null; - setNeed_check_hashIsSet(false); - this.need_check_hash = false; - setReturn_expire_tsIsSet(false); - this.return_expire_ts = false; - setFull_scanIsSet(false); - this.full_scan = false; - } - - public blob getStart_key() { - return this.start_key; - } - - public get_scanner_request setStart_key(blob start_key) { - this.start_key = start_key; - return this; - } - - public void unsetStart_key() { - this.start_key = null; - } - - /** Returns true if field start_key is set (has been assigned a value) and false otherwise */ - public boolean isSetStart_key() { - return this.start_key != null; - } - - public void setStart_keyIsSet(boolean value) { - if (!value) { - this.start_key = null; - } - } - - public blob getStop_key() { - return this.stop_key; - } - - public get_scanner_request setStop_key(blob stop_key) { - this.stop_key = stop_key; - return this; - } - - public void unsetStop_key() { - this.stop_key = null; - } - - /** Returns true if field stop_key is set (has been assigned a value) and false otherwise */ - public boolean isSetStop_key() { - return this.stop_key != null; - } - - public void setStop_keyIsSet(boolean value) { - if (!value) { - this.stop_key = null; - } - } - - public boolean isStart_inclusive() { - return this.start_inclusive; - } - - public get_scanner_request setStart_inclusive(boolean start_inclusive) { - this.start_inclusive = start_inclusive; - setStart_inclusiveIsSet(true); - return this; - } - - public void unsetStart_inclusive() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __START_INCLUSIVE_ISSET_ID); - } - - /** - * Returns true if field start_inclusive is set (has been assigned a value) and false otherwise - */ - public boolean isSetStart_inclusive() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __START_INCLUSIVE_ISSET_ID); - } - - public void setStart_inclusiveIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __START_INCLUSIVE_ISSET_ID, value); - } - - public boolean isStop_inclusive() { - return this.stop_inclusive; - } - - public get_scanner_request setStop_inclusive(boolean stop_inclusive) { - this.stop_inclusive = stop_inclusive; - setStop_inclusiveIsSet(true); - return this; - } - - public void unsetStop_inclusive() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __STOP_INCLUSIVE_ISSET_ID); - } - - /** Returns true if field stop_inclusive is set (has been assigned a value) and false otherwise */ - public boolean isSetStop_inclusive() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __STOP_INCLUSIVE_ISSET_ID); - } - - public void setStop_inclusiveIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __STOP_INCLUSIVE_ISSET_ID, value); - } - - public int getBatch_size() { - return this.batch_size; - } - - public get_scanner_request setBatch_size(int batch_size) { - this.batch_size = batch_size; - setBatch_sizeIsSet(true); - return this; - } - - public void unsetBatch_size() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __BATCH_SIZE_ISSET_ID); - } - - /** Returns true if field batch_size is set (has been assigned a value) and false otherwise */ - public boolean isSetBatch_size() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __BATCH_SIZE_ISSET_ID); - } - - public void setBatch_sizeIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __BATCH_SIZE_ISSET_ID, value); - } - - public boolean isNo_value() { - return this.no_value; - } - - public get_scanner_request setNo_value(boolean no_value) { - this.no_value = no_value; - setNo_valueIsSet(true); - return this; - } - - public void unsetNo_value() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __NO_VALUE_ISSET_ID); - } - - /** Returns true if field no_value is set (has been assigned a value) and false otherwise */ - public boolean isSetNo_value() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __NO_VALUE_ISSET_ID); - } - - public void setNo_valueIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __NO_VALUE_ISSET_ID, value); - } - - /** @see filter_type */ - public filter_type getHash_key_filter_type() { - return this.hash_key_filter_type; - } - - /** @see filter_type */ - public get_scanner_request setHash_key_filter_type(filter_type hash_key_filter_type) { - this.hash_key_filter_type = hash_key_filter_type; - return this; - } - - public void unsetHash_key_filter_type() { - this.hash_key_filter_type = null; - } - - /** - * Returns true if field hash_key_filter_type is set (has been assigned a value) and false - * otherwise - */ - public boolean isSetHash_key_filter_type() { - return this.hash_key_filter_type != null; - } - - public void setHash_key_filter_typeIsSet(boolean value) { - if (!value) { - this.hash_key_filter_type = null; - } - } - - public blob getHash_key_filter_pattern() { - return this.hash_key_filter_pattern; - } - - public get_scanner_request setHash_key_filter_pattern(blob hash_key_filter_pattern) { - this.hash_key_filter_pattern = hash_key_filter_pattern; - return this; - } - - public void unsetHash_key_filter_pattern() { - this.hash_key_filter_pattern = null; - } - - /** - * Returns true if field hash_key_filter_pattern is set (has been assigned a value) and false - * otherwise - */ - public boolean isSetHash_key_filter_pattern() { - return this.hash_key_filter_pattern != null; - } - - public void setHash_key_filter_patternIsSet(boolean value) { - if (!value) { - this.hash_key_filter_pattern = null; - } - } - - /** @see filter_type */ - public filter_type getSort_key_filter_type() { - return this.sort_key_filter_type; - } - - /** @see filter_type */ - public get_scanner_request setSort_key_filter_type(filter_type sort_key_filter_type) { - this.sort_key_filter_type = sort_key_filter_type; - return this; - } - - public void unsetSort_key_filter_type() { - this.sort_key_filter_type = null; - } - - /** - * Returns true if field sort_key_filter_type is set (has been assigned a value) and false - * otherwise - */ - public boolean isSetSort_key_filter_type() { - return this.sort_key_filter_type != null; - } - - public void setSort_key_filter_typeIsSet(boolean value) { - if (!value) { - this.sort_key_filter_type = null; - } - } - - public blob getSort_key_filter_pattern() { - return this.sort_key_filter_pattern; - } - - public get_scanner_request setSort_key_filter_pattern(blob sort_key_filter_pattern) { - this.sort_key_filter_pattern = sort_key_filter_pattern; - return this; - } - - public void unsetSort_key_filter_pattern() { - this.sort_key_filter_pattern = null; - } - - /** - * Returns true if field sort_key_filter_pattern is set (has been assigned a value) and false - * otherwise - */ - public boolean isSetSort_key_filter_pattern() { - return this.sort_key_filter_pattern != null; - } - - public void setSort_key_filter_patternIsSet(boolean value) { - if (!value) { - this.sort_key_filter_pattern = null; - } - } - - public boolean isNeed_check_hash() { - return this.need_check_hash; - } - - public get_scanner_request setNeed_check_hash(boolean need_check_hash) { - this.need_check_hash = need_check_hash; - setNeed_check_hashIsSet(true); - return this; - } - - public void unsetNeed_check_hash() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __NEED_CHECK_HASH_ISSET_ID); - } - - /** - * Returns true if field need_check_hash is set (has been assigned a value) and false otherwise - */ - public boolean isSetNeed_check_hash() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __NEED_CHECK_HASH_ISSET_ID); - } - - public void setNeed_check_hashIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __NEED_CHECK_HASH_ISSET_ID, value); - } - - public boolean isReturn_expire_ts() { - return this.return_expire_ts; - } - - public get_scanner_request setReturn_expire_ts(boolean return_expire_ts) { - this.return_expire_ts = return_expire_ts; - setReturn_expire_tsIsSet(true); - return this; - } - - public void unsetReturn_expire_ts() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __RETURN_EXPIRE_TS_ISSET_ID); - } - - /** - * Returns true if field return_expire_ts is set (has been assigned a value) and false otherwise - */ - public boolean isSetReturn_expire_ts() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __RETURN_EXPIRE_TS_ISSET_ID); - } - - public void setReturn_expire_tsIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit( - __isset_bitfield, __RETURN_EXPIRE_TS_ISSET_ID, value); - } - - public boolean isFull_scan() { - return this.full_scan; - } - - public get_scanner_request setFull_scan(boolean full_scan) { - this.full_scan = full_scan; - setFull_scanIsSet(true); - return this; - } - - public void unsetFull_scan() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __FULL_SCAN_ISSET_ID); - } - - /** Returns true if field full_scan is set (has been assigned a value) and false otherwise */ - public boolean isSetFull_scan() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __FULL_SCAN_ISSET_ID); - } - - public void setFull_scanIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __FULL_SCAN_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case START_KEY: - if (value == null) { - unsetStart_key(); - } else { - setStart_key((blob) value); - } - break; - - case STOP_KEY: - if (value == null) { - unsetStop_key(); - } else { - setStop_key((blob) value); - } - break; - - case START_INCLUSIVE: - if (value == null) { - unsetStart_inclusive(); - } else { - setStart_inclusive((java.lang.Boolean) value); - } - break; - - case STOP_INCLUSIVE: - if (value == null) { - unsetStop_inclusive(); - } else { - setStop_inclusive((java.lang.Boolean) value); - } - break; - - case BATCH_SIZE: - if (value == null) { - unsetBatch_size(); - } else { - setBatch_size((java.lang.Integer) value); - } - break; - - case NO_VALUE: - if (value == null) { - unsetNo_value(); - } else { - setNo_value((java.lang.Boolean) value); - } - break; - - case HASH_KEY_FILTER_TYPE: - if (value == null) { - unsetHash_key_filter_type(); - } else { - setHash_key_filter_type((filter_type) value); - } - break; - - case HASH_KEY_FILTER_PATTERN: - if (value == null) { - unsetHash_key_filter_pattern(); - } else { - setHash_key_filter_pattern((blob) value); - } - break; - - case SORT_KEY_FILTER_TYPE: - if (value == null) { - unsetSort_key_filter_type(); - } else { - setSort_key_filter_type((filter_type) value); - } - break; - - case SORT_KEY_FILTER_PATTERN: - if (value == null) { - unsetSort_key_filter_pattern(); - } else { - setSort_key_filter_pattern((blob) value); - } - break; - - case NEED_CHECK_HASH: - if (value == null) { - unsetNeed_check_hash(); - } else { - setNeed_check_hash((java.lang.Boolean) value); - } - break; - - case RETURN_EXPIRE_TS: - if (value == null) { - unsetReturn_expire_ts(); - } else { - setReturn_expire_ts((java.lang.Boolean) value); - } - break; - - case FULL_SCAN: - if (value == null) { - unsetFull_scan(); - } else { - setFull_scan((java.lang.Boolean) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case START_KEY: - return getStart_key(); - - case STOP_KEY: - return getStop_key(); - - case START_INCLUSIVE: - return isStart_inclusive(); - - case STOP_INCLUSIVE: - return isStop_inclusive(); - - case BATCH_SIZE: - return getBatch_size(); - - case NO_VALUE: - return isNo_value(); - - case HASH_KEY_FILTER_TYPE: - return getHash_key_filter_type(); - - case HASH_KEY_FILTER_PATTERN: - return getHash_key_filter_pattern(); - - case SORT_KEY_FILTER_TYPE: - return getSort_key_filter_type(); - - case SORT_KEY_FILTER_PATTERN: - return getSort_key_filter_pattern(); - - case NEED_CHECK_HASH: - return isNeed_check_hash(); - - case RETURN_EXPIRE_TS: - return isReturn_expire_ts(); - - case FULL_SCAN: - return isFull_scan(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case START_KEY: - return isSetStart_key(); - case STOP_KEY: - return isSetStop_key(); - case START_INCLUSIVE: - return isSetStart_inclusive(); - case STOP_INCLUSIVE: - return isSetStop_inclusive(); - case BATCH_SIZE: - return isSetBatch_size(); - case NO_VALUE: - return isSetNo_value(); - case HASH_KEY_FILTER_TYPE: - return isSetHash_key_filter_type(); - case HASH_KEY_FILTER_PATTERN: - return isSetHash_key_filter_pattern(); - case SORT_KEY_FILTER_TYPE: - return isSetSort_key_filter_type(); - case SORT_KEY_FILTER_PATTERN: - return isSetSort_key_filter_pattern(); - case NEED_CHECK_HASH: - return isSetNeed_check_hash(); - case RETURN_EXPIRE_TS: - return isSetReturn_expire_ts(); - case FULL_SCAN: - return isSetFull_scan(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof get_scanner_request) return this.equals((get_scanner_request) that); - return false; - } - - public boolean equals(get_scanner_request that) { - if (that == null) return false; - if (this == that) return true; - - boolean this_present_start_key = true && this.isSetStart_key(); - boolean that_present_start_key = true && that.isSetStart_key(); - if (this_present_start_key || that_present_start_key) { - if (!(this_present_start_key && that_present_start_key)) return false; - if (!this.start_key.equals(that.start_key)) return false; - } - - boolean this_present_stop_key = true && this.isSetStop_key(); - boolean that_present_stop_key = true && that.isSetStop_key(); - if (this_present_stop_key || that_present_stop_key) { - if (!(this_present_stop_key && that_present_stop_key)) return false; - if (!this.stop_key.equals(that.stop_key)) return false; - } - - boolean this_present_start_inclusive = true; - boolean that_present_start_inclusive = true; - if (this_present_start_inclusive || that_present_start_inclusive) { - if (!(this_present_start_inclusive && that_present_start_inclusive)) return false; - if (this.start_inclusive != that.start_inclusive) return false; - } - - boolean this_present_stop_inclusive = true; - boolean that_present_stop_inclusive = true; - if (this_present_stop_inclusive || that_present_stop_inclusive) { - if (!(this_present_stop_inclusive && that_present_stop_inclusive)) return false; - if (this.stop_inclusive != that.stop_inclusive) return false; - } - - boolean this_present_batch_size = true; - boolean that_present_batch_size = true; - if (this_present_batch_size || that_present_batch_size) { - if (!(this_present_batch_size && that_present_batch_size)) return false; - if (this.batch_size != that.batch_size) return false; - } - - boolean this_present_no_value = true; - boolean that_present_no_value = true; - if (this_present_no_value || that_present_no_value) { - if (!(this_present_no_value && that_present_no_value)) return false; - if (this.no_value != that.no_value) return false; - } - - boolean this_present_hash_key_filter_type = true && this.isSetHash_key_filter_type(); - boolean that_present_hash_key_filter_type = true && that.isSetHash_key_filter_type(); - if (this_present_hash_key_filter_type || that_present_hash_key_filter_type) { - if (!(this_present_hash_key_filter_type && that_present_hash_key_filter_type)) return false; - if (!this.hash_key_filter_type.equals(that.hash_key_filter_type)) return false; - } - - boolean this_present_hash_key_filter_pattern = true && this.isSetHash_key_filter_pattern(); - boolean that_present_hash_key_filter_pattern = true && that.isSetHash_key_filter_pattern(); - if (this_present_hash_key_filter_pattern || that_present_hash_key_filter_pattern) { - if (!(this_present_hash_key_filter_pattern && that_present_hash_key_filter_pattern)) - return false; - if (!this.hash_key_filter_pattern.equals(that.hash_key_filter_pattern)) return false; - } - - boolean this_present_sort_key_filter_type = true && this.isSetSort_key_filter_type(); - boolean that_present_sort_key_filter_type = true && that.isSetSort_key_filter_type(); - if (this_present_sort_key_filter_type || that_present_sort_key_filter_type) { - if (!(this_present_sort_key_filter_type && that_present_sort_key_filter_type)) return false; - if (!this.sort_key_filter_type.equals(that.sort_key_filter_type)) return false; - } - - boolean this_present_sort_key_filter_pattern = true && this.isSetSort_key_filter_pattern(); - boolean that_present_sort_key_filter_pattern = true && that.isSetSort_key_filter_pattern(); - if (this_present_sort_key_filter_pattern || that_present_sort_key_filter_pattern) { - if (!(this_present_sort_key_filter_pattern && that_present_sort_key_filter_pattern)) - return false; - if (!this.sort_key_filter_pattern.equals(that.sort_key_filter_pattern)) return false; - } - - boolean this_present_need_check_hash = true && this.isSetNeed_check_hash(); - boolean that_present_need_check_hash = true && that.isSetNeed_check_hash(); - if (this_present_need_check_hash || that_present_need_check_hash) { - if (!(this_present_need_check_hash && that_present_need_check_hash)) return false; - if (this.need_check_hash != that.need_check_hash) return false; - } - - boolean this_present_return_expire_ts = true && this.isSetReturn_expire_ts(); - boolean that_present_return_expire_ts = true && that.isSetReturn_expire_ts(); - if (this_present_return_expire_ts || that_present_return_expire_ts) { - if (!(this_present_return_expire_ts && that_present_return_expire_ts)) return false; - if (this.return_expire_ts != that.return_expire_ts) return false; - } - - boolean this_present_full_scan = true && this.isSetFull_scan(); - boolean that_present_full_scan = true && that.isSetFull_scan(); - if (this_present_full_scan || that_present_full_scan) { - if (!(this_present_full_scan && that_present_full_scan)) return false; - if (this.full_scan != that.full_scan) return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetStart_key()) ? 131071 : 524287); - if (isSetStart_key()) hashCode = hashCode * 8191 + start_key.hashCode(); - - hashCode = hashCode * 8191 + ((isSetStop_key()) ? 131071 : 524287); - if (isSetStop_key()) hashCode = hashCode * 8191 + stop_key.hashCode(); - - hashCode = hashCode * 8191 + ((start_inclusive) ? 131071 : 524287); - - hashCode = hashCode * 8191 + ((stop_inclusive) ? 131071 : 524287); - - hashCode = hashCode * 8191 + batch_size; - - hashCode = hashCode * 8191 + ((no_value) ? 131071 : 524287); - - hashCode = hashCode * 8191 + ((isSetHash_key_filter_type()) ? 131071 : 524287); - if (isSetHash_key_filter_type()) hashCode = hashCode * 8191 + hash_key_filter_type.getValue(); - - hashCode = hashCode * 8191 + ((isSetHash_key_filter_pattern()) ? 131071 : 524287); - if (isSetHash_key_filter_pattern()) - hashCode = hashCode * 8191 + hash_key_filter_pattern.hashCode(); - - hashCode = hashCode * 8191 + ((isSetSort_key_filter_type()) ? 131071 : 524287); - if (isSetSort_key_filter_type()) hashCode = hashCode * 8191 + sort_key_filter_type.getValue(); - - hashCode = hashCode * 8191 + ((isSetSort_key_filter_pattern()) ? 131071 : 524287); - if (isSetSort_key_filter_pattern()) - hashCode = hashCode * 8191 + sort_key_filter_pattern.hashCode(); - - hashCode = hashCode * 8191 + ((isSetNeed_check_hash()) ? 131071 : 524287); - if (isSetNeed_check_hash()) hashCode = hashCode * 8191 + ((need_check_hash) ? 131071 : 524287); - - hashCode = hashCode * 8191 + ((isSetReturn_expire_ts()) ? 131071 : 524287); - if (isSetReturn_expire_ts()) - hashCode = hashCode * 8191 + ((return_expire_ts) ? 131071 : 524287); - - hashCode = hashCode * 8191 + ((isSetFull_scan()) ? 131071 : 524287); - if (isSetFull_scan()) hashCode = hashCode * 8191 + ((full_scan) ? 131071 : 524287); - - return hashCode; - } - - @Override - public int compareTo(get_scanner_request other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetStart_key()).compareTo(other.isSetStart_key()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStart_key()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.start_key, other.start_key); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetStop_key()).compareTo(other.isSetStop_key()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStop_key()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stop_key, other.stop_key); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetStart_inclusive()).compareTo(other.isSetStart_inclusive()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStart_inclusive()) { - lastComparison = - org.apache.thrift.TBaseHelper.compareTo(this.start_inclusive, other.start_inclusive); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetStop_inclusive()).compareTo(other.isSetStop_inclusive()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStop_inclusive()) { - lastComparison = - org.apache.thrift.TBaseHelper.compareTo(this.stop_inclusive, other.stop_inclusive); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetBatch_size()).compareTo(other.isSetBatch_size()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetBatch_size()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.batch_size, other.batch_size); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetNo_value()).compareTo(other.isSetNo_value()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetNo_value()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.no_value, other.no_value); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetHash_key_filter_type()) - .compareTo(other.isSetHash_key_filter_type()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetHash_key_filter_type()) { - lastComparison = - org.apache.thrift.TBaseHelper.compareTo( - this.hash_key_filter_type, other.hash_key_filter_type); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetHash_key_filter_pattern()) - .compareTo(other.isSetHash_key_filter_pattern()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetHash_key_filter_pattern()) { - lastComparison = - org.apache.thrift.TBaseHelper.compareTo( - this.hash_key_filter_pattern, other.hash_key_filter_pattern); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetSort_key_filter_type()) - .compareTo(other.isSetSort_key_filter_type()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSort_key_filter_type()) { - lastComparison = - org.apache.thrift.TBaseHelper.compareTo( - this.sort_key_filter_type, other.sort_key_filter_type); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetSort_key_filter_pattern()) - .compareTo(other.isSetSort_key_filter_pattern()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSort_key_filter_pattern()) { - lastComparison = - org.apache.thrift.TBaseHelper.compareTo( - this.sort_key_filter_pattern, other.sort_key_filter_pattern); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetNeed_check_hash()).compareTo(other.isSetNeed_check_hash()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetNeed_check_hash()) { - lastComparison = - org.apache.thrift.TBaseHelper.compareTo(this.need_check_hash, other.need_check_hash); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetReturn_expire_ts()).compareTo(other.isSetReturn_expire_ts()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReturn_expire_ts()) { - lastComparison = - org.apache.thrift.TBaseHelper.compareTo(this.return_expire_ts, other.return_expire_ts); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetFull_scan()).compareTo(other.isSetFull_scan()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetFull_scan()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.full_scan, other.full_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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("get_scanner_request("); - boolean first = true; - - sb.append("start_key:"); - if (this.start_key == null) { - sb.append("null"); - } else { - sb.append(this.start_key); - } - first = false; - if (!first) sb.append(", "); - sb.append("stop_key:"); - if (this.stop_key == null) { - sb.append("null"); - } else { - sb.append(this.stop_key); - } - first = false; - if (!first) sb.append(", "); - sb.append("start_inclusive:"); - sb.append(this.start_inclusive); - first = false; - if (!first) sb.append(", "); - sb.append("stop_inclusive:"); - sb.append(this.stop_inclusive); - first = false; - if (!first) sb.append(", "); - sb.append("batch_size:"); - sb.append(this.batch_size); - first = false; - if (!first) sb.append(", "); - sb.append("no_value:"); - sb.append(this.no_value); - first = false; - if (!first) sb.append(", "); - sb.append("hash_key_filter_type:"); - if (this.hash_key_filter_type == null) { - sb.append("null"); - } else { - sb.append(this.hash_key_filter_type); - } - first = false; - if (!first) sb.append(", "); - sb.append("hash_key_filter_pattern:"); - if (this.hash_key_filter_pattern == null) { - sb.append("null"); - } else { - sb.append(this.hash_key_filter_pattern); - } - first = false; - if (!first) sb.append(", "); - sb.append("sort_key_filter_type:"); - if (this.sort_key_filter_type == null) { - sb.append("null"); - } else { - sb.append(this.sort_key_filter_type); - } - first = false; - if (!first) sb.append(", "); - sb.append("sort_key_filter_pattern:"); - if (this.sort_key_filter_pattern == null) { - sb.append("null"); - } else { - sb.append(this.sort_key_filter_pattern); - } - first = false; - if (isSetNeed_check_hash()) { - if (!first) sb.append(", "); - sb.append("need_check_hash:"); - sb.append(this.need_check_hash); - first = false; - } - if (isSetReturn_expire_ts()) { - if (!first) sb.append(", "); - sb.append("return_expire_ts:"); - sb.append(this.return_expire_ts); - first = false; - } - if (isSetFull_scan()) { - if (!first) sb.append(", "); - sb.append("full_scan:"); - sb.append(this.full_scan); - 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 (start_key != null) { - start_key.validate(); - } - if (stop_key != null) { - stop_key.validate(); - } - if (hash_key_filter_pattern != null) { - hash_key_filter_pattern.validate(); - } - if (sort_key_filter_pattern != null) { - sort_key_filter_pattern.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, java.lang.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 get_scanner_requestStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public get_scanner_requestStandardScheme getScheme() { - return new get_scanner_requestStandardScheme(); - } - } - - private static class get_scanner_requestStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, get_scanner_request struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // START_KEY - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.start_key = new blob(); - struct.start_key.read(iprot); - struct.setStart_keyIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // STOP_KEY - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.stop_key = new blob(); - struct.stop_key.read(iprot); - struct.setStop_keyIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // START_INCLUSIVE - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.start_inclusive = iprot.readBool(); - struct.setStart_inclusiveIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // STOP_INCLUSIVE - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.stop_inclusive = iprot.readBool(); - struct.setStop_inclusiveIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 5: // BATCH_SIZE - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.batch_size = iprot.readI32(); - struct.setBatch_sizeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 6: // NO_VALUE - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.no_value = iprot.readBool(); - struct.setNo_valueIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 7: // HASH_KEY_FILTER_TYPE - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.hash_key_filter_type = filter_type.findByValue(iprot.readI32()); - struct.setHash_key_filter_typeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 8: // HASH_KEY_FILTER_PATTERN - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.hash_key_filter_pattern = new blob(); - struct.hash_key_filter_pattern.read(iprot); - struct.setHash_key_filter_patternIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 9: // SORT_KEY_FILTER_TYPE - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.sort_key_filter_type = filter_type.findByValue(iprot.readI32()); - struct.setSort_key_filter_typeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 10: // SORT_KEY_FILTER_PATTERN - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.sort_key_filter_pattern = new blob(); - struct.sort_key_filter_pattern.read(iprot); - struct.setSort_key_filter_patternIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 11: // NEED_CHECK_HASH - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.need_check_hash = iprot.readBool(); - struct.setNeed_check_hashIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 12: // RETURN_EXPIRE_TS - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.return_expire_ts = iprot.readBool(); - struct.setReturn_expire_tsIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 13: // FULL_SCAN - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.full_scan = iprot.readBool(); - struct.setFull_scanIsSet(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_scanner_request struct) - throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.start_key != null) { - oprot.writeFieldBegin(START_KEY_FIELD_DESC); - struct.start_key.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.stop_key != null) { - oprot.writeFieldBegin(STOP_KEY_FIELD_DESC); - struct.stop_key.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(START_INCLUSIVE_FIELD_DESC); - oprot.writeBool(struct.start_inclusive); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(STOP_INCLUSIVE_FIELD_DESC); - oprot.writeBool(struct.stop_inclusive); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(BATCH_SIZE_FIELD_DESC); - oprot.writeI32(struct.batch_size); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(NO_VALUE_FIELD_DESC); - oprot.writeBool(struct.no_value); - oprot.writeFieldEnd(); - if (struct.hash_key_filter_type != null) { - oprot.writeFieldBegin(HASH_KEY_FILTER_TYPE_FIELD_DESC); - oprot.writeI32(struct.hash_key_filter_type.getValue()); - oprot.writeFieldEnd(); - } - if (struct.hash_key_filter_pattern != null) { - oprot.writeFieldBegin(HASH_KEY_FILTER_PATTERN_FIELD_DESC); - struct.hash_key_filter_pattern.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.sort_key_filter_type != null) { - oprot.writeFieldBegin(SORT_KEY_FILTER_TYPE_FIELD_DESC); - oprot.writeI32(struct.sort_key_filter_type.getValue()); - oprot.writeFieldEnd(); - } - if (struct.sort_key_filter_pattern != null) { - oprot.writeFieldBegin(SORT_KEY_FILTER_PATTERN_FIELD_DESC); - struct.sort_key_filter_pattern.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.isSetNeed_check_hash()) { - oprot.writeFieldBegin(NEED_CHECK_HASH_FIELD_DESC); - oprot.writeBool(struct.need_check_hash); - oprot.writeFieldEnd(); - } - if (struct.isSetReturn_expire_ts()) { - oprot.writeFieldBegin(RETURN_EXPIRE_TS_FIELD_DESC); - oprot.writeBool(struct.return_expire_ts); - oprot.writeFieldEnd(); - } - if (struct.isSetFull_scan()) { - oprot.writeFieldBegin(FULL_SCAN_FIELD_DESC); - oprot.writeBool(struct.full_scan); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class get_scanner_requestTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public get_scanner_requestTupleScheme getScheme() { - return new get_scanner_requestTupleScheme(); - } - } - - private static class get_scanner_requestTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, get_scanner_request struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetStart_key()) { - optionals.set(0); - } - if (struct.isSetStop_key()) { - optionals.set(1); - } - if (struct.isSetStart_inclusive()) { - optionals.set(2); - } - if (struct.isSetStop_inclusive()) { - optionals.set(3); - } - if (struct.isSetBatch_size()) { - optionals.set(4); - } - if (struct.isSetNo_value()) { - optionals.set(5); - } - if (struct.isSetHash_key_filter_type()) { - optionals.set(6); - } - if (struct.isSetHash_key_filter_pattern()) { - optionals.set(7); - } - if (struct.isSetSort_key_filter_type()) { - optionals.set(8); - } - if (struct.isSetSort_key_filter_pattern()) { - optionals.set(9); - } - if (struct.isSetNeed_check_hash()) { - optionals.set(10); - } - if (struct.isSetReturn_expire_ts()) { - optionals.set(11); - } - if (struct.isSetFull_scan()) { - optionals.set(12); - } - oprot.writeBitSet(optionals, 13); - if (struct.isSetStart_key()) { - struct.start_key.write(oprot); - } - if (struct.isSetStop_key()) { - struct.stop_key.write(oprot); - } - if (struct.isSetStart_inclusive()) { - oprot.writeBool(struct.start_inclusive); - } - if (struct.isSetStop_inclusive()) { - oprot.writeBool(struct.stop_inclusive); - } - if (struct.isSetBatch_size()) { - oprot.writeI32(struct.batch_size); - } - if (struct.isSetNo_value()) { - oprot.writeBool(struct.no_value); - } - if (struct.isSetHash_key_filter_type()) { - oprot.writeI32(struct.hash_key_filter_type.getValue()); - } - if (struct.isSetHash_key_filter_pattern()) { - struct.hash_key_filter_pattern.write(oprot); - } - if (struct.isSetSort_key_filter_type()) { - oprot.writeI32(struct.sort_key_filter_type.getValue()); - } - if (struct.isSetSort_key_filter_pattern()) { - struct.sort_key_filter_pattern.write(oprot); - } - if (struct.isSetNeed_check_hash()) { - oprot.writeBool(struct.need_check_hash); - } - if (struct.isSetReturn_expire_ts()) { - oprot.writeBool(struct.return_expire_ts); - } - if (struct.isSetFull_scan()) { - oprot.writeBool(struct.full_scan); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, get_scanner_request struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(13); - if (incoming.get(0)) { - struct.start_key = new blob(); - struct.start_key.read(iprot); - struct.setStart_keyIsSet(true); - } - if (incoming.get(1)) { - struct.stop_key = new blob(); - struct.stop_key.read(iprot); - struct.setStop_keyIsSet(true); - } - if (incoming.get(2)) { - struct.start_inclusive = iprot.readBool(); - struct.setStart_inclusiveIsSet(true); - } - if (incoming.get(3)) { - struct.stop_inclusive = iprot.readBool(); - struct.setStop_inclusiveIsSet(true); - } - if (incoming.get(4)) { - struct.batch_size = iprot.readI32(); - struct.setBatch_sizeIsSet(true); - } - if (incoming.get(5)) { - struct.no_value = iprot.readBool(); - struct.setNo_valueIsSet(true); - } - if (incoming.get(6)) { - struct.hash_key_filter_type = filter_type.findByValue(iprot.readI32()); - struct.setHash_key_filter_typeIsSet(true); - } - if (incoming.get(7)) { - struct.hash_key_filter_pattern = new blob(); - struct.hash_key_filter_pattern.read(iprot); - struct.setHash_key_filter_patternIsSet(true); - } - if (incoming.get(8)) { - struct.sort_key_filter_type = filter_type.findByValue(iprot.readI32()); - struct.setSort_key_filter_typeIsSet(true); - } - if (incoming.get(9)) { - struct.sort_key_filter_pattern = new blob(); - struct.sort_key_filter_pattern.read(iprot); - struct.setSort_key_filter_patternIsSet(true); - } - if (incoming.get(10)) { - struct.need_check_hash = iprot.readBool(); - struct.setNeed_check_hashIsSet(true); - } - if (incoming.get(11)) { - struct.return_expire_ts = iprot.readBool(); - struct.setReturn_expire_tsIsSet(true); - } - if (incoming.get(12)) { - struct.full_scan = iprot.readBool(); - struct.setFull_scanIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } -} diff --git a/java-client/src/main/java/org/apache/pegasus/apps/incr_request.java b/java-client/src/main/java/org/apache/pegasus/apps/incr_request.java deleted file mode 100644 index dc8b6504a3..0000000000 --- a/java-client/src/main/java/org/apache/pegasus/apps/incr_request.java +++ /dev/null @@ -1,635 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.11.0) - * - *

DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * - * @generated - */ -package org.apache.pegasus.apps; - -import org.apache.pegasus.base.blob; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated( - value = "Autogenerated by Thrift Compiler (0.11.0)", - date = "2020-04-13") -public class incr_request - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("incr_request"); - - private static final org.apache.thrift.protocol.TField KEY_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "key", org.apache.thrift.protocol.TType.STRUCT, (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.I64, (short) 2); - private static final org.apache.thrift.protocol.TField EXPIRE_TS_SECONDS_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "expire_ts_seconds", org.apache.thrift.protocol.TType.I32, (short) 3); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new incr_requestStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new incr_requestTupleSchemeFactory(); - - public blob key; // required - public long increment; // required - public int expire_ts_seconds; // 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 { - KEY((short) 1, "key"), - INCREMENT((short) 2, "increment"), - EXPIRE_TS_SECONDS((short) 3, "expire_ts_seconds"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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: // KEY - return KEY; - case 2: // INCREMENT - return INCREMENT; - case 3: // EXPIRE_TS_SECONDS - return EXPIRE_TS_SECONDS; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __INCREMENT_ISSET_ID = 0; - private static final int __EXPIRE_TS_SECONDS_ISSET_ID = 1; - private byte __isset_bitfield = 0; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put( - _Fields.KEY, - new org.apache.thrift.meta_data.FieldMetaData( - "key", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData( - org.apache.thrift.protocol.TType.STRUCT, blob.class))); - tmpMap.put( - _Fields.INCREMENT, - new org.apache.thrift.meta_data.FieldMetaData( - "increment", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I64))); - tmpMap.put( - _Fields.EXPIRE_TS_SECONDS, - new org.apache.thrift.meta_data.FieldMetaData( - "expire_ts_seconds", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I32))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(incr_request.class, metaDataMap); - } - - public incr_request() {} - - public incr_request(blob key, long increment, int expire_ts_seconds) { - this(); - this.key = key; - this.increment = increment; - setIncrementIsSet(true); - this.expire_ts_seconds = expire_ts_seconds; - setExpire_ts_secondsIsSet(true); - } - - /** Performs a deep copy on other. */ - public incr_request(incr_request other) { - __isset_bitfield = other.__isset_bitfield; - if (other.isSetKey()) { - this.key = new blob(other.key); - } - this.increment = other.increment; - this.expire_ts_seconds = other.expire_ts_seconds; - } - - public incr_request deepCopy() { - return new incr_request(this); - } - - @Override - public void clear() { - this.key = null; - setIncrementIsSet(false); - this.increment = 0; - setExpire_ts_secondsIsSet(false); - this.expire_ts_seconds = 0; - } - - public blob getKey() { - return this.key; - } - - public incr_request setKey(blob key) { - this.key = key; - return this; - } - - public void unsetKey() { - this.key = null; - } - - /** Returns true if field key is set (has been assigned a value) and false otherwise */ - public boolean isSetKey() { - return this.key != null; - } - - public void setKeyIsSet(boolean value) { - if (!value) { - this.key = null; - } - } - - public long getIncrement() { - return this.increment; - } - - public incr_request setIncrement(long increment) { - this.increment = increment; - setIncrementIsSet(true); - return this; - } - - public void unsetIncrement() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __INCREMENT_ISSET_ID); - } - - /** Returns true if field increment is set (has been assigned a value) and false otherwise */ - public boolean isSetIncrement() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __INCREMENT_ISSET_ID); - } - - public void setIncrementIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __INCREMENT_ISSET_ID, value); - } - - public int getExpire_ts_seconds() { - return this.expire_ts_seconds; - } - - public incr_request setExpire_ts_seconds(int expire_ts_seconds) { - this.expire_ts_seconds = expire_ts_seconds; - setExpire_ts_secondsIsSet(true); - return this; - } - - public void unsetExpire_ts_seconds() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __EXPIRE_TS_SECONDS_ISSET_ID); - } - - /** - * Returns true if field expire_ts_seconds is set (has been assigned a value) and false otherwise - */ - public boolean isSetExpire_ts_seconds() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __EXPIRE_TS_SECONDS_ISSET_ID); - } - - public void setExpire_ts_secondsIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit( - __isset_bitfield, __EXPIRE_TS_SECONDS_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case KEY: - if (value == null) { - unsetKey(); - } else { - setKey((blob) value); - } - break; - - case INCREMENT: - if (value == null) { - unsetIncrement(); - } else { - setIncrement((java.lang.Long) value); - } - break; - - case EXPIRE_TS_SECONDS: - if (value == null) { - unsetExpire_ts_seconds(); - } else { - setExpire_ts_seconds((java.lang.Integer) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case KEY: - return getKey(); - - case INCREMENT: - return getIncrement(); - - case EXPIRE_TS_SECONDS: - return getExpire_ts_seconds(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case KEY: - return isSetKey(); - case INCREMENT: - return isSetIncrement(); - case EXPIRE_TS_SECONDS: - return isSetExpire_ts_seconds(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof incr_request) return this.equals((incr_request) that); - return false; - } - - public boolean equals(incr_request that) { - if (that == null) return false; - if (this == that) return true; - - boolean this_present_key = true && this.isSetKey(); - boolean that_present_key = true && that.isSetKey(); - if (this_present_key || that_present_key) { - if (!(this_present_key && that_present_key)) return false; - if (!this.key.equals(that.key)) return false; - } - - boolean this_present_increment = true; - boolean that_present_increment = true; - if (this_present_increment || that_present_increment) { - if (!(this_present_increment && that_present_increment)) return false; - if (this.increment != that.increment) return false; - } - - boolean this_present_expire_ts_seconds = true; - boolean that_present_expire_ts_seconds = true; - if (this_present_expire_ts_seconds || that_present_expire_ts_seconds) { - if (!(this_present_expire_ts_seconds && that_present_expire_ts_seconds)) return false; - if (this.expire_ts_seconds != that.expire_ts_seconds) return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetKey()) ? 131071 : 524287); - if (isSetKey()) hashCode = hashCode * 8191 + key.hashCode(); - - hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(increment); - - hashCode = hashCode * 8191 + expire_ts_seconds; - - return hashCode; - } - - @Override - public int compareTo(incr_request other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetKey()).compareTo(other.isSetKey()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetKey()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.key, other.key); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetIncrement()).compareTo(other.isSetIncrement()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetIncrement()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.increment, other.increment); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetExpire_ts_seconds()) - .compareTo(other.isSetExpire_ts_seconds()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetExpire_ts_seconds()) { - lastComparison = - org.apache.thrift.TBaseHelper.compareTo(this.expire_ts_seconds, other.expire_ts_seconds); - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("incr_request("); - boolean first = true; - - sb.append("key:"); - if (this.key == null) { - sb.append("null"); - } else { - sb.append(this.key); - } - first = false; - if (!first) sb.append(", "); - sb.append("increment:"); - sb.append(this.increment); - first = false; - if (!first) sb.append(", "); - sb.append("expire_ts_seconds:"); - sb.append(this.expire_ts_seconds); - 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 (key != null) { - key.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, java.lang.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 incr_requestStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public incr_requestStandardScheme getScheme() { - return new incr_requestStandardScheme(); - } - } - - private static class incr_requestStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, incr_request 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: // KEY - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.key = new blob(); - struct.key.read(iprot); - struct.setKeyIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // INCREMENT - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.increment = iprot.readI64(); - struct.setIncrementIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // EXPIRE_TS_SECONDS - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.expire_ts_seconds = iprot.readI32(); - struct.setExpire_ts_secondsIsSet(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, incr_request struct) - throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.key != null) { - oprot.writeFieldBegin(KEY_FIELD_DESC); - struct.key.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(INCREMENT_FIELD_DESC); - oprot.writeI64(struct.increment); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(EXPIRE_TS_SECONDS_FIELD_DESC); - oprot.writeI32(struct.expire_ts_seconds); - oprot.writeFieldEnd(); - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class incr_requestTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public incr_requestTupleScheme getScheme() { - return new incr_requestTupleScheme(); - } - } - - private static class incr_requestTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, incr_request struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetKey()) { - optionals.set(0); - } - if (struct.isSetIncrement()) { - optionals.set(1); - } - if (struct.isSetExpire_ts_seconds()) { - optionals.set(2); - } - oprot.writeBitSet(optionals, 3); - if (struct.isSetKey()) { - struct.key.write(oprot); - } - if (struct.isSetIncrement()) { - oprot.writeI64(struct.increment); - } - if (struct.isSetExpire_ts_seconds()) { - oprot.writeI32(struct.expire_ts_seconds); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, incr_request struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(3); - if (incoming.get(0)) { - struct.key = new blob(); - struct.key.read(iprot); - struct.setKeyIsSet(true); - } - if (incoming.get(1)) { - struct.increment = iprot.readI64(); - struct.setIncrementIsSet(true); - } - if (incoming.get(2)) { - struct.expire_ts_seconds = iprot.readI32(); - struct.setExpire_ts_secondsIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } -} diff --git a/java-client/src/main/java/org/apache/pegasus/apps/incr_response.java b/java-client/src/main/java/org/apache/pegasus/apps/incr_response.java deleted file mode 100644 index 7b67f8d12c..0000000000 --- a/java-client/src/main/java/org/apache/pegasus/apps/incr_response.java +++ /dev/null @@ -1,938 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.11.0) - * - *

DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * - * @generated - */ -package org.apache.pegasus.apps; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated( - value = "Autogenerated by Thrift Compiler (0.11.0)", - date = "2020-04-13") -public class incr_response - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("incr_response"); - - private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "error", org.apache.thrift.protocol.TType.I32, (short) 1); - private static final org.apache.thrift.protocol.TField NEW_VALUE_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "new_value", org.apache.thrift.protocol.TType.I64, (short) 2); - private static final org.apache.thrift.protocol.TField APP_ID_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "app_id", org.apache.thrift.protocol.TType.I32, (short) 3); - private static final org.apache.thrift.protocol.TField PARTITION_INDEX_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "partition_index", org.apache.thrift.protocol.TType.I32, (short) 4); - private static final org.apache.thrift.protocol.TField DECREE_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "decree", org.apache.thrift.protocol.TType.I64, (short) 5); - private static final org.apache.thrift.protocol.TField SERVER_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "server", org.apache.thrift.protocol.TType.STRING, (short) 6); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new incr_responseStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new incr_responseTupleSchemeFactory(); - - public int error; // required - public long new_value; // required - public int app_id; // required - public int partition_index; // required - public long decree; // required - public java.lang.String server; // 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 { - ERROR((short) 1, "error"), - NEW_VALUE((short) 2, "new_value"), - APP_ID((short) 3, "app_id"), - PARTITION_INDEX((short) 4, "partition_index"), - DECREE((short) 5, "decree"), - SERVER((short) 6, "server"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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: // ERROR - return ERROR; - case 2: // NEW_VALUE - return NEW_VALUE; - case 3: // APP_ID - return APP_ID; - case 4: // PARTITION_INDEX - return PARTITION_INDEX; - case 5: // DECREE - return DECREE; - case 6: // SERVER - return SERVER; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __ERROR_ISSET_ID = 0; - private static final int __NEW_VALUE_ISSET_ID = 1; - private static final int __APP_ID_ISSET_ID = 2; - private static final int __PARTITION_INDEX_ISSET_ID = 3; - private static final int __DECREE_ISSET_ID = 4; - private byte __isset_bitfield = 0; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put( - _Fields.ERROR, - new org.apache.thrift.meta_data.FieldMetaData( - "error", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I32))); - tmpMap.put( - _Fields.NEW_VALUE, - new org.apache.thrift.meta_data.FieldMetaData( - "new_value", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I64))); - tmpMap.put( - _Fields.APP_ID, - new org.apache.thrift.meta_data.FieldMetaData( - "app_id", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I32))); - tmpMap.put( - _Fields.PARTITION_INDEX, - new org.apache.thrift.meta_data.FieldMetaData( - "partition_index", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I32))); - tmpMap.put( - _Fields.DECREE, - new org.apache.thrift.meta_data.FieldMetaData( - "decree", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I64))); - tmpMap.put( - _Fields.SERVER, - new org.apache.thrift.meta_data.FieldMetaData( - "server", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.STRING))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap( - incr_response.class, metaDataMap); - } - - public incr_response() {} - - public incr_response( - int error, - long new_value, - int app_id, - int partition_index, - long decree, - java.lang.String server) { - this(); - this.error = error; - setErrorIsSet(true); - this.new_value = new_value; - setNew_valueIsSet(true); - this.app_id = app_id; - setApp_idIsSet(true); - this.partition_index = partition_index; - setPartition_indexIsSet(true); - this.decree = decree; - setDecreeIsSet(true); - this.server = server; - } - - /** Performs a deep copy on other. */ - public incr_response(incr_response other) { - __isset_bitfield = other.__isset_bitfield; - this.error = other.error; - this.new_value = other.new_value; - this.app_id = other.app_id; - this.partition_index = other.partition_index; - this.decree = other.decree; - if (other.isSetServer()) { - this.server = other.server; - } - } - - public incr_response deepCopy() { - return new incr_response(this); - } - - @Override - public void clear() { - setErrorIsSet(false); - this.error = 0; - setNew_valueIsSet(false); - this.new_value = 0; - setApp_idIsSet(false); - this.app_id = 0; - setPartition_indexIsSet(false); - this.partition_index = 0; - setDecreeIsSet(false); - this.decree = 0; - this.server = null; - } - - public int getError() { - return this.error; - } - - public incr_response setError(int error) { - this.error = error; - setErrorIsSet(true); - return this; - } - - public void unsetError() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ERROR_ISSET_ID); - } - - /** Returns true if field error is set (has been assigned a value) and false otherwise */ - public boolean isSetError() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ERROR_ISSET_ID); - } - - public void setErrorIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ERROR_ISSET_ID, value); - } - - public long getNew_value() { - return this.new_value; - } - - public incr_response setNew_value(long new_value) { - this.new_value = new_value; - setNew_valueIsSet(true); - return this; - } - - public void unsetNew_value() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __NEW_VALUE_ISSET_ID); - } - - /** Returns true if field new_value is set (has been assigned a value) and false otherwise */ - public boolean isSetNew_value() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __NEW_VALUE_ISSET_ID); - } - - public void setNew_valueIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __NEW_VALUE_ISSET_ID, value); - } - - public int getApp_id() { - return this.app_id; - } - - public incr_response setApp_id(int app_id) { - this.app_id = app_id; - setApp_idIsSet(true); - return this; - } - - public void unsetApp_id() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __APP_ID_ISSET_ID); - } - - /** Returns true if field app_id is set (has been assigned a value) and false otherwise */ - public boolean isSetApp_id() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __APP_ID_ISSET_ID); - } - - public void setApp_idIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __APP_ID_ISSET_ID, value); - } - - public int getPartition_index() { - return this.partition_index; - } - - public incr_response setPartition_index(int partition_index) { - this.partition_index = partition_index; - setPartition_indexIsSet(true); - return this; - } - - public void unsetPartition_index() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __PARTITION_INDEX_ISSET_ID); - } - - /** - * Returns true if field partition_index is set (has been assigned a value) and false otherwise - */ - public boolean isSetPartition_index() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __PARTITION_INDEX_ISSET_ID); - } - - public void setPartition_indexIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __PARTITION_INDEX_ISSET_ID, value); - } - - public long getDecree() { - return this.decree; - } - - public incr_response setDecree(long decree) { - this.decree = decree; - setDecreeIsSet(true); - return this; - } - - public void unsetDecree() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __DECREE_ISSET_ID); - } - - /** Returns true if field decree is set (has been assigned a value) and false otherwise */ - public boolean isSetDecree() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __DECREE_ISSET_ID); - } - - public void setDecreeIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __DECREE_ISSET_ID, value); - } - - public java.lang.String getServer() { - return this.server; - } - - public incr_response setServer(java.lang.String server) { - this.server = server; - return this; - } - - public void unsetServer() { - this.server = null; - } - - /** Returns true if field server is set (has been assigned a value) and false otherwise */ - public boolean isSetServer() { - return this.server != null; - } - - public void setServerIsSet(boolean value) { - if (!value) { - this.server = null; - } - } - - public void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case ERROR: - if (value == null) { - unsetError(); - } else { - setError((java.lang.Integer) value); - } - break; - - case NEW_VALUE: - if (value == null) { - unsetNew_value(); - } else { - setNew_value((java.lang.Long) value); - } - break; - - case APP_ID: - if (value == null) { - unsetApp_id(); - } else { - setApp_id((java.lang.Integer) value); - } - break; - - case PARTITION_INDEX: - if (value == null) { - unsetPartition_index(); - } else { - setPartition_index((java.lang.Integer) value); - } - break; - - case DECREE: - if (value == null) { - unsetDecree(); - } else { - setDecree((java.lang.Long) value); - } - break; - - case SERVER: - if (value == null) { - unsetServer(); - } else { - setServer((java.lang.String) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case ERROR: - return getError(); - - case NEW_VALUE: - return getNew_value(); - - case APP_ID: - return getApp_id(); - - case PARTITION_INDEX: - return getPartition_index(); - - case DECREE: - return getDecree(); - - case SERVER: - return getServer(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case ERROR: - return isSetError(); - case NEW_VALUE: - return isSetNew_value(); - case APP_ID: - return isSetApp_id(); - case PARTITION_INDEX: - return isSetPartition_index(); - case DECREE: - return isSetDecree(); - case SERVER: - return isSetServer(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof incr_response) return this.equals((incr_response) that); - return false; - } - - public boolean equals(incr_response that) { - if (that == null) return false; - if (this == that) return true; - - boolean this_present_error = true; - boolean that_present_error = true; - if (this_present_error || that_present_error) { - if (!(this_present_error && that_present_error)) return false; - if (this.error != that.error) return false; - } - - boolean this_present_new_value = true; - boolean that_present_new_value = true; - if (this_present_new_value || that_present_new_value) { - if (!(this_present_new_value && that_present_new_value)) return false; - if (this.new_value != that.new_value) return false; - } - - boolean this_present_app_id = true; - boolean that_present_app_id = true; - if (this_present_app_id || that_present_app_id) { - if (!(this_present_app_id && that_present_app_id)) return false; - if (this.app_id != that.app_id) return false; - } - - boolean this_present_partition_index = true; - boolean that_present_partition_index = true; - if (this_present_partition_index || that_present_partition_index) { - if (!(this_present_partition_index && that_present_partition_index)) return false; - if (this.partition_index != that.partition_index) return false; - } - - boolean this_present_decree = true; - boolean that_present_decree = true; - if (this_present_decree || that_present_decree) { - if (!(this_present_decree && that_present_decree)) return false; - if (this.decree != that.decree) return false; - } - - boolean this_present_server = true && this.isSetServer(); - boolean that_present_server = true && that.isSetServer(); - if (this_present_server || that_present_server) { - if (!(this_present_server && that_present_server)) return false; - if (!this.server.equals(that.server)) return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + error; - - hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(new_value); - - hashCode = hashCode * 8191 + app_id; - - hashCode = hashCode * 8191 + partition_index; - - hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(decree); - - hashCode = hashCode * 8191 + ((isSetServer()) ? 131071 : 524287); - if (isSetServer()) hashCode = hashCode * 8191 + server.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(incr_response other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetError()).compareTo(other.isSetError()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetError()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetNew_value()).compareTo(other.isSetNew_value()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetNew_value()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.new_value, other.new_value); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetApp_id()).compareTo(other.isSetApp_id()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetApp_id()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.app_id, other.app_id); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetPartition_index()).compareTo(other.isSetPartition_index()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetPartition_index()) { - lastComparison = - org.apache.thrift.TBaseHelper.compareTo(this.partition_index, other.partition_index); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetDecree()).compareTo(other.isSetDecree()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetDecree()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.decree, other.decree); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetServer()).compareTo(other.isSetServer()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetServer()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.server, other.server); - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("incr_response("); - boolean first = true; - - sb.append("error:"); - sb.append(this.error); - first = false; - if (!first) sb.append(", "); - sb.append("new_value:"); - sb.append(this.new_value); - first = false; - if (!first) sb.append(", "); - sb.append("app_id:"); - sb.append(this.app_id); - first = false; - if (!first) sb.append(", "); - sb.append("partition_index:"); - sb.append(this.partition_index); - first = false; - if (!first) sb.append(", "); - sb.append("decree:"); - sb.append(this.decree); - first = false; - if (!first) sb.append(", "); - sb.append("server:"); - if (this.server == null) { - sb.append("null"); - } else { - sb.append(this.server); - } - 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, java.lang.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 incr_responseStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public incr_responseStandardScheme getScheme() { - return new incr_responseStandardScheme(); - } - } - - private static class incr_responseStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, incr_response 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: // ERROR - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.error = iprot.readI32(); - struct.setErrorIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // NEW_VALUE - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.new_value = iprot.readI64(); - struct.setNew_valueIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // APP_ID - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.app_id = iprot.readI32(); - struct.setApp_idIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // PARTITION_INDEX - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.partition_index = iprot.readI32(); - struct.setPartition_indexIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 5: // DECREE - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.decree = iprot.readI64(); - struct.setDecreeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 6: // SERVER - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.server = iprot.readString(); - struct.setServerIsSet(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, incr_response struct) - throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(ERROR_FIELD_DESC); - oprot.writeI32(struct.error); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(NEW_VALUE_FIELD_DESC); - oprot.writeI64(struct.new_value); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(APP_ID_FIELD_DESC); - oprot.writeI32(struct.app_id); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(PARTITION_INDEX_FIELD_DESC); - oprot.writeI32(struct.partition_index); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(DECREE_FIELD_DESC); - oprot.writeI64(struct.decree); - oprot.writeFieldEnd(); - if (struct.server != null) { - oprot.writeFieldBegin(SERVER_FIELD_DESC); - oprot.writeString(struct.server); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class incr_responseTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public incr_responseTupleScheme getScheme() { - return new incr_responseTupleScheme(); - } - } - - private static class incr_responseTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, incr_response struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetError()) { - optionals.set(0); - } - if (struct.isSetNew_value()) { - optionals.set(1); - } - if (struct.isSetApp_id()) { - optionals.set(2); - } - if (struct.isSetPartition_index()) { - optionals.set(3); - } - if (struct.isSetDecree()) { - optionals.set(4); - } - if (struct.isSetServer()) { - optionals.set(5); - } - oprot.writeBitSet(optionals, 6); - if (struct.isSetError()) { - oprot.writeI32(struct.error); - } - if (struct.isSetNew_value()) { - oprot.writeI64(struct.new_value); - } - if (struct.isSetApp_id()) { - oprot.writeI32(struct.app_id); - } - if (struct.isSetPartition_index()) { - oprot.writeI32(struct.partition_index); - } - if (struct.isSetDecree()) { - oprot.writeI64(struct.decree); - } - if (struct.isSetServer()) { - oprot.writeString(struct.server); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, incr_response struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(6); - if (incoming.get(0)) { - struct.error = iprot.readI32(); - struct.setErrorIsSet(true); - } - if (incoming.get(1)) { - struct.new_value = iprot.readI64(); - struct.setNew_valueIsSet(true); - } - if (incoming.get(2)) { - struct.app_id = iprot.readI32(); - struct.setApp_idIsSet(true); - } - if (incoming.get(3)) { - struct.partition_index = iprot.readI32(); - struct.setPartition_indexIsSet(true); - } - if (incoming.get(4)) { - struct.decree = iprot.readI64(); - struct.setDecreeIsSet(true); - } - if (incoming.get(5)) { - struct.server = iprot.readString(); - struct.setServerIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } -} diff --git a/java-client/src/main/java/org/apache/pegasus/apps/key_value.java b/java-client/src/main/java/org/apache/pegasus/apps/key_value.java deleted file mode 100644 index ed778f8c88..0000000000 --- a/java-client/src/main/java/org/apache/pegasus/apps/key_value.java +++ /dev/null @@ -1,532 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.11.0) - * - *

DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * - * @generated - */ -package org.apache.pegasus.apps; - -import org.apache.pegasus.base.blob; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated( - value = "Autogenerated by Thrift Compiler (0.11.0)", - date = "2020-04-13") -public class key_value - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("key_value"); - - private static final org.apache.thrift.protocol.TField KEY_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "key", org.apache.thrift.protocol.TType.STRUCT, (short) 1); - private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "value", org.apache.thrift.protocol.TType.STRUCT, (short) 2); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new key_valueStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new key_valueTupleSchemeFactory(); - - public blob key; // required - public blob value; // required - - /** - * The set of fields this struct contains, along with convenience methods for finding and - * manipulating them. - */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - KEY((short) 1, "key"), - VALUE((short) 2, "value"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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: // KEY - return KEY; - case 2: // VALUE - return VALUE; - default: - return null; - } - } - - /** Find the _Fields constant that matches fieldId, throwing an exception if it is not found. */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) - throw new java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put( - _Fields.KEY, - new org.apache.thrift.meta_data.FieldMetaData( - "key", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData( - org.apache.thrift.protocol.TType.STRUCT, blob.class))); - tmpMap.put( - _Fields.VALUE, - new org.apache.thrift.meta_data.FieldMetaData( - "value", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData( - org.apache.thrift.protocol.TType.STRUCT, blob.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(key_value.class, metaDataMap); - } - - public key_value() {} - - public key_value(blob key, blob value) { - this(); - this.key = key; - this.value = value; - } - - /** Performs a deep copy on other. */ - public key_value(key_value other) { - if (other.isSetKey()) { - this.key = new blob(other.key); - } - if (other.isSetValue()) { - this.value = new blob(other.value); - } - } - - public key_value deepCopy() { - return new key_value(this); - } - - @Override - public void clear() { - this.key = null; - this.value = null; - } - - public blob getKey() { - return this.key; - } - - public key_value setKey(blob key) { - this.key = key; - return this; - } - - public void unsetKey() { - this.key = null; - } - - /** Returns true if field key is set (has been assigned a value) and false otherwise */ - public boolean isSetKey() { - return this.key != null; - } - - public void setKeyIsSet(boolean value) { - if (!value) { - this.key = null; - } - } - - public blob getValue() { - return this.value; - } - - public key_value setValue(blob 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 void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case KEY: - if (value == null) { - unsetKey(); - } else { - setKey((blob) value); - } - break; - - case VALUE: - if (value == null) { - unsetValue(); - } else { - setValue((blob) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case KEY: - return getKey(); - - case VALUE: - return getValue(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case KEY: - return isSetKey(); - case VALUE: - return isSetValue(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof key_value) return this.equals((key_value) that); - return false; - } - - public boolean equals(key_value that) { - if (that == null) return false; - if (this == that) return true; - - boolean this_present_key = true && this.isSetKey(); - boolean that_present_key = true && that.isSetKey(); - if (this_present_key || that_present_key) { - if (!(this_present_key && that_present_key)) return false; - if (!this.key.equals(that.key)) 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; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetKey()) ? 131071 : 524287); - if (isSetKey()) hashCode = hashCode * 8191 + key.hashCode(); - - hashCode = hashCode * 8191 + ((isSetValue()) ? 131071 : 524287); - if (isSetValue()) hashCode = hashCode * 8191 + value.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(key_value other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetKey()).compareTo(other.isSetKey()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetKey()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.key, other.key); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetValue()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, other.value); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("key_value("); - boolean first = true; - - sb.append("key:"); - if (this.key == null) { - sb.append("null"); - } else { - sb.append(this.key); - } - first = false; - if (!first) sb.append(", "); - sb.append("value:"); - if (this.value == null) { - sb.append("null"); - } else { - sb.append(this.value); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (key != null) { - key.validate(); - } - if (value != null) { - value.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, java.lang.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 key_valueStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public key_valueStandardScheme getScheme() { - return new key_valueStandardScheme(); - } - } - - private static class key_valueStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, key_value 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: // KEY - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.key = new blob(); - struct.key.read(iprot); - struct.setKeyIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // VALUE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.value = new blob(); - struct.value.read(iprot); - struct.setValueIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, key_value struct) - throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.key != null) { - oprot.writeFieldBegin(KEY_FIELD_DESC); - struct.key.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.value != null) { - oprot.writeFieldBegin(VALUE_FIELD_DESC); - struct.value.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class key_valueTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public key_valueTupleScheme getScheme() { - return new key_valueTupleScheme(); - } - } - - private static class key_valueTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, key_value struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetKey()) { - optionals.set(0); - } - if (struct.isSetValue()) { - optionals.set(1); - } - oprot.writeBitSet(optionals, 2); - if (struct.isSetKey()) { - struct.key.write(oprot); - } - if (struct.isSetValue()) { - struct.value.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, key_value struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(2); - if (incoming.get(0)) { - struct.key = new blob(); - struct.key.read(iprot); - struct.setKeyIsSet(true); - } - if (incoming.get(1)) { - struct.value = new blob(); - struct.value.read(iprot); - struct.setValueIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } -} diff --git a/java-client/src/main/java/org/apache/pegasus/apps/meta.java b/java-client/src/main/java/org/apache/pegasus/apps/meta.java deleted file mode 100644 index cb51bd8513..0000000000 --- a/java-client/src/main/java/org/apache/pegasus/apps/meta.java +++ /dev/null @@ -1,3144 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.11.0) - * - *

DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * - * @generated - */ -package org.apache.pegasus.apps; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated( - value = "Autogenerated by Thrift Compiler (0.11.0)", - date = "2022-05-17") -public class meta { - - public interface Iface { - - public org.apache.pegasus.replication.query_cfg_response query_cfg( - org.apache.pegasus.replication.query_cfg_request query) throws org.apache.thrift.TException; - - public org.apache.pegasus.replication.configuration_create_app_response create_app( - org.apache.pegasus.replication.configuration_create_app_request request) - throws org.apache.thrift.TException; - - public org.apache.pegasus.replication.configuration_drop_app_response drop_app( - org.apache.pegasus.replication.configuration_drop_app_request request) - throws org.apache.thrift.TException; - } - - public interface AsyncIface { - - public void query_cfg( - org.apache.pegasus.replication.query_cfg_request query, - org.apache.thrift.async.AsyncMethodCallback< - org.apache.pegasus.replication.query_cfg_response> - resultHandler) - throws org.apache.thrift.TException; - - public void create_app( - org.apache.pegasus.replication.configuration_create_app_request request, - org.apache.thrift.async.AsyncMethodCallback< - org.apache.pegasus.replication.configuration_create_app_response> - resultHandler) - throws org.apache.thrift.TException; - - public void drop_app( - org.apache.pegasus.replication.configuration_drop_app_request request, - org.apache.thrift.async.AsyncMethodCallback< - org.apache.pegasus.replication.configuration_drop_app_response> - 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 org.apache.pegasus.replication.query_cfg_response query_cfg( - org.apache.pegasus.replication.query_cfg_request query) - throws org.apache.thrift.TException { - send_query_cfg(query); - return recv_query_cfg(); - } - - public void send_query_cfg(org.apache.pegasus.replication.query_cfg_request query) - throws org.apache.thrift.TException { - query_cfg_args args = new query_cfg_args(); - args.setQuery(query); - sendBase("query_cfg", args); - } - - public org.apache.pegasus.replication.query_cfg_response recv_query_cfg() - throws org.apache.thrift.TException { - query_cfg_result result = new query_cfg_result(); - receiveBase(result, "query_cfg"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException( - org.apache.thrift.TApplicationException.MISSING_RESULT, - "query_cfg failed: unknown result"); - } - - public org.apache.pegasus.replication.configuration_create_app_response create_app( - org.apache.pegasus.replication.configuration_create_app_request request) - throws org.apache.thrift.TException { - send_create_app(request); - return recv_create_app(); - } - - public void send_create_app( - org.apache.pegasus.replication.configuration_create_app_request request) - throws org.apache.thrift.TException { - create_app_args args = new create_app_args(); - args.setRequest(request); - sendBase("create_app", args); - } - - public org.apache.pegasus.replication.configuration_create_app_response recv_create_app() - throws org.apache.thrift.TException { - create_app_result result = new create_app_result(); - receiveBase(result, "create_app"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException( - org.apache.thrift.TApplicationException.MISSING_RESULT, - "create_app failed: unknown result"); - } - - public org.apache.pegasus.replication.configuration_drop_app_response drop_app( - org.apache.pegasus.replication.configuration_drop_app_request request) - throws org.apache.thrift.TException { - send_drop_app(request); - return recv_drop_app(); - } - - public void send_drop_app(org.apache.pegasus.replication.configuration_drop_app_request request) - throws org.apache.thrift.TException { - drop_app_args args = new drop_app_args(); - args.setRequest(request); - sendBase("drop_app", args); - } - - public org.apache.pegasus.replication.configuration_drop_app_response recv_drop_app() - throws org.apache.thrift.TException { - drop_app_result result = new drop_app_result(); - receiveBase(result, "drop_app"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException( - org.apache.thrift.TApplicationException.MISSING_RESULT, - "drop_app failed: unknown result"); - } - } - - public static class AsyncClient extends org.apache.thrift.async.TAsyncClient - implements AsyncIface { - public static class Factory - implements org.apache.thrift.async.TAsyncClientFactory { - private org.apache.thrift.async.TAsyncClientManager clientManager; - private org.apache.thrift.protocol.TProtocolFactory protocolFactory; - - public Factory( - org.apache.thrift.async.TAsyncClientManager clientManager, - org.apache.thrift.protocol.TProtocolFactory protocolFactory) { - this.clientManager = clientManager; - this.protocolFactory = protocolFactory; - } - - public AsyncClient getAsyncClient( - org.apache.thrift.transport.TNonblockingTransport transport) { - return new AsyncClient(protocolFactory, clientManager, transport); - } - } - - public AsyncClient( - org.apache.thrift.protocol.TProtocolFactory protocolFactory, - org.apache.thrift.async.TAsyncClientManager clientManager, - org.apache.thrift.transport.TNonblockingTransport transport) { - super(protocolFactory, clientManager, transport); - } - - public void query_cfg( - org.apache.pegasus.replication.query_cfg_request query, - org.apache.thrift.async.AsyncMethodCallback< - org.apache.pegasus.replication.query_cfg_response> - resultHandler) - throws org.apache.thrift.TException { - checkReady(); - query_cfg_call method_call = - new query_cfg_call(query, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class query_cfg_call - extends org.apache.thrift.async.TAsyncMethodCall< - org.apache.pegasus.replication.query_cfg_response> { - private org.apache.pegasus.replication.query_cfg_request query; - - public query_cfg_call( - org.apache.pegasus.replication.query_cfg_request query, - org.apache.thrift.async.AsyncMethodCallback< - org.apache.pegasus.replication.query_cfg_response> - 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.query = query; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) - throws org.apache.thrift.TException { - prot.writeMessageBegin( - new org.apache.thrift.protocol.TMessage( - "query_cfg", org.apache.thrift.protocol.TMessageType.CALL, 0)); - query_cfg_args args = new query_cfg_args(); - args.setQuery(query); - args.write(prot); - prot.writeMessageEnd(); - } - - public org.apache.pegasus.replication.query_cfg_response getResult() - throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.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_query_cfg(); - } - } - - public void create_app( - org.apache.pegasus.replication.configuration_create_app_request request, - org.apache.thrift.async.AsyncMethodCallback< - org.apache.pegasus.replication.configuration_create_app_response> - resultHandler) - throws org.apache.thrift.TException { - checkReady(); - create_app_call method_call = - new create_app_call(request, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class create_app_call - extends org.apache.thrift.async.TAsyncMethodCall< - org.apache.pegasus.replication.configuration_create_app_response> { - private org.apache.pegasus.replication.configuration_create_app_request request; - - public create_app_call( - org.apache.pegasus.replication.configuration_create_app_request request, - org.apache.thrift.async.AsyncMethodCallback< - org.apache.pegasus.replication.configuration_create_app_response> - 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.request = request; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) - throws org.apache.thrift.TException { - prot.writeMessageBegin( - new org.apache.thrift.protocol.TMessage( - "create_app", org.apache.thrift.protocol.TMessageType.CALL, 0)); - create_app_args args = new create_app_args(); - args.setRequest(request); - args.write(prot); - prot.writeMessageEnd(); - } - - public org.apache.pegasus.replication.configuration_create_app_response getResult() - throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.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_create_app(); - } - } - - public void drop_app( - org.apache.pegasus.replication.configuration_drop_app_request request, - org.apache.thrift.async.AsyncMethodCallback< - org.apache.pegasus.replication.configuration_drop_app_response> - resultHandler) - throws org.apache.thrift.TException { - checkReady(); - drop_app_call method_call = - new drop_app_call(request, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class drop_app_call - extends org.apache.thrift.async.TAsyncMethodCall< - org.apache.pegasus.replication.configuration_drop_app_response> { - private org.apache.pegasus.replication.configuration_drop_app_request request; - - public drop_app_call( - org.apache.pegasus.replication.configuration_drop_app_request request, - org.apache.thrift.async.AsyncMethodCallback< - org.apache.pegasus.replication.configuration_drop_app_response> - 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.request = request; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) - throws org.apache.thrift.TException { - prot.writeMessageBegin( - new org.apache.thrift.protocol.TMessage( - "drop_app", org.apache.thrift.protocol.TMessageType.CALL, 0)); - drop_app_args args = new drop_app_args(); - args.setRequest(request); - args.write(prot); - prot.writeMessageEnd(); - } - - public org.apache.pegasus.replication.configuration_drop_app_response getResult() - throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.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_drop_app(); - } - } - } - - public static class Processor extends org.apache.thrift.TBaseProcessor - implements org.apache.thrift.TProcessor { - private static final org.slf4j.Logger _LOGGER = - org.slf4j.LoggerFactory.getLogger(Processor.class.getName()); - - public Processor(I iface) { - super( - iface, - getProcessMap( - new java.util.HashMap< - java.lang.String, - org.apache.thrift.ProcessFunction>())); - } - - protected Processor( - I iface, - java.util.Map< - java.lang.String, - org.apache.thrift.ProcessFunction> - processMap) { - super(iface, getProcessMap(processMap)); - } - - private static - java.util.Map< - java.lang.String, - org.apache.thrift.ProcessFunction> - getProcessMap( - java.util.Map< - java.lang.String, - org.apache.thrift.ProcessFunction> - processMap) { - processMap.put("query_cfg", new query_cfg()); - processMap.put("create_app", new create_app()); - processMap.put("drop_app", new drop_app()); - return processMap; - } - - public static class query_cfg - extends org.apache.thrift.ProcessFunction { - public query_cfg() { - super("query_cfg"); - } - - public query_cfg_args getEmptyArgsInstance() { - return new query_cfg_args(); - } - - protected boolean isOneway() { - return false; - } - - @Override - protected boolean handleRuntimeExceptions() { - return false; - } - - public query_cfg_result getResult(I iface, query_cfg_args args) - throws org.apache.thrift.TException { - query_cfg_result result = new query_cfg_result(); - result.success = iface.query_cfg(args.query); - return result; - } - } - - public static class create_app - extends org.apache.thrift.ProcessFunction { - public create_app() { - super("create_app"); - } - - public create_app_args getEmptyArgsInstance() { - return new create_app_args(); - } - - protected boolean isOneway() { - return false; - } - - @Override - protected boolean handleRuntimeExceptions() { - return false; - } - - public create_app_result getResult(I iface, create_app_args args) - throws org.apache.thrift.TException { - create_app_result result = new create_app_result(); - result.success = iface.create_app(args.request); - return result; - } - } - - public static class drop_app - extends org.apache.thrift.ProcessFunction { - public drop_app() { - super("drop_app"); - } - - public drop_app_args getEmptyArgsInstance() { - return new drop_app_args(); - } - - protected boolean isOneway() { - return false; - } - - @Override - protected boolean handleRuntimeExceptions() { - return false; - } - - public drop_app_result getResult(I iface, drop_app_args args) - throws org.apache.thrift.TException { - drop_app_result result = new drop_app_result(); - result.success = iface.drop_app(args.request); - return result; - } - } - } - - public static class AsyncProcessor - extends org.apache.thrift.TBaseAsyncProcessor { - private static final org.slf4j.Logger _LOGGER = - org.slf4j.LoggerFactory.getLogger(AsyncProcessor.class.getName()); - - public AsyncProcessor(I iface) { - super( - iface, - getProcessMap( - new java.util.HashMap< - java.lang.String, - org.apache.thrift.AsyncProcessFunction< - I, ? extends org.apache.thrift.TBase, ?>>())); - } - - protected AsyncProcessor( - I iface, - java.util.Map< - java.lang.String, - org.apache.thrift.AsyncProcessFunction> - processMap) { - super(iface, getProcessMap(processMap)); - } - - private static - java.util.Map< - java.lang.String, - org.apache.thrift.AsyncProcessFunction> - getProcessMap( - java.util.Map< - java.lang.String, - org.apache.thrift.AsyncProcessFunction< - I, ? extends org.apache.thrift.TBase, ?>> - processMap) { - processMap.put("query_cfg", new query_cfg()); - processMap.put("create_app", new create_app()); - processMap.put("drop_app", new drop_app()); - return processMap; - } - - public static class query_cfg - extends org.apache.thrift.AsyncProcessFunction< - I, query_cfg_args, org.apache.pegasus.replication.query_cfg_response> { - public query_cfg() { - super("query_cfg"); - } - - public query_cfg_args getEmptyArgsInstance() { - return new query_cfg_args(); - } - - public org.apache.thrift.async.AsyncMethodCallback< - org.apache.pegasus.replication.query_cfg_response> - getResultHandler( - final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, - final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback< - org.apache.pegasus.replication.query_cfg_response>() { - public void onComplete(org.apache.pegasus.replication.query_cfg_response o) { - query_cfg_result result = new query_cfg_result(); - result.success = o; - try { - fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY, seqid); - } catch (org.apache.thrift.transport.TTransportException e) { - _LOGGER.error("TTransportException writing to internal frame buffer", e); - fb.close(); - } catch (java.lang.Exception e) { - _LOGGER.error("Exception writing to internal frame buffer", e); - onError(e); - } - } - - public void onError(java.lang.Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; - query_cfg_result result = new query_cfg_result(); - if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - return; - } else if (e instanceof org.apache.thrift.TApplicationException) { - _LOGGER.error("TApplicationException inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException) e; - } else { - _LOGGER.error("Exception inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = - new org.apache.thrift.TApplicationException( - org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb, msg, msgType, seqid); - } catch (java.lang.Exception ex) { - _LOGGER.error("Exception writing to internal frame buffer", ex); - fb.close(); - } - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start( - I iface, - query_cfg_args args, - org.apache.thrift.async.AsyncMethodCallback< - org.apache.pegasus.replication.query_cfg_response> - resultHandler) - throws org.apache.thrift.TException { - iface.query_cfg(args.query, resultHandler); - } - } - - public static class create_app - extends org.apache.thrift.AsyncProcessFunction< - I, create_app_args, org.apache.pegasus.replication.configuration_create_app_response> { - public create_app() { - super("create_app"); - } - - public create_app_args getEmptyArgsInstance() { - return new create_app_args(); - } - - public org.apache.thrift.async.AsyncMethodCallback< - org.apache.pegasus.replication.configuration_create_app_response> - getResultHandler( - final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, - final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback< - org.apache.pegasus.replication.configuration_create_app_response>() { - public void onComplete( - org.apache.pegasus.replication.configuration_create_app_response o) { - create_app_result result = new create_app_result(); - result.success = o; - try { - fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY, seqid); - } catch (org.apache.thrift.transport.TTransportException e) { - _LOGGER.error("TTransportException writing to internal frame buffer", e); - fb.close(); - } catch (java.lang.Exception e) { - _LOGGER.error("Exception writing to internal frame buffer", e); - onError(e); - } - } - - public void onError(java.lang.Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; - create_app_result result = new create_app_result(); - if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - return; - } else if (e instanceof org.apache.thrift.TApplicationException) { - _LOGGER.error("TApplicationException inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException) e; - } else { - _LOGGER.error("Exception inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = - new org.apache.thrift.TApplicationException( - org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb, msg, msgType, seqid); - } catch (java.lang.Exception ex) { - _LOGGER.error("Exception writing to internal frame buffer", ex); - fb.close(); - } - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start( - I iface, - create_app_args args, - org.apache.thrift.async.AsyncMethodCallback< - org.apache.pegasus.replication.configuration_create_app_response> - resultHandler) - throws org.apache.thrift.TException { - iface.create_app(args.request, resultHandler); - } - } - - public static class drop_app - extends org.apache.thrift.AsyncProcessFunction< - I, drop_app_args, org.apache.pegasus.replication.configuration_drop_app_response> { - public drop_app() { - super("drop_app"); - } - - public drop_app_args getEmptyArgsInstance() { - return new drop_app_args(); - } - - public org.apache.thrift.async.AsyncMethodCallback< - org.apache.pegasus.replication.configuration_drop_app_response> - getResultHandler( - final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, - final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback< - org.apache.pegasus.replication.configuration_drop_app_response>() { - public void onComplete(org.apache.pegasus.replication.configuration_drop_app_response o) { - drop_app_result result = new drop_app_result(); - result.success = o; - try { - fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY, seqid); - } catch (org.apache.thrift.transport.TTransportException e) { - _LOGGER.error("TTransportException writing to internal frame buffer", e); - fb.close(); - } catch (java.lang.Exception e) { - _LOGGER.error("Exception writing to internal frame buffer", e); - onError(e); - } - } - - public void onError(java.lang.Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; - drop_app_result result = new drop_app_result(); - if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - return; - } else if (e instanceof org.apache.thrift.TApplicationException) { - _LOGGER.error("TApplicationException inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException) e; - } else { - _LOGGER.error("Exception inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = - new org.apache.thrift.TApplicationException( - org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb, msg, msgType, seqid); - } catch (java.lang.Exception ex) { - _LOGGER.error("Exception writing to internal frame buffer", ex); - fb.close(); - } - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start( - I iface, - drop_app_args args, - org.apache.thrift.async.AsyncMethodCallback< - org.apache.pegasus.replication.configuration_drop_app_response> - resultHandler) - throws org.apache.thrift.TException { - iface.drop_app(args.request, resultHandler); - } - } - } - - public static class query_cfg_args - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("query_cfg_args"); - - private static final org.apache.thrift.protocol.TField QUERY_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "query", org.apache.thrift.protocol.TType.STRUCT, (short) 1); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new query_cfg_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new query_cfg_argsTupleSchemeFactory(); - - public org.apache.pegasus.replication.query_cfg_request query; // 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 { - QUERY((short) 1, "query"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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: // QUERY - return QUERY; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> - metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put( - _Fields.QUERY, - new org.apache.thrift.meta_data.FieldMetaData( - "query", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData( - org.apache.thrift.protocol.TType.STRUCT, - org.apache.pegasus.replication.query_cfg_request.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap( - query_cfg_args.class, metaDataMap); - } - - public query_cfg_args() {} - - public query_cfg_args(org.apache.pegasus.replication.query_cfg_request query) { - this(); - this.query = query; - } - - /** Performs a deep copy on other. */ - public query_cfg_args(query_cfg_args other) { - if (other.isSetQuery()) { - this.query = new org.apache.pegasus.replication.query_cfg_request(other.query); - } - } - - public query_cfg_args deepCopy() { - return new query_cfg_args(this); - } - - @Override - public void clear() { - this.query = null; - } - - public org.apache.pegasus.replication.query_cfg_request getQuery() { - return this.query; - } - - public query_cfg_args setQuery(org.apache.pegasus.replication.query_cfg_request query) { - this.query = query; - return this; - } - - public void unsetQuery() { - this.query = null; - } - - /** Returns true if field query is set (has been assigned a value) and false otherwise */ - public boolean isSetQuery() { - return this.query != null; - } - - public void setQueryIsSet(boolean value) { - if (!value) { - this.query = null; - } - } - - public void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case QUERY: - if (value == null) { - unsetQuery(); - } else { - setQuery((org.apache.pegasus.replication.query_cfg_request) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case QUERY: - return getQuery(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case QUERY: - return isSetQuery(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof query_cfg_args) return this.equals((query_cfg_args) that); - return false; - } - - public boolean equals(query_cfg_args that) { - if (that == null) return false; - if (this == that) return true; - - boolean this_present_query = true && this.isSetQuery(); - boolean that_present_query = true && that.isSetQuery(); - if (this_present_query || that_present_query) { - if (!(this_present_query && that_present_query)) return false; - if (!this.query.equals(that.query)) return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetQuery()) ? 131071 : 524287); - if (isSetQuery()) hashCode = hashCode * 8191 + query.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(query_cfg_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetQuery()).compareTo(other.isSetQuery()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetQuery()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.query, other.query); - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("query_cfg_args("); - boolean first = true; - - sb.append("query:"); - if (this.query == null) { - sb.append("null"); - } else { - sb.append(this.query); - } - 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 (query != null) { - query.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, java.lang.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 query_cfg_argsStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public query_cfg_argsStandardScheme getScheme() { - return new query_cfg_argsStandardScheme(); - } - } - - private static class query_cfg_argsStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, query_cfg_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: // QUERY - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.query = new org.apache.pegasus.replication.query_cfg_request(); - struct.query.read(iprot); - struct.setQueryIsSet(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, query_cfg_args struct) - throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.query != null) { - oprot.writeFieldBegin(QUERY_FIELD_DESC); - struct.query.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class query_cfg_argsTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public query_cfg_argsTupleScheme getScheme() { - return new query_cfg_argsTupleScheme(); - } - } - - private static class query_cfg_argsTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, query_cfg_args struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetQuery()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetQuery()) { - struct.query.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, query_cfg_args struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.query = new org.apache.pegasus.replication.query_cfg_request(); - struct.query.read(iprot); - struct.setQueryIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } - } - - public static class query_cfg_result - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("query_cfg_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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new query_cfg_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new query_cfg_resultTupleSchemeFactory(); - - public org.apache.pegasus.replication.query_cfg_response success; // 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"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> - metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.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, - org.apache.pegasus.replication.query_cfg_response.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap( - query_cfg_result.class, metaDataMap); - } - - public query_cfg_result() {} - - public query_cfg_result(org.apache.pegasus.replication.query_cfg_response success) { - this(); - this.success = success; - } - - /** Performs a deep copy on other. */ - public query_cfg_result(query_cfg_result other) { - if (other.isSetSuccess()) { - this.success = new org.apache.pegasus.replication.query_cfg_response(other.success); - } - } - - public query_cfg_result deepCopy() { - return new query_cfg_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public org.apache.pegasus.replication.query_cfg_response getSuccess() { - return this.success; - } - - public query_cfg_result setSuccess(org.apache.pegasus.replication.query_cfg_response 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 void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((org.apache.pegasus.replication.query_cfg_response) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof query_cfg_result) return this.equals((query_cfg_result) that); - return false; - } - - public boolean equals(query_cfg_result that) { - if (that == null) return false; - if (this == that) return true; - - 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; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) hashCode = hashCode * 8191 + success.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(query_cfg_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("query_cfg_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - 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, java.lang.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 query_cfg_resultStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public query_cfg_resultStandardScheme getScheme() { - return new query_cfg_resultStandardScheme(); - } - } - - private static class query_cfg_resultStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, query_cfg_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 org.apache.pegasus.replication.query_cfg_response(); - struct.success.read(iprot); - struct.setSuccessIsSet(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, query_cfg_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(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class query_cfg_resultTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public query_cfg_resultTupleScheme getScheme() { - return new query_cfg_resultTupleScheme(); - } - } - - private static class query_cfg_resultTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, query_cfg_result struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, query_cfg_result struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new org.apache.pegasus.replication.query_cfg_response(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } - } - - public static class create_app_args - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("create_app_args"); - - private static final org.apache.thrift.protocol.TField REQUEST_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "request", org.apache.thrift.protocol.TType.STRUCT, (short) 1); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new create_app_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new create_app_argsTupleSchemeFactory(); - - public org.apache.pegasus.replication.configuration_create_app_request request; // 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 { - REQUEST((short) 1, "request"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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: // REQUEST - return REQUEST; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> - metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put( - _Fields.REQUEST, - new org.apache.thrift.meta_data.FieldMetaData( - "request", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData( - org.apache.thrift.protocol.TType.STRUCT, - org.apache.pegasus.replication.configuration_create_app_request.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap( - create_app_args.class, metaDataMap); - } - - public create_app_args() {} - - public create_app_args( - org.apache.pegasus.replication.configuration_create_app_request request) { - this(); - this.request = request; - } - - /** Performs a deep copy on other. */ - public create_app_args(create_app_args other) { - if (other.isSetRequest()) { - this.request = - new org.apache.pegasus.replication.configuration_create_app_request(other.request); - } - } - - public create_app_args deepCopy() { - return new create_app_args(this); - } - - @Override - public void clear() { - this.request = null; - } - - public org.apache.pegasus.replication.configuration_create_app_request getRequest() { - return this.request; - } - - public create_app_args setRequest( - org.apache.pegasus.replication.configuration_create_app_request request) { - this.request = request; - return this; - } - - public void unsetRequest() { - this.request = null; - } - - /** Returns true if field request is set (has been assigned a value) and false otherwise */ - public boolean isSetRequest() { - return this.request != null; - } - - public void setRequestIsSet(boolean value) { - if (!value) { - this.request = null; - } - } - - public void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case REQUEST: - if (value == null) { - unsetRequest(); - } else { - setRequest((org.apache.pegasus.replication.configuration_create_app_request) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case REQUEST: - return getRequest(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case REQUEST: - return isSetRequest(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof create_app_args) return this.equals((create_app_args) that); - return false; - } - - public boolean equals(create_app_args that) { - if (that == null) return false; - if (this == that) return true; - - boolean this_present_request = true && this.isSetRequest(); - boolean that_present_request = true && that.isSetRequest(); - if (this_present_request || that_present_request) { - if (!(this_present_request && that_present_request)) return false; - if (!this.request.equals(that.request)) return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetRequest()) ? 131071 : 524287); - if (isSetRequest()) hashCode = hashCode * 8191 + request.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(create_app_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetRequest()).compareTo(other.isSetRequest()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetRequest()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.request, other.request); - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("create_app_args("); - boolean first = true; - - sb.append("request:"); - if (this.request == null) { - sb.append("null"); - } else { - sb.append(this.request); - } - 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 (request != null) { - request.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, java.lang.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 create_app_argsStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public create_app_argsStandardScheme getScheme() { - return new create_app_argsStandardScheme(); - } - } - - private static class create_app_argsStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, create_app_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: // REQUEST - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.request = - new org.apache.pegasus.replication.configuration_create_app_request(); - struct.request.read(iprot); - struct.setRequestIsSet(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, create_app_args struct) - throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.request != null) { - oprot.writeFieldBegin(REQUEST_FIELD_DESC); - struct.request.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class create_app_argsTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public create_app_argsTupleScheme getScheme() { - return new create_app_argsTupleScheme(); - } - } - - private static class create_app_argsTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, create_app_args struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetRequest()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetRequest()) { - struct.request.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, create_app_args struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.request = new org.apache.pegasus.replication.configuration_create_app_request(); - struct.request.read(iprot); - struct.setRequestIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } - } - - public static class create_app_result - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("create_app_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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new create_app_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new create_app_resultTupleSchemeFactory(); - - public org.apache.pegasus.replication.configuration_create_app_response success; // 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"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> - metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.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, - org.apache.pegasus.replication.configuration_create_app_response.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap( - create_app_result.class, metaDataMap); - } - - public create_app_result() {} - - public create_app_result( - org.apache.pegasus.replication.configuration_create_app_response success) { - this(); - this.success = success; - } - - /** Performs a deep copy on other. */ - public create_app_result(create_app_result other) { - if (other.isSetSuccess()) { - this.success = - new org.apache.pegasus.replication.configuration_create_app_response(other.success); - } - } - - public create_app_result deepCopy() { - return new create_app_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public org.apache.pegasus.replication.configuration_create_app_response getSuccess() { - return this.success; - } - - public create_app_result setSuccess( - org.apache.pegasus.replication.configuration_create_app_response 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 void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((org.apache.pegasus.replication.configuration_create_app_response) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof create_app_result) return this.equals((create_app_result) that); - return false; - } - - public boolean equals(create_app_result that) { - if (that == null) return false; - if (this == that) return true; - - 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; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) hashCode = hashCode * 8191 + success.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(create_app_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("create_app_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - 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, java.lang.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 create_app_resultStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public create_app_resultStandardScheme getScheme() { - return new create_app_resultStandardScheme(); - } - } - - private static class create_app_resultStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, create_app_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 org.apache.pegasus.replication.configuration_create_app_response(); - struct.success.read(iprot); - struct.setSuccessIsSet(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, create_app_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(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class create_app_resultTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public create_app_resultTupleScheme getScheme() { - return new create_app_resultTupleScheme(); - } - } - - private static class create_app_resultTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, create_app_result struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, create_app_result struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new org.apache.pegasus.replication.configuration_create_app_response(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } - } - - public static class drop_app_args - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("drop_app_args"); - - private static final org.apache.thrift.protocol.TField REQUEST_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "request", org.apache.thrift.protocol.TType.STRUCT, (short) 1); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new drop_app_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new drop_app_argsTupleSchemeFactory(); - - public org.apache.pegasus.replication.configuration_drop_app_request request; // 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 { - REQUEST((short) 1, "request"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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: // REQUEST - return REQUEST; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> - metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put( - _Fields.REQUEST, - new org.apache.thrift.meta_data.FieldMetaData( - "request", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData( - org.apache.thrift.protocol.TType.STRUCT, - org.apache.pegasus.replication.configuration_drop_app_request.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap( - drop_app_args.class, metaDataMap); - } - - public drop_app_args() {} - - public drop_app_args(org.apache.pegasus.replication.configuration_drop_app_request request) { - this(); - this.request = request; - } - - /** Performs a deep copy on other. */ - public drop_app_args(drop_app_args other) { - if (other.isSetRequest()) { - this.request = - new org.apache.pegasus.replication.configuration_drop_app_request(other.request); - } - } - - public drop_app_args deepCopy() { - return new drop_app_args(this); - } - - @Override - public void clear() { - this.request = null; - } - - public org.apache.pegasus.replication.configuration_drop_app_request getRequest() { - return this.request; - } - - public drop_app_args setRequest( - org.apache.pegasus.replication.configuration_drop_app_request request) { - this.request = request; - return this; - } - - public void unsetRequest() { - this.request = null; - } - - /** Returns true if field request is set (has been assigned a value) and false otherwise */ - public boolean isSetRequest() { - return this.request != null; - } - - public void setRequestIsSet(boolean value) { - if (!value) { - this.request = null; - } - } - - public void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case REQUEST: - if (value == null) { - unsetRequest(); - } else { - setRequest((org.apache.pegasus.replication.configuration_drop_app_request) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case REQUEST: - return getRequest(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case REQUEST: - return isSetRequest(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof drop_app_args) return this.equals((drop_app_args) that); - return false; - } - - public boolean equals(drop_app_args that) { - if (that == null) return false; - if (this == that) return true; - - boolean this_present_request = true && this.isSetRequest(); - boolean that_present_request = true && that.isSetRequest(); - if (this_present_request || that_present_request) { - if (!(this_present_request && that_present_request)) return false; - if (!this.request.equals(that.request)) return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetRequest()) ? 131071 : 524287); - if (isSetRequest()) hashCode = hashCode * 8191 + request.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(drop_app_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetRequest()).compareTo(other.isSetRequest()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetRequest()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.request, other.request); - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("drop_app_args("); - boolean first = true; - - sb.append("request:"); - if (this.request == null) { - sb.append("null"); - } else { - sb.append(this.request); - } - 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 (request != null) { - request.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, java.lang.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 drop_app_argsStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public drop_app_argsStandardScheme getScheme() { - return new drop_app_argsStandardScheme(); - } - } - - private static class drop_app_argsStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, drop_app_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: // REQUEST - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.request = - new org.apache.pegasus.replication.configuration_drop_app_request(); - struct.request.read(iprot); - struct.setRequestIsSet(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, drop_app_args struct) - throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.request != null) { - oprot.writeFieldBegin(REQUEST_FIELD_DESC); - struct.request.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class drop_app_argsTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public drop_app_argsTupleScheme getScheme() { - return new drop_app_argsTupleScheme(); - } - } - - private static class drop_app_argsTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, drop_app_args struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetRequest()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetRequest()) { - struct.request.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, drop_app_args struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.request = new org.apache.pegasus.replication.configuration_drop_app_request(); - struct.request.read(iprot); - struct.setRequestIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } - } - - public static class drop_app_result - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("drop_app_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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new drop_app_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new drop_app_resultTupleSchemeFactory(); - - public org.apache.pegasus.replication.configuration_drop_app_response success; // 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"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> - metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.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, - org.apache.pegasus.replication.configuration_drop_app_response.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap( - drop_app_result.class, metaDataMap); - } - - public drop_app_result() {} - - public drop_app_result(org.apache.pegasus.replication.configuration_drop_app_response success) { - this(); - this.success = success; - } - - /** Performs a deep copy on other. */ - public drop_app_result(drop_app_result other) { - if (other.isSetSuccess()) { - this.success = - new org.apache.pegasus.replication.configuration_drop_app_response(other.success); - } - } - - public drop_app_result deepCopy() { - return new drop_app_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public org.apache.pegasus.replication.configuration_drop_app_response getSuccess() { - return this.success; - } - - public drop_app_result setSuccess( - org.apache.pegasus.replication.configuration_drop_app_response 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 void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((org.apache.pegasus.replication.configuration_drop_app_response) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof drop_app_result) return this.equals((drop_app_result) that); - return false; - } - - public boolean equals(drop_app_result that) { - if (that == null) return false; - if (this == that) return true; - - 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; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) hashCode = hashCode * 8191 + success.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(drop_app_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("drop_app_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - 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, java.lang.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 drop_app_resultStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public drop_app_resultStandardScheme getScheme() { - return new drop_app_resultStandardScheme(); - } - } - - private static class drop_app_resultStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, drop_app_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 org.apache.pegasus.replication.configuration_drop_app_response(); - struct.success.read(iprot); - struct.setSuccessIsSet(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, drop_app_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(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class drop_app_resultTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public drop_app_resultTupleScheme getScheme() { - return new drop_app_resultTupleScheme(); - } - } - - private static class drop_app_resultTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, drop_app_result struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, drop_app_result struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new org.apache.pegasus.replication.configuration_drop_app_response(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } - } -} diff --git a/java-client/src/main/java/org/apache/pegasus/apps/multi_get_request.java b/java-client/src/main/java/org/apache/pegasus/apps/multi_get_request.java deleted file mode 100644 index 8b5c3cdf25..0000000000 --- a/java-client/src/main/java/org/apache/pegasus/apps/multi_get_request.java +++ /dev/null @@ -1,1690 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.11.0) - * - *

DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * - * @generated - */ -package org.apache.pegasus.apps; - -import org.apache.pegasus.base.blob; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated( - value = "Autogenerated by Thrift Compiler (0.11.0)", - date = "2020-04-13") -public class multi_get_request - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("multi_get_request"); - - private static final org.apache.thrift.protocol.TField HASH_KEY_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "hash_key", org.apache.thrift.protocol.TType.STRUCT, (short) 1); - private static final org.apache.thrift.protocol.TField SORK_KEYS_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "sork_keys", org.apache.thrift.protocol.TType.LIST, (short) 2); - private static final org.apache.thrift.protocol.TField MAX_KV_COUNT_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "max_kv_count", org.apache.thrift.protocol.TType.I32, (short) 3); - private static final org.apache.thrift.protocol.TField MAX_KV_SIZE_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "max_kv_size", org.apache.thrift.protocol.TType.I32, (short) 4); - private static final org.apache.thrift.protocol.TField NO_VALUE_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "no_value", org.apache.thrift.protocol.TType.BOOL, (short) 5); - private static final org.apache.thrift.protocol.TField START_SORTKEY_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "start_sortkey", org.apache.thrift.protocol.TType.STRUCT, (short) 6); - private static final org.apache.thrift.protocol.TField STOP_SORTKEY_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "stop_sortkey", org.apache.thrift.protocol.TType.STRUCT, (short) 7); - private static final org.apache.thrift.protocol.TField START_INCLUSIVE_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "start_inclusive", org.apache.thrift.protocol.TType.BOOL, (short) 8); - private static final org.apache.thrift.protocol.TField STOP_INCLUSIVE_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "stop_inclusive", org.apache.thrift.protocol.TType.BOOL, (short) 9); - private static final org.apache.thrift.protocol.TField SORT_KEY_FILTER_TYPE_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "sort_key_filter_type", org.apache.thrift.protocol.TType.I32, (short) 10); - private static final org.apache.thrift.protocol.TField SORT_KEY_FILTER_PATTERN_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "sort_key_filter_pattern", org.apache.thrift.protocol.TType.STRUCT, (short) 11); - private static final org.apache.thrift.protocol.TField REVERSE_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "reverse", org.apache.thrift.protocol.TType.BOOL, (short) 12); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new multi_get_requestStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new multi_get_requestTupleSchemeFactory(); - - public blob hash_key; // required - public java.util.List sork_keys; // required - public int max_kv_count; // required - public int max_kv_size; // required - public boolean no_value; // required - public blob start_sortkey; // required - public blob stop_sortkey; // required - public boolean start_inclusive; // required - public boolean stop_inclusive; // required - /** @see filter_type */ - public filter_type sort_key_filter_type; // required - - public blob sort_key_filter_pattern; // required - public boolean reverse; // 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 { - HASH_KEY((short) 1, "hash_key"), - SORK_KEYS((short) 2, "sork_keys"), - MAX_KV_COUNT((short) 3, "max_kv_count"), - MAX_KV_SIZE((short) 4, "max_kv_size"), - NO_VALUE((short) 5, "no_value"), - START_SORTKEY((short) 6, "start_sortkey"), - STOP_SORTKEY((short) 7, "stop_sortkey"), - START_INCLUSIVE((short) 8, "start_inclusive"), - STOP_INCLUSIVE((short) 9, "stop_inclusive"), - /** @see filter_type */ - SORT_KEY_FILTER_TYPE((short) 10, "sort_key_filter_type"), - SORT_KEY_FILTER_PATTERN((short) 11, "sort_key_filter_pattern"), - REVERSE((short) 12, "reverse"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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: // HASH_KEY - return HASH_KEY; - case 2: // SORK_KEYS - return SORK_KEYS; - case 3: // MAX_KV_COUNT - return MAX_KV_COUNT; - case 4: // MAX_KV_SIZE - return MAX_KV_SIZE; - case 5: // NO_VALUE - return NO_VALUE; - case 6: // START_SORTKEY - return START_SORTKEY; - case 7: // STOP_SORTKEY - return STOP_SORTKEY; - case 8: // START_INCLUSIVE - return START_INCLUSIVE; - case 9: // STOP_INCLUSIVE - return STOP_INCLUSIVE; - case 10: // SORT_KEY_FILTER_TYPE - return SORT_KEY_FILTER_TYPE; - case 11: // SORT_KEY_FILTER_PATTERN - return SORT_KEY_FILTER_PATTERN; - case 12: // REVERSE - return REVERSE; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __MAX_KV_COUNT_ISSET_ID = 0; - private static final int __MAX_KV_SIZE_ISSET_ID = 1; - private static final int __NO_VALUE_ISSET_ID = 2; - private static final int __START_INCLUSIVE_ISSET_ID = 3; - private static final int __STOP_INCLUSIVE_ISSET_ID = 4; - private static final int __REVERSE_ISSET_ID = 5; - private byte __isset_bitfield = 0; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put( - _Fields.HASH_KEY, - new org.apache.thrift.meta_data.FieldMetaData( - "hash_key", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData( - org.apache.thrift.protocol.TType.STRUCT, blob.class))); - tmpMap.put( - _Fields.SORK_KEYS, - new org.apache.thrift.meta_data.FieldMetaData( - "sork_keys", - 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, blob.class)))); - tmpMap.put( - _Fields.MAX_KV_COUNT, - new org.apache.thrift.meta_data.FieldMetaData( - "max_kv_count", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I32))); - tmpMap.put( - _Fields.MAX_KV_SIZE, - new org.apache.thrift.meta_data.FieldMetaData( - "max_kv_size", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I32))); - tmpMap.put( - _Fields.NO_VALUE, - new org.apache.thrift.meta_data.FieldMetaData( - "no_value", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.BOOL))); - tmpMap.put( - _Fields.START_SORTKEY, - new org.apache.thrift.meta_data.FieldMetaData( - "start_sortkey", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData( - org.apache.thrift.protocol.TType.STRUCT, blob.class))); - tmpMap.put( - _Fields.STOP_SORTKEY, - new org.apache.thrift.meta_data.FieldMetaData( - "stop_sortkey", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData( - org.apache.thrift.protocol.TType.STRUCT, blob.class))); - tmpMap.put( - _Fields.START_INCLUSIVE, - new org.apache.thrift.meta_data.FieldMetaData( - "start_inclusive", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.BOOL))); - tmpMap.put( - _Fields.STOP_INCLUSIVE, - new org.apache.thrift.meta_data.FieldMetaData( - "stop_inclusive", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.BOOL))); - tmpMap.put( - _Fields.SORT_KEY_FILTER_TYPE, - new org.apache.thrift.meta_data.FieldMetaData( - "sort_key_filter_type", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.EnumMetaData( - org.apache.thrift.protocol.TType.ENUM, filter_type.class))); - tmpMap.put( - _Fields.SORT_KEY_FILTER_PATTERN, - new org.apache.thrift.meta_data.FieldMetaData( - "sort_key_filter_pattern", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData( - org.apache.thrift.protocol.TType.STRUCT, blob.class))); - tmpMap.put( - _Fields.REVERSE, - new org.apache.thrift.meta_data.FieldMetaData( - "reverse", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.BOOL))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap( - multi_get_request.class, metaDataMap); - } - - public multi_get_request() {} - - public multi_get_request( - blob hash_key, - java.util.List sork_keys, - int max_kv_count, - int max_kv_size, - boolean no_value, - blob start_sortkey, - blob stop_sortkey, - boolean start_inclusive, - boolean stop_inclusive, - filter_type sort_key_filter_type, - blob sort_key_filter_pattern, - boolean reverse) { - this(); - this.hash_key = hash_key; - this.sork_keys = sork_keys; - this.max_kv_count = max_kv_count; - setMax_kv_countIsSet(true); - this.max_kv_size = max_kv_size; - setMax_kv_sizeIsSet(true); - this.no_value = no_value; - setNo_valueIsSet(true); - this.start_sortkey = start_sortkey; - this.stop_sortkey = stop_sortkey; - this.start_inclusive = start_inclusive; - setStart_inclusiveIsSet(true); - this.stop_inclusive = stop_inclusive; - setStop_inclusiveIsSet(true); - this.sort_key_filter_type = sort_key_filter_type; - this.sort_key_filter_pattern = sort_key_filter_pattern; - this.reverse = reverse; - setReverseIsSet(true); - } - - /** Performs a deep copy on other. */ - public multi_get_request(multi_get_request other) { - __isset_bitfield = other.__isset_bitfield; - if (other.isSetHash_key()) { - this.hash_key = new blob(other.hash_key); - } - if (other.isSetSork_keys()) { - java.util.List __this__sork_keys = - new java.util.ArrayList(other.sork_keys.size()); - for (blob other_element : other.sork_keys) { - __this__sork_keys.add(new blob(other_element)); - } - this.sork_keys = __this__sork_keys; - } - this.max_kv_count = other.max_kv_count; - this.max_kv_size = other.max_kv_size; - this.no_value = other.no_value; - if (other.isSetStart_sortkey()) { - this.start_sortkey = new blob(other.start_sortkey); - } - if (other.isSetStop_sortkey()) { - this.stop_sortkey = new blob(other.stop_sortkey); - } - this.start_inclusive = other.start_inclusive; - this.stop_inclusive = other.stop_inclusive; - if (other.isSetSort_key_filter_type()) { - this.sort_key_filter_type = other.sort_key_filter_type; - } - if (other.isSetSort_key_filter_pattern()) { - this.sort_key_filter_pattern = new blob(other.sort_key_filter_pattern); - } - this.reverse = other.reverse; - } - - public multi_get_request deepCopy() { - return new multi_get_request(this); - } - - @Override - public void clear() { - this.hash_key = null; - this.sork_keys = null; - setMax_kv_countIsSet(false); - this.max_kv_count = 0; - setMax_kv_sizeIsSet(false); - this.max_kv_size = 0; - setNo_valueIsSet(false); - this.no_value = false; - this.start_sortkey = null; - this.stop_sortkey = null; - setStart_inclusiveIsSet(false); - this.start_inclusive = false; - setStop_inclusiveIsSet(false); - this.stop_inclusive = false; - this.sort_key_filter_type = null; - this.sort_key_filter_pattern = null; - setReverseIsSet(false); - this.reverse = false; - } - - public blob getHash_key() { - return this.hash_key; - } - - public multi_get_request setHash_key(blob hash_key) { - this.hash_key = hash_key; - return this; - } - - public void unsetHash_key() { - this.hash_key = null; - } - - /** Returns true if field hash_key is set (has been assigned a value) and false otherwise */ - public boolean isSetHash_key() { - return this.hash_key != null; - } - - public void setHash_keyIsSet(boolean value) { - if (!value) { - this.hash_key = null; - } - } - - public int getSork_keysSize() { - return (this.sork_keys == null) ? 0 : this.sork_keys.size(); - } - - public java.util.Iterator getSork_keysIterator() { - return (this.sork_keys == null) ? null : this.sork_keys.iterator(); - } - - public void addToSork_keys(blob elem) { - if (this.sork_keys == null) { - this.sork_keys = new java.util.ArrayList(); - } - this.sork_keys.add(elem); - } - - public java.util.List getSork_keys() { - return this.sork_keys; - } - - public multi_get_request setSork_keys(java.util.List sork_keys) { - this.sork_keys = sork_keys; - return this; - } - - public void unsetSork_keys() { - this.sork_keys = null; - } - - /** Returns true if field sork_keys is set (has been assigned a value) and false otherwise */ - public boolean isSetSork_keys() { - return this.sork_keys != null; - } - - public void setSork_keysIsSet(boolean value) { - if (!value) { - this.sork_keys = null; - } - } - - public int getMax_kv_count() { - return this.max_kv_count; - } - - public multi_get_request setMax_kv_count(int max_kv_count) { - this.max_kv_count = max_kv_count; - setMax_kv_countIsSet(true); - return this; - } - - public void unsetMax_kv_count() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __MAX_KV_COUNT_ISSET_ID); - } - - /** Returns true if field max_kv_count is set (has been assigned a value) and false otherwise */ - public boolean isSetMax_kv_count() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __MAX_KV_COUNT_ISSET_ID); - } - - public void setMax_kv_countIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __MAX_KV_COUNT_ISSET_ID, value); - } - - public int getMax_kv_size() { - return this.max_kv_size; - } - - public multi_get_request setMax_kv_size(int max_kv_size) { - this.max_kv_size = max_kv_size; - setMax_kv_sizeIsSet(true); - return this; - } - - public void unsetMax_kv_size() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __MAX_KV_SIZE_ISSET_ID); - } - - /** Returns true if field max_kv_size is set (has been assigned a value) and false otherwise */ - public boolean isSetMax_kv_size() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __MAX_KV_SIZE_ISSET_ID); - } - - public void setMax_kv_sizeIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __MAX_KV_SIZE_ISSET_ID, value); - } - - public boolean isNo_value() { - return this.no_value; - } - - public multi_get_request setNo_value(boolean no_value) { - this.no_value = no_value; - setNo_valueIsSet(true); - return this; - } - - public void unsetNo_value() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __NO_VALUE_ISSET_ID); - } - - /** Returns true if field no_value is set (has been assigned a value) and false otherwise */ - public boolean isSetNo_value() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __NO_VALUE_ISSET_ID); - } - - public void setNo_valueIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __NO_VALUE_ISSET_ID, value); - } - - public blob getStart_sortkey() { - return this.start_sortkey; - } - - public multi_get_request setStart_sortkey(blob start_sortkey) { - this.start_sortkey = start_sortkey; - return this; - } - - public void unsetStart_sortkey() { - this.start_sortkey = null; - } - - /** Returns true if field start_sortkey is set (has been assigned a value) and false otherwise */ - public boolean isSetStart_sortkey() { - return this.start_sortkey != null; - } - - public void setStart_sortkeyIsSet(boolean value) { - if (!value) { - this.start_sortkey = null; - } - } - - public blob getStop_sortkey() { - return this.stop_sortkey; - } - - public multi_get_request setStop_sortkey(blob stop_sortkey) { - this.stop_sortkey = stop_sortkey; - return this; - } - - public void unsetStop_sortkey() { - this.stop_sortkey = null; - } - - /** Returns true if field stop_sortkey is set (has been assigned a value) and false otherwise */ - public boolean isSetStop_sortkey() { - return this.stop_sortkey != null; - } - - public void setStop_sortkeyIsSet(boolean value) { - if (!value) { - this.stop_sortkey = null; - } - } - - public boolean isStart_inclusive() { - return this.start_inclusive; - } - - public multi_get_request setStart_inclusive(boolean start_inclusive) { - this.start_inclusive = start_inclusive; - setStart_inclusiveIsSet(true); - return this; - } - - public void unsetStart_inclusive() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __START_INCLUSIVE_ISSET_ID); - } - - /** - * Returns true if field start_inclusive is set (has been assigned a value) and false otherwise - */ - public boolean isSetStart_inclusive() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __START_INCLUSIVE_ISSET_ID); - } - - public void setStart_inclusiveIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __START_INCLUSIVE_ISSET_ID, value); - } - - public boolean isStop_inclusive() { - return this.stop_inclusive; - } - - public multi_get_request setStop_inclusive(boolean stop_inclusive) { - this.stop_inclusive = stop_inclusive; - setStop_inclusiveIsSet(true); - return this; - } - - public void unsetStop_inclusive() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __STOP_INCLUSIVE_ISSET_ID); - } - - /** Returns true if field stop_inclusive is set (has been assigned a value) and false otherwise */ - public boolean isSetStop_inclusive() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __STOP_INCLUSIVE_ISSET_ID); - } - - public void setStop_inclusiveIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __STOP_INCLUSIVE_ISSET_ID, value); - } - - /** @see filter_type */ - public filter_type getSort_key_filter_type() { - return this.sort_key_filter_type; - } - - /** @see filter_type */ - public multi_get_request setSort_key_filter_type(filter_type sort_key_filter_type) { - this.sort_key_filter_type = sort_key_filter_type; - return this; - } - - public void unsetSort_key_filter_type() { - this.sort_key_filter_type = null; - } - - /** - * Returns true if field sort_key_filter_type is set (has been assigned a value) and false - * otherwise - */ - public boolean isSetSort_key_filter_type() { - return this.sort_key_filter_type != null; - } - - public void setSort_key_filter_typeIsSet(boolean value) { - if (!value) { - this.sort_key_filter_type = null; - } - } - - public blob getSort_key_filter_pattern() { - return this.sort_key_filter_pattern; - } - - public multi_get_request setSort_key_filter_pattern(blob sort_key_filter_pattern) { - this.sort_key_filter_pattern = sort_key_filter_pattern; - return this; - } - - public void unsetSort_key_filter_pattern() { - this.sort_key_filter_pattern = null; - } - - /** - * Returns true if field sort_key_filter_pattern is set (has been assigned a value) and false - * otherwise - */ - public boolean isSetSort_key_filter_pattern() { - return this.sort_key_filter_pattern != null; - } - - public void setSort_key_filter_patternIsSet(boolean value) { - if (!value) { - this.sort_key_filter_pattern = null; - } - } - - public boolean isReverse() { - return this.reverse; - } - - public multi_get_request setReverse(boolean reverse) { - this.reverse = reverse; - setReverseIsSet(true); - return this; - } - - public void unsetReverse() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __REVERSE_ISSET_ID); - } - - /** Returns true if field reverse is set (has been assigned a value) and false otherwise */ - public boolean isSetReverse() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __REVERSE_ISSET_ID); - } - - public void setReverseIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __REVERSE_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case HASH_KEY: - if (value == null) { - unsetHash_key(); - } else { - setHash_key((blob) value); - } - break; - - case SORK_KEYS: - if (value == null) { - unsetSork_keys(); - } else { - setSork_keys((java.util.List) value); - } - break; - - case MAX_KV_COUNT: - if (value == null) { - unsetMax_kv_count(); - } else { - setMax_kv_count((java.lang.Integer) value); - } - break; - - case MAX_KV_SIZE: - if (value == null) { - unsetMax_kv_size(); - } else { - setMax_kv_size((java.lang.Integer) value); - } - break; - - case NO_VALUE: - if (value == null) { - unsetNo_value(); - } else { - setNo_value((java.lang.Boolean) value); - } - break; - - case START_SORTKEY: - if (value == null) { - unsetStart_sortkey(); - } else { - setStart_sortkey((blob) value); - } - break; - - case STOP_SORTKEY: - if (value == null) { - unsetStop_sortkey(); - } else { - setStop_sortkey((blob) value); - } - break; - - case START_INCLUSIVE: - if (value == null) { - unsetStart_inclusive(); - } else { - setStart_inclusive((java.lang.Boolean) value); - } - break; - - case STOP_INCLUSIVE: - if (value == null) { - unsetStop_inclusive(); - } else { - setStop_inclusive((java.lang.Boolean) value); - } - break; - - case SORT_KEY_FILTER_TYPE: - if (value == null) { - unsetSort_key_filter_type(); - } else { - setSort_key_filter_type((filter_type) value); - } - break; - - case SORT_KEY_FILTER_PATTERN: - if (value == null) { - unsetSort_key_filter_pattern(); - } else { - setSort_key_filter_pattern((blob) value); - } - break; - - case REVERSE: - if (value == null) { - unsetReverse(); - } else { - setReverse((java.lang.Boolean) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case HASH_KEY: - return getHash_key(); - - case SORK_KEYS: - return getSork_keys(); - - case MAX_KV_COUNT: - return getMax_kv_count(); - - case MAX_KV_SIZE: - return getMax_kv_size(); - - case NO_VALUE: - return isNo_value(); - - case START_SORTKEY: - return getStart_sortkey(); - - case STOP_SORTKEY: - return getStop_sortkey(); - - case START_INCLUSIVE: - return isStart_inclusive(); - - case STOP_INCLUSIVE: - return isStop_inclusive(); - - case SORT_KEY_FILTER_TYPE: - return getSort_key_filter_type(); - - case SORT_KEY_FILTER_PATTERN: - return getSort_key_filter_pattern(); - - case REVERSE: - return isReverse(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case HASH_KEY: - return isSetHash_key(); - case SORK_KEYS: - return isSetSork_keys(); - case MAX_KV_COUNT: - return isSetMax_kv_count(); - case MAX_KV_SIZE: - return isSetMax_kv_size(); - case NO_VALUE: - return isSetNo_value(); - case START_SORTKEY: - return isSetStart_sortkey(); - case STOP_SORTKEY: - return isSetStop_sortkey(); - case START_INCLUSIVE: - return isSetStart_inclusive(); - case STOP_INCLUSIVE: - return isSetStop_inclusive(); - case SORT_KEY_FILTER_TYPE: - return isSetSort_key_filter_type(); - case SORT_KEY_FILTER_PATTERN: - return isSetSort_key_filter_pattern(); - case REVERSE: - return isSetReverse(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof multi_get_request) return this.equals((multi_get_request) that); - return false; - } - - public boolean equals(multi_get_request that) { - if (that == null) return false; - if (this == that) return true; - - boolean this_present_hash_key = true && this.isSetHash_key(); - boolean that_present_hash_key = true && that.isSetHash_key(); - if (this_present_hash_key || that_present_hash_key) { - if (!(this_present_hash_key && that_present_hash_key)) return false; - if (!this.hash_key.equals(that.hash_key)) return false; - } - - boolean this_present_sork_keys = true && this.isSetSork_keys(); - boolean that_present_sork_keys = true && that.isSetSork_keys(); - if (this_present_sork_keys || that_present_sork_keys) { - if (!(this_present_sork_keys && that_present_sork_keys)) return false; - if (!this.sork_keys.equals(that.sork_keys)) return false; - } - - boolean this_present_max_kv_count = true; - boolean that_present_max_kv_count = true; - if (this_present_max_kv_count || that_present_max_kv_count) { - if (!(this_present_max_kv_count && that_present_max_kv_count)) return false; - if (this.max_kv_count != that.max_kv_count) return false; - } - - boolean this_present_max_kv_size = true; - boolean that_present_max_kv_size = true; - if (this_present_max_kv_size || that_present_max_kv_size) { - if (!(this_present_max_kv_size && that_present_max_kv_size)) return false; - if (this.max_kv_size != that.max_kv_size) return false; - } - - boolean this_present_no_value = true; - boolean that_present_no_value = true; - if (this_present_no_value || that_present_no_value) { - if (!(this_present_no_value && that_present_no_value)) return false; - if (this.no_value != that.no_value) return false; - } - - boolean this_present_start_sortkey = true && this.isSetStart_sortkey(); - boolean that_present_start_sortkey = true && that.isSetStart_sortkey(); - if (this_present_start_sortkey || that_present_start_sortkey) { - if (!(this_present_start_sortkey && that_present_start_sortkey)) return false; - if (!this.start_sortkey.equals(that.start_sortkey)) return false; - } - - boolean this_present_stop_sortkey = true && this.isSetStop_sortkey(); - boolean that_present_stop_sortkey = true && that.isSetStop_sortkey(); - if (this_present_stop_sortkey || that_present_stop_sortkey) { - if (!(this_present_stop_sortkey && that_present_stop_sortkey)) return false; - if (!this.stop_sortkey.equals(that.stop_sortkey)) return false; - } - - boolean this_present_start_inclusive = true; - boolean that_present_start_inclusive = true; - if (this_present_start_inclusive || that_present_start_inclusive) { - if (!(this_present_start_inclusive && that_present_start_inclusive)) return false; - if (this.start_inclusive != that.start_inclusive) return false; - } - - boolean this_present_stop_inclusive = true; - boolean that_present_stop_inclusive = true; - if (this_present_stop_inclusive || that_present_stop_inclusive) { - if (!(this_present_stop_inclusive && that_present_stop_inclusive)) return false; - if (this.stop_inclusive != that.stop_inclusive) return false; - } - - boolean this_present_sort_key_filter_type = true && this.isSetSort_key_filter_type(); - boolean that_present_sort_key_filter_type = true && that.isSetSort_key_filter_type(); - if (this_present_sort_key_filter_type || that_present_sort_key_filter_type) { - if (!(this_present_sort_key_filter_type && that_present_sort_key_filter_type)) return false; - if (!this.sort_key_filter_type.equals(that.sort_key_filter_type)) return false; - } - - boolean this_present_sort_key_filter_pattern = true && this.isSetSort_key_filter_pattern(); - boolean that_present_sort_key_filter_pattern = true && that.isSetSort_key_filter_pattern(); - if (this_present_sort_key_filter_pattern || that_present_sort_key_filter_pattern) { - if (!(this_present_sort_key_filter_pattern && that_present_sort_key_filter_pattern)) - return false; - if (!this.sort_key_filter_pattern.equals(that.sort_key_filter_pattern)) return false; - } - - boolean this_present_reverse = true; - boolean that_present_reverse = true; - if (this_present_reverse || that_present_reverse) { - if (!(this_present_reverse && that_present_reverse)) return false; - if (this.reverse != that.reverse) return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetHash_key()) ? 131071 : 524287); - if (isSetHash_key()) hashCode = hashCode * 8191 + hash_key.hashCode(); - - hashCode = hashCode * 8191 + ((isSetSork_keys()) ? 131071 : 524287); - if (isSetSork_keys()) hashCode = hashCode * 8191 + sork_keys.hashCode(); - - hashCode = hashCode * 8191 + max_kv_count; - - hashCode = hashCode * 8191 + max_kv_size; - - hashCode = hashCode * 8191 + ((no_value) ? 131071 : 524287); - - hashCode = hashCode * 8191 + ((isSetStart_sortkey()) ? 131071 : 524287); - if (isSetStart_sortkey()) hashCode = hashCode * 8191 + start_sortkey.hashCode(); - - hashCode = hashCode * 8191 + ((isSetStop_sortkey()) ? 131071 : 524287); - if (isSetStop_sortkey()) hashCode = hashCode * 8191 + stop_sortkey.hashCode(); - - hashCode = hashCode * 8191 + ((start_inclusive) ? 131071 : 524287); - - hashCode = hashCode * 8191 + ((stop_inclusive) ? 131071 : 524287); - - hashCode = hashCode * 8191 + ((isSetSort_key_filter_type()) ? 131071 : 524287); - if (isSetSort_key_filter_type()) hashCode = hashCode * 8191 + sort_key_filter_type.getValue(); - - hashCode = hashCode * 8191 + ((isSetSort_key_filter_pattern()) ? 131071 : 524287); - if (isSetSort_key_filter_pattern()) - hashCode = hashCode * 8191 + sort_key_filter_pattern.hashCode(); - - hashCode = hashCode * 8191 + ((reverse) ? 131071 : 524287); - - return hashCode; - } - - @Override - public int compareTo(multi_get_request other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetHash_key()).compareTo(other.isSetHash_key()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetHash_key()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.hash_key, other.hash_key); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetSork_keys()).compareTo(other.isSetSork_keys()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSork_keys()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sork_keys, other.sork_keys); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetMax_kv_count()).compareTo(other.isSetMax_kv_count()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetMax_kv_count()) { - lastComparison = - org.apache.thrift.TBaseHelper.compareTo(this.max_kv_count, other.max_kv_count); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetMax_kv_size()).compareTo(other.isSetMax_kv_size()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetMax_kv_size()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.max_kv_size, other.max_kv_size); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetNo_value()).compareTo(other.isSetNo_value()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetNo_value()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.no_value, other.no_value); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetStart_sortkey()).compareTo(other.isSetStart_sortkey()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStart_sortkey()) { - lastComparison = - org.apache.thrift.TBaseHelper.compareTo(this.start_sortkey, other.start_sortkey); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetStop_sortkey()).compareTo(other.isSetStop_sortkey()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStop_sortkey()) { - lastComparison = - org.apache.thrift.TBaseHelper.compareTo(this.stop_sortkey, other.stop_sortkey); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetStart_inclusive()).compareTo(other.isSetStart_inclusive()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStart_inclusive()) { - lastComparison = - org.apache.thrift.TBaseHelper.compareTo(this.start_inclusive, other.start_inclusive); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetStop_inclusive()).compareTo(other.isSetStop_inclusive()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStop_inclusive()) { - lastComparison = - org.apache.thrift.TBaseHelper.compareTo(this.stop_inclusive, other.stop_inclusive); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetSort_key_filter_type()) - .compareTo(other.isSetSort_key_filter_type()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSort_key_filter_type()) { - lastComparison = - org.apache.thrift.TBaseHelper.compareTo( - this.sort_key_filter_type, other.sort_key_filter_type); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetSort_key_filter_pattern()) - .compareTo(other.isSetSort_key_filter_pattern()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSort_key_filter_pattern()) { - lastComparison = - org.apache.thrift.TBaseHelper.compareTo( - this.sort_key_filter_pattern, other.sort_key_filter_pattern); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetReverse()).compareTo(other.isSetReverse()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReverse()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.reverse, other.reverse); - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("multi_get_request("); - boolean first = true; - - sb.append("hash_key:"); - if (this.hash_key == null) { - sb.append("null"); - } else { - sb.append(this.hash_key); - } - first = false; - if (!first) sb.append(", "); - sb.append("sork_keys:"); - if (this.sork_keys == null) { - sb.append("null"); - } else { - sb.append(this.sork_keys); - } - first = false; - if (!first) sb.append(", "); - sb.append("max_kv_count:"); - sb.append(this.max_kv_count); - first = false; - if (!first) sb.append(", "); - sb.append("max_kv_size:"); - sb.append(this.max_kv_size); - first = false; - if (!first) sb.append(", "); - sb.append("no_value:"); - sb.append(this.no_value); - first = false; - if (!first) sb.append(", "); - sb.append("start_sortkey:"); - if (this.start_sortkey == null) { - sb.append("null"); - } else { - sb.append(this.start_sortkey); - } - first = false; - if (!first) sb.append(", "); - sb.append("stop_sortkey:"); - if (this.stop_sortkey == null) { - sb.append("null"); - } else { - sb.append(this.stop_sortkey); - } - first = false; - if (!first) sb.append(", "); - sb.append("start_inclusive:"); - sb.append(this.start_inclusive); - first = false; - if (!first) sb.append(", "); - sb.append("stop_inclusive:"); - sb.append(this.stop_inclusive); - first = false; - if (!first) sb.append(", "); - sb.append("sort_key_filter_type:"); - if (this.sort_key_filter_type == null) { - sb.append("null"); - } else { - sb.append(this.sort_key_filter_type); - } - first = false; - if (!first) sb.append(", "); - sb.append("sort_key_filter_pattern:"); - if (this.sort_key_filter_pattern == null) { - sb.append("null"); - } else { - sb.append(this.sort_key_filter_pattern); - } - first = false; - if (!first) sb.append(", "); - sb.append("reverse:"); - sb.append(this.reverse); - 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 (hash_key != null) { - hash_key.validate(); - } - if (start_sortkey != null) { - start_sortkey.validate(); - } - if (stop_sortkey != null) { - stop_sortkey.validate(); - } - if (sort_key_filter_pattern != null) { - sort_key_filter_pattern.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, java.lang.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 multi_get_requestStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public multi_get_requestStandardScheme getScheme() { - return new multi_get_requestStandardScheme(); - } - } - - private static class multi_get_requestStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, multi_get_request 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: // HASH_KEY - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.hash_key = new blob(); - struct.hash_key.read(iprot); - struct.setHash_keyIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // SORK_KEYS - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list16 = iprot.readListBegin(); - struct.sork_keys = new java.util.ArrayList(_list16.size); - blob _elem17; - for (int _i18 = 0; _i18 < _list16.size; ++_i18) { - _elem17 = new blob(); - _elem17.read(iprot); - struct.sork_keys.add(_elem17); - } - iprot.readListEnd(); - } - struct.setSork_keysIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // MAX_KV_COUNT - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.max_kv_count = iprot.readI32(); - struct.setMax_kv_countIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // MAX_KV_SIZE - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.max_kv_size = iprot.readI32(); - struct.setMax_kv_sizeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 5: // NO_VALUE - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.no_value = iprot.readBool(); - struct.setNo_valueIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 6: // START_SORTKEY - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.start_sortkey = new blob(); - struct.start_sortkey.read(iprot); - struct.setStart_sortkeyIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 7: // STOP_SORTKEY - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.stop_sortkey = new blob(); - struct.stop_sortkey.read(iprot); - struct.setStop_sortkeyIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 8: // START_INCLUSIVE - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.start_inclusive = iprot.readBool(); - struct.setStart_inclusiveIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 9: // STOP_INCLUSIVE - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.stop_inclusive = iprot.readBool(); - struct.setStop_inclusiveIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 10: // SORT_KEY_FILTER_TYPE - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.sort_key_filter_type = filter_type.findByValue(iprot.readI32()); - struct.setSort_key_filter_typeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 11: // SORT_KEY_FILTER_PATTERN - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.sort_key_filter_pattern = new blob(); - struct.sort_key_filter_pattern.read(iprot); - struct.setSort_key_filter_patternIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 12: // REVERSE - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.reverse = iprot.readBool(); - struct.setReverseIsSet(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, multi_get_request struct) - throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.hash_key != null) { - oprot.writeFieldBegin(HASH_KEY_FIELD_DESC); - struct.hash_key.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.sork_keys != null) { - oprot.writeFieldBegin(SORK_KEYS_FIELD_DESC); - { - oprot.writeListBegin( - new org.apache.thrift.protocol.TList( - org.apache.thrift.protocol.TType.STRUCT, struct.sork_keys.size())); - for (blob _iter19 : struct.sork_keys) { - _iter19.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(MAX_KV_COUNT_FIELD_DESC); - oprot.writeI32(struct.max_kv_count); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(MAX_KV_SIZE_FIELD_DESC); - oprot.writeI32(struct.max_kv_size); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(NO_VALUE_FIELD_DESC); - oprot.writeBool(struct.no_value); - oprot.writeFieldEnd(); - if (struct.start_sortkey != null) { - oprot.writeFieldBegin(START_SORTKEY_FIELD_DESC); - struct.start_sortkey.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.stop_sortkey != null) { - oprot.writeFieldBegin(STOP_SORTKEY_FIELD_DESC); - struct.stop_sortkey.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(START_INCLUSIVE_FIELD_DESC); - oprot.writeBool(struct.start_inclusive); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(STOP_INCLUSIVE_FIELD_DESC); - oprot.writeBool(struct.stop_inclusive); - oprot.writeFieldEnd(); - if (struct.sort_key_filter_type != null) { - oprot.writeFieldBegin(SORT_KEY_FILTER_TYPE_FIELD_DESC); - oprot.writeI32(struct.sort_key_filter_type.getValue()); - oprot.writeFieldEnd(); - } - if (struct.sort_key_filter_pattern != null) { - oprot.writeFieldBegin(SORT_KEY_FILTER_PATTERN_FIELD_DESC); - struct.sort_key_filter_pattern.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(REVERSE_FIELD_DESC); - oprot.writeBool(struct.reverse); - oprot.writeFieldEnd(); - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class multi_get_requestTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public multi_get_requestTupleScheme getScheme() { - return new multi_get_requestTupleScheme(); - } - } - - private static class multi_get_requestTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, multi_get_request struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetHash_key()) { - optionals.set(0); - } - if (struct.isSetSork_keys()) { - optionals.set(1); - } - if (struct.isSetMax_kv_count()) { - optionals.set(2); - } - if (struct.isSetMax_kv_size()) { - optionals.set(3); - } - if (struct.isSetNo_value()) { - optionals.set(4); - } - if (struct.isSetStart_sortkey()) { - optionals.set(5); - } - if (struct.isSetStop_sortkey()) { - optionals.set(6); - } - if (struct.isSetStart_inclusive()) { - optionals.set(7); - } - if (struct.isSetStop_inclusive()) { - optionals.set(8); - } - if (struct.isSetSort_key_filter_type()) { - optionals.set(9); - } - if (struct.isSetSort_key_filter_pattern()) { - optionals.set(10); - } - if (struct.isSetReverse()) { - optionals.set(11); - } - oprot.writeBitSet(optionals, 12); - if (struct.isSetHash_key()) { - struct.hash_key.write(oprot); - } - if (struct.isSetSork_keys()) { - { - oprot.writeI32(struct.sork_keys.size()); - for (blob _iter20 : struct.sork_keys) { - _iter20.write(oprot); - } - } - } - if (struct.isSetMax_kv_count()) { - oprot.writeI32(struct.max_kv_count); - } - if (struct.isSetMax_kv_size()) { - oprot.writeI32(struct.max_kv_size); - } - if (struct.isSetNo_value()) { - oprot.writeBool(struct.no_value); - } - if (struct.isSetStart_sortkey()) { - struct.start_sortkey.write(oprot); - } - if (struct.isSetStop_sortkey()) { - struct.stop_sortkey.write(oprot); - } - if (struct.isSetStart_inclusive()) { - oprot.writeBool(struct.start_inclusive); - } - if (struct.isSetStop_inclusive()) { - oprot.writeBool(struct.stop_inclusive); - } - if (struct.isSetSort_key_filter_type()) { - oprot.writeI32(struct.sort_key_filter_type.getValue()); - } - if (struct.isSetSort_key_filter_pattern()) { - struct.sort_key_filter_pattern.write(oprot); - } - if (struct.isSetReverse()) { - oprot.writeBool(struct.reverse); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, multi_get_request struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(12); - if (incoming.get(0)) { - struct.hash_key = new blob(); - struct.hash_key.read(iprot); - struct.setHash_keyIsSet(true); - } - if (incoming.get(1)) { - { - org.apache.thrift.protocol.TList _list21 = - new org.apache.thrift.protocol.TList( - org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.sork_keys = new java.util.ArrayList(_list21.size); - blob _elem22; - for (int _i23 = 0; _i23 < _list21.size; ++_i23) { - _elem22 = new blob(); - _elem22.read(iprot); - struct.sork_keys.add(_elem22); - } - } - struct.setSork_keysIsSet(true); - } - if (incoming.get(2)) { - struct.max_kv_count = iprot.readI32(); - struct.setMax_kv_countIsSet(true); - } - if (incoming.get(3)) { - struct.max_kv_size = iprot.readI32(); - struct.setMax_kv_sizeIsSet(true); - } - if (incoming.get(4)) { - struct.no_value = iprot.readBool(); - struct.setNo_valueIsSet(true); - } - if (incoming.get(5)) { - struct.start_sortkey = new blob(); - struct.start_sortkey.read(iprot); - struct.setStart_sortkeyIsSet(true); - } - if (incoming.get(6)) { - struct.stop_sortkey = new blob(); - struct.stop_sortkey.read(iprot); - struct.setStop_sortkeyIsSet(true); - } - if (incoming.get(7)) { - struct.start_inclusive = iprot.readBool(); - struct.setStart_inclusiveIsSet(true); - } - if (incoming.get(8)) { - struct.stop_inclusive = iprot.readBool(); - struct.setStop_inclusiveIsSet(true); - } - if (incoming.get(9)) { - struct.sort_key_filter_type = filter_type.findByValue(iprot.readI32()); - struct.setSort_key_filter_typeIsSet(true); - } - if (incoming.get(10)) { - struct.sort_key_filter_pattern = new blob(); - struct.sort_key_filter_pattern.read(iprot); - struct.setSort_key_filter_patternIsSet(true); - } - if (incoming.get(11)) { - struct.reverse = iprot.readBool(); - struct.setReverseIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } -} diff --git a/java-client/src/main/java/org/apache/pegasus/apps/multi_get_response.java b/java-client/src/main/java/org/apache/pegasus/apps/multi_get_response.java deleted file mode 100644 index 70a2456495..0000000000 --- a/java-client/src/main/java/org/apache/pegasus/apps/multi_get_response.java +++ /dev/null @@ -1,895 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.11.0) - * - *

DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * - * @generated - */ -package org.apache.pegasus.apps; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated( - value = "Autogenerated by Thrift Compiler (0.11.0)", - date = "2020-04-13") -public class multi_get_response - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("multi_get_response"); - - private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "error", org.apache.thrift.protocol.TType.I32, (short) 1); - private static final org.apache.thrift.protocol.TField KVS_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "kvs", org.apache.thrift.protocol.TType.LIST, (short) 2); - private static final org.apache.thrift.protocol.TField APP_ID_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "app_id", org.apache.thrift.protocol.TType.I32, (short) 3); - private static final org.apache.thrift.protocol.TField PARTITION_INDEX_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "partition_index", org.apache.thrift.protocol.TType.I32, (short) 4); - private static final org.apache.thrift.protocol.TField SERVER_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "server", org.apache.thrift.protocol.TType.STRING, (short) 6); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new multi_get_responseStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new multi_get_responseTupleSchemeFactory(); - - public int error; // required - public java.util.List kvs; // required - public int app_id; // required - public int partition_index; // required - public java.lang.String server; // 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 { - ERROR((short) 1, "error"), - KVS((short) 2, "kvs"), - APP_ID((short) 3, "app_id"), - PARTITION_INDEX((short) 4, "partition_index"), - SERVER((short) 6, "server"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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: // ERROR - return ERROR; - case 2: // KVS - return KVS; - case 3: // APP_ID - return APP_ID; - case 4: // PARTITION_INDEX - return PARTITION_INDEX; - case 6: // SERVER - return SERVER; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __ERROR_ISSET_ID = 0; - private static final int __APP_ID_ISSET_ID = 1; - private static final int __PARTITION_INDEX_ISSET_ID = 2; - private byte __isset_bitfield = 0; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put( - _Fields.ERROR, - new org.apache.thrift.meta_data.FieldMetaData( - "error", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I32))); - tmpMap.put( - _Fields.KVS, - new org.apache.thrift.meta_data.FieldMetaData( - "kvs", - 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, key_value.class)))); - tmpMap.put( - _Fields.APP_ID, - new org.apache.thrift.meta_data.FieldMetaData( - "app_id", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I32))); - tmpMap.put( - _Fields.PARTITION_INDEX, - new org.apache.thrift.meta_data.FieldMetaData( - "partition_index", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I32))); - tmpMap.put( - _Fields.SERVER, - new org.apache.thrift.meta_data.FieldMetaData( - "server", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.STRING))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap( - multi_get_response.class, metaDataMap); - } - - public multi_get_response() {} - - public multi_get_response( - int error, - java.util.List kvs, - int app_id, - int partition_index, - java.lang.String server) { - this(); - this.error = error; - setErrorIsSet(true); - this.kvs = kvs; - this.app_id = app_id; - setApp_idIsSet(true); - this.partition_index = partition_index; - setPartition_indexIsSet(true); - this.server = server; - } - - /** Performs a deep copy on other. */ - public multi_get_response(multi_get_response other) { - __isset_bitfield = other.__isset_bitfield; - this.error = other.error; - if (other.isSetKvs()) { - java.util.List __this__kvs = new java.util.ArrayList(other.kvs.size()); - for (key_value other_element : other.kvs) { - __this__kvs.add(new key_value(other_element)); - } - this.kvs = __this__kvs; - } - this.app_id = other.app_id; - this.partition_index = other.partition_index; - if (other.isSetServer()) { - this.server = other.server; - } - } - - public multi_get_response deepCopy() { - return new multi_get_response(this); - } - - @Override - public void clear() { - setErrorIsSet(false); - this.error = 0; - this.kvs = null; - setApp_idIsSet(false); - this.app_id = 0; - setPartition_indexIsSet(false); - this.partition_index = 0; - this.server = null; - } - - public int getError() { - return this.error; - } - - public multi_get_response setError(int error) { - this.error = error; - setErrorIsSet(true); - return this; - } - - public void unsetError() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ERROR_ISSET_ID); - } - - /** Returns true if field error is set (has been assigned a value) and false otherwise */ - public boolean isSetError() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ERROR_ISSET_ID); - } - - public void setErrorIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ERROR_ISSET_ID, value); - } - - public int getKvsSize() { - return (this.kvs == null) ? 0 : this.kvs.size(); - } - - public java.util.Iterator getKvsIterator() { - return (this.kvs == null) ? null : this.kvs.iterator(); - } - - public void addToKvs(key_value elem) { - if (this.kvs == null) { - this.kvs = new java.util.ArrayList(); - } - this.kvs.add(elem); - } - - public java.util.List getKvs() { - return this.kvs; - } - - public multi_get_response setKvs(java.util.List kvs) { - this.kvs = kvs; - return this; - } - - public void unsetKvs() { - this.kvs = null; - } - - /** Returns true if field kvs is set (has been assigned a value) and false otherwise */ - public boolean isSetKvs() { - return this.kvs != null; - } - - public void setKvsIsSet(boolean value) { - if (!value) { - this.kvs = null; - } - } - - public int getApp_id() { - return this.app_id; - } - - public multi_get_response setApp_id(int app_id) { - this.app_id = app_id; - setApp_idIsSet(true); - return this; - } - - public void unsetApp_id() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __APP_ID_ISSET_ID); - } - - /** Returns true if field app_id is set (has been assigned a value) and false otherwise */ - public boolean isSetApp_id() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __APP_ID_ISSET_ID); - } - - public void setApp_idIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __APP_ID_ISSET_ID, value); - } - - public int getPartition_index() { - return this.partition_index; - } - - public multi_get_response setPartition_index(int partition_index) { - this.partition_index = partition_index; - setPartition_indexIsSet(true); - return this; - } - - public void unsetPartition_index() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __PARTITION_INDEX_ISSET_ID); - } - - /** - * Returns true if field partition_index is set (has been assigned a value) and false otherwise - */ - public boolean isSetPartition_index() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __PARTITION_INDEX_ISSET_ID); - } - - public void setPartition_indexIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __PARTITION_INDEX_ISSET_ID, value); - } - - public java.lang.String getServer() { - return this.server; - } - - public multi_get_response setServer(java.lang.String server) { - this.server = server; - return this; - } - - public void unsetServer() { - this.server = null; - } - - /** Returns true if field server is set (has been assigned a value) and false otherwise */ - public boolean isSetServer() { - return this.server != null; - } - - public void setServerIsSet(boolean value) { - if (!value) { - this.server = null; - } - } - - public void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case ERROR: - if (value == null) { - unsetError(); - } else { - setError((java.lang.Integer) value); - } - break; - - case KVS: - if (value == null) { - unsetKvs(); - } else { - setKvs((java.util.List) value); - } - break; - - case APP_ID: - if (value == null) { - unsetApp_id(); - } else { - setApp_id((java.lang.Integer) value); - } - break; - - case PARTITION_INDEX: - if (value == null) { - unsetPartition_index(); - } else { - setPartition_index((java.lang.Integer) value); - } - break; - - case SERVER: - if (value == null) { - unsetServer(); - } else { - setServer((java.lang.String) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case ERROR: - return getError(); - - case KVS: - return getKvs(); - - case APP_ID: - return getApp_id(); - - case PARTITION_INDEX: - return getPartition_index(); - - case SERVER: - return getServer(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case ERROR: - return isSetError(); - case KVS: - return isSetKvs(); - case APP_ID: - return isSetApp_id(); - case PARTITION_INDEX: - return isSetPartition_index(); - case SERVER: - return isSetServer(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof multi_get_response) return this.equals((multi_get_response) that); - return false; - } - - public boolean equals(multi_get_response that) { - if (that == null) return false; - if (this == that) return true; - - boolean this_present_error = true; - boolean that_present_error = true; - if (this_present_error || that_present_error) { - if (!(this_present_error && that_present_error)) return false; - if (this.error != that.error) return false; - } - - boolean this_present_kvs = true && this.isSetKvs(); - boolean that_present_kvs = true && that.isSetKvs(); - if (this_present_kvs || that_present_kvs) { - if (!(this_present_kvs && that_present_kvs)) return false; - if (!this.kvs.equals(that.kvs)) return false; - } - - boolean this_present_app_id = true; - boolean that_present_app_id = true; - if (this_present_app_id || that_present_app_id) { - if (!(this_present_app_id && that_present_app_id)) return false; - if (this.app_id != that.app_id) return false; - } - - boolean this_present_partition_index = true; - boolean that_present_partition_index = true; - if (this_present_partition_index || that_present_partition_index) { - if (!(this_present_partition_index && that_present_partition_index)) return false; - if (this.partition_index != that.partition_index) return false; - } - - boolean this_present_server = true && this.isSetServer(); - boolean that_present_server = true && that.isSetServer(); - if (this_present_server || that_present_server) { - if (!(this_present_server && that_present_server)) return false; - if (!this.server.equals(that.server)) return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + error; - - hashCode = hashCode * 8191 + ((isSetKvs()) ? 131071 : 524287); - if (isSetKvs()) hashCode = hashCode * 8191 + kvs.hashCode(); - - hashCode = hashCode * 8191 + app_id; - - hashCode = hashCode * 8191 + partition_index; - - hashCode = hashCode * 8191 + ((isSetServer()) ? 131071 : 524287); - if (isSetServer()) hashCode = hashCode * 8191 + server.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(multi_get_response other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetError()).compareTo(other.isSetError()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetError()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetKvs()).compareTo(other.isSetKvs()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetKvs()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.kvs, other.kvs); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetApp_id()).compareTo(other.isSetApp_id()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetApp_id()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.app_id, other.app_id); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetPartition_index()).compareTo(other.isSetPartition_index()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetPartition_index()) { - lastComparison = - org.apache.thrift.TBaseHelper.compareTo(this.partition_index, other.partition_index); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetServer()).compareTo(other.isSetServer()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetServer()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.server, other.server); - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("multi_get_response("); - boolean first = true; - - sb.append("error:"); - sb.append(this.error); - first = false; - if (!first) sb.append(", "); - sb.append("kvs:"); - if (this.kvs == null) { - sb.append("null"); - } else { - sb.append(this.kvs); - } - first = false; - if (!first) sb.append(", "); - sb.append("app_id:"); - sb.append(this.app_id); - first = false; - if (!first) sb.append(", "); - sb.append("partition_index:"); - sb.append(this.partition_index); - first = false; - if (!first) sb.append(", "); - sb.append("server:"); - if (this.server == null) { - sb.append("null"); - } else { - sb.append(this.server); - } - 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, java.lang.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 multi_get_responseStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public multi_get_responseStandardScheme getScheme() { - return new multi_get_responseStandardScheme(); - } - } - - private static class multi_get_responseStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, multi_get_response 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: // ERROR - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.error = iprot.readI32(); - struct.setErrorIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // KVS - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list24 = iprot.readListBegin(); - struct.kvs = new java.util.ArrayList(_list24.size); - key_value _elem25; - for (int _i26 = 0; _i26 < _list24.size; ++_i26) { - _elem25 = new key_value(); - _elem25.read(iprot); - struct.kvs.add(_elem25); - } - iprot.readListEnd(); - } - struct.setKvsIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // APP_ID - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.app_id = iprot.readI32(); - struct.setApp_idIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // PARTITION_INDEX - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.partition_index = iprot.readI32(); - struct.setPartition_indexIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 6: // SERVER - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.server = iprot.readString(); - struct.setServerIsSet(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, multi_get_response struct) - throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(ERROR_FIELD_DESC); - oprot.writeI32(struct.error); - oprot.writeFieldEnd(); - if (struct.kvs != null) { - oprot.writeFieldBegin(KVS_FIELD_DESC); - { - oprot.writeListBegin( - new org.apache.thrift.protocol.TList( - org.apache.thrift.protocol.TType.STRUCT, struct.kvs.size())); - for (key_value _iter27 : struct.kvs) { - _iter27.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(APP_ID_FIELD_DESC); - oprot.writeI32(struct.app_id); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(PARTITION_INDEX_FIELD_DESC); - oprot.writeI32(struct.partition_index); - oprot.writeFieldEnd(); - if (struct.server != null) { - oprot.writeFieldBegin(SERVER_FIELD_DESC); - oprot.writeString(struct.server); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class multi_get_responseTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public multi_get_responseTupleScheme getScheme() { - return new multi_get_responseTupleScheme(); - } - } - - private static class multi_get_responseTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, multi_get_response struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetError()) { - optionals.set(0); - } - if (struct.isSetKvs()) { - optionals.set(1); - } - if (struct.isSetApp_id()) { - optionals.set(2); - } - if (struct.isSetPartition_index()) { - optionals.set(3); - } - if (struct.isSetServer()) { - optionals.set(4); - } - oprot.writeBitSet(optionals, 5); - if (struct.isSetError()) { - oprot.writeI32(struct.error); - } - if (struct.isSetKvs()) { - { - oprot.writeI32(struct.kvs.size()); - for (key_value _iter28 : struct.kvs) { - _iter28.write(oprot); - } - } - } - if (struct.isSetApp_id()) { - oprot.writeI32(struct.app_id); - } - if (struct.isSetPartition_index()) { - oprot.writeI32(struct.partition_index); - } - if (struct.isSetServer()) { - oprot.writeString(struct.server); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, multi_get_response struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(5); - if (incoming.get(0)) { - struct.error = iprot.readI32(); - struct.setErrorIsSet(true); - } - if (incoming.get(1)) { - { - org.apache.thrift.protocol.TList _list29 = - new org.apache.thrift.protocol.TList( - org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.kvs = new java.util.ArrayList(_list29.size); - key_value _elem30; - for (int _i31 = 0; _i31 < _list29.size; ++_i31) { - _elem30 = new key_value(); - _elem30.read(iprot); - struct.kvs.add(_elem30); - } - } - struct.setKvsIsSet(true); - } - if (incoming.get(2)) { - struct.app_id = iprot.readI32(); - struct.setApp_idIsSet(true); - } - if (incoming.get(3)) { - struct.partition_index = iprot.readI32(); - struct.setPartition_indexIsSet(true); - } - if (incoming.get(4)) { - struct.server = iprot.readString(); - struct.setServerIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } -} diff --git a/java-client/src/main/java/org/apache/pegasus/apps/multi_put_request.java b/java-client/src/main/java/org/apache/pegasus/apps/multi_put_request.java deleted file mode 100644 index 965e374a2d..0000000000 --- a/java-client/src/main/java/org/apache/pegasus/apps/multi_put_request.java +++ /dev/null @@ -1,696 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.11.0) - * - *

DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * - * @generated - */ -package org.apache.pegasus.apps; - -import org.apache.pegasus.base.blob; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated( - value = "Autogenerated by Thrift Compiler (0.11.0)", - date = "2020-04-13") -public class multi_put_request - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("multi_put_request"); - - private static final org.apache.thrift.protocol.TField HASH_KEY_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "hash_key", org.apache.thrift.protocol.TType.STRUCT, (short) 1); - private static final org.apache.thrift.protocol.TField KVS_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "kvs", org.apache.thrift.protocol.TType.LIST, (short) 2); - private static final org.apache.thrift.protocol.TField EXPIRE_TS_SECONDS_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "expire_ts_seconds", org.apache.thrift.protocol.TType.I32, (short) 3); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new multi_put_requestStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new multi_put_requestTupleSchemeFactory(); - - public blob hash_key; // required - public java.util.List kvs; // required - public int expire_ts_seconds; // 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 { - HASH_KEY((short) 1, "hash_key"), - KVS((short) 2, "kvs"), - EXPIRE_TS_SECONDS((short) 3, "expire_ts_seconds"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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: // HASH_KEY - return HASH_KEY; - case 2: // KVS - return KVS; - case 3: // EXPIRE_TS_SECONDS - return EXPIRE_TS_SECONDS; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __EXPIRE_TS_SECONDS_ISSET_ID = 0; - private byte __isset_bitfield = 0; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put( - _Fields.HASH_KEY, - new org.apache.thrift.meta_data.FieldMetaData( - "hash_key", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData( - org.apache.thrift.protocol.TType.STRUCT, blob.class))); - tmpMap.put( - _Fields.KVS, - new org.apache.thrift.meta_data.FieldMetaData( - "kvs", - 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, key_value.class)))); - tmpMap.put( - _Fields.EXPIRE_TS_SECONDS, - new org.apache.thrift.meta_data.FieldMetaData( - "expire_ts_seconds", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I32))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap( - multi_put_request.class, metaDataMap); - } - - public multi_put_request() {} - - public multi_put_request(blob hash_key, java.util.List kvs, int expire_ts_seconds) { - this(); - this.hash_key = hash_key; - this.kvs = kvs; - this.expire_ts_seconds = expire_ts_seconds; - setExpire_ts_secondsIsSet(true); - } - - /** Performs a deep copy on other. */ - public multi_put_request(multi_put_request other) { - __isset_bitfield = other.__isset_bitfield; - if (other.isSetHash_key()) { - this.hash_key = new blob(other.hash_key); - } - if (other.isSetKvs()) { - java.util.List __this__kvs = new java.util.ArrayList(other.kvs.size()); - for (key_value other_element : other.kvs) { - __this__kvs.add(new key_value(other_element)); - } - this.kvs = __this__kvs; - } - this.expire_ts_seconds = other.expire_ts_seconds; - } - - public multi_put_request deepCopy() { - return new multi_put_request(this); - } - - @Override - public void clear() { - this.hash_key = null; - this.kvs = null; - setExpire_ts_secondsIsSet(false); - this.expire_ts_seconds = 0; - } - - public blob getHash_key() { - return this.hash_key; - } - - public multi_put_request setHash_key(blob hash_key) { - this.hash_key = hash_key; - return this; - } - - public void unsetHash_key() { - this.hash_key = null; - } - - /** Returns true if field hash_key is set (has been assigned a value) and false otherwise */ - public boolean isSetHash_key() { - return this.hash_key != null; - } - - public void setHash_keyIsSet(boolean value) { - if (!value) { - this.hash_key = null; - } - } - - public int getKvsSize() { - return (this.kvs == null) ? 0 : this.kvs.size(); - } - - public java.util.Iterator getKvsIterator() { - return (this.kvs == null) ? null : this.kvs.iterator(); - } - - public void addToKvs(key_value elem) { - if (this.kvs == null) { - this.kvs = new java.util.ArrayList(); - } - this.kvs.add(elem); - } - - public java.util.List getKvs() { - return this.kvs; - } - - public multi_put_request setKvs(java.util.List kvs) { - this.kvs = kvs; - return this; - } - - public void unsetKvs() { - this.kvs = null; - } - - /** Returns true if field kvs is set (has been assigned a value) and false otherwise */ - public boolean isSetKvs() { - return this.kvs != null; - } - - public void setKvsIsSet(boolean value) { - if (!value) { - this.kvs = null; - } - } - - public int getExpire_ts_seconds() { - return this.expire_ts_seconds; - } - - public multi_put_request setExpire_ts_seconds(int expire_ts_seconds) { - this.expire_ts_seconds = expire_ts_seconds; - setExpire_ts_secondsIsSet(true); - return this; - } - - public void unsetExpire_ts_seconds() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __EXPIRE_TS_SECONDS_ISSET_ID); - } - - /** - * Returns true if field expire_ts_seconds is set (has been assigned a value) and false otherwise - */ - public boolean isSetExpire_ts_seconds() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __EXPIRE_TS_SECONDS_ISSET_ID); - } - - public void setExpire_ts_secondsIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit( - __isset_bitfield, __EXPIRE_TS_SECONDS_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case HASH_KEY: - if (value == null) { - unsetHash_key(); - } else { - setHash_key((blob) value); - } - break; - - case KVS: - if (value == null) { - unsetKvs(); - } else { - setKvs((java.util.List) value); - } - break; - - case EXPIRE_TS_SECONDS: - if (value == null) { - unsetExpire_ts_seconds(); - } else { - setExpire_ts_seconds((java.lang.Integer) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case HASH_KEY: - return getHash_key(); - - case KVS: - return getKvs(); - - case EXPIRE_TS_SECONDS: - return getExpire_ts_seconds(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case HASH_KEY: - return isSetHash_key(); - case KVS: - return isSetKvs(); - case EXPIRE_TS_SECONDS: - return isSetExpire_ts_seconds(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof multi_put_request) return this.equals((multi_put_request) that); - return false; - } - - public boolean equals(multi_put_request that) { - if (that == null) return false; - if (this == that) return true; - - boolean this_present_hash_key = true && this.isSetHash_key(); - boolean that_present_hash_key = true && that.isSetHash_key(); - if (this_present_hash_key || that_present_hash_key) { - if (!(this_present_hash_key && that_present_hash_key)) return false; - if (!this.hash_key.equals(that.hash_key)) return false; - } - - boolean this_present_kvs = true && this.isSetKvs(); - boolean that_present_kvs = true && that.isSetKvs(); - if (this_present_kvs || that_present_kvs) { - if (!(this_present_kvs && that_present_kvs)) return false; - if (!this.kvs.equals(that.kvs)) return false; - } - - boolean this_present_expire_ts_seconds = true; - boolean that_present_expire_ts_seconds = true; - if (this_present_expire_ts_seconds || that_present_expire_ts_seconds) { - if (!(this_present_expire_ts_seconds && that_present_expire_ts_seconds)) return false; - if (this.expire_ts_seconds != that.expire_ts_seconds) return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetHash_key()) ? 131071 : 524287); - if (isSetHash_key()) hashCode = hashCode * 8191 + hash_key.hashCode(); - - hashCode = hashCode * 8191 + ((isSetKvs()) ? 131071 : 524287); - if (isSetKvs()) hashCode = hashCode * 8191 + kvs.hashCode(); - - hashCode = hashCode * 8191 + expire_ts_seconds; - - return hashCode; - } - - @Override - public int compareTo(multi_put_request other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetHash_key()).compareTo(other.isSetHash_key()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetHash_key()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.hash_key, other.hash_key); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetKvs()).compareTo(other.isSetKvs()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetKvs()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.kvs, other.kvs); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetExpire_ts_seconds()) - .compareTo(other.isSetExpire_ts_seconds()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetExpire_ts_seconds()) { - lastComparison = - org.apache.thrift.TBaseHelper.compareTo(this.expire_ts_seconds, other.expire_ts_seconds); - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("multi_put_request("); - boolean first = true; - - sb.append("hash_key:"); - if (this.hash_key == null) { - sb.append("null"); - } else { - sb.append(this.hash_key); - } - first = false; - if (!first) sb.append(", "); - sb.append("kvs:"); - if (this.kvs == null) { - sb.append("null"); - } else { - sb.append(this.kvs); - } - first = false; - if (!first) sb.append(", "); - sb.append("expire_ts_seconds:"); - sb.append(this.expire_ts_seconds); - 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 (hash_key != null) { - hash_key.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, java.lang.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 multi_put_requestStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public multi_put_requestStandardScheme getScheme() { - return new multi_put_requestStandardScheme(); - } - } - - private static class multi_put_requestStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, multi_put_request 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: // HASH_KEY - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.hash_key = new blob(); - struct.hash_key.read(iprot); - struct.setHash_keyIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // KVS - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list0 = iprot.readListBegin(); - struct.kvs = new java.util.ArrayList(_list0.size); - key_value _elem1; - for (int _i2 = 0; _i2 < _list0.size; ++_i2) { - _elem1 = new key_value(); - _elem1.read(iprot); - struct.kvs.add(_elem1); - } - iprot.readListEnd(); - } - struct.setKvsIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // EXPIRE_TS_SECONDS - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.expire_ts_seconds = iprot.readI32(); - struct.setExpire_ts_secondsIsSet(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, multi_put_request struct) - throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.hash_key != null) { - oprot.writeFieldBegin(HASH_KEY_FIELD_DESC); - struct.hash_key.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.kvs != null) { - oprot.writeFieldBegin(KVS_FIELD_DESC); - { - oprot.writeListBegin( - new org.apache.thrift.protocol.TList( - org.apache.thrift.protocol.TType.STRUCT, struct.kvs.size())); - for (key_value _iter3 : struct.kvs) { - _iter3.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(EXPIRE_TS_SECONDS_FIELD_DESC); - oprot.writeI32(struct.expire_ts_seconds); - oprot.writeFieldEnd(); - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class multi_put_requestTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public multi_put_requestTupleScheme getScheme() { - return new multi_put_requestTupleScheme(); - } - } - - private static class multi_put_requestTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, multi_put_request struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetHash_key()) { - optionals.set(0); - } - if (struct.isSetKvs()) { - optionals.set(1); - } - if (struct.isSetExpire_ts_seconds()) { - optionals.set(2); - } - oprot.writeBitSet(optionals, 3); - if (struct.isSetHash_key()) { - struct.hash_key.write(oprot); - } - if (struct.isSetKvs()) { - { - oprot.writeI32(struct.kvs.size()); - for (key_value _iter4 : struct.kvs) { - _iter4.write(oprot); - } - } - } - if (struct.isSetExpire_ts_seconds()) { - oprot.writeI32(struct.expire_ts_seconds); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, multi_put_request struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(3); - if (incoming.get(0)) { - struct.hash_key = new blob(); - struct.hash_key.read(iprot); - struct.setHash_keyIsSet(true); - } - if (incoming.get(1)) { - { - org.apache.thrift.protocol.TList _list5 = - new org.apache.thrift.protocol.TList( - org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.kvs = new java.util.ArrayList(_list5.size); - key_value _elem6; - for (int _i7 = 0; _i7 < _list5.size; ++_i7) { - _elem6 = new key_value(); - _elem6.read(iprot); - struct.kvs.add(_elem6); - } - } - struct.setKvsIsSet(true); - } - if (incoming.get(2)) { - struct.expire_ts_seconds = iprot.readI32(); - struct.setExpire_ts_secondsIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } -} diff --git a/java-client/src/main/java/org/apache/pegasus/apps/multi_remove_request.java b/java-client/src/main/java/org/apache/pegasus/apps/multi_remove_request.java deleted file mode 100644 index 3f570ec0e8..0000000000 --- a/java-client/src/main/java/org/apache/pegasus/apps/multi_remove_request.java +++ /dev/null @@ -1,691 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.11.0) - * - *

DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * - * @generated - */ -package org.apache.pegasus.apps; - -import org.apache.pegasus.base.blob; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated( - value = "Autogenerated by Thrift Compiler (0.11.0)", - date = "2020-04-13") -public class multi_remove_request - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("multi_remove_request"); - - private static final org.apache.thrift.protocol.TField HASH_KEY_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "hash_key", org.apache.thrift.protocol.TType.STRUCT, (short) 1); - private static final org.apache.thrift.protocol.TField SORK_KEYS_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "sork_keys", org.apache.thrift.protocol.TType.LIST, (short) 2); - private static final org.apache.thrift.protocol.TField MAX_COUNT_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "max_count", org.apache.thrift.protocol.TType.I64, (short) 3); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new multi_remove_requestStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new multi_remove_requestTupleSchemeFactory(); - - public blob hash_key; // required - public java.util.List sork_keys; // required - public long max_count; // 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 { - HASH_KEY((short) 1, "hash_key"), - SORK_KEYS((short) 2, "sork_keys"), - MAX_COUNT((short) 3, "max_count"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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: // HASH_KEY - return HASH_KEY; - case 2: // SORK_KEYS - return SORK_KEYS; - case 3: // MAX_COUNT - return MAX_COUNT; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __MAX_COUNT_ISSET_ID = 0; - private byte __isset_bitfield = 0; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put( - _Fields.HASH_KEY, - new org.apache.thrift.meta_data.FieldMetaData( - "hash_key", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData( - org.apache.thrift.protocol.TType.STRUCT, blob.class))); - tmpMap.put( - _Fields.SORK_KEYS, - new org.apache.thrift.meta_data.FieldMetaData( - "sork_keys", - 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, blob.class)))); - tmpMap.put( - _Fields.MAX_COUNT, - new org.apache.thrift.meta_data.FieldMetaData( - "max_count", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I64))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap( - multi_remove_request.class, metaDataMap); - } - - public multi_remove_request() {} - - public multi_remove_request(blob hash_key, java.util.List sork_keys, long max_count) { - this(); - this.hash_key = hash_key; - this.sork_keys = sork_keys; - this.max_count = max_count; - setMax_countIsSet(true); - } - - /** Performs a deep copy on other. */ - public multi_remove_request(multi_remove_request other) { - __isset_bitfield = other.__isset_bitfield; - if (other.isSetHash_key()) { - this.hash_key = new blob(other.hash_key); - } - if (other.isSetSork_keys()) { - java.util.List __this__sork_keys = - new java.util.ArrayList(other.sork_keys.size()); - for (blob other_element : other.sork_keys) { - __this__sork_keys.add(new blob(other_element)); - } - this.sork_keys = __this__sork_keys; - } - this.max_count = other.max_count; - } - - public multi_remove_request deepCopy() { - return new multi_remove_request(this); - } - - @Override - public void clear() { - this.hash_key = null; - this.sork_keys = null; - setMax_countIsSet(false); - this.max_count = 0; - } - - public blob getHash_key() { - return this.hash_key; - } - - public multi_remove_request setHash_key(blob hash_key) { - this.hash_key = hash_key; - return this; - } - - public void unsetHash_key() { - this.hash_key = null; - } - - /** Returns true if field hash_key is set (has been assigned a value) and false otherwise */ - public boolean isSetHash_key() { - return this.hash_key != null; - } - - public void setHash_keyIsSet(boolean value) { - if (!value) { - this.hash_key = null; - } - } - - public int getSork_keysSize() { - return (this.sork_keys == null) ? 0 : this.sork_keys.size(); - } - - public java.util.Iterator getSork_keysIterator() { - return (this.sork_keys == null) ? null : this.sork_keys.iterator(); - } - - public void addToSork_keys(blob elem) { - if (this.sork_keys == null) { - this.sork_keys = new java.util.ArrayList(); - } - this.sork_keys.add(elem); - } - - public java.util.List getSork_keys() { - return this.sork_keys; - } - - public multi_remove_request setSork_keys(java.util.List sork_keys) { - this.sork_keys = sork_keys; - return this; - } - - public void unsetSork_keys() { - this.sork_keys = null; - } - - /** Returns true if field sork_keys is set (has been assigned a value) and false otherwise */ - public boolean isSetSork_keys() { - return this.sork_keys != null; - } - - public void setSork_keysIsSet(boolean value) { - if (!value) { - this.sork_keys = null; - } - } - - public long getMax_count() { - return this.max_count; - } - - public multi_remove_request setMax_count(long max_count) { - this.max_count = max_count; - setMax_countIsSet(true); - return this; - } - - public void unsetMax_count() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __MAX_COUNT_ISSET_ID); - } - - /** Returns true if field max_count is set (has been assigned a value) and false otherwise */ - public boolean isSetMax_count() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __MAX_COUNT_ISSET_ID); - } - - public void setMax_countIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __MAX_COUNT_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case HASH_KEY: - if (value == null) { - unsetHash_key(); - } else { - setHash_key((blob) value); - } - break; - - case SORK_KEYS: - if (value == null) { - unsetSork_keys(); - } else { - setSork_keys((java.util.List) value); - } - break; - - case MAX_COUNT: - if (value == null) { - unsetMax_count(); - } else { - setMax_count((java.lang.Long) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case HASH_KEY: - return getHash_key(); - - case SORK_KEYS: - return getSork_keys(); - - case MAX_COUNT: - return getMax_count(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case HASH_KEY: - return isSetHash_key(); - case SORK_KEYS: - return isSetSork_keys(); - case MAX_COUNT: - return isSetMax_count(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof multi_remove_request) return this.equals((multi_remove_request) that); - return false; - } - - public boolean equals(multi_remove_request that) { - if (that == null) return false; - if (this == that) return true; - - boolean this_present_hash_key = true && this.isSetHash_key(); - boolean that_present_hash_key = true && that.isSetHash_key(); - if (this_present_hash_key || that_present_hash_key) { - if (!(this_present_hash_key && that_present_hash_key)) return false; - if (!this.hash_key.equals(that.hash_key)) return false; - } - - boolean this_present_sork_keys = true && this.isSetSork_keys(); - boolean that_present_sork_keys = true && that.isSetSork_keys(); - if (this_present_sork_keys || that_present_sork_keys) { - if (!(this_present_sork_keys && that_present_sork_keys)) return false; - if (!this.sork_keys.equals(that.sork_keys)) return false; - } - - boolean this_present_max_count = true; - boolean that_present_max_count = true; - if (this_present_max_count || that_present_max_count) { - if (!(this_present_max_count && that_present_max_count)) return false; - if (this.max_count != that.max_count) return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetHash_key()) ? 131071 : 524287); - if (isSetHash_key()) hashCode = hashCode * 8191 + hash_key.hashCode(); - - hashCode = hashCode * 8191 + ((isSetSork_keys()) ? 131071 : 524287); - if (isSetSork_keys()) hashCode = hashCode * 8191 + sork_keys.hashCode(); - - hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(max_count); - - return hashCode; - } - - @Override - public int compareTo(multi_remove_request other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetHash_key()).compareTo(other.isSetHash_key()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetHash_key()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.hash_key, other.hash_key); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetSork_keys()).compareTo(other.isSetSork_keys()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSork_keys()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sork_keys, other.sork_keys); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetMax_count()).compareTo(other.isSetMax_count()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetMax_count()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.max_count, other.max_count); - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("multi_remove_request("); - boolean first = true; - - sb.append("hash_key:"); - if (this.hash_key == null) { - sb.append("null"); - } else { - sb.append(this.hash_key); - } - first = false; - if (!first) sb.append(", "); - sb.append("sork_keys:"); - if (this.sork_keys == null) { - sb.append("null"); - } else { - sb.append(this.sork_keys); - } - first = false; - if (!first) sb.append(", "); - sb.append("max_count:"); - sb.append(this.max_count); - 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 (hash_key != null) { - hash_key.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, java.lang.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 multi_remove_requestStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public multi_remove_requestStandardScheme getScheme() { - return new multi_remove_requestStandardScheme(); - } - } - - private static class multi_remove_requestStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, multi_remove_request 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: // HASH_KEY - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.hash_key = new blob(); - struct.hash_key.read(iprot); - struct.setHash_keyIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // SORK_KEYS - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list8 = iprot.readListBegin(); - struct.sork_keys = new java.util.ArrayList(_list8.size); - blob _elem9; - for (int _i10 = 0; _i10 < _list8.size; ++_i10) { - _elem9 = new blob(); - _elem9.read(iprot); - struct.sork_keys.add(_elem9); - } - iprot.readListEnd(); - } - struct.setSork_keysIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // MAX_COUNT - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.max_count = iprot.readI64(); - struct.setMax_countIsSet(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, multi_remove_request struct) - throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.hash_key != null) { - oprot.writeFieldBegin(HASH_KEY_FIELD_DESC); - struct.hash_key.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.sork_keys != null) { - oprot.writeFieldBegin(SORK_KEYS_FIELD_DESC); - { - oprot.writeListBegin( - new org.apache.thrift.protocol.TList( - org.apache.thrift.protocol.TType.STRUCT, struct.sork_keys.size())); - for (blob _iter11 : struct.sork_keys) { - _iter11.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(MAX_COUNT_FIELD_DESC); - oprot.writeI64(struct.max_count); - oprot.writeFieldEnd(); - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class multi_remove_requestTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public multi_remove_requestTupleScheme getScheme() { - return new multi_remove_requestTupleScheme(); - } - } - - private static class multi_remove_requestTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, multi_remove_request struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetHash_key()) { - optionals.set(0); - } - if (struct.isSetSork_keys()) { - optionals.set(1); - } - if (struct.isSetMax_count()) { - optionals.set(2); - } - oprot.writeBitSet(optionals, 3); - if (struct.isSetHash_key()) { - struct.hash_key.write(oprot); - } - if (struct.isSetSork_keys()) { - { - oprot.writeI32(struct.sork_keys.size()); - for (blob _iter12 : struct.sork_keys) { - _iter12.write(oprot); - } - } - } - if (struct.isSetMax_count()) { - oprot.writeI64(struct.max_count); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, multi_remove_request struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(3); - if (incoming.get(0)) { - struct.hash_key = new blob(); - struct.hash_key.read(iprot); - struct.setHash_keyIsSet(true); - } - if (incoming.get(1)) { - { - org.apache.thrift.protocol.TList _list13 = - new org.apache.thrift.protocol.TList( - org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.sork_keys = new java.util.ArrayList(_list13.size); - blob _elem14; - for (int _i15 = 0; _i15 < _list13.size; ++_i15) { - _elem14 = new blob(); - _elem14.read(iprot); - struct.sork_keys.add(_elem14); - } - } - struct.setSork_keysIsSet(true); - } - if (incoming.get(2)) { - struct.max_count = iprot.readI64(); - struct.setMax_countIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } -} diff --git a/java-client/src/main/java/org/apache/pegasus/apps/multi_remove_response.java b/java-client/src/main/java/org/apache/pegasus/apps/multi_remove_response.java deleted file mode 100644 index f4d0cbae73..0000000000 --- a/java-client/src/main/java/org/apache/pegasus/apps/multi_remove_response.java +++ /dev/null @@ -1,937 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.11.0) - * - *

DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * - * @generated - */ -package org.apache.pegasus.apps; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated( - value = "Autogenerated by Thrift Compiler (0.11.0)", - date = "2020-04-13") -public class multi_remove_response - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("multi_remove_response"); - - private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "error", org.apache.thrift.protocol.TType.I32, (short) 1); - private static final org.apache.thrift.protocol.TField COUNT_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "count", org.apache.thrift.protocol.TType.I64, (short) 2); - private static final org.apache.thrift.protocol.TField APP_ID_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "app_id", org.apache.thrift.protocol.TType.I32, (short) 3); - private static final org.apache.thrift.protocol.TField PARTITION_INDEX_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "partition_index", org.apache.thrift.protocol.TType.I32, (short) 4); - private static final org.apache.thrift.protocol.TField DECREE_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "decree", org.apache.thrift.protocol.TType.I64, (short) 5); - private static final org.apache.thrift.protocol.TField SERVER_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "server", org.apache.thrift.protocol.TType.STRING, (short) 6); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new multi_remove_responseStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new multi_remove_responseTupleSchemeFactory(); - - public int error; // required - public long count; // required - public int app_id; // required - public int partition_index; // required - public long decree; // required - public java.lang.String server; // 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 { - ERROR((short) 1, "error"), - COUNT((short) 2, "count"), - APP_ID((short) 3, "app_id"), - PARTITION_INDEX((short) 4, "partition_index"), - DECREE((short) 5, "decree"), - SERVER((short) 6, "server"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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: // ERROR - return ERROR; - case 2: // COUNT - return COUNT; - case 3: // APP_ID - return APP_ID; - case 4: // PARTITION_INDEX - return PARTITION_INDEX; - case 5: // DECREE - return DECREE; - case 6: // SERVER - return SERVER; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __ERROR_ISSET_ID = 0; - private static final int __COUNT_ISSET_ID = 1; - private static final int __APP_ID_ISSET_ID = 2; - private static final int __PARTITION_INDEX_ISSET_ID = 3; - private static final int __DECREE_ISSET_ID = 4; - private byte __isset_bitfield = 0; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put( - _Fields.ERROR, - new org.apache.thrift.meta_data.FieldMetaData( - "error", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I32))); - tmpMap.put( - _Fields.COUNT, - new org.apache.thrift.meta_data.FieldMetaData( - "count", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I64))); - tmpMap.put( - _Fields.APP_ID, - new org.apache.thrift.meta_data.FieldMetaData( - "app_id", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I32))); - tmpMap.put( - _Fields.PARTITION_INDEX, - new org.apache.thrift.meta_data.FieldMetaData( - "partition_index", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I32))); - tmpMap.put( - _Fields.DECREE, - new org.apache.thrift.meta_data.FieldMetaData( - "decree", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I64))); - tmpMap.put( - _Fields.SERVER, - new org.apache.thrift.meta_data.FieldMetaData( - "server", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.STRING))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap( - multi_remove_response.class, metaDataMap); - } - - public multi_remove_response() {} - - public multi_remove_response( - int error, - long count, - int app_id, - int partition_index, - long decree, - java.lang.String server) { - this(); - this.error = error; - setErrorIsSet(true); - this.count = count; - setCountIsSet(true); - this.app_id = app_id; - setApp_idIsSet(true); - this.partition_index = partition_index; - setPartition_indexIsSet(true); - this.decree = decree; - setDecreeIsSet(true); - this.server = server; - } - - /** Performs a deep copy on other. */ - public multi_remove_response(multi_remove_response other) { - __isset_bitfield = other.__isset_bitfield; - this.error = other.error; - this.count = other.count; - this.app_id = other.app_id; - this.partition_index = other.partition_index; - this.decree = other.decree; - if (other.isSetServer()) { - this.server = other.server; - } - } - - public multi_remove_response deepCopy() { - return new multi_remove_response(this); - } - - @Override - public void clear() { - setErrorIsSet(false); - this.error = 0; - setCountIsSet(false); - this.count = 0; - setApp_idIsSet(false); - this.app_id = 0; - setPartition_indexIsSet(false); - this.partition_index = 0; - setDecreeIsSet(false); - this.decree = 0; - this.server = null; - } - - public int getError() { - return this.error; - } - - public multi_remove_response setError(int error) { - this.error = error; - setErrorIsSet(true); - return this; - } - - public void unsetError() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ERROR_ISSET_ID); - } - - /** Returns true if field error is set (has been assigned a value) and false otherwise */ - public boolean isSetError() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ERROR_ISSET_ID); - } - - public void setErrorIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ERROR_ISSET_ID, value); - } - - public long getCount() { - return this.count; - } - - public multi_remove_response setCount(long count) { - this.count = count; - setCountIsSet(true); - return this; - } - - public void unsetCount() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __COUNT_ISSET_ID); - } - - /** Returns true if field count is set (has been assigned a value) and false otherwise */ - public boolean isSetCount() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __COUNT_ISSET_ID); - } - - public void setCountIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __COUNT_ISSET_ID, value); - } - - public int getApp_id() { - return this.app_id; - } - - public multi_remove_response setApp_id(int app_id) { - this.app_id = app_id; - setApp_idIsSet(true); - return this; - } - - public void unsetApp_id() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __APP_ID_ISSET_ID); - } - - /** Returns true if field app_id is set (has been assigned a value) and false otherwise */ - public boolean isSetApp_id() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __APP_ID_ISSET_ID); - } - - public void setApp_idIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __APP_ID_ISSET_ID, value); - } - - public int getPartition_index() { - return this.partition_index; - } - - public multi_remove_response setPartition_index(int partition_index) { - this.partition_index = partition_index; - setPartition_indexIsSet(true); - return this; - } - - public void unsetPartition_index() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __PARTITION_INDEX_ISSET_ID); - } - - /** - * Returns true if field partition_index is set (has been assigned a value) and false otherwise - */ - public boolean isSetPartition_index() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __PARTITION_INDEX_ISSET_ID); - } - - public void setPartition_indexIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __PARTITION_INDEX_ISSET_ID, value); - } - - public long getDecree() { - return this.decree; - } - - public multi_remove_response setDecree(long decree) { - this.decree = decree; - setDecreeIsSet(true); - return this; - } - - public void unsetDecree() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __DECREE_ISSET_ID); - } - - /** Returns true if field decree is set (has been assigned a value) and false otherwise */ - public boolean isSetDecree() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __DECREE_ISSET_ID); - } - - public void setDecreeIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __DECREE_ISSET_ID, value); - } - - public java.lang.String getServer() { - return this.server; - } - - public multi_remove_response setServer(java.lang.String server) { - this.server = server; - return this; - } - - public void unsetServer() { - this.server = null; - } - - /** Returns true if field server is set (has been assigned a value) and false otherwise */ - public boolean isSetServer() { - return this.server != null; - } - - public void setServerIsSet(boolean value) { - if (!value) { - this.server = null; - } - } - - public void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case ERROR: - if (value == null) { - unsetError(); - } else { - setError((java.lang.Integer) value); - } - break; - - case COUNT: - if (value == null) { - unsetCount(); - } else { - setCount((java.lang.Long) value); - } - break; - - case APP_ID: - if (value == null) { - unsetApp_id(); - } else { - setApp_id((java.lang.Integer) value); - } - break; - - case PARTITION_INDEX: - if (value == null) { - unsetPartition_index(); - } else { - setPartition_index((java.lang.Integer) value); - } - break; - - case DECREE: - if (value == null) { - unsetDecree(); - } else { - setDecree((java.lang.Long) value); - } - break; - - case SERVER: - if (value == null) { - unsetServer(); - } else { - setServer((java.lang.String) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case ERROR: - return getError(); - - case COUNT: - return getCount(); - - case APP_ID: - return getApp_id(); - - case PARTITION_INDEX: - return getPartition_index(); - - case DECREE: - return getDecree(); - - case SERVER: - return getServer(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case ERROR: - return isSetError(); - case COUNT: - return isSetCount(); - case APP_ID: - return isSetApp_id(); - case PARTITION_INDEX: - return isSetPartition_index(); - case DECREE: - return isSetDecree(); - case SERVER: - return isSetServer(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof multi_remove_response) return this.equals((multi_remove_response) that); - return false; - } - - public boolean equals(multi_remove_response that) { - if (that == null) return false; - if (this == that) return true; - - boolean this_present_error = true; - boolean that_present_error = true; - if (this_present_error || that_present_error) { - if (!(this_present_error && that_present_error)) return false; - if (this.error != that.error) return false; - } - - boolean this_present_count = true; - boolean that_present_count = true; - if (this_present_count || that_present_count) { - if (!(this_present_count && that_present_count)) return false; - if (this.count != that.count) return false; - } - - boolean this_present_app_id = true; - boolean that_present_app_id = true; - if (this_present_app_id || that_present_app_id) { - if (!(this_present_app_id && that_present_app_id)) return false; - if (this.app_id != that.app_id) return false; - } - - boolean this_present_partition_index = true; - boolean that_present_partition_index = true; - if (this_present_partition_index || that_present_partition_index) { - if (!(this_present_partition_index && that_present_partition_index)) return false; - if (this.partition_index != that.partition_index) return false; - } - - boolean this_present_decree = true; - boolean that_present_decree = true; - if (this_present_decree || that_present_decree) { - if (!(this_present_decree && that_present_decree)) return false; - if (this.decree != that.decree) return false; - } - - boolean this_present_server = true && this.isSetServer(); - boolean that_present_server = true && that.isSetServer(); - if (this_present_server || that_present_server) { - if (!(this_present_server && that_present_server)) return false; - if (!this.server.equals(that.server)) return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + error; - - hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(count); - - hashCode = hashCode * 8191 + app_id; - - hashCode = hashCode * 8191 + partition_index; - - hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(decree); - - hashCode = hashCode * 8191 + ((isSetServer()) ? 131071 : 524287); - if (isSetServer()) hashCode = hashCode * 8191 + server.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(multi_remove_response other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetError()).compareTo(other.isSetError()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetError()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetCount()).compareTo(other.isSetCount()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetCount()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.count, other.count); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetApp_id()).compareTo(other.isSetApp_id()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetApp_id()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.app_id, other.app_id); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetPartition_index()).compareTo(other.isSetPartition_index()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetPartition_index()) { - lastComparison = - org.apache.thrift.TBaseHelper.compareTo(this.partition_index, other.partition_index); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetDecree()).compareTo(other.isSetDecree()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetDecree()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.decree, other.decree); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetServer()).compareTo(other.isSetServer()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetServer()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.server, other.server); - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("multi_remove_response("); - boolean first = true; - - sb.append("error:"); - sb.append(this.error); - first = false; - if (!first) sb.append(", "); - sb.append("count:"); - sb.append(this.count); - first = false; - if (!first) sb.append(", "); - sb.append("app_id:"); - sb.append(this.app_id); - first = false; - if (!first) sb.append(", "); - sb.append("partition_index:"); - sb.append(this.partition_index); - first = false; - if (!first) sb.append(", "); - sb.append("decree:"); - sb.append(this.decree); - first = false; - if (!first) sb.append(", "); - sb.append("server:"); - if (this.server == null) { - sb.append("null"); - } else { - sb.append(this.server); - } - 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, java.lang.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 multi_remove_responseStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public multi_remove_responseStandardScheme getScheme() { - return new multi_remove_responseStandardScheme(); - } - } - - private static class multi_remove_responseStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, multi_remove_response 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: // ERROR - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.error = iprot.readI32(); - struct.setErrorIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // COUNT - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.count = iprot.readI64(); - struct.setCountIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // APP_ID - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.app_id = iprot.readI32(); - struct.setApp_idIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // PARTITION_INDEX - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.partition_index = iprot.readI32(); - struct.setPartition_indexIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 5: // DECREE - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.decree = iprot.readI64(); - struct.setDecreeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 6: // SERVER - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.server = iprot.readString(); - struct.setServerIsSet(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, multi_remove_response struct) - throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(ERROR_FIELD_DESC); - oprot.writeI32(struct.error); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(COUNT_FIELD_DESC); - oprot.writeI64(struct.count); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(APP_ID_FIELD_DESC); - oprot.writeI32(struct.app_id); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(PARTITION_INDEX_FIELD_DESC); - oprot.writeI32(struct.partition_index); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(DECREE_FIELD_DESC); - oprot.writeI64(struct.decree); - oprot.writeFieldEnd(); - if (struct.server != null) { - oprot.writeFieldBegin(SERVER_FIELD_DESC); - oprot.writeString(struct.server); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class multi_remove_responseTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public multi_remove_responseTupleScheme getScheme() { - return new multi_remove_responseTupleScheme(); - } - } - - private static class multi_remove_responseTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, multi_remove_response struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetError()) { - optionals.set(0); - } - if (struct.isSetCount()) { - optionals.set(1); - } - if (struct.isSetApp_id()) { - optionals.set(2); - } - if (struct.isSetPartition_index()) { - optionals.set(3); - } - if (struct.isSetDecree()) { - optionals.set(4); - } - if (struct.isSetServer()) { - optionals.set(5); - } - oprot.writeBitSet(optionals, 6); - if (struct.isSetError()) { - oprot.writeI32(struct.error); - } - if (struct.isSetCount()) { - oprot.writeI64(struct.count); - } - if (struct.isSetApp_id()) { - oprot.writeI32(struct.app_id); - } - if (struct.isSetPartition_index()) { - oprot.writeI32(struct.partition_index); - } - if (struct.isSetDecree()) { - oprot.writeI64(struct.decree); - } - if (struct.isSetServer()) { - oprot.writeString(struct.server); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, multi_remove_response struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(6); - if (incoming.get(0)) { - struct.error = iprot.readI32(); - struct.setErrorIsSet(true); - } - if (incoming.get(1)) { - struct.count = iprot.readI64(); - struct.setCountIsSet(true); - } - if (incoming.get(2)) { - struct.app_id = iprot.readI32(); - struct.setApp_idIsSet(true); - } - if (incoming.get(3)) { - struct.partition_index = iprot.readI32(); - struct.setPartition_indexIsSet(true); - } - if (incoming.get(4)) { - struct.decree = iprot.readI64(); - struct.setDecreeIsSet(true); - } - if (incoming.get(5)) { - struct.server = iprot.readString(); - struct.setServerIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } -} diff --git a/java-client/src/main/java/org/apache/pegasus/apps/mutate.java b/java-client/src/main/java/org/apache/pegasus/apps/mutate.java deleted file mode 100644 index 1bb9a44ea5..0000000000 --- a/java-client/src/main/java/org/apache/pegasus/apps/mutate.java +++ /dev/null @@ -1,759 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.11.0) - * - *

DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * - * @generated - */ -package org.apache.pegasus.apps; - -import org.apache.pegasus.base.blob; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated( - value = "Autogenerated by Thrift Compiler (0.11.0)", - date = "2020-04-13") -public class mutate - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("mutate"); - - private static final org.apache.thrift.protocol.TField OPERATION_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "operation", org.apache.thrift.protocol.TType.I32, (short) 1); - private static final org.apache.thrift.protocol.TField SORT_KEY_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "sort_key", org.apache.thrift.protocol.TType.STRUCT, (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.STRUCT, (short) 3); - private static final org.apache.thrift.protocol.TField SET_EXPIRE_TS_SECONDS_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "set_expire_ts_seconds", org.apache.thrift.protocol.TType.I32, (short) 4); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new mutateStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new mutateTupleSchemeFactory(); - - /** @see mutate_operation */ - public mutate_operation operation; // required - - public blob sort_key; // required - public blob value; // required - public int set_expire_ts_seconds; // 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 { - /** @see mutate_operation */ - OPERATION((short) 1, "operation"), - SORT_KEY((short) 2, "sort_key"), - VALUE((short) 3, "value"), - SET_EXPIRE_TS_SECONDS((short) 4, "set_expire_ts_seconds"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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: // OPERATION - return OPERATION; - case 2: // SORT_KEY - return SORT_KEY; - case 3: // VALUE - return VALUE; - case 4: // SET_EXPIRE_TS_SECONDS - return SET_EXPIRE_TS_SECONDS; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __SET_EXPIRE_TS_SECONDS_ISSET_ID = 0; - private byte __isset_bitfield = 0; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put( - _Fields.OPERATION, - new org.apache.thrift.meta_data.FieldMetaData( - "operation", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.EnumMetaData( - org.apache.thrift.protocol.TType.ENUM, mutate_operation.class))); - tmpMap.put( - _Fields.SORT_KEY, - new org.apache.thrift.meta_data.FieldMetaData( - "sort_key", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData( - org.apache.thrift.protocol.TType.STRUCT, blob.class))); - tmpMap.put( - _Fields.VALUE, - new org.apache.thrift.meta_data.FieldMetaData( - "value", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData( - org.apache.thrift.protocol.TType.STRUCT, blob.class))); - tmpMap.put( - _Fields.SET_EXPIRE_TS_SECONDS, - new org.apache.thrift.meta_data.FieldMetaData( - "set_expire_ts_seconds", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I32))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(mutate.class, metaDataMap); - } - - public mutate() {} - - public mutate(mutate_operation operation, blob sort_key, blob value, int set_expire_ts_seconds) { - this(); - this.operation = operation; - this.sort_key = sort_key; - this.value = value; - this.set_expire_ts_seconds = set_expire_ts_seconds; - setSet_expire_ts_secondsIsSet(true); - } - - /** Performs a deep copy on other. */ - public mutate(mutate other) { - __isset_bitfield = other.__isset_bitfield; - if (other.isSetOperation()) { - this.operation = other.operation; - } - if (other.isSetSort_key()) { - this.sort_key = new blob(other.sort_key); - } - if (other.isSetValue()) { - this.value = new blob(other.value); - } - this.set_expire_ts_seconds = other.set_expire_ts_seconds; - } - - public mutate deepCopy() { - return new mutate(this); - } - - @Override - public void clear() { - this.operation = null; - this.sort_key = null; - this.value = null; - setSet_expire_ts_secondsIsSet(false); - this.set_expire_ts_seconds = 0; - } - - /** @see mutate_operation */ - public mutate_operation getOperation() { - return this.operation; - } - - /** @see mutate_operation */ - public mutate setOperation(mutate_operation operation) { - this.operation = operation; - return this; - } - - public void unsetOperation() { - this.operation = null; - } - - /** Returns true if field operation is set (has been assigned a value) and false otherwise */ - public boolean isSetOperation() { - return this.operation != null; - } - - public void setOperationIsSet(boolean value) { - if (!value) { - this.operation = null; - } - } - - public blob getSort_key() { - return this.sort_key; - } - - public mutate setSort_key(blob sort_key) { - this.sort_key = sort_key; - return this; - } - - public void unsetSort_key() { - this.sort_key = null; - } - - /** Returns true if field sort_key is set (has been assigned a value) and false otherwise */ - public boolean isSetSort_key() { - return this.sort_key != null; - } - - public void setSort_keyIsSet(boolean value) { - if (!value) { - this.sort_key = null; - } - } - - public blob getValue() { - return this.value; - } - - public mutate setValue(blob 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 int getSet_expire_ts_seconds() { - return this.set_expire_ts_seconds; - } - - public mutate setSet_expire_ts_seconds(int set_expire_ts_seconds) { - this.set_expire_ts_seconds = set_expire_ts_seconds; - setSet_expire_ts_secondsIsSet(true); - return this; - } - - public void unsetSet_expire_ts_seconds() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit( - __isset_bitfield, __SET_EXPIRE_TS_SECONDS_ISSET_ID); - } - - /** - * Returns true if field set_expire_ts_seconds is set (has been assigned a value) and false - * otherwise - */ - public boolean isSetSet_expire_ts_seconds() { - return org.apache.thrift.EncodingUtils.testBit( - __isset_bitfield, __SET_EXPIRE_TS_SECONDS_ISSET_ID); - } - - public void setSet_expire_ts_secondsIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit( - __isset_bitfield, __SET_EXPIRE_TS_SECONDS_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case OPERATION: - if (value == null) { - unsetOperation(); - } else { - setOperation((mutate_operation) value); - } - break; - - case SORT_KEY: - if (value == null) { - unsetSort_key(); - } else { - setSort_key((blob) value); - } - break; - - case VALUE: - if (value == null) { - unsetValue(); - } else { - setValue((blob) value); - } - break; - - case SET_EXPIRE_TS_SECONDS: - if (value == null) { - unsetSet_expire_ts_seconds(); - } else { - setSet_expire_ts_seconds((java.lang.Integer) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case OPERATION: - return getOperation(); - - case SORT_KEY: - return getSort_key(); - - case VALUE: - return getValue(); - - case SET_EXPIRE_TS_SECONDS: - return getSet_expire_ts_seconds(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case OPERATION: - return isSetOperation(); - case SORT_KEY: - return isSetSort_key(); - case VALUE: - return isSetValue(); - case SET_EXPIRE_TS_SECONDS: - return isSetSet_expire_ts_seconds(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof mutate) return this.equals((mutate) that); - return false; - } - - public boolean equals(mutate that) { - if (that == null) return false; - if (this == that) return true; - - boolean this_present_operation = true && this.isSetOperation(); - boolean that_present_operation = true && that.isSetOperation(); - if (this_present_operation || that_present_operation) { - if (!(this_present_operation && that_present_operation)) return false; - if (!this.operation.equals(that.operation)) return false; - } - - boolean this_present_sort_key = true && this.isSetSort_key(); - boolean that_present_sort_key = true && that.isSetSort_key(); - if (this_present_sort_key || that_present_sort_key) { - if (!(this_present_sort_key && that_present_sort_key)) return false; - if (!this.sort_key.equals(that.sort_key)) 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_set_expire_ts_seconds = true; - boolean that_present_set_expire_ts_seconds = true; - if (this_present_set_expire_ts_seconds || that_present_set_expire_ts_seconds) { - if (!(this_present_set_expire_ts_seconds && that_present_set_expire_ts_seconds)) return false; - if (this.set_expire_ts_seconds != that.set_expire_ts_seconds) return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetOperation()) ? 131071 : 524287); - if (isSetOperation()) hashCode = hashCode * 8191 + operation.getValue(); - - hashCode = hashCode * 8191 + ((isSetSort_key()) ? 131071 : 524287); - if (isSetSort_key()) hashCode = hashCode * 8191 + sort_key.hashCode(); - - hashCode = hashCode * 8191 + ((isSetValue()) ? 131071 : 524287); - if (isSetValue()) hashCode = hashCode * 8191 + value.hashCode(); - - hashCode = hashCode * 8191 + set_expire_ts_seconds; - - return hashCode; - } - - @Override - public int compareTo(mutate other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetOperation()).compareTo(other.isSetOperation()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOperation()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operation, other.operation); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetSort_key()).compareTo(other.isSetSort_key()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSort_key()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sort_key, other.sort_key); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetValue()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, other.value); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetSet_expire_ts_seconds()) - .compareTo(other.isSetSet_expire_ts_seconds()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSet_expire_ts_seconds()) { - lastComparison = - org.apache.thrift.TBaseHelper.compareTo( - this.set_expire_ts_seconds, other.set_expire_ts_seconds); - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("mutate("); - boolean first = true; - - sb.append("operation:"); - if (this.operation == null) { - sb.append("null"); - } else { - sb.append(this.operation); - } - first = false; - if (!first) sb.append(", "); - sb.append("sort_key:"); - if (this.sort_key == null) { - sb.append("null"); - } else { - sb.append(this.sort_key); - } - first = false; - if (!first) sb.append(", "); - sb.append("value:"); - if (this.value == null) { - sb.append("null"); - } else { - sb.append(this.value); - } - first = false; - if (!first) sb.append(", "); - sb.append("set_expire_ts_seconds:"); - sb.append(this.set_expire_ts_seconds); - 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 (sort_key != null) { - sort_key.validate(); - } - if (value != null) { - value.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, java.lang.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 mutateStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public mutateStandardScheme getScheme() { - return new mutateStandardScheme(); - } - } - - private static class mutateStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, mutate 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: // OPERATION - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.operation = mutate_operation.findByValue(iprot.readI32()); - struct.setOperationIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // SORT_KEY - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.sort_key = new blob(); - struct.sort_key.read(iprot); - struct.setSort_keyIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // VALUE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.value = new blob(); - struct.value.read(iprot); - struct.setValueIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // SET_EXPIRE_TS_SECONDS - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.set_expire_ts_seconds = iprot.readI32(); - struct.setSet_expire_ts_secondsIsSet(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, mutate struct) - throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.operation != null) { - oprot.writeFieldBegin(OPERATION_FIELD_DESC); - oprot.writeI32(struct.operation.getValue()); - oprot.writeFieldEnd(); - } - if (struct.sort_key != null) { - oprot.writeFieldBegin(SORT_KEY_FIELD_DESC); - struct.sort_key.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.value != null) { - oprot.writeFieldBegin(VALUE_FIELD_DESC); - struct.value.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(SET_EXPIRE_TS_SECONDS_FIELD_DESC); - oprot.writeI32(struct.set_expire_ts_seconds); - oprot.writeFieldEnd(); - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class mutateTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public mutateTupleScheme getScheme() { - return new mutateTupleScheme(); - } - } - - private static class mutateTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, mutate struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetOperation()) { - optionals.set(0); - } - if (struct.isSetSort_key()) { - optionals.set(1); - } - if (struct.isSetValue()) { - optionals.set(2); - } - if (struct.isSetSet_expire_ts_seconds()) { - optionals.set(3); - } - oprot.writeBitSet(optionals, 4); - if (struct.isSetOperation()) { - oprot.writeI32(struct.operation.getValue()); - } - if (struct.isSetSort_key()) { - struct.sort_key.write(oprot); - } - if (struct.isSetValue()) { - struct.value.write(oprot); - } - if (struct.isSetSet_expire_ts_seconds()) { - oprot.writeI32(struct.set_expire_ts_seconds); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, mutate struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(4); - if (incoming.get(0)) { - struct.operation = mutate_operation.findByValue(iprot.readI32()); - struct.setOperationIsSet(true); - } - if (incoming.get(1)) { - struct.sort_key = new blob(); - struct.sort_key.read(iprot); - struct.setSort_keyIsSet(true); - } - if (incoming.get(2)) { - struct.value = new blob(); - struct.value.read(iprot); - struct.setValueIsSet(true); - } - if (incoming.get(3)) { - struct.set_expire_ts_seconds = iprot.readI32(); - struct.setSet_expire_ts_secondsIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } -} diff --git a/java-client/src/main/java/org/apache/pegasus/apps/mutate_operation.java b/java-client/src/main/java/org/apache/pegasus/apps/mutate_operation.java deleted file mode 100644 index de4405138e..0000000000 --- a/java-client/src/main/java/org/apache/pegasus/apps/mutate_operation.java +++ /dev/null @@ -1,58 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.11.0) - * - *

DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * - * @generated - */ -package org.apache.pegasus.apps; - -public enum mutate_operation implements org.apache.thrift.TEnum { - MO_PUT(0), - MO_DELETE(1); - - private final int value; - - private mutate_operation(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 mutate_operation findByValue(int value) { - switch (value) { - case 0: - return MO_PUT; - case 1: - return MO_DELETE; - default: - return null; - } - } -} diff --git a/java-client/src/main/java/org/apache/pegasus/apps/mutate_result.java b/java-client/src/main/java/org/apache/pegasus/apps/mutate_result.java deleted file mode 100644 index 1cf9ef157a..0000000000 --- a/java-client/src/main/java/org/apache/pegasus/apps/mutate_result.java +++ /dev/null @@ -1,748 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.11.0) - * - *

DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * - * @generated - */ -package org.apache.pegasus.apps; - -import org.apache.pegasus.base.blob; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated( - value = "Autogenerated by Thrift Compiler (0.11.0)", - date = "2018-08-02") -public class mutate_result - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("mutate_result"); - - private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "error", org.apache.thrift.protocol.TType.I32, (short) 1); - private static final org.apache.thrift.protocol.TField CHECK_VALUE_RETURNED_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "check_value_returned", org.apache.thrift.protocol.TType.BOOL, (short) 2); - private static final org.apache.thrift.protocol.TField CHECK_VALUE_EXIST_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "check_value_exist", org.apache.thrift.protocol.TType.BOOL, (short) 3); - private static final org.apache.thrift.protocol.TField CHECK_VALUE_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "check_value", org.apache.thrift.protocol.TType.STRUCT, (short) 4); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new mutate_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new mutate_resultTupleSchemeFactory(); - - public int error; // required - public boolean check_value_returned; // required - public boolean check_value_exist; // required - public blob check_value; // required - - /** - * The set of fields this struct contains, along with convenience methods for finding and - * manipulating them. - */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - ERROR((short) 1, "error"), - CHECK_VALUE_RETURNED((short) 2, "check_value_returned"), - CHECK_VALUE_EXIST((short) 3, "check_value_exist"), - CHECK_VALUE((short) 4, "check_value"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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: // ERROR - return ERROR; - case 2: // CHECK_VALUE_RETURNED - return CHECK_VALUE_RETURNED; - case 3: // CHECK_VALUE_EXIST - return CHECK_VALUE_EXIST; - case 4: // CHECK_VALUE - return CHECK_VALUE; - default: - return null; - } - } - - /** Find the _Fields constant that matches fieldId, throwing an exception if it is not found. */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) - throw new java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __ERROR_ISSET_ID = 0; - private static final int __CHECK_VALUE_RETURNED_ISSET_ID = 1; - private static final int __CHECK_VALUE_EXIST_ISSET_ID = 2; - private byte __isset_bitfield = 0; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put( - _Fields.ERROR, - new org.apache.thrift.meta_data.FieldMetaData( - "error", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I32))); - tmpMap.put( - _Fields.CHECK_VALUE_RETURNED, - new org.apache.thrift.meta_data.FieldMetaData( - "check_value_returned", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.BOOL))); - tmpMap.put( - _Fields.CHECK_VALUE_EXIST, - new org.apache.thrift.meta_data.FieldMetaData( - "check_value_exist", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.BOOL))); - tmpMap.put( - _Fields.CHECK_VALUE, - new org.apache.thrift.meta_data.FieldMetaData( - "check_value", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData( - org.apache.thrift.protocol.TType.STRUCT, blob.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap( - mutate_result.class, metaDataMap); - } - - public mutate_result() {} - - public mutate_result( - int error, boolean check_value_returned, boolean check_value_exist, blob check_value) { - this(); - this.error = error; - setErrorIsSet(true); - this.check_value_returned = check_value_returned; - setCheck_value_returnedIsSet(true); - this.check_value_exist = check_value_exist; - setCheck_value_existIsSet(true); - this.check_value = check_value; - } - - /** Performs a deep copy on other. */ - public mutate_result(mutate_result other) { - __isset_bitfield = other.__isset_bitfield; - this.error = other.error; - this.check_value_returned = other.check_value_returned; - this.check_value_exist = other.check_value_exist; - if (other.isSetCheck_value()) { - this.check_value = new blob(other.check_value); - } - } - - public mutate_result deepCopy() { - return new mutate_result(this); - } - - @Override - public void clear() { - setErrorIsSet(false); - this.error = 0; - setCheck_value_returnedIsSet(false); - this.check_value_returned = false; - setCheck_value_existIsSet(false); - this.check_value_exist = false; - this.check_value = null; - } - - public int getError() { - return this.error; - } - - public mutate_result setError(int error) { - this.error = error; - setErrorIsSet(true); - return this; - } - - public void unsetError() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ERROR_ISSET_ID); - } - - /** Returns true if field error is set (has been assigned a value) and false otherwise */ - public boolean isSetError() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ERROR_ISSET_ID); - } - - public void setErrorIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ERROR_ISSET_ID, value); - } - - public boolean isCheck_value_returned() { - return this.check_value_returned; - } - - public mutate_result setCheck_value_returned(boolean check_value_returned) { - this.check_value_returned = check_value_returned; - setCheck_value_returnedIsSet(true); - return this; - } - - public void unsetCheck_value_returned() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __CHECK_VALUE_RETURNED_ISSET_ID); - } - - /** - * Returns true if field check_value_returned is set (has been assigned a value) and false - * otherwise - */ - public boolean isSetCheck_value_returned() { - return org.apache.thrift.EncodingUtils.testBit( - __isset_bitfield, __CHECK_VALUE_RETURNED_ISSET_ID); - } - - public void setCheck_value_returnedIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit( - __isset_bitfield, __CHECK_VALUE_RETURNED_ISSET_ID, value); - } - - public boolean isCheck_value_exist() { - return this.check_value_exist; - } - - public mutate_result setCheck_value_exist(boolean check_value_exist) { - this.check_value_exist = check_value_exist; - setCheck_value_existIsSet(true); - return this; - } - - public void unsetCheck_value_exist() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __CHECK_VALUE_EXIST_ISSET_ID); - } - - /** - * Returns true if field check_value_exist is set (has been assigned a value) and false otherwise - */ - public boolean isSetCheck_value_exist() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __CHECK_VALUE_EXIST_ISSET_ID); - } - - public void setCheck_value_existIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit( - __isset_bitfield, __CHECK_VALUE_EXIST_ISSET_ID, value); - } - - public blob getCheck_value() { - return this.check_value; - } - - public mutate_result setCheck_value(blob check_value) { - this.check_value = check_value; - return this; - } - - public void unsetCheck_value() { - this.check_value = null; - } - - /** Returns true if field check_value is set (has been assigned a value) and false otherwise */ - public boolean isSetCheck_value() { - return this.check_value != null; - } - - public void setCheck_valueIsSet(boolean value) { - if (!value) { - this.check_value = null; - } - } - - public void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case ERROR: - if (value == null) { - unsetError(); - } else { - setError((java.lang.Integer) value); - } - break; - - case CHECK_VALUE_RETURNED: - if (value == null) { - unsetCheck_value_returned(); - } else { - setCheck_value_returned((java.lang.Boolean) value); - } - break; - - case CHECK_VALUE_EXIST: - if (value == null) { - unsetCheck_value_exist(); - } else { - setCheck_value_exist((java.lang.Boolean) value); - } - break; - - case CHECK_VALUE: - if (value == null) { - unsetCheck_value(); - } else { - setCheck_value((blob) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case ERROR: - return getError(); - - case CHECK_VALUE_RETURNED: - return isCheck_value_returned(); - - case CHECK_VALUE_EXIST: - return isCheck_value_exist(); - - case CHECK_VALUE: - return getCheck_value(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case ERROR: - return isSetError(); - case CHECK_VALUE_RETURNED: - return isSetCheck_value_returned(); - case CHECK_VALUE_EXIST: - return isSetCheck_value_exist(); - case CHECK_VALUE: - return isSetCheck_value(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof mutate_result) return this.equals((mutate_result) that); - return false; - } - - public boolean equals(mutate_result that) { - if (that == null) return false; - if (this == that) return true; - - boolean this_present_error = true; - boolean that_present_error = true; - if (this_present_error || that_present_error) { - if (!(this_present_error && that_present_error)) return false; - if (this.error != that.error) return false; - } - - boolean this_present_check_value_returned = true; - boolean that_present_check_value_returned = true; - if (this_present_check_value_returned || that_present_check_value_returned) { - if (!(this_present_check_value_returned && that_present_check_value_returned)) return false; - if (this.check_value_returned != that.check_value_returned) return false; - } - - boolean this_present_check_value_exist = true; - boolean that_present_check_value_exist = true; - if (this_present_check_value_exist || that_present_check_value_exist) { - if (!(this_present_check_value_exist && that_present_check_value_exist)) return false; - if (this.check_value_exist != that.check_value_exist) return false; - } - - boolean this_present_check_value = true && this.isSetCheck_value(); - boolean that_present_check_value = true && that.isSetCheck_value(); - if (this_present_check_value || that_present_check_value) { - if (!(this_present_check_value && that_present_check_value)) return false; - if (!this.check_value.equals(that.check_value)) return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + error; - - hashCode = hashCode * 8191 + ((check_value_returned) ? 131071 : 524287); - - hashCode = hashCode * 8191 + ((check_value_exist) ? 131071 : 524287); - - hashCode = hashCode * 8191 + ((isSetCheck_value()) ? 131071 : 524287); - if (isSetCheck_value()) hashCode = hashCode * 8191 + check_value.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(mutate_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetError()).compareTo(other.isSetError()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetError()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetCheck_value_returned()) - .compareTo(other.isSetCheck_value_returned()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetCheck_value_returned()) { - lastComparison = - org.apache.thrift.TBaseHelper.compareTo( - this.check_value_returned, other.check_value_returned); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetCheck_value_exist()) - .compareTo(other.isSetCheck_value_exist()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetCheck_value_exist()) { - lastComparison = - org.apache.thrift.TBaseHelper.compareTo(this.check_value_exist, other.check_value_exist); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetCheck_value()).compareTo(other.isSetCheck_value()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetCheck_value()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.check_value, other.check_value); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("mutate_result("); - boolean first = true; - - sb.append("error:"); - sb.append(this.error); - first = false; - if (!first) sb.append(", "); - sb.append("check_value_returned:"); - sb.append(this.check_value_returned); - first = false; - if (!first) sb.append(", "); - sb.append("check_value_exist:"); - sb.append(this.check_value_exist); - first = false; - if (!first) sb.append(", "); - sb.append("check_value:"); - if (this.check_value == null) { - sb.append("null"); - } else { - sb.append(this.check_value); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (check_value != null) { - check_value.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, java.lang.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 mutate_resultStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public mutate_resultStandardScheme getScheme() { - return new mutate_resultStandardScheme(); - } - } - - private static class mutate_resultStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, mutate_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: // ERROR - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.error = iprot.readI32(); - struct.setErrorIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // CHECK_VALUE_RETURNED - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.check_value_returned = iprot.readBool(); - struct.setCheck_value_returnedIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // CHECK_VALUE_EXIST - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.check_value_exist = iprot.readBool(); - struct.setCheck_value_existIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // CHECK_VALUE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.check_value = new blob(); - struct.check_value.read(iprot); - struct.setCheck_valueIsSet(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, mutate_result struct) - throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(ERROR_FIELD_DESC); - oprot.writeI32(struct.error); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(CHECK_VALUE_RETURNED_FIELD_DESC); - oprot.writeBool(struct.check_value_returned); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(CHECK_VALUE_EXIST_FIELD_DESC); - oprot.writeBool(struct.check_value_exist); - oprot.writeFieldEnd(); - if (struct.check_value != null) { - oprot.writeFieldBegin(CHECK_VALUE_FIELD_DESC); - struct.check_value.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class mutate_resultTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public mutate_resultTupleScheme getScheme() { - return new mutate_resultTupleScheme(); - } - } - - private static class mutate_resultTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, mutate_result struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetError()) { - optionals.set(0); - } - if (struct.isSetCheck_value_returned()) { - optionals.set(1); - } - if (struct.isSetCheck_value_exist()) { - optionals.set(2); - } - if (struct.isSetCheck_value()) { - optionals.set(3); - } - oprot.writeBitSet(optionals, 4); - if (struct.isSetError()) { - oprot.writeI32(struct.error); - } - if (struct.isSetCheck_value_returned()) { - oprot.writeBool(struct.check_value_returned); - } - if (struct.isSetCheck_value_exist()) { - oprot.writeBool(struct.check_value_exist); - } - if (struct.isSetCheck_value()) { - struct.check_value.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, mutate_result struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(4); - if (incoming.get(0)) { - struct.error = iprot.readI32(); - struct.setErrorIsSet(true); - } - if (incoming.get(1)) { - struct.check_value_returned = iprot.readBool(); - struct.setCheck_value_returnedIsSet(true); - } - if (incoming.get(2)) { - struct.check_value_exist = iprot.readBool(); - struct.setCheck_value_existIsSet(true); - } - if (incoming.get(3)) { - struct.check_value = new blob(); - struct.check_value.read(iprot); - struct.setCheck_valueIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } -} diff --git a/java-client/src/main/java/org/apache/pegasus/apps/negotiation_request.java b/java-client/src/main/java/org/apache/pegasus/apps/negotiation_request.java deleted file mode 100644 index 9c48ba6392..0000000000 --- a/java-client/src/main/java/org/apache/pegasus/apps/negotiation_request.java +++ /dev/null @@ -1,533 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.11.0) - * - *

DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * - * @generated - */ -package org.apache.pegasus.apps; - -import org.apache.pegasus.base.blob; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated( - value = "Autogenerated by Thrift Compiler (0.11.0)", - date = "2020-09-14") -public class negotiation_request - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("negotiation_request"); - - private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "status", org.apache.thrift.protocol.TType.I32, (short) 1); - private static final org.apache.thrift.protocol.TField MSG_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "msg", org.apache.thrift.protocol.TType.STRUCT, (short) 2); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new negotiation_requestStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new negotiation_requestTupleSchemeFactory(); - - /** @see negotiation_status */ - public negotiation_status status; // required - - public blob msg; // 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 { - /** @see negotiation_status */ - STATUS((short) 1, "status"), - MSG((short) 2, "msg"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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: // STATUS - return STATUS; - case 2: // MSG - return MSG; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put( - _Fields.STATUS, - new org.apache.thrift.meta_data.FieldMetaData( - "status", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.EnumMetaData( - org.apache.thrift.protocol.TType.ENUM, negotiation_status.class))); - tmpMap.put( - _Fields.MSG, - new org.apache.thrift.meta_data.FieldMetaData( - "msg", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData( - org.apache.thrift.protocol.TType.STRUCT, blob.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap( - negotiation_request.class, metaDataMap); - } - - public negotiation_request() {} - - public negotiation_request(negotiation_status status, blob msg) { - this(); - this.status = status; - this.msg = msg; - } - - /** Performs a deep copy on other. */ - public negotiation_request(negotiation_request other) { - if (other.isSetStatus()) { - this.status = other.status; - } - if (other.isSetMsg()) { - this.msg = new blob(other.msg); - } - } - - public negotiation_request deepCopy() { - return new negotiation_request(this); - } - - @Override - public void clear() { - this.status = null; - this.msg = null; - } - - /** @see negotiation_status */ - public negotiation_status getStatus() { - return this.status; - } - - /** @see negotiation_status */ - public negotiation_request setStatus(negotiation_status status) { - this.status = status; - return this; - } - - public void unsetStatus() { - this.status = null; - } - - /** Returns true if field status is set (has been assigned a value) and false otherwise */ - public boolean isSetStatus() { - return this.status != null; - } - - public void setStatusIsSet(boolean value) { - if (!value) { - this.status = null; - } - } - - public blob getMsg() { - return this.msg; - } - - public negotiation_request setMsg(blob msg) { - this.msg = msg; - return this; - } - - public void unsetMsg() { - this.msg = null; - } - - /** Returns true if field msg is set (has been assigned a value) and false otherwise */ - public boolean isSetMsg() { - return this.msg != null; - } - - public void setMsgIsSet(boolean value) { - if (!value) { - this.msg = null; - } - } - - public void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case STATUS: - if (value == null) { - unsetStatus(); - } else { - setStatus((negotiation_status) value); - } - break; - - case MSG: - if (value == null) { - unsetMsg(); - } else { - setMsg((blob) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case STATUS: - return getStatus(); - - case MSG: - return getMsg(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case STATUS: - return isSetStatus(); - case MSG: - return isSetMsg(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof negotiation_request) return this.equals((negotiation_request) that); - return false; - } - - public boolean equals(negotiation_request that) { - if (that == null) return false; - if (this == that) return true; - - boolean this_present_status = true && this.isSetStatus(); - boolean that_present_status = true && that.isSetStatus(); - if (this_present_status || that_present_status) { - if (!(this_present_status && that_present_status)) return false; - if (!this.status.equals(that.status)) return false; - } - - boolean this_present_msg = true && this.isSetMsg(); - boolean that_present_msg = true && that.isSetMsg(); - if (this_present_msg || that_present_msg) { - if (!(this_present_msg && that_present_msg)) return false; - if (!this.msg.equals(that.msg)) return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); - if (isSetStatus()) hashCode = hashCode * 8191 + status.getValue(); - - hashCode = hashCode * 8191 + ((isSetMsg()) ? 131071 : 524287); - if (isSetMsg()) hashCode = hashCode * 8191 + msg.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(negotiation_request other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetMsg()).compareTo(other.isSetMsg()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetMsg()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.msg, other.msg); - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("negotiation_request("); - boolean first = true; - - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - first = false; - if (!first) sb.append(", "); - sb.append("msg:"); - if (this.msg == null) { - sb.append("null"); - } else { - sb.append(this.msg); - } - 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 (msg != null) { - msg.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, java.lang.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 negotiation_requestStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public negotiation_requestStandardScheme getScheme() { - return new negotiation_requestStandardScheme(); - } - } - - private static class negotiation_requestStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, negotiation_request 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: // STATUS - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.status = negotiation_status.findByValue(iprot.readI32()); - struct.setStatusIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // MSG - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.msg = new blob(); - struct.msg.read(iprot); - struct.setMsgIsSet(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, negotiation_request struct) - throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.status != null) { - oprot.writeFieldBegin(STATUS_FIELD_DESC); - oprot.writeI32(struct.status.getValue()); - oprot.writeFieldEnd(); - } - if (struct.msg != null) { - oprot.writeFieldBegin(MSG_FIELD_DESC); - struct.msg.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class negotiation_requestTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public negotiation_requestTupleScheme getScheme() { - return new negotiation_requestTupleScheme(); - } - } - - private static class negotiation_requestTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, negotiation_request struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetStatus()) { - optionals.set(0); - } - if (struct.isSetMsg()) { - optionals.set(1); - } - oprot.writeBitSet(optionals, 2); - if (struct.isSetStatus()) { - oprot.writeI32(struct.status.getValue()); - } - if (struct.isSetMsg()) { - struct.msg.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, negotiation_request struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(2); - if (incoming.get(0)) { - struct.status = negotiation_status.findByValue(iprot.readI32()); - struct.setStatusIsSet(true); - } - if (incoming.get(1)) { - struct.msg = new blob(); - struct.msg.read(iprot); - struct.setMsgIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } -} diff --git a/java-client/src/main/java/org/apache/pegasus/apps/negotiation_response.java b/java-client/src/main/java/org/apache/pegasus/apps/negotiation_response.java deleted file mode 100644 index 17dfbc9ef7..0000000000 --- a/java-client/src/main/java/org/apache/pegasus/apps/negotiation_response.java +++ /dev/null @@ -1,533 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.11.0) - * - *

DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * - * @generated - */ -package org.apache.pegasus.apps; - -import org.apache.pegasus.base.blob; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated( - value = "Autogenerated by Thrift Compiler (0.11.0)", - date = "2020-09-14") -public class negotiation_response - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("negotiation_response"); - - private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "status", org.apache.thrift.protocol.TType.I32, (short) 1); - private static final org.apache.thrift.protocol.TField MSG_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "msg", org.apache.thrift.protocol.TType.STRUCT, (short) 2); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new negotiation_responseStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new negotiation_responseTupleSchemeFactory(); - - /** @see negotiation_status */ - public negotiation_status status; // required - - public blob msg; // 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 { - /** @see negotiation_status */ - STATUS((short) 1, "status"), - MSG((short) 2, "msg"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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: // STATUS - return STATUS; - case 2: // MSG - return MSG; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put( - _Fields.STATUS, - new org.apache.thrift.meta_data.FieldMetaData( - "status", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.EnumMetaData( - org.apache.thrift.protocol.TType.ENUM, negotiation_status.class))); - tmpMap.put( - _Fields.MSG, - new org.apache.thrift.meta_data.FieldMetaData( - "msg", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData( - org.apache.thrift.protocol.TType.STRUCT, blob.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap( - negotiation_response.class, metaDataMap); - } - - public negotiation_response() {} - - public negotiation_response(negotiation_status status, blob msg) { - this(); - this.status = status; - this.msg = msg; - } - - /** Performs a deep copy on other. */ - public negotiation_response(negotiation_response other) { - if (other.isSetStatus()) { - this.status = other.status; - } - if (other.isSetMsg()) { - this.msg = new blob(other.msg); - } - } - - public negotiation_response deepCopy() { - return new negotiation_response(this); - } - - @Override - public void clear() { - this.status = null; - this.msg = null; - } - - /** @see negotiation_status */ - public negotiation_status getStatus() { - return this.status; - } - - /** @see negotiation_status */ - public negotiation_response setStatus(negotiation_status status) { - this.status = status; - return this; - } - - public void unsetStatus() { - this.status = null; - } - - /** Returns true if field status is set (has been assigned a value) and false otherwise */ - public boolean isSetStatus() { - return this.status != null; - } - - public void setStatusIsSet(boolean value) { - if (!value) { - this.status = null; - } - } - - public blob getMsg() { - return this.msg; - } - - public negotiation_response setMsg(blob msg) { - this.msg = msg; - return this; - } - - public void unsetMsg() { - this.msg = null; - } - - /** Returns true if field msg is set (has been assigned a value) and false otherwise */ - public boolean isSetMsg() { - return this.msg != null; - } - - public void setMsgIsSet(boolean value) { - if (!value) { - this.msg = null; - } - } - - public void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case STATUS: - if (value == null) { - unsetStatus(); - } else { - setStatus((negotiation_status) value); - } - break; - - case MSG: - if (value == null) { - unsetMsg(); - } else { - setMsg((blob) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case STATUS: - return getStatus(); - - case MSG: - return getMsg(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case STATUS: - return isSetStatus(); - case MSG: - return isSetMsg(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof negotiation_response) return this.equals((negotiation_response) that); - return false; - } - - public boolean equals(negotiation_response that) { - if (that == null) return false; - if (this == that) return true; - - boolean this_present_status = true && this.isSetStatus(); - boolean that_present_status = true && that.isSetStatus(); - if (this_present_status || that_present_status) { - if (!(this_present_status && that_present_status)) return false; - if (!this.status.equals(that.status)) return false; - } - - boolean this_present_msg = true && this.isSetMsg(); - boolean that_present_msg = true && that.isSetMsg(); - if (this_present_msg || that_present_msg) { - if (!(this_present_msg && that_present_msg)) return false; - if (!this.msg.equals(that.msg)) return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); - if (isSetStatus()) hashCode = hashCode * 8191 + status.getValue(); - - hashCode = hashCode * 8191 + ((isSetMsg()) ? 131071 : 524287); - if (isSetMsg()) hashCode = hashCode * 8191 + msg.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(negotiation_response other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetMsg()).compareTo(other.isSetMsg()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetMsg()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.msg, other.msg); - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("negotiation_response("); - boolean first = true; - - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - first = false; - if (!first) sb.append(", "); - sb.append("msg:"); - if (this.msg == null) { - sb.append("null"); - } else { - sb.append(this.msg); - } - 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 (msg != null) { - msg.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, java.lang.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 negotiation_responseStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public negotiation_responseStandardScheme getScheme() { - return new negotiation_responseStandardScheme(); - } - } - - private static class negotiation_responseStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, negotiation_response 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: // STATUS - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.status = negotiation_status.findByValue(iprot.readI32()); - struct.setStatusIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // MSG - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.msg = new blob(); - struct.msg.read(iprot); - struct.setMsgIsSet(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, negotiation_response struct) - throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.status != null) { - oprot.writeFieldBegin(STATUS_FIELD_DESC); - oprot.writeI32(struct.status.getValue()); - oprot.writeFieldEnd(); - } - if (struct.msg != null) { - oprot.writeFieldBegin(MSG_FIELD_DESC); - struct.msg.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class negotiation_responseTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public negotiation_responseTupleScheme getScheme() { - return new negotiation_responseTupleScheme(); - } - } - - private static class negotiation_responseTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, negotiation_response struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetStatus()) { - optionals.set(0); - } - if (struct.isSetMsg()) { - optionals.set(1); - } - oprot.writeBitSet(optionals, 2); - if (struct.isSetStatus()) { - oprot.writeI32(struct.status.getValue()); - } - if (struct.isSetMsg()) { - struct.msg.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, negotiation_response struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(2); - if (incoming.get(0)) { - struct.status = negotiation_status.findByValue(iprot.readI32()); - struct.setStatusIsSet(true); - } - if (incoming.get(1)) { - struct.msg = new blob(); - struct.msg.read(iprot); - struct.setMsgIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } -} diff --git a/java-client/src/main/java/org/apache/pegasus/apps/negotiation_status.java b/java-client/src/main/java/org/apache/pegasus/apps/negotiation_status.java deleted file mode 100644 index 674a0d85de..0000000000 --- a/java-client/src/main/java/org/apache/pegasus/apps/negotiation_status.java +++ /dev/null @@ -1,85 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.11.0) - * - *

DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * - * @generated - */ -package org.apache.pegasus.apps; - -public enum negotiation_status implements org.apache.thrift.TEnum { - INVALID(0), - SASL_LIST_MECHANISMS(1), - SASL_LIST_MECHANISMS_RESP(2), - SASL_SELECT_MECHANISMS(3), - SASL_SELECT_MECHANISMS_RESP(4), - SASL_INITIATE(5), - SASL_CHALLENGE(6), - SASL_CHALLENGE_RESP(7), - SASL_SUCC(8), - SASL_AUTH_DISABLE(9), - SASL_AUTH_FAIL(10); - - private final int value; - - private negotiation_status(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 negotiation_status findByValue(int value) { - switch (value) { - case 0: - return INVALID; - case 1: - return SASL_LIST_MECHANISMS; - case 2: - return SASL_LIST_MECHANISMS_RESP; - case 3: - return SASL_SELECT_MECHANISMS; - case 4: - return SASL_SELECT_MECHANISMS_RESP; - case 5: - return SASL_INITIATE; - case 6: - return SASL_CHALLENGE; - case 7: - return SASL_CHALLENGE_RESP; - case 8: - return SASL_SUCC; - case 9: - return SASL_AUTH_DISABLE; - case 10: - return SASL_AUTH_FAIL; - default: - return null; - } - } -} diff --git a/java-client/src/main/java/org/apache/pegasus/apps/read_response.java b/java-client/src/main/java/org/apache/pegasus/apps/read_response.java deleted file mode 100644 index 97374f8ee5..0000000000 --- a/java-client/src/main/java/org/apache/pegasus/apps/read_response.java +++ /dev/null @@ -1,843 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.11.0) - * - *

DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * - * @generated - */ -package org.apache.pegasus.apps; - -import org.apache.pegasus.base.blob; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated( - value = "Autogenerated by Thrift Compiler (0.11.0)", - date = "2020-04-13") -public class read_response - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("read_response"); - - private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "error", org.apache.thrift.protocol.TType.I32, (short) 1); - private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "value", org.apache.thrift.protocol.TType.STRUCT, (short) 2); - private static final org.apache.thrift.protocol.TField APP_ID_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "app_id", org.apache.thrift.protocol.TType.I32, (short) 3); - private static final org.apache.thrift.protocol.TField PARTITION_INDEX_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "partition_index", org.apache.thrift.protocol.TType.I32, (short) 4); - private static final org.apache.thrift.protocol.TField SERVER_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "server", org.apache.thrift.protocol.TType.STRING, (short) 6); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new read_responseStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new read_responseTupleSchemeFactory(); - - public int error; // required - public blob value; // required - public int app_id; // required - public int partition_index; // required - public java.lang.String server; // 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 { - ERROR((short) 1, "error"), - VALUE((short) 2, "value"), - APP_ID((short) 3, "app_id"), - PARTITION_INDEX((short) 4, "partition_index"), - SERVER((short) 6, "server"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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: // ERROR - return ERROR; - case 2: // VALUE - return VALUE; - case 3: // APP_ID - return APP_ID; - case 4: // PARTITION_INDEX - return PARTITION_INDEX; - case 6: // SERVER - return SERVER; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __ERROR_ISSET_ID = 0; - private static final int __APP_ID_ISSET_ID = 1; - private static final int __PARTITION_INDEX_ISSET_ID = 2; - private byte __isset_bitfield = 0; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put( - _Fields.ERROR, - new org.apache.thrift.meta_data.FieldMetaData( - "error", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I32))); - tmpMap.put( - _Fields.VALUE, - new org.apache.thrift.meta_data.FieldMetaData( - "value", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData( - org.apache.thrift.protocol.TType.STRUCT, blob.class))); - tmpMap.put( - _Fields.APP_ID, - new org.apache.thrift.meta_data.FieldMetaData( - "app_id", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I32))); - tmpMap.put( - _Fields.PARTITION_INDEX, - new org.apache.thrift.meta_data.FieldMetaData( - "partition_index", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I32))); - tmpMap.put( - _Fields.SERVER, - new org.apache.thrift.meta_data.FieldMetaData( - "server", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.STRING))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap( - read_response.class, metaDataMap); - } - - public read_response() {} - - public read_response( - int error, blob value, int app_id, int partition_index, java.lang.String server) { - this(); - this.error = error; - setErrorIsSet(true); - this.value = value; - this.app_id = app_id; - setApp_idIsSet(true); - this.partition_index = partition_index; - setPartition_indexIsSet(true); - this.server = server; - } - - /** Performs a deep copy on other. */ - public read_response(read_response other) { - __isset_bitfield = other.__isset_bitfield; - this.error = other.error; - if (other.isSetValue()) { - this.value = new blob(other.value); - } - this.app_id = other.app_id; - this.partition_index = other.partition_index; - if (other.isSetServer()) { - this.server = other.server; - } - } - - public read_response deepCopy() { - return new read_response(this); - } - - @Override - public void clear() { - setErrorIsSet(false); - this.error = 0; - this.value = null; - setApp_idIsSet(false); - this.app_id = 0; - setPartition_indexIsSet(false); - this.partition_index = 0; - this.server = null; - } - - public int getError() { - return this.error; - } - - public read_response setError(int error) { - this.error = error; - setErrorIsSet(true); - return this; - } - - public void unsetError() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ERROR_ISSET_ID); - } - - /** Returns true if field error is set (has been assigned a value) and false otherwise */ - public boolean isSetError() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ERROR_ISSET_ID); - } - - public void setErrorIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ERROR_ISSET_ID, value); - } - - public blob getValue() { - return this.value; - } - - public read_response setValue(blob 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 int getApp_id() { - return this.app_id; - } - - public read_response setApp_id(int app_id) { - this.app_id = app_id; - setApp_idIsSet(true); - return this; - } - - public void unsetApp_id() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __APP_ID_ISSET_ID); - } - - /** Returns true if field app_id is set (has been assigned a value) and false otherwise */ - public boolean isSetApp_id() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __APP_ID_ISSET_ID); - } - - public void setApp_idIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __APP_ID_ISSET_ID, value); - } - - public int getPartition_index() { - return this.partition_index; - } - - public read_response setPartition_index(int partition_index) { - this.partition_index = partition_index; - setPartition_indexIsSet(true); - return this; - } - - public void unsetPartition_index() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __PARTITION_INDEX_ISSET_ID); - } - - /** - * Returns true if field partition_index is set (has been assigned a value) and false otherwise - */ - public boolean isSetPartition_index() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __PARTITION_INDEX_ISSET_ID); - } - - public void setPartition_indexIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __PARTITION_INDEX_ISSET_ID, value); - } - - public java.lang.String getServer() { - return this.server; - } - - public read_response setServer(java.lang.String server) { - this.server = server; - return this; - } - - public void unsetServer() { - this.server = null; - } - - /** Returns true if field server is set (has been assigned a value) and false otherwise */ - public boolean isSetServer() { - return this.server != null; - } - - public void setServerIsSet(boolean value) { - if (!value) { - this.server = null; - } - } - - public void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case ERROR: - if (value == null) { - unsetError(); - } else { - setError((java.lang.Integer) value); - } - break; - - case VALUE: - if (value == null) { - unsetValue(); - } else { - setValue((blob) value); - } - break; - - case APP_ID: - if (value == null) { - unsetApp_id(); - } else { - setApp_id((java.lang.Integer) value); - } - break; - - case PARTITION_INDEX: - if (value == null) { - unsetPartition_index(); - } else { - setPartition_index((java.lang.Integer) value); - } - break; - - case SERVER: - if (value == null) { - unsetServer(); - } else { - setServer((java.lang.String) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case ERROR: - return getError(); - - case VALUE: - return getValue(); - - case APP_ID: - return getApp_id(); - - case PARTITION_INDEX: - return getPartition_index(); - - case SERVER: - return getServer(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case ERROR: - return isSetError(); - case VALUE: - return isSetValue(); - case APP_ID: - return isSetApp_id(); - case PARTITION_INDEX: - return isSetPartition_index(); - case SERVER: - return isSetServer(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof read_response) return this.equals((read_response) that); - return false; - } - - public boolean equals(read_response that) { - if (that == null) return false; - if (this == that) return true; - - boolean this_present_error = true; - boolean that_present_error = true; - if (this_present_error || that_present_error) { - if (!(this_present_error && that_present_error)) return false; - if (this.error != that.error) 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_app_id = true; - boolean that_present_app_id = true; - if (this_present_app_id || that_present_app_id) { - if (!(this_present_app_id && that_present_app_id)) return false; - if (this.app_id != that.app_id) return false; - } - - boolean this_present_partition_index = true; - boolean that_present_partition_index = true; - if (this_present_partition_index || that_present_partition_index) { - if (!(this_present_partition_index && that_present_partition_index)) return false; - if (this.partition_index != that.partition_index) return false; - } - - boolean this_present_server = true && this.isSetServer(); - boolean that_present_server = true && that.isSetServer(); - if (this_present_server || that_present_server) { - if (!(this_present_server && that_present_server)) return false; - if (!this.server.equals(that.server)) return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + error; - - hashCode = hashCode * 8191 + ((isSetValue()) ? 131071 : 524287); - if (isSetValue()) hashCode = hashCode * 8191 + value.hashCode(); - - hashCode = hashCode * 8191 + app_id; - - hashCode = hashCode * 8191 + partition_index; - - hashCode = hashCode * 8191 + ((isSetServer()) ? 131071 : 524287); - if (isSetServer()) hashCode = hashCode * 8191 + server.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(read_response other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetError()).compareTo(other.isSetError()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetError()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetValue()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, other.value); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetApp_id()).compareTo(other.isSetApp_id()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetApp_id()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.app_id, other.app_id); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetPartition_index()).compareTo(other.isSetPartition_index()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetPartition_index()) { - lastComparison = - org.apache.thrift.TBaseHelper.compareTo(this.partition_index, other.partition_index); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetServer()).compareTo(other.isSetServer()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetServer()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.server, other.server); - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("read_response("); - boolean first = true; - - sb.append("error:"); - sb.append(this.error); - first = false; - if (!first) sb.append(", "); - sb.append("value:"); - if (this.value == null) { - sb.append("null"); - } else { - sb.append(this.value); - } - first = false; - if (!first) sb.append(", "); - sb.append("app_id:"); - sb.append(this.app_id); - first = false; - if (!first) sb.append(", "); - sb.append("partition_index:"); - sb.append(this.partition_index); - first = false; - if (!first) sb.append(", "); - sb.append("server:"); - if (this.server == null) { - sb.append("null"); - } else { - sb.append(this.server); - } - 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 (value != null) { - value.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, java.lang.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 read_responseStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public read_responseStandardScheme getScheme() { - return new read_responseStandardScheme(); - } - } - - private static class read_responseStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, read_response 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: // ERROR - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.error = iprot.readI32(); - struct.setErrorIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // VALUE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.value = new blob(); - struct.value.read(iprot); - struct.setValueIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // APP_ID - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.app_id = iprot.readI32(); - struct.setApp_idIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // PARTITION_INDEX - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.partition_index = iprot.readI32(); - struct.setPartition_indexIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 6: // SERVER - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.server = iprot.readString(); - struct.setServerIsSet(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, read_response struct) - throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(ERROR_FIELD_DESC); - oprot.writeI32(struct.error); - oprot.writeFieldEnd(); - if (struct.value != null) { - oprot.writeFieldBegin(VALUE_FIELD_DESC); - struct.value.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(APP_ID_FIELD_DESC); - oprot.writeI32(struct.app_id); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(PARTITION_INDEX_FIELD_DESC); - oprot.writeI32(struct.partition_index); - oprot.writeFieldEnd(); - if (struct.server != null) { - oprot.writeFieldBegin(SERVER_FIELD_DESC); - oprot.writeString(struct.server); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class read_responseTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public read_responseTupleScheme getScheme() { - return new read_responseTupleScheme(); - } - } - - private static class read_responseTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, read_response struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetError()) { - optionals.set(0); - } - if (struct.isSetValue()) { - optionals.set(1); - } - if (struct.isSetApp_id()) { - optionals.set(2); - } - if (struct.isSetPartition_index()) { - optionals.set(3); - } - if (struct.isSetServer()) { - optionals.set(4); - } - oprot.writeBitSet(optionals, 5); - if (struct.isSetError()) { - oprot.writeI32(struct.error); - } - if (struct.isSetValue()) { - struct.value.write(oprot); - } - if (struct.isSetApp_id()) { - oprot.writeI32(struct.app_id); - } - if (struct.isSetPartition_index()) { - oprot.writeI32(struct.partition_index); - } - if (struct.isSetServer()) { - oprot.writeString(struct.server); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, read_response struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(5); - if (incoming.get(0)) { - struct.error = iprot.readI32(); - struct.setErrorIsSet(true); - } - if (incoming.get(1)) { - struct.value = new blob(); - struct.value.read(iprot); - struct.setValueIsSet(true); - } - if (incoming.get(2)) { - struct.app_id = iprot.readI32(); - struct.setApp_idIsSet(true); - } - if (incoming.get(3)) { - struct.partition_index = iprot.readI32(); - struct.setPartition_indexIsSet(true); - } - if (incoming.get(4)) { - struct.server = iprot.readString(); - struct.setServerIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } -} diff --git a/java-client/src/main/java/org/apache/pegasus/apps/rrdb.java b/java-client/src/main/java/org/apache/pegasus/apps/rrdb.java deleted file mode 100644 index 54d1d92e49..0000000000 --- a/java-client/src/main/java/org/apache/pegasus/apps/rrdb.java +++ /dev/null @@ -1,14202 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.11.0) - * - *

DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * - * @generated - */ -package org.apache.pegasus.apps; - -import org.apache.pegasus.base.blob; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated( - value = "Autogenerated by Thrift Compiler (0.11.0)", - date = "2022-03-10") -public class rrdb { - - public interface Iface { - - public update_response put(update_request update) throws org.apache.thrift.TException; - - public update_response multi_put(multi_put_request request) throws org.apache.thrift.TException; - - public update_response remove(blob key) throws org.apache.thrift.TException; - - public multi_remove_response multi_remove(multi_remove_request request) - throws org.apache.thrift.TException; - - public incr_response incr(incr_request request) throws org.apache.thrift.TException; - - public check_and_set_response check_and_set(check_and_set_request request) - throws org.apache.thrift.TException; - - public check_and_mutate_response check_and_mutate(check_and_mutate_request request) - throws org.apache.thrift.TException; - - public read_response get(blob key) throws org.apache.thrift.TException; - - public multi_get_response multi_get(multi_get_request request) - throws org.apache.thrift.TException; - - public batch_get_response batch_get(batch_get_request request) - throws org.apache.thrift.TException; - - public count_response sortkey_count(blob hash_key) throws org.apache.thrift.TException; - - public ttl_response ttl(blob key) throws org.apache.thrift.TException; - - public scan_response get_scanner(get_scanner_request request) - throws org.apache.thrift.TException; - - public scan_response scan(scan_request request) throws org.apache.thrift.TException; - - public void clear_scanner(long context_id) throws org.apache.thrift.TException; - } - - public interface AsyncIface { - - public void put( - update_request update, - org.apache.thrift.async.AsyncMethodCallback resultHandler) - throws org.apache.thrift.TException; - - public void multi_put( - multi_put_request request, - org.apache.thrift.async.AsyncMethodCallback resultHandler) - throws org.apache.thrift.TException; - - public void remove( - blob key, org.apache.thrift.async.AsyncMethodCallback resultHandler) - throws org.apache.thrift.TException; - - public void multi_remove( - multi_remove_request request, - org.apache.thrift.async.AsyncMethodCallback resultHandler) - throws org.apache.thrift.TException; - - public void incr( - incr_request request, - org.apache.thrift.async.AsyncMethodCallback resultHandler) - throws org.apache.thrift.TException; - - public void check_and_set( - check_and_set_request request, - org.apache.thrift.async.AsyncMethodCallback resultHandler) - throws org.apache.thrift.TException; - - public void check_and_mutate( - check_and_mutate_request request, - org.apache.thrift.async.AsyncMethodCallback resultHandler) - throws org.apache.thrift.TException; - - public void get( - blob key, org.apache.thrift.async.AsyncMethodCallback resultHandler) - throws org.apache.thrift.TException; - - public void multi_get( - multi_get_request request, - org.apache.thrift.async.AsyncMethodCallback resultHandler) - throws org.apache.thrift.TException; - - public void batch_get( - batch_get_request request, - org.apache.thrift.async.AsyncMethodCallback resultHandler) - throws org.apache.thrift.TException; - - public void sortkey_count( - blob hash_key, org.apache.thrift.async.AsyncMethodCallback resultHandler) - throws org.apache.thrift.TException; - - public void ttl( - blob key, org.apache.thrift.async.AsyncMethodCallback resultHandler) - throws org.apache.thrift.TException; - - public void get_scanner( - get_scanner_request request, - org.apache.thrift.async.AsyncMethodCallback resultHandler) - throws org.apache.thrift.TException; - - public void scan( - scan_request request, - org.apache.thrift.async.AsyncMethodCallback resultHandler) - throws org.apache.thrift.TException; - - public void clear_scanner( - long context_id, 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 update_response put(update_request update) throws org.apache.thrift.TException { - send_put(update); - return recv_put(); - } - - public void send_put(update_request update) throws org.apache.thrift.TException { - put_args args = new put_args(); - args.setUpdate(update); - sendBase("put", args); - } - - public update_response recv_put() throws org.apache.thrift.TException { - put_result result = new put_result(); - receiveBase(result, "put"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException( - org.apache.thrift.TApplicationException.MISSING_RESULT, "put failed: unknown result"); - } - - public update_response multi_put(multi_put_request request) - throws org.apache.thrift.TException { - send_multi_put(request); - return recv_multi_put(); - } - - public void send_multi_put(multi_put_request request) throws org.apache.thrift.TException { - multi_put_args args = new multi_put_args(); - args.setRequest(request); - sendBase("multi_put", args); - } - - public update_response recv_multi_put() throws org.apache.thrift.TException { - multi_put_result result = new multi_put_result(); - receiveBase(result, "multi_put"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException( - org.apache.thrift.TApplicationException.MISSING_RESULT, - "multi_put failed: unknown result"); - } - - public update_response remove(blob key) throws org.apache.thrift.TException { - send_remove(key); - return recv_remove(); - } - - public void send_remove(blob key) throws org.apache.thrift.TException { - remove_args args = new remove_args(); - args.setKey(key); - sendBase("remove", args); - } - - public update_response recv_remove() throws org.apache.thrift.TException { - remove_result result = new remove_result(); - receiveBase(result, "remove"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException( - org.apache.thrift.TApplicationException.MISSING_RESULT, "remove failed: unknown result"); - } - - public multi_remove_response multi_remove(multi_remove_request request) - throws org.apache.thrift.TException { - send_multi_remove(request); - return recv_multi_remove(); - } - - public void send_multi_remove(multi_remove_request request) - throws org.apache.thrift.TException { - multi_remove_args args = new multi_remove_args(); - args.setRequest(request); - sendBase("multi_remove", args); - } - - public multi_remove_response recv_multi_remove() throws org.apache.thrift.TException { - multi_remove_result result = new multi_remove_result(); - receiveBase(result, "multi_remove"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException( - org.apache.thrift.TApplicationException.MISSING_RESULT, - "multi_remove failed: unknown result"); - } - - public incr_response incr(incr_request request) throws org.apache.thrift.TException { - send_incr(request); - return recv_incr(); - } - - public void send_incr(incr_request request) throws org.apache.thrift.TException { - incr_args args = new incr_args(); - args.setRequest(request); - sendBase("incr", args); - } - - public incr_response recv_incr() throws org.apache.thrift.TException { - incr_result result = new incr_result(); - receiveBase(result, "incr"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException( - org.apache.thrift.TApplicationException.MISSING_RESULT, "incr failed: unknown result"); - } - - public check_and_set_response check_and_set(check_and_set_request request) - throws org.apache.thrift.TException { - send_check_and_set(request); - return recv_check_and_set(); - } - - public void send_check_and_set(check_and_set_request request) - throws org.apache.thrift.TException { - check_and_set_args args = new check_and_set_args(); - args.setRequest(request); - sendBase("check_and_set", args); - } - - public check_and_set_response recv_check_and_set() throws org.apache.thrift.TException { - check_and_set_result result = new check_and_set_result(); - receiveBase(result, "check_and_set"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException( - org.apache.thrift.TApplicationException.MISSING_RESULT, - "check_and_set failed: unknown result"); - } - - public check_and_mutate_response check_and_mutate(check_and_mutate_request request) - throws org.apache.thrift.TException { - send_check_and_mutate(request); - return recv_check_and_mutate(); - } - - public void send_check_and_mutate(check_and_mutate_request request) - throws org.apache.thrift.TException { - check_and_mutate_args args = new check_and_mutate_args(); - args.setRequest(request); - sendBase("check_and_mutate", args); - } - - public check_and_mutate_response recv_check_and_mutate() throws org.apache.thrift.TException { - check_and_mutate_result result = new check_and_mutate_result(); - receiveBase(result, "check_and_mutate"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException( - org.apache.thrift.TApplicationException.MISSING_RESULT, - "check_and_mutate failed: unknown result"); - } - - public read_response get(blob key) throws org.apache.thrift.TException { - send_get(key); - return recv_get(); - } - - public void send_get(blob key) throws org.apache.thrift.TException { - get_args args = new get_args(); - args.setKey(key); - sendBase("get", args); - } - - public read_response recv_get() throws org.apache.thrift.TException { - get_result result = new get_result(); - receiveBase(result, "get"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException( - org.apache.thrift.TApplicationException.MISSING_RESULT, "get failed: unknown result"); - } - - public multi_get_response multi_get(multi_get_request request) - throws org.apache.thrift.TException { - send_multi_get(request); - return recv_multi_get(); - } - - public void send_multi_get(multi_get_request request) throws org.apache.thrift.TException { - multi_get_args args = new multi_get_args(); - args.setRequest(request); - sendBase("multi_get", args); - } - - public multi_get_response recv_multi_get() throws org.apache.thrift.TException { - multi_get_result result = new multi_get_result(); - receiveBase(result, "multi_get"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException( - org.apache.thrift.TApplicationException.MISSING_RESULT, - "multi_get failed: unknown result"); - } - - public batch_get_response batch_get(batch_get_request request) - throws org.apache.thrift.TException { - send_batch_get(request); - return recv_batch_get(); - } - - public void send_batch_get(batch_get_request request) throws org.apache.thrift.TException { - batch_get_args args = new batch_get_args(); - args.setRequest(request); - sendBase("batch_get", args); - } - - public batch_get_response recv_batch_get() throws org.apache.thrift.TException { - batch_get_result result = new batch_get_result(); - receiveBase(result, "batch_get"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException( - org.apache.thrift.TApplicationException.MISSING_RESULT, - "batch_get failed: unknown result"); - } - - public count_response sortkey_count(blob hash_key) throws org.apache.thrift.TException { - send_sortkey_count(hash_key); - return recv_sortkey_count(); - } - - public void send_sortkey_count(blob hash_key) throws org.apache.thrift.TException { - sortkey_count_args args = new sortkey_count_args(); - args.setHash_key(hash_key); - sendBase("sortkey_count", args); - } - - public count_response recv_sortkey_count() throws org.apache.thrift.TException { - sortkey_count_result result = new sortkey_count_result(); - receiveBase(result, "sortkey_count"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException( - org.apache.thrift.TApplicationException.MISSING_RESULT, - "sortkey_count failed: unknown result"); - } - - public ttl_response ttl(blob key) throws org.apache.thrift.TException { - send_ttl(key); - return recv_ttl(); - } - - public void send_ttl(blob key) throws org.apache.thrift.TException { - ttl_args args = new ttl_args(); - args.setKey(key); - sendBase("ttl", args); - } - - public ttl_response recv_ttl() throws org.apache.thrift.TException { - ttl_result result = new ttl_result(); - receiveBase(result, "ttl"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException( - org.apache.thrift.TApplicationException.MISSING_RESULT, "ttl failed: unknown result"); - } - - public scan_response get_scanner(get_scanner_request request) - throws org.apache.thrift.TException { - send_get_scanner(request); - return recv_get_scanner(); - } - - public void send_get_scanner(get_scanner_request request) throws org.apache.thrift.TException { - get_scanner_args args = new get_scanner_args(); - args.setRequest(request); - sendBase("get_scanner", args); - } - - public scan_response recv_get_scanner() throws org.apache.thrift.TException { - get_scanner_result result = new get_scanner_result(); - receiveBase(result, "get_scanner"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException( - org.apache.thrift.TApplicationException.MISSING_RESULT, - "get_scanner failed: unknown result"); - } - - public scan_response scan(scan_request request) throws org.apache.thrift.TException { - send_scan(request); - return recv_scan(); - } - - public void send_scan(scan_request request) throws org.apache.thrift.TException { - scan_args args = new scan_args(); - args.setRequest(request); - sendBase("scan", args); - } - - public scan_response recv_scan() throws org.apache.thrift.TException { - scan_result result = new scan_result(); - receiveBase(result, "scan"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException( - org.apache.thrift.TApplicationException.MISSING_RESULT, "scan failed: unknown result"); - } - - public void clear_scanner(long context_id) throws org.apache.thrift.TException { - send_clear_scanner(context_id); - } - - public void send_clear_scanner(long context_id) throws org.apache.thrift.TException { - clear_scanner_args args = new clear_scanner_args(); - args.setContext_id(context_id); - sendBaseOneway("clear_scanner", args); - } - } - - 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 put( - update_request update, - org.apache.thrift.async.AsyncMethodCallback resultHandler) - throws org.apache.thrift.TException { - checkReady(); - put_call method_call = - new put_call(update, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class put_call extends org.apache.thrift.async.TAsyncMethodCall { - private update_request update; - - public put_call( - update_request update, - 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.update = update; - } - - 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.setUpdate(update); - args.write(prot); - prot.writeMessageEnd(); - } - - public update_response getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.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_put(); - } - } - - public void multi_put( - multi_put_request request, - org.apache.thrift.async.AsyncMethodCallback resultHandler) - throws org.apache.thrift.TException { - checkReady(); - multi_put_call method_call = - new multi_put_call(request, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class multi_put_call - extends org.apache.thrift.async.TAsyncMethodCall { - private multi_put_request request; - - public multi_put_call( - multi_put_request request, - 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.request = request; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) - throws org.apache.thrift.TException { - prot.writeMessageBegin( - new org.apache.thrift.protocol.TMessage( - "multi_put", org.apache.thrift.protocol.TMessageType.CALL, 0)); - multi_put_args args = new multi_put_args(); - args.setRequest(request); - args.write(prot); - prot.writeMessageEnd(); - } - - public update_response getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.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_multi_put(); - } - } - - public void remove( - blob key, org.apache.thrift.async.AsyncMethodCallback resultHandler) - throws org.apache.thrift.TException { - checkReady(); - remove_call method_call = - new remove_call(key, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class remove_call - extends org.apache.thrift.async.TAsyncMethodCall { - private blob key; - - public remove_call( - blob key, - 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.key = key; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) - throws org.apache.thrift.TException { - prot.writeMessageBegin( - new org.apache.thrift.protocol.TMessage( - "remove", org.apache.thrift.protocol.TMessageType.CALL, 0)); - remove_args args = new remove_args(); - args.setKey(key); - args.write(prot); - prot.writeMessageEnd(); - } - - public update_response getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.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_remove(); - } - } - - public void multi_remove( - multi_remove_request request, - org.apache.thrift.async.AsyncMethodCallback resultHandler) - throws org.apache.thrift.TException { - checkReady(); - multi_remove_call method_call = - new multi_remove_call(request, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class multi_remove_call - extends org.apache.thrift.async.TAsyncMethodCall { - private multi_remove_request request; - - public multi_remove_call( - multi_remove_request request, - 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.request = request; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) - throws org.apache.thrift.TException { - prot.writeMessageBegin( - new org.apache.thrift.protocol.TMessage( - "multi_remove", org.apache.thrift.protocol.TMessageType.CALL, 0)); - multi_remove_args args = new multi_remove_args(); - args.setRequest(request); - args.write(prot); - prot.writeMessageEnd(); - } - - public multi_remove_response getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.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_multi_remove(); - } - } - - public void incr( - incr_request request, - org.apache.thrift.async.AsyncMethodCallback resultHandler) - throws org.apache.thrift.TException { - checkReady(); - incr_call method_call = - new incr_call(request, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class incr_call extends org.apache.thrift.async.TAsyncMethodCall { - private incr_request request; - - public incr_call( - incr_request request, - 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.request = request; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) - throws org.apache.thrift.TException { - prot.writeMessageBegin( - new org.apache.thrift.protocol.TMessage( - "incr", org.apache.thrift.protocol.TMessageType.CALL, 0)); - incr_args args = new incr_args(); - args.setRequest(request); - args.write(prot); - prot.writeMessageEnd(); - } - - public incr_response getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.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_incr(); - } - } - - public void check_and_set( - check_and_set_request request, - org.apache.thrift.async.AsyncMethodCallback resultHandler) - throws org.apache.thrift.TException { - checkReady(); - check_and_set_call method_call = - new check_and_set_call(request, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class check_and_set_call - extends org.apache.thrift.async.TAsyncMethodCall { - private check_and_set_request request; - - public check_and_set_call( - check_and_set_request request, - 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.request = request; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) - throws org.apache.thrift.TException { - prot.writeMessageBegin( - new org.apache.thrift.protocol.TMessage( - "check_and_set", org.apache.thrift.protocol.TMessageType.CALL, 0)); - check_and_set_args args = new check_and_set_args(); - args.setRequest(request); - args.write(prot); - prot.writeMessageEnd(); - } - - public check_and_set_response getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.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_check_and_set(); - } - } - - public void check_and_mutate( - check_and_mutate_request request, - org.apache.thrift.async.AsyncMethodCallback resultHandler) - throws org.apache.thrift.TException { - checkReady(); - check_and_mutate_call method_call = - new check_and_mutate_call(request, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class check_and_mutate_call - extends org.apache.thrift.async.TAsyncMethodCall { - private check_and_mutate_request request; - - public check_and_mutate_call( - check_and_mutate_request request, - 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.request = request; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) - throws org.apache.thrift.TException { - prot.writeMessageBegin( - new org.apache.thrift.protocol.TMessage( - "check_and_mutate", org.apache.thrift.protocol.TMessageType.CALL, 0)); - check_and_mutate_args args = new check_and_mutate_args(); - args.setRequest(request); - args.write(prot); - prot.writeMessageEnd(); - } - - public check_and_mutate_response getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.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_check_and_mutate(); - } - } - - public void get( - blob key, org.apache.thrift.async.AsyncMethodCallback resultHandler) - throws org.apache.thrift.TException { - checkReady(); - get_call method_call = - new get_call(key, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class get_call extends org.apache.thrift.async.TAsyncMethodCall { - private blob key; - - public get_call( - blob key, - 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.key = key; - } - - 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.setKey(key); - args.write(prot); - prot.writeMessageEnd(); - } - - public read_response getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.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 multi_get( - multi_get_request request, - org.apache.thrift.async.AsyncMethodCallback resultHandler) - throws org.apache.thrift.TException { - checkReady(); - multi_get_call method_call = - new multi_get_call(request, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class multi_get_call - extends org.apache.thrift.async.TAsyncMethodCall { - private multi_get_request request; - - public multi_get_call( - multi_get_request request, - 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.request = request; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) - throws org.apache.thrift.TException { - prot.writeMessageBegin( - new org.apache.thrift.protocol.TMessage( - "multi_get", org.apache.thrift.protocol.TMessageType.CALL, 0)); - multi_get_args args = new multi_get_args(); - args.setRequest(request); - args.write(prot); - prot.writeMessageEnd(); - } - - public multi_get_response getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.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_multi_get(); - } - } - - public void batch_get( - batch_get_request request, - org.apache.thrift.async.AsyncMethodCallback resultHandler) - throws org.apache.thrift.TException { - checkReady(); - batch_get_call method_call = - new batch_get_call(request, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class batch_get_call - extends org.apache.thrift.async.TAsyncMethodCall { - private batch_get_request request; - - public batch_get_call( - batch_get_request request, - 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.request = request; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) - throws org.apache.thrift.TException { - prot.writeMessageBegin( - new org.apache.thrift.protocol.TMessage( - "batch_get", org.apache.thrift.protocol.TMessageType.CALL, 0)); - batch_get_args args = new batch_get_args(); - args.setRequest(request); - args.write(prot); - prot.writeMessageEnd(); - } - - public batch_get_response getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.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_batch_get(); - } - } - - public void sortkey_count( - blob hash_key, org.apache.thrift.async.AsyncMethodCallback resultHandler) - throws org.apache.thrift.TException { - checkReady(); - sortkey_count_call method_call = - new sortkey_count_call(hash_key, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class sortkey_count_call - extends org.apache.thrift.async.TAsyncMethodCall { - private blob hash_key; - - public sortkey_count_call( - blob hash_key, - 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.hash_key = hash_key; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) - throws org.apache.thrift.TException { - prot.writeMessageBegin( - new org.apache.thrift.protocol.TMessage( - "sortkey_count", org.apache.thrift.protocol.TMessageType.CALL, 0)); - sortkey_count_args args = new sortkey_count_args(); - args.setHash_key(hash_key); - args.write(prot); - prot.writeMessageEnd(); - } - - public count_response getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.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_sortkey_count(); - } - } - - public void ttl( - blob key, org.apache.thrift.async.AsyncMethodCallback resultHandler) - throws org.apache.thrift.TException { - checkReady(); - ttl_call method_call = - new ttl_call(key, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class ttl_call extends org.apache.thrift.async.TAsyncMethodCall { - private blob key; - - public ttl_call( - blob key, - 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.key = key; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) - throws org.apache.thrift.TException { - prot.writeMessageBegin( - new org.apache.thrift.protocol.TMessage( - "ttl", org.apache.thrift.protocol.TMessageType.CALL, 0)); - ttl_args args = new ttl_args(); - args.setKey(key); - args.write(prot); - prot.writeMessageEnd(); - } - - public ttl_response getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.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_ttl(); - } - } - - public void get_scanner( - get_scanner_request request, - org.apache.thrift.async.AsyncMethodCallback resultHandler) - throws org.apache.thrift.TException { - checkReady(); - get_scanner_call method_call = - new get_scanner_call(request, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class get_scanner_call - extends org.apache.thrift.async.TAsyncMethodCall { - private get_scanner_request request; - - public get_scanner_call( - get_scanner_request request, - 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.request = request; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) - throws org.apache.thrift.TException { - prot.writeMessageBegin( - new org.apache.thrift.protocol.TMessage( - "get_scanner", org.apache.thrift.protocol.TMessageType.CALL, 0)); - get_scanner_args args = new get_scanner_args(); - args.setRequest(request); - args.write(prot); - prot.writeMessageEnd(); - } - - public scan_response getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.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_scanner(); - } - } - - public void scan( - scan_request request, - org.apache.thrift.async.AsyncMethodCallback resultHandler) - throws org.apache.thrift.TException { - checkReady(); - scan_call method_call = - new scan_call(request, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class scan_call extends org.apache.thrift.async.TAsyncMethodCall { - private scan_request request; - - public scan_call( - scan_request request, - 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.request = request; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) - throws org.apache.thrift.TException { - prot.writeMessageBegin( - new org.apache.thrift.protocol.TMessage( - "scan", org.apache.thrift.protocol.TMessageType.CALL, 0)); - scan_args args = new scan_args(); - args.setRequest(request); - args.write(prot); - prot.writeMessageEnd(); - } - - public scan_response getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.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_scan(); - } - } - - public void clear_scanner( - long context_id, org.apache.thrift.async.AsyncMethodCallback resultHandler) - throws org.apache.thrift.TException { - checkReady(); - clear_scanner_call method_call = - new clear_scanner_call(context_id, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class clear_scanner_call extends org.apache.thrift.async.TAsyncMethodCall { - private long context_id; - - public clear_scanner_call( - long context_id, - org.apache.thrift.async.AsyncMethodCallback resultHandler, - org.apache.thrift.async.TAsyncClient client, - org.apache.thrift.protocol.TProtocolFactory protocolFactory, - org.apache.thrift.transport.TNonblockingTransport transport) - throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, true); - this.context_id = context_id; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) - throws org.apache.thrift.TException { - prot.writeMessageBegin( - new org.apache.thrift.protocol.TMessage( - "clear_scanner", org.apache.thrift.protocol.TMessageType.ONEWAY, 0)); - clear_scanner_args args = new clear_scanner_args(); - args.setContext_id(context_id); - args.write(prot); - prot.writeMessageEnd(); - } - - public Void getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.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 null; - } - } - } - - public static class Processor extends org.apache.thrift.TBaseProcessor - implements org.apache.thrift.TProcessor { - private static final org.slf4j.Logger _LOGGER = - org.slf4j.LoggerFactory.getLogger(Processor.class.getName()); - - public Processor(I iface) { - super( - iface, - getProcessMap( - new java.util.HashMap< - java.lang.String, - org.apache.thrift.ProcessFunction>())); - } - - protected Processor( - I iface, - java.util.Map< - java.lang.String, - org.apache.thrift.ProcessFunction> - processMap) { - super(iface, getProcessMap(processMap)); - } - - private static - java.util.Map< - java.lang.String, - org.apache.thrift.ProcessFunction> - getProcessMap( - java.util.Map< - java.lang.String, - org.apache.thrift.ProcessFunction> - processMap) { - processMap.put("put", new put()); - processMap.put("multi_put", new multi_put()); - processMap.put("remove", new remove()); - processMap.put("multi_remove", new multi_remove()); - processMap.put("incr", new incr()); - processMap.put("check_and_set", new check_and_set()); - processMap.put("check_and_mutate", new check_and_mutate()); - processMap.put("get", new get()); - processMap.put("multi_get", new multi_get()); - processMap.put("batch_get", new batch_get()); - processMap.put("sortkey_count", new sortkey_count()); - processMap.put("ttl", new ttl()); - processMap.put("get_scanner", new get_scanner()); - processMap.put("scan", new scan()); - processMap.put("clear_scanner", new clear_scanner()); - return processMap; - } - - 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; - } - - @Override - protected boolean handleRuntimeExceptions() { - return false; - } - - public put_result getResult(I iface, put_args args) throws org.apache.thrift.TException { - put_result result = new put_result(); - result.success = iface.put(args.update); - return result; - } - } - - public static class multi_put - extends org.apache.thrift.ProcessFunction { - public multi_put() { - super("multi_put"); - } - - public multi_put_args getEmptyArgsInstance() { - return new multi_put_args(); - } - - protected boolean isOneway() { - return false; - } - - @Override - protected boolean handleRuntimeExceptions() { - return false; - } - - public multi_put_result getResult(I iface, multi_put_args args) - throws org.apache.thrift.TException { - multi_put_result result = new multi_put_result(); - result.success = iface.multi_put(args.request); - return result; - } - } - - public static class remove - extends org.apache.thrift.ProcessFunction { - public remove() { - super("remove"); - } - - public remove_args getEmptyArgsInstance() { - return new remove_args(); - } - - protected boolean isOneway() { - return false; - } - - @Override - protected boolean handleRuntimeExceptions() { - return false; - } - - public remove_result getResult(I iface, remove_args args) - throws org.apache.thrift.TException { - remove_result result = new remove_result(); - result.success = iface.remove(args.key); - return result; - } - } - - public static class multi_remove - extends org.apache.thrift.ProcessFunction { - public multi_remove() { - super("multi_remove"); - } - - public multi_remove_args getEmptyArgsInstance() { - return new multi_remove_args(); - } - - protected boolean isOneway() { - return false; - } - - @Override - protected boolean handleRuntimeExceptions() { - return false; - } - - public multi_remove_result getResult(I iface, multi_remove_args args) - throws org.apache.thrift.TException { - multi_remove_result result = new multi_remove_result(); - result.success = iface.multi_remove(args.request); - return result; - } - } - - public static class incr - extends org.apache.thrift.ProcessFunction { - public incr() { - super("incr"); - } - - public incr_args getEmptyArgsInstance() { - return new incr_args(); - } - - protected boolean isOneway() { - return false; - } - - @Override - protected boolean handleRuntimeExceptions() { - return false; - } - - public incr_result getResult(I iface, incr_args args) throws org.apache.thrift.TException { - incr_result result = new incr_result(); - result.success = iface.incr(args.request); - return result; - } - } - - public static class check_and_set - extends org.apache.thrift.ProcessFunction { - public check_and_set() { - super("check_and_set"); - } - - public check_and_set_args getEmptyArgsInstance() { - return new check_and_set_args(); - } - - protected boolean isOneway() { - return false; - } - - @Override - protected boolean handleRuntimeExceptions() { - return false; - } - - public check_and_set_result getResult(I iface, check_and_set_args args) - throws org.apache.thrift.TException { - check_and_set_result result = new check_and_set_result(); - result.success = iface.check_and_set(args.request); - return result; - } - } - - public static class check_and_mutate - extends org.apache.thrift.ProcessFunction { - public check_and_mutate() { - super("check_and_mutate"); - } - - public check_and_mutate_args getEmptyArgsInstance() { - return new check_and_mutate_args(); - } - - protected boolean isOneway() { - return false; - } - - @Override - protected boolean handleRuntimeExceptions() { - return false; - } - - public check_and_mutate_result getResult(I iface, check_and_mutate_args args) - throws org.apache.thrift.TException { - check_and_mutate_result result = new check_and_mutate_result(); - result.success = iface.check_and_mutate(args.request); - 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; - } - - @Override - protected boolean handleRuntimeExceptions() { - return false; - } - - public get_result getResult(I iface, get_args args) throws org.apache.thrift.TException { - get_result result = new get_result(); - result.success = iface.get(args.key); - return result; - } - } - - public static class multi_get - extends org.apache.thrift.ProcessFunction { - public multi_get() { - super("multi_get"); - } - - public multi_get_args getEmptyArgsInstance() { - return new multi_get_args(); - } - - protected boolean isOneway() { - return false; - } - - @Override - protected boolean handleRuntimeExceptions() { - return false; - } - - public multi_get_result getResult(I iface, multi_get_args args) - throws org.apache.thrift.TException { - multi_get_result result = new multi_get_result(); - result.success = iface.multi_get(args.request); - return result; - } - } - - public static class batch_get - extends org.apache.thrift.ProcessFunction { - public batch_get() { - super("batch_get"); - } - - public batch_get_args getEmptyArgsInstance() { - return new batch_get_args(); - } - - protected boolean isOneway() { - return false; - } - - @Override - protected boolean handleRuntimeExceptions() { - return false; - } - - public batch_get_result getResult(I iface, batch_get_args args) - throws org.apache.thrift.TException { - batch_get_result result = new batch_get_result(); - result.success = iface.batch_get(args.request); - return result; - } - } - - public static class sortkey_count - extends org.apache.thrift.ProcessFunction { - public sortkey_count() { - super("sortkey_count"); - } - - public sortkey_count_args getEmptyArgsInstance() { - return new sortkey_count_args(); - } - - protected boolean isOneway() { - return false; - } - - @Override - protected boolean handleRuntimeExceptions() { - return false; - } - - public sortkey_count_result getResult(I iface, sortkey_count_args args) - throws org.apache.thrift.TException { - sortkey_count_result result = new sortkey_count_result(); - result.success = iface.sortkey_count(args.hash_key); - return result; - } - } - - public static class ttl - extends org.apache.thrift.ProcessFunction { - public ttl() { - super("ttl"); - } - - public ttl_args getEmptyArgsInstance() { - return new ttl_args(); - } - - protected boolean isOneway() { - return false; - } - - @Override - protected boolean handleRuntimeExceptions() { - return false; - } - - public ttl_result getResult(I iface, ttl_args args) throws org.apache.thrift.TException { - ttl_result result = new ttl_result(); - result.success = iface.ttl(args.key); - return result; - } - } - - public static class get_scanner - extends org.apache.thrift.ProcessFunction { - public get_scanner() { - super("get_scanner"); - } - - public get_scanner_args getEmptyArgsInstance() { - return new get_scanner_args(); - } - - protected boolean isOneway() { - return false; - } - - @Override - protected boolean handleRuntimeExceptions() { - return false; - } - - public get_scanner_result getResult(I iface, get_scanner_args args) - throws org.apache.thrift.TException { - get_scanner_result result = new get_scanner_result(); - result.success = iface.get_scanner(args.request); - return result; - } - } - - public static class scan - extends org.apache.thrift.ProcessFunction { - public scan() { - super("scan"); - } - - public scan_args getEmptyArgsInstance() { - return new scan_args(); - } - - protected boolean isOneway() { - return false; - } - - @Override - protected boolean handleRuntimeExceptions() { - return false; - } - - public scan_result getResult(I iface, scan_args args) throws org.apache.thrift.TException { - scan_result result = new scan_result(); - result.success = iface.scan(args.request); - return result; - } - } - - public static class clear_scanner - extends org.apache.thrift.ProcessFunction { - public clear_scanner() { - super("clear_scanner"); - } - - public clear_scanner_args getEmptyArgsInstance() { - return new clear_scanner_args(); - } - - protected boolean isOneway() { - return true; - } - - @Override - protected boolean handleRuntimeExceptions() { - return false; - } - - public org.apache.thrift.TBase getResult(I iface, clear_scanner_args args) - throws org.apache.thrift.TException { - iface.clear_scanner(args.context_id); - return null; - } - } - } - - public static class AsyncProcessor - extends org.apache.thrift.TBaseAsyncProcessor { - private static final org.slf4j.Logger _LOGGER = - org.slf4j.LoggerFactory.getLogger(AsyncProcessor.class.getName()); - - public AsyncProcessor(I iface) { - super( - iface, - getProcessMap( - new java.util.HashMap< - java.lang.String, - org.apache.thrift.AsyncProcessFunction< - I, ? extends org.apache.thrift.TBase, ?>>())); - } - - protected AsyncProcessor( - I iface, - java.util.Map< - java.lang.String, - org.apache.thrift.AsyncProcessFunction> - processMap) { - super(iface, getProcessMap(processMap)); - } - - private static - java.util.Map< - java.lang.String, - org.apache.thrift.AsyncProcessFunction> - getProcessMap( - java.util.Map< - java.lang.String, - org.apache.thrift.AsyncProcessFunction< - I, ? extends org.apache.thrift.TBase, ?>> - processMap) { - processMap.put("put", new put()); - processMap.put("multi_put", new multi_put()); - processMap.put("remove", new remove()); - processMap.put("multi_remove", new multi_remove()); - processMap.put("incr", new incr()); - processMap.put("check_and_set", new check_and_set()); - processMap.put("check_and_mutate", new check_and_mutate()); - processMap.put("get", new get()); - processMap.put("multi_get", new multi_get()); - processMap.put("batch_get", new batch_get()); - processMap.put("sortkey_count", new sortkey_count()); - processMap.put("ttl", new ttl()); - processMap.put("get_scanner", new get_scanner()); - processMap.put("scan", new scan()); - processMap.put("clear_scanner", new clear_scanner()); - return processMap; - } - - public static class put - extends org.apache.thrift.AsyncProcessFunction { - public put() { - super("put"); - } - - public put_args getEmptyArgsInstance() { - return new put_args(); - } - - public org.apache.thrift.async.AsyncMethodCallback getResultHandler( - final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, - final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback() { - public void onComplete(update_response o) { - put_result result = new put_result(); - result.success = o; - try { - fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY, seqid); - } catch (org.apache.thrift.transport.TTransportException e) { - _LOGGER.error("TTransportException writing to internal frame buffer", e); - fb.close(); - } catch (java.lang.Exception e) { - _LOGGER.error("Exception writing to internal frame buffer", e); - onError(e); - } - } - - public void onError(java.lang.Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; - put_result result = new put_result(); - if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - return; - } else if (e instanceof org.apache.thrift.TApplicationException) { - _LOGGER.error("TApplicationException inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException) e; - } else { - _LOGGER.error("Exception inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = - new org.apache.thrift.TApplicationException( - org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb, msg, msgType, seqid); - } catch (java.lang.Exception ex) { - _LOGGER.error("Exception writing to internal frame buffer", ex); - fb.close(); - } - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start( - I iface, - put_args args, - org.apache.thrift.async.AsyncMethodCallback resultHandler) - throws org.apache.thrift.TException { - iface.put(args.update, resultHandler); - } - } - - public static class multi_put - extends org.apache.thrift.AsyncProcessFunction { - public multi_put() { - super("multi_put"); - } - - public multi_put_args getEmptyArgsInstance() { - return new multi_put_args(); - } - - public org.apache.thrift.async.AsyncMethodCallback getResultHandler( - final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, - final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback() { - public void onComplete(update_response o) { - multi_put_result result = new multi_put_result(); - result.success = o; - try { - fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY, seqid); - } catch (org.apache.thrift.transport.TTransportException e) { - _LOGGER.error("TTransportException writing to internal frame buffer", e); - fb.close(); - } catch (java.lang.Exception e) { - _LOGGER.error("Exception writing to internal frame buffer", e); - onError(e); - } - } - - public void onError(java.lang.Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; - multi_put_result result = new multi_put_result(); - if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - return; - } else if (e instanceof org.apache.thrift.TApplicationException) { - _LOGGER.error("TApplicationException inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException) e; - } else { - _LOGGER.error("Exception inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = - new org.apache.thrift.TApplicationException( - org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb, msg, msgType, seqid); - } catch (java.lang.Exception ex) { - _LOGGER.error("Exception writing to internal frame buffer", ex); - fb.close(); - } - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start( - I iface, - multi_put_args args, - org.apache.thrift.async.AsyncMethodCallback resultHandler) - throws org.apache.thrift.TException { - iface.multi_put(args.request, resultHandler); - } - } - - public static class remove - extends org.apache.thrift.AsyncProcessFunction { - public remove() { - super("remove"); - } - - public remove_args getEmptyArgsInstance() { - return new remove_args(); - } - - public org.apache.thrift.async.AsyncMethodCallback getResultHandler( - final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, - final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback() { - public void onComplete(update_response o) { - remove_result result = new remove_result(); - result.success = o; - try { - fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY, seqid); - } catch (org.apache.thrift.transport.TTransportException e) { - _LOGGER.error("TTransportException writing to internal frame buffer", e); - fb.close(); - } catch (java.lang.Exception e) { - _LOGGER.error("Exception writing to internal frame buffer", e); - onError(e); - } - } - - public void onError(java.lang.Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; - remove_result result = new remove_result(); - if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - return; - } else if (e instanceof org.apache.thrift.TApplicationException) { - _LOGGER.error("TApplicationException inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException) e; - } else { - _LOGGER.error("Exception inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = - new org.apache.thrift.TApplicationException( - org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb, msg, msgType, seqid); - } catch (java.lang.Exception ex) { - _LOGGER.error("Exception writing to internal frame buffer", ex); - fb.close(); - } - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start( - I iface, - remove_args args, - org.apache.thrift.async.AsyncMethodCallback resultHandler) - throws org.apache.thrift.TException { - iface.remove(args.key, resultHandler); - } - } - - public static class multi_remove - extends org.apache.thrift.AsyncProcessFunction< - I, multi_remove_args, multi_remove_response> { - public multi_remove() { - super("multi_remove"); - } - - public multi_remove_args getEmptyArgsInstance() { - return new multi_remove_args(); - } - - public org.apache.thrift.async.AsyncMethodCallback getResultHandler( - final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, - final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback() { - public void onComplete(multi_remove_response o) { - multi_remove_result result = new multi_remove_result(); - result.success = o; - try { - fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY, seqid); - } catch (org.apache.thrift.transport.TTransportException e) { - _LOGGER.error("TTransportException writing to internal frame buffer", e); - fb.close(); - } catch (java.lang.Exception e) { - _LOGGER.error("Exception writing to internal frame buffer", e); - onError(e); - } - } - - public void onError(java.lang.Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; - multi_remove_result result = new multi_remove_result(); - if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - return; - } else if (e instanceof org.apache.thrift.TApplicationException) { - _LOGGER.error("TApplicationException inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException) e; - } else { - _LOGGER.error("Exception inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = - new org.apache.thrift.TApplicationException( - org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb, msg, msgType, seqid); - } catch (java.lang.Exception ex) { - _LOGGER.error("Exception writing to internal frame buffer", ex); - fb.close(); - } - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start( - I iface, - multi_remove_args args, - org.apache.thrift.async.AsyncMethodCallback resultHandler) - throws org.apache.thrift.TException { - iface.multi_remove(args.request, resultHandler); - } - } - - public static class incr - extends org.apache.thrift.AsyncProcessFunction { - public incr() { - super("incr"); - } - - public incr_args getEmptyArgsInstance() { - return new incr_args(); - } - - public org.apache.thrift.async.AsyncMethodCallback getResultHandler( - final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, - final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback() { - public void onComplete(incr_response o) { - incr_result result = new incr_result(); - result.success = o; - try { - fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY, seqid); - } catch (org.apache.thrift.transport.TTransportException e) { - _LOGGER.error("TTransportException writing to internal frame buffer", e); - fb.close(); - } catch (java.lang.Exception e) { - _LOGGER.error("Exception writing to internal frame buffer", e); - onError(e); - } - } - - public void onError(java.lang.Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; - incr_result result = new incr_result(); - if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - return; - } else if (e instanceof org.apache.thrift.TApplicationException) { - _LOGGER.error("TApplicationException inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException) e; - } else { - _LOGGER.error("Exception inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = - new org.apache.thrift.TApplicationException( - org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb, msg, msgType, seqid); - } catch (java.lang.Exception ex) { - _LOGGER.error("Exception writing to internal frame buffer", ex); - fb.close(); - } - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start( - I iface, - incr_args args, - org.apache.thrift.async.AsyncMethodCallback resultHandler) - throws org.apache.thrift.TException { - iface.incr(args.request, resultHandler); - } - } - - public static class check_and_set - extends org.apache.thrift.AsyncProcessFunction< - I, check_and_set_args, check_and_set_response> { - public check_and_set() { - super("check_and_set"); - } - - public check_and_set_args getEmptyArgsInstance() { - return new check_and_set_args(); - } - - public org.apache.thrift.async.AsyncMethodCallback getResultHandler( - final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, - final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback() { - public void onComplete(check_and_set_response o) { - check_and_set_result result = new check_and_set_result(); - result.success = o; - try { - fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY, seqid); - } catch (org.apache.thrift.transport.TTransportException e) { - _LOGGER.error("TTransportException writing to internal frame buffer", e); - fb.close(); - } catch (java.lang.Exception e) { - _LOGGER.error("Exception writing to internal frame buffer", e); - onError(e); - } - } - - public void onError(java.lang.Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; - check_and_set_result result = new check_and_set_result(); - if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - return; - } else if (e instanceof org.apache.thrift.TApplicationException) { - _LOGGER.error("TApplicationException inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException) e; - } else { - _LOGGER.error("Exception inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = - new org.apache.thrift.TApplicationException( - org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb, msg, msgType, seqid); - } catch (java.lang.Exception ex) { - _LOGGER.error("Exception writing to internal frame buffer", ex); - fb.close(); - } - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start( - I iface, - check_and_set_args args, - org.apache.thrift.async.AsyncMethodCallback resultHandler) - throws org.apache.thrift.TException { - iface.check_and_set(args.request, resultHandler); - } - } - - public static class check_and_mutate - extends org.apache.thrift.AsyncProcessFunction< - I, check_and_mutate_args, check_and_mutate_response> { - public check_and_mutate() { - super("check_and_mutate"); - } - - public check_and_mutate_args getEmptyArgsInstance() { - return new check_and_mutate_args(); - } - - public org.apache.thrift.async.AsyncMethodCallback - getResultHandler( - final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, - final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback() { - public void onComplete(check_and_mutate_response o) { - check_and_mutate_result result = new check_and_mutate_result(); - result.success = o; - try { - fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY, seqid); - } catch (org.apache.thrift.transport.TTransportException e) { - _LOGGER.error("TTransportException writing to internal frame buffer", e); - fb.close(); - } catch (java.lang.Exception e) { - _LOGGER.error("Exception writing to internal frame buffer", e); - onError(e); - } - } - - public void onError(java.lang.Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; - check_and_mutate_result result = new check_and_mutate_result(); - if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - return; - } else if (e instanceof org.apache.thrift.TApplicationException) { - _LOGGER.error("TApplicationException inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException) e; - } else { - _LOGGER.error("Exception inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = - new org.apache.thrift.TApplicationException( - org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb, msg, msgType, seqid); - } catch (java.lang.Exception ex) { - _LOGGER.error("Exception writing to internal frame buffer", ex); - fb.close(); - } - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start( - I iface, - check_and_mutate_args args, - org.apache.thrift.async.AsyncMethodCallback resultHandler) - throws org.apache.thrift.TException { - iface.check_and_mutate(args.request, resultHandler); - } - } - - public static class get - extends org.apache.thrift.AsyncProcessFunction { - public get() { - super("get"); - } - - public get_args getEmptyArgsInstance() { - return new get_args(); - } - - public org.apache.thrift.async.AsyncMethodCallback getResultHandler( - final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, - final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback() { - public void onComplete(read_response o) { - get_result result = new get_result(); - result.success = o; - try { - fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY, seqid); - } catch (org.apache.thrift.transport.TTransportException e) { - _LOGGER.error("TTransportException writing to internal frame buffer", e); - fb.close(); - } catch (java.lang.Exception e) { - _LOGGER.error("Exception writing to internal frame buffer", e); - onError(e); - } - } - - public void onError(java.lang.Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; - get_result result = new get_result(); - if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - return; - } else if (e instanceof org.apache.thrift.TApplicationException) { - _LOGGER.error("TApplicationException inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException) e; - } else { - _LOGGER.error("Exception inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = - new org.apache.thrift.TApplicationException( - org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb, msg, msgType, seqid); - } catch (java.lang.Exception ex) { - _LOGGER.error("Exception writing to internal frame buffer", ex); - fb.close(); - } - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start( - I iface, - get_args args, - org.apache.thrift.async.AsyncMethodCallback resultHandler) - throws org.apache.thrift.TException { - iface.get(args.key, resultHandler); - } - } - - public static class multi_get - extends org.apache.thrift.AsyncProcessFunction { - public multi_get() { - super("multi_get"); - } - - public multi_get_args getEmptyArgsInstance() { - return new multi_get_args(); - } - - public org.apache.thrift.async.AsyncMethodCallback getResultHandler( - final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, - final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback() { - public void onComplete(multi_get_response o) { - multi_get_result result = new multi_get_result(); - result.success = o; - try { - fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY, seqid); - } catch (org.apache.thrift.transport.TTransportException e) { - _LOGGER.error("TTransportException writing to internal frame buffer", e); - fb.close(); - } catch (java.lang.Exception e) { - _LOGGER.error("Exception writing to internal frame buffer", e); - onError(e); - } - } - - public void onError(java.lang.Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; - multi_get_result result = new multi_get_result(); - if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - return; - } else if (e instanceof org.apache.thrift.TApplicationException) { - _LOGGER.error("TApplicationException inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException) e; - } else { - _LOGGER.error("Exception inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = - new org.apache.thrift.TApplicationException( - org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb, msg, msgType, seqid); - } catch (java.lang.Exception ex) { - _LOGGER.error("Exception writing to internal frame buffer", ex); - fb.close(); - } - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start( - I iface, - multi_get_args args, - org.apache.thrift.async.AsyncMethodCallback resultHandler) - throws org.apache.thrift.TException { - iface.multi_get(args.request, resultHandler); - } - } - - public static class batch_get - extends org.apache.thrift.AsyncProcessFunction { - public batch_get() { - super("batch_get"); - } - - public batch_get_args getEmptyArgsInstance() { - return new batch_get_args(); - } - - public org.apache.thrift.async.AsyncMethodCallback getResultHandler( - final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, - final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback() { - public void onComplete(batch_get_response o) { - batch_get_result result = new batch_get_result(); - result.success = o; - try { - fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY, seqid); - } catch (org.apache.thrift.transport.TTransportException e) { - _LOGGER.error("TTransportException writing to internal frame buffer", e); - fb.close(); - } catch (java.lang.Exception e) { - _LOGGER.error("Exception writing to internal frame buffer", e); - onError(e); - } - } - - public void onError(java.lang.Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; - batch_get_result result = new batch_get_result(); - if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - return; - } else if (e instanceof org.apache.thrift.TApplicationException) { - _LOGGER.error("TApplicationException inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException) e; - } else { - _LOGGER.error("Exception inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = - new org.apache.thrift.TApplicationException( - org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb, msg, msgType, seqid); - } catch (java.lang.Exception ex) { - _LOGGER.error("Exception writing to internal frame buffer", ex); - fb.close(); - } - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start( - I iface, - batch_get_args args, - org.apache.thrift.async.AsyncMethodCallback resultHandler) - throws org.apache.thrift.TException { - iface.batch_get(args.request, resultHandler); - } - } - - public static class sortkey_count - extends org.apache.thrift.AsyncProcessFunction { - public sortkey_count() { - super("sortkey_count"); - } - - public sortkey_count_args getEmptyArgsInstance() { - return new sortkey_count_args(); - } - - public org.apache.thrift.async.AsyncMethodCallback getResultHandler( - final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, - final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback() { - public void onComplete(count_response o) { - sortkey_count_result result = new sortkey_count_result(); - result.success = o; - try { - fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY, seqid); - } catch (org.apache.thrift.transport.TTransportException e) { - _LOGGER.error("TTransportException writing to internal frame buffer", e); - fb.close(); - } catch (java.lang.Exception e) { - _LOGGER.error("Exception writing to internal frame buffer", e); - onError(e); - } - } - - public void onError(java.lang.Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; - sortkey_count_result result = new sortkey_count_result(); - if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - return; - } else if (e instanceof org.apache.thrift.TApplicationException) { - _LOGGER.error("TApplicationException inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException) e; - } else { - _LOGGER.error("Exception inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = - new org.apache.thrift.TApplicationException( - org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb, msg, msgType, seqid); - } catch (java.lang.Exception ex) { - _LOGGER.error("Exception writing to internal frame buffer", ex); - fb.close(); - } - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start( - I iface, - sortkey_count_args args, - org.apache.thrift.async.AsyncMethodCallback resultHandler) - throws org.apache.thrift.TException { - iface.sortkey_count(args.hash_key, resultHandler); - } - } - - public static class ttl - extends org.apache.thrift.AsyncProcessFunction { - public ttl() { - super("ttl"); - } - - public ttl_args getEmptyArgsInstance() { - return new ttl_args(); - } - - public org.apache.thrift.async.AsyncMethodCallback getResultHandler( - final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, - final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback() { - public void onComplete(ttl_response o) { - ttl_result result = new ttl_result(); - result.success = o; - try { - fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY, seqid); - } catch (org.apache.thrift.transport.TTransportException e) { - _LOGGER.error("TTransportException writing to internal frame buffer", e); - fb.close(); - } catch (java.lang.Exception e) { - _LOGGER.error("Exception writing to internal frame buffer", e); - onError(e); - } - } - - public void onError(java.lang.Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; - ttl_result result = new ttl_result(); - if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - return; - } else if (e instanceof org.apache.thrift.TApplicationException) { - _LOGGER.error("TApplicationException inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException) e; - } else { - _LOGGER.error("Exception inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = - new org.apache.thrift.TApplicationException( - org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb, msg, msgType, seqid); - } catch (java.lang.Exception ex) { - _LOGGER.error("Exception writing to internal frame buffer", ex); - fb.close(); - } - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start( - I iface, - ttl_args args, - org.apache.thrift.async.AsyncMethodCallback resultHandler) - throws org.apache.thrift.TException { - iface.ttl(args.key, resultHandler); - } - } - - public static class get_scanner - extends org.apache.thrift.AsyncProcessFunction { - public get_scanner() { - super("get_scanner"); - } - - public get_scanner_args getEmptyArgsInstance() { - return new get_scanner_args(); - } - - public org.apache.thrift.async.AsyncMethodCallback getResultHandler( - final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, - final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback() { - public void onComplete(scan_response o) { - get_scanner_result result = new get_scanner_result(); - result.success = o; - try { - fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY, seqid); - } catch (org.apache.thrift.transport.TTransportException e) { - _LOGGER.error("TTransportException writing to internal frame buffer", e); - fb.close(); - } catch (java.lang.Exception e) { - _LOGGER.error("Exception writing to internal frame buffer", e); - onError(e); - } - } - - public void onError(java.lang.Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; - get_scanner_result result = new get_scanner_result(); - if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - return; - } else if (e instanceof org.apache.thrift.TApplicationException) { - _LOGGER.error("TApplicationException inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException) e; - } else { - _LOGGER.error("Exception inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = - new org.apache.thrift.TApplicationException( - org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb, msg, msgType, seqid); - } catch (java.lang.Exception ex) { - _LOGGER.error("Exception writing to internal frame buffer", ex); - fb.close(); - } - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start( - I iface, - get_scanner_args args, - org.apache.thrift.async.AsyncMethodCallback resultHandler) - throws org.apache.thrift.TException { - iface.get_scanner(args.request, resultHandler); - } - } - - public static class scan - extends org.apache.thrift.AsyncProcessFunction { - public scan() { - super("scan"); - } - - public scan_args getEmptyArgsInstance() { - return new scan_args(); - } - - public org.apache.thrift.async.AsyncMethodCallback getResultHandler( - final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, - final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback() { - public void onComplete(scan_response o) { - scan_result result = new scan_result(); - result.success = o; - try { - fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY, seqid); - } catch (org.apache.thrift.transport.TTransportException e) { - _LOGGER.error("TTransportException writing to internal frame buffer", e); - fb.close(); - } catch (java.lang.Exception e) { - _LOGGER.error("Exception writing to internal frame buffer", e); - onError(e); - } - } - - public void onError(java.lang.Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; - scan_result result = new scan_result(); - if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - return; - } else if (e instanceof org.apache.thrift.TApplicationException) { - _LOGGER.error("TApplicationException inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException) e; - } else { - _LOGGER.error("Exception inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = - new org.apache.thrift.TApplicationException( - org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb, msg, msgType, seqid); - } catch (java.lang.Exception ex) { - _LOGGER.error("Exception writing to internal frame buffer", ex); - fb.close(); - } - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start( - I iface, - scan_args args, - org.apache.thrift.async.AsyncMethodCallback resultHandler) - throws org.apache.thrift.TException { - iface.scan(args.request, resultHandler); - } - } - - public static class clear_scanner - extends org.apache.thrift.AsyncProcessFunction { - public clear_scanner() { - super("clear_scanner"); - } - - public clear_scanner_args getEmptyArgsInstance() { - return new clear_scanner_args(); - } - - public org.apache.thrift.async.AsyncMethodCallback getResultHandler( - final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, - final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback() { - public void onComplete(Void o) {} - - public void onError(java.lang.Exception e) { - if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - } else { - _LOGGER.error("Exception inside oneway handler", e); - } - } - }; - } - - protected boolean isOneway() { - return true; - } - - public void start( - I iface, - clear_scanner_args args, - org.apache.thrift.async.AsyncMethodCallback resultHandler) - throws org.apache.thrift.TException { - iface.clear_scanner(args.context_id, resultHandler); - } - } - } - - public static class put_args - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("put_args"); - - private static final org.apache.thrift.protocol.TField UPDATE_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "update", org.apache.thrift.protocol.TType.STRUCT, (short) 1); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new put_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new put_argsTupleSchemeFactory(); - - public update_request update; // 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 { - UPDATE((short) 1, "update"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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: // UPDATE - return UPDATE; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> - metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put( - _Fields.UPDATE, - new org.apache.thrift.meta_data.FieldMetaData( - "update", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData( - org.apache.thrift.protocol.TType.STRUCT, update_request.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(put_args.class, metaDataMap); - } - - public put_args() {} - - public put_args(update_request update) { - this(); - this.update = update; - } - - /** Performs a deep copy on other. */ - public put_args(put_args other) { - if (other.isSetUpdate()) { - this.update = new update_request(other.update); - } - } - - public put_args deepCopy() { - return new put_args(this); - } - - @Override - public void clear() { - this.update = null; - } - - public update_request getUpdate() { - return this.update; - } - - public put_args setUpdate(update_request update) { - this.update = update; - return this; - } - - public void unsetUpdate() { - this.update = null; - } - - /** Returns true if field update is set (has been assigned a value) and false otherwise */ - public boolean isSetUpdate() { - return this.update != null; - } - - public void setUpdateIsSet(boolean value) { - if (!value) { - this.update = null; - } - } - - public void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case UPDATE: - if (value == null) { - unsetUpdate(); - } else { - setUpdate((update_request) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case UPDATE: - return getUpdate(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case UPDATE: - return isSetUpdate(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.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; - if (this == that) return true; - - boolean this_present_update = true && this.isSetUpdate(); - boolean that_present_update = true && that.isSetUpdate(); - if (this_present_update || that_present_update) { - if (!(this_present_update && that_present_update)) return false; - if (!this.update.equals(that.update)) return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetUpdate()) ? 131071 : 524287); - if (isSetUpdate()) hashCode = hashCode * 8191 + update.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(put_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetUpdate()).compareTo(other.isSetUpdate()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetUpdate()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.update, other.update); - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("put_args("); - boolean first = true; - - sb.append("update:"); - if (this.update == null) { - sb.append("null"); - } else { - sb.append(this.update); - } - 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 (update != null) { - update.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, java.lang.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 org.apache.thrift.scheme.SchemeFactory { - public put_argsStandardScheme getScheme() { - return new put_argsStandardScheme(); - } - } - - private static class put_argsStandardScheme - extends org.apache.thrift.scheme.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: // UPDATE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.update = new update_request(); - struct.update.read(iprot); - struct.setUpdateIsSet(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.update != null) { - oprot.writeFieldBegin(UPDATE_FIELD_DESC); - struct.update.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class put_argsTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public put_argsTupleScheme getScheme() { - return new put_argsTupleScheme(); - } - } - - private static class put_argsTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, put_args struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetUpdate()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetUpdate()) { - struct.update.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, put_args struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.update = new update_request(); - struct.update.read(iprot); - struct.setUpdateIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } - } - - public static class put_result - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("put_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "success", org.apache.thrift.protocol.TType.STRUCT, (short) 0); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new put_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new put_resultTupleSchemeFactory(); - - public update_response success; // 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"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> - metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.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, update_response.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(put_result.class, metaDataMap); - } - - public put_result() {} - - public put_result(update_response success) { - this(); - this.success = success; - } - - /** Performs a deep copy on other. */ - public put_result(put_result other) { - if (other.isSetSuccess()) { - this.success = new update_response(other.success); - } - } - - public put_result deepCopy() { - return new put_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public update_response getSuccess() { - return this.success; - } - - public put_result setSuccess(update_response 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 void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((update_response) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.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; - if (this == that) return true; - - 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; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) hashCode = hashCode * 8191 + success.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(put_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("put_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - 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, java.lang.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 org.apache.thrift.scheme.SchemeFactory { - public put_resultStandardScheme getScheme() { - return new put_resultStandardScheme(); - } - } - - private static class put_resultStandardScheme - extends org.apache.thrift.scheme.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 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.success = new update_response(); - struct.success.read(iprot); - struct.setSuccessIsSet(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.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - struct.success.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class put_resultTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public put_resultTupleScheme getScheme() { - return new put_resultTupleScheme(); - } - } - - private static class put_resultTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, put_result struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, put_result struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new update_response(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } - } - - public static class multi_put_args - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("multi_put_args"); - - private static final org.apache.thrift.protocol.TField REQUEST_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "request", org.apache.thrift.protocol.TType.STRUCT, (short) 1); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new multi_put_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new multi_put_argsTupleSchemeFactory(); - - public multi_put_request request; // 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 { - REQUEST((short) 1, "request"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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: // REQUEST - return REQUEST; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> - metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put( - _Fields.REQUEST, - new org.apache.thrift.meta_data.FieldMetaData( - "request", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData( - org.apache.thrift.protocol.TType.STRUCT, multi_put_request.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap( - multi_put_args.class, metaDataMap); - } - - public multi_put_args() {} - - public multi_put_args(multi_put_request request) { - this(); - this.request = request; - } - - /** Performs a deep copy on other. */ - public multi_put_args(multi_put_args other) { - if (other.isSetRequest()) { - this.request = new multi_put_request(other.request); - } - } - - public multi_put_args deepCopy() { - return new multi_put_args(this); - } - - @Override - public void clear() { - this.request = null; - } - - public multi_put_request getRequest() { - return this.request; - } - - public multi_put_args setRequest(multi_put_request request) { - this.request = request; - return this; - } - - public void unsetRequest() { - this.request = null; - } - - /** Returns true if field request is set (has been assigned a value) and false otherwise */ - public boolean isSetRequest() { - return this.request != null; - } - - public void setRequestIsSet(boolean value) { - if (!value) { - this.request = null; - } - } - - public void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case REQUEST: - if (value == null) { - unsetRequest(); - } else { - setRequest((multi_put_request) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case REQUEST: - return getRequest(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case REQUEST: - return isSetRequest(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof multi_put_args) return this.equals((multi_put_args) that); - return false; - } - - public boolean equals(multi_put_args that) { - if (that == null) return false; - if (this == that) return true; - - boolean this_present_request = true && this.isSetRequest(); - boolean that_present_request = true && that.isSetRequest(); - if (this_present_request || that_present_request) { - if (!(this_present_request && that_present_request)) return false; - if (!this.request.equals(that.request)) return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetRequest()) ? 131071 : 524287); - if (isSetRequest()) hashCode = hashCode * 8191 + request.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(multi_put_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetRequest()).compareTo(other.isSetRequest()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetRequest()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.request, other.request); - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("multi_put_args("); - boolean first = true; - - sb.append("request:"); - if (this.request == null) { - sb.append("null"); - } else { - sb.append(this.request); - } - 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 (request != null) { - request.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, java.lang.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 multi_put_argsStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public multi_put_argsStandardScheme getScheme() { - return new multi_put_argsStandardScheme(); - } - } - - private static class multi_put_argsStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, multi_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: // REQUEST - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.request = new multi_put_request(); - struct.request.read(iprot); - struct.setRequestIsSet(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, multi_put_args struct) - throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.request != null) { - oprot.writeFieldBegin(REQUEST_FIELD_DESC); - struct.request.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class multi_put_argsTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public multi_put_argsTupleScheme getScheme() { - return new multi_put_argsTupleScheme(); - } - } - - private static class multi_put_argsTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, multi_put_args struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetRequest()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetRequest()) { - struct.request.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, multi_put_args struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.request = new multi_put_request(); - struct.request.read(iprot); - struct.setRequestIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } - } - - public static class multi_put_result - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("multi_put_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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new multi_put_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new multi_put_resultTupleSchemeFactory(); - - public update_response success; // 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"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> - metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.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, update_response.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap( - multi_put_result.class, metaDataMap); - } - - public multi_put_result() {} - - public multi_put_result(update_response success) { - this(); - this.success = success; - } - - /** Performs a deep copy on other. */ - public multi_put_result(multi_put_result other) { - if (other.isSetSuccess()) { - this.success = new update_response(other.success); - } - } - - public multi_put_result deepCopy() { - return new multi_put_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public update_response getSuccess() { - return this.success; - } - - public multi_put_result setSuccess(update_response 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 void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((update_response) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof multi_put_result) return this.equals((multi_put_result) that); - return false; - } - - public boolean equals(multi_put_result that) { - if (that == null) return false; - if (this == that) return true; - - 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; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) hashCode = hashCode * 8191 + success.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(multi_put_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("multi_put_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - 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, java.lang.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 multi_put_resultStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public multi_put_resultStandardScheme getScheme() { - return new multi_put_resultStandardScheme(); - } - } - - private static class multi_put_resultStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, multi_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 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.success = new update_response(); - struct.success.read(iprot); - struct.setSuccessIsSet(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, multi_put_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(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class multi_put_resultTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public multi_put_resultTupleScheme getScheme() { - return new multi_put_resultTupleScheme(); - } - } - - private static class multi_put_resultTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, multi_put_result struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, multi_put_result struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new update_response(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } - } - - public static class remove_args - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("remove_args"); - - private static final org.apache.thrift.protocol.TField KEY_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "key", org.apache.thrift.protocol.TType.STRUCT, (short) 1); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new remove_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new remove_argsTupleSchemeFactory(); - - public blob key; // 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 { - KEY((short) 1, "key"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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: // KEY - return KEY; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> - metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put( - _Fields.KEY, - new org.apache.thrift.meta_data.FieldMetaData( - "key", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData( - org.apache.thrift.protocol.TType.STRUCT, blob.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap( - remove_args.class, metaDataMap); - } - - public remove_args() {} - - public remove_args(blob key) { - this(); - this.key = key; - } - - /** Performs a deep copy on other. */ - public remove_args(remove_args other) { - if (other.isSetKey()) { - this.key = new blob(other.key); - } - } - - public remove_args deepCopy() { - return new remove_args(this); - } - - @Override - public void clear() { - this.key = null; - } - - public blob getKey() { - return this.key; - } - - public remove_args setKey(blob key) { - this.key = key; - return this; - } - - public void unsetKey() { - this.key = null; - } - - /** Returns true if field key is set (has been assigned a value) and false otherwise */ - public boolean isSetKey() { - return this.key != null; - } - - public void setKeyIsSet(boolean value) { - if (!value) { - this.key = null; - } - } - - public void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case KEY: - if (value == null) { - unsetKey(); - } else { - setKey((blob) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case KEY: - return getKey(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case KEY: - return isSetKey(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof remove_args) return this.equals((remove_args) that); - return false; - } - - public boolean equals(remove_args that) { - if (that == null) return false; - if (this == that) return true; - - boolean this_present_key = true && this.isSetKey(); - boolean that_present_key = true && that.isSetKey(); - if (this_present_key || that_present_key) { - if (!(this_present_key && that_present_key)) return false; - if (!this.key.equals(that.key)) return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetKey()) ? 131071 : 524287); - if (isSetKey()) hashCode = hashCode * 8191 + key.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(remove_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetKey()).compareTo(other.isSetKey()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetKey()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.key, other.key); - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("remove_args("); - boolean first = true; - - sb.append("key:"); - if (this.key == null) { - sb.append("null"); - } else { - sb.append(this.key); - } - 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 (key != null) { - key.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, java.lang.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 remove_argsStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public remove_argsStandardScheme getScheme() { - return new remove_argsStandardScheme(); - } - } - - private static class remove_argsStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, remove_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: // KEY - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.key = new blob(); - struct.key.read(iprot); - struct.setKeyIsSet(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, remove_args struct) - throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.key != null) { - oprot.writeFieldBegin(KEY_FIELD_DESC); - struct.key.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class remove_argsTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public remove_argsTupleScheme getScheme() { - return new remove_argsTupleScheme(); - } - } - - private static class remove_argsTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, remove_args struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetKey()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetKey()) { - struct.key.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, remove_args struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.key = new blob(); - struct.key.read(iprot); - struct.setKeyIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } - } - - public static class remove_result - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("remove_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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new remove_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new remove_resultTupleSchemeFactory(); - - public update_response success; // 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"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> - metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.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, update_response.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap( - remove_result.class, metaDataMap); - } - - public remove_result() {} - - public remove_result(update_response success) { - this(); - this.success = success; - } - - /** Performs a deep copy on other. */ - public remove_result(remove_result other) { - if (other.isSetSuccess()) { - this.success = new update_response(other.success); - } - } - - public remove_result deepCopy() { - return new remove_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public update_response getSuccess() { - return this.success; - } - - public remove_result setSuccess(update_response 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 void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((update_response) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof remove_result) return this.equals((remove_result) that); - return false; - } - - public boolean equals(remove_result that) { - if (that == null) return false; - if (this == that) return true; - - 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; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) hashCode = hashCode * 8191 + success.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(remove_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("remove_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - 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, java.lang.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 remove_resultStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public remove_resultStandardScheme getScheme() { - return new remove_resultStandardScheme(); - } - } - - private static class remove_resultStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, remove_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 update_response(); - struct.success.read(iprot); - struct.setSuccessIsSet(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, remove_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(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class remove_resultTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public remove_resultTupleScheme getScheme() { - return new remove_resultTupleScheme(); - } - } - - private static class remove_resultTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, remove_result struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, remove_result struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new update_response(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } - } - - public static class multi_remove_args - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("multi_remove_args"); - - private static final org.apache.thrift.protocol.TField REQUEST_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "request", org.apache.thrift.protocol.TType.STRUCT, (short) 1); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new multi_remove_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new multi_remove_argsTupleSchemeFactory(); - - public multi_remove_request request; // 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 { - REQUEST((short) 1, "request"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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: // REQUEST - return REQUEST; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> - metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put( - _Fields.REQUEST, - new org.apache.thrift.meta_data.FieldMetaData( - "request", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData( - org.apache.thrift.protocol.TType.STRUCT, multi_remove_request.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap( - multi_remove_args.class, metaDataMap); - } - - public multi_remove_args() {} - - public multi_remove_args(multi_remove_request request) { - this(); - this.request = request; - } - - /** Performs a deep copy on other. */ - public multi_remove_args(multi_remove_args other) { - if (other.isSetRequest()) { - this.request = new multi_remove_request(other.request); - } - } - - public multi_remove_args deepCopy() { - return new multi_remove_args(this); - } - - @Override - public void clear() { - this.request = null; - } - - public multi_remove_request getRequest() { - return this.request; - } - - public multi_remove_args setRequest(multi_remove_request request) { - this.request = request; - return this; - } - - public void unsetRequest() { - this.request = null; - } - - /** Returns true if field request is set (has been assigned a value) and false otherwise */ - public boolean isSetRequest() { - return this.request != null; - } - - public void setRequestIsSet(boolean value) { - if (!value) { - this.request = null; - } - } - - public void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case REQUEST: - if (value == null) { - unsetRequest(); - } else { - setRequest((multi_remove_request) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case REQUEST: - return getRequest(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case REQUEST: - return isSetRequest(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof multi_remove_args) return this.equals((multi_remove_args) that); - return false; - } - - public boolean equals(multi_remove_args that) { - if (that == null) return false; - if (this == that) return true; - - boolean this_present_request = true && this.isSetRequest(); - boolean that_present_request = true && that.isSetRequest(); - if (this_present_request || that_present_request) { - if (!(this_present_request && that_present_request)) return false; - if (!this.request.equals(that.request)) return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetRequest()) ? 131071 : 524287); - if (isSetRequest()) hashCode = hashCode * 8191 + request.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(multi_remove_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetRequest()).compareTo(other.isSetRequest()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetRequest()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.request, other.request); - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("multi_remove_args("); - boolean first = true; - - sb.append("request:"); - if (this.request == null) { - sb.append("null"); - } else { - sb.append(this.request); - } - 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 (request != null) { - request.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, java.lang.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 multi_remove_argsStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public multi_remove_argsStandardScheme getScheme() { - return new multi_remove_argsStandardScheme(); - } - } - - private static class multi_remove_argsStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, multi_remove_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: // REQUEST - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.request = new multi_remove_request(); - struct.request.read(iprot); - struct.setRequestIsSet(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, multi_remove_args struct) - throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.request != null) { - oprot.writeFieldBegin(REQUEST_FIELD_DESC); - struct.request.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class multi_remove_argsTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public multi_remove_argsTupleScheme getScheme() { - return new multi_remove_argsTupleScheme(); - } - } - - private static class multi_remove_argsTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, multi_remove_args struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetRequest()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetRequest()) { - struct.request.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, multi_remove_args struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.request = new multi_remove_request(); - struct.request.read(iprot); - struct.setRequestIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } - } - - public static class multi_remove_result - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("multi_remove_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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new multi_remove_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new multi_remove_resultTupleSchemeFactory(); - - public multi_remove_response success; // 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"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> - metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.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, multi_remove_response.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap( - multi_remove_result.class, metaDataMap); - } - - public multi_remove_result() {} - - public multi_remove_result(multi_remove_response success) { - this(); - this.success = success; - } - - /** Performs a deep copy on other. */ - public multi_remove_result(multi_remove_result other) { - if (other.isSetSuccess()) { - this.success = new multi_remove_response(other.success); - } - } - - public multi_remove_result deepCopy() { - return new multi_remove_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public multi_remove_response getSuccess() { - return this.success; - } - - public multi_remove_result setSuccess(multi_remove_response 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 void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((multi_remove_response) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof multi_remove_result) return this.equals((multi_remove_result) that); - return false; - } - - public boolean equals(multi_remove_result that) { - if (that == null) return false; - if (this == that) return true; - - 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; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) hashCode = hashCode * 8191 + success.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(multi_remove_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("multi_remove_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - 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, java.lang.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 multi_remove_resultStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public multi_remove_resultStandardScheme getScheme() { - return new multi_remove_resultStandardScheme(); - } - } - - private static class multi_remove_resultStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, multi_remove_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 multi_remove_response(); - struct.success.read(iprot); - struct.setSuccessIsSet(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, multi_remove_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(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class multi_remove_resultTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public multi_remove_resultTupleScheme getScheme() { - return new multi_remove_resultTupleScheme(); - } - } - - private static class multi_remove_resultTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, multi_remove_result struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, multi_remove_result struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new multi_remove_response(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } - } - - public static class incr_args - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("incr_args"); - - private static final org.apache.thrift.protocol.TField REQUEST_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "request", org.apache.thrift.protocol.TType.STRUCT, (short) 1); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new incr_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new incr_argsTupleSchemeFactory(); - - public incr_request request; // 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 { - REQUEST((short) 1, "request"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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: // REQUEST - return REQUEST; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> - metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put( - _Fields.REQUEST, - new org.apache.thrift.meta_data.FieldMetaData( - "request", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData( - org.apache.thrift.protocol.TType.STRUCT, incr_request.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(incr_args.class, metaDataMap); - } - - public incr_args() {} - - public incr_args(incr_request request) { - this(); - this.request = request; - } - - /** Performs a deep copy on other. */ - public incr_args(incr_args other) { - if (other.isSetRequest()) { - this.request = new incr_request(other.request); - } - } - - public incr_args deepCopy() { - return new incr_args(this); - } - - @Override - public void clear() { - this.request = null; - } - - public incr_request getRequest() { - return this.request; - } - - public incr_args setRequest(incr_request request) { - this.request = request; - return this; - } - - public void unsetRequest() { - this.request = null; - } - - /** Returns true if field request is set (has been assigned a value) and false otherwise */ - public boolean isSetRequest() { - return this.request != null; - } - - public void setRequestIsSet(boolean value) { - if (!value) { - this.request = null; - } - } - - public void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case REQUEST: - if (value == null) { - unsetRequest(); - } else { - setRequest((incr_request) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case REQUEST: - return getRequest(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case REQUEST: - return isSetRequest(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof incr_args) return this.equals((incr_args) that); - return false; - } - - public boolean equals(incr_args that) { - if (that == null) return false; - if (this == that) return true; - - boolean this_present_request = true && this.isSetRequest(); - boolean that_present_request = true && that.isSetRequest(); - if (this_present_request || that_present_request) { - if (!(this_present_request && that_present_request)) return false; - if (!this.request.equals(that.request)) return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetRequest()) ? 131071 : 524287); - if (isSetRequest()) hashCode = hashCode * 8191 + request.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(incr_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetRequest()).compareTo(other.isSetRequest()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetRequest()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.request, other.request); - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("incr_args("); - boolean first = true; - - sb.append("request:"); - if (this.request == null) { - sb.append("null"); - } else { - sb.append(this.request); - } - 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 (request != null) { - request.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, java.lang.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 incr_argsStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public incr_argsStandardScheme getScheme() { - return new incr_argsStandardScheme(); - } - } - - private static class incr_argsStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, incr_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: // REQUEST - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.request = new incr_request(); - struct.request.read(iprot); - struct.setRequestIsSet(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, incr_args struct) - throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.request != null) { - oprot.writeFieldBegin(REQUEST_FIELD_DESC); - struct.request.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class incr_argsTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public incr_argsTupleScheme getScheme() { - return new incr_argsTupleScheme(); - } - } - - private static class incr_argsTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, incr_args struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetRequest()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetRequest()) { - struct.request.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, incr_args struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.request = new incr_request(); - struct.request.read(iprot); - struct.setRequestIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } - } - - public static class incr_result - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("incr_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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new incr_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new incr_resultTupleSchemeFactory(); - - public incr_response success; // 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"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> - metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.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, incr_response.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap( - incr_result.class, metaDataMap); - } - - public incr_result() {} - - public incr_result(incr_response success) { - this(); - this.success = success; - } - - /** Performs a deep copy on other. */ - public incr_result(incr_result other) { - if (other.isSetSuccess()) { - this.success = new incr_response(other.success); - } - } - - public incr_result deepCopy() { - return new incr_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public incr_response getSuccess() { - return this.success; - } - - public incr_result setSuccess(incr_response 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 void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((incr_response) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof incr_result) return this.equals((incr_result) that); - return false; - } - - public boolean equals(incr_result that) { - if (that == null) return false; - if (this == that) return true; - - 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; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) hashCode = hashCode * 8191 + success.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(incr_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("incr_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - 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, java.lang.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 incr_resultStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public incr_resultStandardScheme getScheme() { - return new incr_resultStandardScheme(); - } - } - - private static class incr_resultStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, incr_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 incr_response(); - struct.success.read(iprot); - struct.setSuccessIsSet(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, incr_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(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class incr_resultTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public incr_resultTupleScheme getScheme() { - return new incr_resultTupleScheme(); - } - } - - private static class incr_resultTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, incr_result struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, incr_result struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new incr_response(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } - } - - public static class check_and_set_args - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("check_and_set_args"); - - private static final org.apache.thrift.protocol.TField REQUEST_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "request", org.apache.thrift.protocol.TType.STRUCT, (short) 1); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new check_and_set_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new check_and_set_argsTupleSchemeFactory(); - - public check_and_set_request request; // 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 { - REQUEST((short) 1, "request"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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: // REQUEST - return REQUEST; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> - metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put( - _Fields.REQUEST, - new org.apache.thrift.meta_data.FieldMetaData( - "request", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData( - org.apache.thrift.protocol.TType.STRUCT, check_and_set_request.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap( - check_and_set_args.class, metaDataMap); - } - - public check_and_set_args() {} - - public check_and_set_args(check_and_set_request request) { - this(); - this.request = request; - } - - /** Performs a deep copy on other. */ - public check_and_set_args(check_and_set_args other) { - if (other.isSetRequest()) { - this.request = new check_and_set_request(other.request); - } - } - - public check_and_set_args deepCopy() { - return new check_and_set_args(this); - } - - @Override - public void clear() { - this.request = null; - } - - public check_and_set_request getRequest() { - return this.request; - } - - public check_and_set_args setRequest(check_and_set_request request) { - this.request = request; - return this; - } - - public void unsetRequest() { - this.request = null; - } - - /** Returns true if field request is set (has been assigned a value) and false otherwise */ - public boolean isSetRequest() { - return this.request != null; - } - - public void setRequestIsSet(boolean value) { - if (!value) { - this.request = null; - } - } - - public void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case REQUEST: - if (value == null) { - unsetRequest(); - } else { - setRequest((check_and_set_request) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case REQUEST: - return getRequest(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case REQUEST: - return isSetRequest(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof check_and_set_args) return this.equals((check_and_set_args) that); - return false; - } - - public boolean equals(check_and_set_args that) { - if (that == null) return false; - if (this == that) return true; - - boolean this_present_request = true && this.isSetRequest(); - boolean that_present_request = true && that.isSetRequest(); - if (this_present_request || that_present_request) { - if (!(this_present_request && that_present_request)) return false; - if (!this.request.equals(that.request)) return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetRequest()) ? 131071 : 524287); - if (isSetRequest()) hashCode = hashCode * 8191 + request.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(check_and_set_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetRequest()).compareTo(other.isSetRequest()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetRequest()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.request, other.request); - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("check_and_set_args("); - boolean first = true; - - sb.append("request:"); - if (this.request == null) { - sb.append("null"); - } else { - sb.append(this.request); - } - 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 (request != null) { - request.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, java.lang.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 check_and_set_argsStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public check_and_set_argsStandardScheme getScheme() { - return new check_and_set_argsStandardScheme(); - } - } - - private static class check_and_set_argsStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, check_and_set_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: // REQUEST - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.request = new check_and_set_request(); - struct.request.read(iprot); - struct.setRequestIsSet(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, check_and_set_args struct) - throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.request != null) { - oprot.writeFieldBegin(REQUEST_FIELD_DESC); - struct.request.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class check_and_set_argsTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public check_and_set_argsTupleScheme getScheme() { - return new check_and_set_argsTupleScheme(); - } - } - - private static class check_and_set_argsTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, check_and_set_args struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetRequest()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetRequest()) { - struct.request.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, check_and_set_args struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.request = new check_and_set_request(); - struct.request.read(iprot); - struct.setRequestIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } - } - - public static class check_and_set_result - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("check_and_set_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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new check_and_set_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new check_and_set_resultTupleSchemeFactory(); - - public check_and_set_response success; // 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"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> - metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.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, check_and_set_response.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap( - check_and_set_result.class, metaDataMap); - } - - public check_and_set_result() {} - - public check_and_set_result(check_and_set_response success) { - this(); - this.success = success; - } - - /** Performs a deep copy on other. */ - public check_and_set_result(check_and_set_result other) { - if (other.isSetSuccess()) { - this.success = new check_and_set_response(other.success); - } - } - - public check_and_set_result deepCopy() { - return new check_and_set_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public check_and_set_response getSuccess() { - return this.success; - } - - public check_and_set_result setSuccess(check_and_set_response 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 void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((check_and_set_response) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof check_and_set_result) return this.equals((check_and_set_result) that); - return false; - } - - public boolean equals(check_and_set_result that) { - if (that == null) return false; - if (this == that) return true; - - 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; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) hashCode = hashCode * 8191 + success.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(check_and_set_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("check_and_set_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - 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, java.lang.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 check_and_set_resultStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public check_and_set_resultStandardScheme getScheme() { - return new check_and_set_resultStandardScheme(); - } - } - - private static class check_and_set_resultStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, check_and_set_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 check_and_set_response(); - struct.success.read(iprot); - struct.setSuccessIsSet(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, check_and_set_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(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class check_and_set_resultTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public check_and_set_resultTupleScheme getScheme() { - return new check_and_set_resultTupleScheme(); - } - } - - private static class check_and_set_resultTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, check_and_set_result struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, check_and_set_result struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new check_and_set_response(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } - } - - public static class check_and_mutate_args - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("check_and_mutate_args"); - - private static final org.apache.thrift.protocol.TField REQUEST_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "request", org.apache.thrift.protocol.TType.STRUCT, (short) 1); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new check_and_mutate_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new check_and_mutate_argsTupleSchemeFactory(); - - public check_and_mutate_request request; // 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 { - REQUEST((short) 1, "request"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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: // REQUEST - return REQUEST; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> - metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put( - _Fields.REQUEST, - new org.apache.thrift.meta_data.FieldMetaData( - "request", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData( - org.apache.thrift.protocol.TType.STRUCT, check_and_mutate_request.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap( - check_and_mutate_args.class, metaDataMap); - } - - public check_and_mutate_args() {} - - public check_and_mutate_args(check_and_mutate_request request) { - this(); - this.request = request; - } - - /** Performs a deep copy on other. */ - public check_and_mutate_args(check_and_mutate_args other) { - if (other.isSetRequest()) { - this.request = new check_and_mutate_request(other.request); - } - } - - public check_and_mutate_args deepCopy() { - return new check_and_mutate_args(this); - } - - @Override - public void clear() { - this.request = null; - } - - public check_and_mutate_request getRequest() { - return this.request; - } - - public check_and_mutate_args setRequest(check_and_mutate_request request) { - this.request = request; - return this; - } - - public void unsetRequest() { - this.request = null; - } - - /** Returns true if field request is set (has been assigned a value) and false otherwise */ - public boolean isSetRequest() { - return this.request != null; - } - - public void setRequestIsSet(boolean value) { - if (!value) { - this.request = null; - } - } - - public void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case REQUEST: - if (value == null) { - unsetRequest(); - } else { - setRequest((check_and_mutate_request) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case REQUEST: - return getRequest(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case REQUEST: - return isSetRequest(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof check_and_mutate_args) return this.equals((check_and_mutate_args) that); - return false; - } - - public boolean equals(check_and_mutate_args that) { - if (that == null) return false; - if (this == that) return true; - - boolean this_present_request = true && this.isSetRequest(); - boolean that_present_request = true && that.isSetRequest(); - if (this_present_request || that_present_request) { - if (!(this_present_request && that_present_request)) return false; - if (!this.request.equals(that.request)) return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetRequest()) ? 131071 : 524287); - if (isSetRequest()) hashCode = hashCode * 8191 + request.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(check_and_mutate_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetRequest()).compareTo(other.isSetRequest()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetRequest()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.request, other.request); - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("check_and_mutate_args("); - boolean first = true; - - sb.append("request:"); - if (this.request == null) { - sb.append("null"); - } else { - sb.append(this.request); - } - 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 (request != null) { - request.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, java.lang.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 check_and_mutate_argsStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public check_and_mutate_argsStandardScheme getScheme() { - return new check_and_mutate_argsStandardScheme(); - } - } - - private static class check_and_mutate_argsStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, check_and_mutate_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: // REQUEST - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.request = new check_and_mutate_request(); - struct.request.read(iprot); - struct.setRequestIsSet(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, check_and_mutate_args struct) - throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.request != null) { - oprot.writeFieldBegin(REQUEST_FIELD_DESC); - struct.request.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class check_and_mutate_argsTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public check_and_mutate_argsTupleScheme getScheme() { - return new check_and_mutate_argsTupleScheme(); - } - } - - private static class check_and_mutate_argsTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, check_and_mutate_args struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetRequest()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetRequest()) { - struct.request.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, check_and_mutate_args struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.request = new check_and_mutate_request(); - struct.request.read(iprot); - struct.setRequestIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } - } - - public static class check_and_mutate_result - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("check_and_mutate_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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new check_and_mutate_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new check_and_mutate_resultTupleSchemeFactory(); - - public check_and_mutate_response success; // 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"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> - metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.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, check_and_mutate_response.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap( - check_and_mutate_result.class, metaDataMap); - } - - public check_and_mutate_result() {} - - public check_and_mutate_result(check_and_mutate_response success) { - this(); - this.success = success; - } - - /** Performs a deep copy on other. */ - public check_and_mutate_result(check_and_mutate_result other) { - if (other.isSetSuccess()) { - this.success = new check_and_mutate_response(other.success); - } - } - - public check_and_mutate_result deepCopy() { - return new check_and_mutate_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public check_and_mutate_response getSuccess() { - return this.success; - } - - public check_and_mutate_result setSuccess(check_and_mutate_response 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 void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((check_and_mutate_response) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof check_and_mutate_result) - return this.equals((check_and_mutate_result) that); - return false; - } - - public boolean equals(check_and_mutate_result that) { - if (that == null) return false; - if (this == that) return true; - - 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; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) hashCode = hashCode * 8191 + success.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(check_and_mutate_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("check_and_mutate_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - 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, java.lang.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 check_and_mutate_resultStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public check_and_mutate_resultStandardScheme getScheme() { - return new check_and_mutate_resultStandardScheme(); - } - } - - private static class check_and_mutate_resultStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, check_and_mutate_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 check_and_mutate_response(); - struct.success.read(iprot); - struct.setSuccessIsSet(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, check_and_mutate_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(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class check_and_mutate_resultTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public check_and_mutate_resultTupleScheme getScheme() { - return new check_and_mutate_resultTupleScheme(); - } - } - - private static class check_and_mutate_resultTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, check_and_mutate_result struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, check_and_mutate_result struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new check_and_mutate_response(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } - } - - public static class get_args - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("get_args"); - - private static final org.apache.thrift.protocol.TField KEY_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "key", org.apache.thrift.protocol.TType.STRUCT, (short) 1); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new get_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new get_argsTupleSchemeFactory(); - - public blob key; // 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 { - KEY((short) 1, "key"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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: // KEY - return KEY; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> - metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put( - _Fields.KEY, - new org.apache.thrift.meta_data.FieldMetaData( - "key", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData( - org.apache.thrift.protocol.TType.STRUCT, blob.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(get_args.class, metaDataMap); - } - - public get_args() {} - - public get_args(blob key) { - this(); - this.key = key; - } - - /** Performs a deep copy on other. */ - public get_args(get_args other) { - if (other.isSetKey()) { - this.key = new blob(other.key); - } - } - - public get_args deepCopy() { - return new get_args(this); - } - - @Override - public void clear() { - this.key = null; - } - - public blob getKey() { - return this.key; - } - - public get_args setKey(blob key) { - this.key = key; - return this; - } - - public void unsetKey() { - this.key = null; - } - - /** Returns true if field key is set (has been assigned a value) and false otherwise */ - public boolean isSetKey() { - return this.key != null; - } - - public void setKeyIsSet(boolean value) { - if (!value) { - this.key = null; - } - } - - public void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case KEY: - if (value == null) { - unsetKey(); - } else { - setKey((blob) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case KEY: - return getKey(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case KEY: - return isSetKey(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.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; - if (this == that) return true; - - boolean this_present_key = true && this.isSetKey(); - boolean that_present_key = true && that.isSetKey(); - if (this_present_key || that_present_key) { - if (!(this_present_key && that_present_key)) return false; - if (!this.key.equals(that.key)) return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetKey()) ? 131071 : 524287); - if (isSetKey()) hashCode = hashCode * 8191 + key.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(get_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetKey()).compareTo(other.isSetKey()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetKey()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.key, other.key); - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("get_args("); - boolean first = true; - - sb.append("key:"); - if (this.key == null) { - sb.append("null"); - } else { - sb.append(this.key); - } - 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 (key != null) { - key.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, java.lang.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 org.apache.thrift.scheme.SchemeFactory { - public get_argsStandardScheme getScheme() { - return new get_argsStandardScheme(); - } - } - - private static class get_argsStandardScheme - extends org.apache.thrift.scheme.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: // KEY - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.key = new blob(); - struct.key.read(iprot); - struct.setKeyIsSet(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.key != null) { - oprot.writeFieldBegin(KEY_FIELD_DESC); - struct.key.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class get_argsTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public get_argsTupleScheme getScheme() { - return new get_argsTupleScheme(); - } - } - - private static class get_argsTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, get_args struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetKey()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetKey()) { - struct.key.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, get_args struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.key = new blob(); - struct.key.read(iprot); - struct.setKeyIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } - } - - public static class get_result - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("get_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "success", org.apache.thrift.protocol.TType.STRUCT, (short) 0); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new get_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new get_resultTupleSchemeFactory(); - - public read_response success; // 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"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> - metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.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, read_response.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(get_result.class, metaDataMap); - } - - public get_result() {} - - public get_result(read_response success) { - this(); - this.success = success; - } - - /** Performs a deep copy on other. */ - public get_result(get_result other) { - if (other.isSetSuccess()) { - this.success = new read_response(other.success); - } - } - - public get_result deepCopy() { - return new get_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public read_response getSuccess() { - return this.success; - } - - public get_result setSuccess(read_response 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 void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((read_response) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.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; - if (this == that) return true; - - 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; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) hashCode = hashCode * 8191 + success.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(get_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("get_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - 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, java.lang.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 org.apache.thrift.scheme.SchemeFactory { - public get_resultStandardScheme getScheme() { - return new get_resultStandardScheme(); - } - } - - private static class get_resultStandardScheme - extends org.apache.thrift.scheme.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 read_response(); - struct.success.read(iprot); - struct.setSuccessIsSet(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(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class get_resultTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public get_resultTupleScheme getScheme() { - return new get_resultTupleScheme(); - } - } - - private static class get_resultTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, get_result struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, get_result struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new read_response(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } - } - - public static class multi_get_args - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("multi_get_args"); - - private static final org.apache.thrift.protocol.TField REQUEST_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "request", org.apache.thrift.protocol.TType.STRUCT, (short) 1); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new multi_get_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new multi_get_argsTupleSchemeFactory(); - - public multi_get_request request; // 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 { - REQUEST((short) 1, "request"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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: // REQUEST - return REQUEST; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> - metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put( - _Fields.REQUEST, - new org.apache.thrift.meta_data.FieldMetaData( - "request", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData( - org.apache.thrift.protocol.TType.STRUCT, multi_get_request.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap( - multi_get_args.class, metaDataMap); - } - - public multi_get_args() {} - - public multi_get_args(multi_get_request request) { - this(); - this.request = request; - } - - /** Performs a deep copy on other. */ - public multi_get_args(multi_get_args other) { - if (other.isSetRequest()) { - this.request = new multi_get_request(other.request); - } - } - - public multi_get_args deepCopy() { - return new multi_get_args(this); - } - - @Override - public void clear() { - this.request = null; - } - - public multi_get_request getRequest() { - return this.request; - } - - public multi_get_args setRequest(multi_get_request request) { - this.request = request; - return this; - } - - public void unsetRequest() { - this.request = null; - } - - /** Returns true if field request is set (has been assigned a value) and false otherwise */ - public boolean isSetRequest() { - return this.request != null; - } - - public void setRequestIsSet(boolean value) { - if (!value) { - this.request = null; - } - } - - public void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case REQUEST: - if (value == null) { - unsetRequest(); - } else { - setRequest((multi_get_request) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case REQUEST: - return getRequest(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case REQUEST: - return isSetRequest(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof multi_get_args) return this.equals((multi_get_args) that); - return false; - } - - public boolean equals(multi_get_args that) { - if (that == null) return false; - if (this == that) return true; - - boolean this_present_request = true && this.isSetRequest(); - boolean that_present_request = true && that.isSetRequest(); - if (this_present_request || that_present_request) { - if (!(this_present_request && that_present_request)) return false; - if (!this.request.equals(that.request)) return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetRequest()) ? 131071 : 524287); - if (isSetRequest()) hashCode = hashCode * 8191 + request.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(multi_get_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetRequest()).compareTo(other.isSetRequest()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetRequest()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.request, other.request); - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("multi_get_args("); - boolean first = true; - - sb.append("request:"); - if (this.request == null) { - sb.append("null"); - } else { - sb.append(this.request); - } - 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 (request != null) { - request.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, java.lang.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 multi_get_argsStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public multi_get_argsStandardScheme getScheme() { - return new multi_get_argsStandardScheme(); - } - } - - private static class multi_get_argsStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, multi_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: // REQUEST - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.request = new multi_get_request(); - struct.request.read(iprot); - struct.setRequestIsSet(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, multi_get_args struct) - throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.request != null) { - oprot.writeFieldBegin(REQUEST_FIELD_DESC); - struct.request.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class multi_get_argsTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public multi_get_argsTupleScheme getScheme() { - return new multi_get_argsTupleScheme(); - } - } - - private static class multi_get_argsTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, multi_get_args struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetRequest()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetRequest()) { - struct.request.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, multi_get_args struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.request = new multi_get_request(); - struct.request.read(iprot); - struct.setRequestIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } - } - - public static class multi_get_result - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("multi_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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new multi_get_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new multi_get_resultTupleSchemeFactory(); - - public multi_get_response success; // 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"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> - metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.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, multi_get_response.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap( - multi_get_result.class, metaDataMap); - } - - public multi_get_result() {} - - public multi_get_result(multi_get_response success) { - this(); - this.success = success; - } - - /** Performs a deep copy on other. */ - public multi_get_result(multi_get_result other) { - if (other.isSetSuccess()) { - this.success = new multi_get_response(other.success); - } - } - - public multi_get_result deepCopy() { - return new multi_get_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public multi_get_response getSuccess() { - return this.success; - } - - public multi_get_result setSuccess(multi_get_response 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 void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((multi_get_response) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof multi_get_result) return this.equals((multi_get_result) that); - return false; - } - - public boolean equals(multi_get_result that) { - if (that == null) return false; - if (this == that) return true; - - 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; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) hashCode = hashCode * 8191 + success.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(multi_get_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("multi_get_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - 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, java.lang.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 multi_get_resultStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public multi_get_resultStandardScheme getScheme() { - return new multi_get_resultStandardScheme(); - } - } - - private static class multi_get_resultStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, multi_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 multi_get_response(); - struct.success.read(iprot); - struct.setSuccessIsSet(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, multi_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(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class multi_get_resultTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public multi_get_resultTupleScheme getScheme() { - return new multi_get_resultTupleScheme(); - } - } - - private static class multi_get_resultTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, multi_get_result struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, multi_get_result struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new multi_get_response(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } - } - - public static class batch_get_args - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("batch_get_args"); - - private static final org.apache.thrift.protocol.TField REQUEST_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "request", org.apache.thrift.protocol.TType.STRUCT, (short) 1); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new batch_get_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new batch_get_argsTupleSchemeFactory(); - - public batch_get_request request; // 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 { - REQUEST((short) 1, "request"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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: // REQUEST - return REQUEST; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> - metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put( - _Fields.REQUEST, - new org.apache.thrift.meta_data.FieldMetaData( - "request", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData( - org.apache.thrift.protocol.TType.STRUCT, batch_get_request.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap( - batch_get_args.class, metaDataMap); - } - - public batch_get_args() {} - - public batch_get_args(batch_get_request request) { - this(); - this.request = request; - } - - /** Performs a deep copy on other. */ - public batch_get_args(batch_get_args other) { - if (other.isSetRequest()) { - this.request = new batch_get_request(other.request); - } - } - - public batch_get_args deepCopy() { - return new batch_get_args(this); - } - - @Override - public void clear() { - this.request = null; - } - - public batch_get_request getRequest() { - return this.request; - } - - public batch_get_args setRequest(batch_get_request request) { - this.request = request; - return this; - } - - public void unsetRequest() { - this.request = null; - } - - /** Returns true if field request is set (has been assigned a value) and false otherwise */ - public boolean isSetRequest() { - return this.request != null; - } - - public void setRequestIsSet(boolean value) { - if (!value) { - this.request = null; - } - } - - public void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case REQUEST: - if (value == null) { - unsetRequest(); - } else { - setRequest((batch_get_request) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case REQUEST: - return getRequest(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case REQUEST: - return isSetRequest(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof batch_get_args) return this.equals((batch_get_args) that); - return false; - } - - public boolean equals(batch_get_args that) { - if (that == null) return false; - if (this == that) return true; - - boolean this_present_request = true && this.isSetRequest(); - boolean that_present_request = true && that.isSetRequest(); - if (this_present_request || that_present_request) { - if (!(this_present_request && that_present_request)) return false; - if (!this.request.equals(that.request)) return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetRequest()) ? 131071 : 524287); - if (isSetRequest()) hashCode = hashCode * 8191 + request.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(batch_get_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetRequest()).compareTo(other.isSetRequest()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetRequest()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.request, other.request); - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("batch_get_args("); - boolean first = true; - - sb.append("request:"); - if (this.request == null) { - sb.append("null"); - } else { - sb.append(this.request); - } - 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 (request != null) { - request.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, java.lang.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 batch_get_argsStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public batch_get_argsStandardScheme getScheme() { - return new batch_get_argsStandardScheme(); - } - } - - private static class batch_get_argsStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, batch_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: // REQUEST - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.request = new batch_get_request(); - struct.request.read(iprot); - struct.setRequestIsSet(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, batch_get_args struct) - throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.request != null) { - oprot.writeFieldBegin(REQUEST_FIELD_DESC); - struct.request.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class batch_get_argsTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public batch_get_argsTupleScheme getScheme() { - return new batch_get_argsTupleScheme(); - } - } - - private static class batch_get_argsTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, batch_get_args struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetRequest()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetRequest()) { - struct.request.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, batch_get_args struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.request = new batch_get_request(); - struct.request.read(iprot); - struct.setRequestIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } - } - - public static class batch_get_result - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("batch_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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new batch_get_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new batch_get_resultTupleSchemeFactory(); - - public batch_get_response success; // 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"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> - metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.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, batch_get_response.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap( - batch_get_result.class, metaDataMap); - } - - public batch_get_result() {} - - public batch_get_result(batch_get_response success) { - this(); - this.success = success; - } - - /** Performs a deep copy on other. */ - public batch_get_result(batch_get_result other) { - if (other.isSetSuccess()) { - this.success = new batch_get_response(other.success); - } - } - - public batch_get_result deepCopy() { - return new batch_get_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public batch_get_response getSuccess() { - return this.success; - } - - public batch_get_result setSuccess(batch_get_response 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 void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((batch_get_response) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof batch_get_result) return this.equals((batch_get_result) that); - return false; - } - - public boolean equals(batch_get_result that) { - if (that == null) return false; - if (this == that) return true; - - 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; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) hashCode = hashCode * 8191 + success.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(batch_get_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("batch_get_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - 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, java.lang.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 batch_get_resultStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public batch_get_resultStandardScheme getScheme() { - return new batch_get_resultStandardScheme(); - } - } - - private static class batch_get_resultStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, batch_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 batch_get_response(); - struct.success.read(iprot); - struct.setSuccessIsSet(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, batch_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(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class batch_get_resultTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public batch_get_resultTupleScheme getScheme() { - return new batch_get_resultTupleScheme(); - } - } - - private static class batch_get_resultTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, batch_get_result struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, batch_get_result struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new batch_get_response(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } - } - - public static class sortkey_count_args - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("sortkey_count_args"); - - private static final org.apache.thrift.protocol.TField HASH_KEY_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "hash_key", org.apache.thrift.protocol.TType.STRUCT, (short) 1); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new sortkey_count_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new sortkey_count_argsTupleSchemeFactory(); - - public blob hash_key; // 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 { - HASH_KEY((short) 1, "hash_key"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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: // HASH_KEY - return HASH_KEY; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> - metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put( - _Fields.HASH_KEY, - new org.apache.thrift.meta_data.FieldMetaData( - "hash_key", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData( - org.apache.thrift.protocol.TType.STRUCT, blob.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap( - sortkey_count_args.class, metaDataMap); - } - - public sortkey_count_args() {} - - public sortkey_count_args(blob hash_key) { - this(); - this.hash_key = hash_key; - } - - /** Performs a deep copy on other. */ - public sortkey_count_args(sortkey_count_args other) { - if (other.isSetHash_key()) { - this.hash_key = new blob(other.hash_key); - } - } - - public sortkey_count_args deepCopy() { - return new sortkey_count_args(this); - } - - @Override - public void clear() { - this.hash_key = null; - } - - public blob getHash_key() { - return this.hash_key; - } - - public sortkey_count_args setHash_key(blob hash_key) { - this.hash_key = hash_key; - return this; - } - - public void unsetHash_key() { - this.hash_key = null; - } - - /** Returns true if field hash_key is set (has been assigned a value) and false otherwise */ - public boolean isSetHash_key() { - return this.hash_key != null; - } - - public void setHash_keyIsSet(boolean value) { - if (!value) { - this.hash_key = null; - } - } - - public void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case HASH_KEY: - if (value == null) { - unsetHash_key(); - } else { - setHash_key((blob) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case HASH_KEY: - return getHash_key(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case HASH_KEY: - return isSetHash_key(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof sortkey_count_args) return this.equals((sortkey_count_args) that); - return false; - } - - public boolean equals(sortkey_count_args that) { - if (that == null) return false; - if (this == that) return true; - - boolean this_present_hash_key = true && this.isSetHash_key(); - boolean that_present_hash_key = true && that.isSetHash_key(); - if (this_present_hash_key || that_present_hash_key) { - if (!(this_present_hash_key && that_present_hash_key)) return false; - if (!this.hash_key.equals(that.hash_key)) return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetHash_key()) ? 131071 : 524287); - if (isSetHash_key()) hashCode = hashCode * 8191 + hash_key.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(sortkey_count_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetHash_key()).compareTo(other.isSetHash_key()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetHash_key()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.hash_key, other.hash_key); - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("sortkey_count_args("); - boolean first = true; - - sb.append("hash_key:"); - if (this.hash_key == null) { - sb.append("null"); - } else { - sb.append(this.hash_key); - } - 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 (hash_key != null) { - hash_key.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, java.lang.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 sortkey_count_argsStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public sortkey_count_argsStandardScheme getScheme() { - return new sortkey_count_argsStandardScheme(); - } - } - - private static class sortkey_count_argsStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, sortkey_count_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: // HASH_KEY - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.hash_key = new blob(); - struct.hash_key.read(iprot); - struct.setHash_keyIsSet(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, sortkey_count_args struct) - throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.hash_key != null) { - oprot.writeFieldBegin(HASH_KEY_FIELD_DESC); - struct.hash_key.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class sortkey_count_argsTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public sortkey_count_argsTupleScheme getScheme() { - return new sortkey_count_argsTupleScheme(); - } - } - - private static class sortkey_count_argsTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, sortkey_count_args struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetHash_key()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetHash_key()) { - struct.hash_key.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, sortkey_count_args struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.hash_key = new blob(); - struct.hash_key.read(iprot); - struct.setHash_keyIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } - } - - public static class sortkey_count_result - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("sortkey_count_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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new sortkey_count_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new sortkey_count_resultTupleSchemeFactory(); - - public count_response success; // 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"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> - metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.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, count_response.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap( - sortkey_count_result.class, metaDataMap); - } - - public sortkey_count_result() {} - - public sortkey_count_result(count_response success) { - this(); - this.success = success; - } - - /** Performs a deep copy on other. */ - public sortkey_count_result(sortkey_count_result other) { - if (other.isSetSuccess()) { - this.success = new count_response(other.success); - } - } - - public sortkey_count_result deepCopy() { - return new sortkey_count_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public count_response getSuccess() { - return this.success; - } - - public sortkey_count_result setSuccess(count_response 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 void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((count_response) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof sortkey_count_result) return this.equals((sortkey_count_result) that); - return false; - } - - public boolean equals(sortkey_count_result that) { - if (that == null) return false; - if (this == that) return true; - - 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; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) hashCode = hashCode * 8191 + success.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(sortkey_count_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("sortkey_count_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - 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, java.lang.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 sortkey_count_resultStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public sortkey_count_resultStandardScheme getScheme() { - return new sortkey_count_resultStandardScheme(); - } - } - - private static class sortkey_count_resultStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, sortkey_count_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 count_response(); - struct.success.read(iprot); - struct.setSuccessIsSet(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, sortkey_count_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(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class sortkey_count_resultTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public sortkey_count_resultTupleScheme getScheme() { - return new sortkey_count_resultTupleScheme(); - } - } - - private static class sortkey_count_resultTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, sortkey_count_result struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, sortkey_count_result struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new count_response(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } - } - - public static class ttl_args - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("ttl_args"); - - private static final org.apache.thrift.protocol.TField KEY_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "key", org.apache.thrift.protocol.TType.STRUCT, (short) 1); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new ttl_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new ttl_argsTupleSchemeFactory(); - - public blob key; // 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 { - KEY((short) 1, "key"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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: // KEY - return KEY; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> - metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put( - _Fields.KEY, - new org.apache.thrift.meta_data.FieldMetaData( - "key", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData( - org.apache.thrift.protocol.TType.STRUCT, blob.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ttl_args.class, metaDataMap); - } - - public ttl_args() {} - - public ttl_args(blob key) { - this(); - this.key = key; - } - - /** Performs a deep copy on other. */ - public ttl_args(ttl_args other) { - if (other.isSetKey()) { - this.key = new blob(other.key); - } - } - - public ttl_args deepCopy() { - return new ttl_args(this); - } - - @Override - public void clear() { - this.key = null; - } - - public blob getKey() { - return this.key; - } - - public ttl_args setKey(blob key) { - this.key = key; - return this; - } - - public void unsetKey() { - this.key = null; - } - - /** Returns true if field key is set (has been assigned a value) and false otherwise */ - public boolean isSetKey() { - return this.key != null; - } - - public void setKeyIsSet(boolean value) { - if (!value) { - this.key = null; - } - } - - public void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case KEY: - if (value == null) { - unsetKey(); - } else { - setKey((blob) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case KEY: - return getKey(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case KEY: - return isSetKey(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof ttl_args) return this.equals((ttl_args) that); - return false; - } - - public boolean equals(ttl_args that) { - if (that == null) return false; - if (this == that) return true; - - boolean this_present_key = true && this.isSetKey(); - boolean that_present_key = true && that.isSetKey(); - if (this_present_key || that_present_key) { - if (!(this_present_key && that_present_key)) return false; - if (!this.key.equals(that.key)) return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetKey()) ? 131071 : 524287); - if (isSetKey()) hashCode = hashCode * 8191 + key.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(ttl_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetKey()).compareTo(other.isSetKey()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetKey()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.key, other.key); - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("ttl_args("); - boolean first = true; - - sb.append("key:"); - if (this.key == null) { - sb.append("null"); - } else { - sb.append(this.key); - } - 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 (key != null) { - key.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, java.lang.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 ttl_argsStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public ttl_argsStandardScheme getScheme() { - return new ttl_argsStandardScheme(); - } - } - - private static class ttl_argsStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, ttl_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: // KEY - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.key = new blob(); - struct.key.read(iprot); - struct.setKeyIsSet(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, ttl_args struct) - throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.key != null) { - oprot.writeFieldBegin(KEY_FIELD_DESC); - struct.key.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class ttl_argsTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public ttl_argsTupleScheme getScheme() { - return new ttl_argsTupleScheme(); - } - } - - private static class ttl_argsTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, ttl_args struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetKey()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetKey()) { - struct.key.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, ttl_args struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.key = new blob(); - struct.key.read(iprot); - struct.setKeyIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } - } - - public static class ttl_result - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("ttl_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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new ttl_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new ttl_resultTupleSchemeFactory(); - - public ttl_response success; // 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"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> - metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.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, ttl_response.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ttl_result.class, metaDataMap); - } - - public ttl_result() {} - - public ttl_result(ttl_response success) { - this(); - this.success = success; - } - - /** Performs a deep copy on other. */ - public ttl_result(ttl_result other) { - if (other.isSetSuccess()) { - this.success = new ttl_response(other.success); - } - } - - public ttl_result deepCopy() { - return new ttl_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public ttl_response getSuccess() { - return this.success; - } - - public ttl_result setSuccess(ttl_response 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 void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((ttl_response) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof ttl_result) return this.equals((ttl_result) that); - return false; - } - - public boolean equals(ttl_result that) { - if (that == null) return false; - if (this == that) return true; - - 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; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) hashCode = hashCode * 8191 + success.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(ttl_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("ttl_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - 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, java.lang.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 ttl_resultStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public ttl_resultStandardScheme getScheme() { - return new ttl_resultStandardScheme(); - } - } - - private static class ttl_resultStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, ttl_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 ttl_response(); - struct.success.read(iprot); - struct.setSuccessIsSet(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, ttl_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(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class ttl_resultTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public ttl_resultTupleScheme getScheme() { - return new ttl_resultTupleScheme(); - } - } - - private static class ttl_resultTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, ttl_result struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, ttl_result struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new ttl_response(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } - } - - public static class get_scanner_args - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("get_scanner_args"); - - private static final org.apache.thrift.protocol.TField REQUEST_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "request", org.apache.thrift.protocol.TType.STRUCT, (short) 1); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new get_scanner_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new get_scanner_argsTupleSchemeFactory(); - - public get_scanner_request request; // 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 { - REQUEST((short) 1, "request"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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: // REQUEST - return REQUEST; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> - metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put( - _Fields.REQUEST, - new org.apache.thrift.meta_data.FieldMetaData( - "request", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData( - org.apache.thrift.protocol.TType.STRUCT, get_scanner_request.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap( - get_scanner_args.class, metaDataMap); - } - - public get_scanner_args() {} - - public get_scanner_args(get_scanner_request request) { - this(); - this.request = request; - } - - /** Performs a deep copy on other. */ - public get_scanner_args(get_scanner_args other) { - if (other.isSetRequest()) { - this.request = new get_scanner_request(other.request); - } - } - - public get_scanner_args deepCopy() { - return new get_scanner_args(this); - } - - @Override - public void clear() { - this.request = null; - } - - public get_scanner_request getRequest() { - return this.request; - } - - public get_scanner_args setRequest(get_scanner_request request) { - this.request = request; - return this; - } - - public void unsetRequest() { - this.request = null; - } - - /** Returns true if field request is set (has been assigned a value) and false otherwise */ - public boolean isSetRequest() { - return this.request != null; - } - - public void setRequestIsSet(boolean value) { - if (!value) { - this.request = null; - } - } - - public void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case REQUEST: - if (value == null) { - unsetRequest(); - } else { - setRequest((get_scanner_request) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case REQUEST: - return getRequest(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case REQUEST: - return isSetRequest(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof get_scanner_args) return this.equals((get_scanner_args) that); - return false; - } - - public boolean equals(get_scanner_args that) { - if (that == null) return false; - if (this == that) return true; - - boolean this_present_request = true && this.isSetRequest(); - boolean that_present_request = true && that.isSetRequest(); - if (this_present_request || that_present_request) { - if (!(this_present_request && that_present_request)) return false; - if (!this.request.equals(that.request)) return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetRequest()) ? 131071 : 524287); - if (isSetRequest()) hashCode = hashCode * 8191 + request.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(get_scanner_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetRequest()).compareTo(other.isSetRequest()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetRequest()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.request, other.request); - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("get_scanner_args("); - boolean first = true; - - sb.append("request:"); - if (this.request == null) { - sb.append("null"); - } else { - sb.append(this.request); - } - 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 (request != null) { - request.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, java.lang.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_scanner_argsStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public get_scanner_argsStandardScheme getScheme() { - return new get_scanner_argsStandardScheme(); - } - } - - private static class get_scanner_argsStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, get_scanner_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: // REQUEST - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.request = new get_scanner_request(); - struct.request.read(iprot); - struct.setRequestIsSet(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_scanner_args struct) - throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.request != null) { - oprot.writeFieldBegin(REQUEST_FIELD_DESC); - struct.request.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class get_scanner_argsTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public get_scanner_argsTupleScheme getScheme() { - return new get_scanner_argsTupleScheme(); - } - } - - private static class get_scanner_argsTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, get_scanner_args struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetRequest()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetRequest()) { - struct.request.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, get_scanner_args struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.request = new get_scanner_request(); - struct.request.read(iprot); - struct.setRequestIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } - } - - public static class get_scanner_result - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("get_scanner_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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new get_scanner_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new get_scanner_resultTupleSchemeFactory(); - - public scan_response success; // 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"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> - metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.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, scan_response.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap( - get_scanner_result.class, metaDataMap); - } - - public get_scanner_result() {} - - public get_scanner_result(scan_response success) { - this(); - this.success = success; - } - - /** Performs a deep copy on other. */ - public get_scanner_result(get_scanner_result other) { - if (other.isSetSuccess()) { - this.success = new scan_response(other.success); - } - } - - public get_scanner_result deepCopy() { - return new get_scanner_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public scan_response getSuccess() { - return this.success; - } - - public get_scanner_result setSuccess(scan_response 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 void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((scan_response) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof get_scanner_result) return this.equals((get_scanner_result) that); - return false; - } - - public boolean equals(get_scanner_result that) { - if (that == null) return false; - if (this == that) return true; - - 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; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) hashCode = hashCode * 8191 + success.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(get_scanner_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("get_scanner_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - 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, java.lang.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_scanner_resultStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public get_scanner_resultStandardScheme getScheme() { - return new get_scanner_resultStandardScheme(); - } - } - - private static class get_scanner_resultStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, get_scanner_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 scan_response(); - struct.success.read(iprot); - struct.setSuccessIsSet(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_scanner_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(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class get_scanner_resultTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public get_scanner_resultTupleScheme getScheme() { - return new get_scanner_resultTupleScheme(); - } - } - - private static class get_scanner_resultTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, get_scanner_result struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, get_scanner_result struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new scan_response(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } - } - - public static class scan_args - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("scan_args"); - - private static final org.apache.thrift.protocol.TField REQUEST_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "request", org.apache.thrift.protocol.TType.STRUCT, (short) 1); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new scan_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new scan_argsTupleSchemeFactory(); - - public scan_request request; // 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 { - REQUEST((short) 1, "request"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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: // REQUEST - return REQUEST; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> - metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put( - _Fields.REQUEST, - new org.apache.thrift.meta_data.FieldMetaData( - "request", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData( - org.apache.thrift.protocol.TType.STRUCT, scan_request.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(scan_args.class, metaDataMap); - } - - public scan_args() {} - - public scan_args(scan_request request) { - this(); - this.request = request; - } - - /** Performs a deep copy on other. */ - public scan_args(scan_args other) { - if (other.isSetRequest()) { - this.request = new scan_request(other.request); - } - } - - public scan_args deepCopy() { - return new scan_args(this); - } - - @Override - public void clear() { - this.request = null; - } - - public scan_request getRequest() { - return this.request; - } - - public scan_args setRequest(scan_request request) { - this.request = request; - return this; - } - - public void unsetRequest() { - this.request = null; - } - - /** Returns true if field request is set (has been assigned a value) and false otherwise */ - public boolean isSetRequest() { - return this.request != null; - } - - public void setRequestIsSet(boolean value) { - if (!value) { - this.request = null; - } - } - - public void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case REQUEST: - if (value == null) { - unsetRequest(); - } else { - setRequest((scan_request) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case REQUEST: - return getRequest(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case REQUEST: - return isSetRequest(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof scan_args) return this.equals((scan_args) that); - return false; - } - - public boolean equals(scan_args that) { - if (that == null) return false; - if (this == that) return true; - - boolean this_present_request = true && this.isSetRequest(); - boolean that_present_request = true && that.isSetRequest(); - if (this_present_request || that_present_request) { - if (!(this_present_request && that_present_request)) return false; - if (!this.request.equals(that.request)) return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetRequest()) ? 131071 : 524287); - if (isSetRequest()) hashCode = hashCode * 8191 + request.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(scan_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetRequest()).compareTo(other.isSetRequest()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetRequest()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.request, other.request); - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("scan_args("); - boolean first = true; - - sb.append("request:"); - if (this.request == null) { - sb.append("null"); - } else { - sb.append(this.request); - } - 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 (request != null) { - request.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, java.lang.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 scan_argsStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public scan_argsStandardScheme getScheme() { - return new scan_argsStandardScheme(); - } - } - - private static class scan_argsStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, scan_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: // REQUEST - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.request = new scan_request(); - struct.request.read(iprot); - struct.setRequestIsSet(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, scan_args struct) - throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.request != null) { - oprot.writeFieldBegin(REQUEST_FIELD_DESC); - struct.request.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class scan_argsTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public scan_argsTupleScheme getScheme() { - return new scan_argsTupleScheme(); - } - } - - private static class scan_argsTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, scan_args struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetRequest()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetRequest()) { - struct.request.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, scan_args struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.request = new scan_request(); - struct.request.read(iprot); - struct.setRequestIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } - } - - public static class scan_result - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("scan_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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new scan_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new scan_resultTupleSchemeFactory(); - - public scan_response success; // 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"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> - metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.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, scan_response.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap( - scan_result.class, metaDataMap); - } - - public scan_result() {} - - public scan_result(scan_response success) { - this(); - this.success = success; - } - - /** Performs a deep copy on other. */ - public scan_result(scan_result other) { - if (other.isSetSuccess()) { - this.success = new scan_response(other.success); - } - } - - public scan_result deepCopy() { - return new scan_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public scan_response getSuccess() { - return this.success; - } - - public scan_result setSuccess(scan_response 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 void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((scan_response) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof scan_result) return this.equals((scan_result) that); - return false; - } - - public boolean equals(scan_result that) { - if (that == null) return false; - if (this == that) return true; - - 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; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) hashCode = hashCode * 8191 + success.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(scan_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("scan_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - 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, java.lang.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 scan_resultStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public scan_resultStandardScheme getScheme() { - return new scan_resultStandardScheme(); - } - } - - private static class scan_resultStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, scan_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 scan_response(); - struct.success.read(iprot); - struct.setSuccessIsSet(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, scan_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(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class scan_resultTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public scan_resultTupleScheme getScheme() { - return new scan_resultTupleScheme(); - } - } - - private static class scan_resultTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, scan_result struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, scan_result struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new scan_response(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } - } - - public static class clear_scanner_args - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("clear_scanner_args"); - - private static final org.apache.thrift.protocol.TField CONTEXT_ID_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "context_id", org.apache.thrift.protocol.TType.I64, (short) 1); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new clear_scanner_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new clear_scanner_argsTupleSchemeFactory(); - - public long context_id; // required - - /** - * The set of fields this struct contains, along with convenience methods for finding and - * manipulating them. - */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - CONTEXT_ID((short) 1, "context_id"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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: // CONTEXT_ID - return CONTEXT_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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __CONTEXT_ID_ISSET_ID = 0; - private byte __isset_bitfield = 0; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> - metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put( - _Fields.CONTEXT_ID, - new org.apache.thrift.meta_data.FieldMetaData( - "context_id", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I64))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap( - clear_scanner_args.class, metaDataMap); - } - - public clear_scanner_args() {} - - public clear_scanner_args(long context_id) { - this(); - this.context_id = context_id; - setContext_idIsSet(true); - } - - /** Performs a deep copy on other. */ - public clear_scanner_args(clear_scanner_args other) { - __isset_bitfield = other.__isset_bitfield; - this.context_id = other.context_id; - } - - public clear_scanner_args deepCopy() { - return new clear_scanner_args(this); - } - - @Override - public void clear() { - setContext_idIsSet(false); - this.context_id = 0; - } - - public long getContext_id() { - return this.context_id; - } - - public clear_scanner_args setContext_id(long context_id) { - this.context_id = context_id; - setContext_idIsSet(true); - return this; - } - - public void unsetContext_id() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __CONTEXT_ID_ISSET_ID); - } - - /** Returns true if field context_id is set (has been assigned a value) and false otherwise */ - public boolean isSetContext_id() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __CONTEXT_ID_ISSET_ID); - } - - public void setContext_idIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __CONTEXT_ID_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case CONTEXT_ID: - if (value == null) { - unsetContext_id(); - } else { - setContext_id((java.lang.Long) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case CONTEXT_ID: - return getContext_id(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case CONTEXT_ID: - return isSetContext_id(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof clear_scanner_args) return this.equals((clear_scanner_args) that); - return false; - } - - public boolean equals(clear_scanner_args that) { - if (that == null) return false; - if (this == that) return true; - - boolean this_present_context_id = true; - boolean that_present_context_id = true; - if (this_present_context_id || that_present_context_id) { - if (!(this_present_context_id && that_present_context_id)) return false; - if (this.context_id != that.context_id) return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(context_id); - - return hashCode; - } - - @Override - public int compareTo(clear_scanner_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = - java.lang.Boolean.valueOf(isSetContext_id()).compareTo(other.isSetContext_id()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetContext_id()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.context_id, other.context_id); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) - throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("clear_scanner_args("); - boolean first = true; - - sb.append("context_id:"); - sb.append(this.context_id); - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write( - new org.apache.thrift.protocol.TCompactProtocol( - new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) - throws java.io.IOException, java.lang.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 clear_scanner_argsStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public clear_scanner_argsStandardScheme getScheme() { - return new clear_scanner_argsStandardScheme(); - } - } - - private static class clear_scanner_argsStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, clear_scanner_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: // CONTEXT_ID - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.context_id = iprot.readI64(); - struct.setContext_idIsSet(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, clear_scanner_args struct) - throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(CONTEXT_ID_FIELD_DESC); - oprot.writeI64(struct.context_id); - oprot.writeFieldEnd(); - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class clear_scanner_argsTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public clear_scanner_argsTupleScheme getScheme() { - return new clear_scanner_argsTupleScheme(); - } - } - - private static class clear_scanner_argsTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, clear_scanner_args struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetContext_id()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetContext_id()) { - oprot.writeI64(struct.context_id); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, clear_scanner_args struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.context_id = iprot.readI64(); - struct.setContext_idIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } - } -} diff --git a/java-client/src/main/java/org/apache/pegasus/apps/scan_request.java b/java-client/src/main/java/org/apache/pegasus/apps/scan_request.java deleted file mode 100644 index 19074be48d..0000000000 --- a/java-client/src/main/java/org/apache/pegasus/apps/scan_request.java +++ /dev/null @@ -1,414 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.11.0) - * - *

DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * - * @generated - */ -package org.apache.pegasus.apps; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated( - value = "Autogenerated by Thrift Compiler (0.11.0)", - date = "2020-04-13") -public class scan_request - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("scan_request"); - - private static final org.apache.thrift.protocol.TField CONTEXT_ID_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "context_id", org.apache.thrift.protocol.TType.I64, (short) 1); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new scan_requestStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new scan_requestTupleSchemeFactory(); - - public long context_id; // required - - /** - * The set of fields this struct contains, along with convenience methods for finding and - * manipulating them. - */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - CONTEXT_ID((short) 1, "context_id"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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: // CONTEXT_ID - return CONTEXT_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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __CONTEXT_ID_ISSET_ID = 0; - private byte __isset_bitfield = 0; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put( - _Fields.CONTEXT_ID, - new org.apache.thrift.meta_data.FieldMetaData( - "context_id", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I64))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(scan_request.class, metaDataMap); - } - - public scan_request() {} - - public scan_request(long context_id) { - this(); - this.context_id = context_id; - setContext_idIsSet(true); - } - - /** Performs a deep copy on other. */ - public scan_request(scan_request other) { - __isset_bitfield = other.__isset_bitfield; - this.context_id = other.context_id; - } - - public scan_request deepCopy() { - return new scan_request(this); - } - - @Override - public void clear() { - setContext_idIsSet(false); - this.context_id = 0; - } - - public long getContext_id() { - return this.context_id; - } - - public scan_request setContext_id(long context_id) { - this.context_id = context_id; - setContext_idIsSet(true); - return this; - } - - public void unsetContext_id() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __CONTEXT_ID_ISSET_ID); - } - - /** Returns true if field context_id is set (has been assigned a value) and false otherwise */ - public boolean isSetContext_id() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __CONTEXT_ID_ISSET_ID); - } - - public void setContext_idIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __CONTEXT_ID_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case CONTEXT_ID: - if (value == null) { - unsetContext_id(); - } else { - setContext_id((java.lang.Long) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case CONTEXT_ID: - return getContext_id(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case CONTEXT_ID: - return isSetContext_id(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof scan_request) return this.equals((scan_request) that); - return false; - } - - public boolean equals(scan_request that) { - if (that == null) return false; - if (this == that) return true; - - boolean this_present_context_id = true; - boolean that_present_context_id = true; - if (this_present_context_id || that_present_context_id) { - if (!(this_present_context_id && that_present_context_id)) return false; - if (this.context_id != that.context_id) return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(context_id); - - return hashCode; - } - - @Override - public int compareTo(scan_request other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = - java.lang.Boolean.valueOf(isSetContext_id()).compareTo(other.isSetContext_id()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetContext_id()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.context_id, other.context_id); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("scan_request("); - boolean first = true; - - sb.append("context_id:"); - sb.append(this.context_id); - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write( - new org.apache.thrift.protocol.TCompactProtocol( - new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) - throws java.io.IOException, java.lang.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 scan_requestStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public scan_requestStandardScheme getScheme() { - return new scan_requestStandardScheme(); - } - } - - private static class scan_requestStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, scan_request 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: // CONTEXT_ID - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.context_id = iprot.readI64(); - struct.setContext_idIsSet(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, scan_request struct) - throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(CONTEXT_ID_FIELD_DESC); - oprot.writeI64(struct.context_id); - oprot.writeFieldEnd(); - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class scan_requestTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public scan_requestTupleScheme getScheme() { - return new scan_requestTupleScheme(); - } - } - - private static class scan_requestTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, scan_request struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetContext_id()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetContext_id()) { - oprot.writeI64(struct.context_id); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, scan_request struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.context_id = iprot.readI64(); - struct.setContext_idIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } -} diff --git a/java-client/src/main/java/org/apache/pegasus/apps/scan_response.java b/java-client/src/main/java/org/apache/pegasus/apps/scan_response.java deleted file mode 100644 index c410756ec8..0000000000 --- a/java-client/src/main/java/org/apache/pegasus/apps/scan_response.java +++ /dev/null @@ -1,999 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.11.0) - * - *

DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * - * @generated - */ -package org.apache.pegasus.apps; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated( - value = "Autogenerated by Thrift Compiler (0.11.0)", - date = "2020-04-13") -public class scan_response - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("scan_response"); - - private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "error", org.apache.thrift.protocol.TType.I32, (short) 1); - private static final org.apache.thrift.protocol.TField KVS_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "kvs", org.apache.thrift.protocol.TType.LIST, (short) 2); - private static final org.apache.thrift.protocol.TField CONTEXT_ID_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "context_id", org.apache.thrift.protocol.TType.I64, (short) 3); - private static final org.apache.thrift.protocol.TField APP_ID_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "app_id", org.apache.thrift.protocol.TType.I32, (short) 4); - private static final org.apache.thrift.protocol.TField PARTITION_INDEX_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "partition_index", org.apache.thrift.protocol.TType.I32, (short) 5); - private static final org.apache.thrift.protocol.TField SERVER_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "server", org.apache.thrift.protocol.TType.STRING, (short) 6); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new scan_responseStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new scan_responseTupleSchemeFactory(); - - public int error; // required - public java.util.List kvs; // required - public long context_id; // required - public int app_id; // required - public int partition_index; // required - public java.lang.String server; // 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 { - ERROR((short) 1, "error"), - KVS((short) 2, "kvs"), - CONTEXT_ID((short) 3, "context_id"), - APP_ID((short) 4, "app_id"), - PARTITION_INDEX((short) 5, "partition_index"), - SERVER((short) 6, "server"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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: // ERROR - return ERROR; - case 2: // KVS - return KVS; - case 3: // CONTEXT_ID - return CONTEXT_ID; - case 4: // APP_ID - return APP_ID; - case 5: // PARTITION_INDEX - return PARTITION_INDEX; - case 6: // SERVER - return SERVER; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __ERROR_ISSET_ID = 0; - private static final int __CONTEXT_ID_ISSET_ID = 1; - private static final int __APP_ID_ISSET_ID = 2; - private static final int __PARTITION_INDEX_ISSET_ID = 3; - private byte __isset_bitfield = 0; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put( - _Fields.ERROR, - new org.apache.thrift.meta_data.FieldMetaData( - "error", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I32))); - tmpMap.put( - _Fields.KVS, - new org.apache.thrift.meta_data.FieldMetaData( - "kvs", - 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, key_value.class)))); - tmpMap.put( - _Fields.CONTEXT_ID, - new org.apache.thrift.meta_data.FieldMetaData( - "context_id", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I64))); - tmpMap.put( - _Fields.APP_ID, - new org.apache.thrift.meta_data.FieldMetaData( - "app_id", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I32))); - tmpMap.put( - _Fields.PARTITION_INDEX, - new org.apache.thrift.meta_data.FieldMetaData( - "partition_index", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I32))); - tmpMap.put( - _Fields.SERVER, - new org.apache.thrift.meta_data.FieldMetaData( - "server", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.STRING))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap( - scan_response.class, metaDataMap); - } - - public scan_response() {} - - public scan_response( - int error, - java.util.List kvs, - long context_id, - int app_id, - int partition_index, - java.lang.String server) { - this(); - this.error = error; - setErrorIsSet(true); - this.kvs = kvs; - this.context_id = context_id; - setContext_idIsSet(true); - this.app_id = app_id; - setApp_idIsSet(true); - this.partition_index = partition_index; - setPartition_indexIsSet(true); - this.server = server; - } - - /** Performs a deep copy on other. */ - public scan_response(scan_response other) { - __isset_bitfield = other.__isset_bitfield; - this.error = other.error; - if (other.isSetKvs()) { - java.util.List __this__kvs = new java.util.ArrayList(other.kvs.size()); - for (key_value other_element : other.kvs) { - __this__kvs.add(new key_value(other_element)); - } - this.kvs = __this__kvs; - } - this.context_id = other.context_id; - this.app_id = other.app_id; - this.partition_index = other.partition_index; - if (other.isSetServer()) { - this.server = other.server; - } - } - - public scan_response deepCopy() { - return new scan_response(this); - } - - @Override - public void clear() { - setErrorIsSet(false); - this.error = 0; - this.kvs = null; - setContext_idIsSet(false); - this.context_id = 0; - setApp_idIsSet(false); - this.app_id = 0; - setPartition_indexIsSet(false); - this.partition_index = 0; - this.server = null; - } - - public int getError() { - return this.error; - } - - public scan_response setError(int error) { - this.error = error; - setErrorIsSet(true); - return this; - } - - public void unsetError() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ERROR_ISSET_ID); - } - - /** Returns true if field error is set (has been assigned a value) and false otherwise */ - public boolean isSetError() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ERROR_ISSET_ID); - } - - public void setErrorIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ERROR_ISSET_ID, value); - } - - public int getKvsSize() { - return (this.kvs == null) ? 0 : this.kvs.size(); - } - - public java.util.Iterator getKvsIterator() { - return (this.kvs == null) ? null : this.kvs.iterator(); - } - - public void addToKvs(key_value elem) { - if (this.kvs == null) { - this.kvs = new java.util.ArrayList(); - } - this.kvs.add(elem); - } - - public java.util.List getKvs() { - return this.kvs; - } - - public scan_response setKvs(java.util.List kvs) { - this.kvs = kvs; - return this; - } - - public void unsetKvs() { - this.kvs = null; - } - - /** Returns true if field kvs is set (has been assigned a value) and false otherwise */ - public boolean isSetKvs() { - return this.kvs != null; - } - - public void setKvsIsSet(boolean value) { - if (!value) { - this.kvs = null; - } - } - - public long getContext_id() { - return this.context_id; - } - - public scan_response setContext_id(long context_id) { - this.context_id = context_id; - setContext_idIsSet(true); - return this; - } - - public void unsetContext_id() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __CONTEXT_ID_ISSET_ID); - } - - /** Returns true if field context_id is set (has been assigned a value) and false otherwise */ - public boolean isSetContext_id() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __CONTEXT_ID_ISSET_ID); - } - - public void setContext_idIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __CONTEXT_ID_ISSET_ID, value); - } - - public int getApp_id() { - return this.app_id; - } - - public scan_response setApp_id(int app_id) { - this.app_id = app_id; - setApp_idIsSet(true); - return this; - } - - public void unsetApp_id() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __APP_ID_ISSET_ID); - } - - /** Returns true if field app_id is set (has been assigned a value) and false otherwise */ - public boolean isSetApp_id() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __APP_ID_ISSET_ID); - } - - public void setApp_idIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __APP_ID_ISSET_ID, value); - } - - public int getPartition_index() { - return this.partition_index; - } - - public scan_response setPartition_index(int partition_index) { - this.partition_index = partition_index; - setPartition_indexIsSet(true); - return this; - } - - public void unsetPartition_index() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __PARTITION_INDEX_ISSET_ID); - } - - /** - * Returns true if field partition_index is set (has been assigned a value) and false otherwise - */ - public boolean isSetPartition_index() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __PARTITION_INDEX_ISSET_ID); - } - - public void setPartition_indexIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __PARTITION_INDEX_ISSET_ID, value); - } - - public java.lang.String getServer() { - return this.server; - } - - public scan_response setServer(java.lang.String server) { - this.server = server; - return this; - } - - public void unsetServer() { - this.server = null; - } - - /** Returns true if field server is set (has been assigned a value) and false otherwise */ - public boolean isSetServer() { - return this.server != null; - } - - public void setServerIsSet(boolean value) { - if (!value) { - this.server = null; - } - } - - public void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case ERROR: - if (value == null) { - unsetError(); - } else { - setError((java.lang.Integer) value); - } - break; - - case KVS: - if (value == null) { - unsetKvs(); - } else { - setKvs((java.util.List) value); - } - break; - - case CONTEXT_ID: - if (value == null) { - unsetContext_id(); - } else { - setContext_id((java.lang.Long) value); - } - break; - - case APP_ID: - if (value == null) { - unsetApp_id(); - } else { - setApp_id((java.lang.Integer) value); - } - break; - - case PARTITION_INDEX: - if (value == null) { - unsetPartition_index(); - } else { - setPartition_index((java.lang.Integer) value); - } - break; - - case SERVER: - if (value == null) { - unsetServer(); - } else { - setServer((java.lang.String) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case ERROR: - return getError(); - - case KVS: - return getKvs(); - - case CONTEXT_ID: - return getContext_id(); - - case APP_ID: - return getApp_id(); - - case PARTITION_INDEX: - return getPartition_index(); - - case SERVER: - return getServer(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case ERROR: - return isSetError(); - case KVS: - return isSetKvs(); - case CONTEXT_ID: - return isSetContext_id(); - case APP_ID: - return isSetApp_id(); - case PARTITION_INDEX: - return isSetPartition_index(); - case SERVER: - return isSetServer(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof scan_response) return this.equals((scan_response) that); - return false; - } - - public boolean equals(scan_response that) { - if (that == null) return false; - if (this == that) return true; - - boolean this_present_error = true; - boolean that_present_error = true; - if (this_present_error || that_present_error) { - if (!(this_present_error && that_present_error)) return false; - if (this.error != that.error) return false; - } - - boolean this_present_kvs = true && this.isSetKvs(); - boolean that_present_kvs = true && that.isSetKvs(); - if (this_present_kvs || that_present_kvs) { - if (!(this_present_kvs && that_present_kvs)) return false; - if (!this.kvs.equals(that.kvs)) return false; - } - - boolean this_present_context_id = true; - boolean that_present_context_id = true; - if (this_present_context_id || that_present_context_id) { - if (!(this_present_context_id && that_present_context_id)) return false; - if (this.context_id != that.context_id) return false; - } - - boolean this_present_app_id = true; - boolean that_present_app_id = true; - if (this_present_app_id || that_present_app_id) { - if (!(this_present_app_id && that_present_app_id)) return false; - if (this.app_id != that.app_id) return false; - } - - boolean this_present_partition_index = true; - boolean that_present_partition_index = true; - if (this_present_partition_index || that_present_partition_index) { - if (!(this_present_partition_index && that_present_partition_index)) return false; - if (this.partition_index != that.partition_index) return false; - } - - boolean this_present_server = true && this.isSetServer(); - boolean that_present_server = true && that.isSetServer(); - if (this_present_server || that_present_server) { - if (!(this_present_server && that_present_server)) return false; - if (!this.server.equals(that.server)) return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + error; - - hashCode = hashCode * 8191 + ((isSetKvs()) ? 131071 : 524287); - if (isSetKvs()) hashCode = hashCode * 8191 + kvs.hashCode(); - - hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(context_id); - - hashCode = hashCode * 8191 + app_id; - - hashCode = hashCode * 8191 + partition_index; - - hashCode = hashCode * 8191 + ((isSetServer()) ? 131071 : 524287); - if (isSetServer()) hashCode = hashCode * 8191 + server.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(scan_response other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetError()).compareTo(other.isSetError()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetError()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetKvs()).compareTo(other.isSetKvs()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetKvs()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.kvs, other.kvs); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetContext_id()).compareTo(other.isSetContext_id()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetContext_id()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.context_id, other.context_id); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetApp_id()).compareTo(other.isSetApp_id()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetApp_id()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.app_id, other.app_id); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetPartition_index()).compareTo(other.isSetPartition_index()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetPartition_index()) { - lastComparison = - org.apache.thrift.TBaseHelper.compareTo(this.partition_index, other.partition_index); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetServer()).compareTo(other.isSetServer()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetServer()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.server, other.server); - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("scan_response("); - boolean first = true; - - sb.append("error:"); - sb.append(this.error); - first = false; - if (!first) sb.append(", "); - sb.append("kvs:"); - if (this.kvs == null) { - sb.append("null"); - } else { - sb.append(this.kvs); - } - first = false; - if (!first) sb.append(", "); - sb.append("context_id:"); - sb.append(this.context_id); - first = false; - if (!first) sb.append(", "); - sb.append("app_id:"); - sb.append(this.app_id); - first = false; - if (!first) sb.append(", "); - sb.append("partition_index:"); - sb.append(this.partition_index); - first = false; - if (!first) sb.append(", "); - sb.append("server:"); - if (this.server == null) { - sb.append("null"); - } else { - sb.append(this.server); - } - 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, java.lang.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 scan_responseStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public scan_responseStandardScheme getScheme() { - return new scan_responseStandardScheme(); - } - } - - private static class scan_responseStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, scan_response 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: // ERROR - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.error = iprot.readI32(); - struct.setErrorIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // KVS - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list40 = iprot.readListBegin(); - struct.kvs = new java.util.ArrayList(_list40.size); - key_value _elem41; - for (int _i42 = 0; _i42 < _list40.size; ++_i42) { - _elem41 = new key_value(); - _elem41.read(iprot); - struct.kvs.add(_elem41); - } - iprot.readListEnd(); - } - struct.setKvsIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // CONTEXT_ID - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.context_id = iprot.readI64(); - struct.setContext_idIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // APP_ID - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.app_id = iprot.readI32(); - struct.setApp_idIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 5: // PARTITION_INDEX - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.partition_index = iprot.readI32(); - struct.setPartition_indexIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 6: // SERVER - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.server = iprot.readString(); - struct.setServerIsSet(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, scan_response struct) - throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(ERROR_FIELD_DESC); - oprot.writeI32(struct.error); - oprot.writeFieldEnd(); - if (struct.kvs != null) { - oprot.writeFieldBegin(KVS_FIELD_DESC); - { - oprot.writeListBegin( - new org.apache.thrift.protocol.TList( - org.apache.thrift.protocol.TType.STRUCT, struct.kvs.size())); - for (key_value _iter43 : struct.kvs) { - _iter43.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(CONTEXT_ID_FIELD_DESC); - oprot.writeI64(struct.context_id); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(APP_ID_FIELD_DESC); - oprot.writeI32(struct.app_id); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(PARTITION_INDEX_FIELD_DESC); - oprot.writeI32(struct.partition_index); - oprot.writeFieldEnd(); - if (struct.server != null) { - oprot.writeFieldBegin(SERVER_FIELD_DESC); - oprot.writeString(struct.server); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class scan_responseTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public scan_responseTupleScheme getScheme() { - return new scan_responseTupleScheme(); - } - } - - private static class scan_responseTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, scan_response struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetError()) { - optionals.set(0); - } - if (struct.isSetKvs()) { - optionals.set(1); - } - if (struct.isSetContext_id()) { - optionals.set(2); - } - if (struct.isSetApp_id()) { - optionals.set(3); - } - if (struct.isSetPartition_index()) { - optionals.set(4); - } - if (struct.isSetServer()) { - optionals.set(5); - } - oprot.writeBitSet(optionals, 6); - if (struct.isSetError()) { - oprot.writeI32(struct.error); - } - if (struct.isSetKvs()) { - { - oprot.writeI32(struct.kvs.size()); - for (key_value _iter44 : struct.kvs) { - _iter44.write(oprot); - } - } - } - if (struct.isSetContext_id()) { - oprot.writeI64(struct.context_id); - } - if (struct.isSetApp_id()) { - oprot.writeI32(struct.app_id); - } - if (struct.isSetPartition_index()) { - oprot.writeI32(struct.partition_index); - } - if (struct.isSetServer()) { - oprot.writeString(struct.server); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, scan_response struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(6); - if (incoming.get(0)) { - struct.error = iprot.readI32(); - struct.setErrorIsSet(true); - } - if (incoming.get(1)) { - { - org.apache.thrift.protocol.TList _list45 = - new org.apache.thrift.protocol.TList( - org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.kvs = new java.util.ArrayList(_list45.size); - key_value _elem46; - for (int _i47 = 0; _i47 < _list45.size; ++_i47) { - _elem46 = new key_value(); - _elem46.read(iprot); - struct.kvs.add(_elem46); - } - } - struct.setKvsIsSet(true); - } - if (incoming.get(2)) { - struct.context_id = iprot.readI64(); - struct.setContext_idIsSet(true); - } - if (incoming.get(3)) { - struct.app_id = iprot.readI32(); - struct.setApp_idIsSet(true); - } - if (incoming.get(4)) { - struct.partition_index = iprot.readI32(); - struct.setPartition_indexIsSet(true); - } - if (incoming.get(5)) { - struct.server = iprot.readString(); - struct.setServerIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } -} diff --git a/java-client/src/main/java/org/apache/pegasus/apps/security.java b/java-client/src/main/java/org/apache/pegasus/apps/security.java deleted file mode 100644 index 27350c05b6..0000000000 --- a/java-client/src/main/java/org/apache/pegasus/apps/security.java +++ /dev/null @@ -1,1133 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.11.0) - * - *

DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * - * @generated - */ -package org.apache.pegasus.apps; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated( - value = "Autogenerated by Thrift Compiler (0.11.0)", - date = "2020-09-14") -public class security { - - public interface Iface { - - public negotiation_response negotiate(negotiation_request request) - throws org.apache.thrift.TException; - } - - public interface AsyncIface { - - public void negotiate( - negotiation_request request, - 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 negotiation_response negotiate(negotiation_request request) - throws org.apache.thrift.TException { - send_negotiate(request); - return recv_negotiate(); - } - - public void send_negotiate(negotiation_request request) throws org.apache.thrift.TException { - negotiate_args args = new negotiate_args(); - args.setRequest(request); - sendBase("negotiate", args); - } - - public negotiation_response recv_negotiate() throws org.apache.thrift.TException { - negotiate_result result = new negotiate_result(); - receiveBase(result, "negotiate"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException( - org.apache.thrift.TApplicationException.MISSING_RESULT, - "negotiate failed: unknown result"); - } - } - - public static class AsyncClient extends org.apache.thrift.async.TAsyncClient - implements AsyncIface { - public static class Factory - implements org.apache.thrift.async.TAsyncClientFactory { - private org.apache.thrift.async.TAsyncClientManager clientManager; - private org.apache.thrift.protocol.TProtocolFactory protocolFactory; - - public Factory( - org.apache.thrift.async.TAsyncClientManager clientManager, - org.apache.thrift.protocol.TProtocolFactory protocolFactory) { - this.clientManager = clientManager; - this.protocolFactory = protocolFactory; - } - - public AsyncClient getAsyncClient( - org.apache.thrift.transport.TNonblockingTransport transport) { - return new AsyncClient(protocolFactory, clientManager, transport); - } - } - - public AsyncClient( - org.apache.thrift.protocol.TProtocolFactory protocolFactory, - org.apache.thrift.async.TAsyncClientManager clientManager, - org.apache.thrift.transport.TNonblockingTransport transport) { - super(protocolFactory, clientManager, transport); - } - - public void negotiate( - negotiation_request request, - org.apache.thrift.async.AsyncMethodCallback resultHandler) - throws org.apache.thrift.TException { - checkReady(); - negotiate_call method_call = - new negotiate_call(request, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class negotiate_call - extends org.apache.thrift.async.TAsyncMethodCall { - private negotiation_request request; - - public negotiate_call( - negotiation_request request, - 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.request = request; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) - throws org.apache.thrift.TException { - prot.writeMessageBegin( - new org.apache.thrift.protocol.TMessage( - "negotiate", org.apache.thrift.protocol.TMessageType.CALL, 0)); - negotiate_args args = new negotiate_args(); - args.setRequest(request); - args.write(prot); - prot.writeMessageEnd(); - } - - public negotiation_response getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.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_negotiate(); - } - } - } - - public static class Processor extends org.apache.thrift.TBaseProcessor - implements org.apache.thrift.TProcessor { - private static final org.slf4j.Logger _LOGGER = - org.slf4j.LoggerFactory.getLogger(Processor.class.getName()); - - public Processor(I iface) { - super( - iface, - getProcessMap( - new java.util.HashMap< - java.lang.String, - org.apache.thrift.ProcessFunction>())); - } - - protected Processor( - I iface, - java.util.Map< - java.lang.String, - org.apache.thrift.ProcessFunction> - processMap) { - super(iface, getProcessMap(processMap)); - } - - private static - java.util.Map< - java.lang.String, - org.apache.thrift.ProcessFunction> - getProcessMap( - java.util.Map< - java.lang.String, - org.apache.thrift.ProcessFunction> - processMap) { - processMap.put("negotiate", new negotiate()); - return processMap; - } - - public static class negotiate - extends org.apache.thrift.ProcessFunction { - public negotiate() { - super("negotiate"); - } - - public negotiate_args getEmptyArgsInstance() { - return new negotiate_args(); - } - - protected boolean isOneway() { - return false; - } - - @Override - protected boolean handleRuntimeExceptions() { - return false; - } - - public negotiate_result getResult(I iface, negotiate_args args) - throws org.apache.thrift.TException { - negotiate_result result = new negotiate_result(); - result.success = iface.negotiate(args.request); - return result; - } - } - } - - public static class AsyncProcessor - extends org.apache.thrift.TBaseAsyncProcessor { - private static final org.slf4j.Logger _LOGGER = - org.slf4j.LoggerFactory.getLogger(AsyncProcessor.class.getName()); - - public AsyncProcessor(I iface) { - super( - iface, - getProcessMap( - new java.util.HashMap< - java.lang.String, - org.apache.thrift.AsyncProcessFunction< - I, ? extends org.apache.thrift.TBase, ?>>())); - } - - protected AsyncProcessor( - I iface, - java.util.Map< - java.lang.String, - org.apache.thrift.AsyncProcessFunction> - processMap) { - super(iface, getProcessMap(processMap)); - } - - private static - java.util.Map< - java.lang.String, - org.apache.thrift.AsyncProcessFunction> - getProcessMap( - java.util.Map< - java.lang.String, - org.apache.thrift.AsyncProcessFunction< - I, ? extends org.apache.thrift.TBase, ?>> - processMap) { - processMap.put("negotiate", new negotiate()); - return processMap; - } - - public static class negotiate - extends org.apache.thrift.AsyncProcessFunction { - public negotiate() { - super("negotiate"); - } - - public negotiate_args getEmptyArgsInstance() { - return new negotiate_args(); - } - - public org.apache.thrift.async.AsyncMethodCallback getResultHandler( - final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, - final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback() { - public void onComplete(negotiation_response o) { - negotiate_result result = new negotiate_result(); - result.success = o; - try { - fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY, seqid); - } catch (org.apache.thrift.transport.TTransportException e) { - _LOGGER.error("TTransportException writing to internal frame buffer", e); - fb.close(); - } catch (java.lang.Exception e) { - _LOGGER.error("Exception writing to internal frame buffer", e); - onError(e); - } - } - - public void onError(java.lang.Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; - negotiate_result result = new negotiate_result(); - if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - return; - } else if (e instanceof org.apache.thrift.TApplicationException) { - _LOGGER.error("TApplicationException inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException) e; - } else { - _LOGGER.error("Exception inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = - new org.apache.thrift.TApplicationException( - org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb, msg, msgType, seqid); - } catch (java.lang.Exception ex) { - _LOGGER.error("Exception writing to internal frame buffer", ex); - fb.close(); - } - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start( - I iface, - negotiate_args args, - org.apache.thrift.async.AsyncMethodCallback resultHandler) - throws org.apache.thrift.TException { - iface.negotiate(args.request, resultHandler); - } - } - } - - public static class negotiate_args - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("negotiate_args"); - - private static final org.apache.thrift.protocol.TField REQUEST_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "request", org.apache.thrift.protocol.TType.STRUCT, (short) 1); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new negotiate_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new negotiate_argsTupleSchemeFactory(); - - public negotiation_request request; // 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 { - REQUEST((short) 1, "request"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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: // REQUEST - return REQUEST; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> - metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put( - _Fields.REQUEST, - new org.apache.thrift.meta_data.FieldMetaData( - "request", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData( - org.apache.thrift.protocol.TType.STRUCT, negotiation_request.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap( - negotiate_args.class, metaDataMap); - } - - public negotiate_args() {} - - public negotiate_args(negotiation_request request) { - this(); - this.request = request; - } - - /** Performs a deep copy on other. */ - public negotiate_args(negotiate_args other) { - if (other.isSetRequest()) { - this.request = new negotiation_request(other.request); - } - } - - public negotiate_args deepCopy() { - return new negotiate_args(this); - } - - @Override - public void clear() { - this.request = null; - } - - public negotiation_request getRequest() { - return this.request; - } - - public negotiate_args setRequest(negotiation_request request) { - this.request = request; - return this; - } - - public void unsetRequest() { - this.request = null; - } - - /** Returns true if field request is set (has been assigned a value) and false otherwise */ - public boolean isSetRequest() { - return this.request != null; - } - - public void setRequestIsSet(boolean value) { - if (!value) { - this.request = null; - } - } - - public void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case REQUEST: - if (value == null) { - unsetRequest(); - } else { - setRequest((negotiation_request) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case REQUEST: - return getRequest(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case REQUEST: - return isSetRequest(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof negotiate_args) return this.equals((negotiate_args) that); - return false; - } - - public boolean equals(negotiate_args that) { - if (that == null) return false; - if (this == that) return true; - - boolean this_present_request = true && this.isSetRequest(); - boolean that_present_request = true && that.isSetRequest(); - if (this_present_request || that_present_request) { - if (!(this_present_request && that_present_request)) return false; - if (!this.request.equals(that.request)) return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetRequest()) ? 131071 : 524287); - if (isSetRequest()) hashCode = hashCode * 8191 + request.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(negotiate_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetRequest()).compareTo(other.isSetRequest()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetRequest()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.request, other.request); - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("negotiate_args("); - boolean first = true; - - sb.append("request:"); - if (this.request == null) { - sb.append("null"); - } else { - sb.append(this.request); - } - 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 (request != null) { - request.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, java.lang.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 negotiate_argsStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public negotiate_argsStandardScheme getScheme() { - return new negotiate_argsStandardScheme(); - } - } - - private static class negotiate_argsStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, negotiate_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: // REQUEST - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.request = new negotiation_request(); - struct.request.read(iprot); - struct.setRequestIsSet(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, negotiate_args struct) - throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.request != null) { - oprot.writeFieldBegin(REQUEST_FIELD_DESC); - struct.request.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class negotiate_argsTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public negotiate_argsTupleScheme getScheme() { - return new negotiate_argsTupleScheme(); - } - } - - private static class negotiate_argsTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, negotiate_args struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetRequest()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetRequest()) { - struct.request.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, negotiate_args struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.request = new negotiation_request(); - struct.request.read(iprot); - struct.setRequestIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } - } - - public static class negotiate_result - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("negotiate_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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new negotiate_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new negotiate_resultTupleSchemeFactory(); - - public negotiation_response success; // 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"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> - metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.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, negotiation_response.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap( - negotiate_result.class, metaDataMap); - } - - public negotiate_result() {} - - public negotiate_result(negotiation_response success) { - this(); - this.success = success; - } - - /** Performs a deep copy on other. */ - public negotiate_result(negotiate_result other) { - if (other.isSetSuccess()) { - this.success = new negotiation_response(other.success); - } - } - - public negotiate_result deepCopy() { - return new negotiate_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public negotiation_response getSuccess() { - return this.success; - } - - public negotiate_result setSuccess(negotiation_response 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 void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((negotiation_response) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof negotiate_result) return this.equals((negotiate_result) that); - return false; - } - - public boolean equals(negotiate_result that) { - if (that == null) return false; - if (this == that) return true; - - 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; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) hashCode = hashCode * 8191 + success.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(negotiate_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("negotiate_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - 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, java.lang.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 negotiate_resultStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public negotiate_resultStandardScheme getScheme() { - return new negotiate_resultStandardScheme(); - } - } - - private static class negotiate_resultStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, negotiate_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 negotiation_response(); - struct.success.read(iprot); - struct.setSuccessIsSet(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, negotiate_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(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class negotiate_resultTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public negotiate_resultTupleScheme getScheme() { - return new negotiate_resultTupleScheme(); - } - } - - private static class negotiate_resultTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, negotiate_result struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, negotiate_result struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new negotiation_response(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } - } -} diff --git a/java-client/src/main/java/org/apache/pegasus/apps/ttl_response.java b/java-client/src/main/java/org/apache/pegasus/apps/ttl_response.java deleted file mode 100644 index ca631ed320..0000000000 --- a/java-client/src/main/java/org/apache/pegasus/apps/ttl_response.java +++ /dev/null @@ -1,831 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.11.0) - * - *

DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * - * @generated - */ -package org.apache.pegasus.apps; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated( - value = "Autogenerated by Thrift Compiler (0.11.0)", - date = "2020-04-13") -public class ttl_response - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("ttl_response"); - - private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "error", org.apache.thrift.protocol.TType.I32, (short) 1); - private static final org.apache.thrift.protocol.TField TTL_SECONDS_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "ttl_seconds", org.apache.thrift.protocol.TType.I32, (short) 2); - private static final org.apache.thrift.protocol.TField APP_ID_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "app_id", org.apache.thrift.protocol.TType.I32, (short) 3); - private static final org.apache.thrift.protocol.TField PARTITION_INDEX_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "partition_index", org.apache.thrift.protocol.TType.I32, (short) 4); - private static final org.apache.thrift.protocol.TField SERVER_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "server", org.apache.thrift.protocol.TType.STRING, (short) 6); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new ttl_responseStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new ttl_responseTupleSchemeFactory(); - - public int error; // required - public int ttl_seconds; // required - public int app_id; // required - public int partition_index; // required - public java.lang.String server; // 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 { - ERROR((short) 1, "error"), - TTL_SECONDS((short) 2, "ttl_seconds"), - APP_ID((short) 3, "app_id"), - PARTITION_INDEX((short) 4, "partition_index"), - SERVER((short) 6, "server"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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: // ERROR - return ERROR; - case 2: // TTL_SECONDS - return TTL_SECONDS; - case 3: // APP_ID - return APP_ID; - case 4: // PARTITION_INDEX - return PARTITION_INDEX; - case 6: // SERVER - return SERVER; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __ERROR_ISSET_ID = 0; - private static final int __TTL_SECONDS_ISSET_ID = 1; - private static final int __APP_ID_ISSET_ID = 2; - private static final int __PARTITION_INDEX_ISSET_ID = 3; - private byte __isset_bitfield = 0; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put( - _Fields.ERROR, - new org.apache.thrift.meta_data.FieldMetaData( - "error", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I32))); - tmpMap.put( - _Fields.TTL_SECONDS, - new org.apache.thrift.meta_data.FieldMetaData( - "ttl_seconds", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I32))); - tmpMap.put( - _Fields.APP_ID, - new org.apache.thrift.meta_data.FieldMetaData( - "app_id", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I32))); - tmpMap.put( - _Fields.PARTITION_INDEX, - new org.apache.thrift.meta_data.FieldMetaData( - "partition_index", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I32))); - tmpMap.put( - _Fields.SERVER, - new org.apache.thrift.meta_data.FieldMetaData( - "server", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.STRING))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ttl_response.class, metaDataMap); - } - - public ttl_response() {} - - public ttl_response( - int error, int ttl_seconds, int app_id, int partition_index, java.lang.String server) { - this(); - this.error = error; - setErrorIsSet(true); - this.ttl_seconds = ttl_seconds; - setTtl_secondsIsSet(true); - this.app_id = app_id; - setApp_idIsSet(true); - this.partition_index = partition_index; - setPartition_indexIsSet(true); - this.server = server; - } - - /** Performs a deep copy on other. */ - public ttl_response(ttl_response other) { - __isset_bitfield = other.__isset_bitfield; - this.error = other.error; - this.ttl_seconds = other.ttl_seconds; - this.app_id = other.app_id; - this.partition_index = other.partition_index; - if (other.isSetServer()) { - this.server = other.server; - } - } - - public ttl_response deepCopy() { - return new ttl_response(this); - } - - @Override - public void clear() { - setErrorIsSet(false); - this.error = 0; - setTtl_secondsIsSet(false); - this.ttl_seconds = 0; - setApp_idIsSet(false); - this.app_id = 0; - setPartition_indexIsSet(false); - this.partition_index = 0; - this.server = null; - } - - public int getError() { - return this.error; - } - - public ttl_response setError(int error) { - this.error = error; - setErrorIsSet(true); - return this; - } - - public void unsetError() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ERROR_ISSET_ID); - } - - /** Returns true if field error is set (has been assigned a value) and false otherwise */ - public boolean isSetError() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ERROR_ISSET_ID); - } - - public void setErrorIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ERROR_ISSET_ID, value); - } - - public int getTtl_seconds() { - return this.ttl_seconds; - } - - public ttl_response setTtl_seconds(int ttl_seconds) { - this.ttl_seconds = ttl_seconds; - setTtl_secondsIsSet(true); - return this; - } - - public void unsetTtl_seconds() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __TTL_SECONDS_ISSET_ID); - } - - /** Returns true if field ttl_seconds is set (has been assigned a value) and false otherwise */ - public boolean isSetTtl_seconds() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __TTL_SECONDS_ISSET_ID); - } - - public void setTtl_secondsIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __TTL_SECONDS_ISSET_ID, value); - } - - public int getApp_id() { - return this.app_id; - } - - public ttl_response setApp_id(int app_id) { - this.app_id = app_id; - setApp_idIsSet(true); - return this; - } - - public void unsetApp_id() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __APP_ID_ISSET_ID); - } - - /** Returns true if field app_id is set (has been assigned a value) and false otherwise */ - public boolean isSetApp_id() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __APP_ID_ISSET_ID); - } - - public void setApp_idIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __APP_ID_ISSET_ID, value); - } - - public int getPartition_index() { - return this.partition_index; - } - - public ttl_response setPartition_index(int partition_index) { - this.partition_index = partition_index; - setPartition_indexIsSet(true); - return this; - } - - public void unsetPartition_index() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __PARTITION_INDEX_ISSET_ID); - } - - /** - * Returns true if field partition_index is set (has been assigned a value) and false otherwise - */ - public boolean isSetPartition_index() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __PARTITION_INDEX_ISSET_ID); - } - - public void setPartition_indexIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __PARTITION_INDEX_ISSET_ID, value); - } - - public java.lang.String getServer() { - return this.server; - } - - public ttl_response setServer(java.lang.String server) { - this.server = server; - return this; - } - - public void unsetServer() { - this.server = null; - } - - /** Returns true if field server is set (has been assigned a value) and false otherwise */ - public boolean isSetServer() { - return this.server != null; - } - - public void setServerIsSet(boolean value) { - if (!value) { - this.server = null; - } - } - - public void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case ERROR: - if (value == null) { - unsetError(); - } else { - setError((java.lang.Integer) value); - } - break; - - case TTL_SECONDS: - if (value == null) { - unsetTtl_seconds(); - } else { - setTtl_seconds((java.lang.Integer) value); - } - break; - - case APP_ID: - if (value == null) { - unsetApp_id(); - } else { - setApp_id((java.lang.Integer) value); - } - break; - - case PARTITION_INDEX: - if (value == null) { - unsetPartition_index(); - } else { - setPartition_index((java.lang.Integer) value); - } - break; - - case SERVER: - if (value == null) { - unsetServer(); - } else { - setServer((java.lang.String) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case ERROR: - return getError(); - - case TTL_SECONDS: - return getTtl_seconds(); - - case APP_ID: - return getApp_id(); - - case PARTITION_INDEX: - return getPartition_index(); - - case SERVER: - return getServer(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case ERROR: - return isSetError(); - case TTL_SECONDS: - return isSetTtl_seconds(); - case APP_ID: - return isSetApp_id(); - case PARTITION_INDEX: - return isSetPartition_index(); - case SERVER: - return isSetServer(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof ttl_response) return this.equals((ttl_response) that); - return false; - } - - public boolean equals(ttl_response that) { - if (that == null) return false; - if (this == that) return true; - - boolean this_present_error = true; - boolean that_present_error = true; - if (this_present_error || that_present_error) { - if (!(this_present_error && that_present_error)) return false; - if (this.error != that.error) return false; - } - - boolean this_present_ttl_seconds = true; - boolean that_present_ttl_seconds = true; - if (this_present_ttl_seconds || that_present_ttl_seconds) { - if (!(this_present_ttl_seconds && that_present_ttl_seconds)) return false; - if (this.ttl_seconds != that.ttl_seconds) return false; - } - - boolean this_present_app_id = true; - boolean that_present_app_id = true; - if (this_present_app_id || that_present_app_id) { - if (!(this_present_app_id && that_present_app_id)) return false; - if (this.app_id != that.app_id) return false; - } - - boolean this_present_partition_index = true; - boolean that_present_partition_index = true; - if (this_present_partition_index || that_present_partition_index) { - if (!(this_present_partition_index && that_present_partition_index)) return false; - if (this.partition_index != that.partition_index) return false; - } - - boolean this_present_server = true && this.isSetServer(); - boolean that_present_server = true && that.isSetServer(); - if (this_present_server || that_present_server) { - if (!(this_present_server && that_present_server)) return false; - if (!this.server.equals(that.server)) return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + error; - - hashCode = hashCode * 8191 + ttl_seconds; - - hashCode = hashCode * 8191 + app_id; - - hashCode = hashCode * 8191 + partition_index; - - hashCode = hashCode * 8191 + ((isSetServer()) ? 131071 : 524287); - if (isSetServer()) hashCode = hashCode * 8191 + server.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(ttl_response other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetError()).compareTo(other.isSetError()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetError()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetTtl_seconds()).compareTo(other.isSetTtl_seconds()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetTtl_seconds()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ttl_seconds, other.ttl_seconds); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetApp_id()).compareTo(other.isSetApp_id()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetApp_id()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.app_id, other.app_id); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetPartition_index()).compareTo(other.isSetPartition_index()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetPartition_index()) { - lastComparison = - org.apache.thrift.TBaseHelper.compareTo(this.partition_index, other.partition_index); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetServer()).compareTo(other.isSetServer()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetServer()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.server, other.server); - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("ttl_response("); - boolean first = true; - - sb.append("error:"); - sb.append(this.error); - first = false; - if (!first) sb.append(", "); - sb.append("ttl_seconds:"); - sb.append(this.ttl_seconds); - first = false; - if (!first) sb.append(", "); - sb.append("app_id:"); - sb.append(this.app_id); - first = false; - if (!first) sb.append(", "); - sb.append("partition_index:"); - sb.append(this.partition_index); - first = false; - if (!first) sb.append(", "); - sb.append("server:"); - if (this.server == null) { - sb.append("null"); - } else { - sb.append(this.server); - } - 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, java.lang.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 ttl_responseStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public ttl_responseStandardScheme getScheme() { - return new ttl_responseStandardScheme(); - } - } - - private static class ttl_responseStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, ttl_response 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: // ERROR - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.error = iprot.readI32(); - struct.setErrorIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // TTL_SECONDS - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.ttl_seconds = iprot.readI32(); - struct.setTtl_secondsIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // APP_ID - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.app_id = iprot.readI32(); - struct.setApp_idIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // PARTITION_INDEX - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.partition_index = iprot.readI32(); - struct.setPartition_indexIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 6: // SERVER - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.server = iprot.readString(); - struct.setServerIsSet(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, ttl_response struct) - throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(ERROR_FIELD_DESC); - oprot.writeI32(struct.error); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(TTL_SECONDS_FIELD_DESC); - oprot.writeI32(struct.ttl_seconds); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(APP_ID_FIELD_DESC); - oprot.writeI32(struct.app_id); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(PARTITION_INDEX_FIELD_DESC); - oprot.writeI32(struct.partition_index); - oprot.writeFieldEnd(); - if (struct.server != null) { - oprot.writeFieldBegin(SERVER_FIELD_DESC); - oprot.writeString(struct.server); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class ttl_responseTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public ttl_responseTupleScheme getScheme() { - return new ttl_responseTupleScheme(); - } - } - - private static class ttl_responseTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, ttl_response struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetError()) { - optionals.set(0); - } - if (struct.isSetTtl_seconds()) { - optionals.set(1); - } - if (struct.isSetApp_id()) { - optionals.set(2); - } - if (struct.isSetPartition_index()) { - optionals.set(3); - } - if (struct.isSetServer()) { - optionals.set(4); - } - oprot.writeBitSet(optionals, 5); - if (struct.isSetError()) { - oprot.writeI32(struct.error); - } - if (struct.isSetTtl_seconds()) { - oprot.writeI32(struct.ttl_seconds); - } - if (struct.isSetApp_id()) { - oprot.writeI32(struct.app_id); - } - if (struct.isSetPartition_index()) { - oprot.writeI32(struct.partition_index); - } - if (struct.isSetServer()) { - oprot.writeString(struct.server); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, ttl_response struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(5); - if (incoming.get(0)) { - struct.error = iprot.readI32(); - struct.setErrorIsSet(true); - } - if (incoming.get(1)) { - struct.ttl_seconds = iprot.readI32(); - struct.setTtl_secondsIsSet(true); - } - if (incoming.get(2)) { - struct.app_id = iprot.readI32(); - struct.setApp_idIsSet(true); - } - if (incoming.get(3)) { - struct.partition_index = iprot.readI32(); - struct.setPartition_indexIsSet(true); - } - if (incoming.get(4)) { - struct.server = iprot.readString(); - struct.setServerIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } -} diff --git a/java-client/src/main/java/org/apache/pegasus/apps/update_request.java b/java-client/src/main/java/org/apache/pegasus/apps/update_request.java deleted file mode 100644 index 70758b5e12..0000000000 --- a/java-client/src/main/java/org/apache/pegasus/apps/update_request.java +++ /dev/null @@ -1,646 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.11.0) - * - *

DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * - * @generated - */ -package org.apache.pegasus.apps; - -import org.apache.pegasus.base.blob; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated( - value = "Autogenerated by Thrift Compiler (0.11.0)", - date = "2020-04-13") -public class update_request - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("update_request"); - - private static final org.apache.thrift.protocol.TField KEY_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "key", org.apache.thrift.protocol.TType.STRUCT, (short) 1); - private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "value", org.apache.thrift.protocol.TType.STRUCT, (short) 2); - private static final org.apache.thrift.protocol.TField EXPIRE_TS_SECONDS_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "expire_ts_seconds", org.apache.thrift.protocol.TType.I32, (short) 3); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new update_requestStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new update_requestTupleSchemeFactory(); - - public blob key; // required - public blob value; // required - public int expire_ts_seconds; // 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 { - KEY((short) 1, "key"), - VALUE((short) 2, "value"), - EXPIRE_TS_SECONDS((short) 3, "expire_ts_seconds"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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: // KEY - return KEY; - case 2: // VALUE - return VALUE; - case 3: // EXPIRE_TS_SECONDS - return EXPIRE_TS_SECONDS; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __EXPIRE_TS_SECONDS_ISSET_ID = 0; - private byte __isset_bitfield = 0; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put( - _Fields.KEY, - new org.apache.thrift.meta_data.FieldMetaData( - "key", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData( - org.apache.thrift.protocol.TType.STRUCT, blob.class))); - tmpMap.put( - _Fields.VALUE, - new org.apache.thrift.meta_data.FieldMetaData( - "value", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData( - org.apache.thrift.protocol.TType.STRUCT, blob.class))); - tmpMap.put( - _Fields.EXPIRE_TS_SECONDS, - new org.apache.thrift.meta_data.FieldMetaData( - "expire_ts_seconds", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I32))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap( - update_request.class, metaDataMap); - } - - public update_request() {} - - public update_request(blob key, blob value, int expire_ts_seconds) { - this(); - this.key = key; - this.value = value; - this.expire_ts_seconds = expire_ts_seconds; - setExpire_ts_secondsIsSet(true); - } - - /** Performs a deep copy on other. */ - public update_request(update_request other) { - __isset_bitfield = other.__isset_bitfield; - if (other.isSetKey()) { - this.key = new blob(other.key); - } - if (other.isSetValue()) { - this.value = new blob(other.value); - } - this.expire_ts_seconds = other.expire_ts_seconds; - } - - public update_request deepCopy() { - return new update_request(this); - } - - @Override - public void clear() { - this.key = null; - this.value = null; - setExpire_ts_secondsIsSet(false); - this.expire_ts_seconds = 0; - } - - public blob getKey() { - return this.key; - } - - public update_request setKey(blob key) { - this.key = key; - return this; - } - - public void unsetKey() { - this.key = null; - } - - /** Returns true if field key is set (has been assigned a value) and false otherwise */ - public boolean isSetKey() { - return this.key != null; - } - - public void setKeyIsSet(boolean value) { - if (!value) { - this.key = null; - } - } - - public blob getValue() { - return this.value; - } - - public update_request setValue(blob 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 int getExpire_ts_seconds() { - return this.expire_ts_seconds; - } - - public update_request setExpire_ts_seconds(int expire_ts_seconds) { - this.expire_ts_seconds = expire_ts_seconds; - setExpire_ts_secondsIsSet(true); - return this; - } - - public void unsetExpire_ts_seconds() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __EXPIRE_TS_SECONDS_ISSET_ID); - } - - /** - * Returns true if field expire_ts_seconds is set (has been assigned a value) and false otherwise - */ - public boolean isSetExpire_ts_seconds() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __EXPIRE_TS_SECONDS_ISSET_ID); - } - - public void setExpire_ts_secondsIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit( - __isset_bitfield, __EXPIRE_TS_SECONDS_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case KEY: - if (value == null) { - unsetKey(); - } else { - setKey((blob) value); - } - break; - - case VALUE: - if (value == null) { - unsetValue(); - } else { - setValue((blob) value); - } - break; - - case EXPIRE_TS_SECONDS: - if (value == null) { - unsetExpire_ts_seconds(); - } else { - setExpire_ts_seconds((java.lang.Integer) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case KEY: - return getKey(); - - case VALUE: - return getValue(); - - case EXPIRE_TS_SECONDS: - return getExpire_ts_seconds(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case KEY: - return isSetKey(); - case VALUE: - return isSetValue(); - case EXPIRE_TS_SECONDS: - return isSetExpire_ts_seconds(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof update_request) return this.equals((update_request) that); - return false; - } - - public boolean equals(update_request that) { - if (that == null) return false; - if (this == that) return true; - - boolean this_present_key = true && this.isSetKey(); - boolean that_present_key = true && that.isSetKey(); - if (this_present_key || that_present_key) { - if (!(this_present_key && that_present_key)) return false; - if (!this.key.equals(that.key)) 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_expire_ts_seconds = true; - boolean that_present_expire_ts_seconds = true; - if (this_present_expire_ts_seconds || that_present_expire_ts_seconds) { - if (!(this_present_expire_ts_seconds && that_present_expire_ts_seconds)) return false; - if (this.expire_ts_seconds != that.expire_ts_seconds) return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetKey()) ? 131071 : 524287); - if (isSetKey()) hashCode = hashCode * 8191 + key.hashCode(); - - hashCode = hashCode * 8191 + ((isSetValue()) ? 131071 : 524287); - if (isSetValue()) hashCode = hashCode * 8191 + value.hashCode(); - - hashCode = hashCode * 8191 + expire_ts_seconds; - - return hashCode; - } - - @Override - public int compareTo(update_request other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetKey()).compareTo(other.isSetKey()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetKey()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.key, other.key); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetValue()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, other.value); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetExpire_ts_seconds()) - .compareTo(other.isSetExpire_ts_seconds()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetExpire_ts_seconds()) { - lastComparison = - org.apache.thrift.TBaseHelper.compareTo(this.expire_ts_seconds, other.expire_ts_seconds); - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("update_request("); - boolean first = true; - - sb.append("key:"); - if (this.key == null) { - sb.append("null"); - } else { - sb.append(this.key); - } - first = false; - if (!first) sb.append(", "); - sb.append("value:"); - if (this.value == null) { - sb.append("null"); - } else { - sb.append(this.value); - } - first = false; - if (!first) sb.append(", "); - sb.append("expire_ts_seconds:"); - sb.append(this.expire_ts_seconds); - 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 (key != null) { - key.validate(); - } - if (value != null) { - value.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, java.lang.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 update_requestStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public update_requestStandardScheme getScheme() { - return new update_requestStandardScheme(); - } - } - - private static class update_requestStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, update_request 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: // KEY - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.key = new blob(); - struct.key.read(iprot); - struct.setKeyIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // VALUE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.value = new blob(); - struct.value.read(iprot); - struct.setValueIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // EXPIRE_TS_SECONDS - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.expire_ts_seconds = iprot.readI32(); - struct.setExpire_ts_secondsIsSet(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, update_request struct) - throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.key != null) { - oprot.writeFieldBegin(KEY_FIELD_DESC); - struct.key.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.value != null) { - oprot.writeFieldBegin(VALUE_FIELD_DESC); - struct.value.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(EXPIRE_TS_SECONDS_FIELD_DESC); - oprot.writeI32(struct.expire_ts_seconds); - oprot.writeFieldEnd(); - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class update_requestTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public update_requestTupleScheme getScheme() { - return new update_requestTupleScheme(); - } - } - - private static class update_requestTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, update_request struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetKey()) { - optionals.set(0); - } - if (struct.isSetValue()) { - optionals.set(1); - } - if (struct.isSetExpire_ts_seconds()) { - optionals.set(2); - } - oprot.writeBitSet(optionals, 3); - if (struct.isSetKey()) { - struct.key.write(oprot); - } - if (struct.isSetValue()) { - struct.value.write(oprot); - } - if (struct.isSetExpire_ts_seconds()) { - oprot.writeI32(struct.expire_ts_seconds); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, update_request struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(3); - if (incoming.get(0)) { - struct.key = new blob(); - struct.key.read(iprot); - struct.setKeyIsSet(true); - } - if (incoming.get(1)) { - struct.value = new blob(); - struct.value.read(iprot); - struct.setValueIsSet(true); - } - if (incoming.get(2)) { - struct.expire_ts_seconds = iprot.readI32(); - struct.setExpire_ts_secondsIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } -} diff --git a/java-client/src/main/java/org/apache/pegasus/apps/update_response.java b/java-client/src/main/java/org/apache/pegasus/apps/update_response.java deleted file mode 100644 index f3036a831e..0000000000 --- a/java-client/src/main/java/org/apache/pegasus/apps/update_response.java +++ /dev/null @@ -1,831 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.11.0) - * - *

DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * - * @generated - */ -package org.apache.pegasus.apps; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated( - value = "Autogenerated by Thrift Compiler (0.11.0)", - date = "2020-04-13") -public class update_response - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("update_response"); - - private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "error", org.apache.thrift.protocol.TType.I32, (short) 1); - private static final org.apache.thrift.protocol.TField APP_ID_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "app_id", org.apache.thrift.protocol.TType.I32, (short) 2); - private static final org.apache.thrift.protocol.TField PARTITION_INDEX_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "partition_index", org.apache.thrift.protocol.TType.I32, (short) 3); - private static final org.apache.thrift.protocol.TField DECREE_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "decree", org.apache.thrift.protocol.TType.I64, (short) 4); - private static final org.apache.thrift.protocol.TField SERVER_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "server", org.apache.thrift.protocol.TType.STRING, (short) 5); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new update_responseStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new update_responseTupleSchemeFactory(); - - public int error; // required - public int app_id; // required - public int partition_index; // required - public long decree; // required - public java.lang.String server; // 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 { - ERROR((short) 1, "error"), - APP_ID((short) 2, "app_id"), - PARTITION_INDEX((short) 3, "partition_index"), - DECREE((short) 4, "decree"), - SERVER((short) 5, "server"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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: // ERROR - return ERROR; - case 2: // APP_ID - return APP_ID; - case 3: // PARTITION_INDEX - return PARTITION_INDEX; - case 4: // DECREE - return DECREE; - case 5: // SERVER - return SERVER; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __ERROR_ISSET_ID = 0; - private static final int __APP_ID_ISSET_ID = 1; - private static final int __PARTITION_INDEX_ISSET_ID = 2; - private static final int __DECREE_ISSET_ID = 3; - private byte __isset_bitfield = 0; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put( - _Fields.ERROR, - new org.apache.thrift.meta_data.FieldMetaData( - "error", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I32))); - tmpMap.put( - _Fields.APP_ID, - new org.apache.thrift.meta_data.FieldMetaData( - "app_id", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I32))); - tmpMap.put( - _Fields.PARTITION_INDEX, - new org.apache.thrift.meta_data.FieldMetaData( - "partition_index", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I32))); - tmpMap.put( - _Fields.DECREE, - new org.apache.thrift.meta_data.FieldMetaData( - "decree", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I64))); - tmpMap.put( - _Fields.SERVER, - new org.apache.thrift.meta_data.FieldMetaData( - "server", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.STRING))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap( - update_response.class, metaDataMap); - } - - public update_response() {} - - public update_response( - int error, int app_id, int partition_index, long decree, java.lang.String server) { - this(); - this.error = error; - setErrorIsSet(true); - this.app_id = app_id; - setApp_idIsSet(true); - this.partition_index = partition_index; - setPartition_indexIsSet(true); - this.decree = decree; - setDecreeIsSet(true); - this.server = server; - } - - /** Performs a deep copy on other. */ - public update_response(update_response other) { - __isset_bitfield = other.__isset_bitfield; - this.error = other.error; - this.app_id = other.app_id; - this.partition_index = other.partition_index; - this.decree = other.decree; - if (other.isSetServer()) { - this.server = other.server; - } - } - - public update_response deepCopy() { - return new update_response(this); - } - - @Override - public void clear() { - setErrorIsSet(false); - this.error = 0; - setApp_idIsSet(false); - this.app_id = 0; - setPartition_indexIsSet(false); - this.partition_index = 0; - setDecreeIsSet(false); - this.decree = 0; - this.server = null; - } - - public int getError() { - return this.error; - } - - public update_response setError(int error) { - this.error = error; - setErrorIsSet(true); - return this; - } - - public void unsetError() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ERROR_ISSET_ID); - } - - /** Returns true if field error is set (has been assigned a value) and false otherwise */ - public boolean isSetError() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ERROR_ISSET_ID); - } - - public void setErrorIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ERROR_ISSET_ID, value); - } - - public int getApp_id() { - return this.app_id; - } - - public update_response setApp_id(int app_id) { - this.app_id = app_id; - setApp_idIsSet(true); - return this; - } - - public void unsetApp_id() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __APP_ID_ISSET_ID); - } - - /** Returns true if field app_id is set (has been assigned a value) and false otherwise */ - public boolean isSetApp_id() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __APP_ID_ISSET_ID); - } - - public void setApp_idIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __APP_ID_ISSET_ID, value); - } - - public int getPartition_index() { - return this.partition_index; - } - - public update_response setPartition_index(int partition_index) { - this.partition_index = partition_index; - setPartition_indexIsSet(true); - return this; - } - - public void unsetPartition_index() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __PARTITION_INDEX_ISSET_ID); - } - - /** - * Returns true if field partition_index is set (has been assigned a value) and false otherwise - */ - public boolean isSetPartition_index() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __PARTITION_INDEX_ISSET_ID); - } - - public void setPartition_indexIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __PARTITION_INDEX_ISSET_ID, value); - } - - public long getDecree() { - return this.decree; - } - - public update_response setDecree(long decree) { - this.decree = decree; - setDecreeIsSet(true); - return this; - } - - public void unsetDecree() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __DECREE_ISSET_ID); - } - - /** Returns true if field decree is set (has been assigned a value) and false otherwise */ - public boolean isSetDecree() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __DECREE_ISSET_ID); - } - - public void setDecreeIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __DECREE_ISSET_ID, value); - } - - public java.lang.String getServer() { - return this.server; - } - - public update_response setServer(java.lang.String server) { - this.server = server; - return this; - } - - public void unsetServer() { - this.server = null; - } - - /** Returns true if field server is set (has been assigned a value) and false otherwise */ - public boolean isSetServer() { - return this.server != null; - } - - public void setServerIsSet(boolean value) { - if (!value) { - this.server = null; - } - } - - public void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case ERROR: - if (value == null) { - unsetError(); - } else { - setError((java.lang.Integer) value); - } - break; - - case APP_ID: - if (value == null) { - unsetApp_id(); - } else { - setApp_id((java.lang.Integer) value); - } - break; - - case PARTITION_INDEX: - if (value == null) { - unsetPartition_index(); - } else { - setPartition_index((java.lang.Integer) value); - } - break; - - case DECREE: - if (value == null) { - unsetDecree(); - } else { - setDecree((java.lang.Long) value); - } - break; - - case SERVER: - if (value == null) { - unsetServer(); - } else { - setServer((java.lang.String) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case ERROR: - return getError(); - - case APP_ID: - return getApp_id(); - - case PARTITION_INDEX: - return getPartition_index(); - - case DECREE: - return getDecree(); - - case SERVER: - return getServer(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case ERROR: - return isSetError(); - case APP_ID: - return isSetApp_id(); - case PARTITION_INDEX: - return isSetPartition_index(); - case DECREE: - return isSetDecree(); - case SERVER: - return isSetServer(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof update_response) return this.equals((update_response) that); - return false; - } - - public boolean equals(update_response that) { - if (that == null) return false; - if (this == that) return true; - - boolean this_present_error = true; - boolean that_present_error = true; - if (this_present_error || that_present_error) { - if (!(this_present_error && that_present_error)) return false; - if (this.error != that.error) return false; - } - - boolean this_present_app_id = true; - boolean that_present_app_id = true; - if (this_present_app_id || that_present_app_id) { - if (!(this_present_app_id && that_present_app_id)) return false; - if (this.app_id != that.app_id) return false; - } - - boolean this_present_partition_index = true; - boolean that_present_partition_index = true; - if (this_present_partition_index || that_present_partition_index) { - if (!(this_present_partition_index && that_present_partition_index)) return false; - if (this.partition_index != that.partition_index) return false; - } - - boolean this_present_decree = true; - boolean that_present_decree = true; - if (this_present_decree || that_present_decree) { - if (!(this_present_decree && that_present_decree)) return false; - if (this.decree != that.decree) return false; - } - - boolean this_present_server = true && this.isSetServer(); - boolean that_present_server = true && that.isSetServer(); - if (this_present_server || that_present_server) { - if (!(this_present_server && that_present_server)) return false; - if (!this.server.equals(that.server)) return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + error; - - hashCode = hashCode * 8191 + app_id; - - hashCode = hashCode * 8191 + partition_index; - - hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(decree); - - hashCode = hashCode * 8191 + ((isSetServer()) ? 131071 : 524287); - if (isSetServer()) hashCode = hashCode * 8191 + server.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(update_response other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetError()).compareTo(other.isSetError()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetError()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetApp_id()).compareTo(other.isSetApp_id()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetApp_id()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.app_id, other.app_id); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetPartition_index()).compareTo(other.isSetPartition_index()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetPartition_index()) { - lastComparison = - org.apache.thrift.TBaseHelper.compareTo(this.partition_index, other.partition_index); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetDecree()).compareTo(other.isSetDecree()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetDecree()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.decree, other.decree); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetServer()).compareTo(other.isSetServer()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetServer()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.server, other.server); - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("update_response("); - boolean first = true; - - sb.append("error:"); - sb.append(this.error); - first = false; - if (!first) sb.append(", "); - sb.append("app_id:"); - sb.append(this.app_id); - first = false; - if (!first) sb.append(", "); - sb.append("partition_index:"); - sb.append(this.partition_index); - first = false; - if (!first) sb.append(", "); - sb.append("decree:"); - sb.append(this.decree); - first = false; - if (!first) sb.append(", "); - sb.append("server:"); - if (this.server == null) { - sb.append("null"); - } else { - sb.append(this.server); - } - 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, java.lang.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 update_responseStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public update_responseStandardScheme getScheme() { - return new update_responseStandardScheme(); - } - } - - private static class update_responseStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, update_response 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: // ERROR - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.error = iprot.readI32(); - struct.setErrorIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // APP_ID - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.app_id = iprot.readI32(); - struct.setApp_idIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // PARTITION_INDEX - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.partition_index = iprot.readI32(); - struct.setPartition_indexIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // DECREE - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.decree = iprot.readI64(); - struct.setDecreeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 5: // SERVER - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.server = iprot.readString(); - struct.setServerIsSet(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, update_response struct) - throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(ERROR_FIELD_DESC); - oprot.writeI32(struct.error); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(APP_ID_FIELD_DESC); - oprot.writeI32(struct.app_id); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(PARTITION_INDEX_FIELD_DESC); - oprot.writeI32(struct.partition_index); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(DECREE_FIELD_DESC); - oprot.writeI64(struct.decree); - oprot.writeFieldEnd(); - if (struct.server != null) { - oprot.writeFieldBegin(SERVER_FIELD_DESC); - oprot.writeString(struct.server); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class update_responseTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public update_responseTupleScheme getScheme() { - return new update_responseTupleScheme(); - } - } - - private static class update_responseTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, update_response struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetError()) { - optionals.set(0); - } - if (struct.isSetApp_id()) { - optionals.set(1); - } - if (struct.isSetPartition_index()) { - optionals.set(2); - } - if (struct.isSetDecree()) { - optionals.set(3); - } - if (struct.isSetServer()) { - optionals.set(4); - } - oprot.writeBitSet(optionals, 5); - if (struct.isSetError()) { - oprot.writeI32(struct.error); - } - if (struct.isSetApp_id()) { - oprot.writeI32(struct.app_id); - } - if (struct.isSetPartition_index()) { - oprot.writeI32(struct.partition_index); - } - if (struct.isSetDecree()) { - oprot.writeI64(struct.decree); - } - if (struct.isSetServer()) { - oprot.writeString(struct.server); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, update_response struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(5); - if (incoming.get(0)) { - struct.error = iprot.readI32(); - struct.setErrorIsSet(true); - } - if (incoming.get(1)) { - struct.app_id = iprot.readI32(); - struct.setApp_idIsSet(true); - } - if (incoming.get(2)) { - struct.partition_index = iprot.readI32(); - struct.setPartition_indexIsSet(true); - } - if (incoming.get(3)) { - struct.decree = iprot.readI64(); - struct.setDecreeIsSet(true); - } - if (incoming.get(4)) { - struct.server = iprot.readString(); - struct.setServerIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } -} diff --git a/java-client/src/main/java/org/apache/pegasus/replication/configuration_create_app_request.java b/java-client/src/main/java/org/apache/pegasus/replication/configuration_create_app_request.java deleted file mode 100644 index 454a1daab4..0000000000 --- a/java-client/src/main/java/org/apache/pegasus/replication/configuration_create_app_request.java +++ /dev/null @@ -1,532 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.11.0) - * - *

DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * - * @generated - */ -package org.apache.pegasus.replication; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated( - value = "Autogenerated by Thrift Compiler (0.11.0)", - date = "2022-03-10") -public class configuration_create_app_request - implements org.apache.thrift.TBase< - configuration_create_app_request, configuration_create_app_request._Fields>, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("configuration_create_app_request"); - - private static final org.apache.thrift.protocol.TField APP_NAME_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "app_name", org.apache.thrift.protocol.TType.STRING, (short) 1); - private static final org.apache.thrift.protocol.TField OPTIONS_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "options", org.apache.thrift.protocol.TType.STRUCT, (short) 2); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new configuration_create_app_requestStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new configuration_create_app_requestTupleSchemeFactory(); - - public java.lang.String app_name; // required - public create_app_options options; // 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 { - APP_NAME((short) 1, "app_name"), - OPTIONS((short) 2, "options"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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: // APP_NAME - return APP_NAME; - case 2: // OPTIONS - return OPTIONS; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put( - _Fields.APP_NAME, - new org.apache.thrift.meta_data.FieldMetaData( - "app_name", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.STRING))); - tmpMap.put( - _Fields.OPTIONS, - new org.apache.thrift.meta_data.FieldMetaData( - "options", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData( - org.apache.thrift.protocol.TType.STRUCT, create_app_options.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap( - configuration_create_app_request.class, metaDataMap); - } - - public configuration_create_app_request() {} - - public configuration_create_app_request(java.lang.String app_name, create_app_options options) { - this(); - this.app_name = app_name; - this.options = options; - } - - /** Performs a deep copy on other. */ - public configuration_create_app_request(configuration_create_app_request other) { - if (other.isSetApp_name()) { - this.app_name = other.app_name; - } - if (other.isSetOptions()) { - this.options = new create_app_options(other.options); - } - } - - public configuration_create_app_request deepCopy() { - return new configuration_create_app_request(this); - } - - @Override - public void clear() { - this.app_name = null; - this.options = null; - } - - public java.lang.String getApp_name() { - return this.app_name; - } - - public configuration_create_app_request setApp_name(java.lang.String app_name) { - this.app_name = app_name; - return this; - } - - public void unsetApp_name() { - this.app_name = null; - } - - /** Returns true if field app_name is set (has been assigned a value) and false otherwise */ - public boolean isSetApp_name() { - return this.app_name != null; - } - - public void setApp_nameIsSet(boolean value) { - if (!value) { - this.app_name = null; - } - } - - public create_app_options getOptions() { - return this.options; - } - - public configuration_create_app_request setOptions(create_app_options options) { - this.options = options; - return this; - } - - public void unsetOptions() { - this.options = null; - } - - /** Returns true if field options is set (has been assigned a value) and false otherwise */ - public boolean isSetOptions() { - return this.options != null; - } - - public void setOptionsIsSet(boolean value) { - if (!value) { - this.options = null; - } - } - - public void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case APP_NAME: - if (value == null) { - unsetApp_name(); - } else { - setApp_name((java.lang.String) value); - } - break; - - case OPTIONS: - if (value == null) { - unsetOptions(); - } else { - setOptions((create_app_options) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case APP_NAME: - return getApp_name(); - - case OPTIONS: - return getOptions(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case APP_NAME: - return isSetApp_name(); - case OPTIONS: - return isSetOptions(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof configuration_create_app_request) - return this.equals((configuration_create_app_request) that); - return false; - } - - public boolean equals(configuration_create_app_request that) { - if (that == null) return false; - if (this == that) return true; - - boolean this_present_app_name = true && this.isSetApp_name(); - boolean that_present_app_name = true && that.isSetApp_name(); - if (this_present_app_name || that_present_app_name) { - if (!(this_present_app_name && that_present_app_name)) return false; - if (!this.app_name.equals(that.app_name)) return false; - } - - boolean this_present_options = true && this.isSetOptions(); - boolean that_present_options = true && that.isSetOptions(); - if (this_present_options || that_present_options) { - if (!(this_present_options && that_present_options)) return false; - if (!this.options.equals(that.options)) return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetApp_name()) ? 131071 : 524287); - if (isSetApp_name()) hashCode = hashCode * 8191 + app_name.hashCode(); - - hashCode = hashCode * 8191 + ((isSetOptions()) ? 131071 : 524287); - if (isSetOptions()) hashCode = hashCode * 8191 + options.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(configuration_create_app_request other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetApp_name()).compareTo(other.isSetApp_name()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetApp_name()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.app_name, other.app_name); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetOptions()).compareTo(other.isSetOptions()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOptions()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.options, other.options); - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("configuration_create_app_request("); - boolean first = true; - - sb.append("app_name:"); - if (this.app_name == null) { - sb.append("null"); - } else { - sb.append(this.app_name); - } - first = false; - if (!first) sb.append(", "); - sb.append("options:"); - if (this.options == null) { - sb.append("null"); - } else { - sb.append(this.options); - } - 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 (options != null) { - options.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, java.lang.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 configuration_create_app_requestStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public configuration_create_app_requestStandardScheme getScheme() { - return new configuration_create_app_requestStandardScheme(); - } - } - - private static class configuration_create_app_requestStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read( - org.apache.thrift.protocol.TProtocol iprot, configuration_create_app_request 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: // APP_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.app_name = iprot.readString(); - struct.setApp_nameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // OPTIONS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.options = new create_app_options(); - struct.options.read(iprot); - struct.setOptionsIsSet(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, configuration_create_app_request struct) - throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.app_name != null) { - oprot.writeFieldBegin(APP_NAME_FIELD_DESC); - oprot.writeString(struct.app_name); - oprot.writeFieldEnd(); - } - if (struct.options != null) { - oprot.writeFieldBegin(OPTIONS_FIELD_DESC); - struct.options.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class configuration_create_app_requestTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public configuration_create_app_requestTupleScheme getScheme() { - return new configuration_create_app_requestTupleScheme(); - } - } - - private static class configuration_create_app_requestTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write( - org.apache.thrift.protocol.TProtocol prot, configuration_create_app_request struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetApp_name()) { - optionals.set(0); - } - if (struct.isSetOptions()) { - optionals.set(1); - } - oprot.writeBitSet(optionals, 2); - if (struct.isSetApp_name()) { - oprot.writeString(struct.app_name); - } - if (struct.isSetOptions()) { - struct.options.write(oprot); - } - } - - @Override - public void read( - org.apache.thrift.protocol.TProtocol prot, configuration_create_app_request struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(2); - if (incoming.get(0)) { - struct.app_name = iprot.readString(); - struct.setApp_nameIsSet(true); - } - if (incoming.get(1)) { - struct.options = new create_app_options(); - struct.options.read(iprot); - struct.setOptionsIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } -} diff --git a/java-client/src/main/java/org/apache/pegasus/replication/configuration_create_app_response.java b/java-client/src/main/java/org/apache/pegasus/replication/configuration_create_app_response.java deleted file mode 100644 index 7a16e37437..0000000000 --- a/java-client/src/main/java/org/apache/pegasus/replication/configuration_create_app_response.java +++ /dev/null @@ -1,533 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.11.0) - * - *

DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * - * @generated - */ -package org.apache.pegasus.replication; - -import org.apache.pegasus.base.error_code; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated( - value = "Autogenerated by Thrift Compiler (0.11.0)", - date = "2022-03-10") -public class configuration_create_app_response - implements org.apache.thrift.TBase< - configuration_create_app_response, configuration_create_app_response._Fields>, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("configuration_create_app_response"); - - private static final org.apache.thrift.protocol.TField ERR_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "err", org.apache.thrift.protocol.TType.STRUCT, (short) 1); - private static final org.apache.thrift.protocol.TField APPID_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "appid", org.apache.thrift.protocol.TType.I32, (short) 2); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new configuration_create_app_responseStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new configuration_create_app_responseTupleSchemeFactory(); - - public error_code err; // required - public int appid; // 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 { - ERR((short) 1, "err"), - APPID((short) 2, "appid"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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: // ERR - return ERR; - case 2: // APPID - return APPID; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __APPID_ISSET_ID = 0; - private byte __isset_bitfield = 0; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put( - _Fields.ERR, - new org.apache.thrift.meta_data.FieldMetaData( - "err", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData( - org.apache.thrift.protocol.TType.STRUCT, error_code.class))); - tmpMap.put( - _Fields.APPID, - new org.apache.thrift.meta_data.FieldMetaData( - "appid", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I32))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap( - configuration_create_app_response.class, metaDataMap); - } - - public configuration_create_app_response() {} - - public configuration_create_app_response(error_code err, int appid) { - this(); - this.err = err; - this.appid = appid; - setAppidIsSet(true); - } - - /** Performs a deep copy on other. */ - public configuration_create_app_response(configuration_create_app_response other) { - __isset_bitfield = other.__isset_bitfield; - if (other.isSetErr()) { - this.err = new error_code(other.err); - } - this.appid = other.appid; - } - - public configuration_create_app_response deepCopy() { - return new configuration_create_app_response(this); - } - - @Override - public void clear() { - this.err = null; - setAppidIsSet(false); - this.appid = 0; - } - - public error_code getErr() { - return this.err; - } - - public configuration_create_app_response setErr(error_code err) { - this.err = err; - return this; - } - - public void unsetErr() { - this.err = null; - } - - /** Returns true if field err is set (has been assigned a value) and false otherwise */ - public boolean isSetErr() { - return this.err != null; - } - - public void setErrIsSet(boolean value) { - if (!value) { - this.err = null; - } - } - - public int getAppid() { - return this.appid; - } - - public configuration_create_app_response setAppid(int appid) { - this.appid = appid; - setAppidIsSet(true); - return this; - } - - public void unsetAppid() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __APPID_ISSET_ID); - } - - /** Returns true if field appid is set (has been assigned a value) and false otherwise */ - public boolean isSetAppid() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __APPID_ISSET_ID); - } - - public void setAppidIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __APPID_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case ERR: - if (value == null) { - unsetErr(); - } else { - setErr((error_code) value); - } - break; - - case APPID: - if (value == null) { - unsetAppid(); - } else { - setAppid((java.lang.Integer) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case ERR: - return getErr(); - - case APPID: - return getAppid(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case ERR: - return isSetErr(); - case APPID: - return isSetAppid(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof configuration_create_app_response) - return this.equals((configuration_create_app_response) that); - return false; - } - - public boolean equals(configuration_create_app_response that) { - if (that == null) return false; - if (this == that) return true; - - boolean this_present_err = true && this.isSetErr(); - boolean that_present_err = true && that.isSetErr(); - if (this_present_err || that_present_err) { - if (!(this_present_err && that_present_err)) return false; - if (!this.err.equals(that.err)) return false; - } - - boolean this_present_appid = true; - boolean that_present_appid = true; - if (this_present_appid || that_present_appid) { - if (!(this_present_appid && that_present_appid)) return false; - if (this.appid != that.appid) return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetErr()) ? 131071 : 524287); - if (isSetErr()) hashCode = hashCode * 8191 + err.hashCode(); - - hashCode = hashCode * 8191 + appid; - - return hashCode; - } - - @Override - public int compareTo(configuration_create_app_response other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetErr()).compareTo(other.isSetErr()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetErr()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.err, other.err); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetAppid()).compareTo(other.isSetAppid()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetAppid()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.appid, other.appid); - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("configuration_create_app_response("); - boolean first = true; - - sb.append("err:"); - if (this.err == null) { - sb.append("null"); - } else { - sb.append(this.err); - } - first = false; - if (!first) sb.append(", "); - sb.append("appid:"); - sb.append(this.appid); - 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 (err != null) { - err.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, java.lang.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 configuration_create_app_responseStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public configuration_create_app_responseStandardScheme getScheme() { - return new configuration_create_app_responseStandardScheme(); - } - } - - private static class configuration_create_app_responseStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read( - org.apache.thrift.protocol.TProtocol iprot, configuration_create_app_response 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: // ERR - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.err = new error_code(); - struct.err.read(iprot); - struct.setErrIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // APPID - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.appid = iprot.readI32(); - struct.setAppidIsSet(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, configuration_create_app_response struct) - throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.err != null) { - oprot.writeFieldBegin(ERR_FIELD_DESC); - struct.err.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(APPID_FIELD_DESC); - oprot.writeI32(struct.appid); - oprot.writeFieldEnd(); - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class configuration_create_app_responseTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public configuration_create_app_responseTupleScheme getScheme() { - return new configuration_create_app_responseTupleScheme(); - } - } - - private static class configuration_create_app_responseTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write( - org.apache.thrift.protocol.TProtocol prot, configuration_create_app_response struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetErr()) { - optionals.set(0); - } - if (struct.isSetAppid()) { - optionals.set(1); - } - oprot.writeBitSet(optionals, 2); - if (struct.isSetErr()) { - struct.err.write(oprot); - } - if (struct.isSetAppid()) { - oprot.writeI32(struct.appid); - } - } - - @Override - public void read( - org.apache.thrift.protocol.TProtocol prot, configuration_create_app_response struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(2); - if (incoming.get(0)) { - struct.err = new error_code(); - struct.err.read(iprot); - struct.setErrIsSet(true); - } - if (incoming.get(1)) { - struct.appid = iprot.readI32(); - struct.setAppidIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } -} diff --git a/java-client/src/main/java/org/apache/pegasus/replication/configuration_drop_app_request.java b/java-client/src/main/java/org/apache/pegasus/replication/configuration_drop_app_request.java deleted file mode 100644 index e9699d4fee..0000000000 --- a/java-client/src/main/java/org/apache/pegasus/replication/configuration_drop_app_request.java +++ /dev/null @@ -1,532 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.11.0) - * - *

DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * - * @generated - */ -package org.apache.pegasus.replication; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated( - value = "Autogenerated by Thrift Compiler (0.11.0)", - date = "2022-05-17") -public class configuration_drop_app_request - implements org.apache.thrift.TBase< - configuration_drop_app_request, configuration_drop_app_request._Fields>, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("configuration_drop_app_request"); - - private static final org.apache.thrift.protocol.TField APP_NAME_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "app_name", org.apache.thrift.protocol.TType.STRING, (short) 1); - private static final org.apache.thrift.protocol.TField OPTIONS_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "options", org.apache.thrift.protocol.TType.STRUCT, (short) 2); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new configuration_drop_app_requestStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new configuration_drop_app_requestTupleSchemeFactory(); - - public java.lang.String app_name; // required - public drop_app_options options; // 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 { - APP_NAME((short) 1, "app_name"), - OPTIONS((short) 2, "options"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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: // APP_NAME - return APP_NAME; - case 2: // OPTIONS - return OPTIONS; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put( - _Fields.APP_NAME, - new org.apache.thrift.meta_data.FieldMetaData( - "app_name", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.STRING))); - tmpMap.put( - _Fields.OPTIONS, - new org.apache.thrift.meta_data.FieldMetaData( - "options", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData( - org.apache.thrift.protocol.TType.STRUCT, drop_app_options.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap( - configuration_drop_app_request.class, metaDataMap); - } - - public configuration_drop_app_request() {} - - public configuration_drop_app_request(java.lang.String app_name, drop_app_options options) { - this(); - this.app_name = app_name; - this.options = options; - } - - /** Performs a deep copy on other. */ - public configuration_drop_app_request(configuration_drop_app_request other) { - if (other.isSetApp_name()) { - this.app_name = other.app_name; - } - if (other.isSetOptions()) { - this.options = new drop_app_options(other.options); - } - } - - public configuration_drop_app_request deepCopy() { - return new configuration_drop_app_request(this); - } - - @Override - public void clear() { - this.app_name = null; - this.options = null; - } - - public java.lang.String getApp_name() { - return this.app_name; - } - - public configuration_drop_app_request setApp_name(java.lang.String app_name) { - this.app_name = app_name; - return this; - } - - public void unsetApp_name() { - this.app_name = null; - } - - /** Returns true if field app_name is set (has been assigned a value) and false otherwise */ - public boolean isSetApp_name() { - return this.app_name != null; - } - - public void setApp_nameIsSet(boolean value) { - if (!value) { - this.app_name = null; - } - } - - public drop_app_options getOptions() { - return this.options; - } - - public configuration_drop_app_request setOptions(drop_app_options options) { - this.options = options; - return this; - } - - public void unsetOptions() { - this.options = null; - } - - /** Returns true if field options is set (has been assigned a value) and false otherwise */ - public boolean isSetOptions() { - return this.options != null; - } - - public void setOptionsIsSet(boolean value) { - if (!value) { - this.options = null; - } - } - - public void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case APP_NAME: - if (value == null) { - unsetApp_name(); - } else { - setApp_name((java.lang.String) value); - } - break; - - case OPTIONS: - if (value == null) { - unsetOptions(); - } else { - setOptions((drop_app_options) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case APP_NAME: - return getApp_name(); - - case OPTIONS: - return getOptions(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case APP_NAME: - return isSetApp_name(); - case OPTIONS: - return isSetOptions(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof configuration_drop_app_request) - return this.equals((configuration_drop_app_request) that); - return false; - } - - public boolean equals(configuration_drop_app_request that) { - if (that == null) return false; - if (this == that) return true; - - boolean this_present_app_name = true && this.isSetApp_name(); - boolean that_present_app_name = true && that.isSetApp_name(); - if (this_present_app_name || that_present_app_name) { - if (!(this_present_app_name && that_present_app_name)) return false; - if (!this.app_name.equals(that.app_name)) return false; - } - - boolean this_present_options = true && this.isSetOptions(); - boolean that_present_options = true && that.isSetOptions(); - if (this_present_options || that_present_options) { - if (!(this_present_options && that_present_options)) return false; - if (!this.options.equals(that.options)) return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetApp_name()) ? 131071 : 524287); - if (isSetApp_name()) hashCode = hashCode * 8191 + app_name.hashCode(); - - hashCode = hashCode * 8191 + ((isSetOptions()) ? 131071 : 524287); - if (isSetOptions()) hashCode = hashCode * 8191 + options.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(configuration_drop_app_request other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetApp_name()).compareTo(other.isSetApp_name()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetApp_name()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.app_name, other.app_name); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetOptions()).compareTo(other.isSetOptions()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOptions()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.options, other.options); - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("configuration_drop_app_request("); - boolean first = true; - - sb.append("app_name:"); - if (this.app_name == null) { - sb.append("null"); - } else { - sb.append(this.app_name); - } - first = false; - if (!first) sb.append(", "); - sb.append("options:"); - if (this.options == null) { - sb.append("null"); - } else { - sb.append(this.options); - } - 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 (options != null) { - options.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, java.lang.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 configuration_drop_app_requestStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public configuration_drop_app_requestStandardScheme getScheme() { - return new configuration_drop_app_requestStandardScheme(); - } - } - - private static class configuration_drop_app_requestStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read( - org.apache.thrift.protocol.TProtocol iprot, configuration_drop_app_request 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: // APP_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.app_name = iprot.readString(); - struct.setApp_nameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // OPTIONS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.options = new drop_app_options(); - struct.options.read(iprot); - struct.setOptionsIsSet(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, configuration_drop_app_request struct) - throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.app_name != null) { - oprot.writeFieldBegin(APP_NAME_FIELD_DESC); - oprot.writeString(struct.app_name); - oprot.writeFieldEnd(); - } - if (struct.options != null) { - oprot.writeFieldBegin(OPTIONS_FIELD_DESC); - struct.options.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class configuration_drop_app_requestTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public configuration_drop_app_requestTupleScheme getScheme() { - return new configuration_drop_app_requestTupleScheme(); - } - } - - private static class configuration_drop_app_requestTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write( - org.apache.thrift.protocol.TProtocol prot, configuration_drop_app_request struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetApp_name()) { - optionals.set(0); - } - if (struct.isSetOptions()) { - optionals.set(1); - } - oprot.writeBitSet(optionals, 2); - if (struct.isSetApp_name()) { - oprot.writeString(struct.app_name); - } - if (struct.isSetOptions()) { - struct.options.write(oprot); - } - } - - @Override - public void read( - org.apache.thrift.protocol.TProtocol prot, configuration_drop_app_request struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(2); - if (incoming.get(0)) { - struct.app_name = iprot.readString(); - struct.setApp_nameIsSet(true); - } - if (incoming.get(1)) { - struct.options = new drop_app_options(); - struct.options.read(iprot); - struct.setOptionsIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } -} diff --git a/java-client/src/main/java/org/apache/pegasus/replication/configuration_drop_app_response.java b/java-client/src/main/java/org/apache/pegasus/replication/configuration_drop_app_response.java deleted file mode 100644 index 0b362db1b5..0000000000 --- a/java-client/src/main/java/org/apache/pegasus/replication/configuration_drop_app_response.java +++ /dev/null @@ -1,426 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.11.0) - * - *

DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * - * @generated - */ -package org.apache.pegasus.replication; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated( - value = "Autogenerated by Thrift Compiler (0.11.0)", - date = "2022-05-17") -public class configuration_drop_app_response - implements org.apache.thrift.TBase< - configuration_drop_app_response, configuration_drop_app_response._Fields>, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("configuration_drop_app_response"); - - private static final org.apache.thrift.protocol.TField ERR_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "err", org.apache.thrift.protocol.TType.STRUCT, (short) 1); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new configuration_drop_app_responseStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new configuration_drop_app_responseTupleSchemeFactory(); - - public org.apache.pegasus.base.error_code err; // 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 { - ERR((short) 1, "err"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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: // ERR - return ERR; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put( - _Fields.ERR, - new org.apache.thrift.meta_data.FieldMetaData( - "err", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData( - org.apache.thrift.protocol.TType.STRUCT, - org.apache.pegasus.base.error_code.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap( - configuration_drop_app_response.class, metaDataMap); - } - - public configuration_drop_app_response() {} - - public configuration_drop_app_response(org.apache.pegasus.base.error_code err) { - this(); - this.err = err; - } - - /** Performs a deep copy on other. */ - public configuration_drop_app_response(configuration_drop_app_response other) { - if (other.isSetErr()) { - this.err = new org.apache.pegasus.base.error_code(other.err); - } - } - - public configuration_drop_app_response deepCopy() { - return new configuration_drop_app_response(this); - } - - @Override - public void clear() { - this.err = null; - } - - public org.apache.pegasus.base.error_code getErr() { - return this.err; - } - - public configuration_drop_app_response setErr(org.apache.pegasus.base.error_code err) { - this.err = err; - return this; - } - - public void unsetErr() { - this.err = null; - } - - /** Returns true if field err is set (has been assigned a value) and false otherwise */ - public boolean isSetErr() { - return this.err != null; - } - - public void setErrIsSet(boolean value) { - if (!value) { - this.err = null; - } - } - - public void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case ERR: - if (value == null) { - unsetErr(); - } else { - setErr((org.apache.pegasus.base.error_code) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case ERR: - return getErr(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case ERR: - return isSetErr(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof configuration_drop_app_response) - return this.equals((configuration_drop_app_response) that); - return false; - } - - public boolean equals(configuration_drop_app_response that) { - if (that == null) return false; - if (this == that) return true; - - boolean this_present_err = true && this.isSetErr(); - boolean that_present_err = true && that.isSetErr(); - if (this_present_err || that_present_err) { - if (!(this_present_err && that_present_err)) return false; - if (!this.err.equals(that.err)) return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetErr()) ? 131071 : 524287); - if (isSetErr()) hashCode = hashCode * 8191 + err.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(configuration_drop_app_response other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetErr()).compareTo(other.isSetErr()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetErr()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.err, other.err); - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("configuration_drop_app_response("); - boolean first = true; - - sb.append("err:"); - if (this.err == null) { - sb.append("null"); - } else { - sb.append(this.err); - } - 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 (err != null) { - err.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, java.lang.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 configuration_drop_app_responseStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public configuration_drop_app_responseStandardScheme getScheme() { - return new configuration_drop_app_responseStandardScheme(); - } - } - - private static class configuration_drop_app_responseStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read( - org.apache.thrift.protocol.TProtocol iprot, configuration_drop_app_response 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: // ERR - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.err = new org.apache.pegasus.base.error_code(); - struct.err.read(iprot); - struct.setErrIsSet(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, configuration_drop_app_response struct) - throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.err != null) { - oprot.writeFieldBegin(ERR_FIELD_DESC); - struct.err.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class configuration_drop_app_responseTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public configuration_drop_app_responseTupleScheme getScheme() { - return new configuration_drop_app_responseTupleScheme(); - } - } - - private static class configuration_drop_app_responseTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write( - org.apache.thrift.protocol.TProtocol prot, configuration_drop_app_response struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetErr()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetErr()) { - struct.err.write(oprot); - } - } - - @Override - public void read( - org.apache.thrift.protocol.TProtocol prot, configuration_drop_app_response struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.err = new org.apache.pegasus.base.error_code(); - struct.err.read(iprot); - struct.setErrIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } -} diff --git a/java-client/src/main/java/org/apache/pegasus/replication/create_app_options.java b/java-client/src/main/java/org/apache/pegasus/replication/create_app_options.java deleted file mode 100644 index 441a5ac189..0000000000 --- a/java-client/src/main/java/org/apache/pegasus/replication/create_app_options.java +++ /dev/null @@ -1,1014 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.11.0) - * - *

DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * - * @generated - */ -package org.apache.pegasus.replication; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated( - value = "Autogenerated by Thrift Compiler (0.11.0)", - date = "2022-03-10") -public class create_app_options - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("create_app_options"); - - private static final org.apache.thrift.protocol.TField PARTITION_COUNT_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "partition_count", org.apache.thrift.protocol.TType.I32, (short) 1); - private static final org.apache.thrift.protocol.TField REPLICA_COUNT_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "replica_count", org.apache.thrift.protocol.TType.I32, (short) 2); - private static final org.apache.thrift.protocol.TField SUCCESS_IF_EXIST_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "success_if_exist", org.apache.thrift.protocol.TType.BOOL, (short) 3); - private static final org.apache.thrift.protocol.TField APP_TYPE_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "app_type", org.apache.thrift.protocol.TType.STRING, (short) 4); - private static final org.apache.thrift.protocol.TField IS_STATEFUL_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "is_stateful", org.apache.thrift.protocol.TType.BOOL, (short) 5); - private static final org.apache.thrift.protocol.TField ENVS_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "envs", org.apache.thrift.protocol.TType.MAP, (short) 6); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new create_app_optionsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new create_app_optionsTupleSchemeFactory(); - - public int partition_count; // required - public int replica_count; // required - public boolean success_if_exist; // required - public java.lang.String app_type; // required - public boolean is_stateful; // required - public java.util.Map envs; // 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 { - PARTITION_COUNT((short) 1, "partition_count"), - REPLICA_COUNT((short) 2, "replica_count"), - SUCCESS_IF_EXIST((short) 3, "success_if_exist"), - APP_TYPE((short) 4, "app_type"), - IS_STATEFUL((short) 5, "is_stateful"), - ENVS((short) 6, "envs"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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: // PARTITION_COUNT - return PARTITION_COUNT; - case 2: // REPLICA_COUNT - return REPLICA_COUNT; - case 3: // SUCCESS_IF_EXIST - return SUCCESS_IF_EXIST; - case 4: // APP_TYPE - return APP_TYPE; - case 5: // IS_STATEFUL - return IS_STATEFUL; - case 6: // ENVS - return ENVS; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __PARTITION_COUNT_ISSET_ID = 0; - private static final int __REPLICA_COUNT_ISSET_ID = 1; - private static final int __SUCCESS_IF_EXIST_ISSET_ID = 2; - private static final int __IS_STATEFUL_ISSET_ID = 3; - private byte __isset_bitfield = 0; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put( - _Fields.PARTITION_COUNT, - new org.apache.thrift.meta_data.FieldMetaData( - "partition_count", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I32))); - tmpMap.put( - _Fields.REPLICA_COUNT, - new org.apache.thrift.meta_data.FieldMetaData( - "replica_count", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I32))); - tmpMap.put( - _Fields.SUCCESS_IF_EXIST, - new org.apache.thrift.meta_data.FieldMetaData( - "success_if_exist", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.BOOL))); - tmpMap.put( - _Fields.APP_TYPE, - new org.apache.thrift.meta_data.FieldMetaData( - "app_type", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.STRING))); - tmpMap.put( - _Fields.IS_STATEFUL, - new org.apache.thrift.meta_data.FieldMetaData( - "is_stateful", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.BOOL))); - tmpMap.put( - _Fields.ENVS, - new org.apache.thrift.meta_data.FieldMetaData( - "envs", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.MapMetaData( - org.apache.thrift.protocol.TType.MAP, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.STRING), - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.STRING)))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap( - create_app_options.class, metaDataMap); - } - - public create_app_options() {} - - public create_app_options( - int partition_count, - int replica_count, - boolean success_if_exist, - java.lang.String app_type, - boolean is_stateful, - java.util.Map envs) { - this(); - this.partition_count = partition_count; - setPartition_countIsSet(true); - this.replica_count = replica_count; - setReplica_countIsSet(true); - this.success_if_exist = success_if_exist; - setSuccess_if_existIsSet(true); - this.app_type = app_type; - this.is_stateful = is_stateful; - setIs_statefulIsSet(true); - this.envs = envs; - } - - /** Performs a deep copy on other. */ - public create_app_options(create_app_options other) { - __isset_bitfield = other.__isset_bitfield; - this.partition_count = other.partition_count; - this.replica_count = other.replica_count; - this.success_if_exist = other.success_if_exist; - if (other.isSetApp_type()) { - this.app_type = other.app_type; - } - this.is_stateful = other.is_stateful; - if (other.isSetEnvs()) { - java.util.Map __this__envs = - new java.util.HashMap(other.envs); - this.envs = __this__envs; - } - } - - public create_app_options deepCopy() { - return new create_app_options(this); - } - - @Override - public void clear() { - setPartition_countIsSet(false); - this.partition_count = 0; - setReplica_countIsSet(false); - this.replica_count = 0; - setSuccess_if_existIsSet(false); - this.success_if_exist = false; - this.app_type = null; - setIs_statefulIsSet(false); - this.is_stateful = false; - this.envs = null; - } - - public int getPartition_count() { - return this.partition_count; - } - - public create_app_options setPartition_count(int partition_count) { - this.partition_count = partition_count; - setPartition_countIsSet(true); - return this; - } - - public void unsetPartition_count() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __PARTITION_COUNT_ISSET_ID); - } - - /** - * Returns true if field partition_count is set (has been assigned a value) and false otherwise - */ - public boolean isSetPartition_count() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __PARTITION_COUNT_ISSET_ID); - } - - public void setPartition_countIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __PARTITION_COUNT_ISSET_ID, value); - } - - public int getReplica_count() { - return this.replica_count; - } - - public create_app_options setReplica_count(int replica_count) { - this.replica_count = replica_count; - setReplica_countIsSet(true); - return this; - } - - public void unsetReplica_count() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __REPLICA_COUNT_ISSET_ID); - } - - /** Returns true if field replica_count is set (has been assigned a value) and false otherwise */ - public boolean isSetReplica_count() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __REPLICA_COUNT_ISSET_ID); - } - - public void setReplica_countIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __REPLICA_COUNT_ISSET_ID, value); - } - - public boolean isSuccess_if_exist() { - return this.success_if_exist; - } - - public create_app_options setSuccess_if_exist(boolean success_if_exist) { - this.success_if_exist = success_if_exist; - setSuccess_if_existIsSet(true); - return this; - } - - public void unsetSuccess_if_exist() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_IF_EXIST_ISSET_ID); - } - - /** - * Returns true if field success_if_exist is set (has been assigned a value) and false otherwise - */ - public boolean isSetSuccess_if_exist() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SUCCESS_IF_EXIST_ISSET_ID); - } - - public void setSuccess_if_existIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit( - __isset_bitfield, __SUCCESS_IF_EXIST_ISSET_ID, value); - } - - public java.lang.String getApp_type() { - return this.app_type; - } - - public create_app_options setApp_type(java.lang.String app_type) { - this.app_type = app_type; - return this; - } - - public void unsetApp_type() { - this.app_type = null; - } - - /** Returns true if field app_type is set (has been assigned a value) and false otherwise */ - public boolean isSetApp_type() { - return this.app_type != null; - } - - public void setApp_typeIsSet(boolean value) { - if (!value) { - this.app_type = null; - } - } - - public boolean isIs_stateful() { - return this.is_stateful; - } - - public create_app_options setIs_stateful(boolean is_stateful) { - this.is_stateful = is_stateful; - setIs_statefulIsSet(true); - return this; - } - - public void unsetIs_stateful() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __IS_STATEFUL_ISSET_ID); - } - - /** Returns true if field is_stateful is set (has been assigned a value) and false otherwise */ - public boolean isSetIs_stateful() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __IS_STATEFUL_ISSET_ID); - } - - public void setIs_statefulIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __IS_STATEFUL_ISSET_ID, value); - } - - public int getEnvsSize() { - return (this.envs == null) ? 0 : this.envs.size(); - } - - public void putToEnvs(java.lang.String key, java.lang.String val) { - if (this.envs == null) { - this.envs = new java.util.HashMap(); - } - this.envs.put(key, val); - } - - public java.util.Map getEnvs() { - return this.envs; - } - - public create_app_options setEnvs(java.util.Map envs) { - this.envs = envs; - return this; - } - - public void unsetEnvs() { - this.envs = null; - } - - /** Returns true if field envs is set (has been assigned a value) and false otherwise */ - public boolean isSetEnvs() { - return this.envs != null; - } - - public void setEnvsIsSet(boolean value) { - if (!value) { - this.envs = null; - } - } - - public void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case PARTITION_COUNT: - if (value == null) { - unsetPartition_count(); - } else { - setPartition_count((java.lang.Integer) value); - } - break; - - case REPLICA_COUNT: - if (value == null) { - unsetReplica_count(); - } else { - setReplica_count((java.lang.Integer) value); - } - break; - - case SUCCESS_IF_EXIST: - if (value == null) { - unsetSuccess_if_exist(); - } else { - setSuccess_if_exist((java.lang.Boolean) value); - } - break; - - case APP_TYPE: - if (value == null) { - unsetApp_type(); - } else { - setApp_type((java.lang.String) value); - } - break; - - case IS_STATEFUL: - if (value == null) { - unsetIs_stateful(); - } else { - setIs_stateful((java.lang.Boolean) value); - } - break; - - case ENVS: - if (value == null) { - unsetEnvs(); - } else { - setEnvs((java.util.Map) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case PARTITION_COUNT: - return getPartition_count(); - - case REPLICA_COUNT: - return getReplica_count(); - - case SUCCESS_IF_EXIST: - return isSuccess_if_exist(); - - case APP_TYPE: - return getApp_type(); - - case IS_STATEFUL: - return isIs_stateful(); - - case ENVS: - return getEnvs(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case PARTITION_COUNT: - return isSetPartition_count(); - case REPLICA_COUNT: - return isSetReplica_count(); - case SUCCESS_IF_EXIST: - return isSetSuccess_if_exist(); - case APP_TYPE: - return isSetApp_type(); - case IS_STATEFUL: - return isSetIs_stateful(); - case ENVS: - return isSetEnvs(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof create_app_options) return this.equals((create_app_options) that); - return false; - } - - public boolean equals(create_app_options that) { - if (that == null) return false; - if (this == that) return true; - - boolean this_present_partition_count = true; - boolean that_present_partition_count = true; - if (this_present_partition_count || that_present_partition_count) { - if (!(this_present_partition_count && that_present_partition_count)) return false; - if (this.partition_count != that.partition_count) return false; - } - - boolean this_present_replica_count = true; - boolean that_present_replica_count = true; - if (this_present_replica_count || that_present_replica_count) { - if (!(this_present_replica_count && that_present_replica_count)) return false; - if (this.replica_count != that.replica_count) return false; - } - - boolean this_present_success_if_exist = true; - boolean that_present_success_if_exist = true; - if (this_present_success_if_exist || that_present_success_if_exist) { - if (!(this_present_success_if_exist && that_present_success_if_exist)) return false; - if (this.success_if_exist != that.success_if_exist) return false; - } - - boolean this_present_app_type = true && this.isSetApp_type(); - boolean that_present_app_type = true && that.isSetApp_type(); - if (this_present_app_type || that_present_app_type) { - if (!(this_present_app_type && that_present_app_type)) return false; - if (!this.app_type.equals(that.app_type)) return false; - } - - boolean this_present_is_stateful = true; - boolean that_present_is_stateful = true; - if (this_present_is_stateful || that_present_is_stateful) { - if (!(this_present_is_stateful && that_present_is_stateful)) return false; - if (this.is_stateful != that.is_stateful) return false; - } - - boolean this_present_envs = true && this.isSetEnvs(); - boolean that_present_envs = true && that.isSetEnvs(); - if (this_present_envs || that_present_envs) { - if (!(this_present_envs && that_present_envs)) return false; - if (!this.envs.equals(that.envs)) return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + partition_count; - - hashCode = hashCode * 8191 + replica_count; - - hashCode = hashCode * 8191 + ((success_if_exist) ? 131071 : 524287); - - hashCode = hashCode * 8191 + ((isSetApp_type()) ? 131071 : 524287); - if (isSetApp_type()) hashCode = hashCode * 8191 + app_type.hashCode(); - - hashCode = hashCode * 8191 + ((is_stateful) ? 131071 : 524287); - - hashCode = hashCode * 8191 + ((isSetEnvs()) ? 131071 : 524287); - if (isSetEnvs()) hashCode = hashCode * 8191 + envs.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(create_app_options other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = - java.lang.Boolean.valueOf(isSetPartition_count()).compareTo(other.isSetPartition_count()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetPartition_count()) { - lastComparison = - org.apache.thrift.TBaseHelper.compareTo(this.partition_count, other.partition_count); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetReplica_count()).compareTo(other.isSetReplica_count()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReplica_count()) { - lastComparison = - org.apache.thrift.TBaseHelper.compareTo(this.replica_count, other.replica_count); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetSuccess_if_exist()).compareTo(other.isSetSuccess_if_exist()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess_if_exist()) { - lastComparison = - org.apache.thrift.TBaseHelper.compareTo(this.success_if_exist, other.success_if_exist); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetApp_type()).compareTo(other.isSetApp_type()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetApp_type()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.app_type, other.app_type); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetIs_stateful()).compareTo(other.isSetIs_stateful()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetIs_stateful()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.is_stateful, other.is_stateful); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetEnvs()).compareTo(other.isSetEnvs()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetEnvs()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.envs, other.envs); - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("create_app_options("); - boolean first = true; - - sb.append("partition_count:"); - sb.append(this.partition_count); - first = false; - if (!first) sb.append(", "); - sb.append("replica_count:"); - sb.append(this.replica_count); - first = false; - if (!first) sb.append(", "); - sb.append("success_if_exist:"); - sb.append(this.success_if_exist); - first = false; - if (!first) sb.append(", "); - sb.append("app_type:"); - if (this.app_type == null) { - sb.append("null"); - } else { - sb.append(this.app_type); - } - first = false; - if (!first) sb.append(", "); - sb.append("is_stateful:"); - sb.append(this.is_stateful); - first = false; - if (!first) sb.append(", "); - sb.append("envs:"); - if (this.envs == null) { - sb.append("null"); - } else { - sb.append(this.envs); - } - 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, java.lang.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 create_app_optionsStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public create_app_optionsStandardScheme getScheme() { - return new create_app_optionsStandardScheme(); - } - } - - private static class create_app_optionsStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, create_app_options 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: // PARTITION_COUNT - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.partition_count = iprot.readI32(); - struct.setPartition_countIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // REPLICA_COUNT - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.replica_count = iprot.readI32(); - struct.setReplica_countIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // SUCCESS_IF_EXIST - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.success_if_exist = iprot.readBool(); - struct.setSuccess_if_existIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // APP_TYPE - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.app_type = iprot.readString(); - struct.setApp_typeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 5: // IS_STATEFUL - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.is_stateful = iprot.readBool(); - struct.setIs_statefulIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 6: // ENVS - if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { - { - org.apache.thrift.protocol.TMap _map0 = iprot.readMapBegin(); - struct.envs = - new java.util.HashMap(2 * _map0.size); - java.lang.String _key1; - java.lang.String _val2; - for (int _i3 = 0; _i3 < _map0.size; ++_i3) { - _key1 = iprot.readString(); - _val2 = iprot.readString(); - struct.envs.put(_key1, _val2); - } - iprot.readMapEnd(); - } - struct.setEnvsIsSet(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, create_app_options struct) - throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(PARTITION_COUNT_FIELD_DESC); - oprot.writeI32(struct.partition_count); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(REPLICA_COUNT_FIELD_DESC); - oprot.writeI32(struct.replica_count); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(SUCCESS_IF_EXIST_FIELD_DESC); - oprot.writeBool(struct.success_if_exist); - oprot.writeFieldEnd(); - if (struct.app_type != null) { - oprot.writeFieldBegin(APP_TYPE_FIELD_DESC); - oprot.writeString(struct.app_type); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(IS_STATEFUL_FIELD_DESC); - oprot.writeBool(struct.is_stateful); - oprot.writeFieldEnd(); - if (struct.envs != null) { - oprot.writeFieldBegin(ENVS_FIELD_DESC); - { - oprot.writeMapBegin( - new org.apache.thrift.protocol.TMap( - org.apache.thrift.protocol.TType.STRING, - org.apache.thrift.protocol.TType.STRING, - struct.envs.size())); - for (java.util.Map.Entry _iter4 : - struct.envs.entrySet()) { - oprot.writeString(_iter4.getKey()); - oprot.writeString(_iter4.getValue()); - } - oprot.writeMapEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class create_app_optionsTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public create_app_optionsTupleScheme getScheme() { - return new create_app_optionsTupleScheme(); - } - } - - private static class create_app_optionsTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, create_app_options struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetPartition_count()) { - optionals.set(0); - } - if (struct.isSetReplica_count()) { - optionals.set(1); - } - if (struct.isSetSuccess_if_exist()) { - optionals.set(2); - } - if (struct.isSetApp_type()) { - optionals.set(3); - } - if (struct.isSetIs_stateful()) { - optionals.set(4); - } - if (struct.isSetEnvs()) { - optionals.set(5); - } - oprot.writeBitSet(optionals, 6); - if (struct.isSetPartition_count()) { - oprot.writeI32(struct.partition_count); - } - if (struct.isSetReplica_count()) { - oprot.writeI32(struct.replica_count); - } - if (struct.isSetSuccess_if_exist()) { - oprot.writeBool(struct.success_if_exist); - } - if (struct.isSetApp_type()) { - oprot.writeString(struct.app_type); - } - if (struct.isSetIs_stateful()) { - oprot.writeBool(struct.is_stateful); - } - if (struct.isSetEnvs()) { - { - oprot.writeI32(struct.envs.size()); - for (java.util.Map.Entry _iter5 : - struct.envs.entrySet()) { - oprot.writeString(_iter5.getKey()); - oprot.writeString(_iter5.getValue()); - } - } - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, create_app_options struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(6); - if (incoming.get(0)) { - struct.partition_count = iprot.readI32(); - struct.setPartition_countIsSet(true); - } - if (incoming.get(1)) { - struct.replica_count = iprot.readI32(); - struct.setReplica_countIsSet(true); - } - if (incoming.get(2)) { - struct.success_if_exist = iprot.readBool(); - struct.setSuccess_if_existIsSet(true); - } - if (incoming.get(3)) { - struct.app_type = iprot.readString(); - struct.setApp_typeIsSet(true); - } - if (incoming.get(4)) { - struct.is_stateful = iprot.readBool(); - struct.setIs_statefulIsSet(true); - } - if (incoming.get(5)) { - { - org.apache.thrift.protocol.TMap _map6 = - new org.apache.thrift.protocol.TMap( - org.apache.thrift.protocol.TType.STRING, - org.apache.thrift.protocol.TType.STRING, - iprot.readI32()); - struct.envs = new java.util.HashMap(2 * _map6.size); - java.lang.String _key7; - java.lang.String _val8; - for (int _i9 = 0; _i9 < _map6.size; ++_i9) { - _key7 = iprot.readString(); - _val8 = iprot.readString(); - struct.envs.put(_key7, _val8); - } - } - struct.setEnvsIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } -} diff --git a/java-client/src/main/java/org/apache/pegasus/replication/drop_app_options.java b/java-client/src/main/java/org/apache/pegasus/replication/drop_app_options.java deleted file mode 100644 index f44dcaa331..0000000000 --- a/java-client/src/main/java/org/apache/pegasus/replication/drop_app_options.java +++ /dev/null @@ -1,534 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.11.0) - * - *

DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * - * @generated - */ -package org.apache.pegasus.replication; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated( - value = "Autogenerated by Thrift Compiler (0.11.0)", - date = "2022-05-17") -public class drop_app_options - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("drop_app_options"); - - private static final org.apache.thrift.protocol.TField SUCCESS_IF_NOT_EXIST_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "success_if_not_exist", org.apache.thrift.protocol.TType.BOOL, (short) 1); - private static final org.apache.thrift.protocol.TField RESERVE_SECONDS_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "reserve_seconds", org.apache.thrift.protocol.TType.I64, (short) 2); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new drop_app_optionsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new drop_app_optionsTupleSchemeFactory(); - - public boolean success_if_not_exist; // required - public long reserve_seconds; // 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 { - SUCCESS_IF_NOT_EXIST((short) 1, "success_if_not_exist"), - RESERVE_SECONDS((short) 2, "reserve_seconds"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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: // SUCCESS_IF_NOT_EXIST - return SUCCESS_IF_NOT_EXIST; - case 2: // RESERVE_SECONDS - return RESERVE_SECONDS; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __SUCCESS_IF_NOT_EXIST_ISSET_ID = 0; - private static final int __RESERVE_SECONDS_ISSET_ID = 1; - private byte __isset_bitfield = 0; - private static final _Fields optionals[] = {_Fields.RESERVE_SECONDS}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put( - _Fields.SUCCESS_IF_NOT_EXIST, - new org.apache.thrift.meta_data.FieldMetaData( - "success_if_not_exist", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.BOOL))); - tmpMap.put( - _Fields.RESERVE_SECONDS, - new org.apache.thrift.meta_data.FieldMetaData( - "reserve_seconds", - org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I64))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap( - drop_app_options.class, metaDataMap); - } - - public drop_app_options() {} - - public drop_app_options(boolean success_if_not_exist) { - this(); - this.success_if_not_exist = success_if_not_exist; - setSuccess_if_not_existIsSet(true); - } - - /** Performs a deep copy on other. */ - public drop_app_options(drop_app_options other) { - __isset_bitfield = other.__isset_bitfield; - this.success_if_not_exist = other.success_if_not_exist; - this.reserve_seconds = other.reserve_seconds; - } - - public drop_app_options deepCopy() { - return new drop_app_options(this); - } - - @Override - public void clear() { - setSuccess_if_not_existIsSet(false); - this.success_if_not_exist = false; - setReserve_secondsIsSet(false); - this.reserve_seconds = 0; - } - - public boolean isSuccess_if_not_exist() { - return this.success_if_not_exist; - } - - public drop_app_options setSuccess_if_not_exist(boolean success_if_not_exist) { - this.success_if_not_exist = success_if_not_exist; - setSuccess_if_not_existIsSet(true); - return this; - } - - public void unsetSuccess_if_not_exist() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_IF_NOT_EXIST_ISSET_ID); - } - - /** - * Returns true if field success_if_not_exist is set (has been assigned a value) and false - * otherwise - */ - public boolean isSetSuccess_if_not_exist() { - return org.apache.thrift.EncodingUtils.testBit( - __isset_bitfield, __SUCCESS_IF_NOT_EXIST_ISSET_ID); - } - - public void setSuccess_if_not_existIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit( - __isset_bitfield, __SUCCESS_IF_NOT_EXIST_ISSET_ID, value); - } - - public long getReserve_seconds() { - return this.reserve_seconds; - } - - public drop_app_options setReserve_seconds(long reserve_seconds) { - this.reserve_seconds = reserve_seconds; - setReserve_secondsIsSet(true); - return this; - } - - public void unsetReserve_seconds() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __RESERVE_SECONDS_ISSET_ID); - } - - /** - * Returns true if field reserve_seconds is set (has been assigned a value) and false otherwise - */ - public boolean isSetReserve_seconds() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __RESERVE_SECONDS_ISSET_ID); - } - - public void setReserve_secondsIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __RESERVE_SECONDS_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case SUCCESS_IF_NOT_EXIST: - if (value == null) { - unsetSuccess_if_not_exist(); - } else { - setSuccess_if_not_exist((java.lang.Boolean) value); - } - break; - - case RESERVE_SECONDS: - if (value == null) { - unsetReserve_seconds(); - } else { - setReserve_seconds((java.lang.Long) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS_IF_NOT_EXIST: - return isSuccess_if_not_exist(); - - case RESERVE_SECONDS: - return getReserve_seconds(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case SUCCESS_IF_NOT_EXIST: - return isSetSuccess_if_not_exist(); - case RESERVE_SECONDS: - return isSetReserve_seconds(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof drop_app_options) return this.equals((drop_app_options) that); - return false; - } - - public boolean equals(drop_app_options that) { - if (that == null) return false; - if (this == that) return true; - - boolean this_present_success_if_not_exist = true; - boolean that_present_success_if_not_exist = true; - if (this_present_success_if_not_exist || that_present_success_if_not_exist) { - if (!(this_present_success_if_not_exist && that_present_success_if_not_exist)) return false; - if (this.success_if_not_exist != that.success_if_not_exist) return false; - } - - boolean this_present_reserve_seconds = true && this.isSetReserve_seconds(); - boolean that_present_reserve_seconds = true && that.isSetReserve_seconds(); - if (this_present_reserve_seconds || that_present_reserve_seconds) { - if (!(this_present_reserve_seconds && that_present_reserve_seconds)) return false; - if (this.reserve_seconds != that.reserve_seconds) return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((success_if_not_exist) ? 131071 : 524287); - - hashCode = hashCode * 8191 + ((isSetReserve_seconds()) ? 131071 : 524287); - if (isSetReserve_seconds()) - hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(reserve_seconds); - - return hashCode; - } - - @Override - public int compareTo(drop_app_options other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = - java.lang.Boolean.valueOf(isSetSuccess_if_not_exist()) - .compareTo(other.isSetSuccess_if_not_exist()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess_if_not_exist()) { - lastComparison = - org.apache.thrift.TBaseHelper.compareTo( - this.success_if_not_exist, other.success_if_not_exist); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetReserve_seconds()).compareTo(other.isSetReserve_seconds()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReserve_seconds()) { - lastComparison = - org.apache.thrift.TBaseHelper.compareTo(this.reserve_seconds, other.reserve_seconds); - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("drop_app_options("); - boolean first = true; - - sb.append("success_if_not_exist:"); - sb.append(this.success_if_not_exist); - first = false; - if (isSetReserve_seconds()) { - if (!first) sb.append(", "); - sb.append("reserve_seconds:"); - sb.append(this.reserve_seconds); - 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, java.lang.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 drop_app_optionsStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public drop_app_optionsStandardScheme getScheme() { - return new drop_app_optionsStandardScheme(); - } - } - - private static class drop_app_optionsStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, drop_app_options 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: // SUCCESS_IF_NOT_EXIST - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.success_if_not_exist = iprot.readBool(); - struct.setSuccess_if_not_existIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // RESERVE_SECONDS - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.reserve_seconds = iprot.readI64(); - struct.setReserve_secondsIsSet(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, drop_app_options struct) - throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(SUCCESS_IF_NOT_EXIST_FIELD_DESC); - oprot.writeBool(struct.success_if_not_exist); - oprot.writeFieldEnd(); - if (struct.isSetReserve_seconds()) { - oprot.writeFieldBegin(RESERVE_SECONDS_FIELD_DESC); - oprot.writeI64(struct.reserve_seconds); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class drop_app_optionsTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public drop_app_optionsTupleScheme getScheme() { - return new drop_app_optionsTupleScheme(); - } - } - - private static class drop_app_optionsTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, drop_app_options struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetSuccess_if_not_exist()) { - optionals.set(0); - } - if (struct.isSetReserve_seconds()) { - optionals.set(1); - } - oprot.writeBitSet(optionals, 2); - if (struct.isSetSuccess_if_not_exist()) { - oprot.writeBool(struct.success_if_not_exist); - } - if (struct.isSetReserve_seconds()) { - oprot.writeI64(struct.reserve_seconds); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, drop_app_options struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(2); - if (incoming.get(0)) { - struct.success_if_not_exist = iprot.readBool(); - struct.setSuccess_if_not_existIsSet(true); - } - if (incoming.get(1)) { - struct.reserve_seconds = iprot.readI64(); - struct.setReserve_secondsIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } -} diff --git a/java-client/src/main/java/org/apache/pegasus/replication/partition_configuration.java b/java-client/src/main/java/org/apache/pegasus/replication/partition_configuration.java deleted file mode 100644 index 50411752aa..0000000000 --- a/java-client/src/main/java/org/apache/pegasus/replication/partition_configuration.java +++ /dev/null @@ -1,1196 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.11.0) - * - *

DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * - * @generated - */ -package org.apache.pegasus.replication; - -import org.apache.pegasus.base.gpid; -import org.apache.pegasus.base.rpc_address; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated( - value = "Autogenerated by Thrift Compiler (0.11.0)", - date = "2020-04-13") -public class partition_configuration - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("partition_configuration"); - - private static final org.apache.thrift.protocol.TField PID_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "pid", org.apache.thrift.protocol.TType.STRUCT, (short) 1); - private static final org.apache.thrift.protocol.TField BALLOT_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "ballot", org.apache.thrift.protocol.TType.I64, (short) 2); - private static final org.apache.thrift.protocol.TField MAX_REPLICA_COUNT_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "max_replica_count", org.apache.thrift.protocol.TType.I32, (short) 3); - private static final org.apache.thrift.protocol.TField PRIMARY_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "primary", org.apache.thrift.protocol.TType.STRUCT, (short) 4); - private static final org.apache.thrift.protocol.TField SECONDARIES_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "secondaries", org.apache.thrift.protocol.TType.LIST, (short) 5); - private static final org.apache.thrift.protocol.TField LAST_DROPS_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "last_drops", org.apache.thrift.protocol.TType.LIST, (short) 6); - private static final org.apache.thrift.protocol.TField LAST_COMMITTED_DECREE_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "last_committed_decree", org.apache.thrift.protocol.TType.I64, (short) 7); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new partition_configurationStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new partition_configurationTupleSchemeFactory(); - - public gpid pid; // required - public long ballot; // required - public int max_replica_count; // required - public rpc_address primary; // required - public java.util.List secondaries; // required - public java.util.List last_drops; // required - public long last_committed_decree; // 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 { - PID((short) 1, "pid"), - BALLOT((short) 2, "ballot"), - MAX_REPLICA_COUNT((short) 3, "max_replica_count"), - PRIMARY((short) 4, "primary"), - SECONDARIES((short) 5, "secondaries"), - LAST_DROPS((short) 6, "last_drops"), - LAST_COMMITTED_DECREE((short) 7, "last_committed_decree"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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: // PID - return PID; - case 2: // BALLOT - return BALLOT; - case 3: // MAX_REPLICA_COUNT - return MAX_REPLICA_COUNT; - case 4: // PRIMARY - return PRIMARY; - case 5: // SECONDARIES - return SECONDARIES; - case 6: // LAST_DROPS - return LAST_DROPS; - case 7: // LAST_COMMITTED_DECREE - return LAST_COMMITTED_DECREE; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __BALLOT_ISSET_ID = 0; - private static final int __MAX_REPLICA_COUNT_ISSET_ID = 1; - private static final int __LAST_COMMITTED_DECREE_ISSET_ID = 2; - private byte __isset_bitfield = 0; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put( - _Fields.PID, - new org.apache.thrift.meta_data.FieldMetaData( - "pid", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData( - org.apache.thrift.protocol.TType.STRUCT, gpid.class))); - tmpMap.put( - _Fields.BALLOT, - new org.apache.thrift.meta_data.FieldMetaData( - "ballot", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I64))); - tmpMap.put( - _Fields.MAX_REPLICA_COUNT, - new org.apache.thrift.meta_data.FieldMetaData( - "max_replica_count", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I32))); - tmpMap.put( - _Fields.PRIMARY, - new org.apache.thrift.meta_data.FieldMetaData( - "primary", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData( - org.apache.thrift.protocol.TType.STRUCT, rpc_address.class))); - tmpMap.put( - _Fields.SECONDARIES, - new org.apache.thrift.meta_data.FieldMetaData( - "secondaries", - 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, rpc_address.class)))); - tmpMap.put( - _Fields.LAST_DROPS, - new org.apache.thrift.meta_data.FieldMetaData( - "last_drops", - 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, rpc_address.class)))); - tmpMap.put( - _Fields.LAST_COMMITTED_DECREE, - new org.apache.thrift.meta_data.FieldMetaData( - "last_committed_decree", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I64))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap( - partition_configuration.class, metaDataMap); - } - - public partition_configuration() {} - - public partition_configuration( - gpid pid, - long ballot, - int max_replica_count, - rpc_address primary, - java.util.List secondaries, - java.util.List last_drops, - long last_committed_decree) { - this(); - this.pid = pid; - this.ballot = ballot; - setBallotIsSet(true); - this.max_replica_count = max_replica_count; - setMax_replica_countIsSet(true); - this.primary = primary; - this.secondaries = secondaries; - this.last_drops = last_drops; - this.last_committed_decree = last_committed_decree; - setLast_committed_decreeIsSet(true); - } - - /** Performs a deep copy on other. */ - public partition_configuration(partition_configuration other) { - __isset_bitfield = other.__isset_bitfield; - if (other.isSetPid()) { - this.pid = new gpid(other.pid); - } - this.ballot = other.ballot; - this.max_replica_count = other.max_replica_count; - if (other.isSetPrimary()) { - this.primary = new rpc_address(other.primary); - } - if (other.isSetSecondaries()) { - java.util.List __this__secondaries = - new java.util.ArrayList(other.secondaries.size()); - for (rpc_address other_element : other.secondaries) { - __this__secondaries.add(new rpc_address(other_element)); - } - this.secondaries = __this__secondaries; - } - if (other.isSetLast_drops()) { - java.util.List __this__last_drops = - new java.util.ArrayList(other.last_drops.size()); - for (rpc_address other_element : other.last_drops) { - __this__last_drops.add(new rpc_address(other_element)); - } - this.last_drops = __this__last_drops; - } - this.last_committed_decree = other.last_committed_decree; - } - - public partition_configuration deepCopy() { - return new partition_configuration(this); - } - - @Override - public void clear() { - this.pid = null; - setBallotIsSet(false); - this.ballot = 0; - setMax_replica_countIsSet(false); - this.max_replica_count = 0; - this.primary = null; - this.secondaries = null; - this.last_drops = null; - setLast_committed_decreeIsSet(false); - this.last_committed_decree = 0; - } - - public gpid getPid() { - return this.pid; - } - - public partition_configuration setPid(gpid pid) { - this.pid = pid; - return this; - } - - public void unsetPid() { - this.pid = null; - } - - /** Returns true if field pid is set (has been assigned a value) and false otherwise */ - public boolean isSetPid() { - return this.pid != null; - } - - public void setPidIsSet(boolean value) { - if (!value) { - this.pid = null; - } - } - - public long getBallot() { - return this.ballot; - } - - public partition_configuration setBallot(long ballot) { - this.ballot = ballot; - setBallotIsSet(true); - return this; - } - - public void unsetBallot() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __BALLOT_ISSET_ID); - } - - /** Returns true if field ballot is set (has been assigned a value) and false otherwise */ - public boolean isSetBallot() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __BALLOT_ISSET_ID); - } - - public void setBallotIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __BALLOT_ISSET_ID, value); - } - - public int getMax_replica_count() { - return this.max_replica_count; - } - - public partition_configuration setMax_replica_count(int max_replica_count) { - this.max_replica_count = max_replica_count; - setMax_replica_countIsSet(true); - return this; - } - - public void unsetMax_replica_count() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __MAX_REPLICA_COUNT_ISSET_ID); - } - - /** - * Returns true if field max_replica_count is set (has been assigned a value) and false otherwise - */ - public boolean isSetMax_replica_count() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __MAX_REPLICA_COUNT_ISSET_ID); - } - - public void setMax_replica_countIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit( - __isset_bitfield, __MAX_REPLICA_COUNT_ISSET_ID, value); - } - - public rpc_address getPrimary() { - return this.primary; - } - - public partition_configuration setPrimary(rpc_address primary) { - this.primary = primary; - return this; - } - - public void unsetPrimary() { - this.primary = null; - } - - /** Returns true if field primary is set (has been assigned a value) and false otherwise */ - public boolean isSetPrimary() { - return this.primary != null; - } - - public void setPrimaryIsSet(boolean value) { - if (!value) { - this.primary = null; - } - } - - public int getSecondariesSize() { - return (this.secondaries == null) ? 0 : this.secondaries.size(); - } - - public java.util.Iterator getSecondariesIterator() { - return (this.secondaries == null) ? null : this.secondaries.iterator(); - } - - public void addToSecondaries(rpc_address elem) { - if (this.secondaries == null) { - this.secondaries = new java.util.ArrayList(); - } - this.secondaries.add(elem); - } - - public java.util.List getSecondaries() { - return this.secondaries; - } - - public partition_configuration setSecondaries(java.util.List secondaries) { - this.secondaries = secondaries; - return this; - } - - public void unsetSecondaries() { - this.secondaries = null; - } - - /** Returns true if field secondaries is set (has been assigned a value) and false otherwise */ - public boolean isSetSecondaries() { - return this.secondaries != null; - } - - public void setSecondariesIsSet(boolean value) { - if (!value) { - this.secondaries = null; - } - } - - public int getLast_dropsSize() { - return (this.last_drops == null) ? 0 : this.last_drops.size(); - } - - public java.util.Iterator getLast_dropsIterator() { - return (this.last_drops == null) ? null : this.last_drops.iterator(); - } - - public void addToLast_drops(rpc_address elem) { - if (this.last_drops == null) { - this.last_drops = new java.util.ArrayList(); - } - this.last_drops.add(elem); - } - - public java.util.List getLast_drops() { - return this.last_drops; - } - - public partition_configuration setLast_drops(java.util.List last_drops) { - this.last_drops = last_drops; - return this; - } - - public void unsetLast_drops() { - this.last_drops = null; - } - - /** Returns true if field last_drops is set (has been assigned a value) and false otherwise */ - public boolean isSetLast_drops() { - return this.last_drops != null; - } - - public void setLast_dropsIsSet(boolean value) { - if (!value) { - this.last_drops = null; - } - } - - public long getLast_committed_decree() { - return this.last_committed_decree; - } - - public partition_configuration setLast_committed_decree(long last_committed_decree) { - this.last_committed_decree = last_committed_decree; - setLast_committed_decreeIsSet(true); - return this; - } - - public void unsetLast_committed_decree() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit( - __isset_bitfield, __LAST_COMMITTED_DECREE_ISSET_ID); - } - - /** - * Returns true if field last_committed_decree is set (has been assigned a value) and false - * otherwise - */ - public boolean isSetLast_committed_decree() { - return org.apache.thrift.EncodingUtils.testBit( - __isset_bitfield, __LAST_COMMITTED_DECREE_ISSET_ID); - } - - public void setLast_committed_decreeIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit( - __isset_bitfield, __LAST_COMMITTED_DECREE_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case PID: - if (value == null) { - unsetPid(); - } else { - setPid((gpid) value); - } - break; - - case BALLOT: - if (value == null) { - unsetBallot(); - } else { - setBallot((java.lang.Long) value); - } - break; - - case MAX_REPLICA_COUNT: - if (value == null) { - unsetMax_replica_count(); - } else { - setMax_replica_count((java.lang.Integer) value); - } - break; - - case PRIMARY: - if (value == null) { - unsetPrimary(); - } else { - setPrimary((rpc_address) value); - } - break; - - case SECONDARIES: - if (value == null) { - unsetSecondaries(); - } else { - setSecondaries((java.util.List) value); - } - break; - - case LAST_DROPS: - if (value == null) { - unsetLast_drops(); - } else { - setLast_drops((java.util.List) value); - } - break; - - case LAST_COMMITTED_DECREE: - if (value == null) { - unsetLast_committed_decree(); - } else { - setLast_committed_decree((java.lang.Long) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case PID: - return getPid(); - - case BALLOT: - return getBallot(); - - case MAX_REPLICA_COUNT: - return getMax_replica_count(); - - case PRIMARY: - return getPrimary(); - - case SECONDARIES: - return getSecondaries(); - - case LAST_DROPS: - return getLast_drops(); - - case LAST_COMMITTED_DECREE: - return getLast_committed_decree(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case PID: - return isSetPid(); - case BALLOT: - return isSetBallot(); - case MAX_REPLICA_COUNT: - return isSetMax_replica_count(); - case PRIMARY: - return isSetPrimary(); - case SECONDARIES: - return isSetSecondaries(); - case LAST_DROPS: - return isSetLast_drops(); - case LAST_COMMITTED_DECREE: - return isSetLast_committed_decree(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof partition_configuration) return this.equals((partition_configuration) that); - return false; - } - - public boolean equals(partition_configuration that) { - if (that == null) return false; - if (this == that) return true; - - boolean this_present_pid = true && this.isSetPid(); - boolean that_present_pid = true && that.isSetPid(); - if (this_present_pid || that_present_pid) { - if (!(this_present_pid && that_present_pid)) return false; - if (!this.pid.equals(that.pid)) return false; - } - - boolean this_present_ballot = true; - boolean that_present_ballot = true; - if (this_present_ballot || that_present_ballot) { - if (!(this_present_ballot && that_present_ballot)) return false; - if (this.ballot != that.ballot) return false; - } - - boolean this_present_max_replica_count = true; - boolean that_present_max_replica_count = true; - if (this_present_max_replica_count || that_present_max_replica_count) { - if (!(this_present_max_replica_count && that_present_max_replica_count)) return false; - if (this.max_replica_count != that.max_replica_count) return false; - } - - boolean this_present_primary = true && this.isSetPrimary(); - boolean that_present_primary = true && that.isSetPrimary(); - if (this_present_primary || that_present_primary) { - if (!(this_present_primary && that_present_primary)) return false; - if (!this.primary.equals(that.primary)) return false; - } - - boolean this_present_secondaries = true && this.isSetSecondaries(); - boolean that_present_secondaries = true && that.isSetSecondaries(); - if (this_present_secondaries || that_present_secondaries) { - if (!(this_present_secondaries && that_present_secondaries)) return false; - if (!this.secondaries.equals(that.secondaries)) return false; - } - - boolean this_present_last_drops = true && this.isSetLast_drops(); - boolean that_present_last_drops = true && that.isSetLast_drops(); - if (this_present_last_drops || that_present_last_drops) { - if (!(this_present_last_drops && that_present_last_drops)) return false; - if (!this.last_drops.equals(that.last_drops)) return false; - } - - boolean this_present_last_committed_decree = true; - boolean that_present_last_committed_decree = true; - if (this_present_last_committed_decree || that_present_last_committed_decree) { - if (!(this_present_last_committed_decree && that_present_last_committed_decree)) return false; - if (this.last_committed_decree != that.last_committed_decree) return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetPid()) ? 131071 : 524287); - if (isSetPid()) hashCode = hashCode * 8191 + pid.hashCode(); - - hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(ballot); - - hashCode = hashCode * 8191 + max_replica_count; - - hashCode = hashCode * 8191 + ((isSetPrimary()) ? 131071 : 524287); - if (isSetPrimary()) hashCode = hashCode * 8191 + primary.hashCode(); - - hashCode = hashCode * 8191 + ((isSetSecondaries()) ? 131071 : 524287); - if (isSetSecondaries()) hashCode = hashCode * 8191 + secondaries.hashCode(); - - hashCode = hashCode * 8191 + ((isSetLast_drops()) ? 131071 : 524287); - if (isSetLast_drops()) hashCode = hashCode * 8191 + last_drops.hashCode(); - - hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(last_committed_decree); - - return hashCode; - } - - @Override - public int compareTo(partition_configuration other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetPid()).compareTo(other.isSetPid()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetPid()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pid, other.pid); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetBallot()).compareTo(other.isSetBallot()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetBallot()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ballot, other.ballot); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetMax_replica_count()) - .compareTo(other.isSetMax_replica_count()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetMax_replica_count()) { - lastComparison = - org.apache.thrift.TBaseHelper.compareTo(this.max_replica_count, other.max_replica_count); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetPrimary()).compareTo(other.isSetPrimary()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetPrimary()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.primary, other.primary); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetSecondaries()).compareTo(other.isSetSecondaries()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSecondaries()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.secondaries, other.secondaries); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetLast_drops()).compareTo(other.isSetLast_drops()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetLast_drops()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.last_drops, other.last_drops); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetLast_committed_decree()) - .compareTo(other.isSetLast_committed_decree()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetLast_committed_decree()) { - lastComparison = - org.apache.thrift.TBaseHelper.compareTo( - this.last_committed_decree, other.last_committed_decree); - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("partition_configuration("); - boolean first = true; - - sb.append("pid:"); - if (this.pid == null) { - sb.append("null"); - } else { - sb.append(this.pid); - } - first = false; - if (!first) sb.append(", "); - sb.append("ballot:"); - sb.append(this.ballot); - first = false; - if (!first) sb.append(", "); - sb.append("max_replica_count:"); - sb.append(this.max_replica_count); - first = false; - if (!first) sb.append(", "); - sb.append("primary:"); - if (this.primary == null) { - sb.append("null"); - } else { - sb.append(this.primary); - } - first = false; - if (!first) sb.append(", "); - sb.append("secondaries:"); - if (this.secondaries == null) { - sb.append("null"); - } else { - sb.append(this.secondaries); - } - first = false; - if (!first) sb.append(", "); - sb.append("last_drops:"); - if (this.last_drops == null) { - sb.append("null"); - } else { - sb.append(this.last_drops); - } - first = false; - if (!first) sb.append(", "); - sb.append("last_committed_decree:"); - sb.append(this.last_committed_decree); - 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 (pid != null) { - pid.validate(); - } - if (primary != null) { - primary.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, java.lang.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 partition_configurationStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public partition_configurationStandardScheme getScheme() { - return new partition_configurationStandardScheme(); - } - } - - private static class partition_configurationStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, partition_configuration 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: // PID - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.pid = new gpid(); - struct.pid.read(iprot); - struct.setPidIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // BALLOT - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.ballot = iprot.readI64(); - struct.setBallotIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // MAX_REPLICA_COUNT - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.max_replica_count = iprot.readI32(); - struct.setMax_replica_countIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // PRIMARY - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.primary = new rpc_address(); - struct.primary.read(iprot); - struct.setPrimaryIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 5: // SECONDARIES - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list0 = iprot.readListBegin(); - struct.secondaries = new java.util.ArrayList(_list0.size); - rpc_address _elem1; - for (int _i2 = 0; _i2 < _list0.size; ++_i2) { - _elem1 = new rpc_address(); - _elem1.read(iprot); - struct.secondaries.add(_elem1); - } - iprot.readListEnd(); - } - struct.setSecondariesIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 6: // LAST_DROPS - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list3 = iprot.readListBegin(); - struct.last_drops = new java.util.ArrayList(_list3.size); - rpc_address _elem4; - for (int _i5 = 0; _i5 < _list3.size; ++_i5) { - _elem4 = new rpc_address(); - _elem4.read(iprot); - struct.last_drops.add(_elem4); - } - iprot.readListEnd(); - } - struct.setLast_dropsIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 7: // LAST_COMMITTED_DECREE - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.last_committed_decree = iprot.readI64(); - struct.setLast_committed_decreeIsSet(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, partition_configuration struct) - throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.pid != null) { - oprot.writeFieldBegin(PID_FIELD_DESC); - struct.pid.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(BALLOT_FIELD_DESC); - oprot.writeI64(struct.ballot); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(MAX_REPLICA_COUNT_FIELD_DESC); - oprot.writeI32(struct.max_replica_count); - oprot.writeFieldEnd(); - if (struct.primary != null) { - oprot.writeFieldBegin(PRIMARY_FIELD_DESC); - struct.primary.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.secondaries != null) { - oprot.writeFieldBegin(SECONDARIES_FIELD_DESC); - { - oprot.writeListBegin( - new org.apache.thrift.protocol.TList( - org.apache.thrift.protocol.TType.STRUCT, struct.secondaries.size())); - for (rpc_address _iter6 : struct.secondaries) { - _iter6.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - if (struct.last_drops != null) { - oprot.writeFieldBegin(LAST_DROPS_FIELD_DESC); - { - oprot.writeListBegin( - new org.apache.thrift.protocol.TList( - org.apache.thrift.protocol.TType.STRUCT, struct.last_drops.size())); - for (rpc_address _iter7 : struct.last_drops) { - _iter7.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(LAST_COMMITTED_DECREE_FIELD_DESC); - oprot.writeI64(struct.last_committed_decree); - oprot.writeFieldEnd(); - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class partition_configurationTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public partition_configurationTupleScheme getScheme() { - return new partition_configurationTupleScheme(); - } - } - - private static class partition_configurationTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, partition_configuration struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetPid()) { - optionals.set(0); - } - if (struct.isSetBallot()) { - optionals.set(1); - } - if (struct.isSetMax_replica_count()) { - optionals.set(2); - } - if (struct.isSetPrimary()) { - optionals.set(3); - } - if (struct.isSetSecondaries()) { - optionals.set(4); - } - if (struct.isSetLast_drops()) { - optionals.set(5); - } - if (struct.isSetLast_committed_decree()) { - optionals.set(6); - } - oprot.writeBitSet(optionals, 7); - if (struct.isSetPid()) { - struct.pid.write(oprot); - } - if (struct.isSetBallot()) { - oprot.writeI64(struct.ballot); - } - if (struct.isSetMax_replica_count()) { - oprot.writeI32(struct.max_replica_count); - } - if (struct.isSetPrimary()) { - struct.primary.write(oprot); - } - if (struct.isSetSecondaries()) { - { - oprot.writeI32(struct.secondaries.size()); - for (rpc_address _iter8 : struct.secondaries) { - _iter8.write(oprot); - } - } - } - if (struct.isSetLast_drops()) { - { - oprot.writeI32(struct.last_drops.size()); - for (rpc_address _iter9 : struct.last_drops) { - _iter9.write(oprot); - } - } - } - if (struct.isSetLast_committed_decree()) { - oprot.writeI64(struct.last_committed_decree); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, partition_configuration struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(7); - if (incoming.get(0)) { - struct.pid = new gpid(); - struct.pid.read(iprot); - struct.setPidIsSet(true); - } - if (incoming.get(1)) { - struct.ballot = iprot.readI64(); - struct.setBallotIsSet(true); - } - if (incoming.get(2)) { - struct.max_replica_count = iprot.readI32(); - struct.setMax_replica_countIsSet(true); - } - if (incoming.get(3)) { - struct.primary = new rpc_address(); - struct.primary.read(iprot); - struct.setPrimaryIsSet(true); - } - if (incoming.get(4)) { - { - org.apache.thrift.protocol.TList _list10 = - new org.apache.thrift.protocol.TList( - org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.secondaries = new java.util.ArrayList(_list10.size); - rpc_address _elem11; - for (int _i12 = 0; _i12 < _list10.size; ++_i12) { - _elem11 = new rpc_address(); - _elem11.read(iprot); - struct.secondaries.add(_elem11); - } - } - struct.setSecondariesIsSet(true); - } - if (incoming.get(5)) { - { - org.apache.thrift.protocol.TList _list13 = - new org.apache.thrift.protocol.TList( - org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.last_drops = new java.util.ArrayList(_list13.size); - rpc_address _elem14; - for (int _i15 = 0; _i15 < _list13.size; ++_i15) { - _elem14 = new rpc_address(); - _elem14.read(iprot); - struct.last_drops.add(_elem14); - } - } - struct.setLast_dropsIsSet(true); - } - if (incoming.get(6)) { - struct.last_committed_decree = iprot.readI64(); - struct.setLast_committed_decreeIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } -} diff --git a/java-client/src/main/java/org/apache/pegasus/replication/query_cfg_request.java b/java-client/src/main/java/org/apache/pegasus/replication/query_cfg_request.java deleted file mode 100644 index 17745d2115..0000000000 --- a/java-client/src/main/java/org/apache/pegasus/replication/query_cfg_request.java +++ /dev/null @@ -1,579 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.11.0) - * - *

DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * - * @generated - */ -package org.apache.pegasus.replication; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated( - value = "Autogenerated by Thrift Compiler (0.11.0)", - date = "2020-04-13") -public class query_cfg_request - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("query_cfg_request"); - - private static final org.apache.thrift.protocol.TField APP_NAME_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "app_name", org.apache.thrift.protocol.TType.STRING, (short) 1); - private static final org.apache.thrift.protocol.TField PARTITION_INDICES_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "partition_indices", org.apache.thrift.protocol.TType.LIST, (short) 2); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new query_cfg_requestStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new query_cfg_requestTupleSchemeFactory(); - - public java.lang.String app_name; // required - public java.util.List partition_indices; // 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 { - APP_NAME((short) 1, "app_name"), - PARTITION_INDICES((short) 2, "partition_indices"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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: // APP_NAME - return APP_NAME; - case 2: // PARTITION_INDICES - return PARTITION_INDICES; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put( - _Fields.APP_NAME, - new org.apache.thrift.meta_data.FieldMetaData( - "app_name", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.STRING))); - tmpMap.put( - _Fields.PARTITION_INDICES, - new org.apache.thrift.meta_data.FieldMetaData( - "partition_indices", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.ListMetaData( - org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I32)))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap( - query_cfg_request.class, metaDataMap); - } - - public query_cfg_request() {} - - public query_cfg_request( - java.lang.String app_name, java.util.List partition_indices) { - this(); - this.app_name = app_name; - this.partition_indices = partition_indices; - } - - /** Performs a deep copy on other. */ - public query_cfg_request(query_cfg_request other) { - if (other.isSetApp_name()) { - this.app_name = other.app_name; - } - if (other.isSetPartition_indices()) { - java.util.List __this__partition_indices = - new java.util.ArrayList(other.partition_indices); - this.partition_indices = __this__partition_indices; - } - } - - public query_cfg_request deepCopy() { - return new query_cfg_request(this); - } - - @Override - public void clear() { - this.app_name = null; - this.partition_indices = null; - } - - public java.lang.String getApp_name() { - return this.app_name; - } - - public query_cfg_request setApp_name(java.lang.String app_name) { - this.app_name = app_name; - return this; - } - - public void unsetApp_name() { - this.app_name = null; - } - - /** Returns true if field app_name is set (has been assigned a value) and false otherwise */ - public boolean isSetApp_name() { - return this.app_name != null; - } - - public void setApp_nameIsSet(boolean value) { - if (!value) { - this.app_name = null; - } - } - - public int getPartition_indicesSize() { - return (this.partition_indices == null) ? 0 : this.partition_indices.size(); - } - - public java.util.Iterator getPartition_indicesIterator() { - return (this.partition_indices == null) ? null : this.partition_indices.iterator(); - } - - public void addToPartition_indices(int elem) { - if (this.partition_indices == null) { - this.partition_indices = new java.util.ArrayList(); - } - this.partition_indices.add(elem); - } - - public java.util.List getPartition_indices() { - return this.partition_indices; - } - - public query_cfg_request setPartition_indices( - java.util.List partition_indices) { - this.partition_indices = partition_indices; - return this; - } - - public void unsetPartition_indices() { - this.partition_indices = null; - } - - /** - * Returns true if field partition_indices is set (has been assigned a value) and false otherwise - */ - public boolean isSetPartition_indices() { - return this.partition_indices != null; - } - - public void setPartition_indicesIsSet(boolean value) { - if (!value) { - this.partition_indices = null; - } - } - - public void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case APP_NAME: - if (value == null) { - unsetApp_name(); - } else { - setApp_name((java.lang.String) value); - } - break; - - case PARTITION_INDICES: - if (value == null) { - unsetPartition_indices(); - } else { - setPartition_indices((java.util.List) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case APP_NAME: - return getApp_name(); - - case PARTITION_INDICES: - return getPartition_indices(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case APP_NAME: - return isSetApp_name(); - case PARTITION_INDICES: - return isSetPartition_indices(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof query_cfg_request) return this.equals((query_cfg_request) that); - return false; - } - - public boolean equals(query_cfg_request that) { - if (that == null) return false; - if (this == that) return true; - - boolean this_present_app_name = true && this.isSetApp_name(); - boolean that_present_app_name = true && that.isSetApp_name(); - if (this_present_app_name || that_present_app_name) { - if (!(this_present_app_name && that_present_app_name)) return false; - if (!this.app_name.equals(that.app_name)) return false; - } - - boolean this_present_partition_indices = true && this.isSetPartition_indices(); - boolean that_present_partition_indices = true && that.isSetPartition_indices(); - if (this_present_partition_indices || that_present_partition_indices) { - if (!(this_present_partition_indices && that_present_partition_indices)) return false; - if (!this.partition_indices.equals(that.partition_indices)) return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetApp_name()) ? 131071 : 524287); - if (isSetApp_name()) hashCode = hashCode * 8191 + app_name.hashCode(); - - hashCode = hashCode * 8191 + ((isSetPartition_indices()) ? 131071 : 524287); - if (isSetPartition_indices()) hashCode = hashCode * 8191 + partition_indices.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(query_cfg_request other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetApp_name()).compareTo(other.isSetApp_name()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetApp_name()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.app_name, other.app_name); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetPartition_indices()) - .compareTo(other.isSetPartition_indices()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetPartition_indices()) { - lastComparison = - org.apache.thrift.TBaseHelper.compareTo(this.partition_indices, other.partition_indices); - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("query_cfg_request("); - boolean first = true; - - sb.append("app_name:"); - if (this.app_name == null) { - sb.append("null"); - } else { - sb.append(this.app_name); - } - first = false; - if (!first) sb.append(", "); - sb.append("partition_indices:"); - if (this.partition_indices == null) { - sb.append("null"); - } else { - sb.append(this.partition_indices); - } - 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, java.lang.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 query_cfg_requestStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public query_cfg_requestStandardScheme getScheme() { - return new query_cfg_requestStandardScheme(); - } - } - - private static class query_cfg_requestStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, query_cfg_request 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: // APP_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.app_name = iprot.readString(); - struct.setApp_nameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // PARTITION_INDICES - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list16 = iprot.readListBegin(); - struct.partition_indices = new java.util.ArrayList(_list16.size); - int _elem17; - for (int _i18 = 0; _i18 < _list16.size; ++_i18) { - _elem17 = iprot.readI32(); - struct.partition_indices.add(_elem17); - } - iprot.readListEnd(); - } - struct.setPartition_indicesIsSet(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, query_cfg_request struct) - throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.app_name != null) { - oprot.writeFieldBegin(APP_NAME_FIELD_DESC); - oprot.writeString(struct.app_name); - oprot.writeFieldEnd(); - } - if (struct.partition_indices != null) { - oprot.writeFieldBegin(PARTITION_INDICES_FIELD_DESC); - { - oprot.writeListBegin( - new org.apache.thrift.protocol.TList( - org.apache.thrift.protocol.TType.I32, struct.partition_indices.size())); - for (int _iter19 : struct.partition_indices) { - oprot.writeI32(_iter19); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class query_cfg_requestTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public query_cfg_requestTupleScheme getScheme() { - return new query_cfg_requestTupleScheme(); - } - } - - private static class query_cfg_requestTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, query_cfg_request struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetApp_name()) { - optionals.set(0); - } - if (struct.isSetPartition_indices()) { - optionals.set(1); - } - oprot.writeBitSet(optionals, 2); - if (struct.isSetApp_name()) { - oprot.writeString(struct.app_name); - } - if (struct.isSetPartition_indices()) { - { - oprot.writeI32(struct.partition_indices.size()); - for (int _iter20 : struct.partition_indices) { - oprot.writeI32(_iter20); - } - } - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, query_cfg_request struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(2); - if (incoming.get(0)) { - struct.app_name = iprot.readString(); - struct.setApp_nameIsSet(true); - } - if (incoming.get(1)) { - { - org.apache.thrift.protocol.TList _list21 = - new org.apache.thrift.protocol.TList( - org.apache.thrift.protocol.TType.I32, iprot.readI32()); - struct.partition_indices = new java.util.ArrayList(_list21.size); - int _elem22; - for (int _i23 = 0; _i23 < _list21.size; ++_i23) { - _elem22 = iprot.readI32(); - struct.partition_indices.add(_elem22); - } - } - struct.setPartition_indicesIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } -} diff --git a/java-client/src/main/java/org/apache/pegasus/replication/query_cfg_response.java b/java-client/src/main/java/org/apache/pegasus/replication/query_cfg_response.java deleted file mode 100644 index 86152561fa..0000000000 --- a/java-client/src/main/java/org/apache/pegasus/replication/query_cfg_response.java +++ /dev/null @@ -1,906 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.11.0) - * - *

DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * - * @generated - */ -package org.apache.pegasus.replication; - -import org.apache.pegasus.base.error_code; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated( - value = "Autogenerated by Thrift Compiler (0.11.0)", - date = "2020-04-13") -public class query_cfg_response - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("query_cfg_response"); - - private static final org.apache.thrift.protocol.TField ERR_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "err", org.apache.thrift.protocol.TType.STRUCT, (short) 1); - private static final org.apache.thrift.protocol.TField APP_ID_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "app_id", org.apache.thrift.protocol.TType.I32, (short) 2); - private static final org.apache.thrift.protocol.TField PARTITION_COUNT_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "partition_count", org.apache.thrift.protocol.TType.I32, (short) 3); - private static final org.apache.thrift.protocol.TField IS_STATEFUL_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "is_stateful", org.apache.thrift.protocol.TType.BOOL, (short) 4); - private static final org.apache.thrift.protocol.TField PARTITIONS_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "partitions", org.apache.thrift.protocol.TType.LIST, (short) 5); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new query_cfg_responseStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new query_cfg_responseTupleSchemeFactory(); - - public error_code err; // required - public int app_id; // required - public int partition_count; // required - public boolean is_stateful; // required - public java.util.List partitions; // 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 { - ERR((short) 1, "err"), - APP_ID((short) 2, "app_id"), - PARTITION_COUNT((short) 3, "partition_count"), - IS_STATEFUL((short) 4, "is_stateful"), - PARTITIONS((short) 5, "partitions"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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: // ERR - return ERR; - case 2: // APP_ID - return APP_ID; - case 3: // PARTITION_COUNT - return PARTITION_COUNT; - case 4: // IS_STATEFUL - return IS_STATEFUL; - case 5: // PARTITIONS - return PARTITIONS; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __APP_ID_ISSET_ID = 0; - private static final int __PARTITION_COUNT_ISSET_ID = 1; - private static final int __IS_STATEFUL_ISSET_ID = 2; - private byte __isset_bitfield = 0; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put( - _Fields.ERR, - new org.apache.thrift.meta_data.FieldMetaData( - "err", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData( - org.apache.thrift.protocol.TType.STRUCT, error_code.class))); - tmpMap.put( - _Fields.APP_ID, - new org.apache.thrift.meta_data.FieldMetaData( - "app_id", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I32))); - tmpMap.put( - _Fields.PARTITION_COUNT, - new org.apache.thrift.meta_data.FieldMetaData( - "partition_count", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I32))); - tmpMap.put( - _Fields.IS_STATEFUL, - new org.apache.thrift.meta_data.FieldMetaData( - "is_stateful", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.BOOL))); - tmpMap.put( - _Fields.PARTITIONS, - new org.apache.thrift.meta_data.FieldMetaData( - "partitions", - 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, partition_configuration.class)))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap( - query_cfg_response.class, metaDataMap); - } - - public query_cfg_response() {} - - public query_cfg_response( - error_code err, - int app_id, - int partition_count, - boolean is_stateful, - java.util.List partitions) { - this(); - this.err = err; - this.app_id = app_id; - setApp_idIsSet(true); - this.partition_count = partition_count; - setPartition_countIsSet(true); - this.is_stateful = is_stateful; - setIs_statefulIsSet(true); - this.partitions = partitions; - } - - /** Performs a deep copy on other. */ - public query_cfg_response(query_cfg_response other) { - __isset_bitfield = other.__isset_bitfield; - if (other.isSetErr()) { - this.err = new error_code(other.err); - } - this.app_id = other.app_id; - this.partition_count = other.partition_count; - this.is_stateful = other.is_stateful; - if (other.isSetPartitions()) { - java.util.List __this__partitions = - new java.util.ArrayList(other.partitions.size()); - for (partition_configuration other_element : other.partitions) { - __this__partitions.add(new partition_configuration(other_element)); - } - this.partitions = __this__partitions; - } - } - - public query_cfg_response deepCopy() { - return new query_cfg_response(this); - } - - @Override - public void clear() { - this.err = null; - setApp_idIsSet(false); - this.app_id = 0; - setPartition_countIsSet(false); - this.partition_count = 0; - setIs_statefulIsSet(false); - this.is_stateful = false; - this.partitions = null; - } - - public error_code getErr() { - return this.err; - } - - public query_cfg_response setErr(error_code err) { - this.err = err; - return this; - } - - public void unsetErr() { - this.err = null; - } - - /** Returns true if field err is set (has been assigned a value) and false otherwise */ - public boolean isSetErr() { - return this.err != null; - } - - public void setErrIsSet(boolean value) { - if (!value) { - this.err = null; - } - } - - public int getApp_id() { - return this.app_id; - } - - public query_cfg_response setApp_id(int app_id) { - this.app_id = app_id; - setApp_idIsSet(true); - return this; - } - - public void unsetApp_id() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __APP_ID_ISSET_ID); - } - - /** Returns true if field app_id is set (has been assigned a value) and false otherwise */ - public boolean isSetApp_id() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __APP_ID_ISSET_ID); - } - - public void setApp_idIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __APP_ID_ISSET_ID, value); - } - - public int getPartition_count() { - return this.partition_count; - } - - public query_cfg_response setPartition_count(int partition_count) { - this.partition_count = partition_count; - setPartition_countIsSet(true); - return this; - } - - public void unsetPartition_count() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __PARTITION_COUNT_ISSET_ID); - } - - /** - * Returns true if field partition_count is set (has been assigned a value) and false otherwise - */ - public boolean isSetPartition_count() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __PARTITION_COUNT_ISSET_ID); - } - - public void setPartition_countIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __PARTITION_COUNT_ISSET_ID, value); - } - - public boolean isIs_stateful() { - return this.is_stateful; - } - - public query_cfg_response setIs_stateful(boolean is_stateful) { - this.is_stateful = is_stateful; - setIs_statefulIsSet(true); - return this; - } - - public void unsetIs_stateful() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __IS_STATEFUL_ISSET_ID); - } - - /** Returns true if field is_stateful is set (has been assigned a value) and false otherwise */ - public boolean isSetIs_stateful() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __IS_STATEFUL_ISSET_ID); - } - - public void setIs_statefulIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __IS_STATEFUL_ISSET_ID, value); - } - - public int getPartitionsSize() { - return (this.partitions == null) ? 0 : this.partitions.size(); - } - - public java.util.Iterator getPartitionsIterator() { - return (this.partitions == null) ? null : this.partitions.iterator(); - } - - public void addToPartitions(partition_configuration elem) { - if (this.partitions == null) { - this.partitions = new java.util.ArrayList(); - } - this.partitions.add(elem); - } - - public java.util.List getPartitions() { - return this.partitions; - } - - public query_cfg_response setPartitions(java.util.List partitions) { - this.partitions = partitions; - return this; - } - - public void unsetPartitions() { - this.partitions = null; - } - - /** Returns true if field partitions is set (has been assigned a value) and false otherwise */ - public boolean isSetPartitions() { - return this.partitions != null; - } - - public void setPartitionsIsSet(boolean value) { - if (!value) { - this.partitions = null; - } - } - - public void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case ERR: - if (value == null) { - unsetErr(); - } else { - setErr((error_code) value); - } - break; - - case APP_ID: - if (value == null) { - unsetApp_id(); - } else { - setApp_id((java.lang.Integer) value); - } - break; - - case PARTITION_COUNT: - if (value == null) { - unsetPartition_count(); - } else { - setPartition_count((java.lang.Integer) value); - } - break; - - case IS_STATEFUL: - if (value == null) { - unsetIs_stateful(); - } else { - setIs_stateful((java.lang.Boolean) value); - } - break; - - case PARTITIONS: - if (value == null) { - unsetPartitions(); - } else { - setPartitions((java.util.List) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case ERR: - return getErr(); - - case APP_ID: - return getApp_id(); - - case PARTITION_COUNT: - return getPartition_count(); - - case IS_STATEFUL: - return isIs_stateful(); - - case PARTITIONS: - return getPartitions(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case ERR: - return isSetErr(); - case APP_ID: - return isSetApp_id(); - case PARTITION_COUNT: - return isSetPartition_count(); - case IS_STATEFUL: - return isSetIs_stateful(); - case PARTITIONS: - return isSetPartitions(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof query_cfg_response) return this.equals((query_cfg_response) that); - return false; - } - - public boolean equals(query_cfg_response that) { - if (that == null) return false; - if (this == that) return true; - - boolean this_present_err = true && this.isSetErr(); - boolean that_present_err = true && that.isSetErr(); - if (this_present_err || that_present_err) { - if (!(this_present_err && that_present_err)) return false; - if (!this.err.equals(that.err)) return false; - } - - boolean this_present_app_id = true; - boolean that_present_app_id = true; - if (this_present_app_id || that_present_app_id) { - if (!(this_present_app_id && that_present_app_id)) return false; - if (this.app_id != that.app_id) return false; - } - - boolean this_present_partition_count = true; - boolean that_present_partition_count = true; - if (this_present_partition_count || that_present_partition_count) { - if (!(this_present_partition_count && that_present_partition_count)) return false; - if (this.partition_count != that.partition_count) return false; - } - - boolean this_present_is_stateful = true; - boolean that_present_is_stateful = true; - if (this_present_is_stateful || that_present_is_stateful) { - if (!(this_present_is_stateful && that_present_is_stateful)) return false; - if (this.is_stateful != that.is_stateful) return false; - } - - boolean this_present_partitions = true && this.isSetPartitions(); - boolean that_present_partitions = true && that.isSetPartitions(); - if (this_present_partitions || that_present_partitions) { - if (!(this_present_partitions && that_present_partitions)) return false; - if (!this.partitions.equals(that.partitions)) return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetErr()) ? 131071 : 524287); - if (isSetErr()) hashCode = hashCode * 8191 + err.hashCode(); - - hashCode = hashCode * 8191 + app_id; - - hashCode = hashCode * 8191 + partition_count; - - hashCode = hashCode * 8191 + ((is_stateful) ? 131071 : 524287); - - hashCode = hashCode * 8191 + ((isSetPartitions()) ? 131071 : 524287); - if (isSetPartitions()) hashCode = hashCode * 8191 + partitions.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(query_cfg_response other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetErr()).compareTo(other.isSetErr()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetErr()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.err, other.err); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetApp_id()).compareTo(other.isSetApp_id()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetApp_id()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.app_id, other.app_id); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetPartition_count()).compareTo(other.isSetPartition_count()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetPartition_count()) { - lastComparison = - org.apache.thrift.TBaseHelper.compareTo(this.partition_count, other.partition_count); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetIs_stateful()).compareTo(other.isSetIs_stateful()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetIs_stateful()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.is_stateful, other.is_stateful); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetPartitions()).compareTo(other.isSetPartitions()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetPartitions()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.partitions, other.partitions); - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("query_cfg_response("); - boolean first = true; - - sb.append("err:"); - if (this.err == null) { - sb.append("null"); - } else { - sb.append(this.err); - } - first = false; - if (!first) sb.append(", "); - sb.append("app_id:"); - sb.append(this.app_id); - first = false; - if (!first) sb.append(", "); - sb.append("partition_count:"); - sb.append(this.partition_count); - first = false; - if (!first) sb.append(", "); - sb.append("is_stateful:"); - sb.append(this.is_stateful); - first = false; - if (!first) sb.append(", "); - sb.append("partitions:"); - if (this.partitions == null) { - sb.append("null"); - } else { - sb.append(this.partitions); - } - 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 (err != null) { - err.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, java.lang.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 query_cfg_responseStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public query_cfg_responseStandardScheme getScheme() { - return new query_cfg_responseStandardScheme(); - } - } - - private static class query_cfg_responseStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, query_cfg_response 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: // ERR - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.err = new error_code(); - struct.err.read(iprot); - struct.setErrIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // APP_ID - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.app_id = iprot.readI32(); - struct.setApp_idIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // PARTITION_COUNT - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.partition_count = iprot.readI32(); - struct.setPartition_countIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // IS_STATEFUL - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.is_stateful = iprot.readBool(); - struct.setIs_statefulIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 5: // PARTITIONS - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list24 = iprot.readListBegin(); - struct.partitions = new java.util.ArrayList(_list24.size); - partition_configuration _elem25; - for (int _i26 = 0; _i26 < _list24.size; ++_i26) { - _elem25 = new partition_configuration(); - _elem25.read(iprot); - struct.partitions.add(_elem25); - } - iprot.readListEnd(); - } - struct.setPartitionsIsSet(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, query_cfg_response struct) - throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.err != null) { - oprot.writeFieldBegin(ERR_FIELD_DESC); - struct.err.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(APP_ID_FIELD_DESC); - oprot.writeI32(struct.app_id); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(PARTITION_COUNT_FIELD_DESC); - oprot.writeI32(struct.partition_count); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(IS_STATEFUL_FIELD_DESC); - oprot.writeBool(struct.is_stateful); - oprot.writeFieldEnd(); - if (struct.partitions != null) { - oprot.writeFieldBegin(PARTITIONS_FIELD_DESC); - { - oprot.writeListBegin( - new org.apache.thrift.protocol.TList( - org.apache.thrift.protocol.TType.STRUCT, struct.partitions.size())); - for (partition_configuration _iter27 : struct.partitions) { - _iter27.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class query_cfg_responseTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public query_cfg_responseTupleScheme getScheme() { - return new query_cfg_responseTupleScheme(); - } - } - - private static class query_cfg_responseTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, query_cfg_response struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetErr()) { - optionals.set(0); - } - if (struct.isSetApp_id()) { - optionals.set(1); - } - if (struct.isSetPartition_count()) { - optionals.set(2); - } - if (struct.isSetIs_stateful()) { - optionals.set(3); - } - if (struct.isSetPartitions()) { - optionals.set(4); - } - oprot.writeBitSet(optionals, 5); - if (struct.isSetErr()) { - struct.err.write(oprot); - } - if (struct.isSetApp_id()) { - oprot.writeI32(struct.app_id); - } - if (struct.isSetPartition_count()) { - oprot.writeI32(struct.partition_count); - } - if (struct.isSetIs_stateful()) { - oprot.writeBool(struct.is_stateful); - } - if (struct.isSetPartitions()) { - { - oprot.writeI32(struct.partitions.size()); - for (partition_configuration _iter28 : struct.partitions) { - _iter28.write(oprot); - } - } - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, query_cfg_response struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(5); - if (incoming.get(0)) { - struct.err = new error_code(); - struct.err.read(iprot); - struct.setErrIsSet(true); - } - if (incoming.get(1)) { - struct.app_id = iprot.readI32(); - struct.setApp_idIsSet(true); - } - if (incoming.get(2)) { - struct.partition_count = iprot.readI32(); - struct.setPartition_countIsSet(true); - } - if (incoming.get(3)) { - struct.is_stateful = iprot.readBool(); - struct.setIs_statefulIsSet(true); - } - if (incoming.get(4)) { - { - org.apache.thrift.protocol.TList _list29 = - new org.apache.thrift.protocol.TList( - org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.partitions = new java.util.ArrayList(_list29.size); - partition_configuration _elem30; - for (int _i31 = 0; _i31 < _list29.size; ++_i31) { - _elem30 = new partition_configuration(); - _elem30.read(iprot); - struct.partitions.add(_elem30); - } - } - struct.setPartitionsIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } -} diff --git a/java-client/src/main/java/org/apache/pegasus/replication/request_meta.java b/java-client/src/main/java/org/apache/pegasus/replication/request_meta.java deleted file mode 100644 index f1142bd593..0000000000 --- a/java-client/src/main/java/org/apache/pegasus/replication/request_meta.java +++ /dev/null @@ -1,840 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.11.0) - * - *

DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * - * @generated - */ -package org.apache.pegasus.replication; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated( - value = "Autogenerated by Thrift Compiler (0.11.0)", - date = "2020-04-13") -public class request_meta - implements org.apache.thrift.TBase, - java.io.Serializable, - Cloneable, - Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("request_meta"); - - private static final org.apache.thrift.protocol.TField APP_ID_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "app_id", org.apache.thrift.protocol.TType.I32, (short) 1); - private static final org.apache.thrift.protocol.TField PARTITION_INDEX_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "partition_index", org.apache.thrift.protocol.TType.I32, (short) 2); - private static final org.apache.thrift.protocol.TField CLIENT_TIMEOUT_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "client_timeout", org.apache.thrift.protocol.TType.I32, (short) 3); - private static final org.apache.thrift.protocol.TField PARTITION_HASH_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "partition_hash", org.apache.thrift.protocol.TType.I64, (short) 4); - private static final org.apache.thrift.protocol.TField IS_BACKUP_REQUEST_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "is_backup_request", org.apache.thrift.protocol.TType.BOOL, (short) 5); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new request_metaStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new request_metaTupleSchemeFactory(); - - public int app_id; // required - public int partition_index; // required - public int client_timeout; // required - public long partition_hash; // required - public boolean is_backup_request; // 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 { - APP_ID((short) 1, "app_id"), - PARTITION_INDEX((short) 2, "partition_index"), - CLIENT_TIMEOUT((short) 3, "client_timeout"), - PARTITION_HASH((short) 4, "partition_hash"), - IS_BACKUP_REQUEST((short) 5, "is_backup_request"); - - private static final java.util.Map byName = - new java.util.HashMap(); - - static { - for (_Fields field : java.util.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: // APP_ID - return APP_ID; - case 2: // PARTITION_INDEX - return PARTITION_INDEX; - case 3: // CLIENT_TIMEOUT - return CLIENT_TIMEOUT; - case 4: // PARTITION_HASH - return PARTITION_HASH; - case 5: // IS_BACKUP_REQUEST - return IS_BACKUP_REQUEST; - 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 java.lang.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(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __APP_ID_ISSET_ID = 0; - private static final int __PARTITION_INDEX_ISSET_ID = 1; - private static final int __CLIENT_TIMEOUT_ISSET_ID = 2; - private static final int __PARTITION_HASH_ISSET_ID = 3; - private static final int __IS_BACKUP_REQUEST_ISSET_ID = 4; - private byte __isset_bitfield = 0; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = - new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put( - _Fields.APP_ID, - new org.apache.thrift.meta_data.FieldMetaData( - "app_id", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I32))); - tmpMap.put( - _Fields.PARTITION_INDEX, - new org.apache.thrift.meta_data.FieldMetaData( - "partition_index", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I32))); - tmpMap.put( - _Fields.CLIENT_TIMEOUT, - new org.apache.thrift.meta_data.FieldMetaData( - "client_timeout", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I32))); - tmpMap.put( - _Fields.PARTITION_HASH, - new org.apache.thrift.meta_data.FieldMetaData( - "partition_hash", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.I64))); - tmpMap.put( - _Fields.IS_BACKUP_REQUEST, - new org.apache.thrift.meta_data.FieldMetaData( - "is_backup_request", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.BOOL))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(request_meta.class, metaDataMap); - } - - public request_meta() {} - - public request_meta( - int app_id, - int partition_index, - int client_timeout, - long partition_hash, - boolean is_backup_request) { - this(); - this.app_id = app_id; - setApp_idIsSet(true); - this.partition_index = partition_index; - setPartition_indexIsSet(true); - this.client_timeout = client_timeout; - setClient_timeoutIsSet(true); - this.partition_hash = partition_hash; - setPartition_hashIsSet(true); - this.is_backup_request = is_backup_request; - setIs_backup_requestIsSet(true); - } - - /** Performs a deep copy on other. */ - public request_meta(request_meta other) { - __isset_bitfield = other.__isset_bitfield; - this.app_id = other.app_id; - this.partition_index = other.partition_index; - this.client_timeout = other.client_timeout; - this.partition_hash = other.partition_hash; - this.is_backup_request = other.is_backup_request; - } - - public request_meta deepCopy() { - return new request_meta(this); - } - - @Override - public void clear() { - setApp_idIsSet(false); - this.app_id = 0; - setPartition_indexIsSet(false); - this.partition_index = 0; - setClient_timeoutIsSet(false); - this.client_timeout = 0; - setPartition_hashIsSet(false); - this.partition_hash = 0; - setIs_backup_requestIsSet(false); - this.is_backup_request = false; - } - - public int getApp_id() { - return this.app_id; - } - - public request_meta setApp_id(int app_id) { - this.app_id = app_id; - setApp_idIsSet(true); - return this; - } - - public void unsetApp_id() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __APP_ID_ISSET_ID); - } - - /** Returns true if field app_id is set (has been assigned a value) and false otherwise */ - public boolean isSetApp_id() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __APP_ID_ISSET_ID); - } - - public void setApp_idIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __APP_ID_ISSET_ID, value); - } - - public int getPartition_index() { - return this.partition_index; - } - - public request_meta setPartition_index(int partition_index) { - this.partition_index = partition_index; - setPartition_indexIsSet(true); - return this; - } - - public void unsetPartition_index() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __PARTITION_INDEX_ISSET_ID); - } - - /** - * Returns true if field partition_index is set (has been assigned a value) and false otherwise - */ - public boolean isSetPartition_index() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __PARTITION_INDEX_ISSET_ID); - } - - public void setPartition_indexIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __PARTITION_INDEX_ISSET_ID, value); - } - - public int getClient_timeout() { - return this.client_timeout; - } - - public request_meta setClient_timeout(int client_timeout) { - this.client_timeout = client_timeout; - setClient_timeoutIsSet(true); - return this; - } - - public void unsetClient_timeout() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __CLIENT_TIMEOUT_ISSET_ID); - } - - /** Returns true if field client_timeout is set (has been assigned a value) and false otherwise */ - public boolean isSetClient_timeout() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __CLIENT_TIMEOUT_ISSET_ID); - } - - public void setClient_timeoutIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __CLIENT_TIMEOUT_ISSET_ID, value); - } - - public long getPartition_hash() { - return this.partition_hash; - } - - public request_meta setPartition_hash(long partition_hash) { - this.partition_hash = partition_hash; - setPartition_hashIsSet(true); - return this; - } - - public void unsetPartition_hash() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __PARTITION_HASH_ISSET_ID); - } - - /** Returns true if field partition_hash is set (has been assigned a value) and false otherwise */ - public boolean isSetPartition_hash() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __PARTITION_HASH_ISSET_ID); - } - - public void setPartition_hashIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __PARTITION_HASH_ISSET_ID, value); - } - - public boolean isIs_backup_request() { - return this.is_backup_request; - } - - public request_meta setIs_backup_request(boolean is_backup_request) { - this.is_backup_request = is_backup_request; - setIs_backup_requestIsSet(true); - return this; - } - - public void unsetIs_backup_request() { - __isset_bitfield = - org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __IS_BACKUP_REQUEST_ISSET_ID); - } - - /** - * Returns true if field is_backup_request is set (has been assigned a value) and false otherwise - */ - public boolean isSetIs_backup_request() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __IS_BACKUP_REQUEST_ISSET_ID); - } - - public void setIs_backup_requestIsSet(boolean value) { - __isset_bitfield = - org.apache.thrift.EncodingUtils.setBit( - __isset_bitfield, __IS_BACKUP_REQUEST_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, java.lang.Object value) { - switch (field) { - case APP_ID: - if (value == null) { - unsetApp_id(); - } else { - setApp_id((java.lang.Integer) value); - } - break; - - case PARTITION_INDEX: - if (value == null) { - unsetPartition_index(); - } else { - setPartition_index((java.lang.Integer) value); - } - break; - - case CLIENT_TIMEOUT: - if (value == null) { - unsetClient_timeout(); - } else { - setClient_timeout((java.lang.Integer) value); - } - break; - - case PARTITION_HASH: - if (value == null) { - unsetPartition_hash(); - } else { - setPartition_hash((java.lang.Long) value); - } - break; - - case IS_BACKUP_REQUEST: - if (value == null) { - unsetIs_backup_request(); - } else { - setIs_backup_request((java.lang.Boolean) value); - } - break; - } - } - - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case APP_ID: - return getApp_id(); - - case PARTITION_INDEX: - return getPartition_index(); - - case CLIENT_TIMEOUT: - return getClient_timeout(); - - case PARTITION_HASH: - return getPartition_hash(); - - case IS_BACKUP_REQUEST: - return isIs_backup_request(); - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case APP_ID: - return isSetApp_id(); - case PARTITION_INDEX: - return isSetPartition_index(); - case CLIENT_TIMEOUT: - return isSetClient_timeout(); - case PARTITION_HASH: - return isSetPartition_hash(); - case IS_BACKUP_REQUEST: - return isSetIs_backup_request(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) return false; - if (that instanceof request_meta) return this.equals((request_meta) that); - return false; - } - - public boolean equals(request_meta that) { - if (that == null) return false; - if (this == that) return true; - - boolean this_present_app_id = true; - boolean that_present_app_id = true; - if (this_present_app_id || that_present_app_id) { - if (!(this_present_app_id && that_present_app_id)) return false; - if (this.app_id != that.app_id) return false; - } - - boolean this_present_partition_index = true; - boolean that_present_partition_index = true; - if (this_present_partition_index || that_present_partition_index) { - if (!(this_present_partition_index && that_present_partition_index)) return false; - if (this.partition_index != that.partition_index) return false; - } - - boolean this_present_client_timeout = true; - boolean that_present_client_timeout = true; - if (this_present_client_timeout || that_present_client_timeout) { - if (!(this_present_client_timeout && that_present_client_timeout)) return false; - if (this.client_timeout != that.client_timeout) return false; - } - - boolean this_present_partition_hash = true; - boolean that_present_partition_hash = true; - if (this_present_partition_hash || that_present_partition_hash) { - if (!(this_present_partition_hash && that_present_partition_hash)) return false; - if (this.partition_hash != that.partition_hash) return false; - } - - boolean this_present_is_backup_request = true; - boolean that_present_is_backup_request = true; - if (this_present_is_backup_request || that_present_is_backup_request) { - if (!(this_present_is_backup_request && that_present_is_backup_request)) return false; - if (this.is_backup_request != that.is_backup_request) return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + app_id; - - hashCode = hashCode * 8191 + partition_index; - - hashCode = hashCode * 8191 + client_timeout; - - hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(partition_hash); - - hashCode = hashCode * 8191 + ((is_backup_request) ? 131071 : 524287); - - return hashCode; - } - - @Override - public int compareTo(request_meta other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetApp_id()).compareTo(other.isSetApp_id()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetApp_id()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.app_id, other.app_id); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetPartition_index()).compareTo(other.isSetPartition_index()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetPartition_index()) { - lastComparison = - org.apache.thrift.TBaseHelper.compareTo(this.partition_index, other.partition_index); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetClient_timeout()).compareTo(other.isSetClient_timeout()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetClient_timeout()) { - lastComparison = - org.apache.thrift.TBaseHelper.compareTo(this.client_timeout, other.client_timeout); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetPartition_hash()).compareTo(other.isSetPartition_hash()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetPartition_hash()) { - lastComparison = - org.apache.thrift.TBaseHelper.compareTo(this.partition_hash, other.partition_hash); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = - java.lang.Boolean.valueOf(isSetIs_backup_request()) - .compareTo(other.isSetIs_backup_request()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetIs_backup_request()) { - lastComparison = - org.apache.thrift.TBaseHelper.compareTo(this.is_backup_request, other.is_backup_request); - 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 { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("request_meta("); - boolean first = true; - - sb.append("app_id:"); - sb.append(this.app_id); - first = false; - if (!first) sb.append(", "); - sb.append("partition_index:"); - sb.append(this.partition_index); - first = false; - if (!first) sb.append(", "); - sb.append("client_timeout:"); - sb.append(this.client_timeout); - first = false; - if (!first) sb.append(", "); - sb.append("partition_hash:"); - sb.append(this.partition_hash); - first = false; - if (!first) sb.append(", "); - sb.append("is_backup_request:"); - sb.append(this.is_backup_request); - 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, java.lang.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 request_metaStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public request_metaStandardScheme getScheme() { - return new request_metaStandardScheme(); - } - } - - private static class request_metaStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, request_meta 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: // APP_ID - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.app_id = iprot.readI32(); - struct.setApp_idIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // PARTITION_INDEX - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.partition_index = iprot.readI32(); - struct.setPartition_indexIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // CLIENT_TIMEOUT - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.client_timeout = iprot.readI32(); - struct.setClient_timeoutIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // PARTITION_HASH - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.partition_hash = iprot.readI64(); - struct.setPartition_hashIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 5: // IS_BACKUP_REQUEST - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.is_backup_request = iprot.readBool(); - struct.setIs_backup_requestIsSet(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, request_meta struct) - throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(APP_ID_FIELD_DESC); - oprot.writeI32(struct.app_id); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(PARTITION_INDEX_FIELD_DESC); - oprot.writeI32(struct.partition_index); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(CLIENT_TIMEOUT_FIELD_DESC); - oprot.writeI32(struct.client_timeout); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(PARTITION_HASH_FIELD_DESC); - oprot.writeI64(struct.partition_hash); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(IS_BACKUP_REQUEST_FIELD_DESC); - oprot.writeBool(struct.is_backup_request); - oprot.writeFieldEnd(); - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class request_metaTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public request_metaTupleScheme getScheme() { - return new request_metaTupleScheme(); - } - } - - private static class request_metaTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, request_meta struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetApp_id()) { - optionals.set(0); - } - if (struct.isSetPartition_index()) { - optionals.set(1); - } - if (struct.isSetClient_timeout()) { - optionals.set(2); - } - if (struct.isSetPartition_hash()) { - optionals.set(3); - } - if (struct.isSetIs_backup_request()) { - optionals.set(4); - } - oprot.writeBitSet(optionals, 5); - if (struct.isSetApp_id()) { - oprot.writeI32(struct.app_id); - } - if (struct.isSetPartition_index()) { - oprot.writeI32(struct.partition_index); - } - if (struct.isSetClient_timeout()) { - oprot.writeI32(struct.client_timeout); - } - if (struct.isSetPartition_hash()) { - oprot.writeI64(struct.partition_hash); - } - if (struct.isSetIs_backup_request()) { - oprot.writeBool(struct.is_backup_request); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, request_meta struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(5); - if (incoming.get(0)) { - struct.app_id = iprot.readI32(); - struct.setApp_idIsSet(true); - } - if (incoming.get(1)) { - struct.partition_index = iprot.readI32(); - struct.setPartition_indexIsSet(true); - } - if (incoming.get(2)) { - struct.client_timeout = iprot.readI32(); - struct.setClient_timeoutIsSet(true); - } - if (incoming.get(3)) { - struct.partition_hash = iprot.readI64(); - struct.setPartition_hashIsSet(true); - } - if (incoming.get(4)) { - struct.is_backup_request = iprot.readBool(); - struct.setIs_backup_requestIsSet(true); - } - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } -}