Commiting generated code from Thrift api change.
Project: http://git-wip-us.apache.org/repos/asf/incubator-blur/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-blur/commit/fb44fa50 Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/fb44fa50 Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/fb44fa50 Branch: refs/heads/blur-384-random-port-cleanup Commit: fb44fa504d3d602fe9f87efac0cc462362c60de9 Parents: 4ffb994 Author: Aaron McCurry <[email protected]> Authored: Wed Oct 1 09:55:57 2014 -0400 Committer: Aaron McCurry <[email protected]> Committed: Wed Oct 1 09:55:57 2014 -0400 ---------------------------------------------------------------------- .../thrift/generated/ArgumentDescriptor.java | 605 +++++++++++++++++++ .../thrift/generated/CommandDescriptor.java | 100 +-- .../main/scripts/interface/gen-html/Blur.html | 12 +- .../main/scripts/interface/gen-html/index.html | 3 +- .../thrift/generated/ArgumentDescriptor.java | 605 +++++++++++++++++++ .../thrift/generated/CommandDescriptor.java | 100 +-- .../main/scripts/interface/gen-js/Blur_types.js | 96 ++- .../scripts/interface/gen-perl/Blur/Types.pm | 112 +++- .../main/scripts/interface/gen-rb/blur_types.rb | 24 +- docs/Blur.html | 10 +- 10 files changed, 1549 insertions(+), 118 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/fb44fa50/blur-thrift/src/main/java/org/apache/blur/thrift/generated/ArgumentDescriptor.java ---------------------------------------------------------------------- diff --git a/blur-thrift/src/main/java/org/apache/blur/thrift/generated/ArgumentDescriptor.java b/blur-thrift/src/main/java/org/apache/blur/thrift/generated/ArgumentDescriptor.java new file mode 100644 index 0000000..a540737 --- /dev/null +++ b/blur-thrift/src/main/java/org/apache/blur/thrift/generated/ArgumentDescriptor.java @@ -0,0 +1,605 @@ +/** + * Autogenerated by Thrift Compiler (0.9.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.blur.thrift.generated; + +/** + * 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. + */ + + + +import org.apache.blur.thirdparty.thrift_0_9_0.scheme.IScheme; +import org.apache.blur.thirdparty.thrift_0_9_0.scheme.SchemeFactory; +import org.apache.blur.thirdparty.thrift_0_9_0.scheme.StandardScheme; + +import org.apache.blur.thirdparty.thrift_0_9_0.scheme.TupleScheme; +import org.apache.blur.thirdparty.thrift_0_9_0.protocol.TTupleProtocol; +import org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocolException; +import org.apache.blur.thirdparty.thrift_0_9_0.EncodingUtils; +import org.apache.blur.thirdparty.thrift_0_9_0.TException; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.Set; +import java.util.HashSet; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import java.nio.ByteBuffer; +import java.util.Arrays; +//import org.slf4j.Logger; +//import org.slf4j.LoggerFactory; + +public class ArgumentDescriptor implements org.apache.blur.thirdparty.thrift_0_9_0.TBase<ArgumentDescriptor, ArgumentDescriptor._Fields>, java.io.Serializable, Cloneable { + private static final org.apache.blur.thirdparty.thrift_0_9_0.protocol.TStruct STRUCT_DESC = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TStruct("ArgumentDescriptor"); + + private static final org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField NAME_FIELD_DESC = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField("name", org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, (short)1); + private static final org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField TYPE_FIELD_DESC = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField("type", org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, (short)2); + private static final org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField DESCRIPTION_FIELD_DESC = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField("description", org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, (short)3); + + private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new ArgumentDescriptorStandardSchemeFactory()); + schemes.put(TupleScheme.class, new ArgumentDescriptorTupleSchemeFactory()); + } + + public String name; // required + public String type; // required + public String description; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.blur.thirdparty.thrift_0_9_0.TFieldIdEnum { + NAME((short)1, "name"), + TYPE((short)2, "type"), + DESCRIPTION((short)3, "description"); + + private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // NAME + return NAME; + case 2: // TYPE + return TYPE; + case 3: // DESCRIPTION + return DESCRIPTION; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.NAME, new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData("name", org.apache.blur.thirdparty.thrift_0_9_0.TFieldRequirementType.DEFAULT, + new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldValueMetaData(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING))); + tmpMap.put(_Fields.TYPE, new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData("type", org.apache.blur.thirdparty.thrift_0_9_0.TFieldRequirementType.DEFAULT, + new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldValueMetaData(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING))); + tmpMap.put(_Fields.DESCRIPTION, new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData("description", org.apache.blur.thirdparty.thrift_0_9_0.TFieldRequirementType.DEFAULT, + new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldValueMetaData(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData.addStructMetaDataMap(ArgumentDescriptor.class, metaDataMap); + } + + public ArgumentDescriptor() { + } + + public ArgumentDescriptor( + String name, + String type, + String description) + { + this(); + this.name = name; + this.type = type; + this.description = description; + } + + /** + * Performs a deep copy on <i>other</i>. + */ + public ArgumentDescriptor(ArgumentDescriptor other) { + if (other.isSetName()) { + this.name = other.name; + } + if (other.isSetType()) { + this.type = other.type; + } + if (other.isSetDescription()) { + this.description = other.description; + } + } + + public ArgumentDescriptor deepCopy() { + return new ArgumentDescriptor(this); + } + + @Override + public void clear() { + this.name = null; + this.type = null; + this.description = null; + } + + public String getName() { + return this.name; + } + + public ArgumentDescriptor setName(String name) { + this.name = name; + return this; + } + + public void unsetName() { + this.name = null; + } + + /** Returns true if field name is set (has been assigned a value) and false otherwise */ + public boolean isSetName() { + return this.name != null; + } + + public void setNameIsSet(boolean value) { + if (!value) { + this.name = null; + } + } + + public String getType() { + return this.type; + } + + public ArgumentDescriptor setType(String 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; + } + } + + public String getDescription() { + return this.description; + } + + public ArgumentDescriptor setDescription(String description) { + this.description = description; + return this; + } + + public void unsetDescription() { + this.description = null; + } + + /** Returns true if field description is set (has been assigned a value) and false otherwise */ + public boolean isSetDescription() { + return this.description != null; + } + + public void setDescriptionIsSet(boolean value) { + if (!value) { + this.description = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case NAME: + if (value == null) { + unsetName(); + } else { + setName((String)value); + } + break; + + case TYPE: + if (value == null) { + unsetType(); + } else { + setType((String)value); + } + break; + + case DESCRIPTION: + if (value == null) { + unsetDescription(); + } else { + setDescription((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case NAME: + return getName(); + + case TYPE: + return getType(); + + case DESCRIPTION: + return getDescription(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case NAME: + return isSetName(); + case TYPE: + return isSetType(); + case DESCRIPTION: + return isSetDescription(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof ArgumentDescriptor) + return this.equals((ArgumentDescriptor)that); + return false; + } + + public boolean equals(ArgumentDescriptor that) { + if (that == null) + return false; + + boolean this_present_name = true && this.isSetName(); + boolean that_present_name = true && that.isSetName(); + if (this_present_name || that_present_name) { + if (!(this_present_name && that_present_name)) + return false; + if (!this.name.equals(that.name)) + return false; + } + + boolean this_present_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_description = true && this.isSetDescription(); + boolean that_present_description = true && that.isSetDescription(); + if (this_present_description || that_present_description) { + if (!(this_present_description && that_present_description)) + return false; + if (!this.description.equals(that.description)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public int compareTo(ArgumentDescriptor other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + ArgumentDescriptor typedOther = (ArgumentDescriptor)other; + + lastComparison = Boolean.valueOf(isSetName()).compareTo(typedOther.isSetName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetName()) { + lastComparison = org.apache.blur.thirdparty.thrift_0_9_0.TBaseHelper.compareTo(this.name, typedOther.name); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetType()).compareTo(typedOther.isSetType()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetType()) { + lastComparison = org.apache.blur.thirdparty.thrift_0_9_0.TBaseHelper.compareTo(this.type, typedOther.type); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetDescription()).compareTo(typedOther.isSetDescription()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetDescription()) { + lastComparison = org.apache.blur.thirdparty.thrift_0_9_0.TBaseHelper.compareTo(this.description, typedOther.description); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol iprot) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol oprot) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("ArgumentDescriptor("); + boolean first = true; + + sb.append("name:"); + if (this.name == null) { + sb.append("null"); + } else { + sb.append(this.name); + } + 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("description:"); + if (this.description == null) { + sb.append("null"); + } else { + sb.append(this.description); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.blur.thirdparty.thrift_0_9_0.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.blur.thirdparty.thrift_0_9_0.protocol.TCompactProtocol(new org.apache.blur.thirdparty.thrift_0_9_0.transport.TIOStreamTransport(out))); + } catch (org.apache.blur.thirdparty.thrift_0_9_0.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TCompactProtocol(new org.apache.blur.thirdparty.thrift_0_9_0.transport.TIOStreamTransport(in))); + } catch (org.apache.blur.thirdparty.thrift_0_9_0.TException te) { + throw new java.io.IOException(te); + } + } + + private static class ArgumentDescriptorStandardSchemeFactory implements SchemeFactory { + public ArgumentDescriptorStandardScheme getScheme() { + return new ArgumentDescriptorStandardScheme(); + } + } + + private static class ArgumentDescriptorStandardScheme extends StandardScheme<ArgumentDescriptor> { + + public void read(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol iprot, ArgumentDescriptor struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { + org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // NAME + if (schemeField.type == org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING) { + struct.name = iprot.readString(); + struct.setNameIsSet(true); + } else { + org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // TYPE + if (schemeField.type == org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING) { + struct.type = iprot.readString(); + struct.setTypeIsSet(true); + } else { + org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // DESCRIPTION + if (schemeField.type == org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING) { + struct.description = iprot.readString(); + struct.setDescriptionIsSet(true); + } else { + org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol oprot, ArgumentDescriptor struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.name != null) { + oprot.writeFieldBegin(NAME_FIELD_DESC); + oprot.writeString(struct.name); + oprot.writeFieldEnd(); + } + if (struct.type != null) { + oprot.writeFieldBegin(TYPE_FIELD_DESC); + oprot.writeString(struct.type); + oprot.writeFieldEnd(); + } + if (struct.description != null) { + oprot.writeFieldBegin(DESCRIPTION_FIELD_DESC); + oprot.writeString(struct.description); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class ArgumentDescriptorTupleSchemeFactory implements SchemeFactory { + public ArgumentDescriptorTupleScheme getScheme() { + return new ArgumentDescriptorTupleScheme(); + } + } + + private static class ArgumentDescriptorTupleScheme extends TupleScheme<ArgumentDescriptor> { + + @Override + public void write(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol prot, ArgumentDescriptor struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetName()) { + optionals.set(0); + } + if (struct.isSetType()) { + optionals.set(1); + } + if (struct.isSetDescription()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetName()) { + oprot.writeString(struct.name); + } + if (struct.isSetType()) { + oprot.writeString(struct.type); + } + if (struct.isSetDescription()) { + oprot.writeString(struct.description); + } + } + + @Override + public void read(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol prot, ArgumentDescriptor struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + struct.name = iprot.readString(); + struct.setNameIsSet(true); + } + if (incoming.get(1)) { + struct.type = iprot.readString(); + struct.setTypeIsSet(true); + } + if (incoming.get(2)) { + struct.description = iprot.readString(); + struct.setDescriptionIsSet(true); + } + } + } + +} + http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/fb44fa50/blur-thrift/src/main/java/org/apache/blur/thrift/generated/CommandDescriptor.java ---------------------------------------------------------------------- diff --git a/blur-thrift/src/main/java/org/apache/blur/thrift/generated/CommandDescriptor.java b/blur-thrift/src/main/java/org/apache/blur/thrift/generated/CommandDescriptor.java index 3bbf1a3..94ee231 100644 --- a/blur-thrift/src/main/java/org/apache/blur/thrift/generated/CommandDescriptor.java +++ b/blur-thrift/src/main/java/org/apache/blur/thrift/generated/CommandDescriptor.java @@ -67,8 +67,8 @@ public class CommandDescriptor implements org.apache.blur.thirdparty.thrift_0_9_ public String commandName; // required public String description; // required - public Map<String,String> requiredArguments; // required - public Map<String,String> optionalArguments; // required + public Map<String,ArgumentDescriptor> requiredArguments; // required + public Map<String,ArgumentDescriptor> optionalArguments; // required public String returnType; // required public String version; // required @@ -156,11 +156,11 @@ public class CommandDescriptor implements org.apache.blur.thirdparty.thrift_0_9_ tmpMap.put(_Fields.REQUIRED_ARGUMENTS, new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData("requiredArguments", org.apache.blur.thirdparty.thrift_0_9_0.TFieldRequirementType.DEFAULT, new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.MapMetaData(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.MAP, new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldValueMetaData(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING), - new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldValueMetaData(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING)))); + new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.StructMetaData(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRUCT, ArgumentDescriptor.class)))); tmpMap.put(_Fields.OPTIONAL_ARGUMENTS, new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData("optionalArguments", org.apache.blur.thirdparty.thrift_0_9_0.TFieldRequirementType.DEFAULT, new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.MapMetaData(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.MAP, new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldValueMetaData(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING), - new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldValueMetaData(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING)))); + new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.StructMetaData(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRUCT, ArgumentDescriptor.class)))); tmpMap.put(_Fields.RETURN_TYPE, new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData("returnType", org.apache.blur.thirdparty.thrift_0_9_0.TFieldRequirementType.DEFAULT, new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldValueMetaData(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING))); tmpMap.put(_Fields.VERSION, new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData("version", org.apache.blur.thirdparty.thrift_0_9_0.TFieldRequirementType.DEFAULT, @@ -175,8 +175,8 @@ public class CommandDescriptor implements org.apache.blur.thirdparty.thrift_0_9_ public CommandDescriptor( String commandName, String description, - Map<String,String> requiredArguments, - Map<String,String> optionalArguments, + Map<String,ArgumentDescriptor> requiredArguments, + Map<String,ArgumentDescriptor> optionalArguments, String returnType, String version) { @@ -200,30 +200,30 @@ public class CommandDescriptor implements org.apache.blur.thirdparty.thrift_0_9_ this.description = other.description; } if (other.isSetRequiredArguments()) { - Map<String,String> __this__requiredArguments = new HashMap<String,String>(); - for (Map.Entry<String, String> other_element : other.requiredArguments.entrySet()) { + Map<String,ArgumentDescriptor> __this__requiredArguments = new HashMap<String,ArgumentDescriptor>(); + for (Map.Entry<String, ArgumentDescriptor> other_element : other.requiredArguments.entrySet()) { String other_element_key = other_element.getKey(); - String other_element_value = other_element.getValue(); + ArgumentDescriptor other_element_value = other_element.getValue(); String __this__requiredArguments_copy_key = other_element_key; - String __this__requiredArguments_copy_value = other_element_value; + ArgumentDescriptor __this__requiredArguments_copy_value = new ArgumentDescriptor(other_element_value); __this__requiredArguments.put(__this__requiredArguments_copy_key, __this__requiredArguments_copy_value); } this.requiredArguments = __this__requiredArguments; } if (other.isSetOptionalArguments()) { - Map<String,String> __this__optionalArguments = new HashMap<String,String>(); - for (Map.Entry<String, String> other_element : other.optionalArguments.entrySet()) { + Map<String,ArgumentDescriptor> __this__optionalArguments = new HashMap<String,ArgumentDescriptor>(); + for (Map.Entry<String, ArgumentDescriptor> other_element : other.optionalArguments.entrySet()) { String other_element_key = other_element.getKey(); - String other_element_value = other_element.getValue(); + ArgumentDescriptor other_element_value = other_element.getValue(); String __this__optionalArguments_copy_key = other_element_key; - String __this__optionalArguments_copy_value = other_element_value; + ArgumentDescriptor __this__optionalArguments_copy_value = new ArgumentDescriptor(other_element_value); __this__optionalArguments.put(__this__optionalArguments_copy_key, __this__optionalArguments_copy_value); } @@ -303,18 +303,18 @@ public class CommandDescriptor implements org.apache.blur.thirdparty.thrift_0_9_ return (this.requiredArguments == null) ? 0 : this.requiredArguments.size(); } - public void putToRequiredArguments(String key, String val) { + public void putToRequiredArguments(String key, ArgumentDescriptor val) { if (this.requiredArguments == null) { - this.requiredArguments = new HashMap<String,String>(); + this.requiredArguments = new HashMap<String,ArgumentDescriptor>(); } this.requiredArguments.put(key, val); } - public Map<String,String> getRequiredArguments() { + public Map<String,ArgumentDescriptor> getRequiredArguments() { return this.requiredArguments; } - public CommandDescriptor setRequiredArguments(Map<String,String> requiredArguments) { + public CommandDescriptor setRequiredArguments(Map<String,ArgumentDescriptor> requiredArguments) { this.requiredArguments = requiredArguments; return this; } @@ -338,18 +338,18 @@ public class CommandDescriptor implements org.apache.blur.thirdparty.thrift_0_9_ return (this.optionalArguments == null) ? 0 : this.optionalArguments.size(); } - public void putToOptionalArguments(String key, String val) { + public void putToOptionalArguments(String key, ArgumentDescriptor val) { if (this.optionalArguments == null) { - this.optionalArguments = new HashMap<String,String>(); + this.optionalArguments = new HashMap<String,ArgumentDescriptor>(); } this.optionalArguments.put(key, val); } - public Map<String,String> getOptionalArguments() { + public Map<String,ArgumentDescriptor> getOptionalArguments() { return this.optionalArguments; } - public CommandDescriptor setOptionalArguments(Map<String,String> optionalArguments) { + public CommandDescriptor setOptionalArguments(Map<String,ArgumentDescriptor> optionalArguments) { this.optionalArguments = optionalArguments; return this; } @@ -439,7 +439,7 @@ public class CommandDescriptor implements org.apache.blur.thirdparty.thrift_0_9_ if (value == null) { unsetRequiredArguments(); } else { - setRequiredArguments((Map<String,String>)value); + setRequiredArguments((Map<String,ArgumentDescriptor>)value); } break; @@ -447,7 +447,7 @@ public class CommandDescriptor implements org.apache.blur.thirdparty.thrift_0_9_ if (value == null) { unsetOptionalArguments(); } else { - setOptionalArguments((Map<String,String>)value); + setOptionalArguments((Map<String,ArgumentDescriptor>)value); } break; @@ -790,13 +790,14 @@ public class CommandDescriptor implements org.apache.blur.thirdparty.thrift_0_9_ if (schemeField.type == org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.MAP) { { org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMap _map270 = iprot.readMapBegin(); - struct.requiredArguments = new HashMap<String,String>(2*_map270.size); + struct.requiredArguments = new HashMap<String,ArgumentDescriptor>(2*_map270.size); for (int _i271 = 0; _i271 < _map270.size; ++_i271) { String _key272; // optional - String _val273; // required + ArgumentDescriptor _val273; // required _key272 = iprot.readString(); - _val273 = iprot.readString(); + _val273 = new ArgumentDescriptor(); + _val273.read(iprot); struct.requiredArguments.put(_key272, _val273); } iprot.readMapEnd(); @@ -810,13 +811,14 @@ public class CommandDescriptor implements org.apache.blur.thirdparty.thrift_0_9_ if (schemeField.type == org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.MAP) { { org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMap _map274 = iprot.readMapBegin(); - struct.optionalArguments = new HashMap<String,String>(2*_map274.size); + struct.optionalArguments = new HashMap<String,ArgumentDescriptor>(2*_map274.size); for (int _i275 = 0; _i275 < _map274.size; ++_i275) { String _key276; // optional - String _val277; // required + ArgumentDescriptor _val277; // required _key276 = iprot.readString(); - _val277 = iprot.readString(); + _val277 = new ArgumentDescriptor(); + _val277.read(iprot); struct.optionalArguments.put(_key276, _val277); } iprot.readMapEnd(); @@ -870,11 +872,11 @@ public class CommandDescriptor implements org.apache.blur.thirdparty.thrift_0_9_ if (struct.requiredArguments != null) { oprot.writeFieldBegin(REQUIRED_ARGUMENTS_FIELD_DESC); { - oprot.writeMapBegin(new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMap(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, struct.requiredArguments.size())); - for (Map.Entry<String, String> _iter278 : struct.requiredArguments.entrySet()) + oprot.writeMapBegin(new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMap(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRUCT, struct.requiredArguments.size())); + for (Map.Entry<String, ArgumentDescriptor> _iter278 : struct.requiredArguments.entrySet()) { oprot.writeString(_iter278.getKey()); - oprot.writeString(_iter278.getValue()); + _iter278.getValue().write(oprot); } oprot.writeMapEnd(); } @@ -883,11 +885,11 @@ public class CommandDescriptor implements org.apache.blur.thirdparty.thrift_0_9_ if (struct.optionalArguments != null) { oprot.writeFieldBegin(OPTIONAL_ARGUMENTS_FIELD_DESC); { - oprot.writeMapBegin(new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMap(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, struct.optionalArguments.size())); - for (Map.Entry<String, String> _iter279 : struct.optionalArguments.entrySet()) + oprot.writeMapBegin(new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMap(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRUCT, struct.optionalArguments.size())); + for (Map.Entry<String, ArgumentDescriptor> _iter279 : struct.optionalArguments.entrySet()) { oprot.writeString(_iter279.getKey()); - oprot.writeString(_iter279.getValue()); + _iter279.getValue().write(oprot); } oprot.writeMapEnd(); } @@ -949,20 +951,20 @@ public class CommandDescriptor implements org.apache.blur.thirdparty.thrift_0_9_ if (struct.isSetRequiredArguments()) { { oprot.writeI32(struct.requiredArguments.size()); - for (Map.Entry<String, String> _iter280 : struct.requiredArguments.entrySet()) + for (Map.Entry<String, ArgumentDescriptor> _iter280 : struct.requiredArguments.entrySet()) { oprot.writeString(_iter280.getKey()); - oprot.writeString(_iter280.getValue()); + _iter280.getValue().write(oprot); } } } if (struct.isSetOptionalArguments()) { { oprot.writeI32(struct.optionalArguments.size()); - for (Map.Entry<String, String> _iter281 : struct.optionalArguments.entrySet()) + for (Map.Entry<String, ArgumentDescriptor> _iter281 : struct.optionalArguments.entrySet()) { oprot.writeString(_iter281.getKey()); - oprot.writeString(_iter281.getValue()); + _iter281.getValue().write(oprot); } } } @@ -988,14 +990,15 @@ public class CommandDescriptor implements org.apache.blur.thirdparty.thrift_0_9_ } if (incoming.get(2)) { { - org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMap _map282 = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMap(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, iprot.readI32()); - struct.requiredArguments = new HashMap<String,String>(2*_map282.size); + org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMap _map282 = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMap(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRUCT, iprot.readI32()); + struct.requiredArguments = new HashMap<String,ArgumentDescriptor>(2*_map282.size); for (int _i283 = 0; _i283 < _map282.size; ++_i283) { String _key284; // optional - String _val285; // required + ArgumentDescriptor _val285; // required _key284 = iprot.readString(); - _val285 = iprot.readString(); + _val285 = new ArgumentDescriptor(); + _val285.read(iprot); struct.requiredArguments.put(_key284, _val285); } } @@ -1003,14 +1006,15 @@ public class CommandDescriptor implements org.apache.blur.thirdparty.thrift_0_9_ } if (incoming.get(3)) { { - org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMap _map286 = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMap(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, iprot.readI32()); - struct.optionalArguments = new HashMap<String,String>(2*_map286.size); + org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMap _map286 = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMap(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRUCT, iprot.readI32()); + struct.optionalArguments = new HashMap<String,ArgumentDescriptor>(2*_map286.size); for (int _i287 = 0; _i287 < _map286.size; ++_i287) { String _key288; // optional - String _val289; // required + ArgumentDescriptor _val289; // required _key288 = iprot.readString(); - _val289 = iprot.readString(); + _val289 = new ArgumentDescriptor(); + _val289.read(iprot); struct.optionalArguments.put(_key288, _val289); } } http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/fb44fa50/distribution/src/main/scripts/interface/gen-html/Blur.html ---------------------------------------------------------------------- diff --git a/distribution/src/main/scripts/interface/gen-html/Blur.html b/distribution/src/main/scripts/interface/gen-html/Blur.html index 088475c..9033519 100644 --- a/distribution/src/main/scripts/interface/gen-html/Blur.html +++ b/distribution/src/main/scripts/interface/gen-html/Blur.html @@ -64,7 +64,8 @@ <li><a href="Blur.html#Fn_Blur_traceRequestList">traceRequestList</a></li> </ul> </td> -<td><a href="Blur.html#Struct_Arguments">Arguments</a><br/> +<td><a href="Blur.html#Struct_ArgumentDescriptor">ArgumentDescriptor</a><br/> +<a href="Blur.html#Struct_Arguments">Arguments</a><br/> <a href="Blur.html#Struct_BlurException">BlurException</a><br/> <a href="Blur.html#Enum_BlurObjectType">BlurObjectType</a><br/> <a href="Blur.html#Struct_BlurPackedObject">BlurPackedObject</a><br/> @@ -654,12 +655,17 @@ be family dot column, "family.column". <tr><td>3</td><td>commandName</td><td><code>string</code></td><td></td><td>default</td><td></td></tr> <tr><td>4</td><td>arguments</td><td><code><a href="Blur.html#Struct_Arguments">Arguments</a></code></td><td></td><td>default</td><td></td></tr> <tr><td>5</td><td>state</td><td><code><a href="Blur.html#Enum_CommandStatusState">CommandStatusState</a></code></td><td></td><td>default</td><td></td></tr> +</table><br/></div><div class="definition"><h3 id="Struct_ArgumentDescriptor">Struct: ArgumentDescriptor</h3> +<table class="table-bordered table-striped table-condensed"><thead><th>Key</th><th>Field</th><th>Type</th><th>Description</th><th>Requiredness</th><th>Default value</th></thead> +<tr><td>1</td><td>name</td><td><code>string</code></td><td></td><td>default</td><td></td></tr> +<tr><td>2</td><td>type</td><td><code>string</code></td><td></td><td>default</td><td></td></tr> +<tr><td>3</td><td>description</td><td><code>string</code></td><td></td><td>default</td><td></td></tr> </table><br/></div><div class="definition"><h3 id="Struct_CommandDescriptor">Struct: CommandDescriptor</h3> <table class="table-bordered table-striped table-condensed"><thead><th>Key</th><th>Field</th><th>Type</th><th>Description</th><th>Requiredness</th><th>Default value</th></thead> <tr><td>1</td><td>commandName</td><td><code>string</code></td><td></td><td>default</td><td></td></tr> <tr><td>2</td><td>description</td><td><code>string</code></td><td></td><td>default</td><td></td></tr> -<tr><td>3</td><td>requiredArguments</td><td><code>map<<code>string</code>, <code>string</code>></code></td><td></td><td>default</td><td></td></tr> -<tr><td>4</td><td>optionalArguments</td><td><code>map<<code>string</code>, <code>string</code>></code></td><td></td><td>default</td><td></td></tr> +<tr><td>3</td><td>requiredArguments</td><td><code>map<<code>string</code>, <code><a href="Blur.html#Struct_ArgumentDescriptor">ArgumentDescriptor</a></code>></code></td><td></td><td>default</td><td></td></tr> +<tr><td>4</td><td>optionalArguments</td><td><code>map<<code>string</code>, <code><a href="Blur.html#Struct_ArgumentDescriptor">ArgumentDescriptor</a></code>></code></td><td></td><td>default</td><td></td></tr> <tr><td>5</td><td>returnType</td><td><code>string</code></td><td></td><td>default</td><td></td></tr> <tr><td>6</td><td>version</td><td><code>string</code></td><td></td><td>default</td><td></td></tr> </table><br/></div><hr/><h2 id="Services">Services</h2> http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/fb44fa50/distribution/src/main/scripts/interface/gen-html/index.html ---------------------------------------------------------------------- diff --git a/distribution/src/main/scripts/interface/gen-html/index.html b/distribution/src/main/scripts/interface/gen-html/index.html index b0085e9..7420d36 100644 --- a/distribution/src/main/scripts/interface/gen-html/index.html +++ b/distribution/src/main/scripts/interface/gen-html/index.html @@ -60,7 +60,8 @@ <li><a href="Blur.html#Fn_Blur_traceRequestList">traceRequestList</a></li> </ul> </td> -<td><a href="Blur.html#Struct_Arguments">Arguments</a><br/> +<td><a href="Blur.html#Struct_ArgumentDescriptor">ArgumentDescriptor</a><br/> +<a href="Blur.html#Struct_Arguments">Arguments</a><br/> <a href="Blur.html#Struct_BlurException">BlurException</a><br/> <a href="Blur.html#Enum_BlurObjectType">BlurObjectType</a><br/> <a href="Blur.html#Struct_BlurPackedObject">BlurPackedObject</a><br/> http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/fb44fa50/distribution/src/main/scripts/interface/gen-java/org/apache/blur/thrift/generated/ArgumentDescriptor.java ---------------------------------------------------------------------- diff --git a/distribution/src/main/scripts/interface/gen-java/org/apache/blur/thrift/generated/ArgumentDescriptor.java b/distribution/src/main/scripts/interface/gen-java/org/apache/blur/thrift/generated/ArgumentDescriptor.java new file mode 100644 index 0000000..a540737 --- /dev/null +++ b/distribution/src/main/scripts/interface/gen-java/org/apache/blur/thrift/generated/ArgumentDescriptor.java @@ -0,0 +1,605 @@ +/** + * Autogenerated by Thrift Compiler (0.9.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.blur.thrift.generated; + +/** + * 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. + */ + + + +import org.apache.blur.thirdparty.thrift_0_9_0.scheme.IScheme; +import org.apache.blur.thirdparty.thrift_0_9_0.scheme.SchemeFactory; +import org.apache.blur.thirdparty.thrift_0_9_0.scheme.StandardScheme; + +import org.apache.blur.thirdparty.thrift_0_9_0.scheme.TupleScheme; +import org.apache.blur.thirdparty.thrift_0_9_0.protocol.TTupleProtocol; +import org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocolException; +import org.apache.blur.thirdparty.thrift_0_9_0.EncodingUtils; +import org.apache.blur.thirdparty.thrift_0_9_0.TException; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.Set; +import java.util.HashSet; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import java.nio.ByteBuffer; +import java.util.Arrays; +//import org.slf4j.Logger; +//import org.slf4j.LoggerFactory; + +public class ArgumentDescriptor implements org.apache.blur.thirdparty.thrift_0_9_0.TBase<ArgumentDescriptor, ArgumentDescriptor._Fields>, java.io.Serializable, Cloneable { + private static final org.apache.blur.thirdparty.thrift_0_9_0.protocol.TStruct STRUCT_DESC = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TStruct("ArgumentDescriptor"); + + private static final org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField NAME_FIELD_DESC = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField("name", org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, (short)1); + private static final org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField TYPE_FIELD_DESC = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField("type", org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, (short)2); + private static final org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField DESCRIPTION_FIELD_DESC = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField("description", org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, (short)3); + + private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new ArgumentDescriptorStandardSchemeFactory()); + schemes.put(TupleScheme.class, new ArgumentDescriptorTupleSchemeFactory()); + } + + public String name; // required + public String type; // required + public String description; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.blur.thirdparty.thrift_0_9_0.TFieldIdEnum { + NAME((short)1, "name"), + TYPE((short)2, "type"), + DESCRIPTION((short)3, "description"); + + private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // NAME + return NAME; + case 2: // TYPE + return TYPE; + case 3: // DESCRIPTION + return DESCRIPTION; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.NAME, new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData("name", org.apache.blur.thirdparty.thrift_0_9_0.TFieldRequirementType.DEFAULT, + new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldValueMetaData(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING))); + tmpMap.put(_Fields.TYPE, new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData("type", org.apache.blur.thirdparty.thrift_0_9_0.TFieldRequirementType.DEFAULT, + new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldValueMetaData(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING))); + tmpMap.put(_Fields.DESCRIPTION, new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData("description", org.apache.blur.thirdparty.thrift_0_9_0.TFieldRequirementType.DEFAULT, + new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldValueMetaData(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData.addStructMetaDataMap(ArgumentDescriptor.class, metaDataMap); + } + + public ArgumentDescriptor() { + } + + public ArgumentDescriptor( + String name, + String type, + String description) + { + this(); + this.name = name; + this.type = type; + this.description = description; + } + + /** + * Performs a deep copy on <i>other</i>. + */ + public ArgumentDescriptor(ArgumentDescriptor other) { + if (other.isSetName()) { + this.name = other.name; + } + if (other.isSetType()) { + this.type = other.type; + } + if (other.isSetDescription()) { + this.description = other.description; + } + } + + public ArgumentDescriptor deepCopy() { + return new ArgumentDescriptor(this); + } + + @Override + public void clear() { + this.name = null; + this.type = null; + this.description = null; + } + + public String getName() { + return this.name; + } + + public ArgumentDescriptor setName(String name) { + this.name = name; + return this; + } + + public void unsetName() { + this.name = null; + } + + /** Returns true if field name is set (has been assigned a value) and false otherwise */ + public boolean isSetName() { + return this.name != null; + } + + public void setNameIsSet(boolean value) { + if (!value) { + this.name = null; + } + } + + public String getType() { + return this.type; + } + + public ArgumentDescriptor setType(String 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; + } + } + + public String getDescription() { + return this.description; + } + + public ArgumentDescriptor setDescription(String description) { + this.description = description; + return this; + } + + public void unsetDescription() { + this.description = null; + } + + /** Returns true if field description is set (has been assigned a value) and false otherwise */ + public boolean isSetDescription() { + return this.description != null; + } + + public void setDescriptionIsSet(boolean value) { + if (!value) { + this.description = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case NAME: + if (value == null) { + unsetName(); + } else { + setName((String)value); + } + break; + + case TYPE: + if (value == null) { + unsetType(); + } else { + setType((String)value); + } + break; + + case DESCRIPTION: + if (value == null) { + unsetDescription(); + } else { + setDescription((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case NAME: + return getName(); + + case TYPE: + return getType(); + + case DESCRIPTION: + return getDescription(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case NAME: + return isSetName(); + case TYPE: + return isSetType(); + case DESCRIPTION: + return isSetDescription(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof ArgumentDescriptor) + return this.equals((ArgumentDescriptor)that); + return false; + } + + public boolean equals(ArgumentDescriptor that) { + if (that == null) + return false; + + boolean this_present_name = true && this.isSetName(); + boolean that_present_name = true && that.isSetName(); + if (this_present_name || that_present_name) { + if (!(this_present_name && that_present_name)) + return false; + if (!this.name.equals(that.name)) + return false; + } + + boolean this_present_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_description = true && this.isSetDescription(); + boolean that_present_description = true && that.isSetDescription(); + if (this_present_description || that_present_description) { + if (!(this_present_description && that_present_description)) + return false; + if (!this.description.equals(that.description)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public int compareTo(ArgumentDescriptor other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + ArgumentDescriptor typedOther = (ArgumentDescriptor)other; + + lastComparison = Boolean.valueOf(isSetName()).compareTo(typedOther.isSetName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetName()) { + lastComparison = org.apache.blur.thirdparty.thrift_0_9_0.TBaseHelper.compareTo(this.name, typedOther.name); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetType()).compareTo(typedOther.isSetType()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetType()) { + lastComparison = org.apache.blur.thirdparty.thrift_0_9_0.TBaseHelper.compareTo(this.type, typedOther.type); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetDescription()).compareTo(typedOther.isSetDescription()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetDescription()) { + lastComparison = org.apache.blur.thirdparty.thrift_0_9_0.TBaseHelper.compareTo(this.description, typedOther.description); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol iprot) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol oprot) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("ArgumentDescriptor("); + boolean first = true; + + sb.append("name:"); + if (this.name == null) { + sb.append("null"); + } else { + sb.append(this.name); + } + 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("description:"); + if (this.description == null) { + sb.append("null"); + } else { + sb.append(this.description); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.blur.thirdparty.thrift_0_9_0.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.blur.thirdparty.thrift_0_9_0.protocol.TCompactProtocol(new org.apache.blur.thirdparty.thrift_0_9_0.transport.TIOStreamTransport(out))); + } catch (org.apache.blur.thirdparty.thrift_0_9_0.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TCompactProtocol(new org.apache.blur.thirdparty.thrift_0_9_0.transport.TIOStreamTransport(in))); + } catch (org.apache.blur.thirdparty.thrift_0_9_0.TException te) { + throw new java.io.IOException(te); + } + } + + private static class ArgumentDescriptorStandardSchemeFactory implements SchemeFactory { + public ArgumentDescriptorStandardScheme getScheme() { + return new ArgumentDescriptorStandardScheme(); + } + } + + private static class ArgumentDescriptorStandardScheme extends StandardScheme<ArgumentDescriptor> { + + public void read(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol iprot, ArgumentDescriptor struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { + org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // NAME + if (schemeField.type == org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING) { + struct.name = iprot.readString(); + struct.setNameIsSet(true); + } else { + org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // TYPE + if (schemeField.type == org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING) { + struct.type = iprot.readString(); + struct.setTypeIsSet(true); + } else { + org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // DESCRIPTION + if (schemeField.type == org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING) { + struct.description = iprot.readString(); + struct.setDescriptionIsSet(true); + } else { + org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol oprot, ArgumentDescriptor struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.name != null) { + oprot.writeFieldBegin(NAME_FIELD_DESC); + oprot.writeString(struct.name); + oprot.writeFieldEnd(); + } + if (struct.type != null) { + oprot.writeFieldBegin(TYPE_FIELD_DESC); + oprot.writeString(struct.type); + oprot.writeFieldEnd(); + } + if (struct.description != null) { + oprot.writeFieldBegin(DESCRIPTION_FIELD_DESC); + oprot.writeString(struct.description); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class ArgumentDescriptorTupleSchemeFactory implements SchemeFactory { + public ArgumentDescriptorTupleScheme getScheme() { + return new ArgumentDescriptorTupleScheme(); + } + } + + private static class ArgumentDescriptorTupleScheme extends TupleScheme<ArgumentDescriptor> { + + @Override + public void write(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol prot, ArgumentDescriptor struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetName()) { + optionals.set(0); + } + if (struct.isSetType()) { + optionals.set(1); + } + if (struct.isSetDescription()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetName()) { + oprot.writeString(struct.name); + } + if (struct.isSetType()) { + oprot.writeString(struct.type); + } + if (struct.isSetDescription()) { + oprot.writeString(struct.description); + } + } + + @Override + public void read(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol prot, ArgumentDescriptor struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + struct.name = iprot.readString(); + struct.setNameIsSet(true); + } + if (incoming.get(1)) { + struct.type = iprot.readString(); + struct.setTypeIsSet(true); + } + if (incoming.get(2)) { + struct.description = iprot.readString(); + struct.setDescriptionIsSet(true); + } + } + } + +} + http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/fb44fa50/distribution/src/main/scripts/interface/gen-java/org/apache/blur/thrift/generated/CommandDescriptor.java ---------------------------------------------------------------------- diff --git a/distribution/src/main/scripts/interface/gen-java/org/apache/blur/thrift/generated/CommandDescriptor.java b/distribution/src/main/scripts/interface/gen-java/org/apache/blur/thrift/generated/CommandDescriptor.java index 3bbf1a3..94ee231 100644 --- a/distribution/src/main/scripts/interface/gen-java/org/apache/blur/thrift/generated/CommandDescriptor.java +++ b/distribution/src/main/scripts/interface/gen-java/org/apache/blur/thrift/generated/CommandDescriptor.java @@ -67,8 +67,8 @@ public class CommandDescriptor implements org.apache.blur.thirdparty.thrift_0_9_ public String commandName; // required public String description; // required - public Map<String,String> requiredArguments; // required - public Map<String,String> optionalArguments; // required + public Map<String,ArgumentDescriptor> requiredArguments; // required + public Map<String,ArgumentDescriptor> optionalArguments; // required public String returnType; // required public String version; // required @@ -156,11 +156,11 @@ public class CommandDescriptor implements org.apache.blur.thirdparty.thrift_0_9_ tmpMap.put(_Fields.REQUIRED_ARGUMENTS, new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData("requiredArguments", org.apache.blur.thirdparty.thrift_0_9_0.TFieldRequirementType.DEFAULT, new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.MapMetaData(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.MAP, new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldValueMetaData(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING), - new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldValueMetaData(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING)))); + new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.StructMetaData(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRUCT, ArgumentDescriptor.class)))); tmpMap.put(_Fields.OPTIONAL_ARGUMENTS, new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData("optionalArguments", org.apache.blur.thirdparty.thrift_0_9_0.TFieldRequirementType.DEFAULT, new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.MapMetaData(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.MAP, new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldValueMetaData(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING), - new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldValueMetaData(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING)))); + new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.StructMetaData(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRUCT, ArgumentDescriptor.class)))); tmpMap.put(_Fields.RETURN_TYPE, new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData("returnType", org.apache.blur.thirdparty.thrift_0_9_0.TFieldRequirementType.DEFAULT, new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldValueMetaData(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING))); tmpMap.put(_Fields.VERSION, new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData("version", org.apache.blur.thirdparty.thrift_0_9_0.TFieldRequirementType.DEFAULT, @@ -175,8 +175,8 @@ public class CommandDescriptor implements org.apache.blur.thirdparty.thrift_0_9_ public CommandDescriptor( String commandName, String description, - Map<String,String> requiredArguments, - Map<String,String> optionalArguments, + Map<String,ArgumentDescriptor> requiredArguments, + Map<String,ArgumentDescriptor> optionalArguments, String returnType, String version) { @@ -200,30 +200,30 @@ public class CommandDescriptor implements org.apache.blur.thirdparty.thrift_0_9_ this.description = other.description; } if (other.isSetRequiredArguments()) { - Map<String,String> __this__requiredArguments = new HashMap<String,String>(); - for (Map.Entry<String, String> other_element : other.requiredArguments.entrySet()) { + Map<String,ArgumentDescriptor> __this__requiredArguments = new HashMap<String,ArgumentDescriptor>(); + for (Map.Entry<String, ArgumentDescriptor> other_element : other.requiredArguments.entrySet()) { String other_element_key = other_element.getKey(); - String other_element_value = other_element.getValue(); + ArgumentDescriptor other_element_value = other_element.getValue(); String __this__requiredArguments_copy_key = other_element_key; - String __this__requiredArguments_copy_value = other_element_value; + ArgumentDescriptor __this__requiredArguments_copy_value = new ArgumentDescriptor(other_element_value); __this__requiredArguments.put(__this__requiredArguments_copy_key, __this__requiredArguments_copy_value); } this.requiredArguments = __this__requiredArguments; } if (other.isSetOptionalArguments()) { - Map<String,String> __this__optionalArguments = new HashMap<String,String>(); - for (Map.Entry<String, String> other_element : other.optionalArguments.entrySet()) { + Map<String,ArgumentDescriptor> __this__optionalArguments = new HashMap<String,ArgumentDescriptor>(); + for (Map.Entry<String, ArgumentDescriptor> other_element : other.optionalArguments.entrySet()) { String other_element_key = other_element.getKey(); - String other_element_value = other_element.getValue(); + ArgumentDescriptor other_element_value = other_element.getValue(); String __this__optionalArguments_copy_key = other_element_key; - String __this__optionalArguments_copy_value = other_element_value; + ArgumentDescriptor __this__optionalArguments_copy_value = new ArgumentDescriptor(other_element_value); __this__optionalArguments.put(__this__optionalArguments_copy_key, __this__optionalArguments_copy_value); } @@ -303,18 +303,18 @@ public class CommandDescriptor implements org.apache.blur.thirdparty.thrift_0_9_ return (this.requiredArguments == null) ? 0 : this.requiredArguments.size(); } - public void putToRequiredArguments(String key, String val) { + public void putToRequiredArguments(String key, ArgumentDescriptor val) { if (this.requiredArguments == null) { - this.requiredArguments = new HashMap<String,String>(); + this.requiredArguments = new HashMap<String,ArgumentDescriptor>(); } this.requiredArguments.put(key, val); } - public Map<String,String> getRequiredArguments() { + public Map<String,ArgumentDescriptor> getRequiredArguments() { return this.requiredArguments; } - public CommandDescriptor setRequiredArguments(Map<String,String> requiredArguments) { + public CommandDescriptor setRequiredArguments(Map<String,ArgumentDescriptor> requiredArguments) { this.requiredArguments = requiredArguments; return this; } @@ -338,18 +338,18 @@ public class CommandDescriptor implements org.apache.blur.thirdparty.thrift_0_9_ return (this.optionalArguments == null) ? 0 : this.optionalArguments.size(); } - public void putToOptionalArguments(String key, String val) { + public void putToOptionalArguments(String key, ArgumentDescriptor val) { if (this.optionalArguments == null) { - this.optionalArguments = new HashMap<String,String>(); + this.optionalArguments = new HashMap<String,ArgumentDescriptor>(); } this.optionalArguments.put(key, val); } - public Map<String,String> getOptionalArguments() { + public Map<String,ArgumentDescriptor> getOptionalArguments() { return this.optionalArguments; } - public CommandDescriptor setOptionalArguments(Map<String,String> optionalArguments) { + public CommandDescriptor setOptionalArguments(Map<String,ArgumentDescriptor> optionalArguments) { this.optionalArguments = optionalArguments; return this; } @@ -439,7 +439,7 @@ public class CommandDescriptor implements org.apache.blur.thirdparty.thrift_0_9_ if (value == null) { unsetRequiredArguments(); } else { - setRequiredArguments((Map<String,String>)value); + setRequiredArguments((Map<String,ArgumentDescriptor>)value); } break; @@ -447,7 +447,7 @@ public class CommandDescriptor implements org.apache.blur.thirdparty.thrift_0_9_ if (value == null) { unsetOptionalArguments(); } else { - setOptionalArguments((Map<String,String>)value); + setOptionalArguments((Map<String,ArgumentDescriptor>)value); } break; @@ -790,13 +790,14 @@ public class CommandDescriptor implements org.apache.blur.thirdparty.thrift_0_9_ if (schemeField.type == org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.MAP) { { org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMap _map270 = iprot.readMapBegin(); - struct.requiredArguments = new HashMap<String,String>(2*_map270.size); + struct.requiredArguments = new HashMap<String,ArgumentDescriptor>(2*_map270.size); for (int _i271 = 0; _i271 < _map270.size; ++_i271) { String _key272; // optional - String _val273; // required + ArgumentDescriptor _val273; // required _key272 = iprot.readString(); - _val273 = iprot.readString(); + _val273 = new ArgumentDescriptor(); + _val273.read(iprot); struct.requiredArguments.put(_key272, _val273); } iprot.readMapEnd(); @@ -810,13 +811,14 @@ public class CommandDescriptor implements org.apache.blur.thirdparty.thrift_0_9_ if (schemeField.type == org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.MAP) { { org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMap _map274 = iprot.readMapBegin(); - struct.optionalArguments = new HashMap<String,String>(2*_map274.size); + struct.optionalArguments = new HashMap<String,ArgumentDescriptor>(2*_map274.size); for (int _i275 = 0; _i275 < _map274.size; ++_i275) { String _key276; // optional - String _val277; // required + ArgumentDescriptor _val277; // required _key276 = iprot.readString(); - _val277 = iprot.readString(); + _val277 = new ArgumentDescriptor(); + _val277.read(iprot); struct.optionalArguments.put(_key276, _val277); } iprot.readMapEnd(); @@ -870,11 +872,11 @@ public class CommandDescriptor implements org.apache.blur.thirdparty.thrift_0_9_ if (struct.requiredArguments != null) { oprot.writeFieldBegin(REQUIRED_ARGUMENTS_FIELD_DESC); { - oprot.writeMapBegin(new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMap(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, struct.requiredArguments.size())); - for (Map.Entry<String, String> _iter278 : struct.requiredArguments.entrySet()) + oprot.writeMapBegin(new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMap(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRUCT, struct.requiredArguments.size())); + for (Map.Entry<String, ArgumentDescriptor> _iter278 : struct.requiredArguments.entrySet()) { oprot.writeString(_iter278.getKey()); - oprot.writeString(_iter278.getValue()); + _iter278.getValue().write(oprot); } oprot.writeMapEnd(); } @@ -883,11 +885,11 @@ public class CommandDescriptor implements org.apache.blur.thirdparty.thrift_0_9_ if (struct.optionalArguments != null) { oprot.writeFieldBegin(OPTIONAL_ARGUMENTS_FIELD_DESC); { - oprot.writeMapBegin(new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMap(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, struct.optionalArguments.size())); - for (Map.Entry<String, String> _iter279 : struct.optionalArguments.entrySet()) + oprot.writeMapBegin(new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMap(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRUCT, struct.optionalArguments.size())); + for (Map.Entry<String, ArgumentDescriptor> _iter279 : struct.optionalArguments.entrySet()) { oprot.writeString(_iter279.getKey()); - oprot.writeString(_iter279.getValue()); + _iter279.getValue().write(oprot); } oprot.writeMapEnd(); } @@ -949,20 +951,20 @@ public class CommandDescriptor implements org.apache.blur.thirdparty.thrift_0_9_ if (struct.isSetRequiredArguments()) { { oprot.writeI32(struct.requiredArguments.size()); - for (Map.Entry<String, String> _iter280 : struct.requiredArguments.entrySet()) + for (Map.Entry<String, ArgumentDescriptor> _iter280 : struct.requiredArguments.entrySet()) { oprot.writeString(_iter280.getKey()); - oprot.writeString(_iter280.getValue()); + _iter280.getValue().write(oprot); } } } if (struct.isSetOptionalArguments()) { { oprot.writeI32(struct.optionalArguments.size()); - for (Map.Entry<String, String> _iter281 : struct.optionalArguments.entrySet()) + for (Map.Entry<String, ArgumentDescriptor> _iter281 : struct.optionalArguments.entrySet()) { oprot.writeString(_iter281.getKey()); - oprot.writeString(_iter281.getValue()); + _iter281.getValue().write(oprot); } } } @@ -988,14 +990,15 @@ public class CommandDescriptor implements org.apache.blur.thirdparty.thrift_0_9_ } if (incoming.get(2)) { { - org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMap _map282 = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMap(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, iprot.readI32()); - struct.requiredArguments = new HashMap<String,String>(2*_map282.size); + org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMap _map282 = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMap(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRUCT, iprot.readI32()); + struct.requiredArguments = new HashMap<String,ArgumentDescriptor>(2*_map282.size); for (int _i283 = 0; _i283 < _map282.size; ++_i283) { String _key284; // optional - String _val285; // required + ArgumentDescriptor _val285; // required _key284 = iprot.readString(); - _val285 = iprot.readString(); + _val285 = new ArgumentDescriptor(); + _val285.read(iprot); struct.requiredArguments.put(_key284, _val285); } } @@ -1003,14 +1006,15 @@ public class CommandDescriptor implements org.apache.blur.thirdparty.thrift_0_9_ } if (incoming.get(3)) { { - org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMap _map286 = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMap(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, iprot.readI32()); - struct.optionalArguments = new HashMap<String,String>(2*_map286.size); + org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMap _map286 = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMap(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRUCT, iprot.readI32()); + struct.optionalArguments = new HashMap<String,ArgumentDescriptor>(2*_map286.size); for (int _i287 = 0; _i287 < _map286.size; ++_i287) { String _key288; // optional - String _val289; // required + ArgumentDescriptor _val289; // required _key288 = iprot.readString(); - _val289 = iprot.readString(); + _val289 = new ArgumentDescriptor(); + _val289.read(iprot); struct.optionalArguments.put(_key288, _val289); } } http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/fb44fa50/distribution/src/main/scripts/interface/gen-js/Blur_types.js ---------------------------------------------------------------------- diff --git a/distribution/src/main/scripts/interface/gen-js/Blur_types.js b/distribution/src/main/scripts/interface/gen-js/Blur_types.js index c2ba3bc..963e516 100644 --- a/distribution/src/main/scripts/interface/gen-js/Blur_types.js +++ b/distribution/src/main/scripts/interface/gen-js/Blur_types.js @@ -4544,6 +4544,88 @@ CommandStatus.prototype.write = function(output) { return; }; +ArgumentDescriptor = function(args) { + this.name = null; + this.type = null; + this.description = null; + if (args) { + if (args.name !== undefined) { + this.name = args.name; + } + if (args.type !== undefined) { + this.type = args.type; + } + if (args.description !== undefined) { + this.description = args.description; + } + } +}; +ArgumentDescriptor.prototype = {}; +ArgumentDescriptor.prototype.read = function(input) { + input.readStructBegin(); + while (true) + { + var ret = input.readFieldBegin(); + var fname = ret.fname; + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == Thrift.Type.STRING) { + this.name = input.readString().value; + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.type = input.readString().value; + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.STRING) { + this.description = input.readString().value; + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +ArgumentDescriptor.prototype.write = function(output) { + output.writeStructBegin('ArgumentDescriptor'); + if (this.name !== null && this.name !== undefined) { + output.writeFieldBegin('name', Thrift.Type.STRING, 1); + output.writeString(this.name); + output.writeFieldEnd(); + } + if (this.type !== null && this.type !== undefined) { + output.writeFieldBegin('type', Thrift.Type.STRING, 2); + output.writeString(this.type); + output.writeFieldEnd(); + } + if (this.description !== null && this.description !== undefined) { + output.writeFieldBegin('description', Thrift.Type.STRING, 3); + output.writeString(this.description); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + CommandDescriptor = function(args) { this.commandName = null; this.description = null; @@ -4621,7 +4703,8 @@ CommandDescriptor.prototype.read = function(input) { var key276 = null; var val277 = null; key276 = input.readString().value; - val277 = input.readString().value; + val277 = new ArgumentDescriptor(); + val277.read(input); this.requiredArguments[key276] = val277; } input.readMapEnd(); @@ -4650,7 +4733,8 @@ CommandDescriptor.prototype.read = function(input) { var key284 = null; var val285 = null; key284 = input.readString().value; - val285 = input.readString().value; + val285 = new ArgumentDescriptor(); + val285.read(input); this.optionalArguments[key284] = val285; } input.readMapEnd(); @@ -4695,14 +4779,14 @@ CommandDescriptor.prototype.write = function(output) { } if (this.requiredArguments !== null && this.requiredArguments !== undefined) { output.writeFieldBegin('requiredArguments', Thrift.Type.MAP, 3); - output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.requiredArguments)); + output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRUCT, Thrift.objectLength(this.requiredArguments)); for (var kiter286 in this.requiredArguments) { if (this.requiredArguments.hasOwnProperty(kiter286)) { var viter287 = this.requiredArguments[kiter286]; output.writeString(kiter286); - output.writeString(viter287); + viter287.write(output); } } output.writeMapEnd(); @@ -4710,14 +4794,14 @@ CommandDescriptor.prototype.write = function(output) { } if (this.optionalArguments !== null && this.optionalArguments !== undefined) { output.writeFieldBegin('optionalArguments', Thrift.Type.MAP, 4); - output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.optionalArguments)); + output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRUCT, Thrift.objectLength(this.optionalArguments)); for (var kiter288 in this.optionalArguments) { if (this.optionalArguments.hasOwnProperty(kiter288)) { var viter289 = this.optionalArguments[kiter288]; output.writeString(kiter288); - output.writeString(viter289); + viter289.write(output); } } output.writeMapEnd();
