⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 intertrackerprotocol.java

📁 hadoop:Nutch集群平台
💻 JAVA
字号:
/** * Copyright 2005 The Apache Software Foundation * * Licensed 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.io.*;import org.apache.hadoop.ipc.VersionedProtocol;/**  * Protocol that a TaskTracker and the central JobTracker use to communicate. * The JobTracker is the Server, which implements this protocol. */ interface InterTrackerProtocol extends VersionedProtocol {  // version 2 introduced to replace TaskStatus.State with an enum  public static final long versionID = 2L;    public final static int TRACKERS_OK = 0;  public final static int UNKNOWN_TASKTRACKER = 1;  /**    * Called regularly by the task tracker to update the status of its tasks   * within the job tracker.  JobTracker responds with a code that tells the    * TaskTracker whether all is well.   *   * TaskTracker must also indicate whether this is the first interaction   * (since state refresh)   */  int emitHeartbeat(TaskTrackerStatus status,                     boolean initialContact) throws IOException;  /** Called to get new tasks from from the job tracker for this tracker.*/  Task pollForNewTask(String trackerName) throws IOException;  /** Called to find which tasks that have been run by this tracker should now   * be closed because their job is complete.  This is used to, e.g.,    * notify a map task that its output is no longer needed and may    * be removed. */  String[] pollForTaskWithClosedJob(String trackerName) throws IOException;  /** Called by a reduce task to find which map tasks are completed.   *   * @param jobId the job id   * @param mapTasksNeeded an array of the mapIds that we need   * @param partition the reduce's id   * @return an array of MapOutputLocation   */  MapOutputLocation[] locateMapOutputs(String jobId,                                        int[] mapTasksNeeded,                                       int partition                                       ) throws IOException;  /**   * The task tracker calls this once, to discern where it can find   * files referred to by the JobTracker   */  public String getFilesystemName() throws IOException;    /**   * Report a problem to the job tracker.   * @param taskTracker the name of the task tracker   * @param errorClass the kind of error (eg. the class that was thrown)   * @param errorMessage the human readable error message   * @throws IOException if there was a problem in communication or on the   *                     remote side   */  public void reportTaskTrackerError(String taskTracker,                                     String errorClass,                                     String errorMessage) throws IOException;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -