http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/90bcb15e/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 new file mode 100644 index 0000000..3bbf1a3 --- /dev/null +++ b/blur-thrift/src/main/java/org/apache/blur/thrift/generated/CommandDescriptor.java @@ -0,0 +1,1031 @@ +/** + * 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 CommandDescriptor implements org.apache.blur.thirdparty.thrift_0_9_0.TBase<CommandDescriptor, CommandDescriptor._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("CommandDescriptor"); + + private static final org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField COMMAND_NAME_FIELD_DESC = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField("commandName", 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 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)2); + private static final org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField REQUIRED_ARGUMENTS_FIELD_DESC = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField("requiredArguments", org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.MAP, (short)3); + private static final org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField OPTIONAL_ARGUMENTS_FIELD_DESC = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField("optionalArguments", org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.MAP, (short)4); + private static final org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField RETURN_TYPE_FIELD_DESC = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField("returnType", org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, (short)5); + private static final org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField VERSION_FIELD_DESC = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField("version", org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, (short)6); + + private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new CommandDescriptorStandardSchemeFactory()); + schemes.put(TupleScheme.class, new CommandDescriptorTupleSchemeFactory()); + } + + public String commandName; // required + public String description; // required + public Map<String,String> requiredArguments; // required + public Map<String,String> optionalArguments; // required + public String returnType; // required + public String version; // 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 { + COMMAND_NAME((short)1, "commandName"), + DESCRIPTION((short)2, "description"), + REQUIRED_ARGUMENTS((short)3, "requiredArguments"), + OPTIONAL_ARGUMENTS((short)4, "optionalArguments"), + RETURN_TYPE((short)5, "returnType"), + VERSION((short)6, "version"); + + 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: // COMMAND_NAME + return COMMAND_NAME; + case 2: // DESCRIPTION + return DESCRIPTION; + case 3: // REQUIRED_ARGUMENTS + return REQUIRED_ARGUMENTS; + case 4: // OPTIONAL_ARGUMENTS + return OPTIONAL_ARGUMENTS; + case 5: // RETURN_TYPE + return RETURN_TYPE; + case 6: // VERSION + return VERSION; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches 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.COMMAND_NAME, new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData("commandName", 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))); + 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)))); + 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)))); + 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, + 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(CommandDescriptor.class, metaDataMap); + } + + public CommandDescriptor() { + } + + public CommandDescriptor( + String commandName, + String description, + Map<String,String> requiredArguments, + Map<String,String> optionalArguments, + String returnType, + String version) + { + this(); + this.commandName = commandName; + this.description = description; + this.requiredArguments = requiredArguments; + this.optionalArguments = optionalArguments; + this.returnType = returnType; + this.version = version; + } + + /** + * Performs a deep copy on <i>other</i>. + */ + public CommandDescriptor(CommandDescriptor other) { + if (other.isSetCommandName()) { + this.commandName = other.commandName; + } + if (other.isSetDescription()) { + 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()) { + + String other_element_key = other_element.getKey(); + String other_element_value = other_element.getValue(); + + String __this__requiredArguments_copy_key = other_element_key; + + String __this__requiredArguments_copy_value = 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()) { + + String other_element_key = other_element.getKey(); + String other_element_value = other_element.getValue(); + + String __this__optionalArguments_copy_key = other_element_key; + + String __this__optionalArguments_copy_value = other_element_value; + + __this__optionalArguments.put(__this__optionalArguments_copy_key, __this__optionalArguments_copy_value); + } + this.optionalArguments = __this__optionalArguments; + } + if (other.isSetReturnType()) { + this.returnType = other.returnType; + } + if (other.isSetVersion()) { + this.version = other.version; + } + } + + public CommandDescriptor deepCopy() { + return new CommandDescriptor(this); + } + + @Override + public void clear() { + this.commandName = null; + this.description = null; + this.requiredArguments = null; + this.optionalArguments = null; + this.returnType = null; + this.version = null; + } + + public String getCommandName() { + return this.commandName; + } + + public CommandDescriptor setCommandName(String commandName) { + this.commandName = commandName; + return this; + } + + public void unsetCommandName() { + this.commandName = null; + } + + /** Returns true if field commandName is set (has been assigned a value) and false otherwise */ + public boolean isSetCommandName() { + return this.commandName != null; + } + + public void setCommandNameIsSet(boolean value) { + if (!value) { + this.commandName = null; + } + } + + public String getDescription() { + return this.description; + } + + public CommandDescriptor 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 int getRequiredArgumentsSize() { + return (this.requiredArguments == null) ? 0 : this.requiredArguments.size(); + } + + public void putToRequiredArguments(String key, String val) { + if (this.requiredArguments == null) { + this.requiredArguments = new HashMap<String,String>(); + } + this.requiredArguments.put(key, val); + } + + public Map<String,String> getRequiredArguments() { + return this.requiredArguments; + } + + public CommandDescriptor setRequiredArguments(Map<String,String> requiredArguments) { + this.requiredArguments = requiredArguments; + return this; + } + + public void unsetRequiredArguments() { + this.requiredArguments = null; + } + + /** Returns true if field requiredArguments is set (has been assigned a value) and false otherwise */ + public boolean isSetRequiredArguments() { + return this.requiredArguments != null; + } + + public void setRequiredArgumentsIsSet(boolean value) { + if (!value) { + this.requiredArguments = null; + } + } + + public int getOptionalArgumentsSize() { + return (this.optionalArguments == null) ? 0 : this.optionalArguments.size(); + } + + public void putToOptionalArguments(String key, String val) { + if (this.optionalArguments == null) { + this.optionalArguments = new HashMap<String,String>(); + } + this.optionalArguments.put(key, val); + } + + public Map<String,String> getOptionalArguments() { + return this.optionalArguments; + } + + public CommandDescriptor setOptionalArguments(Map<String,String> optionalArguments) { + this.optionalArguments = optionalArguments; + return this; + } + + public void unsetOptionalArguments() { + this.optionalArguments = null; + } + + /** Returns true if field optionalArguments is set (has been assigned a value) and false otherwise */ + public boolean isSetOptionalArguments() { + return this.optionalArguments != null; + } + + public void setOptionalArgumentsIsSet(boolean value) { + if (!value) { + this.optionalArguments = null; + } + } + + public String getReturnType() { + return this.returnType; + } + + public CommandDescriptor setReturnType(String returnType) { + this.returnType = returnType; + return this; + } + + public void unsetReturnType() { + this.returnType = null; + } + + /** Returns true if field returnType is set (has been assigned a value) and false otherwise */ + public boolean isSetReturnType() { + return this.returnType != null; + } + + public void setReturnTypeIsSet(boolean value) { + if (!value) { + this.returnType = null; + } + } + + public String getVersion() { + return this.version; + } + + public CommandDescriptor setVersion(String version) { + this.version = version; + return this; + } + + public void unsetVersion() { + this.version = null; + } + + /** Returns true if field version is set (has been assigned a value) and false otherwise */ + public boolean isSetVersion() { + return this.version != null; + } + + public void setVersionIsSet(boolean value) { + if (!value) { + this.version = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case COMMAND_NAME: + if (value == null) { + unsetCommandName(); + } else { + setCommandName((String)value); + } + break; + + case DESCRIPTION: + if (value == null) { + unsetDescription(); + } else { + setDescription((String)value); + } + break; + + case REQUIRED_ARGUMENTS: + if (value == null) { + unsetRequiredArguments(); + } else { + setRequiredArguments((Map<String,String>)value); + } + break; + + case OPTIONAL_ARGUMENTS: + if (value == null) { + unsetOptionalArguments(); + } else { + setOptionalArguments((Map<String,String>)value); + } + break; + + case RETURN_TYPE: + if (value == null) { + unsetReturnType(); + } else { + setReturnType((String)value); + } + break; + + case VERSION: + if (value == null) { + unsetVersion(); + } else { + setVersion((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case COMMAND_NAME: + return getCommandName(); + + case DESCRIPTION: + return getDescription(); + + case REQUIRED_ARGUMENTS: + return getRequiredArguments(); + + case OPTIONAL_ARGUMENTS: + return getOptionalArguments(); + + case RETURN_TYPE: + return getReturnType(); + + case VERSION: + return getVersion(); + + } + 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 COMMAND_NAME: + return isSetCommandName(); + case DESCRIPTION: + return isSetDescription(); + case REQUIRED_ARGUMENTS: + return isSetRequiredArguments(); + case OPTIONAL_ARGUMENTS: + return isSetOptionalArguments(); + case RETURN_TYPE: + return isSetReturnType(); + case VERSION: + return isSetVersion(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof CommandDescriptor) + return this.equals((CommandDescriptor)that); + return false; + } + + public boolean equals(CommandDescriptor that) { + if (that == null) + return false; + + boolean this_present_commandName = true && this.isSetCommandName(); + boolean that_present_commandName = true && that.isSetCommandName(); + if (this_present_commandName || that_present_commandName) { + if (!(this_present_commandName && that_present_commandName)) + return false; + if (!this.commandName.equals(that.commandName)) + 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; + } + + boolean this_present_requiredArguments = true && this.isSetRequiredArguments(); + boolean that_present_requiredArguments = true && that.isSetRequiredArguments(); + if (this_present_requiredArguments || that_present_requiredArguments) { + if (!(this_present_requiredArguments && that_present_requiredArguments)) + return false; + if (!this.requiredArguments.equals(that.requiredArguments)) + return false; + } + + boolean this_present_optionalArguments = true && this.isSetOptionalArguments(); + boolean that_present_optionalArguments = true && that.isSetOptionalArguments(); + if (this_present_optionalArguments || that_present_optionalArguments) { + if (!(this_present_optionalArguments && that_present_optionalArguments)) + return false; + if (!this.optionalArguments.equals(that.optionalArguments)) + return false; + } + + boolean this_present_returnType = true && this.isSetReturnType(); + boolean that_present_returnType = true && that.isSetReturnType(); + if (this_present_returnType || that_present_returnType) { + if (!(this_present_returnType && that_present_returnType)) + return false; + if (!this.returnType.equals(that.returnType)) + return false; + } + + boolean this_present_version = true && this.isSetVersion(); + boolean that_present_version = true && that.isSetVersion(); + if (this_present_version || that_present_version) { + if (!(this_present_version && that_present_version)) + return false; + if (!this.version.equals(that.version)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public int compareTo(CommandDescriptor other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + CommandDescriptor typedOther = (CommandDescriptor)other; + + lastComparison = Boolean.valueOf(isSetCommandName()).compareTo(typedOther.isSetCommandName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetCommandName()) { + lastComparison = org.apache.blur.thirdparty.thrift_0_9_0.TBaseHelper.compareTo(this.commandName, typedOther.commandName); + 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; + } + } + lastComparison = Boolean.valueOf(isSetRequiredArguments()).compareTo(typedOther.isSetRequiredArguments()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRequiredArguments()) { + lastComparison = org.apache.blur.thirdparty.thrift_0_9_0.TBaseHelper.compareTo(this.requiredArguments, typedOther.requiredArguments); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetOptionalArguments()).compareTo(typedOther.isSetOptionalArguments()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetOptionalArguments()) { + lastComparison = org.apache.blur.thirdparty.thrift_0_9_0.TBaseHelper.compareTo(this.optionalArguments, typedOther.optionalArguments); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetReturnType()).compareTo(typedOther.isSetReturnType()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetReturnType()) { + lastComparison = org.apache.blur.thirdparty.thrift_0_9_0.TBaseHelper.compareTo(this.returnType, typedOther.returnType); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetVersion()).compareTo(typedOther.isSetVersion()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetVersion()) { + lastComparison = org.apache.blur.thirdparty.thrift_0_9_0.TBaseHelper.compareTo(this.version, typedOther.version); + 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("CommandDescriptor("); + boolean first = true; + + sb.append("commandName:"); + if (this.commandName == null) { + sb.append("null"); + } else { + sb.append(this.commandName); + } + first = false; + if (!first) sb.append(", "); + sb.append("description:"); + if (this.description == null) { + sb.append("null"); + } else { + sb.append(this.description); + } + first = false; + if (!first) sb.append(", "); + sb.append("requiredArguments:"); + if (this.requiredArguments == null) { + sb.append("null"); + } else { + sb.append(this.requiredArguments); + } + first = false; + if (!first) sb.append(", "); + sb.append("optionalArguments:"); + if (this.optionalArguments == null) { + sb.append("null"); + } else { + sb.append(this.optionalArguments); + } + first = false; + if (!first) sb.append(", "); + sb.append("returnType:"); + if (this.returnType == null) { + sb.append("null"); + } else { + sb.append(this.returnType); + } + first = false; + if (!first) sb.append(", "); + sb.append("version:"); + if (this.version == null) { + sb.append("null"); + } else { + sb.append(this.version); + } + 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 CommandDescriptorStandardSchemeFactory implements SchemeFactory { + public CommandDescriptorStandardScheme getScheme() { + return new CommandDescriptorStandardScheme(); + } + } + + private static class CommandDescriptorStandardScheme extends StandardScheme<CommandDescriptor> { + + public void read(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol iprot, CommandDescriptor 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: // COMMAND_NAME + if (schemeField.type == org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING) { + struct.commandName = iprot.readString(); + struct.setCommandNameIsSet(true); + } else { + org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // 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; + case 3: // REQUIRED_ARGUMENTS + 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); + for (int _i271 = 0; _i271 < _map270.size; ++_i271) + { + String _key272; // optional + String _val273; // required + _key272 = iprot.readString(); + _val273 = iprot.readString(); + struct.requiredArguments.put(_key272, _val273); + } + iprot.readMapEnd(); + } + struct.setRequiredArgumentsIsSet(true); + } else { + org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // OPTIONAL_ARGUMENTS + 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); + for (int _i275 = 0; _i275 < _map274.size; ++_i275) + { + String _key276; // optional + String _val277; // required + _key276 = iprot.readString(); + _val277 = iprot.readString(); + struct.optionalArguments.put(_key276, _val277); + } + iprot.readMapEnd(); + } + struct.setOptionalArgumentsIsSet(true); + } else { + org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // RETURN_TYPE + if (schemeField.type == org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING) { + struct.returnType = iprot.readString(); + struct.setReturnTypeIsSet(true); + } else { + org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 6: // VERSION + if (schemeField.type == org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING) { + struct.version = iprot.readString(); + struct.setVersionIsSet(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, CommandDescriptor struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.commandName != null) { + oprot.writeFieldBegin(COMMAND_NAME_FIELD_DESC); + oprot.writeString(struct.commandName); + oprot.writeFieldEnd(); + } + if (struct.description != null) { + oprot.writeFieldBegin(DESCRIPTION_FIELD_DESC); + oprot.writeString(struct.description); + oprot.writeFieldEnd(); + } + 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.writeString(_iter278.getKey()); + oprot.writeString(_iter278.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + 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.writeString(_iter279.getKey()); + oprot.writeString(_iter279.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.returnType != null) { + oprot.writeFieldBegin(RETURN_TYPE_FIELD_DESC); + oprot.writeString(struct.returnType); + oprot.writeFieldEnd(); + } + if (struct.version != null) { + oprot.writeFieldBegin(VERSION_FIELD_DESC); + oprot.writeString(struct.version); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class CommandDescriptorTupleSchemeFactory implements SchemeFactory { + public CommandDescriptorTupleScheme getScheme() { + return new CommandDescriptorTupleScheme(); + } + } + + private static class CommandDescriptorTupleScheme extends TupleScheme<CommandDescriptor> { + + @Override + public void write(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol prot, CommandDescriptor struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetCommandName()) { + optionals.set(0); + } + if (struct.isSetDescription()) { + optionals.set(1); + } + if (struct.isSetRequiredArguments()) { + optionals.set(2); + } + if (struct.isSetOptionalArguments()) { + optionals.set(3); + } + if (struct.isSetReturnType()) { + optionals.set(4); + } + if (struct.isSetVersion()) { + optionals.set(5); + } + oprot.writeBitSet(optionals, 6); + if (struct.isSetCommandName()) { + oprot.writeString(struct.commandName); + } + if (struct.isSetDescription()) { + oprot.writeString(struct.description); + } + if (struct.isSetRequiredArguments()) { + { + oprot.writeI32(struct.requiredArguments.size()); + for (Map.Entry<String, String> _iter280 : struct.requiredArguments.entrySet()) + { + oprot.writeString(_iter280.getKey()); + oprot.writeString(_iter280.getValue()); + } + } + } + if (struct.isSetOptionalArguments()) { + { + oprot.writeI32(struct.optionalArguments.size()); + for (Map.Entry<String, String> _iter281 : struct.optionalArguments.entrySet()) + { + oprot.writeString(_iter281.getKey()); + oprot.writeString(_iter281.getValue()); + } + } + } + if (struct.isSetReturnType()) { + oprot.writeString(struct.returnType); + } + if (struct.isSetVersion()) { + oprot.writeString(struct.version); + } + } + + @Override + public void read(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol prot, CommandDescriptor struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(6); + if (incoming.get(0)) { + struct.commandName = iprot.readString(); + struct.setCommandNameIsSet(true); + } + if (incoming.get(1)) { + struct.description = iprot.readString(); + struct.setDescriptionIsSet(true); + } + 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); + for (int _i283 = 0; _i283 < _map282.size; ++_i283) + { + String _key284; // optional + String _val285; // required + _key284 = iprot.readString(); + _val285 = iprot.readString(); + struct.requiredArguments.put(_key284, _val285); + } + } + struct.setRequiredArgumentsIsSet(true); + } + 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); + for (int _i287 = 0; _i287 < _map286.size; ++_i287) + { + String _key288; // optional + String _val289; // required + _key288 = iprot.readString(); + _val289 = iprot.readString(); + struct.optionalArguments.put(_key288, _val289); + } + } + struct.setOptionalArgumentsIsSet(true); + } + if (incoming.get(4)) { + struct.returnType = iprot.readString(); + struct.setReturnTypeIsSet(true); + } + if (incoming.get(5)) { + struct.version = iprot.readString(); + struct.setVersionIsSet(true); + } + } + } + +} +
http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/90bcb15e/blur-thrift/src/main/java/org/apache/blur/thrift/generated/SafeClientGen.java ---------------------------------------------------------------------- diff --git a/blur-thrift/src/main/java/org/apache/blur/thrift/generated/SafeClientGen.java b/blur-thrift/src/main/java/org/apache/blur/thrift/generated/SafeClientGen.java index 20d7def..79171b7 100644 --- a/blur-thrift/src/main/java/org/apache/blur/thrift/generated/SafeClientGen.java +++ b/blur-thrift/src/main/java/org/apache/blur/thrift/generated/SafeClientGen.java @@ -188,6 +188,13 @@ public boolean isInSafeMode(java.lang.String arg0) throws org.apache.blur.thrift } @Override +public java.util.List listInstalledCommands() throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException { + _lock.errorFailLock(); try { + return super.listInstalledCommands(); + } finally {_lock.unlock();} +} + +@Override public java.util.Map listSnapshots(java.lang.String arg0) throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException { _lock.errorFailLock(); try { return super.listSnapshots(arg0); @@ -405,6 +412,13 @@ public boolean recv_isInSafeMode() throws org.apache.blur.thrift.generated.BlurE } @Override +public java.util.List recv_listInstalledCommands() throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException { + _lock.errorFailLock(); try { + return super.recv_listInstalledCommands(); + } finally {_lock.unlock();} +} + +@Override public java.util.Map recv_listSnapshots() throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException { _lock.errorFailLock(); try { return super.recv_listSnapshots(); @@ -769,6 +783,13 @@ public void send_isInSafeMode(java.lang.String arg0) throws org.apache.blur.thir } @Override +public void send_listInstalledCommands() throws org.apache.blur.thirdparty.thrift_0_9_0.TException { + _lock.errorFailLock(); try { + super.send_listInstalledCommands(); + } finally {_lock.unlock();} +} + +@Override public void send_listSnapshots(java.lang.String arg0) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { _lock.errorFailLock(); try { super.send_listSnapshots(arg0); http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/90bcb15e/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 7868344..088475c 100644 --- a/distribution/src/main/scripts/interface/gen-html/Blur.html +++ b/distribution/src/main/scripts/interface/gen-html/Blur.html @@ -29,6 +29,7 @@ <li><a href="Blur.html#Fn_Blur_fetchRow">fetchRow</a></li> <li><a href="Blur.html#Fn_Blur_fetchRowBatch">fetchRowBatch</a></li> <li><a href="Blur.html#Fn_Blur_isInSafeMode">isInSafeMode</a></li> +<li><a href="Blur.html#Fn_Blur_listInstalledCommands">listInstalledCommands</a></li> <li><a href="Blur.html#Fn_Blur_listSnapshots">listSnapshots</a></li> <li><a href="Blur.html#Fn_Blur_logging">logging</a></li> <li><a href="Blur.html#Fn_Blur_metrics">metrics</a></li> @@ -73,6 +74,7 @@ <a href="Blur.html#Struct_BlurResults">BlurResults</a><br/> <a href="Blur.html#Struct_Column">Column</a><br/> <a href="Blur.html#Struct_ColumnDefinition">ColumnDefinition</a><br/> +<a href="Blur.html#Struct_CommandDescriptor">CommandDescriptor</a><br/> <a href="Blur.html#Struct_CommandStatus">CommandStatus</a><br/> <a href="Blur.html#Enum_CommandStatusState">CommandStatusState</a><br/> <a href="Blur.html#Struct_CpuTime">CpuTime</a><br/> @@ -652,11 +654,23 @@ 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_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>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> <h3 id="Svc_Blur">Service: Blur</h3> The Blur service API. This API is the same for both controller servers as well as shards servers. Each of the methods are documented. -<br/><div class="definition"><h4 id="Fn_Blur_execute">Function: Blur.execute</h4> +<br/><div class="definition"><h4 id="Fn_Blur_listInstalledCommands">Function: Blur.listInstalledCommands</h4> +<pre><code>list<<code><a href="Blur.html#Struct_CommandDescriptor">CommandDescriptor</a></code>></code> listInstalledCommands() + throws <code><a href="Blur.html#Struct_BlurException">BlurException</a></code> +</pre>List the currently installed commands in the server process. +<br/></div><div class="definition"><h4 id="Fn_Blur_execute">Function: Blur.execute</h4> <pre><code><a href="Blur.html#Struct_Response">Response</a></code> execute(<code>string</code> commandName, <code><a href="Blur.html#Struct_Arguments">Arguments</a></code> arguments) throws <code><a href="Blur.html#Struct_BlurException">BlurException</a></code>, <code><a href="Blur.html#Struct_TimeoutException">TimeoutException</a></code> http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/90bcb15e/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 42ef7c7..b0085e9 100644 --- a/distribution/src/main/scripts/interface/gen-html/index.html +++ b/distribution/src/main/scripts/interface/gen-html/index.html @@ -25,6 +25,7 @@ <li><a href="Blur.html#Fn_Blur_fetchRow">fetchRow</a></li> <li><a href="Blur.html#Fn_Blur_fetchRowBatch">fetchRowBatch</a></li> <li><a href="Blur.html#Fn_Blur_isInSafeMode">isInSafeMode</a></li> +<li><a href="Blur.html#Fn_Blur_listInstalledCommands">listInstalledCommands</a></li> <li><a href="Blur.html#Fn_Blur_listSnapshots">listSnapshots</a></li> <li><a href="Blur.html#Fn_Blur_logging">logging</a></li> <li><a href="Blur.html#Fn_Blur_metrics">metrics</a></li> @@ -69,6 +70,7 @@ <a href="Blur.html#Struct_BlurResults">BlurResults</a><br/> <a href="Blur.html#Struct_Column">Column</a><br/> <a href="Blur.html#Struct_ColumnDefinition">ColumnDefinition</a><br/> +<a href="Blur.html#Struct_CommandDescriptor">CommandDescriptor</a><br/> <a href="Blur.html#Struct_CommandStatus">CommandStatus</a><br/> <a href="Blur.html#Enum_CommandStatusState">CommandStatusState</a><br/> <a href="Blur.html#Struct_CpuTime">CpuTime</a><br/>
