You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by er...@apache.org on 2013/11/05 21:54:36 UTC

svn commit: r1539128 - in /lucene/dev/branches/branch_4x: ./ dev-tools/ lucene/ lucene/analysis/ lucene/analysis/icu/src/java/org/apache/lucene/collation/ lucene/backwards/ lucene/benchmark/ lucene/classification/ lucene/classification/src/ lucene/code...

Author: erick
Date: Tue Nov  5 20:54:34 2013
New Revision: 1539128

URL: http://svn.apache.org/r1539128
Log:
SOLR-5084: new enum field type

Added:
    lucene/dev/branches/branch_4x/lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/EnumFieldSource.java
      - copied unchanged from r1539111, lucene/dev/trunk/lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/EnumFieldSource.java
    lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/schema/EnumField.java
      - copied, changed from r1539111, lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/EnumField.java
    lucene/dev/branches/branch_4x/solr/core/src/test-files/solr/collection1/conf/enumsConfig.xml
      - copied unchanged from r1539111, lucene/dev/trunk/solr/core/src/test-files/solr/collection1/conf/enumsConfig.xml
    lucene/dev/branches/branch_4x/solr/core/src/test-files/solr/collection1/conf/schema-enums.xml   (props changed)
      - copied unchanged from r1539111, lucene/dev/trunk/solr/core/src/test-files/solr/collection1/conf/schema-enums.xml
    lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/schema/EnumFieldTest.java
      - copied unchanged from r1539111, lucene/dev/trunk/solr/core/src/test/org/apache/solr/schema/EnumFieldTest.java
    lucene/dev/branches/branch_4x/solr/solrj/src/java/org/apache/solr/common/EnumFieldValue.java
      - copied unchanged from r1539111, lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/common/EnumFieldValue.java
Modified:
    lucene/dev/branches/branch_4x/   (props changed)
    lucene/dev/branches/branch_4x/dev-tools/   (props changed)
    lucene/dev/branches/branch_4x/lucene/   (props changed)
    lucene/dev/branches/branch_4x/lucene/BUILD.txt   (props changed)
    lucene/dev/branches/branch_4x/lucene/CHANGES.txt   (props changed)
    lucene/dev/branches/branch_4x/lucene/JRE_VERSION_MIGRATION.txt   (props changed)
    lucene/dev/branches/branch_4x/lucene/LICENSE.txt   (props changed)
    lucene/dev/branches/branch_4x/lucene/MIGRATE.txt   (props changed)
    lucene/dev/branches/branch_4x/lucene/NOTICE.txt   (props changed)
    lucene/dev/branches/branch_4x/lucene/README.txt   (props changed)
    lucene/dev/branches/branch_4x/lucene/SYSTEM_REQUIREMENTS.txt   (props changed)
    lucene/dev/branches/branch_4x/lucene/analysis/   (props changed)
    lucene/dev/branches/branch_4x/lucene/analysis/icu/src/java/org/apache/lucene/collation/ICUCollationKeyFilterFactory.java   (props changed)
    lucene/dev/branches/branch_4x/lucene/backwards/   (props changed)
    lucene/dev/branches/branch_4x/lucene/benchmark/   (props changed)
    lucene/dev/branches/branch_4x/lucene/build.xml   (props changed)
    lucene/dev/branches/branch_4x/lucene/classification/   (props changed)
    lucene/dev/branches/branch_4x/lucene/classification/build.xml   (props changed)
    lucene/dev/branches/branch_4x/lucene/classification/ivy.xml   (props changed)
    lucene/dev/branches/branch_4x/lucene/classification/src/   (props changed)
    lucene/dev/branches/branch_4x/lucene/codecs/   (props changed)
    lucene/dev/branches/branch_4x/lucene/common-build.xml   (props changed)
    lucene/dev/branches/branch_4x/lucene/core/   (props changed)
    lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java   (props changed)
    lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/index/index.40.cfs.zip   (props changed)
    lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/index/index.40.nocfs.zip   (props changed)
    lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/index/index.40.optimized.cfs.zip   (props changed)
    lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/index/index.40.optimized.nocfs.zip   (props changed)
    lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/search/TestSort.java   (props changed)
    lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/search/TestSortDocValues.java   (props changed)
    lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/search/TestSortRandom.java   (props changed)
    lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/search/TestTopFieldCollector.java   (props changed)
    lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/search/TestTotalHitCountCollector.java   (props changed)
    lucene/dev/branches/branch_4x/lucene/demo/   (props changed)
    lucene/dev/branches/branch_4x/lucene/expressions/   (props changed)
    lucene/dev/branches/branch_4x/lucene/facet/   (props changed)
    lucene/dev/branches/branch_4x/lucene/grouping/   (props changed)
    lucene/dev/branches/branch_4x/lucene/highlighter/   (props changed)
    lucene/dev/branches/branch_4x/lucene/ivy-settings.xml   (props changed)
    lucene/dev/branches/branch_4x/lucene/ivy-versions.properties   (props changed)
    lucene/dev/branches/branch_4x/lucene/join/   (props changed)
    lucene/dev/branches/branch_4x/lucene/licenses/   (props changed)
    lucene/dev/branches/branch_4x/lucene/memory/   (props changed)
    lucene/dev/branches/branch_4x/lucene/misc/   (props changed)
    lucene/dev/branches/branch_4x/lucene/module-build.xml   (props changed)
    lucene/dev/branches/branch_4x/lucene/queries/   (props changed)
    lucene/dev/branches/branch_4x/lucene/queries/src/test/org/apache/lucene/queries/function/TestFunctionQuerySort.java   (props changed)
    lucene/dev/branches/branch_4x/lucene/queryparser/   (props changed)
    lucene/dev/branches/branch_4x/lucene/replicator/   (props changed)
    lucene/dev/branches/branch_4x/lucene/sandbox/   (props changed)
    lucene/dev/branches/branch_4x/lucene/site/   (props changed)
    lucene/dev/branches/branch_4x/lucene/spatial/   (props changed)
    lucene/dev/branches/branch_4x/lucene/suggest/   (props changed)
    lucene/dev/branches/branch_4x/lucene/test-framework/   (props changed)
    lucene/dev/branches/branch_4x/lucene/tools/   (props changed)
    lucene/dev/branches/branch_4x/solr/   (props changed)
    lucene/dev/branches/branch_4x/solr/CHANGES.txt   (contents, props changed)
    lucene/dev/branches/branch_4x/solr/LICENSE.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/NOTICE.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/README.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/SYSTEM_REQUIREMENTS.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/build.xml   (props changed)
    lucene/dev/branches/branch_4x/solr/cloud-dev/   (props changed)
    lucene/dev/branches/branch_4x/solr/common-build.xml   (props changed)
    lucene/dev/branches/branch_4x/solr/contrib/   (props changed)
    lucene/dev/branches/branch_4x/solr/core/   (props changed)
    lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handler/component/StatsValuesFactory.java
    lucene/dev/branches/branch_4x/solr/core/src/test-files/solr/collection1/conf/solrconfig-minimal.xml
    lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/core/TestConfig.java   (props changed)
    lucene/dev/branches/branch_4x/solr/example/   (props changed)
    lucene/dev/branches/branch_4x/solr/licenses/   (props changed)
    lucene/dev/branches/branch_4x/solr/licenses/httpclient-LICENSE-ASL.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/licenses/httpclient-NOTICE.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/licenses/httpcore-LICENSE-ASL.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/licenses/httpcore-NOTICE.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/licenses/httpmime-LICENSE-ASL.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/licenses/httpmime-NOTICE.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/scripts/   (props changed)
    lucene/dev/branches/branch_4x/solr/site/   (props changed)
    lucene/dev/branches/branch_4x/solr/solrj/   (props changed)
    lucene/dev/branches/branch_4x/solr/solrj/src/java/org/apache/solr/common/util/JavaBinCodec.java
    lucene/dev/branches/branch_4x/solr/test-framework/   (props changed)
    lucene/dev/branches/branch_4x/solr/test-framework/src/java/org/apache/solr/cloud/AbstractZkTestCase.java
    lucene/dev/branches/branch_4x/solr/webapp/   (props changed)

Modified: lucene/dev/branches/branch_4x/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/CHANGES.txt?rev=1539128&r1=1539127&r2=1539128&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/CHANGES.txt (original)
+++ lucene/dev/branches/branch_4x/solr/CHANGES.txt Tue Nov  5 20:54:34 2013
@@ -89,6 +89,8 @@ New Features
 
 *  SOLR-5392: Extend solrj apis to cover collection management.
    (Roman Shaposhnik via Mark Miller)
+   
+* SOLR-5084: new field type EnumField. Elran Dvir via Erick Erickson
 
 Bug Fixes
 ----------------------

Modified: lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handler/component/StatsValuesFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handler/component/StatsValuesFactory.java?rev=1539128&r1=1539127&r2=1539128&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handler/component/StatsValuesFactory.java (original)
+++ lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handler/component/StatsValuesFactory.java Tue Nov  5 20:54:34 2013
@@ -27,6 +27,7 @@ import org.apache.lucene.index.AtomicRea
 import org.apache.lucene.queries.function.FunctionValues;
 import org.apache.lucene.queries.function.ValueSource;
 import org.apache.lucene.util.BytesRef;
+import org.apache.solr.common.EnumFieldValue;
 import org.apache.solr.common.SolrException;
 import org.apache.solr.common.util.NamedList;
 import org.apache.solr.common.util.SimpleOrderedMap;
@@ -62,6 +63,8 @@ public class StatsValuesFactory {
       return new DateStatsValues(sf);
     } else if (StrField.class.isInstance(fieldType)) {
       return new StringStatsValues(sf);
+    } else if (sf.getType().getClass().equals(EnumField.class)) {
+      return new EnumStatsValues(sf);
     } else {
       throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, "Field type " + fieldType + " is not currently supported");
     }
@@ -312,6 +315,72 @@ class NumericStatsValues extends Abstrac
 }
 
 /**
+ * Implementation of StatsValues that supports EnumField values
+ */
+class EnumStatsValues extends AbstractStatsValues<EnumFieldValue> {
+
+  public EnumStatsValues(SchemaField sf) {
+    super(sf);
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public void accumulate(int docID) {
+    if (values.exists(docID)) {
+      Integer intValue = (Integer) values.objectVal(docID);
+      String stringValue = values.strVal(docID);
+      EnumFieldValue enumFieldValue = new EnumFieldValue(intValue, stringValue);
+      accumulate(enumFieldValue, 1);
+    } else {
+      missing();
+    }
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  protected void updateMinMax(EnumFieldValue min, EnumFieldValue max) {
+    if (max != null) {
+      if (max.compareTo(this.max) > 0)
+        this.max = max;
+    }
+    if (this.min == null)
+      this.min = min;
+    else if (this.min.compareTo(min) > 0)
+      this.min = min;
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  protected void updateTypeSpecificStats(NamedList stv) {
+    // No type specific stats
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  protected void updateTypeSpecificStats(EnumFieldValue value, int count) {
+    // No type specific stats
+  }
+
+  /**
+   * Adds no type specific statistics
+   */
+  @Override
+  protected void addTypeSpecificStats(NamedList<Object> res) {
+    // Add no statistics
+  }
+
+
+}
+
+/**
+ * /**
  * Implementation of StatsValues that supports Date values
  */
 class DateStatsValues extends AbstractStatsValues<Date> {

Copied: lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/schema/EnumField.java (from r1539111, lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/EnumField.java)
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/schema/EnumField.java?p2=lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/schema/EnumField.java&p1=lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/EnumField.java&r1=1539111&r2=1539128&rev=1539128&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/EnumField.java (original)
+++ lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/schema/EnumField.java Tue Nov  5 20:54:34 2013
@@ -18,7 +18,8 @@ package org.apache.solr.schema;
  */
 
 import org.apache.lucene.document.FieldType;
-import org.apache.lucene.index.StorableField;
+import org.apache.lucene.index.IndexableField;
+
 import org.apache.lucene.queries.function.ValueSource;
 import org.apache.lucene.queries.function.valuesource.EnumFieldSource;
 import org.apache.lucene.search.*;
@@ -160,7 +161,7 @@ public class EnumField extends Primitive
    * {@inheritDoc}
    */
   @Override
-  public EnumFieldValue toObject(StorableField f) {
+  public EnumFieldValue toObject(IndexableField f) {
     Integer intValue = null;
     String stringValue = null;
     final Number val = f.numericValue();
@@ -194,7 +195,7 @@ public class EnumField extends Primitive
    * {@inheritDoc}
    */
   @Override
-  public void write(TextResponseWriter writer, String name, StorableField f) throws IOException {
+  public void write(TextResponseWriter writer, String name, IndexableField f) throws IOException {
     final Number val = f.numericValue();
     if (val == null) {
       writer.writeNull(name);
@@ -290,7 +291,7 @@ public class EnumField extends Primitive
    * {@inheritDoc}
    */
   @Override
-  public String toExternal(StorableField f) {
+  public String toExternal(IndexableField f) {
     final Number val = f.numericValue();
     if (val == null)
       return null;
@@ -337,7 +338,7 @@ public class EnumField extends Primitive
    * {@inheritDoc}
    */
   @Override
-  public String storedToIndexed(StorableField f) {
+  public String storedToIndexed(IndexableField f) {
     final Number val = f.numericValue();
     if (val == null)
       return null;
@@ -350,7 +351,7 @@ public class EnumField extends Primitive
    * {@inheritDoc}
    */
   @Override
-  public StorableField createField(SchemaField field, Object value, float boost) {
+  public IndexableField createField(SchemaField field, Object value, float boost) {
     final boolean indexed = field.indexed();
     final boolean stored = field.stored();
     final boolean docValues = field.hasDocValues();

Modified: lucene/dev/branches/branch_4x/solr/core/src/test-files/solr/collection1/conf/solrconfig-minimal.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/test-files/solr/collection1/conf/solrconfig-minimal.xml?rev=1539128&r1=1539127&r2=1539128&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/test-files/solr/collection1/conf/solrconfig-minimal.xml (original)
+++ lucene/dev/branches/branch_4x/solr/core/src/test-files/solr/collection1/conf/solrconfig-minimal.xml Tue Nov  5 20:54:34 2013
@@ -1,75 +1,61 @@
-<?xml version="1.0" encoding="UTF-8" ?>
+<?xml version="1.0" ?>
 
 <!--
-  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.
+ 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.
+-->
+
+<!-- This is a "kitchen sink" config file that tests can use.
+     When writting a new test, feel free to add *new* items (plugins,
+     config options, etc...) as long as they don't break any existing
+     tests.  if you need to test something esoteric please add a new
+     "solrconfig-your-esoteric-purpose.xml" config file.
+
+     Note in particular that this test is used by MinimalSchemaTest so
+     Anything added to this file needs to work correctly even if there
+     is now uniqueKey or defaultSearch Field.
   -->
 
-    <!-- For testing, I need to create some custom directories on the fly, particularly for some of the new
-     discovery-based core configuration. Trying a minimal configuration to cut down the setup time.
-     use in conjunction with schema-minimal.xml perhaps? -->
 <config>
-  <luceneMatchVersion>LUCENE_41</luceneMatchVersion>
 
   <dataDir>${solr.data.dir:}</dataDir>
 
   <directoryFactory name="DirectoryFactory"
                     class="${solr.directoryFactory:solr.NRTCachingDirectoryFactory}"/>
 
-  <xi:include href="./solrconfig.snippet.randomindexconfig.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
-  <codecFactory class="solr.SchemaCodecFactory"/>
-  <jmx/>
-  <updateHandler class="solr.DirectUpdateHandler2">
-    <!--updateLog>
-      <str name="dir">${solr.ulog.dir:}</str>
-    </updateLog-->
-  </updateHandler>
-
-  <query>
-    <enableLazyFieldLoading>true</enableLazyFieldLoading>
-    <queryResultWindowSize>20</queryResultWindowSize>
-    <queryResultMaxDocsCached>20</queryResultMaxDocsCached>
-
-    <useColdSearcher>true</useColdSearcher>
-
-    <maxWarmingSearchers>1</maxWarmingSearchers>
+  <luceneMatchVersion>${tests.luceneMatchVersion:LUCENE_CURRENT}</luceneMatchVersion>
 
-  </query>
+  <xi:include href="solrconfig.snippet.randomindexconfig.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
 
-  <requestHandler name="/admin/" class="solr.admin.AdminHandlers" />
+  <updateHandler class="solr.DirectUpdateHandler2">
+    <commitWithin>
+      <softCommit>${solr.commitwithin.softcommit:true}</softCommit>
+    </commitWithin>
 
-  <requestDispatcher handleSelect="false">
-    <httpCaching never304="true"/>
-  </requestDispatcher>
+  </updateHandler>
   <requestHandler name="/select" class="solr.SearchHandler">
     <lst name="defaults">
       <str name="echoParams">explicit</str>
-      <str name="wt">json</str>
       <str name="indent">true</str>
       <str name="df">text</str>
     </lst>
 
   </requestHandler>
-  <requestHandler name="/update" class="solr.UpdateRequestHandler">
-  </requestHandler>
 
-  <queryResponseWriter name="json" class="solr.JSONResponseWriter">
-    <!-- For the purposes of the tutorial, JSON responses are written as
-     plain text so that they are easy to read in *any* browser.
-     If you expect a MIME type of "application/json" just remove this override.
-    -->
-    <str name="content-type">text/plain; charset=UTF-8</str>
-  </queryResponseWriter>
+  <requestHandler name="/admin/" class="org.apache.solr.handler.admin.AdminHandlers" />
+
+  <requestHandler name="/update" class="solr.UpdateRequestHandler"  />
 </config>
+

Modified: lucene/dev/branches/branch_4x/solr/solrj/src/java/org/apache/solr/common/util/JavaBinCodec.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/solrj/src/java/org/apache/solr/common/util/JavaBinCodec.java?rev=1539128&r1=1539127&r2=1539128&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/solrj/src/java/org/apache/solr/common/util/JavaBinCodec.java (original)
+++ lucene/dev/branches/branch_4x/solr/solrj/src/java/org/apache/solr/common/util/JavaBinCodec.java Tue Nov  5 20:54:34 2013
@@ -16,6 +16,7 @@
  */
 package org.apache.solr.common.util;
 
+import org.apache.solr.common.EnumFieldValue;
 import org.noggit.CharArr;
 import org.apache.solr.common.SolrDocument;
 import org.apache.solr.common.SolrDocumentList;
@@ -62,7 +63,8 @@ public class JavaBinCodec {
           END = 15,
 
           SOLRINPUTDOC = 16,
-
+          SOLRINPUTDOC_CHILDS = 17,
+          ENUM_FIELD_VALUE = 18,
           // types that combine tag + length (or other info) in a single byte
           TAG_AND_LEN = (byte) (1 << 5),
           STR = (byte) (1 << 5),
@@ -223,6 +225,8 @@ public class JavaBinCodec {
         return END_OBJ;
       case SOLRINPUTDOC:
         return readSolrInputDocument(dis);
+      case ENUM_FIELD_VALUE:
+        return readEnumFieldValue(dis);
     }
 
     throw new RuntimeException("Unknown type " + tagByte);
@@ -278,6 +282,10 @@ public class JavaBinCodec {
       writeIterator(((Iterable) val).iterator());
       return true;
     }
+    if (val instanceof EnumFieldValue) {
+      writeEnumFieldValue((EnumFieldValue) val);
+      return true;
+    }
     return false;
   }
 
@@ -464,6 +472,27 @@ public class JavaBinCodec {
   }
 
   /**
+   * write {@link EnumFieldValue} as tag+int value+string value
+   * @param enumFieldValue to write
+   */
+  public void writeEnumFieldValue(EnumFieldValue enumFieldValue) throws IOException {
+    writeTag(ENUM_FIELD_VALUE);
+    writeInt(enumFieldValue.toInt());
+    writeStr(enumFieldValue.toString());
+  }
+
+  /**
+   * read {@link EnumFieldValue} (int+string) from input stream
+   * @param dis data input stream
+   * @return {@link EnumFieldValue}
+   */
+  public EnumFieldValue readEnumFieldValue(DataInputInputStream dis) throws IOException {
+    Integer intValue = (Integer) readVal(dis);
+    String stringValue = (String) readVal(dis);
+    return new EnumFieldValue(intValue, stringValue);
+  }
+
+  /**
    * write the string as tag+length, with length being the number of UTF-8 bytes
    */
   public void writeStr(String s) throws IOException {

Modified: lucene/dev/branches/branch_4x/solr/test-framework/src/java/org/apache/solr/cloud/AbstractZkTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/test-framework/src/java/org/apache/solr/cloud/AbstractZkTestCase.java?rev=1539128&r1=1539127&r2=1539128&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/test-framework/src/java/org/apache/solr/cloud/AbstractZkTestCase.java (original)
+++ lucene/dev/branches/branch_4x/solr/test-framework/src/java/org/apache/solr/cloud/AbstractZkTestCase.java Tue Nov  5 20:54:34 2013
@@ -109,6 +109,7 @@ public abstract class AbstractZkTestCase
     putConfig("conf1", zkClient, solrhome, "stopwords.txt");
     putConfig("conf1", zkClient, solrhome, "protwords.txt");
     putConfig("conf1", zkClient, solrhome, "currency.xml");
+    putConfig("conf1", zkClient, solrhome, "enumsConfig.xml");
     putConfig("conf1", zkClient, solrhome, "open-exchange-rates.json");
     putConfig("conf1", zkClient, solrhome, "mapping-ISOLatin1Accent.txt");
     putConfig("conf1", zkClient, solrhome, "old_synonyms.txt");