hadoop QueueRefresher 源码

  • 2022-10-20
  • 浏览 (133)

haddop QueueRefresher 代码

文件路径:/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/QueueRefresher.java

/**
 * 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.
 */

package org.apache.hadoop.mapred;

import java.util.List;

/**
 * Abstract QueueRefresher class. Scheduler's can extend this and return an
 * instance of this in the {@link #getQueueRefresher()} method. The
 * {@link #refreshQueues(List)} method of this instance will be invoked by the
 * {@link QueueManager} whenever it gets a request from an administrator to
 * refresh its own queue-configuration. This method has a documented contract
 * between the {@link QueueManager} and the {@link TaskScheduler}.
 * 
 * Before calling QueueRefresher, the caller must hold the lock to the
 * corresponding {@link TaskScheduler} (generally in the {@link JobTracker}).
 */
abstract class QueueRefresher {

  /**
   * Refresh the queue-configuration in the scheduler. This method has the
   * following contract.
   * <ol>
   * <li>Before this method, {@link QueueManager} does a validation of the new
   * queue-configuration. For e.g, currently addition of new queues, or
   * removal of queues at any level in the hierarchy is not supported by
   * {@link QueueManager} and so are not supported for schedulers too.</li>
   * <li>Schedulers will be passed a list of {@link JobQueueInfo}s of the root
   * queues i.e. the queues at the top level. All the descendants are properly
   * linked from these top-level queues.</li>
   * <li>Schedulers should use the scheduler specific queue properties from
   * the newRootQueues, validate the properties themselves and apply them
   * internally.</li>
   * <li>
   * Once the method returns successfully from the schedulers, it is assumed
   * that the refresh of queue properties is successful throughout and will be
   * 'committed' internally to {@link QueueManager} too. It is guaranteed that
   * at no point, after successful return from the scheduler, is the queue
   * refresh in QueueManager failed. If ever, such abnormalities happen, the
   * queue framework will be inconsistent and will need a JT restart.</li>
   * <li>If scheduler throws an exception during {@link #refreshQueues()},
   * {@link QueueManager} throws away the newly read configuration, retains
   * the old (consistent) configuration and informs the request issuer about
   * the error appropriately.</li>
   * </ol>
   * 
   * @param newRootQueues
   */
  abstract void refreshQueues(List<JobQueueInfo> newRootQueues)
      throws Throwable;
}

相关信息

hadoop 源码目录

相关文章

hadoop AMFeedback 源码

hadoop BackupStore 源码

hadoop BasicTypeSorterBase 源码

hadoop BufferSorter 源码

hadoop CleanupQueue 源码

hadoop Clock 源码

hadoop ClusterStatus 源码

hadoop Counters 源码

hadoop CumulativePeriodicStats 源码

hadoop DeprecatedQueueConfigurationParser 源码

0  赞