lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cpoersc...@apache.org
Subject lucene-solr git commit: for SOLR-8621 work-in-progress branch: * adds LogByteSizeMergePolicyFactory and LogDocMergePolicyFactory * removes subPackages arg from MergePolicyFactoryHelper.newInstance signature * adds BaseMergePolicyTestCase.testMergePoli
Date Tue, 02 Feb 2016 10:57:09 GMT
Repository: lucene-solr
Updated Branches:
  refs/heads/master-solr-8621 219f7de94 -> 43671b3e0


for SOLR-8621 work-in-progress branch:
 * adds LogByteSizeMergePolicyFactory and LogDocMergePolicyFactory
 * removes subPackages arg from MergePolicyFactoryHelper.newInstance signature
 * adds BaseMergePolicyTestCase.testMergePolicyFactory method (and the things it calls)


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/43671b3e
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/43671b3e
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/43671b3e

Branch: refs/heads/master-solr-8621
Commit: 43671b3e0dc998bab73fd53bcd4df829d8eb273d
Parents: 219f7de
Author: Christine Poerschke <cpoerschke@apache.org>
Authored: Tue Feb 2 10:55:58 2016 +0000
Committer: Christine Poerschke <cpoerschke@apache.org>
Committed: Tue Feb 2 10:55:58 2016 +0000

----------------------------------------------------------------------
 .../index/LogByteSizeMergePolicyFactory.java    | 31 +++++++
 .../lucene/index/LogDocMergePolicyFactory.java  | 31 +++++++
 .../lucene/index/MergePolicyFactoryHelper.java  |  3 +-
 .../lucene/index/SimpleMergePolicyFactory.java  |  1 -
 .../lucene/index/WrapperMergePolicyFactory.java |  2 -
 .../apache/lucene/index/TestLogMergePolicy.java | 18 ++++
 .../apache/lucene/index/TestNoMergePolicy.java  | 15 +++
 .../lucene/index/TestTieredMergePolicy.java     | 18 ++++
 .../index/TestUpgradeIndexMergePolicy.java      | 12 +++
 .../lucene/index/TestSortingMergePolicy.java    | 17 ++++
 .../lucene/index/BaseMergePolicyTestCase.java   | 97 ++++++++++++++++++++
 .../org/apache/solr/update/SolrIndexConfig.java |  7 +-
 12 files changed, 244 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/43671b3e/lucene/core/src/java/org/apache/lucene/index/LogByteSizeMergePolicyFactory.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/index/LogByteSizeMergePolicyFactory.java
b/lucene/core/src/java/org/apache/lucene/index/LogByteSizeMergePolicyFactory.java
new file mode 100644
index 0000000..82ee6a8
--- /dev/null
+++ b/lucene/core/src/java/org/apache/lucene/index/LogByteSizeMergePolicyFactory.java
@@ -0,0 +1,31 @@
+package org.apache.lucene.index;
+
+/*
+ * 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.
+ */
+
+/**
+ * A {@link MergePolicyFactory} for {@link LogByteSizeMergePolicy} objects.
+ *
+ * @lucene.experimental
+ */
+public class LogByteSizeMergePolicyFactory extends SimpleMergePolicyFactory {
+
+  public LogByteSizeMergePolicyFactory(MergePolicyFactoryHelper helper, MergePolicyFactoryArgs
args) {
+    super(helper, args, LogByteSizeMergePolicy.class.getName());
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/43671b3e/lucene/core/src/java/org/apache/lucene/index/LogDocMergePolicyFactory.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/index/LogDocMergePolicyFactory.java b/lucene/core/src/java/org/apache/lucene/index/LogDocMergePolicyFactory.java
new file mode 100644
index 0000000..1327ff7
--- /dev/null
+++ b/lucene/core/src/java/org/apache/lucene/index/LogDocMergePolicyFactory.java
@@ -0,0 +1,31 @@
+package org.apache.lucene.index;
+
+/*
+ * 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.
+ */
+
+/**
+ * A {@link MergePolicyFactory} for {@link LogDocMergePolicy} objects.
+ *
+ * @lucene.experimental
+ */
+public class LogDocMergePolicyFactory extends SimpleMergePolicyFactory {
+
+  public LogDocMergePolicyFactory(MergePolicyFactoryHelper helper, MergePolicyFactoryArgs
args) {
+    super(helper, args, LogDocMergePolicy.class.getName());
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/43671b3e/lucene/core/src/java/org/apache/lucene/index/MergePolicyFactoryHelper.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/index/MergePolicyFactoryHelper.java b/lucene/core/src/java/org/apache/lucene/index/MergePolicyFactoryHelper.java
index 0701f4a..6fdeb79 100644
--- a/lucene/core/src/java/org/apache/lucene/index/MergePolicyFactoryHelper.java
+++ b/lucene/core/src/java/org/apache/lucene/index/MergePolicyFactoryHelper.java
@@ -19,9 +19,8 @@ package org.apache.lucene.index;
 
 public abstract class MergePolicyFactoryHelper {
 
-  public static final String NO_SUB_PACKAGES[] = new String[0];
   public static final Class[] NO_CLASSES = new Class[0];
   public static final Object[] NO_OBJECTS = new Object[0];
 
-  public abstract <T> T newInstance(String cName, Class<T> expectedType, String
[] subPackages, Class[] params, Object[] args);
+  public abstract <T> T newInstance(String cName, Class<T> expectedType, Class[]
params, Object[] args);
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/43671b3e/lucene/core/src/java/org/apache/lucene/index/SimpleMergePolicyFactory.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/index/SimpleMergePolicyFactory.java b/lucene/core/src/java/org/apache/lucene/index/SimpleMergePolicyFactory.java
index 97cc151..ab99955 100644
--- a/lucene/core/src/java/org/apache/lucene/index/SimpleMergePolicyFactory.java
+++ b/lucene/core/src/java/org/apache/lucene/index/SimpleMergePolicyFactory.java
@@ -36,7 +36,6 @@ public abstract class SimpleMergePolicyFactory extends MergePolicyFactory
{
     final MergePolicy mp = helper.newInstance(
         mergePolicyClassName,
         MergePolicy.class,
-        MergePolicyFactoryHelper.NO_SUB_PACKAGES,
         MergePolicyFactoryHelper.NO_CLASSES,
         MergePolicyFactoryHelper.NO_OBJECTS);
     args.invokeSetters(mp);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/43671b3e/lucene/core/src/java/org/apache/lucene/index/WrapperMergePolicyFactory.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/index/WrapperMergePolicyFactory.java b/lucene/core/src/java/org/apache/lucene/index/WrapperMergePolicyFactory.java
index af1381f..3d750ca 100644
--- a/lucene/core/src/java/org/apache/lucene/index/WrapperMergePolicyFactory.java
+++ b/lucene/core/src/java/org/apache/lucene/index/WrapperMergePolicyFactory.java
@@ -63,7 +63,6 @@ public abstract class WrapperMergePolicyFactory extends MergePolicyFactory
{
     final MergePolicy wrapperMP = (helper == null ? null : helper.newInstance(
         wrapperMergePolicyClassName,
         MergePolicy.class,
-        MergePolicyFactoryHelper.NO_SUB_PACKAGES,
         new Class[] { MergePolicy.class },
         new Object[] { wrappedMP }));
     args.invokeSetters(wrapperMP);
@@ -74,7 +73,6 @@ public abstract class WrapperMergePolicyFactory extends MergePolicyFactory
{
     final MergePolicyFactory mpf = helper.newInstance(
         wrappedMergePolicyArgs.mergePolicyFactoryClassName,
         MergePolicyFactory.class,
-        null,
         new Class[] { MergePolicyFactoryArgs.class },
         new Object[] { wrappedMergePolicyArgs });
     return mpf.getMergePolicy();

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/43671b3e/lucene/core/src/test/org/apache/lucene/index/TestLogMergePolicy.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestLogMergePolicy.java b/lucene/core/src/test/org/apache/lucene/index/TestLogMergePolicy.java
index 8dffdf8..104836e 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestLogMergePolicy.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestLogMergePolicy.java
@@ -23,6 +23,24 @@ public class TestLogMergePolicy extends BaseMergePolicyTestCase {
     return newLogMergePolicy(random());
   }
 
+  final private boolean changeMergeFactor = random().nextBoolean();
+  final private boolean changeNoCFSRatio = random().nextBoolean();
+
+  @Override
+  MergePolicyFactoryArgs mergePolicyFactoryArgs() {
+    final MergePolicyFactoryArgs args = new MergePolicyFactoryArgs();
+    if (changeMergeFactor) args.put("mergeFactor", new Integer(42));
+    if (changeNoCFSRatio) args.put("noCFSRatio", new Double(0.42d));
+    return args;
+  }
+
+  protected void checkFactoryCreatedMergePolicy(MergePolicy mergePolicy) {
+    assertTrue(mergePolicy instanceof LogMergePolicy);
+    final LogMergePolicy mp = (LogMergePolicy)mergePolicy;
+    if (changeMergeFactor) assertEquals(42, mp.getMergeFactor());
+    if (changeNoCFSRatio) assertEquals(0.42d, mp.getNoCFSRatio(), 0.0);
+  }
+
   public void testDefaultForcedMergeMB() {
     LogByteSizeMergePolicy mp = new LogByteSizeMergePolicy();
     assertTrue(mp.getMaxMergeMBForForcedMerge() > 0.0);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/43671b3e/lucene/core/src/test/org/apache/lucene/index/TestNoMergePolicy.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestNoMergePolicy.java b/lucene/core/src/test/org/apache/lucene/index/TestNoMergePolicy.java
index bdd83c6..418516f 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestNoMergePolicy.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestNoMergePolicy.java
@@ -31,6 +31,21 @@ public class TestNoMergePolicy extends BaseMergePolicyTestCase {
     return NoMergePolicy.INSTANCE;
   }
 
+  final private boolean changeNoCFSRatio = random().nextBoolean();
+
+  @Override
+  MergePolicyFactoryArgs mergePolicyFactoryArgs() {
+    final MergePolicyFactoryArgs args = new MergePolicyFactoryArgs();
+    if (changeNoCFSRatio) args.put("noCFSRatio", new Double(0.42d));
+    return args;
+  }
+
+  protected void checkFactoryCreatedMergePolicy(MergePolicy mergePolicy) {
+    assertTrue(mergePolicy instanceof NoMergePolicy);
+    final NoMergePolicy mp = (NoMergePolicy)mergePolicy;
+    if (changeNoCFSRatio) assertEquals(0.42d, mp.getNoCFSRatio(), 0.0);
+  }
+
   @Test
   public void testNoMergePolicy() throws Exception {
     MergePolicy mp = mergePolicy();

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/43671b3e/lucene/core/src/test/org/apache/lucene/index/TestTieredMergePolicy.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestTieredMergePolicy.java b/lucene/core/src/test/org/apache/lucene/index/TestTieredMergePolicy.java
index 945cf10..7e8aa07 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestTieredMergePolicy.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestTieredMergePolicy.java
@@ -29,6 +29,24 @@ public class TestTieredMergePolicy extends BaseMergePolicyTestCase {
     return newTieredMergePolicy();
   }
 
+  final private boolean changeMaxMergeAtOnce = random().nextBoolean();
+  final private boolean changeReclaimDeletesWeight = random().nextBoolean();
+
+  @Override
+  MergePolicyFactoryArgs mergePolicyFactoryArgs() {
+    final MergePolicyFactoryArgs args = new MergePolicyFactoryArgs();
+    if (changeMaxMergeAtOnce) args.put("maxMergeAtOnce", new Integer(42));
+    if (changeReclaimDeletesWeight) args.put("reclaimDeletesWeight", new Double(4.2d));
+    return args;
+  }
+
+  protected void checkFactoryCreatedMergePolicy(MergePolicy mergePolicy) {
+    assertTrue(mergePolicy instanceof TieredMergePolicy);
+    final TieredMergePolicy mp = (TieredMergePolicy)mergePolicy;
+    if (changeMaxMergeAtOnce) assertEquals(42, mp.getMaxMergeAtOnce());
+    if (changeReclaimDeletesWeight) assertEquals(4.2d, mp.getReclaimDeletesWeight(), 0.0);
+  }
+
   public void testForceMergeDeletes() throws Exception {
     Directory dir = newDirectory();
     IndexWriterConfig conf = newIndexWriterConfig(new MockAnalyzer(random()));

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/43671b3e/lucene/core/src/test/org/apache/lucene/index/TestUpgradeIndexMergePolicy.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestUpgradeIndexMergePolicy.java
b/lucene/core/src/test/org/apache/lucene/index/TestUpgradeIndexMergePolicy.java
index 857bcca..a154ba7 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestUpgradeIndexMergePolicy.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestUpgradeIndexMergePolicy.java
@@ -23,4 +23,16 @@ public class TestUpgradeIndexMergePolicy extends BaseMergePolicyTestCase
{
     return new UpgradeIndexMergePolicy(newMergePolicy(random()));
   }
 
+  @Override
+  MergePolicyFactoryArgs mergePolicyFactoryArgs() {
+    final MergePolicyFactoryArgs args = new MergePolicyFactoryArgs();
+    // TODO
+    return args;
+  }
+
+  protected void checkFactoryCreatedMergePolicy(MergePolicy mergePolicy) {
+    assertTrue(mergePolicy instanceof UpgradeIndexMergePolicy);
+    // TODO
+  }
+
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/43671b3e/lucene/misc/src/test/org/apache/lucene/index/TestSortingMergePolicy.java
----------------------------------------------------------------------
diff --git a/lucene/misc/src/test/org/apache/lucene/index/TestSortingMergePolicy.java b/lucene/misc/src/test/org/apache/lucene/index/TestSortingMergePolicy.java
index d9baf55..786e291 100644
--- a/lucene/misc/src/test/org/apache/lucene/index/TestSortingMergePolicy.java
+++ b/lucene/misc/src/test/org/apache/lucene/index/TestSortingMergePolicy.java
@@ -82,6 +82,23 @@ public class TestSortingMergePolicy extends BaseMergePolicyTestCase {
     return newSortingMergePolicy(sort);
   }
 
+  @Override
+  MergePolicyFactoryArgs mergePolicyFactoryArgs() {
+    final MergePolicyFactoryArgs args = new MergePolicyFactoryArgs();
+    // SOLR-5730 will add stuff here.
+    return args;
+  }
+
+  @Override
+  public void testMergePolicyFactory() throws IOException {
+    // This is a no-op until SOLR-5730 is in place.
+  }
+
+  protected void checkFactoryCreatedMergePolicy(MergePolicy mergePolicy) {
+    assertTrue(mergePolicy instanceof SortingMergePolicy);
+    // SOLR-5730 will add stuff here.
+  }
+
   public static SortingMergePolicy newSortingMergePolicy(Sort sort) {
     // usually create a MP with a low merge factor so that many merges happen
     MergePolicy mp;

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/43671b3e/lucene/test-framework/src/java/org/apache/lucene/index/BaseMergePolicyTestCase.java
----------------------------------------------------------------------
diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/BaseMergePolicyTestCase.java
b/lucene/test-framework/src/java/org/apache/lucene/index/BaseMergePolicyTestCase.java
index d94c1c3..ab4c8c7 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/index/BaseMergePolicyTestCase.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/index/BaseMergePolicyTestCase.java
@@ -24,6 +24,9 @@ import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.util.TestUtil;
 
 import java.io.IOException;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Modifier;
 import java.util.concurrent.atomic.AtomicBoolean;
 
 /**
@@ -66,4 +69,98 @@ public abstract class BaseMergePolicyTestCase extends LuceneTestCase {
     dir.close();
   }
   
+  Class<?>[] mergePolicyFactoryConstructorParameterTypes() {
+    return new Class[] {
+        MergePolicyFactoryHelper.class,
+        MergePolicyFactoryArgs.class
+    };
+  }
+
+  Object[] mergePolicyFactoryConstructorParameters() {
+    return new Object[] {
+        mergePolicyFactoryHelper(),
+        mergePolicyFactoryArgs()
+    };
+  }
+
+  protected abstract void checkFactoryCreatedMergePolicy(MergePolicy mergePolicy);
+
+  MergePolicyFactoryHelper mergePolicyFactoryHelper() {
+    return new MergePolicyFactoryHelper() {
+      public <T> T newInstance(String cName, Class<T> expectedType, Class[] params,
Object[] args) {
+        Class<? extends T> clazz;
+        try {
+          clazz = Class.forName(cName).asSubclass(expectedType);
+        } catch (ClassNotFoundException e) {
+          return null;
+        }
+        Constructor<? extends T> constructor = null;
+        try {
+          constructor = clazz.getConstructor(params);
+        } catch (NoSuchMethodException|SecurityException e) {
+          return null;
+        }
+        T obj = null;
+        try {
+          obj = constructor.newInstance(args);
+        } catch (IllegalAccessException|IllegalArgumentException|InstantiationException|InvocationTargetException
e) {
+          return null;
+        }
+        return obj;
+      }
+    };
+  }
+
+  MergePolicyFactoryArgs mergePolicyFactoryArgs() {
+    return new MergePolicyFactoryArgs();
+  }
+
+  public void testMergePolicyFactory() throws IOException {
+    final MergePolicy mp = mergePolicy();
+    Class<?> mpClass = mp.getClass();
+    do {
+      implTestMergePolicyFactory(mpClass);
+      mpClass = mpClass.getSuperclass();
+    } while (MergePolicy.class.isAssignableFrom(mpClass));
+    implTestMergePolicyFactory(MergePolicy.class);
+  }
+
+  private void implTestMergePolicyFactory(Class<?> mpClass) throws IOException {
+    if (Modifier.isAbstract(mpClass.getModifiers())) return;
+    final String mpClassName = mpClass.getName();
+    final String mpfClassName = mpClassName+"Factory";
+    // find factory class
+    Class<?> mpfClass = null;
+    try {
+      mpfClass = Class.forName(mpfClassName);
+    } catch (ClassNotFoundException e) {
+      fail(mpfClassName+" factory for "+mpClassName+" not found: "+mpClass);
+    }
+    final int mpfClassModifiers = mpfClass.getModifiers();
+    assertTrue(mpfClassName+" factory for "+mpClassName+" is not public: "+mpfClass,
+        Modifier.isPublic(mpfClassModifiers));
+    // find factory class's constructor
+    Constructor<?> constructor = null;
+    final Class<?>[] mpfConstructorParameterTypes = mergePolicyFactoryConstructorParameterTypes();
+    try {
+      constructor = mpfClass.getConstructor(mpfConstructorParameterTypes);
+    } catch (NoSuchMethodException|SecurityException e) {
+      fail(mpfClassName+" constructor("+mpfConstructorParameterTypes+") not found - "+e);
+    }
+    // construct a factory instance
+    MergePolicyFactory mpf = null;
+    final Object[] mpfConstructorParameters = mergePolicyFactoryConstructorParameters();
+    try {
+      final Object obj = constructor.newInstance(mpfConstructorParameters);
+      assertTrue(obj+" is not a MergePolicyFactory", obj instanceof MergePolicyFactory);
+      mpf = (MergePolicyFactory)obj;
+    } catch (IllegalAccessException|IllegalArgumentException|InstantiationException|InvocationTargetException
e) {
+      fail(mpfClassName+" constructor.newInstance("+mpfConstructorParameterTypes+") failed
- "+e);
+    }
+    // create a merge policy using the factory instance
+    final MergePolicy mp = mpf.getMergePolicy();
+    assertTrue(mp+" cannot be assigned to "+mpClass, mpClass.isAssignableFrom(mp.getClass()));
+    checkFactoryCreatedMergePolicy(mp);
+  }
+
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/43671b3e/solr/core/src/java/org/apache/solr/update/SolrIndexConfig.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/update/SolrIndexConfig.java b/solr/core/src/java/org/apache/solr/update/SolrIndexConfig.java
index 965b8a2..68bc357 100644
--- a/solr/core/src/java/org/apache/solr/update/SolrIndexConfig.java
+++ b/solr/core/src/java/org/apache/solr/update/SolrIndexConfig.java
@@ -240,6 +240,8 @@ public class SolrIndexConfig implements MapSerializable {
     return iwc;
   }
 
+  private static final String NO_SUB_PACKAGES[] = new String[0];
+
   /**
    * Builds a MergePolicy using the configured MergePolicyFactory
    * or if no factory is configured uses the configured mergePolicy PluginInfo.
@@ -262,16 +264,15 @@ public class SolrIndexConfig implements MapSerializable {
 
     final MergePolicyFactoryHelper mpfHelper = new MergePolicyFactoryHelper() {
       @Override
-      public <T> T newInstance(String cName, Class<T> expectedType, String []
subPackages, Class[] params, Object[] args) {
+      public <T> T newInstance(String cName, Class<T> expectedType, Class[] params,
Object[] args) {
         return schema.getResourceLoader().newInstance(
-            cName, expectedType, subPackages, params, args);
+            cName, expectedType, NO_SUB_PACKAGES, params, args);
       }
     };
 
     final MergePolicyFactory mpf = mpfHelper.newInstance(
         mpfClassName,
         MergePolicyFactory.class,
-        new String[0],
         new Class[] { MergePolicyFactoryHelper.class, MergePolicyFactoryArgs.class },
         new Object[] { mpfHelper, mpfArgs });
 


Mime
View raw message