<commit_before>/*
 * Copyright 2015-2016 IBM Corporation
 *
 * 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
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package whisk.core

import whisk.common.Config
import java.io.File
import whisk.common.Crypt

/**
 * A set of properties which might be needed to run a whisk microservice implemented
 * in scala.
 *
 * @param requiredProperties a Map whose keys define properties that must be bound to
 * a value, and whose values are default values.   A null value in the Map means there is
 * no default value specified, so it must appear in the properties file
 * @param whiskPropertiesFile a File object, the whisk.properties file
 */

class WhiskConfig(
    requiredProperties: Map[String, String])
    extends Config(requiredProperties, WhiskConfig.whiskPropertiesFile) {

    val logsDir = this(WhiskConfig.logsDir)
    val servicePort = this(WhiskConfig.servicePort)
    val dockerRegistry = this(WhiskConfig.dockerRegistry)
    val dockerEndpoint = this(WhiskConfig.dockerEndpoint)
    val selfDockerEndpoint = this(WhiskConfig.selfDockerEndpoint)
    val dockerPort = this(WhiskConfig.dockerPort)

    val dockerImageTag = this(WhiskConfig.dockerImageTag)

    val invokerContainerNetwork = this(WhiskConfig.invokerContainerNetwork)

    val controllerHost = this(WhiskConfig.controllerHostName) + ":" + this(WhiskConfig.controllerHostPort)
    val edgeHost = this(WhiskConfig.edgeHostName) + ":" + this(WhiskConfig.edgeHostApiPort)
    val elkHost = this(WhiskConfig.elkHostName) + ":" + this(WhiskConfig.elkHostPort)
    val kafkaHost = this(WhiskConfig.kafkaHostName) + ":" + this(WhiskConfig.kafkaHostPort)
    val kafkaPartitions = this(WhiskConfig.kafkaPartitions)
    val loadbalancerHost = this(WhiskConfig.loadbalancerHostName) + ":" + this(WhiskConfig.loadbalancerHostPort)
    val messagehubtriggerHost = this(WhiskConfig.messagehubtriggerHostName) + ":" + this(WhiskConfig.messagehubtriggerHostPort)

    val monitorHost = this(WhiskConfig.monitorHostName) + ":" + this(WhiskConfig.monitorHostPort)
    val zookeeperHost = this(WhiskConfig.zookeeperHostName) + ":" + this(WhiskConfig.zookeeperHostPort)
    val consulServer = this(WhiskConfig.consulServerHost) + ":" + this(WhiskConfig.consulPort)
    val consulServices = this(WhiskConfig.consulServiceList)
    val invokerHosts = this(WhiskConfig.invokerHostsList)

    val dbProvider = this(WhiskConfig.dbProvider)
    val dbUsername = this(WhiskConfig.dbUsername)
    val dbPassword = this(WhiskConfig.dbPassword)
    val dbProtocol = this(WhiskConfig.dbProtocol)
    val dbHost = this(WhiskConfig.dbHost)
    val dbPort = this(WhiskConfig.dbPort)
    val dbWhisk = this(WhiskConfig.dbWhisk)
    val dbAuths = this(WhiskConfig.dbAuths)
    val dbActivations = this(WhiskConfig.dbActivations)
    val dbCipher = this(WhiskConfig.dbCipher)
    val dbPrefix = this(WhiskConfig.dbPrefix)
    val authKey = this(WhiskConfig.authKey)

    val entitlementHost = this(WhiskConfig.entitlementHostName) + ":" + this(WhiskConfig.entitlementHostPort)
    val routerHost = this(WhiskConfig.routerHost)
    val cliApiHost = this(WhiskConfig.cliApiHost)

    val edgeDockerEndpoint = this(WhiskConfig.edgeDockerEndpoint)
    val kafkaDockerEndpoint = this(WhiskConfig.kafkaDockerEndpoint)<commit_msg>Add address of edge host to WhiskConfig<commit_after>/*
 * Copyright 2015-2016 IBM Corporation
 *
 * 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
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package whisk.core

import whisk.common.Config
import java.io.File
import whisk.common.Crypt

/**
 * A set of properties which might be needed to run a whisk microservice implemented
 * in scala.
 *
 * @param requiredProperties a Map whose keys define properties that must be bound to
 * a value, and whose values are default values.   A null value in the Map means there is
 * no default value specified, so it must appear in the properties file
 * @param whiskPropertiesFile a File object, the whisk.properties file
 */

class WhiskConfig(
    requiredProperties: Map[String, String])
    extends Config(requiredProperties, WhiskConfig.whiskPropertiesFile) {

    val logsDir = this(WhiskConfig.logsDir)
    val servicePort = this(WhiskConfig.servicePort)
    val dockerRegistry = this(WhiskConfig.dockerRegistry)
    val dockerEndpoint = this(WhiskConfig.dockerEndpoint)
    val selfDockerEndpoint = this(WhiskConfig.selfDockerEndpoint)
    val dockerPort = this(WhiskConfig.dockerPort)

    val dockerImageTag = this(WhiskConfig.dockerImageTag)

    val invokerContainerNetwork = this(WhiskConfig.invokerContainerNetwork)

    val controllerHost = this(WhiskConfig.controllerHostName) + ":" + this(WhiskConfig.controllerHostPort)
    val edgeHost = this(WhiskConfig.edgeHostName) + ":" + this(WhiskConfig.edgeHostApiPort)
    val elkHost = this(WhiskConfig.elkHostName) + ":" + this(WhiskConfig.elkHostPort)
    val kafkaHost = this(WhiskConfig.kafkaHostName) + ":" + this(WhiskConfig.kafkaHostPort)
    val kafkaPartitions = this(WhiskConfig.kafkaPartitions)
    val loadbalancerHost = this(WhiskConfig.loadbalancerHostName) + ":" + this(WhiskConfig.loadbalancerHostPort)
    val messagehubtriggerHost = this(WhiskConfig.messagehubtriggerHostName) + ":" + this(WhiskConfig.messagehubtriggerHostPort)

    val edgeHostName = this(WhiskConfig.edgeHostName)

    val monitorHost = this(WhiskConfig.monitorHostName) + ":" + this(WhiskConfig.monitorHostPort)
    val zookeeperHost = this(WhiskConfig.zookeeperHostName) + ":" + this(WhiskConfig.zookeeperHostPort)
    val consulServer = this(WhiskConfig.consulServerHost) + ":" + this(WhiskConfig.consulPort)
    val consulServices = this(WhiskConfig.consulServiceList)
    val invokerHosts = this(WhiskConfig.invokerHostsList)

    val dbProvider = this(WhiskConfig.dbProvider)
    val dbUsername = this(WhiskConfig.dbUsername)
    val dbPassword = this(WhiskConfig.dbPassword)
    val dbProtocol = this(WhiskConfig.dbProtocol)
    val dbHost = this(WhiskConfig.dbHost)
    val dbPort = this(WhiskConfig.dbPort)
    val dbWhisk = this(WhiskConfig.dbWhisk)
    val dbAuths = this(WhiskConfig.dbAuths)
    val dbActivations = this(WhiskConfig.dbActivations)
    val dbCipher = this(WhiskConfig.dbCipher)
    val dbPrefix = this(WhiskConfig.dbPrefix)
    val authKey = this(WhiskConfig.authKey)

    val entitlementHost = this(WhiskConfig.entitlementHostName) + ":" + this(WhiskConfig.entitlementHostPort)
    val routerHost = this(WhiskConfig.routerHost)
    val cliApiHost = this(WhiskConfig.cliApiHost)

    val edgeDockerEndpoint = this(WhiskConfig.edgeDockerEndpoint)
    val kafkaDockerEndpoint = this(WhiskConfig.kafkaDockerEndpoint)
{'fraction_non_alphanumeric': 0.08235758452835153, 'fraction_numerical': 0.003157479279042231, 'mean_word_length': 4.834228702993093, 'pattern_counts': {'":': 20, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4260861', 'n_tokens_mistral': 2265, 'n_tokens_neox': 2210, 'n_words': 580}