lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rm...@apache.org
Subject svn commit: r1685498 - in /lucene/dev/trunk: lucene/core/src/java/org/apache/lucene/index/ lucene/core/src/test/org/apache/lucene/index/ solr/core/src/java/org/apache/solr/update/
Date Mon, 15 Jun 2015 02:52:51 GMT
Author: rmuir
Date: Mon Jun 15 02:52:51 2015
New Revision: 1685498

URL: http://svn.apache.org/r1685498
Log:
LUCENE-6525: remove deprecations from trunk

Modified:
    lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java
    lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/IndexWriterConfig.java
    lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/LiveIndexWriterConfig.java
    lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterConfig.java
    lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/SolrIndexConfig.java

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java?rev=1685498&r1=1685497&r2=1685498&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java (original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java Mon Jun
15 02:52:51 2015
@@ -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 Clos
     
     // 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 {

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/IndexWriterConfig.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/IndexWriterConfig.java?rev=1685498&r1=1685497&r2=1685498&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/IndexWriterConfig.java (original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/IndexWriterConfig.java Mon
Jun 15 02:52:51 2015
@@ -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 ext
    */
   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;
 
@@ -246,24 +238,6 @@ public final class IndexWriterConfig ext
   }
 
   /**
-   * 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.
-   *
-   * <p>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}.
    * 
    * <p>

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/LiveIndexWriterConfig.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/LiveIndexWriterConfig.java?rev=1685498&r1=1685497&r2=1685498&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/LiveIndexWriterConfig.java
(original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/LiveIndexWriterConfig.java
Mon Jun 15 02:52:51 2015
@@ -24,7 +24,6 @@ import org.apache.lucene.index.IndexWrit
 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");

Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterConfig.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterConfig.java?rev=1685498&r1=1685497&r2=1685498&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterConfig.java
(original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterConfig.java
Mon Jun 15 02:52:51 2015
@@ -177,7 +177,6 @@ public class TestIndexWriterConfig exten
   @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);

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/SolrIndexConfig.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/SolrIndexConfig.java?rev=1685498&r1=1685497&r2=1685498&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/SolrIndexConfig.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/SolrIndexConfig.java Mon Jun
15 02:52:51 2015
@@ -209,9 +209,6 @@ public class SolrIndexConfig implements
     if (ramBufferSizeMB != -1)
       iwc.setRAMBufferSizeMB(ramBufferSizeMB);
 
-    if (writeLockTimeout != -1)
-      iwc.setWriteLockTimeout(writeLockTimeout);
-
     iwc.setSimilarity(schema.getSimilarity());
     iwc.setMergePolicy(buildMergePolicy(schema));
     iwc.setMergeScheduler(buildMergeScheduler(schema));



Mime
View raw message