Re-order log statements to be correct for segment and top level warming.
This commit is contained in:
parent
640085c45d
commit
f8d35d81d8
|
@ -88,6 +88,19 @@ public interface IndicesWarmer {
|
||||||
public IndexReader indexReader() {
|
public IndexReader indexReader() {
|
||||||
return indexReader;
|
return indexReader;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
final String value;
|
||||||
|
if (newSearcher != null) {
|
||||||
|
value = newSearcher.reader().toString();
|
||||||
|
} else if (indexReader != null) {
|
||||||
|
value = indexReader.toString();
|
||||||
|
} else {
|
||||||
|
value = "null";
|
||||||
|
}
|
||||||
|
return "WarmerContext: " + value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void addListener(Listener listener);
|
void addListener(Listener listener);
|
||||||
|
|
|
@ -93,9 +93,9 @@ public class InternalIndicesWarmer extends AbstractComponent implements IndicesW
|
||||||
}
|
}
|
||||||
if (logger.isTraceEnabled()) {
|
if (logger.isTraceEnabled()) {
|
||||||
if (topReader) {
|
if (topReader) {
|
||||||
logger.trace("[{}][{}] warming [{}]", context.shardId().index().name(), context.shardId().id(), context.newSearcher().reader());
|
logger.trace("[{}][{}] top warming [{}]", context.shardId().index().name(), context.shardId().id(), context);
|
||||||
} else {
|
} else {
|
||||||
logger.trace("[{}][{}] top warming [{}]", context.shardId().index().name(), context.shardId().id(), context.indexReader());
|
logger.trace("[{}][{}] warming [{}]", context.shardId().index().name(), context.shardId().id(), context);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
indexShard.warmerService().onPreWarm();
|
indexShard.warmerService().onPreWarm();
|
||||||
|
@ -116,9 +116,9 @@ public class InternalIndicesWarmer extends AbstractComponent implements IndicesW
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
Thread.currentThread().interrupt();
|
Thread.currentThread().interrupt();
|
||||||
if (topReader) {
|
if (topReader) {
|
||||||
logger.warn("warming has been interrupted", e);
|
|
||||||
} else {
|
|
||||||
logger.warn("top warming has been interrupted", e);
|
logger.warn("top warming has been interrupted", e);
|
||||||
|
} else {
|
||||||
|
logger.warn("warming has been interrupted", e);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,4 +49,22 @@ public class FieldDataLoadingTests extends ElasticsearchIntegrationTest {
|
||||||
assertThat(response.getIndicesStats().getFieldData().getMemorySizeInBytes(), greaterThan(0l));
|
assertThat(response.getIndicesStats().getFieldData().getMemorySizeInBytes(), greaterThan(0l));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testEagerGlobalOrdinalsFieldDataLoading() throws Exception {
|
||||||
|
assertAcked(prepareCreate("test")
|
||||||
|
.addMapping("type", jsonBuilder().startObject().startObject("type").startObject("properties")
|
||||||
|
.startObject("name")
|
||||||
|
.field("type", "string")
|
||||||
|
.startObject("fielddata").field("loading", "eager_global_ordinals").endObject()
|
||||||
|
.endObject()
|
||||||
|
.endObject().endObject().endObject()));
|
||||||
|
ensureGreen();
|
||||||
|
|
||||||
|
client().prepareIndex("test", "type", "1").setSource("name", "name").get();
|
||||||
|
client().admin().indices().prepareRefresh("test").get();
|
||||||
|
|
||||||
|
ClusterStatsResponse response = client().admin().cluster().prepareClusterStats().get();
|
||||||
|
assertThat(response.getIndicesStats().getFieldData().getMemorySizeInBytes(), greaterThan(0l));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue