remove use of deprecated methods

This commit is contained in:
kimchy 2011-06-02 12:03:05 +03:00
parent 30127d6ed4
commit 2fad1c4308
4 changed files with 12 additions and 6 deletions

View File

@ -749,6 +749,7 @@ public class RobinEngine extends AbstractIndexShardComponent implements Engine {
if (flushNeeded) {
flushNeeded = false;
long time = System.currentTimeMillis();
try {
long translogId = translogIdGenerator.incrementAndGet();
translog.newTransientTranslog(translogId);
@ -760,6 +761,7 @@ public class RobinEngine extends AbstractIndexShardComponent implements Engine {
failEngine(e);
throw new FlushFailedEngineException(shardId, e);
}
System.err.println("Commit took " + new TimeValue(System.currentTimeMillis() - time));
}
} finally {
rwl.readLock().unlock();

View File

@ -78,7 +78,7 @@ public class LogByteSizeMergePolicyProvider extends AbstractIndexShardComponent
@Override public LogByteSizeMergePolicy newMergePolicy() {
CustomLogByteSizeMergePolicy mergePolicy;
if (asyncMerge) {
mergePolicy = new CustomLogByteSizeMergePolicy(this);
mergePolicy = new EnableMergeLogByteSizeMergePolicy(this);
} else {
mergePolicy = new CustomLogByteSizeMergePolicy(this);
}

View File

@ -19,7 +19,11 @@
package org.elasticsearch.index.merge.scheduler;
import org.apache.lucene.index.*;
import org.apache.lucene.index.CorruptIndexException;
import org.apache.lucene.index.IndexWriter;
import org.apache.lucene.index.MergePolicy;
import org.apache.lucene.index.MergeScheduler;
import org.apache.lucene.index.TrackingConcurrentMergeScheduler;
import org.apache.lucene.store.AlreadyClosedException;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.logging.ESLogger;
@ -81,8 +85,8 @@ public class ConcurrentMergeSchedulerProvider extends AbstractIndexShardComponen
@Override public void merge(IndexWriter writer) throws CorruptIndexException, IOException {
try {
// if merge is not enabled, don't do any merging...
if (writer.getMergePolicy() instanceof EnableMergePolicy) {
if (!((EnableMergePolicy) writer.getMergePolicy()).isMergeEnabled()) {
if (writer.getConfig().getMergePolicy() instanceof EnableMergePolicy) {
if (!((EnableMergePolicy) writer.getConfig().getMergePolicy()).isMergeEnabled()) {
return;
}
}

View File

@ -75,8 +75,8 @@ public class SerialMergeSchedulerProvider extends AbstractIndexShardComponent im
@Override public void merge(IndexWriter writer) throws CorruptIndexException, IOException {
try {
// if merge is not enabled, don't do any merging...
if (writer.getMergePolicy() instanceof EnableMergePolicy) {
if (!((EnableMergePolicy) writer.getMergePolicy()).isMergeEnabled()) {
if (writer.getConfig().getMergePolicy() instanceof EnableMergePolicy) {
if (!((EnableMergePolicy) writer.getConfig().getMergePolicy()).isMergeEnabled()) {
return;
}
}