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.common.evaluator.PIDStoreStartHandler; 025import org.apache.reef.runtime.standalone.client.parameters.NodeListFilePath; 026import org.apache.reef.runtime.standalone.client.parameters.RootFolder; 027import org.apache.reef.tang.ConfigurationProvider; 028import org.apache.reef.tang.formats.*; 029import org.apache.reef.wake.time.Clock; 030 031/** 032 * A ConfigurationModule to configure the standalone resourcemanager. 033 */ 034@Unstable 035public final class StandaloneRuntimeConfiguration extends ConfigurationModuleBuilder { 036 037 /** 038 * The folder in which the sub-folders, one per Node, will be created. Those will contain one folder per 039 * Evaluator instantiated on the virtual node. Those inner folders will be named by the time when the Evaluator was 040 * launched. 041 * <p> 042 * If none is given, a folder "REEF_STANDALONE_RUNTIME" will be created in the local directory. 043 */ 044 public static final OptionalParameter<String> RUNTIME_ROOT_FOLDER = new OptionalParameter<>(); 045 046 /** 047 * Configuration provides whose Configuration will be merged into all Driver Configuration. 048 */ 049 public static final OptionalImpl<ConfigurationProvider> DRIVER_CONFIGURATION_PROVIDERS = new OptionalImpl<>(); 050 051 /** 052 * The file which will contain information of remote nodes. 053 */ 054 public static final RequiredParameter<String> NODE_LIST_FILE_PATH = new RequiredParameter<>(); 055 056 /** 057 * The ConfigurationModule for the standalone resourcemanager. 058 */ 059 public static final ConfigurationModule CONF = new StandaloneRuntimeConfiguration() 060 .merge(CommonRuntimeConfiguration.CONF) 061 // Bind parameters of the standalone runtime 062 .bindNamedParameter(RootFolder.class, RUNTIME_ROOT_FOLDER) 063 .bindNamedParameter(NodeListFilePath.class, NODE_LIST_FILE_PATH) 064 .bindSetEntry(DriverConfigurationProviders.class, DRIVER_CONFIGURATION_PROVIDERS) 065 .bindSetEntry(Clock.StartHandler.class, PIDStoreStartHandler.class) 066 .build(); 067 068 069}