Adding generated thrift code.
Project: http://git-wip-us.apache.org/repos/asf/incubator-blur/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-blur/commit/4e3073e7 Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/4e3073e7 Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/4e3073e7 Branch: refs/heads/master Commit: 4e3073e79002c660e4f6b6bb558d6e5bc8d90d59 Parents: 55e3d3a Author: Aaron McCurry <[email protected]> Authored: Wed Jan 21 22:37:58 2015 -0500 Committer: Aaron McCurry <[email protected]> Committed: Wed Jan 21 22:37:58 2015 -0500 ---------------------------------------------------------------------- .../blur/thrift/generated/ColumnDefinition.java | 116 ++++++++++++++++++- .../main/scripts/interface/gen-html/Blur.html | 2 + .../blur/thrift/generated/ColumnDefinition.java | 116 ++++++++++++++++++- .../main/scripts/interface/gen-js/Blur_types.js | 16 +++ .../scripts/interface/gen-perl/Blur/Types.pm | 17 ++- .../main/scripts/interface/gen-rb/blur_types.rb | 5 +- docs/Blur.html | 2 + 7 files changed, 266 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/4e3073e7/blur-thrift/src/main/java/org/apache/blur/thrift/generated/ColumnDefinition.java ---------------------------------------------------------------------- diff --git a/blur-thrift/src/main/java/org/apache/blur/thrift/generated/ColumnDefinition.java b/blur-thrift/src/main/java/org/apache/blur/thrift/generated/ColumnDefinition.java index 55d1744..58620b9 100644 --- a/blur-thrift/src/main/java/org/apache/blur/thrift/generated/ColumnDefinition.java +++ b/blur-thrift/src/main/java/org/apache/blur/thrift/generated/ColumnDefinition.java @@ -62,6 +62,7 @@ public class ColumnDefinition implements org.apache.blur.thirdparty.thrift_0_9_0 private static final org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField FIELD_TYPE_FIELD_DESC = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField("fieldType", 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 PROPERTIES_FIELD_DESC = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField("properties", org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.MAP, (short)6); private static final org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField SORTABLE_FIELD_DESC = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField("sortable", org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.BOOL, (short)7); + private static final org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField MULTI_VALUE_FIELD_FIELD_DESC = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField("multiValueField", org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.BOOL, (short)8); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { @@ -107,6 +108,10 @@ public class ColumnDefinition implements org.apache.blur.thirdparty.thrift_0_9_0 * This will attempt to enable sorting for this column, if the type does not support sorting then an exception will be thrown. */ public boolean sortable; // required + /** + * This will attempt to enable the ability for multiple values per column name in a single Record. + */ + public boolean multiValueField; // optional /** 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 { @@ -147,7 +152,11 @@ public class ColumnDefinition implements org.apache.blur.thirdparty.thrift_0_9_0 /** * This will attempt to enable sorting for this column, if the type does not support sorting then an exception will be thrown. */ - SORTABLE((short)7, "sortable"); + SORTABLE((short)7, "sortable"), + /** + * This will attempt to enable the ability for multiple values per column name in a single Record. + */ + MULTI_VALUE_FIELD((short)8, "multiValueField"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); @@ -176,6 +185,8 @@ public class ColumnDefinition implements org.apache.blur.thirdparty.thrift_0_9_0 return PROPERTIES; case 7: // SORTABLE return SORTABLE; + case 8: // MULTI_VALUE_FIELD + return MULTI_VALUE_FIELD; default: return null; } @@ -218,7 +229,9 @@ public class ColumnDefinition implements org.apache.blur.thirdparty.thrift_0_9_0 // isset id assignments private static final int __FIELDLESSINDEXED_ISSET_ID = 0; private static final int __SORTABLE_ISSET_ID = 1; + private static final int __MULTIVALUEFIELD_ISSET_ID = 2; private byte __isset_bitfield = 0; + private _Fields optionals[] = {_Fields.MULTI_VALUE_FIELD}; 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); @@ -238,11 +251,15 @@ public class ColumnDefinition implements org.apache.blur.thirdparty.thrift_0_9_0 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.SORTABLE, new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData("sortable", 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.BOOL))); + tmpMap.put(_Fields.MULTI_VALUE_FIELD, new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData("multiValueField", org.apache.blur.thirdparty.thrift_0_9_0.TFieldRequirementType.OPTIONAL, + new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldValueMetaData(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.BOOL))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData.addStructMetaDataMap(ColumnDefinition.class, metaDataMap); } public ColumnDefinition() { + this.multiValueField = true; + } public ColumnDefinition( @@ -300,6 +317,7 @@ public class ColumnDefinition implements org.apache.blur.thirdparty.thrift_0_9_0 this.properties = __this__properties; } this.sortable = other.sortable; + this.multiValueField = other.multiValueField; } public ColumnDefinition deepCopy() { @@ -317,6 +335,8 @@ public class ColumnDefinition implements org.apache.blur.thirdparty.thrift_0_9_0 this.properties = null; setSortableIsSet(false); this.sortable = false; + this.multiValueField = true; + } /** @@ -558,6 +578,35 @@ public class ColumnDefinition implements org.apache.blur.thirdparty.thrift_0_9_0 __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SORTABLE_ISSET_ID, value); } + /** + * This will attempt to enable the ability for multiple values per column name in a single Record. + */ + public boolean isMultiValueField() { + return this.multiValueField; + } + + /** + * This will attempt to enable the ability for multiple values per column name in a single Record. + */ + public ColumnDefinition setMultiValueField(boolean multiValueField) { + this.multiValueField = multiValueField; + setMultiValueFieldIsSet(true); + return this; + } + + public void unsetMultiValueField() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MULTIVALUEFIELD_ISSET_ID); + } + + /** Returns true if field multiValueField is set (has been assigned a value) and false otherwise */ + public boolean isSetMultiValueField() { + return EncodingUtils.testBit(__isset_bitfield, __MULTIVALUEFIELD_ISSET_ID); + } + + public void setMultiValueFieldIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MULTIVALUEFIELD_ISSET_ID, value); + } + public void setFieldValue(_Fields field, Object value) { switch (field) { case FAMILY: @@ -616,6 +665,14 @@ public class ColumnDefinition implements org.apache.blur.thirdparty.thrift_0_9_0 } break; + case MULTI_VALUE_FIELD: + if (value == null) { + unsetMultiValueField(); + } else { + setMultiValueField((Boolean)value); + } + break; + } } @@ -642,6 +699,9 @@ public class ColumnDefinition implements org.apache.blur.thirdparty.thrift_0_9_0 case SORTABLE: return Boolean.valueOf(isSortable()); + case MULTI_VALUE_FIELD: + return Boolean.valueOf(isMultiValueField()); + } throw new IllegalStateException(); } @@ -667,6 +727,8 @@ public class ColumnDefinition implements org.apache.blur.thirdparty.thrift_0_9_0 return isSetProperties(); case SORTABLE: return isSetSortable(); + case MULTI_VALUE_FIELD: + return isSetMultiValueField(); } throw new IllegalStateException(); } @@ -747,6 +809,15 @@ public class ColumnDefinition implements org.apache.blur.thirdparty.thrift_0_9_0 return false; } + boolean this_present_multiValueField = true && this.isSetMultiValueField(); + boolean that_present_multiValueField = true && that.isSetMultiValueField(); + if (this_present_multiValueField || that_present_multiValueField) { + if (!(this_present_multiValueField && that_present_multiValueField)) + return false; + if (this.multiValueField != that.multiValueField) + return false; + } + return true; } @@ -833,6 +904,16 @@ public class ColumnDefinition implements org.apache.blur.thirdparty.thrift_0_9_0 return lastComparison; } } + lastComparison = Boolean.valueOf(isSetMultiValueField()).compareTo(typedOther.isSetMultiValueField()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetMultiValueField()) { + lastComparison = org.apache.blur.thirdparty.thrift_0_9_0.TBaseHelper.compareTo(this.multiValueField, typedOther.multiValueField); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -900,6 +981,12 @@ public class ColumnDefinition implements org.apache.blur.thirdparty.thrift_0_9_0 sb.append("sortable:"); sb.append(this.sortable); first = false; + if (isSetMultiValueField()) { + if (!first) sb.append(", "); + sb.append("multiValueField:"); + sb.append(this.multiValueField); + first = false; + } sb.append(")"); return sb.toString(); } @@ -1013,6 +1100,14 @@ public class ColumnDefinition implements org.apache.blur.thirdparty.thrift_0_9_0 org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; + case 8: // MULTI_VALUE_FIELD + if (schemeField.type == org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.BOOL) { + struct.multiValueField = iprot.readBool(); + struct.setMultiValueFieldIsSet(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); } @@ -1067,6 +1162,11 @@ public class ColumnDefinition implements org.apache.blur.thirdparty.thrift_0_9_0 oprot.writeFieldBegin(SORTABLE_FIELD_DESC); oprot.writeBool(struct.sortable); oprot.writeFieldEnd(); + if (struct.isSetMultiValueField()) { + oprot.writeFieldBegin(MULTI_VALUE_FIELD_FIELD_DESC); + oprot.writeBool(struct.multiValueField); + oprot.writeFieldEnd(); + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -1106,7 +1206,10 @@ public class ColumnDefinition implements org.apache.blur.thirdparty.thrift_0_9_0 if (struct.isSetSortable()) { optionals.set(6); } - oprot.writeBitSet(optionals, 7); + if (struct.isSetMultiValueField()) { + optionals.set(7); + } + oprot.writeBitSet(optionals, 8); if (struct.isSetFamily()) { oprot.writeString(struct.family); } @@ -1135,12 +1238,15 @@ public class ColumnDefinition implements org.apache.blur.thirdparty.thrift_0_9_0 if (struct.isSetSortable()) { oprot.writeBool(struct.sortable); } + if (struct.isSetMultiValueField()) { + oprot.writeBool(struct.multiValueField); + } } @Override public void read(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol prot, ColumnDefinition struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(7); + BitSet incoming = iprot.readBitSet(8); if (incoming.get(0)) { struct.family = iprot.readString(); struct.setFamilyIsSet(true); @@ -1180,6 +1286,10 @@ public class ColumnDefinition implements org.apache.blur.thirdparty.thrift_0_9_0 struct.sortable = iprot.readBool(); struct.setSortableIsSet(true); } + if (incoming.get(7)) { + struct.multiValueField = iprot.readBool(); + struct.setMultiValueFieldIsSet(true); + } } } http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/4e3073e7/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 e181789..9032e67 100644 --- a/distribution/src/main/scripts/interface/gen-html/Blur.html +++ b/distribution/src/main/scripts/interface/gen-html/Blur.html @@ -564,6 +564,8 @@ NOTE: This will index the column as a full text field in a default field, so tha </td><td>default</td><td></td></tr> <tr><td>7</td><td>sortable</td><td><code>bool</code></td><td>This will attempt to enable sorting for this column, if the type does not support sorting then an exception will be thrown. </td><td>default</td><td></td></tr> +<tr><td>8</td><td>multiValueField</td><td><code>bool</code></td><td>This will attempt to enable the ability for multiple values per column name in a single Record. +</td><td>optional</td><td>1</td></tr> </table><br/>The ColumnDefinition defines how a given Column should be interpreted (indexed/stored) <br/></div><div class="definition"><h3 id="Struct_Schema">Struct: Schema</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> http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/4e3073e7/distribution/src/main/scripts/interface/gen-java/org/apache/blur/thrift/generated/ColumnDefinition.java ---------------------------------------------------------------------- diff --git a/distribution/src/main/scripts/interface/gen-java/org/apache/blur/thrift/generated/ColumnDefinition.java b/distribution/src/main/scripts/interface/gen-java/org/apache/blur/thrift/generated/ColumnDefinition.java index 55d1744..58620b9 100644 --- a/distribution/src/main/scripts/interface/gen-java/org/apache/blur/thrift/generated/ColumnDefinition.java +++ b/distribution/src/main/scripts/interface/gen-java/org/apache/blur/thrift/generated/ColumnDefinition.java @@ -62,6 +62,7 @@ public class ColumnDefinition implements org.apache.blur.thirdparty.thrift_0_9_0 private static final org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField FIELD_TYPE_FIELD_DESC = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField("fieldType", 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 PROPERTIES_FIELD_DESC = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField("properties", org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.MAP, (short)6); private static final org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField SORTABLE_FIELD_DESC = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField("sortable", org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.BOOL, (short)7); + private static final org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField MULTI_VALUE_FIELD_FIELD_DESC = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField("multiValueField", org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.BOOL, (short)8); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { @@ -107,6 +108,10 @@ public class ColumnDefinition implements org.apache.blur.thirdparty.thrift_0_9_0 * This will attempt to enable sorting for this column, if the type does not support sorting then an exception will be thrown. */ public boolean sortable; // required + /** + * This will attempt to enable the ability for multiple values per column name in a single Record. + */ + public boolean multiValueField; // optional /** 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 { @@ -147,7 +152,11 @@ public class ColumnDefinition implements org.apache.blur.thirdparty.thrift_0_9_0 /** * This will attempt to enable sorting for this column, if the type does not support sorting then an exception will be thrown. */ - SORTABLE((short)7, "sortable"); + SORTABLE((short)7, "sortable"), + /** + * This will attempt to enable the ability for multiple values per column name in a single Record. + */ + MULTI_VALUE_FIELD((short)8, "multiValueField"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); @@ -176,6 +185,8 @@ public class ColumnDefinition implements org.apache.blur.thirdparty.thrift_0_9_0 return PROPERTIES; case 7: // SORTABLE return SORTABLE; + case 8: // MULTI_VALUE_FIELD + return MULTI_VALUE_FIELD; default: return null; } @@ -218,7 +229,9 @@ public class ColumnDefinition implements org.apache.blur.thirdparty.thrift_0_9_0 // isset id assignments private static final int __FIELDLESSINDEXED_ISSET_ID = 0; private static final int __SORTABLE_ISSET_ID = 1; + private static final int __MULTIVALUEFIELD_ISSET_ID = 2; private byte __isset_bitfield = 0; + private _Fields optionals[] = {_Fields.MULTI_VALUE_FIELD}; 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); @@ -238,11 +251,15 @@ public class ColumnDefinition implements org.apache.blur.thirdparty.thrift_0_9_0 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.SORTABLE, new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData("sortable", 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.BOOL))); + tmpMap.put(_Fields.MULTI_VALUE_FIELD, new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData("multiValueField", org.apache.blur.thirdparty.thrift_0_9_0.TFieldRequirementType.OPTIONAL, + new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldValueMetaData(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.BOOL))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData.addStructMetaDataMap(ColumnDefinition.class, metaDataMap); } public ColumnDefinition() { + this.multiValueField = true; + } public ColumnDefinition( @@ -300,6 +317,7 @@ public class ColumnDefinition implements org.apache.blur.thirdparty.thrift_0_9_0 this.properties = __this__properties; } this.sortable = other.sortable; + this.multiValueField = other.multiValueField; } public ColumnDefinition deepCopy() { @@ -317,6 +335,8 @@ public class ColumnDefinition implements org.apache.blur.thirdparty.thrift_0_9_0 this.properties = null; setSortableIsSet(false); this.sortable = false; + this.multiValueField = true; + } /** @@ -558,6 +578,35 @@ public class ColumnDefinition implements org.apache.blur.thirdparty.thrift_0_9_0 __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SORTABLE_ISSET_ID, value); } + /** + * This will attempt to enable the ability for multiple values per column name in a single Record. + */ + public boolean isMultiValueField() { + return this.multiValueField; + } + + /** + * This will attempt to enable the ability for multiple values per column name in a single Record. + */ + public ColumnDefinition setMultiValueField(boolean multiValueField) { + this.multiValueField = multiValueField; + setMultiValueFieldIsSet(true); + return this; + } + + public void unsetMultiValueField() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MULTIVALUEFIELD_ISSET_ID); + } + + /** Returns true if field multiValueField is set (has been assigned a value) and false otherwise */ + public boolean isSetMultiValueField() { + return EncodingUtils.testBit(__isset_bitfield, __MULTIVALUEFIELD_ISSET_ID); + } + + public void setMultiValueFieldIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MULTIVALUEFIELD_ISSET_ID, value); + } + public void setFieldValue(_Fields field, Object value) { switch (field) { case FAMILY: @@ -616,6 +665,14 @@ public class ColumnDefinition implements org.apache.blur.thirdparty.thrift_0_9_0 } break; + case MULTI_VALUE_FIELD: + if (value == null) { + unsetMultiValueField(); + } else { + setMultiValueField((Boolean)value); + } + break; + } } @@ -642,6 +699,9 @@ public class ColumnDefinition implements org.apache.blur.thirdparty.thrift_0_9_0 case SORTABLE: return Boolean.valueOf(isSortable()); + case MULTI_VALUE_FIELD: + return Boolean.valueOf(isMultiValueField()); + } throw new IllegalStateException(); } @@ -667,6 +727,8 @@ public class ColumnDefinition implements org.apache.blur.thirdparty.thrift_0_9_0 return isSetProperties(); case SORTABLE: return isSetSortable(); + case MULTI_VALUE_FIELD: + return isSetMultiValueField(); } throw new IllegalStateException(); } @@ -747,6 +809,15 @@ public class ColumnDefinition implements org.apache.blur.thirdparty.thrift_0_9_0 return false; } + boolean this_present_multiValueField = true && this.isSetMultiValueField(); + boolean that_present_multiValueField = true && that.isSetMultiValueField(); + if (this_present_multiValueField || that_present_multiValueField) { + if (!(this_present_multiValueField && that_present_multiValueField)) + return false; + if (this.multiValueField != that.multiValueField) + return false; + } + return true; } @@ -833,6 +904,16 @@ public class ColumnDefinition implements org.apache.blur.thirdparty.thrift_0_9_0 return lastComparison; } } + lastComparison = Boolean.valueOf(isSetMultiValueField()).compareTo(typedOther.isSetMultiValueField()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetMultiValueField()) { + lastComparison = org.apache.blur.thirdparty.thrift_0_9_0.TBaseHelper.compareTo(this.multiValueField, typedOther.multiValueField); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -900,6 +981,12 @@ public class ColumnDefinition implements org.apache.blur.thirdparty.thrift_0_9_0 sb.append("sortable:"); sb.append(this.sortable); first = false; + if (isSetMultiValueField()) { + if (!first) sb.append(", "); + sb.append("multiValueField:"); + sb.append(this.multiValueField); + first = false; + } sb.append(")"); return sb.toString(); } @@ -1013,6 +1100,14 @@ public class ColumnDefinition implements org.apache.blur.thirdparty.thrift_0_9_0 org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; + case 8: // MULTI_VALUE_FIELD + if (schemeField.type == org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.BOOL) { + struct.multiValueField = iprot.readBool(); + struct.setMultiValueFieldIsSet(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); } @@ -1067,6 +1162,11 @@ public class ColumnDefinition implements org.apache.blur.thirdparty.thrift_0_9_0 oprot.writeFieldBegin(SORTABLE_FIELD_DESC); oprot.writeBool(struct.sortable); oprot.writeFieldEnd(); + if (struct.isSetMultiValueField()) { + oprot.writeFieldBegin(MULTI_VALUE_FIELD_FIELD_DESC); + oprot.writeBool(struct.multiValueField); + oprot.writeFieldEnd(); + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -1106,7 +1206,10 @@ public class ColumnDefinition implements org.apache.blur.thirdparty.thrift_0_9_0 if (struct.isSetSortable()) { optionals.set(6); } - oprot.writeBitSet(optionals, 7); + if (struct.isSetMultiValueField()) { + optionals.set(7); + } + oprot.writeBitSet(optionals, 8); if (struct.isSetFamily()) { oprot.writeString(struct.family); } @@ -1135,12 +1238,15 @@ public class ColumnDefinition implements org.apache.blur.thirdparty.thrift_0_9_0 if (struct.isSetSortable()) { oprot.writeBool(struct.sortable); } + if (struct.isSetMultiValueField()) { + oprot.writeBool(struct.multiValueField); + } } @Override public void read(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol prot, ColumnDefinition struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(7); + BitSet incoming = iprot.readBitSet(8); if (incoming.get(0)) { struct.family = iprot.readString(); struct.setFamilyIsSet(true); @@ -1180,6 +1286,10 @@ public class ColumnDefinition implements org.apache.blur.thirdparty.thrift_0_9_0 struct.sortable = iprot.readBool(); struct.setSortableIsSet(true); } + if (incoming.get(7)) { + struct.multiValueField = iprot.readBool(); + struct.setMultiValueFieldIsSet(true); + } } } http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/4e3073e7/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 3485fb8..3851678 100644 --- a/distribution/src/main/scripts/interface/gen-js/Blur_types.js +++ b/distribution/src/main/scripts/interface/gen-js/Blur_types.js @@ -2845,6 +2845,7 @@ ColumnDefinition = function(args) { this.fieldType = null; this.properties = null; this.sortable = null; + this.multiValueField = true; if (args) { if (args.family !== undefined) { this.family = args.family; @@ -2867,6 +2868,9 @@ ColumnDefinition = function(args) { if (args.sortable !== undefined) { this.sortable = args.sortable; } + if (args.multiValueField !== undefined) { + this.multiValueField = args.multiValueField; + } } }; ColumnDefinition.prototype = {}; @@ -2954,6 +2958,13 @@ ColumnDefinition.prototype.read = function(input) { input.skip(ftype); } break; + case 8: + if (ftype == Thrift.Type.BOOL) { + this.multiValueField = input.readBool().value; + } else { + input.skip(ftype); + } + break; default: input.skip(ftype); } @@ -3010,6 +3021,11 @@ ColumnDefinition.prototype.write = function(output) { output.writeBool(this.sortable); output.writeFieldEnd(); } + if (this.multiValueField !== null && this.multiValueField !== undefined) { + output.writeFieldBegin('multiValueField', Thrift.Type.BOOL, 8); + output.writeBool(this.multiValueField); + output.writeFieldEnd(); + } output.writeFieldStop(); output.writeStructEnd(); return; http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/4e3073e7/distribution/src/main/scripts/interface/gen-perl/Blur/Types.pm ---------------------------------------------------------------------- diff --git a/distribution/src/main/scripts/interface/gen-perl/Blur/Types.pm b/distribution/src/main/scripts/interface/gen-perl/Blur/Types.pm index 4933918..28e5206 100644 --- a/distribution/src/main/scripts/interface/gen-perl/Blur/Types.pm +++ b/distribution/src/main/scripts/interface/gen-perl/Blur/Types.pm @@ -3037,7 +3037,7 @@ sub write { package Blur::ColumnDefinition; use base qw(Class::Accessor); -Blur::ColumnDefinition->mk_accessors( qw( family columnName subColumnName fieldLessIndexed fieldType properties sortable ) ); +Blur::ColumnDefinition->mk_accessors( qw( family columnName subColumnName fieldLessIndexed fieldType properties sortable multiValueField ) ); sub new { my $classname = shift; @@ -3050,6 +3050,7 @@ sub new { $self->{fieldType} = undef; $self->{properties} = undef; $self->{sortable} = undef; + $self->{multiValueField} = 1; if (UNIVERSAL::isa($vals,'HASH')) { if (defined $vals->{family}) { $self->{family} = $vals->{family}; @@ -3072,6 +3073,9 @@ sub new { if (defined $vals->{sortable}) { $self->{sortable} = $vals->{sortable}; } + if (defined $vals->{multiValueField}) { + $self->{multiValueField} = $vals->{multiValueField}; + } } return bless ($self, $classname); } @@ -3152,6 +3156,12 @@ sub read { $xfer += $input->skip($ftype); } last; }; + /^8$/ && do{ if ($ftype == TType::BOOL) { + $xfer += $input->readBool(\$self->{multiValueField}); + } else { + $xfer += $input->skip($ftype); + } + last; }; $xfer += $input->skip($ftype); } $xfer += $input->readFieldEnd(); @@ -3209,6 +3219,11 @@ sub write { $xfer += $output->writeBool($self->{sortable}); $xfer += $output->writeFieldEnd(); } + if (defined $self->{multiValueField}) { + $xfer += $output->writeFieldBegin('multiValueField', TType::BOOL, 8); + $xfer += $output->writeBool($self->{multiValueField}); + $xfer += $output->writeFieldEnd(); + } $xfer += $output->writeFieldStop(); $xfer += $output->writeStructEnd(); return $xfer; http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/4e3073e7/distribution/src/main/scripts/interface/gen-rb/blur_types.rb ---------------------------------------------------------------------- diff --git a/distribution/src/main/scripts/interface/gen-rb/blur_types.rb b/distribution/src/main/scripts/interface/gen-rb/blur_types.rb index 1a824fc..db739f1 100644 --- a/distribution/src/main/scripts/interface/gen-rb/blur_types.rb +++ b/distribution/src/main/scripts/interface/gen-rb/blur_types.rb @@ -825,6 +825,7 @@ module Blur FIELDTYPE = 5 PROPERTIES = 6 SORTABLE = 7 + MULTIVALUEFIELD = 8 FIELDS = { # Required. The family that this column exists within. @@ -850,7 +851,9 @@ module Blur # For any custom field types, you can pass in configuration properties. PROPERTIES => {:type => ::Thrift::Types::MAP, :name => 'properties', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}}, # This will attempt to enable sorting for this column, if the type does not support sorting then an exception will be thrown. - SORTABLE => {:type => ::Thrift::Types::BOOL, :name => 'sortable'} + SORTABLE => {:type => ::Thrift::Types::BOOL, :name => 'sortable'}, + # This will attempt to enable the ability for multiple values per column name in a single Record. + MULTIVALUEFIELD => {:type => ::Thrift::Types::BOOL, :name => 'multiValueField', :default => true, :optional => true} } def struct_fields; FIELDS; end http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/4e3073e7/docs/Blur.html ---------------------------------------------------------------------- diff --git a/docs/Blur.html b/docs/Blur.html index 0eeafd1..07b0259 100644 --- a/docs/Blur.html +++ b/docs/Blur.html @@ -622,6 +622,8 @@ NOTE: This will index the column as a full text field in a default field, so tha </td><td>default</td><td></td></tr> <tr><td>7</td><td>sortable</td><td><code>bool</code></td><td>This will attempt to enable sorting for this column, if the type does not support sorting then an exception will be thrown. </td><td>default</td><td></td></tr> +<tr><td>8</td><td>multiValueField</td><td><code>bool</code></td><td>This will attempt to enable the ability for multiple values per column name in a single Record. +</td><td>optional</td><td>1</td></tr> </table><br/>The ColumnDefinition defines how a given Column should be interpreted (indexed/stored) <br/></p></section><section><div class="page-header"><h3 id="Struct_Schema">Struct: Schema</h3></div><p class="lead"> <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>
