Merge pull request #10376 from dakrone/misc-addl-logging

Miscellaneous additional logging and cleanups
This commit is contained in:
Simon Willnauer 2015-04-02 12:19:52 +02:00
commit d30d3b967e
6 changed files with 16 additions and 7 deletions

View File

@ -108,4 +108,10 @@ public class FlushRequest extends BroadcastOperationRequest<FlushRequest> {
waitIfOngoing = in.readBoolean();
}
@Override
public String toString() {
return "FlushRequest{" +
"waitIfOngoing=" + waitIfOngoing +
", force=" + force + "}";
}
}

View File

@ -147,6 +147,7 @@ public class InternalEngine extends Engine {
}
}
}
logger.trace("created new InternalEngine");
}
private SearcherManager createSearcherManager() throws EngineException {

View File

@ -90,6 +90,7 @@ public class ShadowEngine extends Engine {
} catch (IOException ex) {
throw new EngineCreationFailureException(shardId, "failed to open index reader", ex);
}
logger.trace("created new ShadowEngine");
}

View File

@ -561,7 +561,7 @@ public class IndexShard extends AbstractIndexShardComponent {
public void refresh(String source) throws ElasticsearchException {
verifyNotClosed();
if (logger.isTraceEnabled()) {
logger.trace("refresh with soruce: {}", source);
logger.trace("refresh with source: {}", source);
}
long time = System.nanoTime();
engine().refresh(source);

View File

@ -291,7 +291,11 @@ public class IndicesService extends AbstractLifecycleComponent<IndicesService> i
indicesLifecycle.beforeIndexCreated(index, settings);
logger.debug("creating Index [{}], shards [{}]/[{}]", sIndexName, settings.get(SETTING_NUMBER_OF_SHARDS), settings.get(SETTING_NUMBER_OF_REPLICAS));
logger.debug("creating Index [{}], shards [{}]/[{}{}]",
sIndexName,
settings.get(SETTING_NUMBER_OF_SHARDS),
settings.get(SETTING_NUMBER_OF_REPLICAS),
IndexMetaData.isIndexUsingShadowReplicas(settings) ? "s" : "");
Settings indexSettings = settingsBuilder()
.put(this.settings)

View File

@ -47,10 +47,7 @@ import java.util.concurrent.ExecutionException;
import static com.google.common.collect.Lists.newArrayList;
import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.*;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.greaterThan;
import static org.hamcrest.Matchers.greaterThanOrEqualTo;
import static org.hamcrest.Matchers.*;
/**
* Tests for indices that use shadow replicas and a shared filesystem