diff --git a/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java b/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java index 37f6ea9566c..f0decc235e1 100644 --- a/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java +++ b/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java @@ -59,7 +59,6 @@ import org.apache.lucene.store.Lock; import org.apache.lucene.store.LockObtainFailedException; import org.apache.lucene.store.MergeInfo; import org.apache.lucene.store.RateLimitedIndexOutput; -import org.apache.lucene.store.SleepingLockWrapper; import org.apache.lucene.store.TrackingDirectoryWrapper; import org.apache.lucene.store.LockValidatingDirectoryWrapper; import org.apache.lucene.util.Accountable; @@ -759,15 +758,7 @@ public class IndexWriter implements Closeable, TwoPhaseCommit, Accountable { // obtain the write.lock. If the user configured a timeout, // we wrap with a sleeper and this might take some time. - long timeout = config.getWriteLockTimeout(); - final Directory lockDir; - if (timeout == 0) { - // user doesn't want sleep/retries - lockDir = d; - } else { - lockDir = new SleepingLockWrapper(d, timeout); - } - writeLock = lockDir.obtainLock(WRITE_LOCK_NAME); + writeLock = d.obtainLock(WRITE_LOCK_NAME); boolean success = false; try { diff --git a/lucene/core/src/java/org/apache/lucene/index/IndexWriterConfig.java b/lucene/core/src/java/org/apache/lucene/index/IndexWriterConfig.java index f614e5762ce..358afe58369 100644 --- a/lucene/core/src/java/org/apache/lucene/index/IndexWriterConfig.java +++ b/lucene/core/src/java/org/apache/lucene/index/IndexWriterConfig.java @@ -24,7 +24,6 @@ import org.apache.lucene.codecs.Codec; import org.apache.lucene.index.DocumentsWriterPerThread.IndexingChain; import org.apache.lucene.index.IndexWriter.IndexReaderWarmer; import org.apache.lucene.search.similarities.Similarity; -import org.apache.lucene.store.SleepingLockWrapper; import org.apache.lucene.util.InfoStream; import org.apache.lucene.util.PrintStreamInfoStream; import org.apache.lucene.util.SetOnce; @@ -87,13 +86,6 @@ public final class IndexWriterConfig extends LiveIndexWriterConfig { */ public final static double DEFAULT_RAM_BUFFER_SIZE_MB = 16.0; - /** - * Default value for the write lock timeout (0 ms: no sleeping). - * @deprecated Use {@link SleepingLockWrapper} if you want sleeping. - */ - @Deprecated - public static final long WRITE_LOCK_TIMEOUT = 0; - /** Default setting for {@link #setReaderPooling}. */ public final static boolean DEFAULT_READER_POOLING = false; @@ -245,24 +237,6 @@ public final class IndexWriterConfig extends LiveIndexWriterConfig { return mergeScheduler; } - /** - * Sets the maximum time to wait for a write lock (in milliseconds) for this - * instance. Note that the value can be zero, for no sleep/retry behavior. - * - *
Only takes effect when IndexWriter is first created. - * @deprecated Use {@link SleepingLockWrapper} if you want sleeping. - */ - @Deprecated - public IndexWriterConfig setWriteLockTimeout(long writeLockTimeout) { - this.writeLockTimeout = writeLockTimeout; - return this; - } - - @Override - public long getWriteLockTimeout() { - return writeLockTimeout; - } - /** * Set the {@link Codec}. * diff --git a/lucene/core/src/java/org/apache/lucene/index/LiveIndexWriterConfig.java b/lucene/core/src/java/org/apache/lucene/index/LiveIndexWriterConfig.java index 846037102ed..3ab0991d0c1 100644 --- a/lucene/core/src/java/org/apache/lucene/index/LiveIndexWriterConfig.java +++ b/lucene/core/src/java/org/apache/lucene/index/LiveIndexWriterConfig.java @@ -24,7 +24,6 @@ import org.apache.lucene.index.IndexWriter.IndexReaderWarmer; import org.apache.lucene.index.IndexWriterConfig.OpenMode; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.similarities.Similarity; -import org.apache.lucene.store.SleepingLockWrapper; import org.apache.lucene.util.InfoStream; /** @@ -61,13 +60,6 @@ public class LiveIndexWriterConfig { /** {@link MergeScheduler} to use for running merges. */ protected volatile MergeScheduler mergeScheduler; - /** - * Timeout when trying to obtain the write lock on init. - * @deprecated Use {@link SleepingLockWrapper} if you want sleeping. - */ - @Deprecated - protected volatile long writeLockTimeout; - /** {@link IndexingChain} that determines how documents are * indexed. */ protected volatile IndexingChain indexingChain; @@ -115,7 +107,6 @@ public class LiveIndexWriterConfig { openMode = OpenMode.CREATE_OR_APPEND; similarity = IndexSearcher.getDefaultSimilarity(); mergeScheduler = new ConcurrentMergeScheduler(); - writeLockTimeout = IndexWriterConfig.WRITE_LOCK_TIMEOUT; indexingChain = DocumentsWriterPerThread.defaultIndexingChain; codec = Codec.getDefault(); if (codec == null) { @@ -355,17 +346,6 @@ public class LiveIndexWriterConfig { public MergeScheduler getMergeScheduler() { return mergeScheduler; } - - /** - * Returns allowed timeout when acquiring the write lock. - * - * @see IndexWriterConfig#setWriteLockTimeout(long) - * @deprecated Use {@link SleepingLockWrapper} if you want sleeping. - */ - @Deprecated - public long getWriteLockTimeout() { - return writeLockTimeout; - } /** Returns the current {@link Codec}. */ public Codec getCodec() { @@ -488,8 +468,6 @@ public class LiveIndexWriterConfig { sb.append("openMode=").append(getOpenMode()).append("\n"); sb.append("similarity=").append(getSimilarity().getClass().getName()).append("\n"); sb.append("mergeScheduler=").append(getMergeScheduler()).append("\n"); - sb.append("default WRITE_LOCK_TIMEOUT=").append(IndexWriterConfig.WRITE_LOCK_TIMEOUT).append("\n"); - sb.append("writeLockTimeout=").append(getWriteLockTimeout()).append("\n"); sb.append("codec=").append(getCodec()).append("\n"); sb.append("infoStream=").append(getInfoStream().getClass().getName()).append("\n"); sb.append("mergePolicy=").append(getMergePolicy()).append("\n"); diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterConfig.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterConfig.java index 0f0d380e02b..b67dd752cd3 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterConfig.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterConfig.java @@ -177,7 +177,6 @@ public class TestIndexWriterConfig extends LuceneTestCase { @Test public void testConstants() throws Exception { // Tests that the values of the constants does not change - assertEquals(0, IndexWriterConfig.WRITE_LOCK_TIMEOUT); assertEquals(-1, IndexWriterConfig.DISABLE_AUTO_FLUSH); assertEquals(IndexWriterConfig.DISABLE_AUTO_FLUSH, IndexWriterConfig.DEFAULT_MAX_BUFFERED_DELETE_TERMS); assertEquals(IndexWriterConfig.DISABLE_AUTO_FLUSH, IndexWriterConfig.DEFAULT_MAX_BUFFERED_DOCS); 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 f6c4a945de4..fc38dc1d328 100644 --- a/solr/core/src/java/org/apache/solr/update/SolrIndexConfig.java +++ b/solr/core/src/java/org/apache/solr/update/SolrIndexConfig.java @@ -209,9 +209,6 @@ public class SolrIndexConfig implements MapSerializable { if (ramBufferSizeMB != -1) iwc.setRAMBufferSizeMB(ramBufferSizeMB); - if (writeLockTimeout != -1) - iwc.setWriteLockTimeout(writeLockTimeout); - iwc.setSimilarity(schema.getSimilarity()); iwc.setMergePolicy(buildMergePolicy(schema)); iwc.setMergeScheduler(buildMergeScheduler(schema));