Return-Path: X-Original-To: apmail-accumulo-commits-archive@www.apache.org Delivered-To: apmail-accumulo-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 31672F590 for ; Fri, 12 Apr 2013 14:38:31 +0000 (UTC) Received: (qmail 73918 invoked by uid 500); 12 Apr 2013 14:38:31 -0000 Delivered-To: apmail-accumulo-commits-archive@accumulo.apache.org Received: (qmail 73866 invoked by uid 500); 12 Apr 2013 14:38:31 -0000 Mailing-List: contact commits-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@accumulo.apache.org Delivered-To: mailing list commits@accumulo.apache.org Received: (qmail 73851 invoked by uid 99); 12 Apr 2013 14:38:31 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Apr 2013 14:38:31 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Apr 2013 14:38:23 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 40F5D2388ADA; Fri, 12 Apr 2013 14:37:39 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1467287 [8/14] - in /accumulo/branches/1.4: ./ src/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/ src/core/src/main/java/org/apache/accumulo/core/client/mock/ src/core/src/main/java/org/apache/accumulo/core/data/thrift/ sr... Date: Fri, 12 Apr 2013 14:37:29 -0000 To: commits@accumulo.apache.org From: ecn@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130412143739.40F5D2388ADA@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Added: accumulo/branches/1.4/src/proxy/src/main/java/org/apache/accumulo/proxy/thrift/ActiveScan.java URL: http://svn.apache.org/viewvc/accumulo/branches/1.4/src/proxy/src/main/java/org/apache/accumulo/proxy/thrift/ActiveScan.java?rev=1467287&view=auto ============================================================================== --- accumulo/branches/1.4/src/proxy/src/main/java/org/apache/accumulo/proxy/thrift/ActiveScan.java (added) +++ accumulo/branches/1.4/src/proxy/src/main/java/org/apache/accumulo/proxy/thrift/ActiveScan.java Fri Apr 12 14:37:09 2013 @@ -0,0 +1,1368 @@ +/* + * 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 + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + */ +package org.apache.accumulo.proxy.thrift; + +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.Set; +import java.util.HashSet; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import java.nio.ByteBuffer; +import java.util.Arrays; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings("all") public class ActiveScan implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ActiveScan"); + + private static final org.apache.thrift.protocol.TField CLIENT_FIELD_DESC = new org.apache.thrift.protocol.TField("client", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField USER_FIELD_DESC = new org.apache.thrift.protocol.TField("user", org.apache.thrift.protocol.TType.STRING, (short)2); + private static final org.apache.thrift.protocol.TField TABLE_FIELD_DESC = new org.apache.thrift.protocol.TField("table", org.apache.thrift.protocol.TType.STRING, (short)3); + private static final org.apache.thrift.protocol.TField AGE_FIELD_DESC = new org.apache.thrift.protocol.TField("age", org.apache.thrift.protocol.TType.I64, (short)4); + private static final org.apache.thrift.protocol.TField IDLE_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("idleTime", org.apache.thrift.protocol.TType.I64, (short)5); + private static final org.apache.thrift.protocol.TField TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("type", org.apache.thrift.protocol.TType.I32, (short)6); + private static final org.apache.thrift.protocol.TField STATE_FIELD_DESC = new org.apache.thrift.protocol.TField("state", org.apache.thrift.protocol.TType.I32, (short)7); + private static final org.apache.thrift.protocol.TField EXTENT_FIELD_DESC = new org.apache.thrift.protocol.TField("extent", org.apache.thrift.protocol.TType.STRUCT, (short)8); + private static final org.apache.thrift.protocol.TField COLUMNS_FIELD_DESC = new org.apache.thrift.protocol.TField("columns", org.apache.thrift.protocol.TType.LIST, (short)9); + private static final org.apache.thrift.protocol.TField ITERATORS_FIELD_DESC = new org.apache.thrift.protocol.TField("iterators", org.apache.thrift.protocol.TType.LIST, (short)10); + private static final org.apache.thrift.protocol.TField AUTHORIZATIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("authorizations", org.apache.thrift.protocol.TType.LIST, (short)11); + + public String client; + public String user; + public String table; + public long age; + public long idleTime; + /** + * + * @see ScanType + */ + public ScanType type; + /** + * + * @see ScanState + */ + public ScanState state; + public KeyExtent extent; + public List columns; + public List iterators; + public List authorizations; + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum { + CLIENT((short)1, "client"), + USER((short)2, "user"), + TABLE((short)3, "table"), + AGE((short)4, "age"), + IDLE_TIME((short)5, "idleTime"), + /** + * + * @see ScanType + */ + TYPE((short)6, "type"), + /** + * + * @see ScanState + */ + STATE((short)7, "state"), + EXTENT((short)8, "extent"), + COLUMNS((short)9, "columns"), + ITERATORS((short)10, "iterators"), + AUTHORIZATIONS((short)11, "authorizations"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // CLIENT + return CLIENT; + case 2: // USER + return USER; + case 3: // TABLE + return TABLE; + case 4: // AGE + return AGE; + case 5: // IDLE_TIME + return IDLE_TIME; + case 6: // TYPE + return TYPE; + case 7: // STATE + return STATE; + case 8: // EXTENT + return EXTENT; + case 9: // COLUMNS + return COLUMNS; + case 10: // ITERATORS + return ITERATORS; + case 11: // AUTHORIZATIONS + return AUTHORIZATIONS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __AGE_ISSET_ID = 0; + private static final int __IDLETIME_ISSET_ID = 1; + private BitSet __isset_bit_vector = new BitSet(2); + + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.CLIENT, new org.apache.thrift.meta_data.FieldMetaData("client", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.USER, new org.apache.thrift.meta_data.FieldMetaData("user", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.TABLE, new org.apache.thrift.meta_data.FieldMetaData("table", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.AGE, new org.apache.thrift.meta_data.FieldMetaData("age", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.IDLE_TIME, new org.apache.thrift.meta_data.FieldMetaData("idleTime", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, ScanType.class))); + tmpMap.put(_Fields.STATE, new org.apache.thrift.meta_data.FieldMetaData("state", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, ScanState.class))); + tmpMap.put(_Fields.EXTENT, new org.apache.thrift.meta_data.FieldMetaData("extent", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, KeyExtent.class))); + tmpMap.put(_Fields.COLUMNS, new org.apache.thrift.meta_data.FieldMetaData("columns", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Column.class)))); + tmpMap.put(_Fields.ITERATORS, new org.apache.thrift.meta_data.FieldMetaData("iterators", 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, IteratorSetting.class)))); + tmpMap.put(_Fields.AUTHORIZATIONS, new org.apache.thrift.meta_data.FieldMetaData("authorizations", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ActiveScan.class, metaDataMap); + } + + public ActiveScan() { + } + + public ActiveScan( + String client, + String user, + String table, + long age, + long idleTime, + ScanType type, + ScanState state, + KeyExtent extent, + List columns, + List iterators, + List authorizations) + { + this(); + this.client = client; + this.user = user; + this.table = table; + this.age = age; + setAgeIsSet(true); + this.idleTime = idleTime; + setIdleTimeIsSet(true); + this.type = type; + this.state = state; + this.extent = extent; + this.columns = columns; + this.iterators = iterators; + this.authorizations = authorizations; + } + + /** + * Performs a deep copy on other. + */ + public ActiveScan(ActiveScan other) { + __isset_bit_vector.clear(); + __isset_bit_vector.or(other.__isset_bit_vector); + if (other.isSetClient()) { + this.client = other.client; + } + if (other.isSetUser()) { + this.user = other.user; + } + if (other.isSetTable()) { + this.table = other.table; + } + this.age = other.age; + this.idleTime = other.idleTime; + if (other.isSetType()) { + this.type = other.type; + } + if (other.isSetState()) { + this.state = other.state; + } + if (other.isSetExtent()) { + this.extent = new KeyExtent(other.extent); + } + if (other.isSetColumns()) { + List __this__columns = new ArrayList(); + for (Column other_element : other.columns) { + __this__columns.add(new Column(other_element)); + } + this.columns = __this__columns; + } + if (other.isSetIterators()) { + List __this__iterators = new ArrayList(); + for (IteratorSetting other_element : other.iterators) { + __this__iterators.add(new IteratorSetting(other_element)); + } + this.iterators = __this__iterators; + } + if (other.isSetAuthorizations()) { + List __this__authorizations = new ArrayList(); + for (ByteBuffer other_element : other.authorizations) { + ByteBuffer temp_binary_element = org.apache.thrift.TBaseHelper.copyBinary(other_element); +; + __this__authorizations.add(temp_binary_element); + } + this.authorizations = __this__authorizations; + } + } + + public ActiveScan deepCopy() { + return new ActiveScan(this); + } + + @Override + public void clear() { + this.client = null; + this.user = null; + this.table = null; + setAgeIsSet(false); + this.age = 0; + setIdleTimeIsSet(false); + this.idleTime = 0; + this.type = null; + this.state = null; + this.extent = null; + this.columns = null; + this.iterators = null; + this.authorizations = null; + } + + public String getClient() { + return this.client; + } + + public ActiveScan setClient(String client) { + this.client = client; + return this; + } + + public void unsetClient() { + this.client = null; + } + + /** Returns true if field client is set (has been assigned a value) and false otherwise */ + public boolean isSetClient() { + return this.client != null; + } + + public void setClientIsSet(boolean value) { + if (!value) { + this.client = null; + } + } + + public String getUser() { + return this.user; + } + + public ActiveScan setUser(String user) { + this.user = user; + return this; + } + + public void unsetUser() { + this.user = null; + } + + /** Returns true if field user is set (has been assigned a value) and false otherwise */ + public boolean isSetUser() { + return this.user != null; + } + + public void setUserIsSet(boolean value) { + if (!value) { + this.user = null; + } + } + + public String getTable() { + return this.table; + } + + public ActiveScan setTable(String table) { + this.table = table; + return this; + } + + public void unsetTable() { + this.table = null; + } + + /** Returns true if field table is set (has been assigned a value) and false otherwise */ + public boolean isSetTable() { + return this.table != null; + } + + public void setTableIsSet(boolean value) { + if (!value) { + this.table = null; + } + } + + public long getAge() { + return this.age; + } + + public ActiveScan setAge(long age) { + this.age = age; + setAgeIsSet(true); + return this; + } + + public void unsetAge() { + __isset_bit_vector.clear(__AGE_ISSET_ID); + } + + /** Returns true if field age is set (has been assigned a value) and false otherwise */ + public boolean isSetAge() { + return __isset_bit_vector.get(__AGE_ISSET_ID); + } + + public void setAgeIsSet(boolean value) { + __isset_bit_vector.set(__AGE_ISSET_ID, value); + } + + public long getIdleTime() { + return this.idleTime; + } + + public ActiveScan setIdleTime(long idleTime) { + this.idleTime = idleTime; + setIdleTimeIsSet(true); + return this; + } + + public void unsetIdleTime() { + __isset_bit_vector.clear(__IDLETIME_ISSET_ID); + } + + /** Returns true if field idleTime is set (has been assigned a value) and false otherwise */ + public boolean isSetIdleTime() { + return __isset_bit_vector.get(__IDLETIME_ISSET_ID); + } + + public void setIdleTimeIsSet(boolean value) { + __isset_bit_vector.set(__IDLETIME_ISSET_ID, value); + } + + /** + * + * @see ScanType + */ + public ScanType getType() { + return this.type; + } + + /** + * + * @see ScanType + */ + public ActiveScan setType(ScanType type) { + this.type = type; + return this; + } + + public void unsetType() { + this.type = null; + } + + /** Returns true if field type is set (has been assigned a value) and false otherwise */ + public boolean isSetType() { + return this.type != null; + } + + public void setTypeIsSet(boolean value) { + if (!value) { + this.type = null; + } + } + + /** + * + * @see ScanState + */ + public ScanState getState() { + return this.state; + } + + /** + * + * @see ScanState + */ + public ActiveScan setState(ScanState state) { + this.state = state; + return this; + } + + public void unsetState() { + this.state = null; + } + + /** Returns true if field state is set (has been assigned a value) and false otherwise */ + public boolean isSetState() { + return this.state != null; + } + + public void setStateIsSet(boolean value) { + if (!value) { + this.state = null; + } + } + + public KeyExtent getExtent() { + return this.extent; + } + + public ActiveScan setExtent(KeyExtent extent) { + this.extent = extent; + return this; + } + + public void unsetExtent() { + this.extent = null; + } + + /** Returns true if field extent is set (has been assigned a value) and false otherwise */ + public boolean isSetExtent() { + return this.extent != null; + } + + public void setExtentIsSet(boolean value) { + if (!value) { + this.extent = null; + } + } + + public int getColumnsSize() { + return (this.columns == null) ? 0 : this.columns.size(); + } + + public java.util.Iterator getColumnsIterator() { + return (this.columns == null) ? null : this.columns.iterator(); + } + + public void addToColumns(Column elem) { + if (this.columns == null) { + this.columns = new ArrayList(); + } + this.columns.add(elem); + } + + public List getColumns() { + return this.columns; + } + + public ActiveScan setColumns(List columns) { + this.columns = columns; + return this; + } + + public void unsetColumns() { + this.columns = null; + } + + /** Returns true if field columns is set (has been assigned a value) and false otherwise */ + public boolean isSetColumns() { + return this.columns != null; + } + + public void setColumnsIsSet(boolean value) { + if (!value) { + this.columns = null; + } + } + + public int getIteratorsSize() { + return (this.iterators == null) ? 0 : this.iterators.size(); + } + + public java.util.Iterator getIteratorsIterator() { + return (this.iterators == null) ? null : this.iterators.iterator(); + } + + public void addToIterators(IteratorSetting elem) { + if (this.iterators == null) { + this.iterators = new ArrayList(); + } + this.iterators.add(elem); + } + + public List getIterators() { + return this.iterators; + } + + public ActiveScan setIterators(List iterators) { + this.iterators = iterators; + return this; + } + + public void unsetIterators() { + this.iterators = null; + } + + /** Returns true if field iterators is set (has been assigned a value) and false otherwise */ + public boolean isSetIterators() { + return this.iterators != null; + } + + public void setIteratorsIsSet(boolean value) { + if (!value) { + this.iterators = null; + } + } + + public int getAuthorizationsSize() { + return (this.authorizations == null) ? 0 : this.authorizations.size(); + } + + public java.util.Iterator getAuthorizationsIterator() { + return (this.authorizations == null) ? null : this.authorizations.iterator(); + } + + public void addToAuthorizations(ByteBuffer elem) { + if (this.authorizations == null) { + this.authorizations = new ArrayList(); + } + this.authorizations.add(elem); + } + + public List getAuthorizations() { + return this.authorizations; + } + + public ActiveScan setAuthorizations(List authorizations) { + this.authorizations = authorizations; + return this; + } + + public void unsetAuthorizations() { + this.authorizations = null; + } + + /** Returns true if field authorizations is set (has been assigned a value) and false otherwise */ + public boolean isSetAuthorizations() { + return this.authorizations != null; + } + + public void setAuthorizationsIsSet(boolean value) { + if (!value) { + this.authorizations = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case CLIENT: + if (value == null) { + unsetClient(); + } else { + setClient((String)value); + } + break; + + case USER: + if (value == null) { + unsetUser(); + } else { + setUser((String)value); + } + break; + + case TABLE: + if (value == null) { + unsetTable(); + } else { + setTable((String)value); + } + break; + + case AGE: + if (value == null) { + unsetAge(); + } else { + setAge((Long)value); + } + break; + + case IDLE_TIME: + if (value == null) { + unsetIdleTime(); + } else { + setIdleTime((Long)value); + } + break; + + case TYPE: + if (value == null) { + unsetType(); + } else { + setType((ScanType)value); + } + break; + + case STATE: + if (value == null) { + unsetState(); + } else { + setState((ScanState)value); + } + break; + + case EXTENT: + if (value == null) { + unsetExtent(); + } else { + setExtent((KeyExtent)value); + } + break; + + case COLUMNS: + if (value == null) { + unsetColumns(); + } else { + setColumns((List)value); + } + break; + + case ITERATORS: + if (value == null) { + unsetIterators(); + } else { + setIterators((List)value); + } + break; + + case AUTHORIZATIONS: + if (value == null) { + unsetAuthorizations(); + } else { + setAuthorizations((List)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case CLIENT: + return getClient(); + + case USER: + return getUser(); + + case TABLE: + return getTable(); + + case AGE: + return new Long(getAge()); + + case IDLE_TIME: + return new Long(getIdleTime()); + + case TYPE: + return getType(); + + case STATE: + return getState(); + + case EXTENT: + return getExtent(); + + case COLUMNS: + return getColumns(); + + case ITERATORS: + return getIterators(); + + case AUTHORIZATIONS: + return getAuthorizations(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case CLIENT: + return isSetClient(); + case USER: + return isSetUser(); + case TABLE: + return isSetTable(); + case AGE: + return isSetAge(); + case IDLE_TIME: + return isSetIdleTime(); + case TYPE: + return isSetType(); + case STATE: + return isSetState(); + case EXTENT: + return isSetExtent(); + case COLUMNS: + return isSetColumns(); + case ITERATORS: + return isSetIterators(); + case AUTHORIZATIONS: + return isSetAuthorizations(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof ActiveScan) + return this.equals((ActiveScan)that); + return false; + } + + public boolean equals(ActiveScan that) { + if (that == null) + return false; + + boolean this_present_client = true && this.isSetClient(); + boolean that_present_client = true && that.isSetClient(); + if (this_present_client || that_present_client) { + if (!(this_present_client && that_present_client)) + return false; + if (!this.client.equals(that.client)) + return false; + } + + boolean this_present_user = true && this.isSetUser(); + boolean that_present_user = true && that.isSetUser(); + if (this_present_user || that_present_user) { + if (!(this_present_user && that_present_user)) + return false; + if (!this.user.equals(that.user)) + return false; + } + + boolean this_present_table = true && this.isSetTable(); + boolean that_present_table = true && that.isSetTable(); + if (this_present_table || that_present_table) { + if (!(this_present_table && that_present_table)) + return false; + if (!this.table.equals(that.table)) + return false; + } + + boolean this_present_age = true; + boolean that_present_age = true; + if (this_present_age || that_present_age) { + if (!(this_present_age && that_present_age)) + return false; + if (this.age != that.age) + return false; + } + + boolean this_present_idleTime = true; + boolean that_present_idleTime = true; + if (this_present_idleTime || that_present_idleTime) { + if (!(this_present_idleTime && that_present_idleTime)) + return false; + if (this.idleTime != that.idleTime) + return false; + } + + boolean this_present_type = true && this.isSetType(); + boolean that_present_type = true && that.isSetType(); + if (this_present_type || that_present_type) { + if (!(this_present_type && that_present_type)) + return false; + if (!this.type.equals(that.type)) + return false; + } + + boolean this_present_state = true && this.isSetState(); + boolean that_present_state = true && that.isSetState(); + if (this_present_state || that_present_state) { + if (!(this_present_state && that_present_state)) + return false; + if (!this.state.equals(that.state)) + return false; + } + + boolean this_present_extent = true && this.isSetExtent(); + boolean that_present_extent = true && that.isSetExtent(); + if (this_present_extent || that_present_extent) { + if (!(this_present_extent && that_present_extent)) + return false; + if (!this.extent.equals(that.extent)) + return false; + } + + boolean this_present_columns = true && this.isSetColumns(); + boolean that_present_columns = true && that.isSetColumns(); + if (this_present_columns || that_present_columns) { + if (!(this_present_columns && that_present_columns)) + return false; + if (!this.columns.equals(that.columns)) + return false; + } + + boolean this_present_iterators = true && this.isSetIterators(); + boolean that_present_iterators = true && that.isSetIterators(); + if (this_present_iterators || that_present_iterators) { + if (!(this_present_iterators && that_present_iterators)) + return false; + if (!this.iterators.equals(that.iterators)) + return false; + } + + boolean this_present_authorizations = true && this.isSetAuthorizations(); + boolean that_present_authorizations = true && that.isSetAuthorizations(); + if (this_present_authorizations || that_present_authorizations) { + if (!(this_present_authorizations && that_present_authorizations)) + return false; + if (!this.authorizations.equals(that.authorizations)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public int compareTo(ActiveScan other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + ActiveScan typedOther = (ActiveScan)other; + + lastComparison = Boolean.valueOf(isSetClient()).compareTo(typedOther.isSetClient()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetClient()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.client, typedOther.client); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetUser()).compareTo(typedOther.isSetUser()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetUser()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.user, typedOther.user); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetTable()).compareTo(typedOther.isSetTable()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTable()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.table, typedOther.table); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetAge()).compareTo(typedOther.isSetAge()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetAge()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.age, typedOther.age); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIdleTime()).compareTo(typedOther.isSetIdleTime()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIdleTime()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.idleTime, typedOther.idleTime); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetType()).compareTo(typedOther.isSetType()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetType()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.type, typedOther.type); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetState()).compareTo(typedOther.isSetState()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetState()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.state, typedOther.state); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetExtent()).compareTo(typedOther.isSetExtent()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetExtent()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.extent, typedOther.extent); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetColumns()).compareTo(typedOther.isSetColumns()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetColumns()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columns, typedOther.columns); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIterators()).compareTo(typedOther.isSetIterators()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIterators()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.iterators, typedOther.iterators); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetAuthorizations()).compareTo(typedOther.isSetAuthorizations()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetAuthorizations()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.authorizations, typedOther.authorizations); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (field.id) { + case 1: // CLIENT + if (field.type == org.apache.thrift.protocol.TType.STRING) { + this.client = iprot.readString(); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + } + break; + case 2: // USER + if (field.type == org.apache.thrift.protocol.TType.STRING) { + this.user = iprot.readString(); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + } + break; + case 3: // TABLE + if (field.type == org.apache.thrift.protocol.TType.STRING) { + this.table = iprot.readString(); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + } + break; + case 4: // AGE + if (field.type == org.apache.thrift.protocol.TType.I64) { + this.age = iprot.readI64(); + setAgeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + } + break; + case 5: // IDLE_TIME + if (field.type == org.apache.thrift.protocol.TType.I64) { + this.idleTime = iprot.readI64(); + setIdleTimeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + } + break; + case 6: // TYPE + if (field.type == org.apache.thrift.protocol.TType.I32) { + this.type = ScanType.findByValue(iprot.readI32()); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + } + break; + case 7: // STATE + if (field.type == org.apache.thrift.protocol.TType.I32) { + this.state = ScanState.findByValue(iprot.readI32()); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + } + break; + case 8: // EXTENT + if (field.type == org.apache.thrift.protocol.TType.STRUCT) { + this.extent = new KeyExtent(); + this.extent.read(iprot); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + } + break; + case 9: // COLUMNS + if (field.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list37 = iprot.readListBegin(); + this.columns = new ArrayList(_list37.size); + for (int _i38 = 0; _i38 < _list37.size; ++_i38) + { + Column _elem39; + _elem39 = new Column(); + _elem39.read(iprot); + this.columns.add(_elem39); + } + iprot.readListEnd(); + } + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + } + break; + case 10: // ITERATORS + if (field.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list40 = iprot.readListBegin(); + this.iterators = new ArrayList(_list40.size); + for (int _i41 = 0; _i41 < _list40.size; ++_i41) + { + IteratorSetting _elem42; + _elem42 = new IteratorSetting(); + _elem42.read(iprot); + this.iterators.add(_elem42); + } + iprot.readListEnd(); + } + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + } + break; + case 11: // AUTHORIZATIONS + if (field.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list43 = iprot.readListBegin(); + this.authorizations = new ArrayList(_list43.size); + for (int _i44 = 0; _i44 < _list43.size; ++_i44) + { + ByteBuffer _elem45; + _elem45 = iprot.readBinary(); + this.authorizations.add(_elem45); + } + iprot.readListEnd(); + } + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (this.client != null) { + oprot.writeFieldBegin(CLIENT_FIELD_DESC); + oprot.writeString(this.client); + oprot.writeFieldEnd(); + } + if (this.user != null) { + oprot.writeFieldBegin(USER_FIELD_DESC); + oprot.writeString(this.user); + oprot.writeFieldEnd(); + } + if (this.table != null) { + oprot.writeFieldBegin(TABLE_FIELD_DESC); + oprot.writeString(this.table); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(AGE_FIELD_DESC); + oprot.writeI64(this.age); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(IDLE_TIME_FIELD_DESC); + oprot.writeI64(this.idleTime); + oprot.writeFieldEnd(); + if (this.type != null) { + oprot.writeFieldBegin(TYPE_FIELD_DESC); + oprot.writeI32(this.type.getValue()); + oprot.writeFieldEnd(); + } + if (this.state != null) { + oprot.writeFieldBegin(STATE_FIELD_DESC); + oprot.writeI32(this.state.getValue()); + oprot.writeFieldEnd(); + } + if (this.extent != null) { + oprot.writeFieldBegin(EXTENT_FIELD_DESC); + this.extent.write(oprot); + oprot.writeFieldEnd(); + } + if (this.columns != null) { + oprot.writeFieldBegin(COLUMNS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.columns.size())); + for (Column _iter46 : this.columns) + { + _iter46.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (this.iterators != null) { + oprot.writeFieldBegin(ITERATORS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.iterators.size())); + for (IteratorSetting _iter47 : this.iterators) + { + _iter47.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (this.authorizations != null) { + oprot.writeFieldBegin(AUTHORIZATIONS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, this.authorizations.size())); + for (ByteBuffer _iter48 : this.authorizations) + { + oprot.writeBinary(_iter48); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("ActiveScan("); + boolean first = true; + + sb.append("client:"); + if (this.client == null) { + sb.append("null"); + } else { + sb.append(this.client); + } + first = false; + if (!first) sb.append(", "); + sb.append("user:"); + if (this.user == null) { + sb.append("null"); + } else { + sb.append(this.user); + } + first = false; + if (!first) sb.append(", "); + sb.append("table:"); + if (this.table == null) { + sb.append("null"); + } else { + sb.append(this.table); + } + first = false; + if (!first) sb.append(", "); + sb.append("age:"); + sb.append(this.age); + first = false; + if (!first) sb.append(", "); + sb.append("idleTime:"); + sb.append(this.idleTime); + first = false; + if (!first) sb.append(", "); + sb.append("type:"); + if (this.type == null) { + sb.append("null"); + } else { + sb.append(this.type); + } + first = false; + if (!first) sb.append(", "); + sb.append("state:"); + if (this.state == null) { + sb.append("null"); + } else { + sb.append(this.state); + } + first = false; + if (!first) sb.append(", "); + sb.append("extent:"); + if (this.extent == null) { + sb.append("null"); + } else { + sb.append(this.extent); + } + first = false; + if (!first) sb.append(", "); + sb.append("columns:"); + if (this.columns == null) { + sb.append("null"); + } else { + sb.append(this.columns); + } + first = false; + if (!first) sb.append(", "); + sb.append("iterators:"); + if (this.iterators == null) { + sb.append("null"); + } else { + sb.append(this.iterators); + } + first = false; + if (!first) sb.append(", "); + sb.append("authorizations:"); + if (this.authorizations == null) { + sb.append("null"); + } else { + sb.append(this.authorizations); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bit_vector = new BitSet(1); + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + +} + Propchange: accumulo/branches/1.4/src/proxy/src/main/java/org/apache/accumulo/proxy/thrift/ActiveScan.java ------------------------------------------------------------------------------ svn:eol-style = native Added: accumulo/branches/1.4/src/proxy/src/main/java/org/apache/accumulo/proxy/thrift/BatchScanOptions.java URL: http://svn.apache.org/viewvc/accumulo/branches/1.4/src/proxy/src/main/java/org/apache/accumulo/proxy/thrift/BatchScanOptions.java?rev=1467287&view=auto ============================================================================== --- accumulo/branches/1.4/src/proxy/src/main/java/org/apache/accumulo/proxy/thrift/BatchScanOptions.java (added) +++ accumulo/branches/1.4/src/proxy/src/main/java/org/apache/accumulo/proxy/thrift/BatchScanOptions.java Fri Apr 12 14:37:09 2013 @@ -0,0 +1,848 @@ +/* + * 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 + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + */ +package org.apache.accumulo.proxy.thrift; + +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.Set; +import java.util.HashSet; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import java.nio.ByteBuffer; +import java.util.Arrays; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings("all") public class BatchScanOptions implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("BatchScanOptions"); + + private static final org.apache.thrift.protocol.TField AUTHORIZATIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("authorizations", org.apache.thrift.protocol.TType.SET, (short)1); + private static final org.apache.thrift.protocol.TField RANGES_FIELD_DESC = new org.apache.thrift.protocol.TField("ranges", org.apache.thrift.protocol.TType.LIST, (short)2); + private static final org.apache.thrift.protocol.TField COLUMNS_FIELD_DESC = new org.apache.thrift.protocol.TField("columns", org.apache.thrift.protocol.TType.LIST, (short)3); + private static final org.apache.thrift.protocol.TField ITERATORS_FIELD_DESC = new org.apache.thrift.protocol.TField("iterators", org.apache.thrift.protocol.TType.LIST, (short)4); + private static final org.apache.thrift.protocol.TField THREADS_FIELD_DESC = new org.apache.thrift.protocol.TField("threads", org.apache.thrift.protocol.TType.I32, (short)5); + + public Set authorizations; + public List ranges; + public List columns; + public List iterators; + public int threads; + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum { + AUTHORIZATIONS((short)1, "authorizations"), + RANGES((short)2, "ranges"), + COLUMNS((short)3, "columns"), + ITERATORS((short)4, "iterators"), + THREADS((short)5, "threads"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // AUTHORIZATIONS + return AUTHORIZATIONS; + case 2: // RANGES + return RANGES; + case 3: // COLUMNS + return COLUMNS; + case 4: // ITERATORS + return ITERATORS; + case 5: // THREADS + return THREADS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __THREADS_ISSET_ID = 0; + private BitSet __isset_bit_vector = new BitSet(1); + + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.AUTHORIZATIONS, new org.apache.thrift.meta_data.FieldMetaData("authorizations", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.SetMetaData(org.apache.thrift.protocol.TType.SET, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)))); + tmpMap.put(_Fields.RANGES, new org.apache.thrift.meta_data.FieldMetaData("ranges", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Range.class)))); + tmpMap.put(_Fields.COLUMNS, new org.apache.thrift.meta_data.FieldMetaData("columns", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ScanColumn.class)))); + tmpMap.put(_Fields.ITERATORS, new org.apache.thrift.meta_data.FieldMetaData("iterators", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, IteratorSetting.class)))); + tmpMap.put(_Fields.THREADS, new org.apache.thrift.meta_data.FieldMetaData("threads", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(BatchScanOptions.class, metaDataMap); + } + + public BatchScanOptions() { + } + + /** + * Performs a deep copy on other. + */ + public BatchScanOptions(BatchScanOptions other) { + __isset_bit_vector.clear(); + __isset_bit_vector.or(other.__isset_bit_vector); + if (other.isSetAuthorizations()) { + Set __this__authorizations = new HashSet(); + for (ByteBuffer other_element : other.authorizations) { + ByteBuffer temp_binary_element = org.apache.thrift.TBaseHelper.copyBinary(other_element); +; + __this__authorizations.add(temp_binary_element); + } + this.authorizations = __this__authorizations; + } + if (other.isSetRanges()) { + List __this__ranges = new ArrayList(); + for (Range other_element : other.ranges) { + __this__ranges.add(new Range(other_element)); + } + this.ranges = __this__ranges; + } + if (other.isSetColumns()) { + List __this__columns = new ArrayList(); + for (ScanColumn other_element : other.columns) { + __this__columns.add(new ScanColumn(other_element)); + } + this.columns = __this__columns; + } + if (other.isSetIterators()) { + List __this__iterators = new ArrayList(); + for (IteratorSetting other_element : other.iterators) { + __this__iterators.add(new IteratorSetting(other_element)); + } + this.iterators = __this__iterators; + } + this.threads = other.threads; + } + + public BatchScanOptions deepCopy() { + return new BatchScanOptions(this); + } + + @Override + public void clear() { + this.authorizations = null; + this.ranges = null; + this.columns = null; + this.iterators = null; + setThreadsIsSet(false); + this.threads = 0; + } + + public int getAuthorizationsSize() { + return (this.authorizations == null) ? 0 : this.authorizations.size(); + } + + public java.util.Iterator getAuthorizationsIterator() { + return (this.authorizations == null) ? null : this.authorizations.iterator(); + } + + public void addToAuthorizations(ByteBuffer elem) { + if (this.authorizations == null) { + this.authorizations = new HashSet(); + } + this.authorizations.add(elem); + } + + public Set getAuthorizations() { + return this.authorizations; + } + + public BatchScanOptions setAuthorizations(Set authorizations) { + this.authorizations = authorizations; + return this; + } + + public void unsetAuthorizations() { + this.authorizations = null; + } + + /** Returns true if field authorizations is set (has been assigned a value) and false otherwise */ + public boolean isSetAuthorizations() { + return this.authorizations != null; + } + + public void setAuthorizationsIsSet(boolean value) { + if (!value) { + this.authorizations = null; + } + } + + public int getRangesSize() { + return (this.ranges == null) ? 0 : this.ranges.size(); + } + + public java.util.Iterator getRangesIterator() { + return (this.ranges == null) ? null : this.ranges.iterator(); + } + + public void addToRanges(Range elem) { + if (this.ranges == null) { + this.ranges = new ArrayList(); + } + this.ranges.add(elem); + } + + public List getRanges() { + return this.ranges; + } + + public BatchScanOptions setRanges(List ranges) { + this.ranges = ranges; + return this; + } + + public void unsetRanges() { + this.ranges = null; + } + + /** Returns true if field ranges is set (has been assigned a value) and false otherwise */ + public boolean isSetRanges() { + return this.ranges != null; + } + + public void setRangesIsSet(boolean value) { + if (!value) { + this.ranges = null; + } + } + + public int getColumnsSize() { + return (this.columns == null) ? 0 : this.columns.size(); + } + + public java.util.Iterator getColumnsIterator() { + return (this.columns == null) ? null : this.columns.iterator(); + } + + public void addToColumns(ScanColumn elem) { + if (this.columns == null) { + this.columns = new ArrayList(); + } + this.columns.add(elem); + } + + public List getColumns() { + return this.columns; + } + + public BatchScanOptions setColumns(List columns) { + this.columns = columns; + return this; + } + + public void unsetColumns() { + this.columns = null; + } + + /** Returns true if field columns is set (has been assigned a value) and false otherwise */ + public boolean isSetColumns() { + return this.columns != null; + } + + public void setColumnsIsSet(boolean value) { + if (!value) { + this.columns = null; + } + } + + public int getIteratorsSize() { + return (this.iterators == null) ? 0 : this.iterators.size(); + } + + public java.util.Iterator getIteratorsIterator() { + return (this.iterators == null) ? null : this.iterators.iterator(); + } + + public void addToIterators(IteratorSetting elem) { + if (this.iterators == null) { + this.iterators = new ArrayList(); + } + this.iterators.add(elem); + } + + public List getIterators() { + return this.iterators; + } + + public BatchScanOptions setIterators(List iterators) { + this.iterators = iterators; + return this; + } + + public void unsetIterators() { + this.iterators = null; + } + + /** Returns true if field iterators is set (has been assigned a value) and false otherwise */ + public boolean isSetIterators() { + return this.iterators != null; + } + + public void setIteratorsIsSet(boolean value) { + if (!value) { + this.iterators = null; + } + } + + public int getThreads() { + return this.threads; + } + + public BatchScanOptions setThreads(int threads) { + this.threads = threads; + setThreadsIsSet(true); + return this; + } + + public void unsetThreads() { + __isset_bit_vector.clear(__THREADS_ISSET_ID); + } + + /** Returns true if field threads is set (has been assigned a value) and false otherwise */ + public boolean isSetThreads() { + return __isset_bit_vector.get(__THREADS_ISSET_ID); + } + + public void setThreadsIsSet(boolean value) { + __isset_bit_vector.set(__THREADS_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case AUTHORIZATIONS: + if (value == null) { + unsetAuthorizations(); + } else { + setAuthorizations((Set)value); + } + break; + + case RANGES: + if (value == null) { + unsetRanges(); + } else { + setRanges((List)value); + } + break; + + case COLUMNS: + if (value == null) { + unsetColumns(); + } else { + setColumns((List)value); + } + break; + + case ITERATORS: + if (value == null) { + unsetIterators(); + } else { + setIterators((List)value); + } + break; + + case THREADS: + if (value == null) { + unsetThreads(); + } else { + setThreads((Integer)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case AUTHORIZATIONS: + return getAuthorizations(); + + case RANGES: + return getRanges(); + + case COLUMNS: + return getColumns(); + + case ITERATORS: + return getIterators(); + + case THREADS: + return new Integer(getThreads()); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case AUTHORIZATIONS: + return isSetAuthorizations(); + case RANGES: + return isSetRanges(); + case COLUMNS: + return isSetColumns(); + case ITERATORS: + return isSetIterators(); + case THREADS: + return isSetThreads(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof BatchScanOptions) + return this.equals((BatchScanOptions)that); + return false; + } + + public boolean equals(BatchScanOptions that) { + if (that == null) + return false; + + boolean this_present_authorizations = true && this.isSetAuthorizations(); + boolean that_present_authorizations = true && that.isSetAuthorizations(); + if (this_present_authorizations || that_present_authorizations) { + if (!(this_present_authorizations && that_present_authorizations)) + return false; + if (!this.authorizations.equals(that.authorizations)) + return false; + } + + boolean this_present_ranges = true && this.isSetRanges(); + boolean that_present_ranges = true && that.isSetRanges(); + if (this_present_ranges || that_present_ranges) { + if (!(this_present_ranges && that_present_ranges)) + return false; + if (!this.ranges.equals(that.ranges)) + return false; + } + + boolean this_present_columns = true && this.isSetColumns(); + boolean that_present_columns = true && that.isSetColumns(); + if (this_present_columns || that_present_columns) { + if (!(this_present_columns && that_present_columns)) + return false; + if (!this.columns.equals(that.columns)) + return false; + } + + boolean this_present_iterators = true && this.isSetIterators(); + boolean that_present_iterators = true && that.isSetIterators(); + if (this_present_iterators || that_present_iterators) { + if (!(this_present_iterators && that_present_iterators)) + return false; + if (!this.iterators.equals(that.iterators)) + return false; + } + + boolean this_present_threads = true && this.isSetThreads(); + boolean that_present_threads = true && that.isSetThreads(); + if (this_present_threads || that_present_threads) { + if (!(this_present_threads && that_present_threads)) + return false; + if (this.threads != that.threads) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public int compareTo(BatchScanOptions other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + BatchScanOptions typedOther = (BatchScanOptions)other; + + lastComparison = Boolean.valueOf(isSetAuthorizations()).compareTo(typedOther.isSetAuthorizations()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetAuthorizations()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.authorizations, typedOther.authorizations); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetRanges()).compareTo(typedOther.isSetRanges()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRanges()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ranges, typedOther.ranges); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetColumns()).compareTo(typedOther.isSetColumns()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetColumns()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columns, typedOther.columns); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIterators()).compareTo(typedOther.isSetIterators()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIterators()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.iterators, typedOther.iterators); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetThreads()).compareTo(typedOther.isSetThreads()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetThreads()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.threads, typedOther.threads); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (field.id) { + case 1: // AUTHORIZATIONS + if (field.type == org.apache.thrift.protocol.TType.SET) { + { + org.apache.thrift.protocol.TSet _set21 = iprot.readSetBegin(); + this.authorizations = new HashSet(2*_set21.size); + for (int _i22 = 0; _i22 < _set21.size; ++_i22) + { + ByteBuffer _elem23; + _elem23 = iprot.readBinary(); + this.authorizations.add(_elem23); + } + iprot.readSetEnd(); + } + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + } + break; + case 2: // RANGES + if (field.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list24 = iprot.readListBegin(); + this.ranges = new ArrayList(_list24.size); + for (int _i25 = 0; _i25 < _list24.size; ++_i25) + { + Range _elem26; + _elem26 = new Range(); + _elem26.read(iprot); + this.ranges.add(_elem26); + } + iprot.readListEnd(); + } + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + } + break; + case 3: // COLUMNS + if (field.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list27 = iprot.readListBegin(); + this.columns = new ArrayList(_list27.size); + for (int _i28 = 0; _i28 < _list27.size; ++_i28) + { + ScanColumn _elem29; + _elem29 = new ScanColumn(); + _elem29.read(iprot); + this.columns.add(_elem29); + } + iprot.readListEnd(); + } + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + } + break; + case 4: // ITERATORS + if (field.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list30 = iprot.readListBegin(); + this.iterators = new ArrayList(_list30.size); + for (int _i31 = 0; _i31 < _list30.size; ++_i31) + { + IteratorSetting _elem32; + _elem32 = new IteratorSetting(); + _elem32.read(iprot); + this.iterators.add(_elem32); + } + iprot.readListEnd(); + } + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + } + break; + case 5: // THREADS + if (field.type == org.apache.thrift.protocol.TType.I32) { + this.threads = iprot.readI32(); + setThreadsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (this.authorizations != null) { + if (isSetAuthorizations()) { + oprot.writeFieldBegin(AUTHORIZATIONS_FIELD_DESC); + { + oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRING, this.authorizations.size())); + for (ByteBuffer _iter33 : this.authorizations) + { + oprot.writeBinary(_iter33); + } + oprot.writeSetEnd(); + } + oprot.writeFieldEnd(); + } + } + if (this.ranges != null) { + if (isSetRanges()) { + oprot.writeFieldBegin(RANGES_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.ranges.size())); + for (Range _iter34 : this.ranges) + { + _iter34.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + } + if (this.columns != null) { + if (isSetColumns()) { + oprot.writeFieldBegin(COLUMNS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.columns.size())); + for (ScanColumn _iter35 : this.columns) + { + _iter35.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + } + if (this.iterators != null) { + if (isSetIterators()) { + oprot.writeFieldBegin(ITERATORS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.iterators.size())); + for (IteratorSetting _iter36 : this.iterators) + { + _iter36.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + } + if (isSetThreads()) { + oprot.writeFieldBegin(THREADS_FIELD_DESC); + oprot.writeI32(this.threads); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("BatchScanOptions("); + boolean first = true; + + if (isSetAuthorizations()) { + sb.append("authorizations:"); + if (this.authorizations == null) { + sb.append("null"); + } else { + sb.append(this.authorizations); + } + first = false; + } + if (isSetRanges()) { + if (!first) sb.append(", "); + sb.append("ranges:"); + if (this.ranges == null) { + sb.append("null"); + } else { + sb.append(this.ranges); + } + first = false; + } + if (isSetColumns()) { + if (!first) sb.append(", "); + sb.append("columns:"); + if (this.columns == null) { + sb.append("null"); + } else { + sb.append(this.columns); + } + first = false; + } + if (isSetIterators()) { + if (!first) sb.append(", "); + sb.append("iterators:"); + if (this.iterators == null) { + sb.append("null"); + } else { + sb.append(this.iterators); + } + first = false; + } + if (isSetThreads()) { + if (!first) sb.append(", "); + sb.append("threads:"); + sb.append(this.threads); + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bit_vector = new BitSet(1); + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + +} + Propchange: accumulo/branches/1.4/src/proxy/src/main/java/org/apache/accumulo/proxy/thrift/BatchScanOptions.java ------------------------------------------------------------------------------ svn:eol-style = native