All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.yahoo.vespa.model.container.component.ConnectionLogComponent Maven / Gradle / Ivy

There is a newer version: 8.409.18
Show newest version
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

package com.yahoo.vespa.model.container.component;

import com.yahoo.container.logging.ConnectionLog;
import com.yahoo.container.logging.ConnectionLogConfig;
import com.yahoo.vespa.model.container.ContainerCluster;

public class ConnectionLogComponent extends SimpleComponent implements ConnectionLogConfig.Producer {

    private final String logDirectoryName;
    private final String clusterName;
    private final boolean isHostedVespa;

    public ConnectionLogComponent(ContainerCluster cluster, Class cls, String logDirectoryName) {
        this(cls, logDirectoryName, cluster.getName(), cluster.isHostedVespa());
    }

    public ConnectionLogComponent(Class cls, String logDirectoryName, String clusterName, boolean isHostedVespa) {
        super(cls.getName());
        this.logDirectoryName = logDirectoryName;
        this.clusterName = clusterName;
        this.isHostedVespa = isHostedVespa;
    }

    @Override
    public void getConfig(ConnectionLogConfig.Builder builder) {
        builder.cluster(clusterName);
        builder.logDirectoryName(logDirectoryName);
        if (isHostedVespa) {
            builder.useClusterIdInFileName(false);
        }
        builder.queueSize(-1);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy