incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amccu...@apache.org
Subject [2/4] git commit: Generated the thrift code.
Date Tue, 19 Feb 2013 02:16:25 GMT
Generated the 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/f7a18ec2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/f7a18ec2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/f7a18ec2

Branch: refs/heads/0.2-dev
Commit: f7a18ec2c97a63733b84842cf42f430c88502fc6
Parents: b14bde7
Author: Aaron McCurry <amccurry@gmail.com>
Authored: Mon Feb 18 21:14:51 2013 -0500
Committer: Aaron McCurry <amccurry@gmail.com>
Committed: Mon Feb 18 21:14:51 2013 -0500

----------------------------------------------------------------------
 .../blur/thrift/generated/ClassDefinition.java     |  124 ++++++++++++++-
 .../src/main/scripts/interface/gen-html/Blur.html  |    3 +
 .../blur/thrift/generated/ClassDefinition.java     |  124 ++++++++++++++-
 .../main/scripts/interface/gen-perl/Blur/Types.pm  |   17 ++-
 .../main/scripts/interface/gen-rb/blur_types.rb    |    6 +-
 5 files changed, 264 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/f7a18ec2/src/blur-thrift/src/main/java/org/apache/blur/thrift/generated/ClassDefinition.java
----------------------------------------------------------------------
diff --git a/src/blur-thrift/src/main/java/org/apache/blur/thrift/generated/ClassDefinition.java
b/src/blur-thrift/src/main/java/org/apache/blur/thrift/generated/ClassDefinition.java
index 1a0046d..4f13848 100644
--- a/src/blur-thrift/src/main/java/org/apache/blur/thrift/generated/ClassDefinition.java
+++ b/src/blur-thrift/src/main/java/org/apache/blur/thrift/generated/ClassDefinition.java
@@ -54,6 +54,7 @@ public class ClassDefinition implements org.apache.thrift.TBase<ClassDefinition,
 
   private static final org.apache.thrift.protocol.TField CLASS_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("className",
org.apache.thrift.protocol.TType.STRING, (short)1);
   private static final org.apache.thrift.protocol.TField ARGUMENTS_FIELD_DESC = new org.apache.thrift.protocol.TField("arguments",
org.apache.thrift.protocol.TType.MAP, (short)2);
+  private static final org.apache.thrift.protocol.TField INIT_FUNCTION_FIELD_DESC = new org.apache.thrift.protocol.TField("initFunction",
org.apache.thrift.protocol.TType.STRING, (short)3);
 
   private static final Map<Class<? extends IScheme>, SchemeFactory> schemes =
new HashMap<Class<? extends IScheme>, SchemeFactory>();
   static {
@@ -63,11 +64,21 @@ public class ClassDefinition implements org.apache.thrift.TBase<ClassDefinition,
 
   public String className; // required
   public Map<String,ByteBuffer> arguments; // required
+  /**
+   * user can define its own way to initialize analyzer by providing javascript function.
+   * This function will always be used if defined.
+   */
+  public String initFunction; // 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 {
     CLASS_NAME((short)1, "className"),
-    ARGUMENTS((short)2, "arguments");
+    ARGUMENTS((short)2, "arguments"),
+    /**
+     * user can define its own way to initialize analyzer by providing javascript function.
+     * This function will always be used if defined.
+     */
+    INIT_FUNCTION((short)3, "initFunction");
 
     private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
@@ -86,6 +97,8 @@ public class ClassDefinition implements org.apache.thrift.TBase<ClassDefinition,
           return CLASS_NAME;
         case 2: // ARGUMENTS
           return ARGUMENTS;
+        case 3: // INIT_FUNCTION
+          return INIT_FUNCTION;
         default:
           return null;
       }
@@ -135,6 +148,8 @@ public class ClassDefinition implements org.apache.thrift.TBase<ClassDefinition,
         new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP,

             new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING),

             new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING
           , true))));
+    tmpMap.put(_Fields.INIT_FUNCTION, new org.apache.thrift.meta_data.FieldMetaData("initFunction",
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(ClassDefinition.class,
metaDataMap);
   }
@@ -144,11 +159,13 @@ public class ClassDefinition implements org.apache.thrift.TBase<ClassDefinition,
 
   public ClassDefinition(
     String className,
-    Map<String,ByteBuffer> arguments)
+    Map<String,ByteBuffer> arguments,
+    String initFunction)
   {
     this();
     this.className = className;
     this.arguments = arguments;
+    this.initFunction = initFunction;
   }
 
   /**
@@ -174,6 +191,9 @@ public class ClassDefinition implements org.apache.thrift.TBase<ClassDefinition,
       }
       this.arguments = __this__arguments;
     }
+    if (other.isSetInitFunction()) {
+      this.initFunction = other.initFunction;
+    }
   }
 
   public ClassDefinition deepCopy() {
@@ -184,6 +204,7 @@ public class ClassDefinition implements org.apache.thrift.TBase<ClassDefinition,
   public void clear() {
     this.className = null;
     this.arguments = null;
+    this.initFunction = null;
   }
 
   public String getClassName() {
@@ -245,6 +266,38 @@ public class ClassDefinition implements org.apache.thrift.TBase<ClassDefinition,
     }
   }
 
+  /**
+   * user can define its own way to initialize analyzer by providing javascript function.
+   * This function will always be used if defined.
+   */
+  public String getInitFunction() {
+    return this.initFunction;
+  }
+
+  /**
+   * user can define its own way to initialize analyzer by providing javascript function.
+   * This function will always be used if defined.
+   */
+  public ClassDefinition setInitFunction(String initFunction) {
+    this.initFunction = initFunction;
+    return this;
+  }
+
+  public void unsetInitFunction() {
+    this.initFunction = null;
+  }
+
+  /** Returns true if field initFunction is set (has been assigned a value) and false otherwise
*/
+  public boolean isSetInitFunction() {
+    return this.initFunction != null;
+  }
+
+  public void setInitFunctionIsSet(boolean value) {
+    if (!value) {
+      this.initFunction = null;
+    }
+  }
+
   public void setFieldValue(_Fields field, Object value) {
     switch (field) {
     case CLASS_NAME:
@@ -263,6 +316,14 @@ public class ClassDefinition implements org.apache.thrift.TBase<ClassDefinition,
       }
       break;
 
+    case INIT_FUNCTION:
+      if (value == null) {
+        unsetInitFunction();
+      } else {
+        setInitFunction((String)value);
+      }
+      break;
+
     }
   }
 
@@ -274,6 +335,9 @@ public class ClassDefinition implements org.apache.thrift.TBase<ClassDefinition,
     case ARGUMENTS:
       return getArguments();
 
+    case INIT_FUNCTION:
+      return getInitFunction();
+
     }
     throw new IllegalStateException();
   }
@@ -289,6 +353,8 @@ public class ClassDefinition implements org.apache.thrift.TBase<ClassDefinition,
       return isSetClassName();
     case ARGUMENTS:
       return isSetArguments();
+    case INIT_FUNCTION:
+      return isSetInitFunction();
     }
     throw new IllegalStateException();
   }
@@ -324,6 +390,15 @@ public class ClassDefinition implements org.apache.thrift.TBase<ClassDefinition,
         return false;
     }
 
+    boolean this_present_initFunction = true && this.isSetInitFunction();
+    boolean that_present_initFunction = true && that.isSetInitFunction();
+    if (this_present_initFunction || that_present_initFunction) {
+      if (!(this_present_initFunction && that_present_initFunction))
+        return false;
+      if (!this.initFunction.equals(that.initFunction))
+        return false;
+    }
+
     return true;
   }
 
@@ -360,6 +435,16 @@ public class ClassDefinition implements org.apache.thrift.TBase<ClassDefinition,
         return lastComparison;
       }
     }
+    lastComparison = Boolean.valueOf(isSetInitFunction()).compareTo(typedOther.isSetInitFunction());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetInitFunction()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.initFunction, typedOther.initFunction);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
     return 0;
   }
 
@@ -395,6 +480,14 @@ public class ClassDefinition implements org.apache.thrift.TBase<ClassDefinition,
       sb.append(this.arguments);
     }
     first = false;
+    if (!first) sb.append(", ");
+    sb.append("initFunction:");
+    if (this.initFunction == null) {
+      sb.append("null");
+    } else {
+      sb.append(this.initFunction);
+    }
+    first = false;
     sb.append(")");
     return sb.toString();
   }
@@ -466,6 +559,14 @@ public class ClassDefinition implements org.apache.thrift.TBase<ClassDefinition,
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
             }
             break;
+          case 3: // INIT_FUNCTION
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.initFunction = iprot.readString();
+              struct.setInitFunctionIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
           default:
             org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
@@ -499,6 +600,11 @@ public class ClassDefinition implements org.apache.thrift.TBase<ClassDefinition,
         }
         oprot.writeFieldEnd();
       }
+      if (struct.initFunction != null) {
+        oprot.writeFieldBegin(INIT_FUNCTION_FIELD_DESC);
+        oprot.writeString(struct.initFunction);
+        oprot.writeFieldEnd();
+      }
       oprot.writeFieldStop();
       oprot.writeStructEnd();
     }
@@ -523,7 +629,10 @@ public class ClassDefinition implements org.apache.thrift.TBase<ClassDefinition,
       if (struct.isSetArguments()) {
         optionals.set(1);
       }
-      oprot.writeBitSet(optionals, 2);
+      if (struct.isSetInitFunction()) {
+        optionals.set(2);
+      }
+      oprot.writeBitSet(optionals, 3);
       if (struct.isSetClassName()) {
         oprot.writeString(struct.className);
       }
@@ -537,12 +646,15 @@ public class ClassDefinition implements org.apache.thrift.TBase<ClassDefinition,
           }
         }
       }
+      if (struct.isSetInitFunction()) {
+        oprot.writeString(struct.initFunction);
+      }
     }
 
     @Override
     public void read(org.apache.thrift.protocol.TProtocol prot, ClassDefinition struct) throws
org.apache.thrift.TException {
       TTupleProtocol iprot = (TTupleProtocol) prot;
-      BitSet incoming = iprot.readBitSet(2);
+      BitSet incoming = iprot.readBitSet(3);
       if (incoming.get(0)) {
         struct.className = iprot.readString();
         struct.setClassNameIsSet(true);
@@ -562,6 +674,10 @@ public class ClassDefinition implements org.apache.thrift.TBase<ClassDefinition,
         }
         struct.setArgumentsIsSet(true);
       }
+      if (incoming.get(2)) {
+        struct.initFunction = iprot.readString();
+        struct.setInitFunctionIsSet(true);
+      }
     }
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/f7a18ec2/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 8cc63c3..0083c21 100644
--- a/src/distribution/src/main/scripts/interface/gen-html/Blur.html
+++ b/src/distribution/src/main/scripts/interface/gen-html/Blur.html
@@ -146,6 +146,9 @@ 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>className</td><td><code>string</code></td><td></td><td>default</td><td></td></tr>
 <tr><td>2</td><td>arguments</td><td><code>map&lt;<code>string</code>,
<code>binary</code>&gt;</code></td><td></td><td>default</td><td></td></tr>
+<tr><td>3</td><td>initFunction</td><td><code>string</code></td><td>user
can define its own way to initialize analyzer by providing javascript function.
+This function will always be used if defined.
+</td><td>default</td><td></td></tr>
 </table><br/></div><div class="definition"><h3 id="Struct_AnalyzerSubType">Struct:
AnalyzerSubType</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>subFieldName</td><td><code>string</code></td><td>The
sub field name.

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/f7a18ec2/src/distribution/src/main/scripts/interface/gen-java/org/apache/blur/thrift/generated/ClassDefinition.java
----------------------------------------------------------------------
diff --git a/src/distribution/src/main/scripts/interface/gen-java/org/apache/blur/thrift/generated/ClassDefinition.java
b/src/distribution/src/main/scripts/interface/gen-java/org/apache/blur/thrift/generated/ClassDefinition.java
index 1a0046d..4f13848 100644
--- a/src/distribution/src/main/scripts/interface/gen-java/org/apache/blur/thrift/generated/ClassDefinition.java
+++ b/src/distribution/src/main/scripts/interface/gen-java/org/apache/blur/thrift/generated/ClassDefinition.java
@@ -54,6 +54,7 @@ public class ClassDefinition implements org.apache.thrift.TBase<ClassDefinition,
 
   private static final org.apache.thrift.protocol.TField CLASS_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("className",
org.apache.thrift.protocol.TType.STRING, (short)1);
   private static final org.apache.thrift.protocol.TField ARGUMENTS_FIELD_DESC = new org.apache.thrift.protocol.TField("arguments",
org.apache.thrift.protocol.TType.MAP, (short)2);
+  private static final org.apache.thrift.protocol.TField INIT_FUNCTION_FIELD_DESC = new org.apache.thrift.protocol.TField("initFunction",
org.apache.thrift.protocol.TType.STRING, (short)3);
 
   private static final Map<Class<? extends IScheme>, SchemeFactory> schemes =
new HashMap<Class<? extends IScheme>, SchemeFactory>();
   static {
@@ -63,11 +64,21 @@ public class ClassDefinition implements org.apache.thrift.TBase<ClassDefinition,
 
   public String className; // required
   public Map<String,ByteBuffer> arguments; // required
+  /**
+   * user can define its own way to initialize analyzer by providing javascript function.
+   * This function will always be used if defined.
+   */
+  public String initFunction; // 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 {
     CLASS_NAME((short)1, "className"),
-    ARGUMENTS((short)2, "arguments");
+    ARGUMENTS((short)2, "arguments"),
+    /**
+     * user can define its own way to initialize analyzer by providing javascript function.
+     * This function will always be used if defined.
+     */
+    INIT_FUNCTION((short)3, "initFunction");
 
     private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
@@ -86,6 +97,8 @@ public class ClassDefinition implements org.apache.thrift.TBase<ClassDefinition,
           return CLASS_NAME;
         case 2: // ARGUMENTS
           return ARGUMENTS;
+        case 3: // INIT_FUNCTION
+          return INIT_FUNCTION;
         default:
           return null;
       }
@@ -135,6 +148,8 @@ public class ClassDefinition implements org.apache.thrift.TBase<ClassDefinition,
         new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP,

             new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING),

             new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING
           , true))));
+    tmpMap.put(_Fields.INIT_FUNCTION, new org.apache.thrift.meta_data.FieldMetaData("initFunction",
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(ClassDefinition.class,
metaDataMap);
   }
@@ -144,11 +159,13 @@ public class ClassDefinition implements org.apache.thrift.TBase<ClassDefinition,
 
   public ClassDefinition(
     String className,
-    Map<String,ByteBuffer> arguments)
+    Map<String,ByteBuffer> arguments,
+    String initFunction)
   {
     this();
     this.className = className;
     this.arguments = arguments;
+    this.initFunction = initFunction;
   }
 
   /**
@@ -174,6 +191,9 @@ public class ClassDefinition implements org.apache.thrift.TBase<ClassDefinition,
       }
       this.arguments = __this__arguments;
     }
+    if (other.isSetInitFunction()) {
+      this.initFunction = other.initFunction;
+    }
   }
 
   public ClassDefinition deepCopy() {
@@ -184,6 +204,7 @@ public class ClassDefinition implements org.apache.thrift.TBase<ClassDefinition,
   public void clear() {
     this.className = null;
     this.arguments = null;
+    this.initFunction = null;
   }
 
   public String getClassName() {
@@ -245,6 +266,38 @@ public class ClassDefinition implements org.apache.thrift.TBase<ClassDefinition,
     }
   }
 
+  /**
+   * user can define its own way to initialize analyzer by providing javascript function.
+   * This function will always be used if defined.
+   */
+  public String getInitFunction() {
+    return this.initFunction;
+  }
+
+  /**
+   * user can define its own way to initialize analyzer by providing javascript function.
+   * This function will always be used if defined.
+   */
+  public ClassDefinition setInitFunction(String initFunction) {
+    this.initFunction = initFunction;
+    return this;
+  }
+
+  public void unsetInitFunction() {
+    this.initFunction = null;
+  }
+
+  /** Returns true if field initFunction is set (has been assigned a value) and false otherwise
*/
+  public boolean isSetInitFunction() {
+    return this.initFunction != null;
+  }
+
+  public void setInitFunctionIsSet(boolean value) {
+    if (!value) {
+      this.initFunction = null;
+    }
+  }
+
   public void setFieldValue(_Fields field, Object value) {
     switch (field) {
     case CLASS_NAME:
@@ -263,6 +316,14 @@ public class ClassDefinition implements org.apache.thrift.TBase<ClassDefinition,
       }
       break;
 
+    case INIT_FUNCTION:
+      if (value == null) {
+        unsetInitFunction();
+      } else {
+        setInitFunction((String)value);
+      }
+      break;
+
     }
   }
 
@@ -274,6 +335,9 @@ public class ClassDefinition implements org.apache.thrift.TBase<ClassDefinition,
     case ARGUMENTS:
       return getArguments();
 
+    case INIT_FUNCTION:
+      return getInitFunction();
+
     }
     throw new IllegalStateException();
   }
@@ -289,6 +353,8 @@ public class ClassDefinition implements org.apache.thrift.TBase<ClassDefinition,
       return isSetClassName();
     case ARGUMENTS:
       return isSetArguments();
+    case INIT_FUNCTION:
+      return isSetInitFunction();
     }
     throw new IllegalStateException();
   }
@@ -324,6 +390,15 @@ public class ClassDefinition implements org.apache.thrift.TBase<ClassDefinition,
         return false;
     }
 
+    boolean this_present_initFunction = true && this.isSetInitFunction();
+    boolean that_present_initFunction = true && that.isSetInitFunction();
+    if (this_present_initFunction || that_present_initFunction) {
+      if (!(this_present_initFunction && that_present_initFunction))
+        return false;
+      if (!this.initFunction.equals(that.initFunction))
+        return false;
+    }
+
     return true;
   }
 
@@ -360,6 +435,16 @@ public class ClassDefinition implements org.apache.thrift.TBase<ClassDefinition,
         return lastComparison;
       }
     }
+    lastComparison = Boolean.valueOf(isSetInitFunction()).compareTo(typedOther.isSetInitFunction());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetInitFunction()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.initFunction, typedOther.initFunction);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
     return 0;
   }
 
@@ -395,6 +480,14 @@ public class ClassDefinition implements org.apache.thrift.TBase<ClassDefinition,
       sb.append(this.arguments);
     }
     first = false;
+    if (!first) sb.append(", ");
+    sb.append("initFunction:");
+    if (this.initFunction == null) {
+      sb.append("null");
+    } else {
+      sb.append(this.initFunction);
+    }
+    first = false;
     sb.append(")");
     return sb.toString();
   }
@@ -466,6 +559,14 @@ public class ClassDefinition implements org.apache.thrift.TBase<ClassDefinition,
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
             }
             break;
+          case 3: // INIT_FUNCTION
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.initFunction = iprot.readString();
+              struct.setInitFunctionIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
           default:
             org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
@@ -499,6 +600,11 @@ public class ClassDefinition implements org.apache.thrift.TBase<ClassDefinition,
         }
         oprot.writeFieldEnd();
       }
+      if (struct.initFunction != null) {
+        oprot.writeFieldBegin(INIT_FUNCTION_FIELD_DESC);
+        oprot.writeString(struct.initFunction);
+        oprot.writeFieldEnd();
+      }
       oprot.writeFieldStop();
       oprot.writeStructEnd();
     }
@@ -523,7 +629,10 @@ public class ClassDefinition implements org.apache.thrift.TBase<ClassDefinition,
       if (struct.isSetArguments()) {
         optionals.set(1);
       }
-      oprot.writeBitSet(optionals, 2);
+      if (struct.isSetInitFunction()) {
+        optionals.set(2);
+      }
+      oprot.writeBitSet(optionals, 3);
       if (struct.isSetClassName()) {
         oprot.writeString(struct.className);
       }
@@ -537,12 +646,15 @@ public class ClassDefinition implements org.apache.thrift.TBase<ClassDefinition,
           }
         }
       }
+      if (struct.isSetInitFunction()) {
+        oprot.writeString(struct.initFunction);
+      }
     }
 
     @Override
     public void read(org.apache.thrift.protocol.TProtocol prot, ClassDefinition struct) throws
org.apache.thrift.TException {
       TTupleProtocol iprot = (TTupleProtocol) prot;
-      BitSet incoming = iprot.readBitSet(2);
+      BitSet incoming = iprot.readBitSet(3);
       if (incoming.get(0)) {
         struct.className = iprot.readString();
         struct.setClassNameIsSet(true);
@@ -562,6 +674,10 @@ public class ClassDefinition implements org.apache.thrift.TBase<ClassDefinition,
         }
         struct.setArgumentsIsSet(true);
       }
+      if (incoming.get(2)) {
+        struct.initFunction = iprot.readString();
+        struct.setInitFunctionIsSet(true);
+      }
     }
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/f7a18ec2/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 bb63f19..624ecad 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
@@ -392,7 +392,7 @@ sub write {
 
 package Blur::ClassDefinition;
 use base qw(Class::Accessor);
-Blur::ClassDefinition->mk_accessors( qw( className arguments ) );
+Blur::ClassDefinition->mk_accessors( qw( className arguments initFunction ) );
 
 sub new {
   my $classname = shift;
@@ -400,6 +400,7 @@ sub new {
   my $vals      = shift || {};
   $self->{className} = undef;
   $self->{arguments} = undef;
+  $self->{initFunction} = undef;
   if (UNIVERSAL::isa($vals,'HASH')) {
     if (defined $vals->{className}) {
       $self->{className} = $vals->{className};
@@ -407,6 +408,9 @@ sub new {
     if (defined $vals->{arguments}) {
       $self->{arguments} = $vals->{arguments};
     }
+    if (defined $vals->{initFunction}) {
+      $self->{initFunction} = $vals->{initFunction};
+    }
   }
   return bless ($self, $classname);
 }
@@ -457,6 +461,12 @@ sub read {
         $xfer += $input->skip($ftype);
       }
       last; };
+      /^3$/ && do{      if ($ftype == TType::STRING) {
+        $xfer += $input->readString(\$self->{initFunction});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
         $xfer += $input->skip($ftype);
     }
     $xfer += $input->readFieldEnd();
@@ -489,6 +499,11 @@ sub write {
     }
     $xfer += $output->writeFieldEnd();
   }
+  if (defined $self->{initFunction}) {
+    $xfer += $output->writeFieldBegin('initFunction', TType::STRING, 3);
+    $xfer += $output->writeString($self->{initFunction});
+    $xfer += $output->writeFieldEnd();
+  }
   $xfer += $output->writeFieldStop();
   $xfer += $output->writeStructEnd();
   return $xfer;

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/f7a18ec2/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 b6acc28..3901ca3 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
@@ -166,10 +166,14 @@ module Blur
     include ::Thrift::Struct, ::Thrift::Struct_Union
     CLASSNAME = 1
     ARGUMENTS = 2
+    INITFUNCTION = 3
 
     FIELDS = {
       CLASSNAME => {:type => ::Thrift::Types::STRING, :name => 'className'},
-      ARGUMENTS => {:type => ::Thrift::Types::MAP, :name => 'arguments', :key =>
{:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING,
:binary => true}}
+      ARGUMENTS => {:type => ::Thrift::Types::MAP, :name => 'arguments', :key =>
{:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING,
:binary => true}},
+      # user can define its own way to initialize analyzer by providing javascript function.
+# This function will always be used if defined.
+      INITFUNCTION => {:type => ::Thrift::Types::STRING, :name => 'initFunction'}
     }
 
     def struct_fields; FIELDS; end


Mime
View raw message