lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rm...@apache.org
Subject svn commit: r1433118 - in /lucene/dev/branches/lucene4547/lucene: codecs/src/java/org/apache/lucene/codecs/diskdv/ core/src/java/org/apache/lucene/codecs/lucene41/
Date Mon, 14 Jan 2013 20:48:20 GMT
Author: rmuir
Date: Mon Jan 14 20:48:20 2013
New Revision: 1433118

URL: http://svn.apache.org/viewvc?rev=1433118&view=rev
Log:
rename/refactor a bit

Added:
    lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/codecs/lucene41/Lucene41SimpleDocValuesConsumer.java
      - copied, changed from r1433091, lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/codecs/lucene41/Lucene41SimpleNormsConsumer.java
    lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/codecs/lucene41/Lucene41SimpleDocValuesFormat.java
  (with props)
    lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/codecs/lucene41/Lucene41SimpleDocValuesProducer.java
      - copied, changed from r1433091, lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/codecs/lucene41/Lucene41SimpleNormsProducer.java
Removed:
    lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/codecs/lucene41/Lucene41SimpleNormsConsumer.java
    lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/codecs/lucene41/Lucene41SimpleNormsProducer.java
Modified:
    lucene/dev/branches/lucene4547/lucene/codecs/src/java/org/apache/lucene/codecs/diskdv/DiskDocValuesConsumer.java
    lucene/dev/branches/lucene4547/lucene/codecs/src/java/org/apache/lucene/codecs/diskdv/DiskDocValuesProducer.java
    lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/codecs/lucene41/Lucene41SimpleNormsFormat.java

Modified: lucene/dev/branches/lucene4547/lucene/codecs/src/java/org/apache/lucene/codecs/diskdv/DiskDocValuesConsumer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/lucene/codecs/src/java/org/apache/lucene/codecs/diskdv/DiskDocValuesConsumer.java?rev=1433118&r1=1433117&r2=1433118&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/lucene/codecs/src/java/org/apache/lucene/codecs/diskdv/DiskDocValuesConsumer.java
(original)
+++ lucene/dev/branches/lucene4547/lucene/codecs/src/java/org/apache/lucene/codecs/diskdv/DiskDocValuesConsumer.java
Mon Jan 14 20:48:20 2013
@@ -37,11 +37,11 @@ class DiskDocValuesConsumer extends Simp
   final int maxDoc;
   
   DiskDocValuesConsumer(SegmentWriteState state) throws IOException {
-    String dataName = IndexFileNames.segmentFileName(state.segmentInfo.name, state.segmentSuffix,
"dvd");
+    String dataName = IndexFileNames.segmentFileName(state.segmentInfo.name, state.segmentSuffix,
"ddvd");
     data = state.directory.createOutput(dataName, state.context);
     CodecUtil.writeHeader(data, DiskDocValuesFormat.DATA_CODEC, 
                                 DiskDocValuesFormat.VERSION_CURRENT);
-    String metaName = IndexFileNames.segmentFileName(state.segmentInfo.name, state.segmentSuffix,
"dvm");
+    String metaName = IndexFileNames.segmentFileName(state.segmentInfo.name, state.segmentSuffix,
"ddvm");
     meta = state.directory.createOutput(metaName, state.context);
     CodecUtil.writeHeader(meta, DiskDocValuesFormat.METADATA_CODEC, 
                                 DiskDocValuesFormat.VERSION_CURRENT);

Modified: lucene/dev/branches/lucene4547/lucene/codecs/src/java/org/apache/lucene/codecs/diskdv/DiskDocValuesProducer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/lucene/codecs/src/java/org/apache/lucene/codecs/diskdv/DiskDocValuesProducer.java?rev=1433118&r1=1433117&r2=1433118&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/lucene/codecs/src/java/org/apache/lucene/codecs/diskdv/DiskDocValuesProducer.java
(original)
+++ lucene/dev/branches/lucene4547/lucene/codecs/src/java/org/apache/lucene/codecs/diskdv/DiskDocValuesProducer.java
Mon Jan 14 20:48:20 2013
@@ -44,7 +44,7 @@ class DiskDocValuesProducer extends Simp
   private final IndexInput data;
   
   DiskDocValuesProducer(SegmentReadState state) throws IOException {
-    String metaName = IndexFileNames.segmentFileName(state.segmentInfo.name, state.segmentSuffix,
"dvm");
+    String metaName = IndexFileNames.segmentFileName(state.segmentInfo.name, state.segmentSuffix,
"ddvm");
     // read in the entries from the metadata file.
     IndexInput in = state.directory.openInput(metaName, state.context);
     boolean success = false;
@@ -65,7 +65,7 @@ class DiskDocValuesProducer extends Simp
       }
     }
     
-    String dataName = IndexFileNames.segmentFileName(state.segmentInfo.name, state.segmentSuffix,
"dvd");
+    String dataName = IndexFileNames.segmentFileName(state.segmentInfo.name, state.segmentSuffix,
"ddvd");
     data = state.directory.openInput(dataName, state.context);
     CodecUtil.checkHeader(data, DiskDocValuesFormat.DATA_CODEC, 
                                 DiskDocValuesFormat.VERSION_START,

Copied: lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/codecs/lucene41/Lucene41SimpleDocValuesConsumer.java
(from r1433091, lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/codecs/lucene41/Lucene41SimpleNormsConsumer.java)
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/codecs/lucene41/Lucene41SimpleDocValuesConsumer.java?p2=lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/codecs/lucene41/Lucene41SimpleDocValuesConsumer.java&p1=lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/codecs/lucene41/Lucene41SimpleNormsConsumer.java&r1=1433091&r2=1433118&rev=1433118&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/codecs/lucene41/Lucene41SimpleNormsConsumer.java
(original)
+++ lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/codecs/lucene41/Lucene41SimpleDocValuesConsumer.java
Mon Jan 14 20:48:20 2013
@@ -41,21 +41,22 @@ import org.apache.lucene.util.packed.Pac
  * the latter is typically much smaller with lucene's sims, as only some byte values are
used,
  * but its often a nonlinear mapping, especially if you dont use crazy boosts.
  */
-class Lucene41SimpleNormsConsumer extends SimpleDVConsumer {
+class Lucene41SimpleDocValuesConsumer extends SimpleDVConsumer {
+  static final int VERSION_START = 0;
+  static final int VERSION_CURRENT = VERSION_START;
+  
   final IndexOutput data, meta;
   final int maxDoc;
   
-  Lucene41SimpleNormsConsumer(SegmentWriteState state) throws IOException {
+  Lucene41SimpleDocValuesConsumer(SegmentWriteState state, String dataCodec, String dataExtension,
String metaCodec, String metaExtension) throws IOException {
     boolean success = false;
     try {
-      String dataName = IndexFileNames.segmentFileName(state.segmentInfo.name, state.segmentSuffix,
"nvd");
+      String dataName = IndexFileNames.segmentFileName(state.segmentInfo.name, state.segmentSuffix,
dataExtension);
       data = state.directory.createOutput(dataName, state.context);
-      CodecUtil.writeHeader(data, Lucene41SimpleNormsFormat.DATA_CODEC, 
-                                  Lucene41SimpleNormsFormat.VERSION_CURRENT);
-      String metaName = IndexFileNames.segmentFileName(state.segmentInfo.name, state.segmentSuffix,
"nvm");
+      CodecUtil.writeHeader(data, dataCodec, VERSION_CURRENT);
+      String metaName = IndexFileNames.segmentFileName(state.segmentInfo.name, state.segmentSuffix,
metaExtension);
       meta = state.directory.createOutput(metaName, state.context);
-      CodecUtil.writeHeader(meta, Lucene41SimpleNormsFormat.METADATA_CODEC, 
-                                  Lucene41SimpleNormsFormat.VERSION_CURRENT);
+      CodecUtil.writeHeader(meta, metaCodec, VERSION_CURRENT);
       maxDoc = state.segmentInfo.getDocCount();
       success = true;
     } finally {

Added: lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/codecs/lucene41/Lucene41SimpleDocValuesFormat.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/codecs/lucene41/Lucene41SimpleDocValuesFormat.java?rev=1433118&view=auto
==============================================================================
--- lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/codecs/lucene41/Lucene41SimpleDocValuesFormat.java
(added)
+++ lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/codecs/lucene41/Lucene41SimpleDocValuesFormat.java
Mon Jan 14 20:48:20 2013
@@ -0,0 +1,44 @@
+package org.apache.lucene.codecs.lucene41;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.io.IOException;
+
+import org.apache.lucene.codecs.SimpleDVConsumer;
+import org.apache.lucene.codecs.SimpleDVProducer;
+import org.apache.lucene.codecs.SimpleNormsFormat;
+import org.apache.lucene.index.SegmentReadState;
+import org.apache.lucene.index.SegmentWriteState;
+
+public class Lucene41SimpleDocValuesFormat extends SimpleNormsFormat {
+
+  @Override
+  public SimpleDVConsumer normsConsumer(SegmentWriteState state) throws IOException {
+    return new Lucene41SimpleDocValuesConsumer(state, DATA_CODEC, DATA_EXTENSION, METADATA_CODEC,
METADATA_EXTENSION);
+  }
+  
+  @Override
+  public SimpleDVProducer normsProducer(SegmentReadState state) throws IOException {
+    return new Lucene41SimpleDocValuesProducer(state, DATA_CODEC, DATA_EXTENSION, METADATA_CODEC,
METADATA_EXTENSION);
+  }
+  
+  private static final String DATA_CODEC = "Lucene41DocValuesData";
+  private static final String DATA_EXTENSION = "dvd";
+  private static final String METADATA_CODEC = "Lucene41DocValuesMetadata";
+  private static final String METADATA_EXTENSION = "dvm";
+}

Copied: lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/codecs/lucene41/Lucene41SimpleDocValuesProducer.java
(from r1433091, lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/codecs/lucene41/Lucene41SimpleNormsProducer.java)
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/codecs/lucene41/Lucene41SimpleDocValuesProducer.java?p2=lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/codecs/lucene41/Lucene41SimpleDocValuesProducer.java&p1=lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/codecs/lucene41/Lucene41SimpleNormsProducer.java&r1=1433091&r2=1433118&rev=1433118&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/codecs/lucene41/Lucene41SimpleNormsProducer.java
(original)
+++ lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/codecs/lucene41/Lucene41SimpleDocValuesProducer.java
Mon Jan 14 20:48:20 2013
@@ -34,7 +34,7 @@ import org.apache.lucene.store.IndexInpu
 import org.apache.lucene.util.IOUtils;
 import org.apache.lucene.util.packed.PackedInts;
 
-class Lucene41SimpleNormsProducer extends SimpleDVProducer {
+class Lucene41SimpleDocValuesProducer extends SimpleDVProducer {
   private final Map<Integer,NumericEntry> numerics;
   private final IndexInput data;
   
@@ -42,15 +42,15 @@ class Lucene41SimpleNormsProducer extend
   private final Map<Integer,NumericDocValues> ramInstances = 
       new HashMap<Integer,NumericDocValues>();
   
-  Lucene41SimpleNormsProducer(SegmentReadState state) throws IOException {
-    String metaName = IndexFileNames.segmentFileName(state.segmentInfo.name, state.segmentSuffix,
"nvm");
+  Lucene41SimpleDocValuesProducer(SegmentReadState state, String dataCodec, String dataExtension,
String metaCodec, String metaExtension) throws IOException {
+    String metaName = IndexFileNames.segmentFileName(state.segmentInfo.name, state.segmentSuffix,
metaExtension);
     // read in the entries from the metadata file.
     IndexInput in = state.directory.openInput(metaName, state.context);
     boolean success = false;
     try {
-      CodecUtil.checkHeader(in, Lucene41SimpleNormsFormat.METADATA_CODEC, 
-                                Lucene41SimpleNormsFormat.VERSION_START,
-                                Lucene41SimpleNormsFormat.VERSION_START);
+      CodecUtil.checkHeader(in, metaCodec, 
+                                Lucene41SimpleDocValuesConsumer.VERSION_START,
+                                Lucene41SimpleDocValuesConsumer.VERSION_START);
       numerics = new HashMap<Integer,NumericEntry>();
       readFields(in, state.fieldInfos);
       success = true;
@@ -62,11 +62,11 @@ class Lucene41SimpleNormsProducer extend
       }
     }
     
-    String dataName = IndexFileNames.segmentFileName(state.segmentInfo.name, state.segmentSuffix,
"nvd");
+    String dataName = IndexFileNames.segmentFileName(state.segmentInfo.name, state.segmentSuffix,
dataExtension);
     data = state.directory.openInput(dataName, state.context);
-    CodecUtil.checkHeader(data, Lucene41SimpleNormsFormat.DATA_CODEC, 
-                                Lucene41SimpleNormsFormat.VERSION_START,
-                                Lucene41SimpleNormsFormat.VERSION_START);
+    CodecUtil.checkHeader(data, dataCodec, 
+                                Lucene41SimpleDocValuesConsumer.VERSION_START,
+                                Lucene41SimpleDocValuesConsumer.VERSION_START);
   }
   
   private void readFields(IndexInput meta, FieldInfos infos) throws IOException {

Modified: lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/codecs/lucene41/Lucene41SimpleNormsFormat.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/codecs/lucene41/Lucene41SimpleNormsFormat.java?rev=1433118&r1=1433117&r2=1433118&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/codecs/lucene41/Lucene41SimpleNormsFormat.java
(original)
+++ lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/codecs/lucene41/Lucene41SimpleNormsFormat.java
Mon Jan 14 20:48:20 2013
@@ -29,16 +29,16 @@ public class Lucene41SimpleNormsFormat e
 
   @Override
   public SimpleDVConsumer normsConsumer(SegmentWriteState state) throws IOException {
-    return new Lucene41SimpleNormsConsumer(state);
+    return new Lucene41SimpleDocValuesConsumer(state, DATA_CODEC, DATA_EXTENSION, METADATA_CODEC,
METADATA_EXTENSION);
   }
   
   @Override
   public SimpleDVProducer normsProducer(SegmentReadState state) throws IOException {
-    return new Lucene41SimpleNormsProducer(state);
+    return new Lucene41SimpleDocValuesProducer(state, DATA_CODEC, DATA_EXTENSION, METADATA_CODEC,
METADATA_EXTENSION);
   }
   
-  static final String DATA_CODEC = "Lucene41NormsData";
-  static final String METADATA_CODEC = "Lucene41DocValuesMetadata";
-  static final int VERSION_START = 0;
-  static final int VERSION_CURRENT = VERSION_START;
+  private static final String DATA_CODEC = "Lucene41NormsData";
+  private static final String DATA_EXTENSION = "nvd";
+  private static final String METADATA_CODEC = "Lucene41NormsMetadata";
+  private static final String METADATA_EXTENSION = "nvm";
 }



Mime
View raw message