You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by rm...@apache.org on 2013/10/21 20:58:44 UTC
svn commit: r1534320 [27/39] - in /lucene/dev/branches/lucene4956: ./
dev-tools/ dev-tools/idea/.idea/ dev-tools/idea/lucene/expressions/
dev-tools/idea/solr/contrib/velocity/ dev-tools/maven/
dev-tools/maven/lucene/ dev-tools/maven/lucene/expressions/...
Modified: lucene/dev/branches/lucene4956/lucene/test-framework/src/java/org/apache/lucene/store/MockDirectoryWrapper.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/lucene/test-framework/src/java/org/apache/lucene/store/MockDirectoryWrapper.java?rev=1534320&r1=1534319&r2=1534320&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/lucene/test-framework/src/java/org/apache/lucene/store/MockDirectoryWrapper.java (original)
+++ lucene/dev/branches/lucene4956/lucene/test-framework/src/java/org/apache/lucene/store/MockDirectoryWrapper.java Mon Oct 21 18:58:24 2013
@@ -80,6 +80,7 @@ public class MockDirectoryWrapper extend
volatile boolean crashed;
private ThrottledIndexOutput throttledOutput;
private Throttling throttling = Throttling.SOMETIMES;
+ protected LockFactory lockFactory;
final AtomicInteger inputCloneCount = new AtomicInteger();
@@ -121,10 +122,6 @@ public class MockDirectoryWrapper extend
this.lockFactory = new MockLockFactoryWrapper(this, delegate.getLockFactory());
init();
}
-
- public Directory getDelegate() {
- return this.delegate;
- }
public int getInputCloneCount() {
return inputCloneCount.get();
@@ -160,21 +157,15 @@ public class MockDirectoryWrapper extend
}
/**
- * Returns true if {@link #getDelegate() delegate} must sync its files.
+ * Returns true if {@link #in} must sync its files.
* Currently, only {@link NRTCachingDirectory} requires sync'ing its files
* because otherwise they are cached in an internal {@link RAMDirectory}. If
* other directories require that too, they should be added to this method.
*/
private boolean mustSync() {
- Directory delegate = this.delegate;
- while (true) {
- if (delegate instanceof RateLimitedDirectoryWrapper) {
- delegate = ((RateLimitedDirectoryWrapper) delegate).getDelegate();
- } else if (delegate instanceof TrackingDirectoryWrapper) {
- delegate = ((TrackingDirectoryWrapper) delegate).getDelegate();
- } else {
- break;
- }
+ Directory delegate = in;
+ while (delegate instanceof FilterDirectory) {
+ delegate = ((FilterDirectory) delegate).getDelegate();
}
return delegate instanceof NRTCachingDirectory;
}
@@ -191,31 +182,22 @@ public class MockDirectoryWrapper extend
for (String name : names) {
// randomly fail with IOE on any file
maybeThrowIOException(name);
- delegate.sync(Collections.singleton(name));
+ in.sync(Collections.singleton(name));
unSyncedFiles.remove(name);
}
} else {
unSyncedFiles.removeAll(names);
}
}
-
- @Override
- public String toString() {
- // NOTE: do not maybeYield here, since it consumes
- // randomness and can thus (unexpectedly during
- // debugging) change the behavior of a seed
- // maybeYield();
- return "MockDirWrapper(" + delegate + ")";
- }
public synchronized final long sizeInBytes() throws IOException {
- if (delegate instanceof RAMDirectory)
- return ((RAMDirectory) delegate).sizeInBytes();
+ if (in instanceof RAMDirectory)
+ return ((RAMDirectory) in).sizeInBytes();
else {
// hack
long size = 0;
- for (String file : delegate.listAll())
- size += delegate.fileLength(file);
+ for (String file : in.listAll())
+ size += in.fileLength(file);
return size;
}
}
@@ -252,7 +234,7 @@ public class MockDirectoryWrapper extend
long length = fileLength(name);
byte[] zeroes = new byte[256];
long upto = 0;
- IndexOutput out = delegate.createOutput(name, LuceneTestCase.newIOContext(randomState));
+ IndexOutput out = in.createOutput(name, LuceneTestCase.newIOContext(randomState));
while(upto < length) {
final int limit = (int) Math.min(length-upto, zeroes.length);
out.writeBytes(zeroes, 0, limit);
@@ -268,12 +250,12 @@ public class MockDirectoryWrapper extend
String tempFileName;
while (true) {
tempFileName = ""+randomState.nextInt();
- if (!delegate.fileExists(tempFileName)) {
+ if (!in.fileExists(tempFileName)) {
break;
}
}
- final IndexOutput tempOut = delegate.createOutput(tempFileName, LuceneTestCase.newIOContext(randomState));
- IndexInput ii = delegate.openInput(name, LuceneTestCase.newIOContext(randomState));
+ final IndexOutput tempOut = in.createOutput(tempFileName, LuceneTestCase.newIOContext(randomState));
+ IndexInput ii = in.openInput(name, LuceneTestCase.newIOContext(randomState));
tempOut.copyBytes(ii, ii.length()/2);
tempOut.close();
ii.close();
@@ -281,8 +263,8 @@ public class MockDirectoryWrapper extend
// Delete original and copy bytes back:
deleteFile(name, true);
- final IndexOutput out = delegate.createOutput(name, LuceneTestCase.newIOContext(randomState));
- ii = delegate.openInput(tempFileName, LuceneTestCase.newIOContext(randomState));
+ final IndexOutput out = in.createOutput(name, LuceneTestCase.newIOContext(randomState));
+ ii = in.openInput(tempFileName, LuceneTestCase.newIOContext(randomState));
out.copyBytes(ii, ii.length());
out.close();
ii.close();
@@ -294,7 +276,7 @@ public class MockDirectoryWrapper extend
action = "fully truncated";
// Totally truncate the file to zero bytes
deleteFile(name, true);
- IndexOutput out = delegate.createOutput(name, LuceneTestCase.newIOContext(randomState));
+ IndexOutput out = in.createOutput(name, LuceneTestCase.newIOContext(randomState));
out.setLength(0);
out.close();
}
@@ -436,7 +418,7 @@ public class MockDirectoryWrapper extend
openFilesDeleted.remove(name);
}
}
- delegate.deleteFile(name);
+ in.deleteFile(name);
}
public synchronized Set<String> getOpenDeletedFiles() {
@@ -476,8 +458,8 @@ public class MockDirectoryWrapper extend
unSyncedFiles.add(name);
createdFiles.add(name);
- if (delegate instanceof RAMDirectory) {
- RAMDirectory ramdir = (RAMDirectory) delegate;
+ if (in instanceof RAMDirectory) {
+ RAMDirectory ramdir = (RAMDirectory) in;
RAMFile file = new RAMFile(ramdir);
RAMFile existing = ramdir.fileMap.get(name);
@@ -493,7 +475,7 @@ public class MockDirectoryWrapper extend
}
}
//System.out.println(Thread.currentThread().getName() + ": MDW: create " + name);
- IndexOutput delegateOutput = delegate.createOutput(name, LuceneTestCase.newIOContext(randomState, context));
+ IndexOutput delegateOutput = in.createOutput(name, LuceneTestCase.newIOContext(randomState, context));
if (randomState.nextInt(10) == 0){
// once in a while wrap the IO in a Buffered IO with random buffer sizes
delegateOutput = new BufferedIndexOutputWrapper(1+randomState.nextInt(BufferedIndexOutput.DEFAULT_BUFFER_SIZE), delegateOutput);
@@ -504,7 +486,7 @@ public class MockDirectoryWrapper extend
// throttling REALLY slows down tests, so don't do it very often for SOMETIMES.
if (throttling == Throttling.ALWAYS ||
- (throttling == Throttling.SOMETIMES && randomState.nextInt(50) == 0) && !(delegate instanceof RateLimitedDirectoryWrapper)) {
+ (throttling == Throttling.SOMETIMES && randomState.nextInt(50) == 0) && !(in instanceof RateLimitedDirectoryWrapper)) {
if (LuceneTestCase.VERBOSE) {
System.out.println("MockDirectoryWrapper: throttling indexOutput (" + name + ")");
}
@@ -544,8 +526,8 @@ public class MockDirectoryWrapper extend
if (failOnOpenInput) {
maybeThrowDeterministicException();
}
- if (!delegate.fileExists(name)) {
- throw randomState.nextBoolean() ? new FileNotFoundException(name + " in dir=" + delegate) : new NoSuchFileException(name + " in dir=" + delegate);
+ if (!in.fileExists(name)) {
+ throw randomState.nextBoolean() ? new FileNotFoundException(name + " in dir=" + in) : new NoSuchFileException(name + " in dir=" + in);
}
// cannot open a file for input if it's still open for
@@ -554,7 +536,7 @@ public class MockDirectoryWrapper extend
throw fillOpenTrace(new IOException("MockDirectoryWrapper: file \"" + name + "\" is still open for writing"), name, false);
}
- IndexInput delegateInput = delegate.openInput(name, LuceneTestCase.newIOContext(randomState, context));
+ IndexInput delegateInput = in.openInput(name, LuceneTestCase.newIOContext(randomState, context));
final IndexInput ii;
int randomInt = randomState.nextInt(500);
@@ -577,10 +559,10 @@ public class MockDirectoryWrapper extend
/** Provided for testing purposes. Use sizeInBytes() instead. */
public synchronized final long getRecomputedSizeInBytes() throws IOException {
- if (!(delegate instanceof RAMDirectory))
+ if (!(in instanceof RAMDirectory))
return sizeInBytes();
long size = 0;
- for(final RAMFile file: ((RAMDirectory)delegate).fileMap.values()) {
+ for(final RAMFile file: ((RAMDirectory)in).fileMap.values()) {
size += file.getSizeInBytes();
}
return size;
@@ -593,10 +575,10 @@ public class MockDirectoryWrapper extend
*/
public final synchronized long getRecomputedActualSizeInBytes() throws IOException {
- if (!(delegate instanceof RAMDirectory))
+ if (!(in instanceof RAMDirectory))
return sizeInBytes();
long size = 0;
- for (final RAMFile file : ((RAMDirectory)delegate).fileMap.values())
+ for (final RAMFile file : ((RAMDirectory)in).fileMap.values())
size += file.length;
return size;
}
@@ -666,8 +648,8 @@ public class MockDirectoryWrapper extend
String[] startFiles = allFiles.toArray(new String[0]);
IndexWriterConfig iwc = new IndexWriterConfig(LuceneTestCase.TEST_VERSION_CURRENT, null);
iwc.setIndexDeletionPolicy(NoDeletionPolicy.INSTANCE);
- new IndexWriter(delegate, iwc).rollback();
- String[] endFiles = delegate.listAll();
+ new IndexWriter(in, iwc).rollback();
+ String[] endFiles = in.listAll();
Set<String> startSet = new TreeSet<String>(Arrays.asList(startFiles));
Set<String> endSet = new TreeSet<String>(Arrays.asList(endFiles));
@@ -692,13 +674,13 @@ public class MockDirectoryWrapper extend
}
SegmentInfos sis = new SegmentInfos();
try {
- sis.read(delegate, file);
+ sis.read(in, file);
} catch (IOException ioe) {
// OK: likely some of the .si files were deleted
}
try {
- Set<String> ghosts = new HashSet<String>(sis.files(delegate, false));
+ Set<String> ghosts = new HashSet<String>(sis.files(in, false));
for (String s : ghosts) {
if (endSet.contains(s) && !startSet.contains(s)) {
assert pendingDeletions.contains(s);
@@ -763,7 +745,7 @@ public class MockDirectoryWrapper extend
}
}
}
- delegate.close();
+ in.close();
}
synchronized void removeOpenFile(Closeable c, String name) {
@@ -856,19 +838,19 @@ public class MockDirectoryWrapper extend
@Override
public synchronized String[] listAll() throws IOException {
maybeYield();
- return delegate.listAll();
+ return in.listAll();
}
@Override
public synchronized boolean fileExists(String name) throws IOException {
maybeYield();
- return delegate.fileExists(name);
+ return in.fileExists(name);
}
@Override
public synchronized long fileLength(String name) throws IOException {
maybeYield();
- return delegate.fileLength(name);
+ return in.fileLength(name);
}
@Override
@@ -888,7 +870,7 @@ public class MockDirectoryWrapper extend
maybeYield();
// sneaky: we must pass the original this way to the dir, because
// some impls (e.g. FSDir) do instanceof here.
- delegate.setLockFactory(lockFactory);
+ in.setLockFactory(lockFactory);
// now set our wrapped factory here
this.lockFactory = new MockLockFactoryWrapper(this, lockFactory);
}
@@ -899,28 +881,28 @@ public class MockDirectoryWrapper extend
if (wrapLockFactory) {
return lockFactory;
} else {
- return delegate.getLockFactory();
+ return in.getLockFactory();
}
}
@Override
public synchronized String getLockID() {
maybeYield();
- return delegate.getLockID();
+ return in.getLockID();
}
@Override
public synchronized void copy(Directory to, String src, String dest, IOContext context) throws IOException {
maybeYield();
// randomize the IOContext here?
- delegate.copy(to, src, dest, context);
+ in.copy(to, src, dest, context);
}
@Override
public IndexInputSlicer createSlicer(final String name, IOContext context)
throws IOException {
maybeYield();
- if (!delegate.fileExists(name)) {
+ if (!in.fileExists(name)) {
throw randomState.nextBoolean() ? new FileNotFoundException(name) : new NoSuchFileException(name);
}
// cannot open a file for input if it's still open for
@@ -929,7 +911,7 @@ public class MockDirectoryWrapper extend
throw fillOpenTrace(new IOException("MockDirectoryWrapper: file \"" + name + "\" is still open for writing"), name, false);
}
- final IndexInputSlicer delegateHandle = delegate.createSlicer(name, context);
+ final IndexInputSlicer delegateHandle = in.createSlicer(name, context);
final IndexInputSlicer handle = new IndexInputSlicer() {
private boolean isClosed;
@@ -991,4 +973,9 @@ public class MockDirectoryWrapper extend
}
}
}
+
+ /** Use this when throwing fake {@code IOException},
+ * e.g. from {@link MockDirectoryWrapper.Failure}. */
+ public static class FakeIOException extends IOException {
+ }
}
Modified: lucene/dev/branches/lucene4956/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java?rev=1534320&r1=1534319&r2=1534320&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java (original)
+++ lucene/dev/branches/lucene4956/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java Mon Oct 21 18:58:24 2013
@@ -332,9 +332,13 @@ public abstract class LuceneTestCase ext
// -----------------------------------------------------------------
/**
- * @lucene.internal
+ * When {@code true}, Codecs for old Lucene version will support writing
+ * indexes in that format. Defaults to {@code true}, can be disabled by
+ * spdecific tests on demand.
+ *
+ * @lucene.internal
*/
- public static boolean PREFLEX_IMPERSONATION_IS_ACTIVE;
+ public static boolean OLD_FORMAT_IMPERSONATION_IS_ACTIVE = true;
// -----------------------------------------------------------------
@@ -1368,6 +1372,25 @@ public abstract class LuceneTestCase ext
}
return true;
}
+
+ /** Returns true if the codec "supports" docsWithField
+ * (other codecs return MatchAllBits, because you couldnt write missing values before) */
+ public static boolean defaultCodecSupportsDocsWithField() {
+ String name = Codec.getDefault().getName();
+ if (name.equals("Lucene40") || name.equals("Lucene41") || name.equals("Lucene42")) {
+ return false;
+ }
+ return true;
+ }
+
+ /** Returns true if the codec "supports" field updates. */
+ public static boolean defaultCodecSupportsFieldUpdates() {
+ String name = Codec.getDefault().getName();
+ if (name.equals("Lucene40") || name.equals("Lucene41") || name.equals("Lucene42") || name.equals("Lucene45")) {
+ return false;
+ }
+ return true;
+ }
public void assertReaderEquals(String info, IndexReader leftReader, IndexReader rightReader) throws IOException {
assertReaderStatisticsEquals(info, leftReader, rightReader);
@@ -1463,7 +1486,6 @@ public abstract class LuceneTestCase ext
* checks collection-level statistics on Terms
*/
public void assertTermsStatisticsEquals(String info, Terms leftTerms, Terms rightTerms) throws IOException {
- assert leftTerms.getComparator() == rightTerms.getComparator();
if (leftTerms.getDocCount() != -1 && rightTerms.getDocCount() != -1) {
assertEquals(info, leftTerms.getDocCount(), rightTerms.getDocCount());
}
@@ -1962,6 +1984,20 @@ public abstract class LuceneTestCase ext
assertNull(info, rightValues);
}
}
+
+ {
+ Bits leftBits = MultiDocValues.getDocsWithField(leftReader, field);
+ Bits rightBits = MultiDocValues.getDocsWithField(rightReader, field);
+ if (leftBits != null && rightBits != null) {
+ assertEquals(info, leftBits.length(), rightBits.length());
+ for (int i = 0; i < leftBits.length(); i++) {
+ assertEquals(info, leftBits.get(i), rightBits.get(i));
+ }
+ } else {
+ assertNull(info, leftBits);
+ assertNull(info, rightBits);
+ }
+ }
}
}
Modified: lucene/dev/branches/lucene4956/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleIgnoreTestSuites.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleIgnoreTestSuites.java?rev=1534320&r1=1534319&r2=1534320&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleIgnoreTestSuites.java (original)
+++ lucene/dev/branches/lucene4956/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleIgnoreTestSuites.java Mon Oct 21 18:58:24 2013
@@ -49,7 +49,7 @@ public final class TestRuleIgnoreTestSui
@Override
public void evaluate() throws Throwable {
if (NestedTestSuite.class.isAssignableFrom(d.getTestClass())) {
- LuceneTestCase.assumeTrue("Nested suite class ignored (started as stand-along).",
+ LuceneTestCase.assumeTrue("Nested suite class ignored (started as stand-alone).",
isRunningNested());
}
s.evaluate();
Modified: lucene/dev/branches/lucene4956/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleSetupAndRestoreClassEnv.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleSetupAndRestoreClassEnv.java?rev=1534320&r1=1534319&r2=1534320&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleSetupAndRestoreClassEnv.java (original)
+++ lucene/dev/branches/lucene4956/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleSetupAndRestoreClassEnv.java Mon Oct 21 18:58:24 2013
@@ -17,13 +17,22 @@ package org.apache.lucene.util;
* limitations under the License.
*/
+import static org.apache.lucene.util.LuceneTestCase.INFOSTREAM;
+import static org.apache.lucene.util.LuceneTestCase.TEST_CODEC;
+import static org.apache.lucene.util.LuceneTestCase.TEST_DOCVALUESFORMAT;
+import static org.apache.lucene.util.LuceneTestCase.TEST_POSTINGSFORMAT;
+import static org.apache.lucene.util.LuceneTestCase.VERBOSE;
+import static org.apache.lucene.util.LuceneTestCase.assumeFalse;
+import static org.apache.lucene.util.LuceneTestCase.localeForName;
+import static org.apache.lucene.util.LuceneTestCase.random;
+import static org.apache.lucene.util.LuceneTestCase.randomLocale;
+import static org.apache.lucene.util.LuceneTestCase.randomTimeZone;
+
import java.io.PrintStream;
-import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
-import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Random;
@@ -39,17 +48,19 @@ import org.apache.lucene.codecs.compress
import org.apache.lucene.codecs.lucene40.Lucene40RWCodec;
import org.apache.lucene.codecs.lucene40.Lucene40RWPostingsFormat;
import org.apache.lucene.codecs.lucene41.Lucene41RWCodec;
-import org.apache.lucene.codecs.lucene42.Lucene42Codec;
+import org.apache.lucene.codecs.lucene42.Lucene42RWCodec;
+import org.apache.lucene.codecs.lucene45.Lucene45RWCodec;
+import org.apache.lucene.codecs.lucene46.Lucene46Codec;
+import org.apache.lucene.codecs.mockrandom.MockRandomPostingsFormat;
import org.apache.lucene.codecs.simpletext.SimpleTextCodec;
import org.apache.lucene.index.RandomCodec;
import org.apache.lucene.search.RandomSimilarityProvider;
import org.apache.lucene.search.similarities.DefaultSimilarity;
import org.apache.lucene.search.similarities.Similarity;
-import org.apache.lucene.util.LuceneTestCase.SuppressCodecs; // javadocs
+import org.apache.lucene.util.LuceneTestCase.SuppressCodecs;
import org.junit.internal.AssumptionViolatedException;
-import com.carrotsearch.randomizedtesting.RandomizedContext;
-import static org.apache.lucene.util.LuceneTestCase.*;
+import com.carrotsearch.randomizedtesting.RandomizedContext;
@@ -161,6 +172,20 @@ final class TestRuleSetupAndRestoreClass
!shouldAvoidCodec("Lucene41"))) {
codec = Codec.forName("Lucene41");
assert codec instanceof Lucene41RWCodec : "fix your classpath to have tests-framework.jar before lucene-core.jar";
+ } else if ("Lucene42".equals(TEST_CODEC) || ("random".equals(TEST_CODEC) &&
+ "random".equals(TEST_POSTINGSFORMAT) &&
+ "random".equals(TEST_DOCVALUESFORMAT) &&
+ randomVal == 2 &&
+ !shouldAvoidCodec("Lucene42"))) {
+ codec = Codec.forName("Lucene42");
+ assert codec instanceof Lucene42RWCodec : "fix your classpath to have tests-framework.jar before lucene-core.jar";
+ } else if ("Lucene45".equals(TEST_CODEC) || ("random".equals(TEST_CODEC) &&
+ "random".equals(TEST_POSTINGSFORMAT) &&
+ "random".equals(TEST_DOCVALUESFORMAT) &&
+ randomVal == 5 &&
+ !shouldAvoidCodec("Lucene45"))) {
+ codec = Codec.forName("Lucene45");
+ assert codec instanceof Lucene45RWCodec : "fix your classpath to have tests-framework.jar before lucene-core.jar";
} else if (("random".equals(TEST_POSTINGSFORMAT) == false) || ("random".equals(TEST_DOCVALUESFORMAT) == false)) {
// the user wired postings or DV: this is messy
// refactor into RandomCodec....
@@ -168,21 +193,20 @@ final class TestRuleSetupAndRestoreClass
final PostingsFormat format;
if ("random".equals(TEST_POSTINGSFORMAT)) {
format = PostingsFormat.forName("Lucene41");
+ } else if ("MockRandom".equals(TEST_POSTINGSFORMAT)) {
+ format = new MockRandomPostingsFormat(new Random(random.nextLong()));
} else {
format = PostingsFormat.forName(TEST_POSTINGSFORMAT);
}
final DocValuesFormat dvFormat;
if ("random".equals(TEST_DOCVALUESFORMAT)) {
- // pick one from SPI
- List<String> formats = new ArrayList<String>(DocValuesFormat.availableDocValuesFormats());
- formats.remove("Facet42");
- dvFormat = DocValuesFormat.forName(formats.get(random.nextInt(formats.size())));
+ dvFormat = DocValuesFormat.forName("Lucene45");
} else {
dvFormat = DocValuesFormat.forName(TEST_DOCVALUESFORMAT);
}
- codec = new Lucene42Codec() {
+ codec = new Lucene46Codec() {
@Override
public PostingsFormat getPostingsFormatForField(String field) {
return format;
Modified: lucene/dev/branches/lucene4956/lucene/test-framework/src/java/org/apache/lucene/util/ThrottledIndexOutput.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/lucene/test-framework/src/java/org/apache/lucene/util/ThrottledIndexOutput.java?rev=1534320&r1=1534319&r2=1534320&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/lucene/test-framework/src/java/org/apache/lucene/util/ThrottledIndexOutput.java (original)
+++ lucene/dev/branches/lucene4956/lucene/test-framework/src/java/org/apache/lucene/util/ThrottledIndexOutput.java Mon Oct 21 18:58:24 2013
@@ -102,11 +102,13 @@ public class ThrottledIndexOutput extend
@Override
public void writeBytes(byte[] b, int offset, int length) throws IOException {
final long before = System.nanoTime();
+ // TODO: sometimes, write only half the bytes, then
+ // sleep, then 2nd half, then sleep, so we sometimes
+ // interrupt having only written not all bytes
delegate.writeBytes(b, offset, length);
timeElapsed += System.nanoTime() - before;
pendingBytes += length;
sleep(getDelay(false));
-
}
protected long getDelay(boolean closing) {
Modified: lucene/dev/branches/lucene4956/lucene/test-framework/src/java/org/apache/lucene/util/_TestUtil.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/lucene/test-framework/src/java/org/apache/lucene/util/_TestUtil.java?rev=1534320&r1=1534319&r2=1534320&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/lucene/test-framework/src/java/org/apache/lucene/util/_TestUtil.java (original)
+++ lucene/dev/branches/lucene4956/lucene/test-framework/src/java/org/apache/lucene/util/_TestUtil.java Mon Oct 21 18:58:24 2013
@@ -25,7 +25,6 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintStream;
-import java.lang.reflect.Method;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.nio.CharBuffer;
@@ -45,7 +44,8 @@ import java.util.zip.ZipFile;
import org.apache.lucene.codecs.Codec;
import org.apache.lucene.codecs.DocValuesFormat;
import org.apache.lucene.codecs.PostingsFormat;
-import org.apache.lucene.codecs.lucene42.Lucene42Codec;
+import org.apache.lucene.codecs.lucene46.Lucene46Codec;
+import org.apache.lucene.codecs.perfield.PerFieldDocValuesFormat;
import org.apache.lucene.codecs.perfield.PerFieldPostingsFormat;
import org.apache.lucene.document.BinaryDocValuesField;
import org.apache.lucene.document.Document;
@@ -70,7 +70,6 @@ import org.apache.lucene.index.DocsAndPo
import org.apache.lucene.index.DocsEnum;
import org.apache.lucene.index.FieldInfo.DocValuesType;
import org.apache.lucene.index.FieldInfos;
-import org.apache.lucene.index.IndexFileNames;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.IndexWriter;
import org.apache.lucene.index.IndexableField;
@@ -78,7 +77,8 @@ import org.apache.lucene.index.LogMergeP
import org.apache.lucene.index.MergePolicy;
import org.apache.lucene.index.MergeScheduler;
import org.apache.lucene.index.MultiFields;
-import org.apache.lucene.index.SegmentInfo;
+import org.apache.lucene.index.SegmentInfoPerCommit;
+import org.apache.lucene.index.SegmentReader;
import org.apache.lucene.index.Terms;
import org.apache.lucene.index.TermsEnum;
import org.apache.lucene.index.TieredMergePolicy;
@@ -87,9 +87,7 @@ import org.apache.lucene.search.Filtered
import org.apache.lucene.search.FilteredQuery.FilterStrategy;
import org.apache.lucene.search.ScoreDoc;
import org.apache.lucene.search.TopDocs;
-import org.apache.lucene.store.CompoundFileDirectory;
import org.apache.lucene.store.Directory;
-import org.apache.lucene.store.IOContext;
import org.junit.Assert;
import com.carrotsearch.randomizedtesting.RandomizedContext;
@@ -703,7 +701,7 @@ public class _TestUtil {
if (LuceneTestCase.VERBOSE) {
System.out.println("forcing postings format to:" + format);
}
- return new Lucene42Codec() {
+ return new Lucene46Codec() {
@Override
public PostingsFormat getPostingsFormatForField(String field) {
return format;
@@ -721,7 +719,7 @@ public class _TestUtil {
if (LuceneTestCase.VERBOSE) {
System.out.println("forcing docvalues format to:" + format);
}
- return new Lucene42Codec() {
+ return new Lucene46Codec() {
@Override
public DocValuesFormat getDocValuesFormatForField(String field) {
return format;
@@ -744,6 +742,28 @@ public class _TestUtil {
}
}
+ public static String getDocValuesFormat(String field) {
+ return getDocValuesFormat(Codec.getDefault(), field);
+ }
+
+ public static String getDocValuesFormat(Codec codec, String field) {
+ DocValuesFormat f = codec.docValuesFormat();
+ if (f instanceof PerFieldDocValuesFormat) {
+ return ((PerFieldDocValuesFormat) f).getDocValuesFormatForField(field).getName();
+ } else {
+ return f.getName();
+ }
+ }
+
+ // TODO: remove this, push this test to Lucene40/Lucene42 codec tests
+ public static boolean fieldSupportsHugeBinaryDocValues(String field) {
+ String dvFormat = getDocValuesFormat(field);
+ if (dvFormat.equals("Lucene40") || dvFormat.equals("Lucene42") || dvFormat.equals("Memory")) {
+ return false;
+ }
+ return true;
+ }
+
public static boolean anyFilesExceptWriteLock(Directory dir) throws IOException {
String[] files = dir.listAll();
if (files.length > 1 || (files.length == 1 && !files[0].equals("write.lock"))) {
@@ -788,19 +808,6 @@ public class _TestUtil {
});
Assert.assertEquals("Reflection does not produce same map", reflectedValues, map);
}
-
- public static void keepFullyDeletedSegments(IndexWriter w) {
- try {
- // Carefully invoke what is a package-private (test
- // only, internal) method on IndexWriter:
- Method m = IndexWriter.class.getDeclaredMethod("keepFullyDeletedSegments");
- m.setAccessible(true);
- m.invoke(w);
- } catch (Exception e) {
- // Should not happen?
- throw new RuntimeException(e);
- }
- }
/**
* insecure, fast version of File.createTempFile
@@ -990,27 +997,6 @@ public class _TestUtil {
}
}
- public static FieldInfos getFieldInfos(SegmentInfo info) throws IOException {
- Directory cfsDir = null;
- try {
- if (info.getUseCompoundFile()) {
- cfsDir = new CompoundFileDirectory(info.dir,
- IndexFileNames.segmentFileName(info.name, "", IndexFileNames.COMPOUND_FILE_EXTENSION),
- IOContext.READONCE,
- false);
- } else {
- cfsDir = info.dir;
- }
- return info.getCodec().fieldInfosFormat().getFieldInfosReader().read(cfsDir,
- info.name,
- IOContext.READONCE);
- } finally {
- if (info.getUseCompoundFile() && cfsDir != null) {
- cfsDir.close();
- }
- }
- }
-
/**
* Returns a valid (compiling) Pattern instance with random stuff inside. Be careful
* when applying random patterns to longer strings as certain types of patterns
Modified: lucene/dev/branches/lucene4956/lucene/test-framework/src/resources/META-INF/services/org.apache.lucene.codecs.Codec
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/lucene/test-framework/src/resources/META-INF/services/org.apache.lucene.codecs.Codec?rev=1534320&r1=1534319&r2=1534320&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/lucene/test-framework/src/resources/META-INF/services/org.apache.lucene.codecs.Codec (original)
+++ lucene/dev/branches/lucene4956/lucene/test-framework/src/resources/META-INF/services/org.apache.lucene.codecs.Codec Mon Oct 21 18:58:24 2013
@@ -21,3 +21,5 @@ org.apache.lucene.codecs.compressing.Hig
org.apache.lucene.codecs.compressing.dummy.DummyCompressingCodec
org.apache.lucene.codecs.lucene40.Lucene40RWCodec
org.apache.lucene.codecs.lucene41.Lucene41RWCodec
+org.apache.lucene.codecs.lucene42.Lucene42RWCodec
+org.apache.lucene.codecs.lucene45.Lucene45RWCodec
Modified: lucene/dev/branches/lucene4956/lucene/test-framework/src/resources/META-INF/services/org.apache.lucene.codecs.DocValuesFormat
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/lucene/test-framework/src/resources/META-INF/services/org.apache.lucene.codecs.DocValuesFormat?rev=1534320&r1=1534319&r2=1534320&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/lucene/test-framework/src/resources/META-INF/services/org.apache.lucene.codecs.DocValuesFormat (original)
+++ lucene/dev/branches/lucene4956/lucene/test-framework/src/resources/META-INF/services/org.apache.lucene.codecs.DocValuesFormat Mon Oct 21 18:58:24 2013
@@ -14,4 +14,4 @@
# limitations under the License.
org.apache.lucene.codecs.asserting.AssertingDocValuesFormat
-org.apache.lucene.codecs.cheapbastard.CheapBastardDocValuesFormat
\ No newline at end of file
+org.apache.lucene.codecs.lucene42.Lucene42RWDocValuesFormat
Modified: lucene/dev/branches/lucene4956/lucene/tools/clover/README.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/lucene/tools/clover/README.txt?rev=1534320&r1=1534319&r2=1534320&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/lucene/tools/clover/README.txt (original)
+++ lucene/dev/branches/lucene4956/lucene/tools/clover/README.txt Mon Oct 21 18:58:24 2013
@@ -2,6 +2,33 @@
DOCUMENTATION ABOUT ATLASSIAN CLOVER LICENSE
################################################
+From: sales@atlassian.com [mailto:sales@atlassian.com]
+Sent: Wednesday, September 25, 2013 5:09 PM
+To: uschindler@apache.org
+Cc: npellow@atlassian.com
+Subject: RE: Fwd: New Clover License for Apache - {844535}
+
+Hey Uwe,
+
+Thanks for getting back.
+I found the license using the key you provided - thanks for that! I've renewed the license for another year and added you as a technical contact.
+
+Cheers,
+Amber
+
+Clover 100+ Machines: Open Source License Apache 27 Jun 2014
+
+SEN: SEN-2304226
+Technical Contact: Mike Mccandless (mikemccand@apache.org), Uwe Schindler (uschindler@apache.org)
+Billing Contact: Mike Mccandless (mikemccand@apache.org)
+Licensed To: Apache
+
+History:
+27 Jun 2012 Purchase of Clover 100+ Machines: Open Source License
+27 Jun 2013 Maintenance Renewal
+
+---------------------------------------------------------------------------------
+
From: Nicholas Muldoon <nm...@atlassian.com>
To: Ted Yu <yu...@gmail.com>
Cc: Enis Soztutar <en...@hortonworks.com>, Todd Lipcon <to...@cloudera.com>
Modified: lucene/dev/branches/lucene4956/lucene/tools/clover/clover.license
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/lucene/tools/clover/clover.license?rev=1534320&r1=1534319&r2=1534320&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/lucene/tools/clover/clover.license (original)
+++ lucene/dev/branches/lucene4956/lucene/tools/clover/clover.license Mon Oct 21 18:58:24 2013
@@ -1,5 +1,5 @@
-RMnmmVojSVTAxfPXiUgnIWdgpmMJbqADeQonukSmgbVIhd
-mi2K<6pTN6gi825uWHxIERlJ2KvVSx3LOJtfGCJvZnLyCp
-qOPqVTPpPqNRmNomonNUXqmqqrrpQMNpNPuVuutwVsxspP
-MmonmqmUUnpqmspoummmmmUUnpqmspoummmmmUU1mXZebU
-Unmmmm
+QqmoPbdVEUcgqDDNWgbNgrmFKrQSasdXsuufEUsBgvsHPPt
+mj2L0B4rIl1r82LzJocSucWqS2K2IIB9aPO8MhfU3iB>x1Z
+PMNRSxMmqoqnmNnpmRmwWORpnRPrrQoPOoXuvuVvXxwuqoo
+mqnmqmUUnptonsuummmmmUUnptonsuummmmmUU1mXZebUUn
+mmmm
Modified: lucene/dev/branches/lucene4956/lucene/tools/custom-tasks.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/lucene/tools/custom-tasks.xml?rev=1534320&r1=1534319&r2=1534320&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/lucene/tools/custom-tasks.xml (original)
+++ lucene/dev/branches/lucene4956/lucene/tools/custom-tasks.xml Mon Oct 21 18:58:24 2013
@@ -39,11 +39,13 @@
<!-- Some typical snapshot/minimalized JAR suffixes. -->
<replaceregex pattern="-min$" replace="" flags="gi" />
- <replaceregex pattern="SNAPSHOT$" replace="" flags="gi" />
+ <replaceregex pattern="SNAPSHOT" replace="" flags="gi" />
<!-- Typical version patterns. -->
<replaceregex pattern="\.rc[0-9]+" replace="" flags="gi" />
- <replaceregex pattern="\-(r)?([0-9\-\_\.])+((b(eta)?)|((a(lpha)?))([0-9\-\.])*)?(\-tests)?$" replace="" flags="gi" />
+ <replaceregex pattern="\-(r)?([0-9\-\_\.])+(([a-zA-Z]+)([0-9\-\.])*)?" replace="" flags="gi" />
+
+ <replaceregex pattern="tests$" replace="-tests" flags="gi" />
<!-- git hashcode pattern: its always 40 chars right? -->
<replaceregex pattern="\-[a-z0-9]{40,40}$" replace="" flags="gi" />
@@ -57,7 +59,7 @@
<sequential>
<!-- LICENSE and NOTICE verification macro. -->
<echo>License check under: @{dir}</echo>
- <licenses licenseDirectory="@{licensedir}">
+ <licenses licenseDirectory="@{licensedir}" skipChecksum="${skipChecksum}" skipSnapshotsChecksum="${skipSnapshotsChecksum}">
<fileset dir="@{dir}">
<include name="**/*.jar" />
<!-- Speed up scanning a bit. -->
@@ -82,4 +84,29 @@
</licenses>
</sequential>
</macrodef>
+
+ <macrodef name="lib-versions-check-macro">
+ <attribute name="dir"/>
+ <attribute name="centralized.versions.file"/>
+ <sequential>
+ <!--
+ Verify that the '/org/name' keys in ivy-versions.properties are sorted
+ lexically and are neither duplicates nor orphans, and that all
+ dependencies in all ivy.xml files use rev="${/org/name}" format.
+ -->
+ <echo>Lib versions check under: @{dir}</echo>
+ <libversions centralizedVersionsFile="@{centralized.versions.file}">
+ <fileset dir="@{dir}">
+ <include name="**/ivy.xml" />
+ <!-- Speed up scanning a bit. -->
+ <exclude name="**/.git/**" />
+ <exclude name="**/.svn/**" />
+ <exclude name="**/bin/**" />
+ <exclude name="**/build/**" />
+ <exclude name="**/dist/**" />
+ <exclude name="**/src/**" />
+ </fileset>
+ </libversions>
+ </sequential>
+ </macrodef>
</project>
Modified: lucene/dev/branches/lucene4956/lucene/tools/src/java/lucene-solr.antlib.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/lucene/tools/src/java/lucene-solr.antlib.xml?rev=1534320&r1=1534319&r2=1534320&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/lucene/tools/src/java/lucene-solr.antlib.xml (original)
+++ lucene/dev/branches/lucene4956/lucene/tools/src/java/lucene-solr.antlib.xml Mon Oct 21 18:58:24 2013
@@ -18,4 +18,7 @@
<taskdef
name="licenses"
classname="org.apache.lucene.validation.LicenseCheckTask" />
+ <taskdef
+ name="libversions"
+ classname="org.apache.lucene.validation.LibVersionsCheckTask" />
</antlib>
Modified: lucene/dev/branches/lucene4956/lucene/tools/src/java/org/apache/lucene/validation/LicenseCheckTask.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/lucene/tools/src/java/org/apache/lucene/validation/LicenseCheckTask.java?rev=1534320&r1=1534319&r2=1534320&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/lucene/tools/src/java/org/apache/lucene/validation/LicenseCheckTask.java (original)
+++ lucene/dev/branches/lucene4956/lucene/tools/src/java/org/apache/lucene/validation/LicenseCheckTask.java Mon Oct 21 18:58:24 2013
@@ -54,6 +54,9 @@ public class LicenseCheckTask extends Ta
private static final int CHECKSUM_BUFFER_SIZE = 8 * 1024;
private static final int CHECKSUM_BYTE_MASK = 0xFF;
+ private boolean skipSnapshotsChecksum;
+ private boolean skipChecksum;
+
/**
* All JAR files to check.
*/
@@ -103,6 +106,14 @@ public class LicenseCheckTask extends Ta
public void setLicenseDirectory(File file) {
licenseDirectory = file;
}
+
+ public void setSkipSnapshotsChecksum(boolean skipSnapshotsChecksum) {
+ this.skipSnapshotsChecksum = skipSnapshotsChecksum;
+ }
+
+ public void setSkipChecksum(boolean skipChecksum) {
+ this.skipChecksum = skipChecksum;
+ }
/**
* Execute the task.
@@ -113,6 +124,12 @@ public class LicenseCheckTask extends Ta
throw new BuildException("Expected an embedded <licenseMapper>.");
}
+ if (skipChecksum) {
+ log("Skipping checksum verification for dependencies", Project.MSG_INFO);
+ } else if (skipSnapshotsChecksum) {
+ log("Skipping checksum for SNAPSHOT dependencies", Project.MSG_INFO);
+ }
+
jarResources.setProject(getProject());
processJars();
@@ -160,48 +177,60 @@ public class LicenseCheckTask extends Ta
*/
private boolean checkJarFile(File jarFile) {
log("Scanning: " + jarFile.getPath(), verboseLevel);
-
- // validate the jar matches against our expected hash
- final File checksumFile = new File(licenseDirectory,
- jarFile.getName() + "." + CHECKSUM_TYPE);
- if (! (checksumFile.exists() && checksumFile.canRead()) ) {
- log("MISSING " +CHECKSUM_TYPE+ " checksum file for: " + jarFile.getPath(), Project.MSG_ERR);
- this.failures = true;
- return false;
- } else {
- final String expectedChecksum = readChecksumFile(checksumFile);
- try {
- final MessageDigest md = MessageDigest.getInstance(CHECKSUM_TYPE);
- byte[] buf = new byte[CHECKSUM_BUFFER_SIZE];
- try {
- FileInputStream fis = new FileInputStream(jarFile);
+
+ if (!skipChecksum) {
+ if (!skipSnapshotsChecksum || !jarFile.getName().contains("-SNAPSHOT")) {
+ // validate the jar matches against our expected hash
+ final File checksumFile = new File(licenseDirectory, jarFile.getName()
+ + "." + CHECKSUM_TYPE);
+ if (!(checksumFile.exists() && checksumFile.canRead())) {
+ log("MISSING " + CHECKSUM_TYPE + " checksum file for: "
+ + jarFile.getPath(), Project.MSG_ERR);
+ log("EXPECTED " + CHECKSUM_TYPE + " checksum file : "
+ + checksumFile.getPath(), Project.MSG_ERR);
+ this.failures = true;
+ return false;
+ } else {
+ final String expectedChecksum = readChecksumFile(checksumFile);
try {
- DigestInputStream dis = new DigestInputStream(fis, md);
+ final MessageDigest md = MessageDigest.getInstance(CHECKSUM_TYPE);
+ byte[] buf = new byte[CHECKSUM_BUFFER_SIZE];
try {
- while (dis.read(buf, 0, CHECKSUM_BUFFER_SIZE) != -1) {
- // NOOP
+ FileInputStream fis = new FileInputStream(jarFile);
+ try {
+ DigestInputStream dis = new DigestInputStream(fis, md);
+ try {
+ while (dis.read(buf, 0, CHECKSUM_BUFFER_SIZE) != -1) {
+ // NOOP
+ }
+ } finally {
+ dis.close();
+ }
+ } finally {
+ fis.close();
}
- } finally {
- dis.close();
+ } catch (IOException ioe) {
+ throw new BuildException("IO error computing checksum of file: "
+ + jarFile, ioe);
}
- } finally {
- fis.close();
+ final byte[] checksumBytes = md.digest();
+ final String checksum = createChecksumString(checksumBytes);
+ if (!checksum.equals(expectedChecksum)) {
+ log("CHECKSUM FAILED for " + jarFile.getPath() + " (expected: \""
+ + expectedChecksum + "\" was: \"" + checksum + "\")",
+ Project.MSG_ERR);
+ this.failures = true;
+ return false;
+ }
+
+ } catch (NoSuchAlgorithmException ae) {
+ throw new BuildException("Digest type " + CHECKSUM_TYPE
+ + " not supported by your JVM", ae);
}
- } catch (IOException ioe) {
- throw new BuildException("IO error computing checksum of file: " + jarFile, ioe);
}
- final byte[] checksumBytes = md.digest();
- final String checksum = createChecksumString(checksumBytes);
- if ( ! checksum.equals(expectedChecksum) ) {
- log("CHECKSUM FAILED for " + jarFile.getPath() +
- " (expected: \"" + expectedChecksum + "\" was: \"" + checksum + "\")",
- Project.MSG_ERR);
- this.failures = true;
- return false;
- }
-
- } catch (NoSuchAlgorithmException ae) {
- throw new BuildException("Digest type " + CHECKSUM_TYPE + " not supported by your JVM", ae);
+ } else if (skipSnapshotsChecksum) {
+ log("Skipping jar because it is a SNAPSHOT : "
+ + jarFile.getAbsolutePath(), Project.MSG_INFO);
}
}
Modified: lucene/dev/branches/lucene4956/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/CHANGES.txt?rev=1534320&r1=1534319&r2=1534320&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/CHANGES.txt (original)
+++ lucene/dev/branches/lucene4956/solr/CHANGES.txt Mon Oct 21 18:58:24 2013
@@ -33,8 +33,13 @@ Apache ZooKeeper 3.4.5
Upgrading from Solr 4.x
----------------------
-The "file" attribute of infoStream in solrconfig.xml is removed. Control this
-via your logging configuration (org.apache.solr.update.LoggingInfoStream) instead.
+* The "file" attribute of infoStream in solrconfig.xml is removed. Control this
+ via your logging configuration (org.apache.solr.update.LoggingInfoStream) instead.
+
+* UniqFieldsUpdateProcessorFactory no longer supports the <lst named="fields"> init
+ param style that was deprecated in Solr 4.5. If you are still using this syntax,
+ update your configs to use <arr name="fieldName"> instead. See SOLR-4249 for more
+ details.
Detailed Change List
----------------------
@@ -47,6 +52,184 @@ Other Changes
* SOLR-4792: Stop shipping a .war. (Robert Muir)
+================== 4.6.0 ==================
+
+Versions of Major Components
+---------------------
+Apache Tika 1.4
+Carrot2 3.8.0
+Velocity 1.7 and Velocity Tools 2.0
+Apache UIMA 2.3.1
+Apache ZooKeeper 3.4.5
+
+Detailed Change List
+----------------------
+
+Upgrading from Solr 4.5.0
+----------------------
+
+* If you are using methods from FieldMutatingUpdateProcessorFactory for getting
+ configuration information (oneOrMany or getBooleanArg), those methods have
+ been moved to NamedList and renamed to removeConfigArgs and removeBooleanArg,
+ respectively. The original methods are deprecated, to be removed in 5.0.
+ See SOLR-5264.
+
+New Features
+----------------------
+
+* SOLR-5167: Add support for AnalyzingInfixSuggester (AnalyzingInfixLookupFactory).
+ (Areek Zillur, Varun Thacker via Robert Muir)
+
+* SOLR-5246: Shard splitting now supports collections configured with router.field.
+ (shalin)
+
+* SOLR-5274: Allow JettySolrRunner SSL config to be specified via a constructor.
+ (Mark Miller)
+
+* SOLR-5300: Shards can be split by specifying arbitrary number of hash ranges
+ within the shard's hash range. (shalin)
+
+* SOLR-5226: Add Lucene index heap usage to the Solr admin UI.
+ (Areek Zillur via Robert Muir)
+
+* SOLR-5324: Make sub shard replica recovery and shard state switch asynchronous.
+ (Yago Riveiro, shalin)
+
+* SOLR-5338: Split shards by a route key using split.key parameter. (shalin)
+
+* SOLR-5353: Enhance CoreAdmin api to split a route key's documents from an index
+ and leave behind all other documents. (shalin)
+
+Bug Fixes
+----------------------
+
+* SOLR-5216: Document updates to SolrCloud can cause a distributed deadlock.
+ (Mark Miller)
+
+* SOLR-5367: Unmarshalling delete by id commands with JavaBin can lead to class cast
+ exception. (Mark Miller)
+
+* SOLR-5359: ZooKeeper client is not closed when it fails to connect to an ensemble.
+ (Mark Miller, Klaus Herrmann)
+
+* SOLR-5042: MoreLikeThisComponent was using the rows/count value in place of
+ flags, which caused a number of very strange issues, including NPEs and
+ ignoring requests for the results to include the score.
+ (Anshum Gupta, Mark Miller, Shawn Heisey)
+
+* SOLR-5371: Solr should consistently call SolrServer#shutdown (Mark Miller)
+
+Optimizations
+----------------------
+
+* SOLR-5232: SolrCloud should distribute updates via streaming rather than buffering.
+ (Mark Miller)
+
+* SOLR-5223: SolrCloud should use the JavaBin binary format for communication by default.
+ (Mark Miller)
+
+* SOLR-5370: Requests to recover when an update fails should be done in
+ background threads. (Mark Miller)
+
+Security
+----------------------
+
+* SOLR-4882: SolrResourceLoader was restricted to only allow access to resource
+ files below the instance dir. The reason for this is security related: Some
+ Solr components allow to pass in resource paths via REST parameters
+ (e.g. XSL stylesheets, velocity templates,...) and load them via resource
+ loader. For backwards compatibility, this security feature can be disabled
+ by a new system property: solr.allow.unsafe.resourceloading=true
+ (Uwe Schindler)
+
+Other Changes
+----------------------
+
+* SOLR-5237: Add indexHeapUsageBytes to LukeRequestHandler, indicating how much
+ heap memory is being used by the underlying Lucene index structures.
+ (Areek Zillur via Robert Muir)
+
+* SOLR-5241: Fix SimplePostToolTest performance problem - implicit DNS lookups
+ (hossman)
+
+* SOLR-5273: Update HttpComponents to 4.2.5 and 4.2.6. (Mark Miller)
+
+* SOLR-5264: Move methods for getting config information from
+ FieldMutatingUpdateProcessorFactory to NamedList. (Shawn Heisey)
+
+* SOLR-5319: Remove unused and incorrect router name from Collection ZK nodes.
+ (Jessica Cheng via shalin)
+
+* SOLR-5321: Remove unnecessary code in Overseer.updateState method which tries to
+ use router name from message where none is ever sent. (shalin)
+
+================== 4.5.1 ==================
+
+Versions of Major Components
+---------------------
+Apache Tika 1.4
+Carrot2 3.8.0
+Velocity 1.7 and Velocity Tools 2.0
+Apache UIMA 2.3.1
+Apache ZooKeeper 3.4.5
+
+Detailed Change List
+----------------------
+
+Bug Fixes
+----------------------
+
+* SOLR-4590: Collections API should return a nice error when not in SolrCloud mode.
+ (Anshum Gupta, Mark Miller)
+
+* SOLR-5295: The CREATESHARD collection API creates maxShardsPerNode number of
+ replicas if replicationFactor is not specified. (Brett Hoerner, shalin)
+
+* SOLR-5296: Creating a collection with implicit router adds shard ranges
+ to each shard. (shalin)
+
+* SOLR-5263: Fix CloudSolrServer URL cache update race. (Jessica Cheng, Mark Miller)
+
+* SOLR-5297: Admin UI - Threads Screen missing Icon (steffkes)
+
+* SOLR-5301: DELETEALIAS command prints CREATEALIAS in logs (janhoy)
+
+* SOLR-5255: Remove unnecessary call to fetch and watch live nodes in ZkStateReader
+ cluster watcher. (Jessica Cheng via shalin)
+
+* SOLR-5305: Admin UI - Reloading System-Information on Dashboard does not work
+ anymore (steffkes)
+
+* SOLR-5314: Shard split action should use soft commits instead of hard commits
+ to make sub shard data visible. (Kalle Aaltonen, shalin)
+
+* SOLR-5327: SOLR-4915, "The root cause should be returned to the user when a SolrCore create
+ call fails", was reverted. (Mark Miller)
+
+* SOLR-5317: SolrCore persistence bugs if defining SolrCores in solr.xml.
+ (Mark Miller, Yago Riveiro)
+
+ * SOLR-5306: Extra collection creation parameters like collection.configName are
+ not being respected. (Mark Miller, Liang Tianyu, Nathan Neulinger)
+
+* SOLR-5325: ZooKeeper connection loss can cause the Overseer to stop processing
+ commands. (Christine Poerschke, Mark Miller, Jessica Cheng)
+
+* SOLR-4327: HttpSolrServer can leak connections on errors. (Karl Wright, Mark Miller)
+
+* SOLR-5349: CloudSolrServer - ZK timeout arguments passed to ZkStateReader are flipped.
+ (Ricardo Merizalde via shalin)
+
+* SOLR-5330: facet.method=fcs on single values fields could sometimes result
+ in incorrect facet labels. (Michael Froh, yonik)
+
+
+Other Changes
+----------------------
+
+* SOLR-5323: Disable ClusteringComponent by default in collection1 example.
+ The solr.clustering.enabled system property needs to be set to 'true'
+ to enable the clustering contrib (reverts SOLR-4708). (Dawid Weiss)
================== 4.5.0 ==================
@@ -66,9 +249,32 @@ Upgrading from Solr 4.4.0
would be chosen arbitrarily and silently. Starting with 4.5, configuration
parsing will fail with an error in situations like this. If you see error
messages such as "solrconfig.xml contains more than one value for config path:
- indexConfig/infoStream" check your solrconfig.xml file for multiple occurrences
- of "infoStream" and delete the one that you do not wish to use. See SOLR-4953
- for more details.
+ XXXXX" or "Found Z configuration sections when at most 1 is allowed matching
+ expression: XXXXX" check your solrconfig.xml file for multiple occurrences of
+ XXXXX and delete the ones that you do not wish to use. See SOLR-4953 &
+ SOLR-5108 for more details.
+
+* In the past, schema.xml parsing would silently ignore "default" or "required"
+ options specified on <dynamicField/> declarations. Begining with 4.5, attempting
+ to do configured these on a dynamic field will cause an init error. If you
+ encounter one of these errors when upgrading an existing schema.xml, you can
+ safely remove these attributes, regardless of their value, from your config and
+ Solr will continue to bahave exactly as it did in previous versions. See
+ SOLR-5227 for more details.
+
+* The UniqFieldsUpdateProcessorFactory has been improved to support all of the
+ FieldMutatingUpdateProcessorFactory selector options. The <lst named="fields">
+ init param option is now deprecated and should be replaced with the more standard
+ <arr name="fieldName">. See SOLR-4249 for more details.
+
+* UpdateRequestExt has been removed as part of SOLR-4816. You should use UpdateRequest
+ instead.
+
+* CloudSolrServer can now use multiple threads to add documents by default. This is a
+ small change in runtime semantics when using the bulk add method - you will still
+ end up with the same exception on a failure, but some documents beyond the one that
+ failed may have made it in. To get the old, single threaded behavior, set parallel updates
+ to false on the CloudSolrServer instance.
Detailed Change List
----------------------
@@ -76,6 +282,12 @@ Detailed Change List
New Features
----------------------
+* SOLR-5219: Rewritten selection of the default search and document clustering
+ algorithms. (Dawid Weiss)
+
+* SOLR-5202: Support easier overrides of Carrot2 clustering attributes via
+ XML data sets exported from the Workbench. (Dawid Weiss)
+
* SOLR-5126: Update Carrot2 clustering to version 3.8.0, update Morfologik
to version 1.7.1 (Dawid Weiss)
@@ -86,12 +298,43 @@ New Features
* SOLR-5082: The encoding of URL-encoded query parameters can be changed with
the "ie" (input encoding) parameter, e.g. "select?q=m%FCller&ie=ISO-8859-1".
The default is UTF-8. To change the encoding of POSTed content, use the
- "Content-Type" HTTP header. (Uwe Schindler, David Smiley)
+ "Content-Type" HTTP header. (Uwe Schindler, Shawn Heisey)
+
* SOLR-4221: Custom sharding (Noble Paul)
-* SOLR-4808: Persist and use router,replicationFactor and maxShardsPerNode at Collection and Shard level (Noble Paul, Shalin Mangar)
+
+* SOLR-4808: Persist and use router,replicationFactor and maxShardsPerNode at Collection
+ and Shard level (Noble Paul, Shalin Mangar)
+
* SOLR-5006: CREATESHARD command for 'implicit' shards (Noble Paul)
+
* SOLR-5017: Allow sharding based on the value of a field (Noble Paul)
-* SOLR-4222:create custom sharded collection via collections API (Noble Paul)
+
+* SOLR-4222: create custom sharded collection via collections API (Noble Paul)
+
+* SOLR-4718: Allow solr.xml to be stored in ZooKeeper. (Mark Miller, Erick Erickson)
+
+* SOLR-5156: Enhance ZkCLI to allow uploading of arbitrary files to ZK. (Erick Erickson)
+
+* SOLR-5165: Single-valued docValues fields no longer require a default value.
+ Additionally they work with sortMissingFirst, sortMissingLast, facet.missing,
+ exists() in function queries, etc. (Robert Muir)
+
+* SOLR-5182: Add NoOpRegenerator, a regenerator for custom per-segment caches
+ where items are preserved across commits. (Robert Muir)
+
+* SOLR-4249: UniqFieldsUpdateProcessorFactory now extends
+ FieldMutatingUpdateProcessorFactory and supports all of it's selector options. Use
+ of the "fields" init param is now deprecated in favor of "fieldName" (hossman)
+
+* SOLR-2548: Allow multiple threads to be specified for faceting. When threading, one
+ can specify facet.threads to parallelize loading the uninverted fields. In at least
+ one extreme case this reduced warmup time from 20 seconds to 3 seconds. (Janne Majaranta,
+ Gun Akkor via Erick Erickson, David Smiley)
+
+* SOLR-4816: CloudSolrServer can now route updates locally and no longer relies on inter-node
+ update forwarding. (Joel Bernstein, Shikhar Bhushan, Stephen Riesenberg, Mark Miller)
+
+* SOLR-3249: Allow CloudSolrServer and SolrCmdDistributor to use JavaBin. (Mark Miller)
Bug Fixes
----------------------
@@ -116,6 +359,79 @@ Bug Fixes
* SOLR-5119: Managed schema problems after adding fields via Schema Rest API.
(Nils Kübler, Steve Rowe)
+
+* SOLR-5133: HdfsUpdateLog can fail to close a FileSystem instance if init
+ is called more than once. (Mark Miller)
+
+* SOLR-5135: Harden Collection API deletion of /collections/$collection
+ ZooKeeper node. (Mark Miller)
+
+* SOLR-4764: When using NRT, just init the first reader from IndexWriter.
+ (Robert Muir, Mark Miller)
+
+* SOLR-5122: Fixed bug in spellcheck.collateMaxCollectDocs. Eliminates risk
+ of divide by zero, and makes estimated hit counts meaningful in non-optimized
+ indexes. (hossman)
+
+* SOLR-3936: Fixed QueryElevationComponent sorting when used with Grouping
+ (Michael Garski via hossman)
+
+* SOLR-5171: SOLR Admin gui works in IE9, breaks in IE10. (Joseph L Howard via
+ steffkes)
+
+* SOLR-5174: Admin UI - Query View doesn't highlight (json) Result if it
+ contains HTML Tags (steffkes)
+
+* SOLR-4817 Solr should not fall back to the back compat built in solr.xml in SolrCloud
+ mode (Erick Erickson)
+
+* SOLR-5112: Show full message in Admin UI Logging View (Matthew Keeney via
+ steffkes)
+
+* SOLR-5190: SolrEntityProcessor substitutes variables only once in child entities
+ (Harsh Chawla, shalin)
+
+* SOLR-3852: Fixed ZookeeperInfoServlet so that the SolrCloud Admin UI pages will
+ work even if ZK contains nodes with data which are not utf8 text. (hossman)
+
+* SOLR-5206: Fixed OpenExchangeRatesOrgProvider to use refreshInterval correctly
+ (Catalin, hossman)
+
+* SOLR-5215: Fix possibility of deadlock in ZooKeeper ConnectionManager.
+ (Mark Miller, Ricardo Merizalde)
+
+* SOLR-4909: Use DirectoryReader.openIfChanged in non-NRT mode.
+ (Michael Garski via Robert Muir)
+
+* SOLR-5227: Correctly fail schema initalization if a dynamicField is configured to
+ be required, or have a default value. (hossman)
+
+* SOLR-5231: Fixed a bug with the behavior of BoolField that caused documents w/o
+ a value for the field to act as if the value were true in functions if no other
+ documents in the same index segment had a value of true.
+ (Robert Muir, hossman, yonik)
+
+* SOLR-5233: The "deleteshard" collections API doesn't wait for cluster state to update,
+ can fail if some nodes of the deleted shard were down and had incorrect logging.
+ (Christine Poerschke, shalin)
+
+* SOLR-5150: HdfsIndexInput may not fully read requested bytes. (Mark Miller, Patrick Hunt)
+
+* SOLR-5240: All solr cores will now be loaded in parallel (as opposed to a fixed number)
+ in zookeeper mode to avoid deadlocks due to replicas waiting for other replicas
+ to come up. (yonik)
+
+* SOLR-5243: Killing a shard in one collection can result in leader election in a different
+ collection if they share the same coreNodeName. (yonik, Mark Miller)
+
+* SOLR-5281: IndexSchema log message was printing '[null]' instead of
+ '[<core name>]' (Jun Ohtani via Steve Rowe)
+
+* SOLR-5279: Implicit properties don't seem to exist on core RELOAD
+ (elyograg, hossman, Steve Rowe)
+
+* SOLR-5291: Solrj does not propagate the root cause to the user for many errors.
+ (Mark Miller)
Optimizations
----------------------
@@ -123,6 +439,16 @@ Optimizations
* SOLR-5044: Admin UI - Note on Core-Admin about directories while creating
core (steffkes)
+* SOLR-5134: Have HdfsIndexOutput extend BufferedIndexOutput.
+ (Mark Miller, Uwe Schindler)
+
+ * SOLR-5057: QueryResultCache should not related with the order of fq's list (Feihong Huang via Erick Erickson)
+
+* SOLR-4816: CloudSolrServer now uses multiple threads to send updates by default.
+ (Joel Bernstein via Mark Miller)
+
+* SOLR-3530: Better error messages / Content-Type validation in SolrJ. (Mark Miller, hossman)
+
Other Changes
----------------------
@@ -130,19 +456,23 @@ Other Changes
The solr.clustering.enabled system property is set to 'true' by default.
(ehatcher, Dawid Weiss)
-* SOLR-4914: Factor out core list persistence and discovery into a
- new CoresLocator interface. (Alan Woodward)
+* SOLR-4914, SOLR-5162: Factor out core list persistence and discovery into a
+ new CoresLocator interface. (Alan Woodward, Shawn Heisey)
* SOLR-5056: Improve type safety of ConfigSolr class. (Alan Woodward)
* SOLR-4951: Better randomization of MergePolicy in Solr tests (hossman)
-* SOLR-4953: Make XML Configuration parsing fail if an xpath matches multiple
- nodes when only a single value is expected. (hossman)
+* SOLR-4953, SOLR-5108: Make XML Configuration parsing fail if an xpath matches
+ multiple nodes when only a single value or plugin instance is expected.
+ (hossman)
* The routing parameter "shard.keys" is deprecated as part of SOLR-5017 .The new parameter name is '_route_' .
The old parameter should continue to work for another release (Noble Paul)
+* SOLR-5173: Solr-core's Maven configuration includes test-only Hadoop
+ dependencies as indirect compile-time dependencies.
+ (Chris Collins, Steve Rowe)
================== 4.4.0 ==================
Modified: lucene/dev/branches/lucene4956/solr/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/build.xml?rev=1534320&r1=1534319&r2=1534320&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/build.xml (original)
+++ lucene/dev/branches/lucene4956/solr/build.xml Mon Oct 21 18:58:24 2013
@@ -176,6 +176,14 @@
<target name="jar" depends="jar-core,jar-solrj,jar-solr-test-framework,jar-contrib"
description="Jar solr core, solrj, solr-test-framework, and all contribs"/>
+ <target name="jar-src"
+ description="Create source jars for solr core, solrj, solr-test-framework, and all contribs">
+ <ant dir="core" target="jar-src" inheritAll="false"/>
+ <ant dir="solrj" target="jar-src" inheritAll="false"/>
+ <ant dir="test-framework" target="jar-src" inheritAll="false"/>
+ <contrib-crawl target="jar-src"/>
+ </target>
+
<!-- Solr core targets -->
<target name="test-solr-core" description="Test solr core">
<ant dir="core" target="test" inheritAll="false">
@@ -274,10 +282,11 @@
</target>
<target name="-check-forbidden-java-apis">
+ <property file="${common.dir}/ivy-versions.properties"/> <!-- for commons-io version -->
<forbidden-apis internalRuntimeForbidden="true" classpathref="forbidden-apis.classpath" failOnMissingClasses="false">
<bundledSignatures name="jdk-unsafe-${javac.target}"/>
<bundledSignatures name="jdk-deprecated-${javac.target}"/>
- <bundledSignatures name="commons-io-unsafe-${commons-io.version}"/>
+ <bundledSignatures name="commons-io-unsafe-${/commons-io/commons-io}"/>
<signaturesFileSet dir="${common.dir}/tools/forbiddenApis">
<include name="base.txt" />
<include name="servlet-api.txt" />
@@ -456,8 +465,14 @@
</target>
<target name="create-package"
- description="Packages the Solr Binary Distribution"
- depends="init-dist, dist, example, documentation">
+ description="Packages the Solr Binary Distribution">
+ <antcall inheritall="true">
+ <param name="called.from.create-package" value="true"/>
+ <target name="init-dist"/>
+ <target name="dist"/>
+ <target name="example"/>
+ <target name="documentation"/>
+ </antcall>
<mkdir dir="${dest}/${fullnamever}"/>
<delete includeemptydirs="true">
<fileset dir="${example}/solr-webapp" includes="**/*"/>
@@ -475,10 +490,9 @@
<tarfileset dir="."
prefix="${fullnamever}"
includes="LICENSE.txt NOTICE.txt CHANGES.txt README.txt SYSTEM_REQUIREMENTS.txt
- example/** client/README.txt client/ruby/solr-ruby/**
- contrib/**/lib/** contrib/**/README.txt
+ example/** contrib/**/lib/** contrib/**/README.txt
licenses/**"
- excludes="lib/README.committers.txt **/data/ **/logs/*
+ excludes="licenses/README.committers.txt **/data/ **/logs/*
**/classes/ **/*.sh **/ivy.xml **/build.xml
**/bin/ **/*.iml **/*.ipr **/*.iws **/pom.xml
**/*pom.xml.template" />
Modified: lucene/dev/branches/lucene4956/solr/common-build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/common-build.xml?rev=1534320&r1=1534319&r2=1534320&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/common-build.xml (original)
+++ lucene/dev/branches/lucene4956/solr/common-build.xml Mon Oct 21 18:58:24 2013
@@ -44,8 +44,26 @@
<property name="changes.target.dir" location="${dest}/docs/changes"/>
<property name="license.dir" location="${common-solr.dir}/licenses"/>
+ <property name="solr.tgz.unpack.dir" location="${common-solr.dir}/build/solr.tgz.unpacked"/>
+ <property name="dist.jar.dir.prefix" value="${solr.tgz.unpack.dir}/solr"/>
+ <property name="dist.jar.dir.suffix" value="dist"/>
+
<import file="${common-solr.dir}/../lucene/module-build.xml"/>
+ <property name="solr.tgz.file" location="${common-solr.dir}/package/solr-${version}.tgz"/>
+ <available file="${solr.tgz.file}" property="solr.tgz.exists"/>
+ <available type="dir" file="${solr.tgz.unpack.dir}" property="solr.tgz.unpack.dir.exists"/>
+ <target name="-ensure-solr-tgz-exists" unless="solr.tgz.exists">
+ <ant dir="${common-solr.dir}" target="create-package" inheritall="false"/>
+ </target>
+ <target name="-unpack-solr-tgz" unless="${solr.tgz.unpack.dir.exists}">
+ <antcall target="-ensure-solr-tgz-exists"/>
+ <mkdir dir="${solr.tgz.unpack.dir}"/>
+ <untar compression="gzip" src="${solr.tgz.file}" dest="${solr.tgz.unpack.dir}">
+ <patternset refid="patternset.lucene.solr.jars"/>
+ </untar>
+ </target>
+
<!-- backwards compatibility with existing targets/tasks; TODO: remove this! -->
<property name="fullnamever" value="${final.name}"/>
@@ -57,10 +75,6 @@
<fileset dir="lib" excludes="${common.classpath.excludes}" erroronmissingdir="false"/>
</path>
- <!-- defined here to be able to make the forbidden-api checker correctly
- reference it. 'ivy.xml' is also referencing this property. -->
- <property name="commons-io.version" value="2.1" />
-
<path id="solr.lucene.libs">
<!-- List of jars that will be used as the foundation for both
the base classpath, as well as copied into the lucene-libs dir
@@ -147,19 +161,33 @@
<property name="solr.deps.compiled" value="true"/>
</target>
- <target name="lucene-jars-to-solr" depends="prep-lucene-jars">
- <!-- TODO: clean this up -->
+ <target name="lucene-jars-to-solr"
+ depends="-lucene-jars-to-solr-not-for-package,-lucene-jars-to-solr-package"/>
+
+ <target name="-lucene-jars-to-solr-not-for-package" unless="called.from.create-package">
<sequential>
- <ant dir="${common.dir}" target="default" inheritall="false">
- <propertyset refid="uptodate.and.compiled.properties"/>
- </ant>
- <copy todir="${lucene-libs}" preservelastmodified="true" flatten="true" failonerror="true" overwrite="true">
- <path refid="solr.lucene.libs" />
- <!-- NOTE: lucene-core is not already included in "solr.lucene.libs"
- because of it's use in classpaths.
- -->
- <fileset file="${lucene-core.jar}" />
- </copy>
+ <antcall target="prep-lucene-jars" inheritall="true"/>
+ <property name="solr.deps.compiled" value="true"/>
+ <copy todir="${lucene-libs}" preservelastmodified="true" flatten="true" failonerror="true" overwrite="true">
+ <path refid="solr.lucene.libs" />
+ <!-- NOTE: lucene-core is not already included in "solr.lucene.libs" because of its use in classpaths. -->
+ <fileset file="${lucene-core.jar}" />
+ </copy>
+ </sequential>
+ </target>
+
+ <target name="-lucene-jars-to-solr-package" if="called.from.create-package">
+ <sequential>
+ <antcall target="-unpack-lucene-tgz" inheritall="true"/>
+ <pathconvert property="relative.solr.lucene.libs" pathsep=",">
+ <path refid="solr.lucene.libs"/>
+ <fileset file="${lucene-core.jar}"/>
+ <globmapper from="${common.build.dir}/*" to="*" handledirsep="true"/>
+ </pathconvert>
+ <mkdir dir="${lucene-libs}"/>
+ <copy todir="${lucene-libs}" preservelastmodified="true" flatten="true" failonerror="true" overwrite="true">
+ <fileset dir="${lucene.tgz.unpack.dir}/lucene-${version}" includes="${relative.solr.lucene.libs}"/>
+ </copy>
</sequential>
</target>
@@ -285,7 +313,7 @@
</macrodef>
<target name="define-lucene-javadoc-url" depends="resolve-groovy" unless="lucene.javadoc.url">
- <script language="groovy" classpathref="groovy.classpath"><![CDATA[
+ <groovy><![CDATA[
String url, version = project.getProperty('version');
if (version.contains('-SNAPSHOT')) {
url = new File(project.getProperty('common.dir'), 'build' + File.separator + 'docs').toURI().toASCIIString();
@@ -294,13 +322,18 @@
version = version.replace('.', '_');
url = 'http://lucene.apache.org/core/' + version + '/';
}
- self.log('Using the following URL to refer to Lucene Javadocs: ' + url);
+ task.log('Using the following URL to refer to Lucene Javadocs: ' + url);
project.setProperty('lucene.javadoc.url', url);
- ]]></script>
+ ]]></groovy>
</target>
- <target name="jar-src" depends="init">
- <solr-jarify basedir="${src.dir}" destfile="${build.dir}/${final.name}-src.jar"/>
+ <target name="jar-src">
+ <sequential>
+ <mkdir dir="${build.dir}"/>
+ <solr-jarify basedir="${src.dir}" destfile="${build.dir}/${final.name}-src.jar">
+ <fileset dir="${resources.dir}" erroronmissingdir="no"/>
+ </solr-jarify>
+ </sequential>
</target>
<target name="m2-deploy-solr-parent-pom" depends="filter-pom-templates"
@@ -310,10 +343,10 @@
</target>
<target name="dist-maven"
- depends="filter-pom-templates, install-maven-tasks, m2-deploy-solr-parent-pom, dist-maven-common"/>
+ depends="filter-pom-templates, install-maven-tasks, m2-deploy-solr-parent-pom, -unpack-solr-tgz, dist-maven-common"/>
<target name="dist-maven-src-java"
- depends="filter-pom-templates, install-maven-tasks, m2-deploy-solr-parent-pom, dist-maven-common-src-java"/>
+ depends="filter-pom-templates, install-maven-tasks, m2-deploy-solr-parent-pom, -unpack-solr-tgz, dist-maven-common-src-java"/>
<target name="-validate-maven-dependencies" depends="-validate-maven-dependencies.init">
<m2-validate-dependencies pom.xml="${maven.pom.xml}" licenseDirectory="${license.dir}">
Modified: lucene/dev/branches/lucene4956/solr/contrib/analysis-extras/README.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/contrib/analysis-extras/README.txt?rev=1534320&r1=1534319&r2=1534320&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/contrib/analysis-extras/README.txt (original)
+++ lucene/dev/branches/lucene4956/solr/contrib/analysis-extras/README.txt Mon Oct 21 18:58:24 2013
@@ -4,16 +4,13 @@ upon large dependencies/dictionaries.
It includes integration with ICU for multilingual support, and
analyzers for Chinese and Polish.
-Relies upon the following lucene components (in lucene-libs/):
+ICU relies upon lucene-libs/lucene-analyzers-icu-X.Y.jar
+and lib/icu4j-X.Y.jar
- * lucene-analyzers-icu-X.Y.jar
- * lucene-analyzers-smartcn-X.Y.jar
- * lucene-analyzers-stempel-X.Y.jar
- * lucene-analyzers-morfologik-X.Y.jar
- * lucene-analyzers-smartcn-X.Y.jar
+Smartcn relies upon lucene-libs/lucene-analyzers-smartcn-X.Y.jar
-And the following third-party library (in lib/):
+Stempel relies on lucene-libs/lucene-analyzers-stempel-X.Y.jar
- * icu4j-X.Y.jar
- * morfologik-*.jar
+Morfologik relies on lucene-libs/lucene-analyzers-morfologik-X.Y.jar
+and lib/morfologik-*.jar
Modified: lucene/dev/branches/lucene4956/solr/contrib/analysis-extras/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/contrib/analysis-extras/build.xml?rev=1534320&r1=1534319&r2=1534320&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/contrib/analysis-extras/build.xml (original)
+++ lucene/dev/branches/lucene4956/solr/contrib/analysis-extras/build.xml Mon Oct 21 18:58:24 2013
@@ -27,6 +27,11 @@
<path id="analysis.extras.lucene.libs">
<pathelement location="${analyzers-icu.jar}"/>
+ <!--
+ Although the smartcn, stempel, and morfologik jars are not dependencies of
+ code in the analysis-extras contrib, they must remain here in order to
+ populate the Solr distribution
+ -->
<pathelement location="${analyzers-smartcn.jar}"/>
<pathelement location="${analyzers-stempel.jar}"/>
<pathelement location="${analyzers-morfologik.jar}"/>
@@ -38,14 +43,39 @@
<path refid="solr.base.classpath"/>
</path>
- <target name="module-jars-to-solr"
- depends="jar-analyzers-icu, jar-analyzers-smartcn, jar-analyzers-stempel, jar-analyzers-morfologik">
+
+ <!--
+ Although the smartcn, stempel, and morfologik jars are not dependencies of
+ code in the analysis-extras contrib, they must remain here in order to
+ populate the Solr distribution
+ -->
+ <target name="module-jars-to-solr"
+ depends="-module-jars-to-solr-not-for-package,-module-jars-to-solr-package"/>
+ <target name="-module-jars-to-solr-not-for-package" unless="called.from.create-package">
+ <antcall inheritall="true">
+ <target name="jar-analyzers-icu"/>
+ <target name="jar-analyzers-smartcn"/>
+ <target name="jar-analyzers-stempel"/>
+ <target name="jar-analyzers-morfologik"/>
+ </antcall>
+ <property name="analyzers-icu.uptodate" value="true"/> <!-- compile-time dependency -->
<mkdir dir="${build.dir}/lucene-libs"/>
<copy todir="${build.dir}/lucene-libs" preservelastmodified="true" flatten="true" failonerror="true" overwrite="true">
<path refid="analysis.extras.lucene.libs" />
</copy>
</target>
+ <target name="-module-jars-to-solr-package" if="called.from.create-package">
+ <antcall target="-unpack-lucene-tgz" inheritall="true"/>
+ <pathconvert property="relative.analysis.extras.lucene.libs" pathsep=",">
+ <path refid="analysis.extras.lucene.libs"/>
+ <globmapper from="${common.build.dir}/*" to="*" handledirsep="true"/>
+ </pathconvert>
+ <mkdir dir="${build.dir}/lucene-libs"/>
+ <copy todir="${build.dir}/lucene-libs" preservelastmodified="true" flatten="true" failonerror="true" overwrite="true">
+ <fileset dir="${lucene.tgz.unpack.dir}/lucene-${version}" includes="${relative.analysis.extras.lucene.libs}"/>
+ </copy>
+ </target>
- <target name="compile-core" depends="jar-analyzers-icu, jar-analyzers-smartcn, jar-analyzers-stempel, jar-analyzers-morfologik, solr-contrib-build.compile-core"/>
+ <target name="compile-core" depends="jar-analyzers-icu, solr-contrib-build.compile-core"/>
<target name="dist" depends="module-jars-to-solr, common-solr.dist"/>
</project>
Modified: lucene/dev/branches/lucene4956/solr/contrib/analysis-extras/ivy.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/contrib/analysis-extras/ivy.xml?rev=1534320&r1=1534319&r2=1534320&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/contrib/analysis-extras/ivy.xml (original)
+++ lucene/dev/branches/lucene4956/solr/contrib/analysis-extras/ivy.xml Mon Oct 21 18:58:24 2013
@@ -19,10 +19,15 @@
<ivy-module version="2.0">
<info organisation="org.apache.solr" module="analysis-extras"/>
<dependencies>
- <dependency org="com.ibm.icu" name="icu4j" rev="49.1" transitive="false"/>
- <dependency org="org.carrot2" name="morfologik-polish" rev="1.7.1" transitive="false"/>
- <dependency org="org.carrot2" name="morfologik-fsa" rev="1.7.1" transitive="false"/>
- <dependency org="org.carrot2" name="morfologik-stemming" rev="1.7.1" transitive="false"/>
+ <dependency org="com.ibm.icu" name="icu4j" rev="${/com.ibm.icu/icu4j}" transitive="false"/>
+ <!--
+ Although the 3rd party morfologik jars are not dependencies of code in
+ the analysis-extras contrib, they must remain here in order to
+ populate the Solr distribution
+ -->
+ <dependency org="org.carrot2" name="morfologik-polish" rev="${/org.carrot2/morfologik-polish}" transitive="false"/>
+ <dependency org="org.carrot2" name="morfologik-fsa" rev="${/org.carrot2/morfologik-fsa}" transitive="false"/>
+ <dependency org="org.carrot2" name="morfologik-stemming" rev="${/org.carrot2/morfologik-stemming}" transitive="false"/>
<exclude org="*" ext="*" matcher="regexp" type="${ivy.exclude.types}"/>
</dependencies>
</ivy-module>
Modified: lucene/dev/branches/lucene4956/solr/contrib/analysis-extras/src/java/org/apache/solr/schema/ICUCollationField.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/contrib/analysis-extras/src/java/org/apache/solr/schema/ICUCollationField.java?rev=1534320&r1=1534319&r2=1534320&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/contrib/analysis-extras/src/java/org/apache/solr/schema/ICUCollationField.java (original)
+++ lucene/dev/branches/lucene4956/solr/contrib/analysis-extras/src/java/org/apache/solr/schema/ICUCollationField.java Mon Oct 21 18:58:24 2013
@@ -234,36 +234,23 @@ public class ICUCollationField extends F
* simple (we already have a threadlocal clone in the reused TS)
*/
private BytesRef analyzeRangePart(String field, String part) {
- TokenStream source;
-
- try {
- source = analyzer.tokenStream(field, part);
+ try (TokenStream source = analyzer.tokenStream(field, part)) {
source.reset();
- } catch (IOException e) {
- throw new RuntimeException("Unable to initialize TokenStream to analyze range part: " + part, e);
- }
- TermToBytesRefAttribute termAtt = source.getAttribute(TermToBytesRefAttribute.class);
- BytesRef bytes = termAtt.getBytesRef();
+ TermToBytesRefAttribute termAtt = source.getAttribute(TermToBytesRefAttribute.class);
+ BytesRef bytes = termAtt.getBytesRef();
- // we control the analyzer here: most errors are impossible
- try {
+ // we control the analyzer here: most errors are impossible
if (!source.incrementToken())
throw new IllegalArgumentException("analyzer returned no terms for range part: " + part);
termAtt.fillBytesRef();
assert !source.incrementToken();
- } catch (IOException e) {
- throw new RuntimeException("error analyzing range part: " + part, e);
- }
- try {
source.end();
- source.close();
+ return BytesRef.deepCopyOf(bytes);
} catch (IOException e) {
- throw new RuntimeException("Unable to end & close TokenStream after analyzing range part: " + part, e);
+ throw new RuntimeException("Unable analyze range part: " + part, e);
}
-
- return BytesRef.deepCopyOf(bytes);
}
@Override
Modified: lucene/dev/branches/lucene4956/solr/contrib/clustering/ivy.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/contrib/clustering/ivy.xml?rev=1534320&r1=1534319&r2=1534320&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/contrib/clustering/ivy.xml (original)
+++ lucene/dev/branches/lucene4956/solr/contrib/clustering/ivy.xml Mon Oct 21 18:58:24 2013
@@ -19,17 +19,17 @@
<ivy-module version="2.0">
<info organisation="org.apache.solr" module="clustering"/>
<dependencies>
- <dependency org="org.carrot2" name="carrot2-mini" rev="3.8.0" transitive="false"/>
+ <dependency org="org.carrot2" name="carrot2-mini" rev="${/org.carrot2/carrot2-mini}" transitive="false"/>
- <dependency org="com.carrotsearch" name="hppc" rev="0.5.2" transitive="false"/>
- <dependency org="org.carrot2.attributes" name="attributes-binder" rev="1.2.0" transitive="false"/>
- <dependency org="org.simpleframework" name="simple-xml" rev="2.7" transitive="false"/>
+ <dependency org="com.carrotsearch" name="hppc" rev="${/com.carrotsearch/hppc}" transitive="false"/>
+ <dependency org="org.carrot2.attributes" name="attributes-binder" rev="${/org.carrot2.attributes/attributes-binder}" transitive="false"/>
+ <dependency org="org.simpleframework" name="simple-xml" rev="${/org.simpleframework/simple-xml}" transitive="false"/>
- <dependency org="org.apache.mahout" name="mahout-math" rev="0.6" transitive="false"/>
- <dependency org="org.apache.mahout" name="mahout-collections" rev="1.0" transitive="false"/>
+ <dependency org="org.apache.mahout" name="mahout-math" rev="${/org.apache.mahout/mahout-math}" transitive="false"/>
+ <dependency org="org.apache.mahout" name="mahout-collections" rev="${/org.apache.mahout/mahout-collections}" transitive="false"/>
- <dependency org="org.codehaus.jackson" name="jackson-core-asl" rev="1.7.4" transitive="false"/>
- <dependency org="org.codehaus.jackson" name="jackson-mapper-asl" rev="1.7.4" transitive="false"/>
+ <dependency org="org.codehaus.jackson" name="jackson-core-asl" rev="${/org.codehaus.jackson/jackson-core-asl}" transitive="false"/>
+ <dependency org="org.codehaus.jackson" name="jackson-mapper-asl" rev="${/org.codehaus.jackson/jackson-mapper-asl}" transitive="false"/>
<!--
Included as part of Solr's environment.