Added cluster attribute to the table schema.
Project: http://git-wip-us.apache.org/repos/asf/incubator-blur/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-blur/commit/b45cb14b Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/b45cb14b Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/b45cb14b Branch: refs/heads/0.2-dev Commit: b45cb14b6e1fd0ee860103c003e92ef0caa200cc Parents: d4de1ff Author: Aaron McCurry <[email protected]> Authored: Mon Jan 28 20:45:07 2013 -0500 Committer: Aaron McCurry <[email protected]> Committed: Mon Jan 28 20:45:07 2013 -0500 ---------------------------------------------------------------------- .../java/org/apache/blur/server/BlurServer.java | 1 + .../apache/blur/thrift/generated/TableSchema.java | 120 ++++++++++++++- .../src/main/scripts/interface/Blur.thrift | 6 +- .../src/main/scripts/interface/gen-html/Blur.html | 2 + .../apache/blur/thrift/generated/TableSchema.java | 120 ++++++++++++++- .../main/scripts/interface/gen-perl/Blur/Types.pm | 17 ++- .../main/scripts/interface/gen-rb/blur_types.rb | 5 +- 7 files changed, 260 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/b45cb14b/src/blur-core/src/main/java/org/apache/blur/server/BlurServer.java ---------------------------------------------------------------------- diff --git a/src/blur-core/src/main/java/org/apache/blur/server/BlurServer.java b/src/blur-core/src/main/java/org/apache/blur/server/BlurServer.java index 91dd5fc..04bde9f 100644 --- a/src/blur-core/src/main/java/org/apache/blur/server/BlurServer.java +++ b/src/blur-core/src/main/java/org/apache/blur/server/BlurServer.java @@ -538,6 +538,7 @@ public class BlurServer extends TableAdmin implements Iface { TypeManager typeManager = tableContext.getTypeManager(); Map<String, org.apache.blur.thrift.generated.TYPE> typeMap = typeManager.getTypeMap(); TableSchema tableSchema = new TableSchema(); + tableSchema.setCluster(_clusterStatus.getClusterName()); for (Entry<String, org.apache.blur.thrift.generated.TYPE> entry : typeMap.entrySet()) { tableSchema.addToFields(new FieldSchema(entry.getKey(), entry.getValue())); } http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/b45cb14b/src/blur-thrift/src/main/java/org/apache/blur/thrift/generated/TableSchema.java ---------------------------------------------------------------------- diff --git a/src/blur-thrift/src/main/java/org/apache/blur/thrift/generated/TableSchema.java b/src/blur-thrift/src/main/java/org/apache/blur/thrift/generated/TableSchema.java index bb04c34..0646589 100644 --- a/src/blur-thrift/src/main/java/org/apache/blur/thrift/generated/TableSchema.java +++ b/src/blur-thrift/src/main/java/org/apache/blur/thrift/generated/TableSchema.java @@ -56,6 +56,7 @@ public class TableSchema implements org.apache.thrift.TBase<TableSchema, TableSc private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TableSchema"); private static final org.apache.thrift.protocol.TField FIELDS_FIELD_DESC = new org.apache.thrift.protocol.TField("fields", org.apache.thrift.protocol.TType.LIST, (short)1); + private static final org.apache.thrift.protocol.TField CLUSTER_FIELD_DESC = new org.apache.thrift.protocol.TField("cluster", org.apache.thrift.protocol.TType.STRING, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { @@ -67,13 +68,21 @@ public class TableSchema implements org.apache.thrift.TBase<TableSchema, TableSc * List of field information for a table. */ public List<FieldSchema> fields; // required + /** + * The cluster name in which this table exists. + */ + public String cluster; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * List of field information for a table. */ - FIELDS((short)1, "fields"); + FIELDS((short)1, "fields"), + /** + * The cluster name in which this table exists. + */ + CLUSTER((short)2, "cluster"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); @@ -90,6 +99,8 @@ public class TableSchema implements org.apache.thrift.TBase<TableSchema, TableSc switch(fieldId) { case 1: // FIELDS return FIELDS; + case 2: // CLUSTER + return CLUSTER; default: return null; } @@ -136,6 +147,8 @@ public class TableSchema implements org.apache.thrift.TBase<TableSchema, TableSc tmpMap.put(_Fields.FIELDS, new org.apache.thrift.meta_data.FieldMetaData("fields", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, FieldSchema.class)))); + tmpMap.put(_Fields.CLUSTER, new org.apache.thrift.meta_data.FieldMetaData("cluster", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TableSchema.class, metaDataMap); } @@ -144,10 +157,12 @@ public class TableSchema implements org.apache.thrift.TBase<TableSchema, TableSc } public TableSchema( - List<FieldSchema> fields) + List<FieldSchema> fields, + String cluster) { this(); this.fields = fields; + this.cluster = cluster; } /** @@ -161,6 +176,9 @@ public class TableSchema implements org.apache.thrift.TBase<TableSchema, TableSc } this.fields = __this__fields; } + if (other.isSetCluster()) { + this.cluster = other.cluster; + } } public TableSchema deepCopy() { @@ -170,6 +188,7 @@ public class TableSchema implements org.apache.thrift.TBase<TableSchema, TableSc @Override public void clear() { this.fields = null; + this.cluster = null; } public int getFieldsSize() { @@ -217,6 +236,36 @@ public class TableSchema implements org.apache.thrift.TBase<TableSchema, TableSc } } + /** + * The cluster name in which this table exists. + */ + public String getCluster() { + return this.cluster; + } + + /** + * The cluster name in which this table exists. + */ + public TableSchema setCluster(String cluster) { + this.cluster = cluster; + return this; + } + + public void unsetCluster() { + this.cluster = null; + } + + /** Returns true if field cluster is set (has been assigned a value) and false otherwise */ + public boolean isSetCluster() { + return this.cluster != null; + } + + public void setClusterIsSet(boolean value) { + if (!value) { + this.cluster = null; + } + } + public void setFieldValue(_Fields field, Object value) { switch (field) { case FIELDS: @@ -227,6 +276,14 @@ public class TableSchema implements org.apache.thrift.TBase<TableSchema, TableSc } break; + case CLUSTER: + if (value == null) { + unsetCluster(); + } else { + setCluster((String)value); + } + break; + } } @@ -235,6 +292,9 @@ public class TableSchema implements org.apache.thrift.TBase<TableSchema, TableSc case FIELDS: return getFields(); + case CLUSTER: + return getCluster(); + } throw new IllegalStateException(); } @@ -248,6 +308,8 @@ public class TableSchema implements org.apache.thrift.TBase<TableSchema, TableSc switch (field) { case FIELDS: return isSetFields(); + case CLUSTER: + return isSetCluster(); } throw new IllegalStateException(); } @@ -274,6 +336,15 @@ public class TableSchema implements org.apache.thrift.TBase<TableSchema, TableSc return false; } + boolean this_present_cluster = true && this.isSetCluster(); + boolean that_present_cluster = true && that.isSetCluster(); + if (this_present_cluster || that_present_cluster) { + if (!(this_present_cluster && that_present_cluster)) + return false; + if (!this.cluster.equals(that.cluster)) + return false; + } + return true; } @@ -300,6 +371,16 @@ public class TableSchema implements org.apache.thrift.TBase<TableSchema, TableSc return lastComparison; } } + lastComparison = Boolean.valueOf(isSetCluster()).compareTo(typedOther.isSetCluster()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetCluster()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cluster, typedOther.cluster); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -327,6 +408,14 @@ public class TableSchema implements org.apache.thrift.TBase<TableSchema, TableSc sb.append(this.fields); } first = false; + if (!first) sb.append(", "); + sb.append("cluster:"); + if (this.cluster == null) { + sb.append("null"); + } else { + sb.append(this.cluster); + } + first = false; sb.append(")"); return sb.toString(); } @@ -389,6 +478,14 @@ public class TableSchema implements org.apache.thrift.TBase<TableSchema, TableSc org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; + case 2: // CLUSTER + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.cluster = iprot.readString(); + struct.setClusterIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -416,6 +513,11 @@ public class TableSchema implements org.apache.thrift.TBase<TableSchema, TableSc } oprot.writeFieldEnd(); } + if (struct.cluster != null) { + oprot.writeFieldBegin(CLUSTER_FIELD_DESC); + oprot.writeString(struct.cluster); + oprot.writeFieldEnd(); + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -437,7 +539,10 @@ public class TableSchema implements org.apache.thrift.TBase<TableSchema, TableSc if (struct.isSetFields()) { optionals.set(0); } - oprot.writeBitSet(optionals, 1); + if (struct.isSetCluster()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); if (struct.isSetFields()) { { oprot.writeI32(struct.fields.size()); @@ -447,12 +552,15 @@ public class TableSchema implements org.apache.thrift.TBase<TableSchema, TableSc } } } + if (struct.isSetCluster()) { + oprot.writeString(struct.cluster); + } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TableSchema struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); + BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { { org.apache.thrift.protocol.TList _list15 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); @@ -467,6 +575,10 @@ public class TableSchema implements org.apache.thrift.TBase<TableSchema, TableSc } struct.setFieldsIsSet(true); } + if (incoming.get(1)) { + struct.cluster = iprot.readString(); + struct.setClusterIsSet(true); + } } } http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/b45cb14b/src/distribution/src/main/scripts/interface/Blur.thrift ---------------------------------------------------------------------- diff --git a/src/distribution/src/main/scripts/interface/Blur.thrift b/src/distribution/src/main/scripts/interface/Blur.thrift index d7584b4..eb7f8e4 100644 --- a/src/distribution/src/main/scripts/interface/Blur.thrift +++ b/src/distribution/src/main/scripts/interface/Blur.thrift @@ -221,7 +221,11 @@ struct TableSchema { /** * List of field information for a table. */ - 1:list<FieldSchema> fields + 1:list<FieldSchema> fields, + /** + * The cluster name in which this table exists. + */ + 2:string cluster } struct ClassDefinition { http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/b45cb14b/src/distribution/src/main/scripts/interface/gen-html/Blur.html ---------------------------------------------------------------------- diff --git a/src/distribution/src/main/scripts/interface/gen-html/Blur.html b/src/distribution/src/main/scripts/interface/gen-html/Blur.html index ee8397d..b1ff0a9 100644 --- a/src/distribution/src/main/scripts/interface/gen-html/Blur.html +++ b/src/distribution/src/main/scripts/interface/gen-html/Blur.html @@ -158,6 +158,8 @@ trace (if any). <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>fields</td><td><code>list<<code><a href="Blur.html#Struct_FieldSchema">FieldSchema</a></code>></code></td><td>List of field information for a table. </td><td>default</td><td></td></tr> +<tr><td>2</td><td>cluster</td><td><code>string</code></td><td>The cluster name in which this table exists. +</td><td>default</td><td></td></tr> </table><br/>TableSchema contains field information that describes the a table. <br/></div><div class="definition"><h3 id="Struct_ClassDefinition">Struct: ClassDefinition</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/b45cb14b/src/distribution/src/main/scripts/interface/gen-java/org/apache/blur/thrift/generated/TableSchema.java ---------------------------------------------------------------------- diff --git a/src/distribution/src/main/scripts/interface/gen-java/org/apache/blur/thrift/generated/TableSchema.java b/src/distribution/src/main/scripts/interface/gen-java/org/apache/blur/thrift/generated/TableSchema.java index bb04c34..0646589 100644 --- a/src/distribution/src/main/scripts/interface/gen-java/org/apache/blur/thrift/generated/TableSchema.java +++ b/src/distribution/src/main/scripts/interface/gen-java/org/apache/blur/thrift/generated/TableSchema.java @@ -56,6 +56,7 @@ public class TableSchema implements org.apache.thrift.TBase<TableSchema, TableSc private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TableSchema"); private static final org.apache.thrift.protocol.TField FIELDS_FIELD_DESC = new org.apache.thrift.protocol.TField("fields", org.apache.thrift.protocol.TType.LIST, (short)1); + private static final org.apache.thrift.protocol.TField CLUSTER_FIELD_DESC = new org.apache.thrift.protocol.TField("cluster", org.apache.thrift.protocol.TType.STRING, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { @@ -67,13 +68,21 @@ public class TableSchema implements org.apache.thrift.TBase<TableSchema, TableSc * List of field information for a table. */ public List<FieldSchema> fields; // required + /** + * The cluster name in which this table exists. + */ + public String cluster; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * List of field information for a table. */ - FIELDS((short)1, "fields"); + FIELDS((short)1, "fields"), + /** + * The cluster name in which this table exists. + */ + CLUSTER((short)2, "cluster"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); @@ -90,6 +99,8 @@ public class TableSchema implements org.apache.thrift.TBase<TableSchema, TableSc switch(fieldId) { case 1: // FIELDS return FIELDS; + case 2: // CLUSTER + return CLUSTER; default: return null; } @@ -136,6 +147,8 @@ public class TableSchema implements org.apache.thrift.TBase<TableSchema, TableSc tmpMap.put(_Fields.FIELDS, new org.apache.thrift.meta_data.FieldMetaData("fields", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, FieldSchema.class)))); + tmpMap.put(_Fields.CLUSTER, new org.apache.thrift.meta_data.FieldMetaData("cluster", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TableSchema.class, metaDataMap); } @@ -144,10 +157,12 @@ public class TableSchema implements org.apache.thrift.TBase<TableSchema, TableSc } public TableSchema( - List<FieldSchema> fields) + List<FieldSchema> fields, + String cluster) { this(); this.fields = fields; + this.cluster = cluster; } /** @@ -161,6 +176,9 @@ public class TableSchema implements org.apache.thrift.TBase<TableSchema, TableSc } this.fields = __this__fields; } + if (other.isSetCluster()) { + this.cluster = other.cluster; + } } public TableSchema deepCopy() { @@ -170,6 +188,7 @@ public class TableSchema implements org.apache.thrift.TBase<TableSchema, TableSc @Override public void clear() { this.fields = null; + this.cluster = null; } public int getFieldsSize() { @@ -217,6 +236,36 @@ public class TableSchema implements org.apache.thrift.TBase<TableSchema, TableSc } } + /** + * The cluster name in which this table exists. + */ + public String getCluster() { + return this.cluster; + } + + /** + * The cluster name in which this table exists. + */ + public TableSchema setCluster(String cluster) { + this.cluster = cluster; + return this; + } + + public void unsetCluster() { + this.cluster = null; + } + + /** Returns true if field cluster is set (has been assigned a value) and false otherwise */ + public boolean isSetCluster() { + return this.cluster != null; + } + + public void setClusterIsSet(boolean value) { + if (!value) { + this.cluster = null; + } + } + public void setFieldValue(_Fields field, Object value) { switch (field) { case FIELDS: @@ -227,6 +276,14 @@ public class TableSchema implements org.apache.thrift.TBase<TableSchema, TableSc } break; + case CLUSTER: + if (value == null) { + unsetCluster(); + } else { + setCluster((String)value); + } + break; + } } @@ -235,6 +292,9 @@ public class TableSchema implements org.apache.thrift.TBase<TableSchema, TableSc case FIELDS: return getFields(); + case CLUSTER: + return getCluster(); + } throw new IllegalStateException(); } @@ -248,6 +308,8 @@ public class TableSchema implements org.apache.thrift.TBase<TableSchema, TableSc switch (field) { case FIELDS: return isSetFields(); + case CLUSTER: + return isSetCluster(); } throw new IllegalStateException(); } @@ -274,6 +336,15 @@ public class TableSchema implements org.apache.thrift.TBase<TableSchema, TableSc return false; } + boolean this_present_cluster = true && this.isSetCluster(); + boolean that_present_cluster = true && that.isSetCluster(); + if (this_present_cluster || that_present_cluster) { + if (!(this_present_cluster && that_present_cluster)) + return false; + if (!this.cluster.equals(that.cluster)) + return false; + } + return true; } @@ -300,6 +371,16 @@ public class TableSchema implements org.apache.thrift.TBase<TableSchema, TableSc return lastComparison; } } + lastComparison = Boolean.valueOf(isSetCluster()).compareTo(typedOther.isSetCluster()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetCluster()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cluster, typedOther.cluster); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -327,6 +408,14 @@ public class TableSchema implements org.apache.thrift.TBase<TableSchema, TableSc sb.append(this.fields); } first = false; + if (!first) sb.append(", "); + sb.append("cluster:"); + if (this.cluster == null) { + sb.append("null"); + } else { + sb.append(this.cluster); + } + first = false; sb.append(")"); return sb.toString(); } @@ -389,6 +478,14 @@ public class TableSchema implements org.apache.thrift.TBase<TableSchema, TableSc org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; + case 2: // CLUSTER + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.cluster = iprot.readString(); + struct.setClusterIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -416,6 +513,11 @@ public class TableSchema implements org.apache.thrift.TBase<TableSchema, TableSc } oprot.writeFieldEnd(); } + if (struct.cluster != null) { + oprot.writeFieldBegin(CLUSTER_FIELD_DESC); + oprot.writeString(struct.cluster); + oprot.writeFieldEnd(); + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -437,7 +539,10 @@ public class TableSchema implements org.apache.thrift.TBase<TableSchema, TableSc if (struct.isSetFields()) { optionals.set(0); } - oprot.writeBitSet(optionals, 1); + if (struct.isSetCluster()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); if (struct.isSetFields()) { { oprot.writeI32(struct.fields.size()); @@ -447,12 +552,15 @@ public class TableSchema implements org.apache.thrift.TBase<TableSchema, TableSc } } } + if (struct.isSetCluster()) { + oprot.writeString(struct.cluster); + } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TableSchema struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); + BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { { org.apache.thrift.protocol.TList _list15 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); @@ -467,6 +575,10 @@ public class TableSchema implements org.apache.thrift.TBase<TableSchema, TableSc } struct.setFieldsIsSet(true); } + if (incoming.get(1)) { + struct.cluster = iprot.readString(); + struct.setClusterIsSet(true); + } } } http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/b45cb14b/src/distribution/src/main/scripts/interface/gen-perl/Blur/Types.pm ---------------------------------------------------------------------- diff --git a/src/distribution/src/main/scripts/interface/gen-perl/Blur/Types.pm b/src/distribution/src/main/scripts/interface/gen-perl/Blur/Types.pm index 794270b..7474d7c 100644 --- a/src/distribution/src/main/scripts/interface/gen-perl/Blur/Types.pm +++ b/src/distribution/src/main/scripts/interface/gen-perl/Blur/Types.pm @@ -505,17 +505,21 @@ sub write { package Blur::TableSchema; use base qw(Class::Accessor); -Blur::TableSchema->mk_accessors( qw( fields ) ); +Blur::TableSchema->mk_accessors( qw( fields cluster ) ); sub new { my $classname = shift; my $self = {}; my $vals = shift || {}; $self->{fields} = undef; + $self->{cluster} = undef; if (UNIVERSAL::isa($vals,'HASH')) { if (defined $vals->{fields}) { $self->{fields} = $vals->{fields}; } + if (defined $vals->{cluster}) { + $self->{cluster} = $vals->{cluster}; + } } return bless ($self, $classname); } @@ -558,6 +562,12 @@ sub read { $xfer += $input->skip($ftype); } last; }; + /^2$/ && do{ if ($ftype == TType::STRING) { + $xfer += $input->readString(\$self->{cluster}); + } else { + $xfer += $input->skip($ftype); + } + last; }; $xfer += $input->skip($ftype); } $xfer += $input->readFieldEnd(); @@ -584,6 +594,11 @@ sub write { } $xfer += $output->writeFieldEnd(); } + if (defined $self->{cluster}) { + $xfer += $output->writeFieldBegin('cluster', TType::STRING, 2); + $xfer += $output->writeString($self->{cluster}); + $xfer += $output->writeFieldEnd(); + } $xfer += $output->writeFieldStop(); $xfer += $output->writeStructEnd(); return $xfer; http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/b45cb14b/src/distribution/src/main/scripts/interface/gen-rb/blur_types.rb ---------------------------------------------------------------------- diff --git a/src/distribution/src/main/scripts/interface/gen-rb/blur_types.rb b/src/distribution/src/main/scripts/interface/gen-rb/blur_types.rb index 9b26ed5..646358c 100644 --- a/src/distribution/src/main/scripts/interface/gen-rb/blur_types.rb +++ b/src/distribution/src/main/scripts/interface/gen-rb/blur_types.rb @@ -196,10 +196,13 @@ module Blur class TableSchema include ::Thrift::Struct, ::Thrift::Struct_Union FIELDS = 1 + CLUSTER = 2 FIELDS = { # List of field information for a table. - FIELDS => {:type => ::Thrift::Types::LIST, :name => 'fields', :element => {:type => ::Thrift::Types::STRUCT, :class => ::Blur::FieldSchema}} + FIELDS => {:type => ::Thrift::Types::LIST, :name => 'fields', :element => {:type => ::Thrift::Types::STRUCT, :class => ::Blur::FieldSchema}}, + # The cluster name in which this table exists. + CLUSTER => {:type => ::Thrift::Types::STRING, :name => 'cluster'} } def struct_fields; FIELDS; end
