001/* 002 * Licensed to the Apache Software Foundation (ASF) under one 003 * or more contributor license agreements. See the NOTICE file 004 * distributed with this work for additional information 005 * regarding copyright ownership. The ASF licenses this file 006 * to you under the Apache License, Version 2.0 (the 007 * "License"); you may not use this file except in compliance 008 * with the License. You may obtain a copy of the License at 009 * 010 * http://www.apache.org/licenses/LICENSE-2.0 011 * 012 * Unless required by applicable law or agreed to in writing, 013 * software distributed under the License is distributed on an 014 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 015 * KIND, either express or implied. See the License for the 016 * specific language governing permissions and limitations 017 * under the License. 018 */ 019package org.apache.reef.runtime.standalone.client; 020 021import org.apache.reef.annotations.Unstable; 022import org.apache.reef.client.parameters.DriverConfigurationProviders; 023import org.apache.reef.runtime.common.client.CommonRuntimeConfiguration; 024import org.apache.reef.runtime.standalone.client.parameters.NodeListFilePath; 025import org.apache.reef.runtime.standalone.client.parameters.RootFolder; 026import org.apache.reef.tang.ConfigurationProvider; 027import org.apache.reef.tang.formats.*; 028 029/** 030 * A ConfigurationModule to configure the standalone resourcemanager. 031 */ 032@Unstable 033public final class StandaloneRuntimeConfiguration extends ConfigurationModuleBuilder { 034 035 /** 036 * The folder in which the sub-folders, one per Node, will be created. Those will contain one folder per 037 * Evaluator instantiated on the virtual node. Those inner folders will be named by the time when the Evaluator was 038 * launched. 039 * <p> 040 * If none is given, a folder "REEF_STANDALONE_RUNTIME" will be created in the local directory. 041 */ 042 public static final OptionalParameter<String> RUNTIME_ROOT_FOLDER = new OptionalParameter<>(); 043 044 /** 045 * Configuration provides whose Configuration will be merged into all Driver Configuration. 046 */ 047 public static final OptionalImpl<ConfigurationProvider> DRIVER_CONFIGURATION_PROVIDERS = new OptionalImpl<>(); 048 049 /** 050 * The file which will contain information of remote nodes. 051 */ 052 public static final RequiredParameter<String> NODE_LIST_FILE_PATH = new RequiredParameter<>(); 053 054 /** 055 * The ConfigurationModule for the standalone resourcemanager. 056 */ 057 public static final ConfigurationModule CONF = new StandaloneRuntimeConfiguration() 058 .merge(CommonRuntimeConfiguration.CONF) 059 // Bind parameters of the standalone runtime 060 .bindNamedParameter(RootFolder.class, RUNTIME_ROOT_FOLDER) 061 .bindNamedParameter(NodeListFilePath.class, NODE_LIST_FILE_PATH) 062 .bindSetEntry(DriverConfigurationProviders.class, DRIVER_CONFIGURATION_PROVIDERS) 063 .build(); 064}