JvmContext() { jvmId = new JVMId(); pid = ""; }
JvmContext() { jvmId = new JVMId(); pid = ""; }
JvmContext() { jvmId = new JVMId(); pid = ""; }
JvmContext() { jvmId = new JVMId(); pid = ""; }
JvmContext() { jvmId = new JVMId(); pid = ""; }
JvmContext() { jvmId = new JVMId(); pid = ""; }
public static JVMId read(DataInput in) throws IOException { JVMId jvmId = new JVMId(); jvmId.readFields(in); return jvmId; }
public JvmRunner(JvmEnv env, JobID jobId) { this.env = env; this.jvmId = new JVMId(jobId, isMap, rand.nextInt()); this.numTasksToRun = env.conf.getNumTasksToExecutePerJvm(); LOG.info("In JvmRunner constructed JVM ID: " + jvmId); } public void run() {
public JvmRunner(JvmEnv env, JobID jobId) { this.env = env; this.jvmId = new JVMId(jobId, isMap, rand.nextInt()); this.numTasksToRun = env.conf.getNumTasksToExecutePerJvm(); LOG.info("In JvmRunner constructed JVM ID: " + jvmId); } public void run() {
/** Construct a JVMId object from given string * @return constructed JVMId object or null if the given String is null * @throws IllegalArgumentException if the given string is malformed */ public static JVMId forName(String str) throws IllegalArgumentException { if(str == null) return null; try { String[] parts = str.split("_"); if(parts.length == 5) { if(parts[0].equals(JVM)) { boolean isMap = false; if(parts[3].equals("m")) isMap = true; else if(parts[3].equals("r")) isMap = false; else throw new Exception(); return new JVMId(parts[1], Integer.parseInt(parts[2]), isMap, Integer.parseInt(parts[4])); } } }catch (Exception ex) {//fall below } throw new IllegalArgumentException("TaskId string : " + str + " is not properly formed"); }
/** Construct a JVMId object from given string * @return constructed JVMId object or null if the given String is null * @throws IllegalArgumentException if the given string is malformed */ public static JVMId forName(String str) throws IllegalArgumentException { if(str == null) return null; try { String[] parts = str.split("_"); if(parts.length == 5) { if(parts[0].equals(JVM)) { boolean isMap = false; if(parts[3].equals("m")) isMap = true; else if(parts[3].equals("r")) isMap = false; else throw new Exception(); return new JVMId(parts[1], Integer.parseInt(parts[2]), isMap, Integer.parseInt(parts[4])); } } }catch (Exception ex) {//fall below } throw new IllegalArgumentException("TaskId string : " + str + " is not properly formed"); }
/** Construct a JVMId object from given string * @return constructed JVMId object or null if the given String is null * @throws IllegalArgumentException if the given string is malformed */ public static JVMId forName(String str) throws IllegalArgumentException { if(str == null) return null; try { String[] parts = str.split("_"); if(parts.length == 5) { if(parts[0].equals(JVM)) { boolean isMap = false; if(parts[3].equals("m")) isMap = true; else if(parts[3].equals("r")) isMap = false; else throw new Exception(); return new JVMId(parts[1], Integer.parseInt(parts[2]), isMap, Integer.parseInt(parts[4])); } } }catch (Exception ex) {//fall below } throw new IllegalArgumentException("TaskId string : " + str + " is not properly formed"); }
/** Construct a JVMId object from given string * @return constructed JVMId object or null if the given String is null * @throws IllegalArgumentException if the given string is malformed */ public static JVMId forName(String str) throws IllegalArgumentException { if(str == null) return null; try { String[] parts = str.split("_"); if(parts.length == 5) { if(parts[0].equals(JVM)) { boolean isMap = false; if(parts[3].equals("m")) isMap = true; else if(parts[3].equals("r")) isMap = false; else throw new Exception(); return new JVMId(parts[1], Integer.parseInt(parts[2]), isMap, Integer.parseInt(parts[4])); } } }catch (Exception ex) {//fall below } throw new IllegalArgumentException("TaskId string : " + str + " is not properly formed"); }
/** Construct a JVMId object from given string * @return constructed JVMId object or null if the given String is null * @throws IllegalArgumentException if the given string is malformed */ public static JVMId forName(String str) throws IllegalArgumentException { if(str == null) return null; try { String[] parts = str.split("_"); if(parts.length == 5) { if(parts[0].equals(JVM)) { boolean isMap = false; if(parts[3].equals("m")) isMap = true; else if(parts[3].equals("r")) isMap = false; else throw new Exception(); return new JVMId(parts[1], Integer.parseInt(parts[2]), isMap, Integer.parseInt(parts[4])); } } }catch (Exception ex) {//fall below } throw new IllegalArgumentException("TaskId string : " + str + " is not properly formed"); }
/** Construct a JVMId object from given string * @return constructed JVMId object or null if the given String is null * @throws IllegalArgumentException if the given string is malformed */ public static JVMId forName(String str) throws IllegalArgumentException { if(str == null) return null; try { String[] parts = str.split("_"); if(parts.length == 5) { if(parts[0].equals(JVM)) { boolean isMap = false; if(parts[3].equals("m")) isMap = true; else if(parts[3].equals("r")) isMap = false; else throw new Exception(); return new JVMId(parts[1], Integer.parseInt(parts[2]), isMap, Integer.parseInt(parts[4])); } } }catch (Exception ex) {//fall below } throw new IllegalArgumentException("TaskId string : " + str + " is not properly formed"); }
/** Construct a JVMId object from given string * @return constructed JVMId object or null if the given String is null * @throws IllegalArgumentException if the given string is malformed */ public static JVMId forName(String str) throws IllegalArgumentException { if(str == null) return null; try { String[] parts = str.split("_"); if(parts.length == 5) { if(parts[0].equals(JVM)) { boolean isMap = false; if(parts[3].equals("m")) isMap = true; else if(parts[3].equals("r")) isMap = false; else throw new Exception(); return new JVMId(parts[1], Integer.parseInt(parts[2]), isMap, Integer.parseInt(parts[4])); } } }catch (Exception ex) {//fall below } throw new IllegalArgumentException("TaskId string : " + str + " is not properly formed"); }
public JvmRunner(JvmEnv env, JobID jobId) { this.env = env; this.jvmId = new JVMId(jobId, isMap, rand.nextInt()); this.numTasksToRun = env.conf.getNumTasksToExecutePerJvm(); this.initalContext = new TaskControllerContext(); initalContext.sleeptimeBeforeSigkill = tracker.getJobConf() .getLong(TTConfig.TT_SLEEP_TIME_BEFORE_SIG_KILL, ProcessTree.DEFAULT_SLEEPTIME_BEFORE_SIGKILL); LOG.info("In JvmRunner constructed JVM ID: " + jvmId); } public void run() {
/** * Run the given task asynchronously. */ void runTask(Task task) { JobID jobId = task.getJobID(); boolean isMap = task.isMapTask(); JVMId jvmId = new JVMId(jobId, isMap, taskCounter++); synchronized(this) { taskJvms.put(jvmId.getId(), jvmId); runningTasks.put(jvmId.getId(), task); } TaskRunnable taskRunnable = new TaskRunnable(task, jvmId.getId()); executor.execute(taskRunnable); }
@Test (timeout=5000) public void testJVMId() { JVMId jvmid = new JVMId("test", 1, true, 2); JVMId jvmid1 = JVMId.forName("jvm_test_0001_m_000002"); // test compare methot should be the same assertEquals(0, jvmid.compareTo(jvmid1)); }
private void configureMocks() { firstReduceStatus = new ReduceTaskStatus(attemptID, 0.0f, 1, TaskStatus.State.RUNNING, "", "RUNNING", "", TaskStatus.Phase.SHUFFLE, new Counters()); firstReduceStatus.addFetchFailedMap(TaskAttemptID.forName(ATTEMPT1_ID)); secondReduceStatus = new ReduceTaskStatus(attemptID, 0.0f, 1, TaskStatus.State.RUNNING, "", "RUNNING", "", TaskStatus.Phase.SORT, new Counters()); secondReduceStatus.addFetchFailedMap(TaskAttemptID.forName(ATTEMPT2_ID)); thirdReduceStatus = new ReduceTaskStatus(attemptID, 0.0f, 1, TaskStatus.State.RUNNING, "", "RUNNING", "", TaskStatus.Phase.REDUCE, new Counters()); when(dispatcher.getEventHandler()).thenReturn(ea); when(appCtx.getEventHandler()).thenReturn(ea); policy = new CheckpointAMPreemptionPolicy(); policy.init(appCtx); listener = new MockTaskAttemptListenerImpl(appCtx, secret, rmHeartbeatHandler, hbHandler, policy); id = new JVMId("foo", 1, true, 1); wid = new WrappedJvmID(id.getJobId(), id.isMap, id.getId()); attemptID = new TaskAttemptID("1", 1, TaskType.MAP, 1, 1); attemptId = TypeConverter.toYarn(attemptID); }