This project has retired. For details please refer to its Attic page.
Source code
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.common.driver.api;
020
021import org.apache.reef.annotations.audience.DriverSide;
022import org.apache.reef.annotations.audience.RuntimeAuthor;
023import org.apache.reef.tang.annotations.DefaultImplementation;
024import org.apache.reef.util.Optional;
025
026import java.util.List;
027
028/**
029 * Event from Driver Process to Driver Runtime.
030 * A request to the Driver Runtime to allocate resources with the given specification
031 */
032@RuntimeAuthor
033@DriverSide
034@DefaultImplementation(ResourceRequestEventImpl.class)
035public interface ResourceRequestEvent {
036
037  /**
038   * @return The number of resources requested
039   */
040  int getResourceCount();
041
042  /**
043   * @return A list of preferred nodes to place the resource on.
044   *   An empty list indicates all nodes are equally preferred.
045   */
046  List<String> getNodeNameList();
047
048  /**
049   * @return A list of preferred racks to place the resource on,
050   *   An empty list indicates all racks are equally preferred.
051   */
052  List<String> getRackNameList();
053
054  /**
055   * @return The amount of memory to allocate to the resource
056   */
057  Optional<Integer> getMemorySize();
058
059  /**
060   * @return The priority assigned to the resource
061   */
062  Optional<Integer> getPriority();
063
064  /**
065   * @return The number of virtual CPU cores to allocate for the resource
066   */
067  Optional<Integer> getVirtualCores();
068
069  /**
070   * @return If true, allow allocation on nodes and racks other than
071   *   the preferred list. If false, strictly enforce the preferences.
072   */
073  Optional<Boolean> getRelaxLocality();
074
075  /**
076   * @return The runtime name
077   */
078  String getRuntimeName();
079}