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.mesos.client; 020 021import org.apache.hadoop.conf.Configuration; 022import org.apache.reef.annotations.audience.ClientSide; 023import org.apache.reef.annotations.audience.Public; 024import org.apache.reef.runtime.common.client.CommonRuntimeConfiguration; 025import org.apache.reef.runtime.common.client.DriverConfigurationProvider; 026import org.apache.reef.runtime.common.client.api.JobSubmissionHandler; 027import org.apache.reef.runtime.common.files.RuntimeClasspathProvider; 028import org.apache.reef.runtime.mesos.MesosClasspathProvider; 029import org.apache.reef.runtime.mesos.client.parameters.MasterIp; 030import org.apache.reef.runtime.mesos.client.parameters.RootFolder; 031import org.apache.reef.runtime.mesos.util.HDFSConfigurationConstructor; 032import org.apache.reef.tang.formats.ConfigurationModule; 033import org.apache.reef.tang.formats.ConfigurationModuleBuilder; 034import org.apache.reef.tang.formats.OptionalParameter; 035import org.apache.reef.tang.formats.RequiredParameter; 036 037/** 038 * A ConfigurationModule for the Mesos resource manager. 039 */ 040@Public 041@ClientSide 042public class MesosClientConfiguration extends ConfigurationModuleBuilder { 043 /** 044 * The folder in which the sub-folders for REEF drivers, one per job, will be created. 045 * If none is given, a folder "REEF_MESOS_RUNTIME" will be created in the local directory. 046 */ 047 public static final OptionalParameter<String> ROOT_FOLDER = new OptionalParameter<>(); 048 049 /** 050 * The ip address of Mesos Master. 051 */ 052 public static final RequiredParameter<String> MASTER_IP = new RequiredParameter<>(); 053 054 public static final ConfigurationModule CONF = new MesosClientConfiguration() 055 .merge(CommonRuntimeConfiguration.CONF) 056 .bindImplementation(JobSubmissionHandler.class, MesosJobSubmissionHandler.class) 057 .bindImplementation(DriverConfigurationProvider.class, MesosDriverConfigurationProviderImpl.class) 058 .bindNamedParameter(RootFolder.class, ROOT_FOLDER) 059 .bindNamedParameter(MasterIp.class, MASTER_IP) 060 .bindConstructor(Configuration.class, HDFSConfigurationConstructor.class) 061 .bindImplementation(RuntimeClasspathProvider.class, MesosClasspathProvider.class) 062 .build(); 063}