diff options
author | Harald Musum <musum@yahooinc.com> | 2023-05-08 10:35:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-08 10:35:07 +0200 |
commit | 5685f5e49b719526c930d35ffaf2d7f945b552a0 (patch) | |
tree | cce00a3bebb2ae78db8ad8101513f5999f0814c9 /config-model/src/main/java/com/yahoo/vespa/model/container/ContainerCluster.java | |
parent | 5f3d9b2a6a3b1c58a8a295189208c4be262e60d2 (diff) |
Revert "Remove access logging for internal container clusters"
Diffstat (limited to 'config-model/src/main/java/com/yahoo/vespa/model/container/ContainerCluster.java')
-rwxr-xr-x | config-model/src/main/java/com/yahoo/vespa/model/container/ContainerCluster.java | 32 |
1 files changed, 7 insertions, 25 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/ContainerCluster.java b/config-model/src/main/java/com/yahoo/vespa/model/container/ContainerCluster.java index 6bbc24e8739..45060f2f27d 100755 --- a/config-model/src/main/java/com/yahoo/vespa/model/container/ContainerCluster.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/container/ContainerCluster.java @@ -26,7 +26,6 @@ import com.yahoo.container.jdisc.state.StateHandler; import com.yahoo.container.logging.AccessLog; import com.yahoo.container.usability.BindingsOverviewHandler; import com.yahoo.document.config.DocumentmanagerConfig; -import com.yahoo.jdisc.http.server.jetty.VoidRequestLog; import com.yahoo.osgi.provider.model.ComponentModel; import com.yahoo.prelude.semantics.SemanticRulesConfig; import com.yahoo.search.config.IndexInfoConfig; @@ -74,7 +73,6 @@ import java.util.Optional; import java.util.Set; import java.util.TreeSet; -import static com.yahoo.vespa.model.container.component.AccessLogComponent.AccessLogType.jsonAccessLog; import static com.yahoo.vespa.model.container.component.chain.ProcessingHandler.PROCESSING_HANDLER_CLASS; /** @@ -150,7 +148,7 @@ public abstract class ContainerCluster<CONTAINER extends Container> private final Set<Path> platformBundles = new TreeSet<>(); // Ensure stable ordering private final ComponentGroup<Component<?, ?>> componentGroup; - protected final boolean isHostedVespa; + private final boolean isHostedVespa; private final boolean zooKeeperLocalhostAffinity; private final String compressionType; @@ -171,7 +169,6 @@ public abstract class ContainerCluster<CONTAINER extends Container> public ContainerCluster(TreeConfigProducer<?> parent, String configSubId, String clusterId, DeployState deployState, boolean zooKeeperLocalhostAffinity) { this(parent, configSubId, clusterId, deployState, zooKeeperLocalhostAffinity, 1); } - public ContainerCluster(TreeConfigProducer<?> parent, String configSubId, String clusterId, DeployState deployState, boolean zooKeeperLocalhostAffinity, int defaultPoolNumThreads) { super(parent, configSubId); this.name = clusterId; @@ -183,7 +180,7 @@ public abstract class ContainerCluster<CONTAINER extends Container> componentGroup = new ComponentGroup<>(this, "component"); addCommonVespaBundles(); - addSimpleComponent(VoidRequestLog.class); + addSimpleComponent(AccessLog.class); addComponent(new DefaultThreadpoolProvider(this, defaultPoolNumThreads)); addComponent(defaultHandlerThreadpool); addSimpleComponent(com.yahoo.concurrent.classlock.ClassLocking.class); @@ -290,11 +287,7 @@ public abstract class ContainerCluster<CONTAINER extends Container> return componentGroup.removeComponent(componentId); } - public void removeSimpleComponent(Class<?> clazz) { - removeComponent(new SimpleComponent(clazz.getName()).getComponentId()); - } - - public void addSimpleComponent(Class<?> clazz) { + private void addSimpleComponent(Class<?> clazz) { addSimpleComponent(clazz.getName()); } @@ -600,23 +593,12 @@ public abstract class ContainerCluster<CONTAINER extends Container> if (containerSearch != null) containerSearch.connectSearchClusters(clusterMap); } - public void addAccessLog(String clusterName) { - addAccessLog(Optional.ofNullable(clusterName)); + public void addDefaultSearchAccessLog() { + // In hosted Vespa with one application container per node we do not use the container name to distinguish log files + Optional<String> clusterName = isHostedVespa ? Optional.empty() : Optional.of(getName()); + addComponent(new AccessLogComponent(this, AccessLogComponent.AccessLogType.jsonAccessLog, compressionType, clusterName, isHostedVespa)); } - public void addAccessLog(String fileNamePattern, String symlinkName) { - removeSimpleComponent(VoidRequestLog.class); - addSimpleComponent(AccessLog.class); - addComponent(new AccessLogComponent(jsonAccessLog, compressionType, fileNamePattern, null, true, true, symlinkName, 1024, 256 * 1024)); - } - - protected void addAccessLog(Optional<String> clusterName) { - removeSimpleComponent(VoidRequestLog.class); - addSimpleComponent(AccessLog.class); - addComponent(new AccessLogComponent(this, jsonAccessLog, compressionType, clusterName, isHostedVespa)); - } - - @Override public void getConfig(IlscriptsConfig.Builder builder) { for (SearchCluster searchCluster : Content.getSearchClusters(getRoot().configModelRepo())) { |