Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SW-2397] Automatically generate R configuration from Scala code #2269

Merged
merged 2 commits into from
Aug 4, 2020

Conversation

jakubhava
Copy link
Contributor

@jakubhava jakubhava commented Aug 4, 2020

Example of a generated file:

#
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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.
#

if (!exists("ConfUtils.getOption", mode = "function")) source(file.path("R", "ConfUtils.R"))

#' @export ExternalBackendConf
InternalBackendConf <- setRefClass("InternalBackendConf", methods = list(

    #
    # Getters
    #

    numH2OWorkers = function() { ConfUtils.getOption(invoke(jconf, "numH2OWorkers")) },

    drddMulFactor = function() { invoke(jconf, "drddMulFactor") },

    numRddRetries = function() { invoke(jconf, "numRddRetries") },

    defaultCloudSize = function() { invoke(jconf, "defaultCloudSize") },

    subseqTries = function() { invoke(jconf, "subseqTries") },

    hdfsConf = function() { ConfUtils.getOption(invoke(jconf, "hdfsConf")) },

    spreadRddRetriesTimeout = function() { invoke(jconf, "spreadRddRetriesTimeout") },

    nodeIcedDir = function() { ConfUtils.getOption(invoke(jconf, "nodeIcedDir")) },

    #
    # Setters
    #

    setNumH2OWorkers = function(value) { invoke(jconf, "setNumH2OWorkers", value); .self },

    setDrddMulFactor = function(value) { invoke(jconf, "setDrddMulFactor", value); .self },

    setNumRddRetries = function(value) { invoke(jconf, "setNumRddRetries", value); .self },

    setDefaultCloudSize = function(value) { invoke(jconf, "setDefaultCloudSize", value); .self },

    setSubseqTries = function(value) { invoke(jconf, "setSubseqTries", value); .self },

    setHdfsConf = function(value) { invoke(jconf, "setHdfsConf", value); .self },

    setSpreadRddRetriesTimeout = function(value) { invoke(jconf, "setSpreadRddRetriesTimeout", value); .self },

    setNodeIcedDir = function(value) { invoke(jconf, "setNodeIcedDir", value); .self }
))

@jakubhava jakubhava added the next major release Goes into Major release label Aug 4, 2020
@jakubhava jakubhava requested a review from mn-mikke August 4, 2020 08:16
Copy link
Collaborator

@mn-mikke mn-mikke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
next major release Goes into Major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants