summaryrefslogtreecommitdiffstats
path: root/container-disc/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'container-disc/src/main')
-rw-r--r--container-disc/src/main/java/com/yahoo/container/jdisc/ConfiguredApplication.java4
-rw-r--r--container-disc/src/main/java/com/yahoo/container/jdisc/metric/ForwardingMetricConsumer.java4
-rw-r--r--container-disc/src/main/java/com/yahoo/container/jdisc/metric/MetricConsumerProvider.java8
-rw-r--r--container-disc/src/main/java/com/yahoo/container/jdisc/metric/MetricProvider.java4
-rw-r--r--container-disc/src/main/java/com/yahoo/container/jdisc/metric/MetricUpdater.java6
-rw-r--r--container-disc/src/main/resources/configdefinitions/container.jdisc.config.http-server.def47
-rw-r--r--container-disc/src/main/resources/configdefinitions/metric-defaults.def4
-rwxr-xr-xcontainer-disc/src/main/sh/vespa-start-container-daemon.sh94
8 files changed, 23 insertions, 148 deletions
diff --git a/container-disc/src/main/java/com/yahoo/container/jdisc/ConfiguredApplication.java b/container-disc/src/main/java/com/yahoo/container/jdisc/ConfiguredApplication.java
index 1cb4e1d4555..eae121604e4 100644
--- a/container-disc/src/main/java/com/yahoo/container/jdisc/ConfiguredApplication.java
+++ b/container-disc/src/main/java/com/yahoo/container/jdisc/ConfiguredApplication.java
@@ -39,7 +39,6 @@ import com.yahoo.jrt.slobrok.api.SlobrokList;
import com.yahoo.log.LogLevel;
import com.yahoo.log.LogSetup;
import com.yahoo.net.HostName;
-import com.yahoo.osgi.OsgiImpl;
import com.yahoo.vespa.config.ConfigKey;
import com.yahoo.yolean.Exceptions;
@@ -115,7 +114,6 @@ public final class ConfiguredApplication implements Application {
}
- @SuppressWarnings("deprecation") // TODO: Remove when the Container line below is removed
@Inject
public ConfiguredApplication(ContainerActivator activator,
OsgiFramework osgiFramework,
@@ -127,7 +125,6 @@ public final class ConfiguredApplication implements Application {
this.subscriberFactory = subscriberFactory;
this.configId = System.getProperty("config.id");
this.restrictedOsgiFramework = new DisableOsgiFramework(new RestrictedBundleContext(osgiFramework.bundleContext()));
- Container.get().setOsgi(new OsgiImpl(osgiFramework)); // TODO: Remove, not necessary
applicationWithLegacySetup = new ContainerDiscApplication(configId);
}
@@ -192,7 +189,6 @@ public final class ConfiguredApplication implements Application {
try {
Container.get().setupFileAcquirer(config.filedistributor());
Container.get().setupUrlDownloader();
- com.yahoo.container.Server.get().initialize(config);
} catch (Exception e) {
log.log(LogLevel.ERROR, "Caught exception when initializing server. Exiting.", e);
Runtime.getRuntime().halt(1);
diff --git a/container-disc/src/main/java/com/yahoo/container/jdisc/metric/ForwardingMetricConsumer.java b/container-disc/src/main/java/com/yahoo/container/jdisc/metric/ForwardingMetricConsumer.java
index 7bdd2d9cc7b..c9caaa9d4b5 100644
--- a/container-disc/src/main/java/com/yahoo/container/jdisc/metric/ForwardingMetricConsumer.java
+++ b/container-disc/src/main/java/com/yahoo/container/jdisc/metric/ForwardingMetricConsumer.java
@@ -8,8 +8,8 @@ import com.yahoo.jdisc.application.MetricConsumer;
import java.util.Map;
/**
- * <p>If more than one {@link MetricConsumerFactory} is registered in a container, calls to <tt>Metric</tt> need to be
- * forwarded to all the underlying <tt>MetricConsumers</tt>. That is the responsibility of this class. Instances of this
+ * <p>If more than one {@link MetricConsumerFactory} is registered in a container, calls to <code>Metric</code> need to be
+ * forwarded to all the underlying <code>MetricConsumers</code>. That is the responsibility of this class. Instances of this
* class is created by the {@link MetricConsumerProvider} in those cases.</p>
*
* @author Simon Thoresen Hult
diff --git a/container-disc/src/main/java/com/yahoo/container/jdisc/metric/MetricConsumerProvider.java b/container-disc/src/main/java/com/yahoo/container/jdisc/metric/MetricConsumerProvider.java
index 1e7a4e75385..a300364d848 100644
--- a/container-disc/src/main/java/com/yahoo/container/jdisc/metric/MetricConsumerProvider.java
+++ b/container-disc/src/main/java/com/yahoo/container/jdisc/metric/MetricConsumerProvider.java
@@ -11,14 +11,14 @@ import com.yahoo.metrics.MetricsPresentationConfig;
/**
- * <p>The purpose of this class it to be the only provider for the <tt>MetricConsumer</tt> interface in a component
+ * <p>The purpose of this class it to be the only provider for the <code>MetricConsumer</code> interface in a component
* graph. This component is automatically registered in the graph by the config server. Configuring a different
- * <tt>MetricConsumer</tt> is done by registering one or more {@link MetricConsumerFactory} in the services-file.</p>
+ * <code>MetricConsumer</code> is done by registering one or more {@link MetricConsumerFactory} in the services-file.</p>
*
* <p>Because this class depends on the {@link ComponentRegistry} of {@link MetricConsumerFactory}, any added or removed
* {@link MetricConsumerFactory} will cause this component to be reconfigured. Because {@link MetricProvider} depends on
- * this class, which means any component that uses <tt>Metric</tt> will be reconfigured. Any component that depends
- * directly on <tt>MetricConsumer</tt> will also be reconfigured.</p>
+ * this class, which means any component that uses <code>Metric</code> will be reconfigured. Any component that depends
+ * directly on <code>MetricConsumer</code> will also be reconfigured.</p>
*
* @author Simon Thoresen Hult
*/
diff --git a/container-disc/src/main/java/com/yahoo/container/jdisc/metric/MetricProvider.java b/container-disc/src/main/java/com/yahoo/container/jdisc/metric/MetricProvider.java
index bcd75c0b36b..57613113e73 100644
--- a/container-disc/src/main/java/com/yahoo/container/jdisc/metric/MetricProvider.java
+++ b/container-disc/src/main/java/com/yahoo/container/jdisc/metric/MetricProvider.java
@@ -6,9 +6,9 @@ import com.yahoo.jdisc.Metric;
import com.yahoo.jdisc.application.MetricConsumer;
/**
- * <p>This class implements a {@link Provider} component of <tt>Metric</tt>. Because this class depends on {@link
+ * <p>This class implements a {@link Provider} component of <code>Metric</code>. Because this class depends on {@link
* MetricConsumerProvider}, any change to the consumer configuration will trigger reconfiguration of this component,
- * which in turn triggers reconfiguration of any component that depends on <tt>Metric</tt>.</p>
+ * which in turn triggers reconfiguration of any component that depends on <code>Metric</code>.</p>
*
* @author Simon Thoresen Hult
*/
diff --git a/container-disc/src/main/java/com/yahoo/container/jdisc/metric/MetricUpdater.java b/container-disc/src/main/java/com/yahoo/container/jdisc/metric/MetricUpdater.java
index c2ef789e8fc..98787eaeeeb 100644
--- a/container-disc/src/main/java/com/yahoo/container/jdisc/metric/MetricUpdater.java
+++ b/container-disc/src/main/java/com/yahoo/container/jdisc/metric/MetricUpdater.java
@@ -24,9 +24,6 @@ import java.util.TimerTask;
*/
public class MetricUpdater extends AbstractComponent {
- @Deprecated private static final String DEPRECATED_FREE_MEMORY_BYTES = "freeMemoryBytes";
- @Deprecated private static final String DEPRECATED_USED_MEMORY_BYTES = "usedMemoryBytes";
- @Deprecated private static final String DEPRECATED_TOTAL_MEMORY_BYTES = "totalMemoryBytes";
private static final String FREE_MEMORY_BYTES = "mem.heap.free";
private static final String USED_MEMORY_BYTES = "mem.heap.used";
private static final String TOTAL_MEMORY_BYTES = "mem.heap.total";
@@ -104,9 +101,6 @@ public class MetricUpdater extends AbstractComponent {
long freeMemory = runtime.freeMemory();
long totalMemory = runtime.totalMemory();
long usedMemory = totalMemory - freeMemory;
- metric.set(DEPRECATED_FREE_MEMORY_BYTES, freeMemory, null);
- metric.set(DEPRECATED_USED_MEMORY_BYTES, usedMemory, null);
- metric.set(DEPRECATED_TOTAL_MEMORY_BYTES, totalMemory, null);
metric.set(FREE_MEMORY_BYTES, freeMemory, null);
metric.set(USED_MEMORY_BYTES, usedMemory, null);
metric.set(TOTAL_MEMORY_BYTES, totalMemory, null);
diff --git a/container-disc/src/main/resources/configdefinitions/container.jdisc.config.http-server.def b/container-disc/src/main/resources/configdefinitions/container.jdisc.config.http-server.def
deleted file mode 100644
index 9275136c585..00000000000
--- a/container-disc/src/main/resources/configdefinitions/container.jdisc.config.http-server.def
+++ /dev/null
@@ -1,47 +0,0 @@
-# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-namespace=container.jdisc.config
-
-# TODO Vespa 7: Remove this config and its adapter in config-model (ConnectorFactory)
-
-serverName string default="default"
-tcpKeepAliveEnabled bool default=false
-httpKeepAliveEnabled bool default=true
-optimizedForPipeline bool default=false
-removeRawPostBodyForWwwUrlEncodedPost bool default=false
-responseChunkingEnabled bool default=true
-tcpNoDelayEnabled bool default=true
-listenPort int
-maxChunkSize int default=65536
-maxHeaderSize int default=65536
-maxInitialLineLength int default=65536
-maxUnchunkedResponseSize int default=10362880
-numWorkerThreads int default=16
-receiveBufferSize int default=-1
-responseCompressionLevel int default=6
-sendBufferSize int default=-1
-tcpListenBacklogLength int default=0
-connectTimeout double default=10
-idleConnectionTimeout double default=180
-soLinger double default=-1
-perRequestMetricsEnabled bool default=false
-metricUpdateInterval double default=1
-ssl.enabled bool default=false
-ssl.keyStoreType string default="JKS"
-ssl.keyStorePath string default="default"
-ssl.trustStorePath string default="default"
-ssl.keyDBKey string default=""
-ssl.algorithm string default="SunX509"
-ssl.protocol string default="TLS"
-
-filter[].id string
-filter[].binding string
-
-#copy pasted from new http-server.def(namespace=jdisc.http.server)
-accessLog.bufferSize int default = 10240
-accessLog.flushTimeout double default = 5 # seconds
-accessLog.fileName string default = ""
-accessLog.rotatable bool default = false
-accessLog.directory string default = "logs/jdisc_core"
-accessLog.prefix string default = "access_log."
-accessLog.suffix string default = ""
-accessLog.fileDateFormat string default = "yyyy-MM-dd"
diff --git a/container-disc/src/main/resources/configdefinitions/metric-defaults.def b/container-disc/src/main/resources/configdefinitions/metric-defaults.def
deleted file mode 100644
index 013c2a8c77e..00000000000
--- a/container-disc/src/main/resources/configdefinitions/metric-defaults.def
+++ /dev/null
@@ -1,4 +0,0 @@
-# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-namespace=container.jdisc.config
-
-factory enum { STATE_MONITOR, YAMAS_SCOREBOARD } default = STATE_MONITOR
diff --git a/container-disc/src/main/sh/vespa-start-container-daemon.sh b/container-disc/src/main/sh/vespa-start-container-daemon.sh
index 21c9dc28022..65826e650c4 100755
--- a/container-disc/src/main/sh/vespa-start-container-daemon.sh
+++ b/container-disc/src/main/sh/vespa-start-container-daemon.sh
@@ -90,6 +90,12 @@ configure_memory() {
fi
}
+configure_cpu() {
+ if ((jvm_availableProcessors > 0)); then
+ cpu_options="-XX:ActiveProcessorCount=${jvm_availableProcessors}"
+ fi
+}
+
configure_numactl() {
log_message debug "starting ${VESPA_SERVICE_NAME} for ${VESPA_CONFIG_ID}"
if numactl --interleave all true &> /dev/null; then
@@ -115,7 +121,7 @@ configure_numactl() {
}
configure_gcopts() {
- consider_fallback jvm_gcopts "-XX:+UseConcMarkSweepGC -XX:MaxTenuringThreshold=15 -XX:NewRatio=1"
+ consider_fallback jvm_gcopts "-XX:MaxTenuringThreshold=15 -XX:NewRatio=1"
if [ "$jvm_verbosegc" = "true" ]; then
jvm_gcopts="${jvm_gcopts} -verbose:gc"
fi
@@ -171,101 +177,31 @@ import_cfg_var () {
fi
}
-exec_jsvc () {
- if [ "$jsvc_classpath_pre" ]; then
- CP="${jsvc_classpath_pre}:${CP}"
- fi
- for jf in $jsvc_extra_classpath_libjars ; do
- CP="${CP}:${VESPA_HOME}/lib/jars/$jf.jar"
- done
- for jf in $jsvc_extra_classpath_files ; do
- CP="${CP}:jf"
- done
-
- PRELOAD="$PRELOAD $jsvc_extra_preload"
- configure_preload
- exec $numactlcmd $envcmd $jsvc_binary_name \
- -Dconfig.id="${VESPA_CONFIG_ID}" \
- -XX:+PreserveFramePointer \
- ${jsvc_opts} \
- ${memory_options} \
- ${jvm_gcopts} \
- -XX:MaxJavaStackTraceDepth=1000000 \
- -XX:+HeapDumpOnOutOfMemoryError \
- -XX:HeapDumpPath="${VESPA_HOME}/var/crash" \
- -XX:+ExitOnOutOfMemoryError \
- -Djava.library.path="${VESPA_HOME}/lib64" \
- -Djava.awt.headless=true \
- -Djavax.net.ssl.keyStoreType=JKS \
- -Dsun.rmi.dgc.client.gcInterval=3600000 \
- -Dsun.net.client.defaultConnectTimeout=5000 -Dsun.net.client.defaultReadTimeout=60000 \
- -Djdisc.config.file="$cfpfile" \
- -Djdisc.export.packages=${jdisc_export_packages} \
- -Djdisc.cache.path="$bundlecachedir" \
- -Djdisc.debug.resources=false \
- -Djdisc.bundle.path="${VESPA_HOME}/lib/jars" \
- -Djdisc.logger.enabled=true \
- -Djdisc.logger.level=ALL \
- -Djdisc.logger.tag="${VESPA_CONFIG_ID}" \
- -Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Jdk14Logger \
- -Dvespa.log.control.dir="${VESPA_LOG_CONTROL_DIR}" \
- -Dzookeeperlogfile="${ZOOKEEPER_LOG_FILE}" \
- -Dfile.encoding=UTF-8 \
- -cp "$CP" \
- "$@" \
- com.yahoo.jdisc.core.BootstrapDaemon file:${VESPA_HOME}/lib/jars/container-disc-jar-with-dependencies.jar
-}
-
-maybe_use_jsvc () {
- import_cfg_var use_jsvc "false"
-
- # if configured, run JSVC aka commons.daemon
- if [ "$use_jsvc" = "true" ]; then
- import_cfg_var jsvc_binary_name "jsvc"
- import_cfg_var jsvc_extra_preload
-
- import_cfg_var jsvc_use_pidfile "false"
-
- import_cfg_var jsvc_classpath_pre
- import_cfg_var jsvc_extra_classpath_libjars
- import_cfg_var jsvc_extra_classpath_files
- import_cfg_var jsvc_ipv6opts
- import_cfg_var jsvc_extra_opts
- import_cfg_var jsvc_normal_opts
- import_cfg_var jsvc_java_home_opt
- if [ "$jsvc_use_pidfile" = "true" ]; then
- import_cfg_var jsvc_pidfile_opt "-pidfile ${VESPA_HOME}/var/run/jsvc.${VESPA_SERVICE_NAME}.pid"
- else
- import_cfg_var jsvc_pidfile_opt ""
- fi
- import_cfg_var jsvc_user_opt
- import_cfg_var jsvc_agent_opt
- import_cfg_var jsvc_ynet_opt
- import_cfg_var jsvc_unknown_opts
-
- jsvc_opts="$jsvc_ipv6opts $jsvc_extra_opts $jsvc_normal_opts $jsvc_java_home_opt $jsvc_pidfile_opt $jsvc_user_opt $jsvc_agent_opt $jsvc_ynet_opt $jsvc_unknown_opts"
- exec_jsvc
- fi
-}
-
getconfig
configure_memory
configure_gcopts
configure_env_vars
configure_classpath
configure_numactl
+configure_cpu
configure_preload
-maybe_use_jsvc
exec $numactlcmd $envcmd java \
-Dconfig.id="${VESPA_CONFIG_ID}" \
-XX:+PreserveFramePointer \
+ ${VESPA_CONTAINER_JVMARGS} \
+ ${cpu_options} \
${memory_options} \
${jvm_gcopts} \
-XX:MaxJavaStackTraceDepth=1000000 \
-XX:+HeapDumpOnOutOfMemoryError \
-XX:HeapDumpPath="${VESPA_HOME}/var/crash" \
-XX:+ExitOnOutOfMemoryError \
+ --illegal-access=warn \
+ --add-opens=java.base/java.io=ALL-UNNAMED \
+ --add-opens=java.base/java.lang=ALL-UNNAMED \
+ --add-opens=java.base/java.net=ALL-UNNAMED \
+ --add-opens=java.base/jdk.internal.loader=ALL-UNNAMED \
-Djava.library.path="${VESPA_HOME}/lib64" \
-Djava.awt.headless=true \
-Djavax.net.ssl.keyStoreType=JKS \