Optimize Node, remove duplicate Settings (#2703)
Removes duplicate Settings Signed-off-by: ruanwenjun <wenjun@apache.org>
This commit is contained in:
parent
6a2a33d187
commit
d848c63260
|
@ -216,25 +216,20 @@ public final class ShardGetService extends AbstractIndexShardComponent {
|
||||||
fetchSourceContext = normalizeFetchSourceContent(fetchSourceContext, gFields);
|
fetchSourceContext = normalizeFetchSourceContent(fetchSourceContext, gFields);
|
||||||
|
|
||||||
Term uidTerm = new Term(IdFieldMapper.NAME, Uid.encodeId(id));
|
Term uidTerm = new Term(IdFieldMapper.NAME, Uid.encodeId(id));
|
||||||
Engine.GetResult get = indexShard.get(
|
|
||||||
new Engine.Get(realtime, true, id, uidTerm).version(version)
|
|
||||||
.versionType(versionType)
|
|
||||||
.setIfSeqNo(ifSeqNo)
|
|
||||||
.setIfPrimaryTerm(ifPrimaryTerm)
|
|
||||||
);
|
|
||||||
if (get.exists() == false) {
|
|
||||||
get.close();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (get == null || get.exists() == false) {
|
try (
|
||||||
return new GetResult(shardId.getIndexName(), id, UNASSIGNED_SEQ_NO, UNASSIGNED_PRIMARY_TERM, -1, false, null, null, null);
|
Engine.GetResult get = indexShard.get(
|
||||||
}
|
new Engine.Get(realtime, true, id, uidTerm).version(version)
|
||||||
|
.versionType(versionType)
|
||||||
try {
|
.setIfSeqNo(ifSeqNo)
|
||||||
|
.setIfPrimaryTerm(ifPrimaryTerm)
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
if (get == null || get.exists() == false) {
|
||||||
|
return new GetResult(shardId.getIndexName(), id, UNASSIGNED_SEQ_NO, UNASSIGNED_PRIMARY_TERM, -1, false, null, null, null);
|
||||||
|
}
|
||||||
// break between having loaded it from translog (so we only have _source), and having a document to load
|
// break between having loaded it from translog (so we only have _source), and having a document to load
|
||||||
return innerGetLoadFromStoredFields(id, gFields, fetchSourceContext, get, mapperService);
|
return innerGetLoadFromStoredFields(id, gFields, fetchSourceContext, get, mapperService);
|
||||||
} finally {
|
|
||||||
get.close();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -348,11 +348,7 @@ public class Node implements Closeable {
|
||||||
Settings tmpSettings = Settings.builder()
|
Settings tmpSettings = Settings.builder()
|
||||||
.put(initialEnvironment.settings())
|
.put(initialEnvironment.settings())
|
||||||
.put(Client.CLIENT_TYPE_SETTING_S.getKey(), CLIENT_TYPE)
|
.put(Client.CLIENT_TYPE_SETTING_S.getKey(), CLIENT_TYPE)
|
||||||
.build();
|
// Enabling shard indexing backpressure node-attribute
|
||||||
|
|
||||||
// Enabling shard indexing backpressure node-attribute
|
|
||||||
tmpSettings = Settings.builder()
|
|
||||||
.put(tmpSettings)
|
|
||||||
.put(NODE_ATTRIBUTES.getKey() + SHARD_INDEXING_PRESSURE_ENABLED_ATTRIBUTE_KEY, "true")
|
.put(NODE_ATTRIBUTES.getKey() + SHARD_INDEXING_PRESSURE_ENABLED_ATTRIBUTE_KEY, "true")
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue