Skip to content

Commit

Permalink
Issue 489: Standardize Controller Config (pravega#3406)
Browse files Browse the repository at this point in the history
* Changes the Controller configuration to use the same approach as in the Segment Store.

* Retires usage of com.typesafe along the way.


Signed-off-by: Andrei Paduroiu <[email protected]>
  • Loading branch information
andreipaduroiu authored and fpj committed Mar 7, 2019
1 parent 7de924f commit 7b9fce6
Show file tree
Hide file tree
Showing 24 changed files with 410 additions and 378 deletions.
2 changes: 1 addition & 1 deletion PravegaGroup.json
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@
"network": "HOST",
"parameters": [
{ "key": "env",
"value": "SERVER_OPTS=\"-DZK_URL=master.mesos:2181\" \"-DCONTROLLER_SERVER_PORT=9090\" \"-DREST_SERVER_PORT=9091\" \"-Dlog.level=INFO\""
"value": "SERVER_OPTS=\"-Dcontroller.zk.url=master.mesos:2181\" \"-Dcontroller.service.port=9090\" \"-Dcontroller.service.restPort=9091\" \"-Dlog.level=INFO\""
},
{ "key": "env",
"value": "JAVA_OPTS=-Xmx512m"
Expand Down
5 changes: 2 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ project('controller') {
applicationName = "pravega-controller"
mainClassName = "io.pravega.controller.server.Main"
applicationDefaultJvmArgs = ["-server", "-Xms128m", "-XX:+HeapDumpOnOutOfMemoryError",
"-Dconfig.file=PRAVEGA_APP_HOME/conf/controller.conf",
"-Dconfig.file=PRAVEGA_APP_HOME/conf/controller.config.properties",
"-Dlogback.configurationFile=PRAVEGA_APP_HOME/conf/logback.xml",
"-Dlog.dir=PRAVEGA_APP_HOME/logs",
"-Dlog.name=controller"]
Expand Down Expand Up @@ -590,7 +590,6 @@ project('controller') {
compile(group: 'io.swagger', name : 'swagger-jersey2-jaxrs', version :swaggerJersey2JaxrsVersion) {
exclude group: 'com.google.guava', module: 'guava'
}
compile group: 'com.typesafe', name: 'config', version: typesafeConfigVersion
compile group: 'org.apache.curator', name: 'curator-framework', version: apacheCuratorVersion
compile group: 'org.apache.curator', name: 'curator-recipes', version: apacheCuratorVersion
compile group: 'org.apache.curator', name: 'curator-client', version: apacheCuratorVersion
Expand All @@ -614,7 +613,7 @@ project('controller') {
"-XX:+PrintGCDetails", "-XX:+PrintGCDateStamps",
"-Xloggc:PRAVEGA_APP_HOME/logs/gc.log", "-XX:+UseGCLogFileRotation",
"-XX:NumberOfGCLogFiles=2", "-XX:GCLogFileSize=64m",
"-Dconfig.file=PRAVEGA_APP_HOME/conf/controller.conf",
"-Dconfig.file=PRAVEGA_APP_HOME/conf/controller.config.properties",
"-Dlogback.configurationFile=PRAVEGA_APP_HOME/conf/logback.xml",
"-Dlog.dir=PRAVEGA_APP_HOME/logs",
"-Dlog.name=controller"]
Expand Down
1 change: 0 additions & 1 deletion checkstyle/import-control.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
<allow pkg="ch.qos.logback"/>
<allow pkg="io.netty"/>
<allow pkg="org.apache"/>
<allow pkg="com.typesafe.config"/>
<allow pkg="org.rocksdb"/>
<allow pkg="com.codahale"/>
<allow pkg="com.emc.object"/>
Expand Down
111 changes: 0 additions & 111 deletions controller/src/conf/application.conf

This file was deleted.

55 changes: 55 additions & 0 deletions controller/src/conf/controller.config.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
###
# Copyright (c) 2017 Dell Inc., or its subsidiaries. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#

## Instructions for using this file:
# 1. Settings are namespaced. The prefix indicates the component for which the configuration applies.
# 2. All settings have default values hardcoded inside the code. The purpose of this file is to provide Environment Variable
# references so that they may fetch values via such an indirection.
# 3. Each of these settings can be overridden from the command like by specifying a Java System Property.
# Example: setting 'controller.service.port' has a default value of 9090, but it can be overridden to a different
# value via the command-line:
# java -Dcontroller.service.port=5689 ...
# which will set the value for that setting to 5689, regardless of what this file contains.


controller.containerCount=${CONTAINER_COUNT}
controller.hostMonitorEnabled=${HOST_MONITOR_ENABLE}
controller.minRebalanceIntervalSeconds=${CLUSTER_MIN_REBALANCE_INTERVAL}
controller.replyWithStackTraceOnError=${REPLY_WITH_STACK_TRACE_ON_ERROR}
controller.requestTracingEnabled=${REQUEST_TRACING_ENABLED}
controller.service.port=${CONTROLLER_SERVER_PORT}
controller.service.asyncTaskPoolSize=${ASYNC_TASK_POOL_SIZE}
controller.service.hostIp=${SERVICE_HOST_IP}
controller.service.hostPort=${SERVICE_HOST_PORT}
controller.service.publishedRPCHost=${CONTROLLER_RPC_PUBLISHED_HOST}
controller.service.publishedRPCPort=${CONTROLLER_RPC_PUBLISHED_PORT}
controller.service.cluster=${CLUSTER_NAME}
controller.service.restIp=${REST_SERVER_IP}
controller.service.restPort=${REST_SERVER_PORT}
controller.auth.enabled=${AUTHORIZATION_ENABLED}
controller.auth.userPasswordFile=${USER_PASSWORD_FILE}
controller.auth.tlsEnabled=${TLS_ENABLED}
controller.auth.tlsCertFile=${TLS_CERT_FILE}
controller.auth.tlsTrustStore=${TLS_TRUST_STORE}
controller.auth.tlsKeyFile=${TLS_KEY_FILE}
controller.auth.tokenSigningKey=${TOKEN_SIGNING_KEY}
controller.zk.url=${ZK_URL}
controller.zk.retryIntervalMillis=${ZK_RETRY_SLEEP_MS}
controller.zk.maxRetries=${ZK_MAX_RETRIES}
controller.zk.sessionTimeoutMillis=${ZK_SESSION_TIMEOUT_MS}
controller.zk.secureConnection=${SECURE_ZK}
controller.retention.frequencyMinutes=${RETENTION_FREQUENCY_MINUTES}
controller.retention.bucketCount=${BUCKET_COUNT}
controller.retention.threadCount=${RETENTION_THREAD_POOL_SIZE}
controller.transaction.minLeaseValue=${MIN_LEASE_VALUE}
controller.transaction.maxLeaseValue=${MAX_LEASE_VALUE}
controller.transaction.ttlHours=${COMPLETED_TXN_TTL_IN_HOURS}
#controller.scale.streamName=_requeststream
#controller.scale.readerGroup=scaleGroup
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public static void main(String[] args) {
StatsProvider statsProvider = null;
try {
//0. Initialize metrics provider
MetricsProvider.initialize(Config.getMetricsConfig());
MetricsProvider.initialize(Config.METRICS_CONFIG);
statsProvider = MetricsProvider.getMetricsProvider();
statsProvider.start();

Expand Down Expand Up @@ -68,7 +68,7 @@ public static void main(String[] args) {

ControllerEventProcessorConfig eventProcessorConfig = ControllerEventProcessorConfigImpl.withDefault();

GRPCServerConfig grpcServerConfig = Config.getGRPCServerConfig();
GRPCServerConfig grpcServerConfig = Config.GRPC_SERVER_CONFIG;

RESTServerConfig restServerConfig = RESTServerConfigImpl.builder()
.host(Config.REST_SERVER_IP)
Expand Down
Loading

0 comments on commit 7b9fce6

Please sign in to comment.