diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2017-10-06 18:24:05 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-06 18:24:05 +0200 |
commit | 8c0427bd8b0de46d8c61f259f80aa3b81bfa128c (patch) | |
tree | 5b044748ebb96c39a0a0a9a90d01f5e7e57e9a04 /config-model/src/main/java/com | |
parent | 4bcfe2688131797449e20b8400228f75a95bc000 (diff) | |
parent | a0c814fafbedba6edc8e730dfca1363623bf3437 (diff) |
Merge pull request #3675 from vespa-engine/balder/summary.numthreads-2-backgroundnumthreads-rebased-1
Balder/summary.numthreads 2 backgroundnumthreads rebased 1
Diffstat (limited to 'config-model/src/main/java/com')
3 files changed, 30 insertions, 3 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/DomSearchTuningBuilder.java b/config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/DomSearchTuningBuilder.java index ba89169fc4c..4ea638ca41a 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/DomSearchTuningBuilder.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/DomSearchTuningBuilder.java @@ -74,6 +74,8 @@ public class DomSearchTuningBuilder extends VespaDomBuilder.DomConfigProducerBui handleSummary(parent, e, t.searchNode); } else if (equals("initialize", e)) { handleInitialize(e, t.searchNode); + } else if (equals("background", e)) { + handleBackground(e, t.searchNode); } } } @@ -251,6 +253,9 @@ public class DomSearchTuningBuilder extends VespaDomBuilder.DomConfigProducerBui } else if (equals("minfilesizefactor", e)) { s.logStore.minFileSizeFactor = asDouble(e); } else if (equals("numthreads", e)) { + parent.deployLogger().log(Level.WARNING, + "Element 'numthreads is deprecated. Use background.threads instead." + + " For now it will take max of the two."); s.logStore.numThreads = asInt(e); } else if (equals("chunk", e)) { s.logStore.chunk = new Tuning.SearchNode.Summary.Store.Component(true); @@ -268,4 +273,13 @@ public class DomSearchTuningBuilder extends VespaDomBuilder.DomConfigProducerBui } } + private void handleBackground(Element spec, Tuning.SearchNode sn) { + sn.background = new Tuning.SearchNode.Background(); + for (Element e : XML.getChildren(spec)) { + if (equals("threads", e)) { + sn.background.threads = asInt(e); + } + } + } + } diff --git a/config-model/src/main/java/com/yahoo/vespa/model/search/NodeFlavorTuning.java b/config-model/src/main/java/com/yahoo/vespa/model/search/NodeFlavorTuning.java index 5750db08178..6cfd52cc232 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/search/NodeFlavorTuning.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/search/NodeFlavorTuning.java @@ -27,7 +27,7 @@ public class NodeFlavorTuning implements ProtonConfig.Producer { setHwInfo(builder); tuneDiskWriteSpeed(builder); tuneDocumentStoreMaxFileSize(builder.summary.log); - tuneDocumentStoreNumThreads(builder.summary.log); + tuneDocumentStoreNumThreads(builder.background); tuneFlushStrategyMemoryLimits(builder.flush.memory); tuneFlushStrategyTlsSize(builder.flush.memory); } @@ -56,8 +56,8 @@ public class NodeFlavorTuning implements ProtonConfig.Producer { builder.maxfilesize(fileSizeBytes); } - private void tuneDocumentStoreNumThreads(ProtonConfig.Summary.Log.Builder builder) { - builder.numthreads(max(8, (int)nodeFlavor.getMinCpuCores()/2)); + private void tuneDocumentStoreNumThreads(ProtonConfig.Background.Builder builder) { + builder.threads(max(8, (int)nodeFlavor.getMinCpuCores()/2)); } private void tuneFlushStrategyMemoryLimits(ProtonConfig.Flush.Memory.Builder builder) { diff --git a/config-model/src/main/java/com/yahoo/vespa/model/search/Tuning.java b/config-model/src/main/java/com/yahoo/vespa/model/search/Tuning.java index 17af4030cb6..1e3b1783f9b 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/search/Tuning.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/search/Tuning.java @@ -334,6 +334,17 @@ public class Tuning extends AbstractConfigProducer implements PartitionsConfig.P } } + public static class Background implements ProtonConfig.Producer { + public Integer threads = null; + + @Override + public void getConfig(ProtonConfig.Builder builder) { + if (threads != null) { + builder.background.threads(threads); + } + } + } + public RequestThreads threads = null; public FlushStrategy strategy = null; public Resizing resizing = null; @@ -341,6 +352,7 @@ public class Tuning extends AbstractConfigProducer implements PartitionsConfig.P public Attribute attribute = null; public Summary summary = null; public Initialize initialize = null; + public Background background = null; @Override public void getConfig(ProtonConfig.Builder builder) { @@ -351,6 +363,7 @@ public class Tuning extends AbstractConfigProducer implements PartitionsConfig.P if (attribute != null) attribute.getConfig(builder); if (summary != null) summary.getConfig(builder); if (initialize != null) initialize.getConfig(builder); + if (background != null) background.getConfig(builder); } } |