You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@eagle.apache.org by qi...@apache.org on 2016/08/25 05:02:43 UTC
[1/4] incubator-eagle git commit: [minor] Change resourceFetch to
resourcefetch
Repository: incubator-eagle
Updated Branches:
refs/heads/develop 6f5f972c9 -> b5fd782c0
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/SparkStage.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/SparkStage.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/SparkStage.java
new file mode 100644
index 0000000..14edeee
--- /dev/null
+++ b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/SparkStage.java
@@ -0,0 +1,211 @@
+/*
+ *
+ * * 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.eagle.jpm.util.resourcefetch.model;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
+import java.util.Map;
+
+@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class SparkStage {
+ private String status;
+ private int stageId;
+ private int attemptId;
+ private int numActiveTasks;
+ private int numCompleteTasks;
+ private int numFailedTasks;
+ private long executorRunTime;
+ private long inputBytes;
+ private long inputRecords;
+ private long outputBytes;
+ private long outputRecords;
+ private long shuffleReadBytes;
+ private long shuffleReadRecords;
+ private long shuffleWriteBytes;
+ private long shuffleWriteRecords;
+ private long memoryBytesSpilled;
+ private long diskBytesSpilled;
+ private String name;
+ private String schedulingPool;
+ //taskID
+ private Map<String, SparkTask> tasks;
+
+ public String getStatus() {
+ return status;
+ }
+
+ public void setStatus(String status) {
+ this.status = status;
+ }
+
+ public int getStageId() {
+ return stageId;
+ }
+
+ public void setStageId(int stageId) {
+ this.stageId = stageId;
+ }
+
+ public int getAttemptId() {
+ return attemptId;
+ }
+
+ public void setAttemptId(int attemptId) {
+ this.attemptId = attemptId;
+ }
+
+ public int getNumActiveTasks() {
+ return numActiveTasks;
+ }
+
+ public void setNumActiveTasks(int numActiveTasks) {
+ this.numActiveTasks = numActiveTasks;
+ }
+
+ public int getNumCompleteTasks() {
+ return numCompleteTasks;
+ }
+
+ public void setNumCompleteTasks(int numCompleteTasks) {
+ this.numCompleteTasks = numCompleteTasks;
+ }
+
+ public int getNumFailedTasks() {
+ return numFailedTasks;
+ }
+
+ public void setNumFailedTasks(int numFailedTasks) {
+ this.numFailedTasks = numFailedTasks;
+ }
+
+ public long getExecutorRunTime() {
+ return executorRunTime;
+ }
+
+ public void setExecutorRunTime(long executorRunTime) {
+ this.executorRunTime = executorRunTime;
+ }
+
+ public long getInputBytes() {
+ return inputBytes;
+ }
+
+ public void setInputBytes(long inputBytes) {
+ this.inputBytes = inputBytes;
+ }
+
+ public long getInputRecords() {
+ return inputRecords;
+ }
+
+ public void setInputRecords(long inputRecords) {
+ this.inputRecords = inputRecords;
+ }
+
+ public long getOutputBytes() {
+ return outputBytes;
+ }
+
+ public void setOutputBytes(long outputBytes) {
+ this.outputBytes = outputBytes;
+ }
+
+ public long getOutputRecords() {
+ return outputRecords;
+ }
+
+ public void setOutputRecords(long outputRecords) {
+ this.outputRecords = outputRecords;
+ }
+
+ public long getShuffleReadBytes() {
+ return shuffleReadBytes;
+ }
+
+ public void setShuffleReadBytes(long shuffleReadBytes) {
+ this.shuffleReadBytes = shuffleReadBytes;
+ }
+
+ public long getShuffleReadRecords() {
+ return shuffleReadRecords;
+ }
+
+ public void setShuffleReadRecords(long shuffleReadRecords) {
+ this.shuffleReadRecords = shuffleReadRecords;
+ }
+
+ public long getShuffleWriteBytes() {
+ return shuffleWriteBytes;
+ }
+
+ public void setShuffleWriteBytes(long shuffleWriteBytes) {
+ this.shuffleWriteBytes = shuffleWriteBytes;
+ }
+
+ public long getShuffleWriteRecords() {
+ return shuffleWriteRecords;
+ }
+
+ public void setShuffleWriteRecords(long shuffleWriteRecords) {
+ this.shuffleWriteRecords = shuffleWriteRecords;
+ }
+
+ public long getMemoryBytesSpilled() {
+ return memoryBytesSpilled;
+ }
+
+ public void setMemoryBytesSpilled(long memoryBytesSpilled) {
+ this.memoryBytesSpilled = memoryBytesSpilled;
+ }
+
+ public long getDiskBytesSpilled() {
+ return diskBytesSpilled;
+ }
+
+ public void setDiskBytesSpilled(long diskBytesSpilled) {
+ this.diskBytesSpilled = diskBytesSpilled;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getSchedulingPool() {
+ return schedulingPool;
+ }
+
+ public void setSchedulingPool(String schedulingPool) {
+ this.schedulingPool = schedulingPool;
+ }
+
+ public Map<String, SparkTask> getTasks() {
+ return tasks;
+ }
+
+ public void setTasks(Map<String, SparkTask> tasks) {
+ this.tasks = tasks;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/SparkTask.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/SparkTask.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/SparkTask.java
new file mode 100644
index 0000000..a5dd08f
--- /dev/null
+++ b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/SparkTask.java
@@ -0,0 +1,111 @@
+/*
+ *
+ * * 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.eagle.jpm.util.resourcefetch.model;
+
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
+@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class SparkTask {
+ private int taskId;
+ private int index;
+ private int attempt;
+ private String launchTime;
+ private String executorId;
+ private String host;
+ private String taskLocality;
+ private boolean speculative;
+ private SparkTaskMetrics taskMetrics;
+
+ public int getTaskId() {
+ return taskId;
+ }
+
+ public void setTaskId(int taskId) {
+ this.taskId = taskId;
+ }
+
+ public int getIndex() {
+ return index;
+ }
+
+ public void setIndex(int index) {
+ this.index = index;
+ }
+
+ public int getAttempt() {
+ return attempt;
+ }
+
+ public void setAttempt(int attempt) {
+ this.attempt = attempt;
+ }
+
+ public String getLaunchTime() {
+ return launchTime;
+ }
+
+ public void setLaunchTime(String launchTime) {
+ this.launchTime = launchTime;
+ }
+
+ public String getExecutorId() {
+ return executorId;
+ }
+
+ public void setExecutorId(String executorId) {
+ this.executorId = executorId;
+ }
+
+ public String getHost() {
+ return host;
+ }
+
+ public void setHost(String host) {
+ this.host = host;
+ }
+
+ public String getTaskLocality() {
+ return taskLocality;
+ }
+
+ public void setTaskLocality(String taskLocality) {
+ this.taskLocality = taskLocality;
+ }
+
+ public boolean isSpeculative() {
+ return speculative;
+ }
+
+ public void setSpeculative(boolean speculative) {
+ this.speculative = speculative;
+ }
+
+ public SparkTaskMetrics getTaskMetrics() {
+ return taskMetrics;
+ }
+
+ public void setTaskMetrics(SparkTaskMetrics taskMetrics) {
+ this.taskMetrics = taskMetrics;
+ }
+}
+
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/SparkTaskInputMetrics.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/SparkTaskInputMetrics.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/SparkTaskInputMetrics.java
new file mode 100644
index 0000000..d079694
--- /dev/null
+++ b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/SparkTaskInputMetrics.java
@@ -0,0 +1,46 @@
+/*
+ *
+ * * 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.eagle.jpm.util.resourcefetch.model;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
+@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class SparkTaskInputMetrics {
+ private long bytesRead;
+ private long recordsRead;
+
+ public long getBytesRead() {
+ return bytesRead;
+ }
+
+ public void setBytesRead(long bytesRead) {
+ this.bytesRead = bytesRead;
+ }
+
+ public long getRecordsRead() {
+ return recordsRead;
+ }
+
+ public void setRecordsRead(long recordsRead) {
+ this.recordsRead = recordsRead;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/SparkTaskMetrics.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/SparkTaskMetrics.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/SparkTaskMetrics.java
new file mode 100644
index 0000000..cdb913d
--- /dev/null
+++ b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/SparkTaskMetrics.java
@@ -0,0 +1,118 @@
+/*
+ *
+ * * 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.eagle.jpm.util.resourcefetch.model;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
+@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class SparkTaskMetrics {
+ private long executorDeserializeTime;
+ private long executorRunTime;
+ private long resultSize;
+ private long jvmGcTime;
+ private long resultSerializationTime;
+ private long memoryBytesSpilled;
+ private long diskBytesSpilled;
+ private SparkTaskInputMetrics inputMetrics;
+ private SparkTaskShuffleWriteMetrics shuffleWriteMetrics;
+ private SparkTaskShuffleReadMetrics shuffleReadMetrics;
+
+ public long getExecutorDeserializeTime() {
+ return executorDeserializeTime;
+ }
+
+ public void setExecutorDeserializeTime(long executorDeserializeTime) {
+ this.executorDeserializeTime = executorDeserializeTime;
+ }
+
+ public long getExecutorRunTime() {
+ return executorRunTime;
+ }
+
+ public void setExecutorRunTime(long executorRunTime) {
+ this.executorRunTime = executorRunTime;
+ }
+
+ public long getResultSize() {
+ return resultSize;
+ }
+
+ public void setResultSize(long resultSize) {
+ this.resultSize = resultSize;
+ }
+
+ public long getJvmGcTime() {
+ return jvmGcTime;
+ }
+
+ public void setJvmGcTime(long jvmGcTime) {
+ this.jvmGcTime = jvmGcTime;
+ }
+
+ public long getResultSerializationTime() {
+ return resultSerializationTime;
+ }
+
+ public void setResultSerializationTime(long resultSerializationTime) {
+ this.resultSerializationTime = resultSerializationTime;
+ }
+
+ public long getMemoryBytesSpilled() {
+ return memoryBytesSpilled;
+ }
+
+ public void setMemoryBytesSpilled(long memoryBytesSpilled) {
+ this.memoryBytesSpilled = memoryBytesSpilled;
+ }
+
+ public long getDiskBytesSpilled() {
+ return diskBytesSpilled;
+ }
+
+ public void setDiskBytesSpilled(long diskBytesSpilled) {
+ this.diskBytesSpilled = diskBytesSpilled;
+ }
+
+ public SparkTaskInputMetrics getInputMetrics() {
+ return inputMetrics;
+ }
+
+ public void setInputMetrics(SparkTaskInputMetrics inputMetrics) {
+ this.inputMetrics = inputMetrics;
+ }
+
+ public SparkTaskShuffleWriteMetrics getShuffleWriteMetrics() {
+ return shuffleWriteMetrics;
+ }
+
+ public void setShuffleWriteMetrics(SparkTaskShuffleWriteMetrics shuffleWriteMetrics) {
+ this.shuffleWriteMetrics = shuffleWriteMetrics;
+ }
+
+ public SparkTaskShuffleReadMetrics getShuffleReadMetrics() {
+ return shuffleReadMetrics;
+ }
+
+ public void setShuffleReadMetrics(SparkTaskShuffleReadMetrics shuffleReadMetrics) {
+ this.shuffleReadMetrics = shuffleReadMetrics;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/SparkTaskShuffleReadMetrics.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/SparkTaskShuffleReadMetrics.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/SparkTaskShuffleReadMetrics.java
new file mode 100644
index 0000000..3aa94bb
--- /dev/null
+++ b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/SparkTaskShuffleReadMetrics.java
@@ -0,0 +1,82 @@
+/*
+ *
+ * * 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.eagle.jpm.util.resourcefetch.model;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
+@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class SparkTaskShuffleReadMetrics {
+ private long remoteBlocksFetched;
+ private long localBlocksFetched;
+ private long fetchWaitTime;
+ private long remoteBytesRead;
+ private long totalBlocksFetched;
+ private long recordsRead;
+
+ public long getRemoteBlocksFetched() {
+ return remoteBlocksFetched;
+ }
+
+ public void setRemoteBlocksFetched(long remoteBlocksFetched) {
+ this.remoteBlocksFetched = remoteBlocksFetched;
+ }
+
+ public long getLocalBlocksFetched() {
+ return localBlocksFetched;
+ }
+
+ public void setLocalBlocksFetched(long localBlocksFetched) {
+ this.localBlocksFetched = localBlocksFetched;
+ }
+
+ public long getFetchWaitTime() {
+ return fetchWaitTime;
+ }
+
+ public void setFetchWaitTime(long fetchWaitTime) {
+ this.fetchWaitTime = fetchWaitTime;
+ }
+
+ public long getRemoteBytesRead() {
+ return remoteBytesRead;
+ }
+
+ public void setRemoteBytesRead(long remoteBytesRead) {
+ this.remoteBytesRead = remoteBytesRead;
+ }
+
+ public long getTotalBlocksFetched() {
+ return totalBlocksFetched;
+ }
+
+ public void setTotalBlocksFetched(long totalBlocksFetched) {
+ this.totalBlocksFetched = totalBlocksFetched;
+ }
+
+ public long getRecordsRead() {
+ return recordsRead;
+ }
+
+ public void setRecordsRead(long recordsRead) {
+ this.recordsRead = recordsRead;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/SparkTaskShuffleWriteMetrics.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/SparkTaskShuffleWriteMetrics.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/SparkTaskShuffleWriteMetrics.java
new file mode 100644
index 0000000..3d8f025
--- /dev/null
+++ b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/SparkTaskShuffleWriteMetrics.java
@@ -0,0 +1,55 @@
+/*
+ *
+ * * 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.eagle.jpm.util.resourcefetch.model;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
+@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class SparkTaskShuffleWriteMetrics {
+ private long bytesWritten;
+ private long writeTime;
+ private long recordsWritten;
+
+ public long getBytesWritten() {
+ return bytesWritten;
+ }
+
+ public void setBytesWritten(long bytesWritten) {
+ this.bytesWritten = bytesWritten;
+ }
+
+ public long getWriteTime() {
+ return writeTime;
+ }
+
+ public void setWriteTime(long writeTime) {
+ this.writeTime = writeTime;
+ }
+
+ public long getRecordsWritten() {
+ return recordsWritten;
+ }
+
+ public void setRecordsWritten(long recordsWritten) {
+ this.recordsWritten = recordsWritten;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/TaskCounterGroup.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/TaskCounterGroup.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/TaskCounterGroup.java
new file mode 100644
index 0000000..9803d11
--- /dev/null
+++ b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/TaskCounterGroup.java
@@ -0,0 +1,46 @@
+/*
+ * 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.eagle.jpm.util.resourcefetch.model;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
+import java.util.List;
+
+@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class TaskCounterGroup {
+ public String getCounterGroupName() {
+ return counterGroupName;
+ }
+
+ public void setCounterGroupName(String counterGroupName) {
+ this.counterGroupName = counterGroupName;
+ }
+
+ public List<TaskCounterItem> getCounter() {
+ return counter;
+ }
+
+ public void setCounter(List<TaskCounterItem> counter) {
+ this.counter = counter;
+ }
+
+ private String counterGroupName;
+ private List<TaskCounterItem> counter;
+}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/TaskCounterItem.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/TaskCounterItem.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/TaskCounterItem.java
new file mode 100644
index 0000000..f8ea22c
--- /dev/null
+++ b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/TaskCounterItem.java
@@ -0,0 +1,44 @@
+/*
+ * 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.eagle.jpm.util.resourcefetch.model;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
+@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class TaskCounterItem {
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public long getValue() {
+ return value;
+ }
+
+ public void setValue(long value) {
+ this.value = value;
+ }
+
+ private String name;
+ private long value;
+}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/TaskCounters.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/TaskCounters.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/TaskCounters.java
new file mode 100644
index 0000000..ef99547
--- /dev/null
+++ b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/TaskCounters.java
@@ -0,0 +1,46 @@
+/*
+ * 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.eagle.jpm.util.resourcefetch.model;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
+import java.util.List;
+
+@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class TaskCounters {
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public List<TaskCounterGroup> getTaskCounterGroup() {
+ return taskCounterGroup;
+ }
+
+ public void setTaskCounterGroup(List<TaskCounterGroup> taskCounterGroup) {
+ this.taskCounterGroup = taskCounterGroup;
+ }
+
+ private String id;
+ private List<TaskCounterGroup> taskCounterGroup;
+}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/TaskCountersWrapper.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/TaskCountersWrapper.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/TaskCountersWrapper.java
new file mode 100644
index 0000000..80808a3
--- /dev/null
+++ b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/TaskCountersWrapper.java
@@ -0,0 +1,35 @@
+/*
+ * 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.eagle.jpm.util.resourcefetch.model;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
+@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class TaskCountersWrapper {
+ public TaskCounters getJobTaskCounters() {
+ return jobTaskCounters;
+ }
+
+ public void setJobTaskCounters(TaskCounters jobTaskCounters) {
+ this.jobTaskCounters = jobTaskCounters;
+ }
+
+ private TaskCounters jobTaskCounters;
+}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/url/JobListServiceURLBuilderImpl.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/url/JobListServiceURLBuilderImpl.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/url/JobListServiceURLBuilderImpl.java
new file mode 100644
index 0000000..5513771
--- /dev/null
+++ b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/url/JobListServiceURLBuilderImpl.java
@@ -0,0 +1,52 @@
+/*
+ * 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.eagle.jpm.util.resourcefetch.url;
+
+import org.apache.eagle.jpm.util.Constants;
+
+public class JobListServiceURLBuilderImpl implements ServiceURLBuilder {
+
+ public String build(String... parameters) {
+ /**
+ * {rmUrl}/ws/v1/cluster/apps?state=RUNNING.
+ * We need to remove tailing slashes to avoid "url//ws/v1"
+ * because it would not be found and would be redirected to
+ * history server ui.
+ */
+ String rmUrl = URLUtil.removeTrailingSlash(parameters[0]);
+
+ String restApi = null;
+ String jobState = parameters[1];
+
+ if (jobState.equals(Constants.JobState.RUNNING.name())) {
+ restApi = Constants.V2_APPS_RUNNING_URL;
+ } else if (jobState.equals(Constants.JobState.FINISHED.name())) {
+ restApi = Constants.V2_APPS_COMPLETED_URL;
+ } else if (jobState.equals(Constants.JobState.ALL.name())) {
+ restApi = Constants.V2_APPS_URL;
+ }
+ if (restApi == null) {
+ return null;
+ }
+ // "/ws/v1/cluster/apps?state=RUNNING"
+ StringBuilder sb = new StringBuilder();
+ sb.append(rmUrl).append("/").append(restApi);
+ sb.append("&").append(Constants.ANONYMOUS_PARAMETER);
+
+ return sb.toString();
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/url/ServiceURLBuilder.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/url/ServiceURLBuilder.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/url/ServiceURLBuilder.java
new file mode 100644
index 0000000..09fea2f
--- /dev/null
+++ b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/url/ServiceURLBuilder.java
@@ -0,0 +1,21 @@
+/*
+ * 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.eagle.jpm.util.resourcefetch.url;
+
+public interface ServiceURLBuilder {
+ String build(String... parameters);
+}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/url/SparkCompleteJobServiceURLBuilderImpl.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/url/SparkCompleteJobServiceURLBuilderImpl.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/url/SparkCompleteJobServiceURLBuilderImpl.java
new file mode 100644
index 0000000..ca6e938
--- /dev/null
+++ b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/url/SparkCompleteJobServiceURLBuilderImpl.java
@@ -0,0 +1,33 @@
+/*
+ *
+ * * 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.eagle.jpm.util.resourcefetch.url;
+
+import org.apache.eagle.jpm.util.Constants;
+
+public class SparkCompleteJobServiceURLBuilderImpl implements ServiceURLBuilder {
+
+ public String build(String... parameters) {
+ String url = URLUtil.removeTrailingSlash(parameters[0]);
+
+ return url + "/" + Constants.V2_APPS_URL
+ + "?applicationTypes=SPARK&state=FINISHED&finishedTimeBegin="
+ + parameters[1] + "&" + Constants.ANONYMOUS_PARAMETER;
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/url/SparkJobServiceURLBuilderImpl.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/url/SparkJobServiceURLBuilderImpl.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/url/SparkJobServiceURLBuilderImpl.java
new file mode 100644
index 0000000..c5ec67a
--- /dev/null
+++ b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/url/SparkJobServiceURLBuilderImpl.java
@@ -0,0 +1,31 @@
+/*
+ *
+ * * 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.eagle.jpm.util.resourcefetch.url;
+
+import org.apache.eagle.jpm.util.Constants;
+
+public class SparkJobServiceURLBuilderImpl implements ServiceURLBuilder {
+
+ public String build(String... parameters) {
+ String serverAddress = URLUtil.removeTrailingSlash(parameters[0]);
+
+ return serverAddress + Constants.SPARK_APPS_URL + parameters[1];
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/url/URLUtil.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/url/URLUtil.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/url/URLUtil.java
new file mode 100644
index 0000000..11cde80
--- /dev/null
+++ b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/url/URLUtil.java
@@ -0,0 +1,33 @@
+/*
+ * 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.eagle.jpm.util.resourcefetch.url;
+
+/**
+ * URL utils.
+ */
+public class URLUtil {
+ public static String removeTrailingSlash(String url) {
+ int i = url.length() - 1;
+ // Skip all slashes from the end.
+ while (i >= 0 && url.charAt(i) == '/') {
+ i--;
+ }
+
+ return url.substring(0, i + 1);
+ }
+}
[3/4] incubator-eagle git commit: [minor] Change resourceFetch to
resourcefetch
Posted by qi...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/MRTaskAttempts.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/MRTaskAttempts.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/MRTaskAttempts.java
deleted file mode 100644
index 03af0d7..0000000
--- a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/MRTaskAttempts.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- *
- * * 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.eagle.jpm.util.resourcefetch.model;
-
-import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.map.annotate.JsonSerialize;
-
-import java.util.List;
-
-@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class MRTaskAttempts {
- public List<MRTaskAttempt> getTaskAttempt() {
- return taskAttempt;
- }
-
- public void setTaskAttempt(List<MRTaskAttempt> taskAttempt) {
- this.taskAttempt = taskAttempt;
- }
-
- private List<MRTaskAttempt> taskAttempt;
-}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/MRTasks.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/MRTasks.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/MRTasks.java
deleted file mode 100644
index b23b23d..0000000
--- a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/MRTasks.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- *
- * * 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.eagle.jpm.util.resourcefetch.model;
-
-import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.map.annotate.JsonSerialize;
-
-import java.util.List;
-
-@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class MRTasks {
- public List<MRTask> getTask() {
- return task;
- }
-
- public void setTask(List<MRTask> task) {
- this.task = task;
- }
-
- private List<MRTask> task;
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/MRTasksWrapper.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/MRTasksWrapper.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/MRTasksWrapper.java
deleted file mode 100644
index f92234a..0000000
--- a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/MRTasksWrapper.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- *
- * * 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.eagle.jpm.util.resourcefetch.model;
-
-import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.map.annotate.JsonSerialize;
-
-@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class MRTasksWrapper {
- public MRTasks getTasks() {
- return tasks;
- }
-
- public void setTasks(MRTasks tasks) {
- this.tasks = tasks;
- }
-
- private MRTasks tasks;
-}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/MrJobs.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/MrJobs.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/MrJobs.java
deleted file mode 100644
index 1d4871c..0000000
--- a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/MrJobs.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- *
- * * 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.eagle.jpm.util.resourcefetch.model;
-
-import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.map.annotate.JsonSerialize;
-
-import java.util.List;
-
-@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class MrJobs {
- public List<MRJob> getJob() {
- return job;
- }
-
- public void setJobs(List<MRJob> job) {
- this.job = job;
- }
-
- private List<MRJob> job;
-}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/SparkApplication.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/SparkApplication.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/SparkApplication.java
deleted file mode 100644
index 299934e..0000000
--- a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/SparkApplication.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- *
- * * 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.eagle.jpm.util.resourcefetch.model;
-
-import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.map.annotate.JsonSerialize;
-
-import java.util.List;
-
-@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class SparkApplication {
- String id;
- String name;
- List<SparkApplicationAttempt> attempts;
-
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public List<SparkApplicationAttempt> getAttempts() {
- return attempts;
- }
-
- public void setAttempts(List<SparkApplicationAttempt> attempts) {
- this.attempts = attempts;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/SparkApplicationAttempt.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/SparkApplicationAttempt.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/SparkApplicationAttempt.java
deleted file mode 100644
index b437cc2..0000000
--- a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/SparkApplicationAttempt.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- *
- * * 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.eagle.jpm.util.resourcefetch.model;
-
-import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.map.annotate.JsonSerialize;
-
-@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class SparkApplicationAttempt {
- String attemptId;
- String sparkUser;
- String startTime;
- String endTime;
- boolean completed;
-
- public String getAttemptId() {
- return attemptId;
- }
-
- public void setAttemptId(String attemptId) {
- this.attemptId = attemptId;
- }
-
- public String getSparkUser() {
- return sparkUser;
- }
-
- public void setSparkUser(String sparkUser) {
- this.sparkUser = sparkUser;
- }
-
- public String getStartTime() {
- return startTime;
- }
-
- public void setStartTime(String startTime) {
- this.startTime = startTime;
- }
-
- public String getEndTime() {
- return endTime;
- }
-
- public void setEndTime(String endTime) {
- this.endTime = endTime;
- }
-
- public boolean isCompleted() {
- return completed;
- }
-
- public void setCompleted(boolean completed) {
- this.completed = completed;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/SparkApplicationWrapper.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/SparkApplicationWrapper.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/SparkApplicationWrapper.java
deleted file mode 100644
index 0b04f31..0000000
--- a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/SparkApplicationWrapper.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- *
- * * 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.eagle.jpm.util.resourcefetch.model;
-
-import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.map.annotate.JsonSerialize;
-
-@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class SparkApplicationWrapper {
-
- SparkApplication app;
-
- public SparkApplication getApp() {
- return app;
- }
-
- public void setApp(SparkApplication app) {
- this.app = app;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/SparkExecutor.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/SparkExecutor.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/SparkExecutor.java
deleted file mode 100644
index c2a2115..0000000
--- a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/SparkExecutor.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- *
- * * 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.eagle.jpm.util.resourcefetch.model;
-
-import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.map.annotate.JsonSerialize;
-
-@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class SparkExecutor {
- private String id;
- private String hostPort;
- private int rddBlocks;
- private long memoryUsed;
- private long diskUsed;
- private int activeTasks;
- private int failedTasks;
- private int completedTasks;
- private int totalTasks;
- private long totalDuration;
- private long totalInputBytes;
- private long totalShuffleRead;
- private long totalShuffleWrite;
- private long maxMemory;
-
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public String getHostPort() {
- return hostPort;
- }
-
- public void setHostPort(String hostPort) {
- this.hostPort = hostPort;
- }
-
- public int getRddBlocks() {
- return rddBlocks;
- }
-
- public void setRddBlocks(int rddBlocks) {
- this.rddBlocks = rddBlocks;
- }
-
- public long getMemoryUsed() {
- return memoryUsed;
- }
-
- public void setMemoryUsed(long memoryUsed) {
- this.memoryUsed = memoryUsed;
- }
-
- public long getDiskUsed() {
- return diskUsed;
- }
-
- public void setDiskUsed(long diskUsed) {
- this.diskUsed = diskUsed;
- }
-
- public int getActiveTasks() {
- return activeTasks;
- }
-
- public void setActiveTasks(int activeTasks) {
- this.activeTasks = activeTasks;
- }
-
- public int getFailedTasks() {
- return failedTasks;
- }
-
- public void setFailedTasks(int failedTasks) {
- this.failedTasks = failedTasks;
- }
-
- public int getCompletedTasks() {
- return completedTasks;
- }
-
- public void setCompletedTasks(int completedTasks) {
- this.completedTasks = completedTasks;
- }
-
- public int getTotalTasks() {
- return totalTasks;
- }
-
- public void setTotalTasks(int totalTasks) {
- this.totalTasks = totalTasks;
- }
-
- public long getTotalDuration() {
- return totalDuration;
- }
-
- public void setTotalDuration(long totalDuration) {
- this.totalDuration = totalDuration;
- }
-
- public long getTotalInputBytes() {
- return totalInputBytes;
- }
-
- public void setTotalInputBytes(long totalInputBytes) {
- this.totalInputBytes = totalInputBytes;
- }
-
- public long getTotalShuffleRead() {
- return totalShuffleRead;
- }
-
- public void setTotalShuffleRead(long totalShuffleRead) {
- this.totalShuffleRead = totalShuffleRead;
- }
-
- public long getTotalShuffleWrite() {
- return totalShuffleWrite;
- }
-
- public void setTotalShuffleWrite(long totalShuffleWrite) {
- this.totalShuffleWrite = totalShuffleWrite;
- }
-
- public long getMaxMemory() {
- return maxMemory;
- }
-
- public void setMaxMemory(long maxMemory) {
- this.maxMemory = maxMemory;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/SparkJob.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/SparkJob.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/SparkJob.java
deleted file mode 100644
index 280cf67..0000000
--- a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/SparkJob.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- *
- * * 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.eagle.jpm.util.resourcefetch.model;
-
-import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.map.annotate.JsonSerialize;
-
-import java.util.List;
-
-@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class SparkJob {
- private int jobId;
- private String name;
- private String submissionTime;
- private String completionTime;
- private List<Integer> stageIds;
- private String status;
- private int numTasks;
- private int numActiveTasks;
- private int numCompletedTasks;
- private int numSkippedTasks;
- private int numFailedTasks;
- private int numActiveStages;
- private int numCompletedStages;
- private int numSkippedStages;
- private int numFailedStages;
-
- public int getJobId() {
- return jobId;
- }
-
- public void setJobId(int jobId) {
- this.jobId = jobId;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getSubmissionTime() {
- return submissionTime;
- }
-
- public void setSubmissionTime(String submissionTime) {
- this.submissionTime = submissionTime;
- }
-
- public String getCompletionTime() {
- return completionTime;
- }
-
- public void setCompletionTime(String completionTime) {
- this.completionTime = completionTime;
- }
-
- public List<Integer> getStageIds() {
- return stageIds;
- }
-
- public void setStageIds(List<Integer> stageIds) {
- this.stageIds = stageIds;
- }
-
- public String getStatus() {
- return status;
- }
-
- public void setStatus(String status) {
- this.status = status;
- }
-
- public int getNumTasks() {
- return numTasks;
- }
-
- public void setNumTasks(int numTasks) {
- this.numTasks = numTasks;
- }
-
- public int getNumActiveTasks() {
- return numActiveTasks;
- }
-
- public void setNumActiveTasks(int numActiveTasks) {
- this.numActiveTasks = numActiveTasks;
- }
-
- public int getNumCompletedTasks() {
- return numCompletedTasks;
- }
-
- public void setNumCompletedTasks(int numCompletedTasks) {
- this.numCompletedTasks = numCompletedTasks;
- }
-
- public int getNumSkippedTasks() {
- return numSkippedTasks;
- }
-
- public void setNumSkippedTasks(int numSkippedTasks) {
- this.numSkippedTasks = numSkippedTasks;
- }
-
- public int getNumFailedTasks() {
- return numFailedTasks;
- }
-
- public void setNumFailedTasks(int numFailedTasks) {
- this.numFailedTasks = numFailedTasks;
- }
-
- public int getNumActiveStages() {
- return numActiveStages;
- }
-
- public void setNumActiveStages(int numActiveStages) {
- this.numActiveStages = numActiveStages;
- }
-
- public int getNumCompletedStages() {
- return numCompletedStages;
- }
-
- public void setNumCompletedStages(int numCompletedStages) {
- this.numCompletedStages = numCompletedStages;
- }
-
- public int getNumSkippedStages() {
- return numSkippedStages;
- }
-
- public void setNumSkippedStages(int numSkippedStages) {
- this.numSkippedStages = numSkippedStages;
- }
-
- public int getNumFailedStages() {
- return numFailedStages;
- }
-
- public void setNumFailedStages(int numFailedStages) {
- this.numFailedStages = numFailedStages;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/SparkStage.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/SparkStage.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/SparkStage.java
deleted file mode 100644
index 14edeee..0000000
--- a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/SparkStage.java
+++ /dev/null
@@ -1,211 +0,0 @@
-/*
- *
- * * 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.eagle.jpm.util.resourcefetch.model;
-
-import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.map.annotate.JsonSerialize;
-
-import java.util.Map;
-
-@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class SparkStage {
- private String status;
- private int stageId;
- private int attemptId;
- private int numActiveTasks;
- private int numCompleteTasks;
- private int numFailedTasks;
- private long executorRunTime;
- private long inputBytes;
- private long inputRecords;
- private long outputBytes;
- private long outputRecords;
- private long shuffleReadBytes;
- private long shuffleReadRecords;
- private long shuffleWriteBytes;
- private long shuffleWriteRecords;
- private long memoryBytesSpilled;
- private long diskBytesSpilled;
- private String name;
- private String schedulingPool;
- //taskID
- private Map<String, SparkTask> tasks;
-
- public String getStatus() {
- return status;
- }
-
- public void setStatus(String status) {
- this.status = status;
- }
-
- public int getStageId() {
- return stageId;
- }
-
- public void setStageId(int stageId) {
- this.stageId = stageId;
- }
-
- public int getAttemptId() {
- return attemptId;
- }
-
- public void setAttemptId(int attemptId) {
- this.attemptId = attemptId;
- }
-
- public int getNumActiveTasks() {
- return numActiveTasks;
- }
-
- public void setNumActiveTasks(int numActiveTasks) {
- this.numActiveTasks = numActiveTasks;
- }
-
- public int getNumCompleteTasks() {
- return numCompleteTasks;
- }
-
- public void setNumCompleteTasks(int numCompleteTasks) {
- this.numCompleteTasks = numCompleteTasks;
- }
-
- public int getNumFailedTasks() {
- return numFailedTasks;
- }
-
- public void setNumFailedTasks(int numFailedTasks) {
- this.numFailedTasks = numFailedTasks;
- }
-
- public long getExecutorRunTime() {
- return executorRunTime;
- }
-
- public void setExecutorRunTime(long executorRunTime) {
- this.executorRunTime = executorRunTime;
- }
-
- public long getInputBytes() {
- return inputBytes;
- }
-
- public void setInputBytes(long inputBytes) {
- this.inputBytes = inputBytes;
- }
-
- public long getInputRecords() {
- return inputRecords;
- }
-
- public void setInputRecords(long inputRecords) {
- this.inputRecords = inputRecords;
- }
-
- public long getOutputBytes() {
- return outputBytes;
- }
-
- public void setOutputBytes(long outputBytes) {
- this.outputBytes = outputBytes;
- }
-
- public long getOutputRecords() {
- return outputRecords;
- }
-
- public void setOutputRecords(long outputRecords) {
- this.outputRecords = outputRecords;
- }
-
- public long getShuffleReadBytes() {
- return shuffleReadBytes;
- }
-
- public void setShuffleReadBytes(long shuffleReadBytes) {
- this.shuffleReadBytes = shuffleReadBytes;
- }
-
- public long getShuffleReadRecords() {
- return shuffleReadRecords;
- }
-
- public void setShuffleReadRecords(long shuffleReadRecords) {
- this.shuffleReadRecords = shuffleReadRecords;
- }
-
- public long getShuffleWriteBytes() {
- return shuffleWriteBytes;
- }
-
- public void setShuffleWriteBytes(long shuffleWriteBytes) {
- this.shuffleWriteBytes = shuffleWriteBytes;
- }
-
- public long getShuffleWriteRecords() {
- return shuffleWriteRecords;
- }
-
- public void setShuffleWriteRecords(long shuffleWriteRecords) {
- this.shuffleWriteRecords = shuffleWriteRecords;
- }
-
- public long getMemoryBytesSpilled() {
- return memoryBytesSpilled;
- }
-
- public void setMemoryBytesSpilled(long memoryBytesSpilled) {
- this.memoryBytesSpilled = memoryBytesSpilled;
- }
-
- public long getDiskBytesSpilled() {
- return diskBytesSpilled;
- }
-
- public void setDiskBytesSpilled(long diskBytesSpilled) {
- this.diskBytesSpilled = diskBytesSpilled;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getSchedulingPool() {
- return schedulingPool;
- }
-
- public void setSchedulingPool(String schedulingPool) {
- this.schedulingPool = schedulingPool;
- }
-
- public Map<String, SparkTask> getTasks() {
- return tasks;
- }
-
- public void setTasks(Map<String, SparkTask> tasks) {
- this.tasks = tasks;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/SparkTask.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/SparkTask.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/SparkTask.java
deleted file mode 100644
index a5dd08f..0000000
--- a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/SparkTask.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- *
- * * 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.eagle.jpm.util.resourcefetch.model;
-
-
-import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.map.annotate.JsonSerialize;
-
-@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class SparkTask {
- private int taskId;
- private int index;
- private int attempt;
- private String launchTime;
- private String executorId;
- private String host;
- private String taskLocality;
- private boolean speculative;
- private SparkTaskMetrics taskMetrics;
-
- public int getTaskId() {
- return taskId;
- }
-
- public void setTaskId(int taskId) {
- this.taskId = taskId;
- }
-
- public int getIndex() {
- return index;
- }
-
- public void setIndex(int index) {
- this.index = index;
- }
-
- public int getAttempt() {
- return attempt;
- }
-
- public void setAttempt(int attempt) {
- this.attempt = attempt;
- }
-
- public String getLaunchTime() {
- return launchTime;
- }
-
- public void setLaunchTime(String launchTime) {
- this.launchTime = launchTime;
- }
-
- public String getExecutorId() {
- return executorId;
- }
-
- public void setExecutorId(String executorId) {
- this.executorId = executorId;
- }
-
- public String getHost() {
- return host;
- }
-
- public void setHost(String host) {
- this.host = host;
- }
-
- public String getTaskLocality() {
- return taskLocality;
- }
-
- public void setTaskLocality(String taskLocality) {
- this.taskLocality = taskLocality;
- }
-
- public boolean isSpeculative() {
- return speculative;
- }
-
- public void setSpeculative(boolean speculative) {
- this.speculative = speculative;
- }
-
- public SparkTaskMetrics getTaskMetrics() {
- return taskMetrics;
- }
-
- public void setTaskMetrics(SparkTaskMetrics taskMetrics) {
- this.taskMetrics = taskMetrics;
- }
-}
-
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/SparkTaskInputMetrics.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/SparkTaskInputMetrics.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/SparkTaskInputMetrics.java
deleted file mode 100644
index d079694..0000000
--- a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/SparkTaskInputMetrics.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- *
- * * 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.eagle.jpm.util.resourcefetch.model;
-
-import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.map.annotate.JsonSerialize;
-
-@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class SparkTaskInputMetrics {
- private long bytesRead;
- private long recordsRead;
-
- public long getBytesRead() {
- return bytesRead;
- }
-
- public void setBytesRead(long bytesRead) {
- this.bytesRead = bytesRead;
- }
-
- public long getRecordsRead() {
- return recordsRead;
- }
-
- public void setRecordsRead(long recordsRead) {
- this.recordsRead = recordsRead;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/SparkTaskMetrics.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/SparkTaskMetrics.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/SparkTaskMetrics.java
deleted file mode 100644
index cdb913d..0000000
--- a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/SparkTaskMetrics.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- *
- * * 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.eagle.jpm.util.resourcefetch.model;
-
-import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.map.annotate.JsonSerialize;
-
-@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class SparkTaskMetrics {
- private long executorDeserializeTime;
- private long executorRunTime;
- private long resultSize;
- private long jvmGcTime;
- private long resultSerializationTime;
- private long memoryBytesSpilled;
- private long diskBytesSpilled;
- private SparkTaskInputMetrics inputMetrics;
- private SparkTaskShuffleWriteMetrics shuffleWriteMetrics;
- private SparkTaskShuffleReadMetrics shuffleReadMetrics;
-
- public long getExecutorDeserializeTime() {
- return executorDeserializeTime;
- }
-
- public void setExecutorDeserializeTime(long executorDeserializeTime) {
- this.executorDeserializeTime = executorDeserializeTime;
- }
-
- public long getExecutorRunTime() {
- return executorRunTime;
- }
-
- public void setExecutorRunTime(long executorRunTime) {
- this.executorRunTime = executorRunTime;
- }
-
- public long getResultSize() {
- return resultSize;
- }
-
- public void setResultSize(long resultSize) {
- this.resultSize = resultSize;
- }
-
- public long getJvmGcTime() {
- return jvmGcTime;
- }
-
- public void setJvmGcTime(long jvmGcTime) {
- this.jvmGcTime = jvmGcTime;
- }
-
- public long getResultSerializationTime() {
- return resultSerializationTime;
- }
-
- public void setResultSerializationTime(long resultSerializationTime) {
- this.resultSerializationTime = resultSerializationTime;
- }
-
- public long getMemoryBytesSpilled() {
- return memoryBytesSpilled;
- }
-
- public void setMemoryBytesSpilled(long memoryBytesSpilled) {
- this.memoryBytesSpilled = memoryBytesSpilled;
- }
-
- public long getDiskBytesSpilled() {
- return diskBytesSpilled;
- }
-
- public void setDiskBytesSpilled(long diskBytesSpilled) {
- this.diskBytesSpilled = diskBytesSpilled;
- }
-
- public SparkTaskInputMetrics getInputMetrics() {
- return inputMetrics;
- }
-
- public void setInputMetrics(SparkTaskInputMetrics inputMetrics) {
- this.inputMetrics = inputMetrics;
- }
-
- public SparkTaskShuffleWriteMetrics getShuffleWriteMetrics() {
- return shuffleWriteMetrics;
- }
-
- public void setShuffleWriteMetrics(SparkTaskShuffleWriteMetrics shuffleWriteMetrics) {
- this.shuffleWriteMetrics = shuffleWriteMetrics;
- }
-
- public SparkTaskShuffleReadMetrics getShuffleReadMetrics() {
- return shuffleReadMetrics;
- }
-
- public void setShuffleReadMetrics(SparkTaskShuffleReadMetrics shuffleReadMetrics) {
- this.shuffleReadMetrics = shuffleReadMetrics;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/SparkTaskShuffleReadMetrics.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/SparkTaskShuffleReadMetrics.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/SparkTaskShuffleReadMetrics.java
deleted file mode 100644
index 3aa94bb..0000000
--- a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/SparkTaskShuffleReadMetrics.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- *
- * * 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.eagle.jpm.util.resourcefetch.model;
-
-import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.map.annotate.JsonSerialize;
-
-@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class SparkTaskShuffleReadMetrics {
- private long remoteBlocksFetched;
- private long localBlocksFetched;
- private long fetchWaitTime;
- private long remoteBytesRead;
- private long totalBlocksFetched;
- private long recordsRead;
-
- public long getRemoteBlocksFetched() {
- return remoteBlocksFetched;
- }
-
- public void setRemoteBlocksFetched(long remoteBlocksFetched) {
- this.remoteBlocksFetched = remoteBlocksFetched;
- }
-
- public long getLocalBlocksFetched() {
- return localBlocksFetched;
- }
-
- public void setLocalBlocksFetched(long localBlocksFetched) {
- this.localBlocksFetched = localBlocksFetched;
- }
-
- public long getFetchWaitTime() {
- return fetchWaitTime;
- }
-
- public void setFetchWaitTime(long fetchWaitTime) {
- this.fetchWaitTime = fetchWaitTime;
- }
-
- public long getRemoteBytesRead() {
- return remoteBytesRead;
- }
-
- public void setRemoteBytesRead(long remoteBytesRead) {
- this.remoteBytesRead = remoteBytesRead;
- }
-
- public long getTotalBlocksFetched() {
- return totalBlocksFetched;
- }
-
- public void setTotalBlocksFetched(long totalBlocksFetched) {
- this.totalBlocksFetched = totalBlocksFetched;
- }
-
- public long getRecordsRead() {
- return recordsRead;
- }
-
- public void setRecordsRead(long recordsRead) {
- this.recordsRead = recordsRead;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/SparkTaskShuffleWriteMetrics.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/SparkTaskShuffleWriteMetrics.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/SparkTaskShuffleWriteMetrics.java
deleted file mode 100644
index 3d8f025..0000000
--- a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/SparkTaskShuffleWriteMetrics.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- *
- * * 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.eagle.jpm.util.resourcefetch.model;
-
-import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.map.annotate.JsonSerialize;
-
-@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class SparkTaskShuffleWriteMetrics {
- private long bytesWritten;
- private long writeTime;
- private long recordsWritten;
-
- public long getBytesWritten() {
- return bytesWritten;
- }
-
- public void setBytesWritten(long bytesWritten) {
- this.bytesWritten = bytesWritten;
- }
-
- public long getWriteTime() {
- return writeTime;
- }
-
- public void setWriteTime(long writeTime) {
- this.writeTime = writeTime;
- }
-
- public long getRecordsWritten() {
- return recordsWritten;
- }
-
- public void setRecordsWritten(long recordsWritten) {
- this.recordsWritten = recordsWritten;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/TaskCounterGroup.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/TaskCounterGroup.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/TaskCounterGroup.java
deleted file mode 100644
index 9803d11..0000000
--- a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/TaskCounterGroup.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * 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.eagle.jpm.util.resourcefetch.model;
-
-import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.map.annotate.JsonSerialize;
-
-import java.util.List;
-
-@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class TaskCounterGroup {
- public String getCounterGroupName() {
- return counterGroupName;
- }
-
- public void setCounterGroupName(String counterGroupName) {
- this.counterGroupName = counterGroupName;
- }
-
- public List<TaskCounterItem> getCounter() {
- return counter;
- }
-
- public void setCounter(List<TaskCounterItem> counter) {
- this.counter = counter;
- }
-
- private String counterGroupName;
- private List<TaskCounterItem> counter;
-}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/TaskCounterItem.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/TaskCounterItem.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/TaskCounterItem.java
deleted file mode 100644
index f8ea22c..0000000
--- a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/TaskCounterItem.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * 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.eagle.jpm.util.resourcefetch.model;
-
-import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.map.annotate.JsonSerialize;
-
-@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class TaskCounterItem {
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public long getValue() {
- return value;
- }
-
- public void setValue(long value) {
- this.value = value;
- }
-
- private String name;
- private long value;
-}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/TaskCounters.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/TaskCounters.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/TaskCounters.java
deleted file mode 100644
index ef99547..0000000
--- a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/TaskCounters.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * 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.eagle.jpm.util.resourcefetch.model;
-
-import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.map.annotate.JsonSerialize;
-
-import java.util.List;
-
-@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class TaskCounters {
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public List<TaskCounterGroup> getTaskCounterGroup() {
- return taskCounterGroup;
- }
-
- public void setTaskCounterGroup(List<TaskCounterGroup> taskCounterGroup) {
- this.taskCounterGroup = taskCounterGroup;
- }
-
- private String id;
- private List<TaskCounterGroup> taskCounterGroup;
-}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/TaskCountersWrapper.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/TaskCountersWrapper.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/TaskCountersWrapper.java
deleted file mode 100644
index 80808a3..0000000
--- a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/TaskCountersWrapper.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * 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.eagle.jpm.util.resourcefetch.model;
-
-import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.map.annotate.JsonSerialize;
-
-@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class TaskCountersWrapper {
- public TaskCounters getJobTaskCounters() {
- return jobTaskCounters;
- }
-
- public void setJobTaskCounters(TaskCounters jobTaskCounters) {
- this.jobTaskCounters = jobTaskCounters;
- }
-
- private TaskCounters jobTaskCounters;
-}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/url/JobListServiceURLBuilderImpl.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/url/JobListServiceURLBuilderImpl.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/url/JobListServiceURLBuilderImpl.java
deleted file mode 100644
index 5513771..0000000
--- a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/url/JobListServiceURLBuilderImpl.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * 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.eagle.jpm.util.resourcefetch.url;
-
-import org.apache.eagle.jpm.util.Constants;
-
-public class JobListServiceURLBuilderImpl implements ServiceURLBuilder {
-
- public String build(String... parameters) {
- /**
- * {rmUrl}/ws/v1/cluster/apps?state=RUNNING.
- * We need to remove tailing slashes to avoid "url//ws/v1"
- * because it would not be found and would be redirected to
- * history server ui.
- */
- String rmUrl = URLUtil.removeTrailingSlash(parameters[0]);
-
- String restApi = null;
- String jobState = parameters[1];
-
- if (jobState.equals(Constants.JobState.RUNNING.name())) {
- restApi = Constants.V2_APPS_RUNNING_URL;
- } else if (jobState.equals(Constants.JobState.FINISHED.name())) {
- restApi = Constants.V2_APPS_COMPLETED_URL;
- } else if (jobState.equals(Constants.JobState.ALL.name())) {
- restApi = Constants.V2_APPS_URL;
- }
- if (restApi == null) {
- return null;
- }
- // "/ws/v1/cluster/apps?state=RUNNING"
- StringBuilder sb = new StringBuilder();
- sb.append(rmUrl).append("/").append(restApi);
- sb.append("&").append(Constants.ANONYMOUS_PARAMETER);
-
- return sb.toString();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/url/ServiceURLBuilder.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/url/ServiceURLBuilder.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/url/ServiceURLBuilder.java
deleted file mode 100644
index 09fea2f..0000000
--- a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/url/ServiceURLBuilder.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * 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.eagle.jpm.util.resourcefetch.url;
-
-public interface ServiceURLBuilder {
- String build(String... parameters);
-}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/url/SparkCompleteJobServiceURLBuilderImpl.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/url/SparkCompleteJobServiceURLBuilderImpl.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/url/SparkCompleteJobServiceURLBuilderImpl.java
deleted file mode 100644
index ca6e938..0000000
--- a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/url/SparkCompleteJobServiceURLBuilderImpl.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- *
- * * 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.eagle.jpm.util.resourcefetch.url;
-
-import org.apache.eagle.jpm.util.Constants;
-
-public class SparkCompleteJobServiceURLBuilderImpl implements ServiceURLBuilder {
-
- public String build(String... parameters) {
- String url = URLUtil.removeTrailingSlash(parameters[0]);
-
- return url + "/" + Constants.V2_APPS_URL
- + "?applicationTypes=SPARK&state=FINISHED&finishedTimeBegin="
- + parameters[1] + "&" + Constants.ANONYMOUS_PARAMETER;
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/url/SparkJobServiceURLBuilderImpl.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/url/SparkJobServiceURLBuilderImpl.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/url/SparkJobServiceURLBuilderImpl.java
deleted file mode 100644
index c5ec67a..0000000
--- a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/url/SparkJobServiceURLBuilderImpl.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- *
- * * 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.eagle.jpm.util.resourcefetch.url;
-
-import org.apache.eagle.jpm.util.Constants;
-
-public class SparkJobServiceURLBuilderImpl implements ServiceURLBuilder {
-
- public String build(String... parameters) {
- String serverAddress = URLUtil.removeTrailingSlash(parameters[0]);
-
- return serverAddress + Constants.SPARK_APPS_URL + parameters[1];
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/url/URLUtil.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/url/URLUtil.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/url/URLUtil.java
deleted file mode 100644
index 11cde80..0000000
--- a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/url/URLUtil.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * 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.eagle.jpm.util.resourcefetch.url;
-
-/**
- * URL utils.
- */
-public class URLUtil {
- public static String removeTrailingSlash(String url) {
- int i = url.length() - 1;
- // Skip all slashes from the end.
- while (i >= 0 && url.charAt(i) == '/') {
- i--;
- }
-
- return url.substring(0, i + 1);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/RMResourceFetcher.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/RMResourceFetcher.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/RMResourceFetcher.java
new file mode 100644
index 0000000..b1881ef
--- /dev/null
+++ b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/RMResourceFetcher.java
@@ -0,0 +1,189 @@
+/*
+ * 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.eagle.jpm.util.resourcefetch;
+
+import org.apache.eagle.jpm.util.Constants;
+import org.apache.eagle.jpm.util.resourcefetch.connection.InputStreamUtils;
+import org.apache.eagle.jpm.util.resourcefetch.ha.HAURLSelector;
+import org.apache.eagle.jpm.util.resourcefetch.ha.HAURLSelectorImpl;
+import org.apache.eagle.jpm.util.resourcefetch.model.AppInfo;
+import org.apache.eagle.jpm.util.resourcefetch.model.AppsWrapper;
+import org.apache.eagle.jpm.util.resourcefetch.model.ClusterInfo;
+import org.apache.eagle.jpm.util.resourcefetch.model.ClusterInfoWrapper;
+import org.apache.eagle.jpm.util.resourcefetch.url.JobListServiceURLBuilderImpl;
+import org.apache.eagle.jpm.util.resourcefetch.url.ServiceURLBuilder;
+import org.apache.eagle.jpm.util.resourcefetch.url.SparkCompleteJobServiceURLBuilderImpl;
+import org.apache.eagle.jpm.util.resourcefetch.url.URLUtil;
+import org.codehaus.jackson.JsonParser;
+import org.codehaus.jackson.map.ObjectMapper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.List;
+
+public class RMResourceFetcher implements ResourceFetcher<AppInfo> {
+
+ private static final Logger LOG = LoggerFactory.getLogger(RMResourceFetcher.class);
+ private final HAURLSelector selector;
+ private final ServiceURLBuilder jobListServiceURLBuilder;
+ private final ServiceURLBuilder sparkCompleteJobServiceURLBuilder;
+ private static final ObjectMapper OBJ_MAPPER = new ObjectMapper();
+
+ static {
+ OBJ_MAPPER.configure(JsonParser.Feature.ALLOW_NON_NUMERIC_NUMBERS, true);
+ }
+
+ public RMResourceFetcher(String[] rmBasePaths) {
+ this.jobListServiceURLBuilder = new JobListServiceURLBuilderImpl();
+ this.sparkCompleteJobServiceURLBuilder = new SparkCompleteJobServiceURLBuilderImpl();
+
+ this.selector = new HAURLSelectorImpl(rmBasePaths, jobListServiceURLBuilder, Constants.CompressionType.GZIP);
+ }
+
+ private void checkUrl() throws IOException {
+ if (!selector.checkUrl(jobListServiceURLBuilder.build(selector.getSelectedUrl(), Constants.JobState.RUNNING.name()))) {
+ selector.reSelectUrl();
+ }
+ }
+
+ private List<AppInfo> doFetchFinishApplicationsList(String urlString, Constants.CompressionType compressionType) throws Exception {
+ List<AppInfo> result;
+ InputStream is = null;
+ try {
+ checkUrl();
+ LOG.info("Going to call yarn api to fetch finished application list: " + urlString);
+ is = InputStreamUtils.getInputStream(urlString, null, compressionType);
+ final AppsWrapper appWrapper = OBJ_MAPPER.readValue(is, AppsWrapper.class);
+ if (appWrapper != null && appWrapper.getApps() != null
+ && appWrapper.getApps().getApp() != null) {
+ result = appWrapper.getApps().getApp();
+ return result;
+ }
+ return null;
+ } finally {
+ if (is != null) {
+ try {
+ is.close();
+ } catch (Exception e) {
+ LOG.warn("{}", e);
+ }
+ }
+ }
+ }
+
+ private String getSparkRunningJobURL() {
+ return selector.getSelectedUrl()
+ + "/"
+ + Constants.V2_APPS_URL
+ + "?applicationTypes=SPARK&state=RUNNING&"
+ + Constants.ANONYMOUS_PARAMETER;
+ }
+
+ private String getMRRunningJobURL() {
+ return String.format("%s/%s?applicationTypes=MAPREDUCE&state=RUNNING&%s",
+ selector.getSelectedUrl(),
+ Constants.V2_APPS_URL,
+ Constants.ANONYMOUS_PARAMETER);
+ }
+
+ private String getMRFinishedJobURL(String lastFinishedTime) {
+ String url = URLUtil.removeTrailingSlash(selector.getSelectedUrl());
+ return url + "/" + "Constants.V2_APPS_URL"
+ + "?applicationTypes=MAPREDUCE&state=FINISHED&finishedTimeBegin="
+ + lastFinishedTime + "&" + Constants.ANONYMOUS_PARAMETER;
+ }
+
+ private List<AppInfo> doFetchRunningApplicationsList(String urlString, Constants.CompressionType compressionType) throws Exception {
+ List<AppInfo> result;
+ InputStream is = null;
+ try {
+ checkUrl();
+ LOG.info("Going to call yarn api to fetch running application list: " + urlString);
+ is = InputStreamUtils.getInputStream(urlString, null, compressionType);
+ final AppsWrapper appWrapper = OBJ_MAPPER.readValue(is, AppsWrapper.class);
+ if (appWrapper != null && appWrapper.getApps() != null && appWrapper.getApps().getApp() != null) {
+ result = appWrapper.getApps().getApp();
+ return result;
+ }
+ return null;
+ } finally {
+ if (is != null) {
+ try {
+ is.close();
+ } catch (Exception e) {
+ LOG.warn("{}", e);
+ }
+ }
+ }
+ }
+
+ private List<AppInfo> getResource(Constants.ResourceType resourceType, Constants.CompressionType compressionType, Object... parameter) throws Exception {
+ switch (resourceType) {
+ case COMPLETE_SPARK_JOB:
+ final String urlString = sparkCompleteJobServiceURLBuilder.build(selector.getSelectedUrl(), (String) parameter[0]);
+ return doFetchFinishApplicationsList(urlString, compressionType);
+ case RUNNING_SPARK_JOB:
+ return doFetchRunningApplicationsList(getSparkRunningJobURL(), compressionType);
+ case RUNNING_MR_JOB:
+ return doFetchRunningApplicationsList(getMRRunningJobURL(), compressionType);
+ case COMPLETE_MR_JOB:
+ return doFetchFinishApplicationsList(getMRFinishedJobURL((String) parameter[0]), compressionType);
+ default:
+ throw new Exception("Not support resourceType :" + resourceType);
+ }
+ }
+
+ public List<AppInfo> getResource(Constants.ResourceType resourceType, Object... parameter) throws Exception {
+ try {
+ return getResource(resourceType, Constants.CompressionType.GZIP, parameter);
+ } catch (java.util.zip.ZipException ex) {
+ return getResource(resourceType, Constants.CompressionType.NONE, parameter);
+ }
+ }
+
+ private String getClusterInfoURL() {
+ return selector.getSelectedUrl() + "/" + Constants.YARN_API_CLUSTER_INFO + "?" + Constants.ANONYMOUS_PARAMETER;
+ }
+
+ public ClusterInfo getClusterInfo() throws Exception {
+ InputStream is = null;
+ try {
+ checkUrl();
+ final String urlString = getClusterInfoURL();
+ LOG.info("Calling yarn api to fetch cluster info: " + urlString);
+ is = InputStreamUtils.getInputStream(urlString, null, Constants.CompressionType.GZIP);
+ final ClusterInfoWrapper clusterInfoWrapper = OBJ_MAPPER.readValue(is, ClusterInfoWrapper.class);
+ if (clusterInfoWrapper != null && clusterInfoWrapper.getClusterInfo() != null) {
+ return clusterInfoWrapper.getClusterInfo();
+ }
+ return null;
+ } finally {
+ if (is != null) {
+ try {
+ is.close();
+ } catch (Exception e) {
+ LOG.warn("{}", e);
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/ResourceFetcher.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/ResourceFetcher.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/ResourceFetcher.java
new file mode 100644
index 0000000..f920ddb
--- /dev/null
+++ b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/ResourceFetcher.java
@@ -0,0 +1,27 @@
+/*
+ * 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.eagle.jpm.util.resourcefetch;
+
+import org.apache.eagle.jpm.util.Constants;
+
+import java.util.List;
+
+public interface ResourceFetcher<T> {
+ //continue to refactor later
+ List<T> getResource(Constants.ResourceType resoureType, Object... parameter) throws Exception;
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/SparkHistoryServerResourceFetcher.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/SparkHistoryServerResourceFetcher.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/SparkHistoryServerResourceFetcher.java
new file mode 100644
index 0000000..ce2d9b8
--- /dev/null
+++ b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/SparkHistoryServerResourceFetcher.java
@@ -0,0 +1,88 @@
+/*
+ *
+ * * 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.eagle.jpm.util.resourcefetch;
+
+import org.apache.eagle.jpm.util.Constants;
+import org.apache.eagle.jpm.util.resourcefetch.connection.InputStreamUtils;
+import org.apache.eagle.jpm.util.resourcefetch.model.SparkApplication;
+import org.apache.eagle.jpm.util.resourcefetch.url.ServiceURLBuilder;
+import org.apache.eagle.jpm.util.resourcefetch.url.SparkJobServiceURLBuilderImpl;
+import org.apache.commons.codec.binary.Base64;
+import org.codehaus.jackson.JsonParser;
+import org.codehaus.jackson.map.ObjectMapper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.FileNotFoundException;
+import java.io.InputStream;
+import java.util.Arrays;
+import java.util.List;
+
+public class SparkHistoryServerResourceFetcher implements ResourceFetcher<SparkApplication> {
+
+ private static final Logger LOG = LoggerFactory.getLogger(SparkHistoryServerResourceFetcher.class);
+
+ private static final ObjectMapper OBJ_MAPPER = new ObjectMapper();
+
+ private String historyServerURL;
+ private final ServiceURLBuilder sparkDetailJobServiceURLBuilder;
+ private String auth;
+
+ static {
+ OBJ_MAPPER.configure(JsonParser.Feature.ALLOW_NON_NUMERIC_NUMBERS, true);
+ }
+
+ public SparkHistoryServerResourceFetcher(String historyServerURL, String userName, String pwd) {
+ this.historyServerURL = historyServerURL;
+ this.sparkDetailJobServiceURLBuilder = new SparkJobServiceURLBuilderImpl();
+ this.auth = "Basic " + new String(new Base64().encode(String.format("%s:%s", userName, pwd).getBytes()));
+ ;
+ }
+
+ private List<SparkApplication> doFetchSparkApplicationDetail(String appId) throws Exception {
+ InputStream is = null;
+ try {
+ final String urlString = sparkDetailJobServiceURLBuilder.build(this.historyServerURL, appId);
+ LOG.info("Going to call spark history server api to fetch spark job: " + urlString);
+ is = InputStreamUtils.getInputStream(urlString, auth, Constants.CompressionType.NONE);
+ SparkApplication app = OBJ_MAPPER.readValue(is, SparkApplication.class);
+ return Arrays.asList(app);
+ } catch (FileNotFoundException e) {
+ return null;
+ } finally {
+ if (is != null) {
+ try {
+ is.close();
+ } catch (Exception e) {
+ LOG.warn("{}", e);
+ }
+ }
+ }
+ }
+
+ public List<SparkApplication> getResource(Constants.ResourceType resoureType, Object... parameter) throws Exception {
+ switch (resoureType) {
+ case SPARK_JOB_DETAIL:
+ return doFetchSparkApplicationDetail((String) parameter[0]);
+ default:
+ throw new Exception("Not support resourceType :" + resoureType);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/connection/InputStreamUtils.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/connection/InputStreamUtils.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/connection/InputStreamUtils.java
new file mode 100644
index 0000000..e99e2aa
--- /dev/null
+++ b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/connection/InputStreamUtils.java
@@ -0,0 +1,68 @@
+/*
+ * 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.eagle.jpm.util.resourcefetch.connection;
+
+import org.apache.eagle.jpm.util.Constants;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.net.URLConnection;
+import java.util.zip.GZIPInputStream;
+
+public class InputStreamUtils {
+
+ private static final int CONNECTION_TIMEOUT = 10 * 1000;
+ private static final int READ_TIMEOUT = 5 * 60 * 1000;
+ private static final String GZIP_HTTP_HEADER = "Accept-Encoding";
+ private static final String GZIP_COMPRESSION = "gzip";
+
+ private static InputStream openGZIPInputStream(URL url, String auth, int timeout) throws IOException {
+ final URLConnection connection = url.openConnection();
+ connection.setConnectTimeout(CONNECTION_TIMEOUT);
+ connection.setReadTimeout(timeout);
+ connection.addRequestProperty(GZIP_HTTP_HEADER, GZIP_COMPRESSION);
+ if (null != auth) {
+ connection.setRequestProperty("Authorization", auth);
+ }
+ return new GZIPInputStream(connection.getInputStream());
+ }
+
+ private static InputStream openInputStream(URL url, String auth, int timeout) throws IOException {
+ URLConnection connection = url.openConnection();
+ connection.setConnectTimeout(timeout);
+ if (null != auth) {
+ connection.setRequestProperty("Authorization", auth);
+ }
+
+ return connection.getInputStream();
+ }
+
+ public static InputStream getInputStream(String urlString, String auth, Constants.CompressionType compressionType, int timeout) throws Exception {
+ final URL url = URLConnectionUtils.getUrl(urlString);
+ if (compressionType.equals(Constants.CompressionType.GZIP)) {
+ return openGZIPInputStream(url, auth, timeout);
+ } else { // CompressionType.NONE
+ return openInputStream(url, auth, timeout);
+ }
+ }
+
+ public static InputStream getInputStream(String urlString, String auth, Constants.CompressionType compressionType) throws Exception {
+ return getInputStream(urlString, auth, compressionType, READ_TIMEOUT);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/connection/JobUtils.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/connection/JobUtils.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/connection/JobUtils.java
new file mode 100644
index 0000000..44d27e8
--- /dev/null
+++ b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/connection/JobUtils.java
@@ -0,0 +1,43 @@
+/*
+ * 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.eagle.jpm.util.resourcefetch.connection;
+
+import org.apache.eagle.jpm.util.Constants;
+
+public class JobUtils {
+
+ public static String checkAndAddLastSlash(String urlBase) {
+ if (!urlBase.endsWith("/")) {
+ return urlBase + "/";
+ }
+ return urlBase;
+ }
+
+ public static String getJobIDByAppID(String appID) {
+ if (appID.startsWith(Constants.APPLICATION_PREFIX)) {
+ return appID.replace(Constants.APPLICATION_PREFIX, Constants.JOB_PREFIX);
+ }
+ return null;
+ }
+
+ public static String getAppIDByJobID(String jobID) {
+ if (jobID.startsWith(Constants.JOB_PREFIX)) {
+ return jobID.replace(Constants.JOB_PREFIX, Constants.APPLICATION_PREFIX);
+ }
+ return null;
+ }
+}
[4/4] incubator-eagle git commit: [minor] Change resourceFetch to
resourcefetch
Posted by qi...@apache.org.
[minor] Change resourceFetch to resourcefetch
Author: Zhao, Qingwen <qi...@apache.org>
Closes #386.
Project: http://git-wip-us.apache.org/repos/asf/incubator-eagle/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-eagle/commit/b5fd782c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-eagle/tree/b5fd782c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-eagle/diff/b5fd782c
Branch: refs/heads/develop
Commit: b5fd782c0968ce8dd499de1899464c8edbf50dfd
Parents: 6f5f972
Author: Qingwen Zhao <qi...@gmail.com>
Authored: Thu Aug 25 11:45:23 2016 +0800
Committer: Qingwen Zhao <qi...@gmail.com>
Committed: Thu Aug 25 13:00:44 2016 +0800
----------------------------------------------------------------------
.../util/resourceFetch/RMResourceFetcher.java | 189 ------------
.../jpm/util/resourceFetch/ResourceFetcher.java | 27 --
.../SparkHistoryServerResourceFetcher.java | 88 ------
.../connection/InputStreamUtils.java | 68 -----
.../util/resourceFetch/connection/JobUtils.java | 43 ---
.../connection/URLConnectionUtils.java | 101 -------
.../resourceFetch/ha/AbstractURLSelector.java | 110 -------
.../util/resourceFetch/ha/HAURLSelector.java | 28 --
.../resourceFetch/ha/HAURLSelectorImpl.java | 109 -------
.../jpm/util/resourceFetch/model/AppInfo.java | 210 --------------
.../util/resourceFetch/model/Applications.java | 38 ---
.../util/resourceFetch/model/AppsWrapper.java | 37 ---
.../util/resourceFetch/model/ClusterInfo.java | 119 --------
.../resourceFetch/model/ClusterInfoWrapper.java | 35 ---
.../resourceFetch/model/JobCounterGroup.java | 46 ---
.../resourceFetch/model/JobCounterItem.java | 62 ----
.../util/resourceFetch/model/JobCounters.java | 46 ---
.../resourceFetch/model/JobCountersWrapper.java | 35 ---
.../jpm/util/resourceFetch/model/MRJob.java | 289 -------------------
.../util/resourceFetch/model/MRJobsWrapper.java | 37 ---
.../jpm/util/resourceFetch/model/MRTask.java | 109 -------
.../util/resourceFetch/model/MRTaskAttempt.java | 136 ---------
.../model/MRTaskAttemptWrapper.java | 37 ---
.../resourceFetch/model/MRTaskAttempts.java | 39 ---
.../jpm/util/resourceFetch/model/MRTasks.java | 40 ---
.../resourceFetch/model/MRTasksWrapper.java | 37 ---
.../jpm/util/resourceFetch/model/MrJobs.java | 39 ---
.../resourceFetch/model/SparkApplication.java | 57 ----
.../model/SparkApplicationAttempt.java | 73 -----
.../model/SparkApplicationWrapper.java | 38 ---
.../util/resourceFetch/model/SparkExecutor.java | 155 ----------
.../jpm/util/resourceFetch/model/SparkJob.java | 165 -----------
.../util/resourceFetch/model/SparkStage.java | 211 --------------
.../jpm/util/resourceFetch/model/SparkTask.java | 111 -------
.../model/SparkTaskInputMetrics.java | 46 ---
.../resourceFetch/model/SparkTaskMetrics.java | 118 --------
.../model/SparkTaskShuffleReadMetrics.java | 82 ------
.../model/SparkTaskShuffleWriteMetrics.java | 55 ----
.../resourceFetch/model/TaskCounterGroup.java | 46 ---
.../resourceFetch/model/TaskCounterItem.java | 44 ---
.../util/resourceFetch/model/TaskCounters.java | 46 ---
.../model/TaskCountersWrapper.java | 35 ---
.../url/JobListServiceURLBuilderImpl.java | 52 ----
.../resourceFetch/url/ServiceURLBuilder.java | 21 --
.../SparkCompleteJobServiceURLBuilderImpl.java | 33 ---
.../url/SparkJobServiceURLBuilderImpl.java | 31 --
.../jpm/util/resourceFetch/url/URLUtil.java | 33 ---
.../util/resourcefetch/RMResourceFetcher.java | 189 ++++++++++++
.../jpm/util/resourcefetch/ResourceFetcher.java | 27 ++
.../SparkHistoryServerResourceFetcher.java | 88 ++++++
.../connection/InputStreamUtils.java | 68 +++++
.../util/resourcefetch/connection/JobUtils.java | 43 +++
.../connection/URLConnectionUtils.java | 101 +++++++
.../resourcefetch/ha/AbstractURLSelector.java | 110 +++++++
.../util/resourcefetch/ha/HAURLSelector.java | 28 ++
.../resourcefetch/ha/HAURLSelectorImpl.java | 109 +++++++
.../jpm/util/resourcefetch/model/AppInfo.java | 210 ++++++++++++++
.../util/resourcefetch/model/Applications.java | 38 +++
.../util/resourcefetch/model/AppsWrapper.java | 37 +++
.../util/resourcefetch/model/ClusterInfo.java | 119 ++++++++
.../resourcefetch/model/ClusterInfoWrapper.java | 35 +++
.../resourcefetch/model/JobCounterGroup.java | 46 +++
.../resourcefetch/model/JobCounterItem.java | 62 ++++
.../util/resourcefetch/model/JobCounters.java | 46 +++
.../resourcefetch/model/JobCountersWrapper.java | 35 +++
.../jpm/util/resourcefetch/model/MRJob.java | 289 +++++++++++++++++++
.../util/resourcefetch/model/MRJobsWrapper.java | 37 +++
.../jpm/util/resourcefetch/model/MRTask.java | 109 +++++++
.../util/resourcefetch/model/MRTaskAttempt.java | 136 +++++++++
.../model/MRTaskAttemptWrapper.java | 37 +++
.../resourcefetch/model/MRTaskAttempts.java | 39 +++
.../jpm/util/resourcefetch/model/MRTasks.java | 40 +++
.../resourcefetch/model/MRTasksWrapper.java | 37 +++
.../jpm/util/resourcefetch/model/MrJobs.java | 39 +++
.../resourcefetch/model/SparkApplication.java | 57 ++++
.../model/SparkApplicationAttempt.java | 73 +++++
.../model/SparkApplicationWrapper.java | 38 +++
.../util/resourcefetch/model/SparkExecutor.java | 155 ++++++++++
.../jpm/util/resourcefetch/model/SparkJob.java | 165 +++++++++++
.../util/resourcefetch/model/SparkStage.java | 211 ++++++++++++++
.../jpm/util/resourcefetch/model/SparkTask.java | 111 +++++++
.../model/SparkTaskInputMetrics.java | 46 +++
.../resourcefetch/model/SparkTaskMetrics.java | 118 ++++++++
.../model/SparkTaskShuffleReadMetrics.java | 82 ++++++
.../model/SparkTaskShuffleWriteMetrics.java | 55 ++++
.../resourcefetch/model/TaskCounterGroup.java | 46 +++
.../resourcefetch/model/TaskCounterItem.java | 44 +++
.../util/resourcefetch/model/TaskCounters.java | 46 +++
.../model/TaskCountersWrapper.java | 35 +++
.../url/JobListServiceURLBuilderImpl.java | 52 ++++
.../resourcefetch/url/ServiceURLBuilder.java | 21 ++
.../SparkCompleteJobServiceURLBuilderImpl.java | 33 +++
.../url/SparkJobServiceURLBuilderImpl.java | 31 ++
.../jpm/util/resourcefetch/url/URLUtil.java | 33 +++
94 files changed, 3606 insertions(+), 3606 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/RMResourceFetcher.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/RMResourceFetcher.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/RMResourceFetcher.java
deleted file mode 100644
index b1881ef..0000000
--- a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/RMResourceFetcher.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- * 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.eagle.jpm.util.resourcefetch;
-
-import org.apache.eagle.jpm.util.Constants;
-import org.apache.eagle.jpm.util.resourcefetch.connection.InputStreamUtils;
-import org.apache.eagle.jpm.util.resourcefetch.ha.HAURLSelector;
-import org.apache.eagle.jpm.util.resourcefetch.ha.HAURLSelectorImpl;
-import org.apache.eagle.jpm.util.resourcefetch.model.AppInfo;
-import org.apache.eagle.jpm.util.resourcefetch.model.AppsWrapper;
-import org.apache.eagle.jpm.util.resourcefetch.model.ClusterInfo;
-import org.apache.eagle.jpm.util.resourcefetch.model.ClusterInfoWrapper;
-import org.apache.eagle.jpm.util.resourcefetch.url.JobListServiceURLBuilderImpl;
-import org.apache.eagle.jpm.util.resourcefetch.url.ServiceURLBuilder;
-import org.apache.eagle.jpm.util.resourcefetch.url.SparkCompleteJobServiceURLBuilderImpl;
-import org.apache.eagle.jpm.util.resourcefetch.url.URLUtil;
-import org.codehaus.jackson.JsonParser;
-import org.codehaus.jackson.map.ObjectMapper;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.List;
-
-public class RMResourceFetcher implements ResourceFetcher<AppInfo> {
-
- private static final Logger LOG = LoggerFactory.getLogger(RMResourceFetcher.class);
- private final HAURLSelector selector;
- private final ServiceURLBuilder jobListServiceURLBuilder;
- private final ServiceURLBuilder sparkCompleteJobServiceURLBuilder;
- private static final ObjectMapper OBJ_MAPPER = new ObjectMapper();
-
- static {
- OBJ_MAPPER.configure(JsonParser.Feature.ALLOW_NON_NUMERIC_NUMBERS, true);
- }
-
- public RMResourceFetcher(String[] rmBasePaths) {
- this.jobListServiceURLBuilder = new JobListServiceURLBuilderImpl();
- this.sparkCompleteJobServiceURLBuilder = new SparkCompleteJobServiceURLBuilderImpl();
-
- this.selector = new HAURLSelectorImpl(rmBasePaths, jobListServiceURLBuilder, Constants.CompressionType.GZIP);
- }
-
- private void checkUrl() throws IOException {
- if (!selector.checkUrl(jobListServiceURLBuilder.build(selector.getSelectedUrl(), Constants.JobState.RUNNING.name()))) {
- selector.reSelectUrl();
- }
- }
-
- private List<AppInfo> doFetchFinishApplicationsList(String urlString, Constants.CompressionType compressionType) throws Exception {
- List<AppInfo> result;
- InputStream is = null;
- try {
- checkUrl();
- LOG.info("Going to call yarn api to fetch finished application list: " + urlString);
- is = InputStreamUtils.getInputStream(urlString, null, compressionType);
- final AppsWrapper appWrapper = OBJ_MAPPER.readValue(is, AppsWrapper.class);
- if (appWrapper != null && appWrapper.getApps() != null
- && appWrapper.getApps().getApp() != null) {
- result = appWrapper.getApps().getApp();
- return result;
- }
- return null;
- } finally {
- if (is != null) {
- try {
- is.close();
- } catch (Exception e) {
- LOG.warn("{}", e);
- }
- }
- }
- }
-
- private String getSparkRunningJobURL() {
- return selector.getSelectedUrl()
- + "/"
- + Constants.V2_APPS_URL
- + "?applicationTypes=SPARK&state=RUNNING&"
- + Constants.ANONYMOUS_PARAMETER;
- }
-
- private String getMRRunningJobURL() {
- return String.format("%s/%s?applicationTypes=MAPREDUCE&state=RUNNING&%s",
- selector.getSelectedUrl(),
- Constants.V2_APPS_URL,
- Constants.ANONYMOUS_PARAMETER);
- }
-
- private String getMRFinishedJobURL(String lastFinishedTime) {
- String url = URLUtil.removeTrailingSlash(selector.getSelectedUrl());
- return url + "/" + "Constants.V2_APPS_URL"
- + "?applicationTypes=MAPREDUCE&state=FINISHED&finishedTimeBegin="
- + lastFinishedTime + "&" + Constants.ANONYMOUS_PARAMETER;
- }
-
- private List<AppInfo> doFetchRunningApplicationsList(String urlString, Constants.CompressionType compressionType) throws Exception {
- List<AppInfo> result;
- InputStream is = null;
- try {
- checkUrl();
- LOG.info("Going to call yarn api to fetch running application list: " + urlString);
- is = InputStreamUtils.getInputStream(urlString, null, compressionType);
- final AppsWrapper appWrapper = OBJ_MAPPER.readValue(is, AppsWrapper.class);
- if (appWrapper != null && appWrapper.getApps() != null && appWrapper.getApps().getApp() != null) {
- result = appWrapper.getApps().getApp();
- return result;
- }
- return null;
- } finally {
- if (is != null) {
- try {
- is.close();
- } catch (Exception e) {
- LOG.warn("{}", e);
- }
- }
- }
- }
-
- private List<AppInfo> getResource(Constants.ResourceType resourceType, Constants.CompressionType compressionType, Object... parameter) throws Exception {
- switch (resourceType) {
- case COMPLETE_SPARK_JOB:
- final String urlString = sparkCompleteJobServiceURLBuilder.build(selector.getSelectedUrl(), (String) parameter[0]);
- return doFetchFinishApplicationsList(urlString, compressionType);
- case RUNNING_SPARK_JOB:
- return doFetchRunningApplicationsList(getSparkRunningJobURL(), compressionType);
- case RUNNING_MR_JOB:
- return doFetchRunningApplicationsList(getMRRunningJobURL(), compressionType);
- case COMPLETE_MR_JOB:
- return doFetchFinishApplicationsList(getMRFinishedJobURL((String) parameter[0]), compressionType);
- default:
- throw new Exception("Not support resourceType :" + resourceType);
- }
- }
-
- public List<AppInfo> getResource(Constants.ResourceType resourceType, Object... parameter) throws Exception {
- try {
- return getResource(resourceType, Constants.CompressionType.GZIP, parameter);
- } catch (java.util.zip.ZipException ex) {
- return getResource(resourceType, Constants.CompressionType.NONE, parameter);
- }
- }
-
- private String getClusterInfoURL() {
- return selector.getSelectedUrl() + "/" + Constants.YARN_API_CLUSTER_INFO + "?" + Constants.ANONYMOUS_PARAMETER;
- }
-
- public ClusterInfo getClusterInfo() throws Exception {
- InputStream is = null;
- try {
- checkUrl();
- final String urlString = getClusterInfoURL();
- LOG.info("Calling yarn api to fetch cluster info: " + urlString);
- is = InputStreamUtils.getInputStream(urlString, null, Constants.CompressionType.GZIP);
- final ClusterInfoWrapper clusterInfoWrapper = OBJ_MAPPER.readValue(is, ClusterInfoWrapper.class);
- if (clusterInfoWrapper != null && clusterInfoWrapper.getClusterInfo() != null) {
- return clusterInfoWrapper.getClusterInfo();
- }
- return null;
- } finally {
- if (is != null) {
- try {
- is.close();
- } catch (Exception e) {
- LOG.warn("{}", e);
- }
- }
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/ResourceFetcher.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/ResourceFetcher.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/ResourceFetcher.java
deleted file mode 100644
index f920ddb..0000000
--- a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/ResourceFetcher.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * 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.eagle.jpm.util.resourcefetch;
-
-import org.apache.eagle.jpm.util.Constants;
-
-import java.util.List;
-
-public interface ResourceFetcher<T> {
- //continue to refactor later
- List<T> getResource(Constants.ResourceType resoureType, Object... parameter) throws Exception;
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/SparkHistoryServerResourceFetcher.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/SparkHistoryServerResourceFetcher.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/SparkHistoryServerResourceFetcher.java
deleted file mode 100644
index ce2d9b8..0000000
--- a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/SparkHistoryServerResourceFetcher.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- *
- * * 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.eagle.jpm.util.resourcefetch;
-
-import org.apache.eagle.jpm.util.Constants;
-import org.apache.eagle.jpm.util.resourcefetch.connection.InputStreamUtils;
-import org.apache.eagle.jpm.util.resourcefetch.model.SparkApplication;
-import org.apache.eagle.jpm.util.resourcefetch.url.ServiceURLBuilder;
-import org.apache.eagle.jpm.util.resourcefetch.url.SparkJobServiceURLBuilderImpl;
-import org.apache.commons.codec.binary.Base64;
-import org.codehaus.jackson.JsonParser;
-import org.codehaus.jackson.map.ObjectMapper;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.FileNotFoundException;
-import java.io.InputStream;
-import java.util.Arrays;
-import java.util.List;
-
-public class SparkHistoryServerResourceFetcher implements ResourceFetcher<SparkApplication> {
-
- private static final Logger LOG = LoggerFactory.getLogger(SparkHistoryServerResourceFetcher.class);
-
- private static final ObjectMapper OBJ_MAPPER = new ObjectMapper();
-
- private String historyServerURL;
- private final ServiceURLBuilder sparkDetailJobServiceURLBuilder;
- private String auth;
-
- static {
- OBJ_MAPPER.configure(JsonParser.Feature.ALLOW_NON_NUMERIC_NUMBERS, true);
- }
-
- public SparkHistoryServerResourceFetcher(String historyServerURL, String userName, String pwd) {
- this.historyServerURL = historyServerURL;
- this.sparkDetailJobServiceURLBuilder = new SparkJobServiceURLBuilderImpl();
- this.auth = "Basic " + new String(new Base64().encode(String.format("%s:%s", userName, pwd).getBytes()));
- ;
- }
-
- private List<SparkApplication> doFetchSparkApplicationDetail(String appId) throws Exception {
- InputStream is = null;
- try {
- final String urlString = sparkDetailJobServiceURLBuilder.build(this.historyServerURL, appId);
- LOG.info("Going to call spark history server api to fetch spark job: " + urlString);
- is = InputStreamUtils.getInputStream(urlString, auth, Constants.CompressionType.NONE);
- SparkApplication app = OBJ_MAPPER.readValue(is, SparkApplication.class);
- return Arrays.asList(app);
- } catch (FileNotFoundException e) {
- return null;
- } finally {
- if (is != null) {
- try {
- is.close();
- } catch (Exception e) {
- LOG.warn("{}", e);
- }
- }
- }
- }
-
- public List<SparkApplication> getResource(Constants.ResourceType resoureType, Object... parameter) throws Exception {
- switch (resoureType) {
- case SPARK_JOB_DETAIL:
- return doFetchSparkApplicationDetail((String) parameter[0]);
- default:
- throw new Exception("Not support resourceType :" + resoureType);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/connection/InputStreamUtils.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/connection/InputStreamUtils.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/connection/InputStreamUtils.java
deleted file mode 100644
index e99e2aa..0000000
--- a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/connection/InputStreamUtils.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * 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.eagle.jpm.util.resourcefetch.connection;
-
-import org.apache.eagle.jpm.util.Constants;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.net.URLConnection;
-import java.util.zip.GZIPInputStream;
-
-public class InputStreamUtils {
-
- private static final int CONNECTION_TIMEOUT = 10 * 1000;
- private static final int READ_TIMEOUT = 5 * 60 * 1000;
- private static final String GZIP_HTTP_HEADER = "Accept-Encoding";
- private static final String GZIP_COMPRESSION = "gzip";
-
- private static InputStream openGZIPInputStream(URL url, String auth, int timeout) throws IOException {
- final URLConnection connection = url.openConnection();
- connection.setConnectTimeout(CONNECTION_TIMEOUT);
- connection.setReadTimeout(timeout);
- connection.addRequestProperty(GZIP_HTTP_HEADER, GZIP_COMPRESSION);
- if (null != auth) {
- connection.setRequestProperty("Authorization", auth);
- }
- return new GZIPInputStream(connection.getInputStream());
- }
-
- private static InputStream openInputStream(URL url, String auth, int timeout) throws IOException {
- URLConnection connection = url.openConnection();
- connection.setConnectTimeout(timeout);
- if (null != auth) {
- connection.setRequestProperty("Authorization", auth);
- }
-
- return connection.getInputStream();
- }
-
- public static InputStream getInputStream(String urlString, String auth, Constants.CompressionType compressionType, int timeout) throws Exception {
- final URL url = URLConnectionUtils.getUrl(urlString);
- if (compressionType.equals(Constants.CompressionType.GZIP)) {
- return openGZIPInputStream(url, auth, timeout);
- } else { // CompressionType.NONE
- return openInputStream(url, auth, timeout);
- }
- }
-
- public static InputStream getInputStream(String urlString, String auth, Constants.CompressionType compressionType) throws Exception {
- return getInputStream(urlString, auth, compressionType, READ_TIMEOUT);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/connection/JobUtils.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/connection/JobUtils.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/connection/JobUtils.java
deleted file mode 100644
index 44d27e8..0000000
--- a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/connection/JobUtils.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * 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.eagle.jpm.util.resourcefetch.connection;
-
-import org.apache.eagle.jpm.util.Constants;
-
-public class JobUtils {
-
- public static String checkAndAddLastSlash(String urlBase) {
- if (!urlBase.endsWith("/")) {
- return urlBase + "/";
- }
- return urlBase;
- }
-
- public static String getJobIDByAppID(String appID) {
- if (appID.startsWith(Constants.APPLICATION_PREFIX)) {
- return appID.replace(Constants.APPLICATION_PREFIX, Constants.JOB_PREFIX);
- }
- return null;
- }
-
- public static String getAppIDByJobID(String jobID) {
- if (jobID.startsWith(Constants.JOB_PREFIX)) {
- return jobID.replace(Constants.JOB_PREFIX, Constants.APPLICATION_PREFIX);
- }
- return null;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/connection/URLConnectionUtils.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/connection/URLConnectionUtils.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/connection/URLConnectionUtils.java
deleted file mode 100644
index 2cd60ba..0000000
--- a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/connection/URLConnectionUtils.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * 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.eagle.jpm.util.resourcefetch.connection;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLConnection;
-import java.security.KeyManagementException;
-import java.security.NoSuchAlgorithmException;
-import java.security.cert.CertificateException;
-import javax.net.ssl.*;
-
-public final class URLConnectionUtils {
- //TODO: change some public method to private
- private static final Logger LOG = LoggerFactory.getLogger(URLConnectionUtils.class);
-
- public static URLConnection getConnection(String url) throws Exception {
- if (url.startsWith("https://")) {
- return getHTTPSConnection(url);
- } else if (url.startsWith("http://")) {
- return getHTTPConnection(url);
- }
- throw new Exception("Invalid input argument url: " + url);
- }
-
- public static URLConnection getHTTPConnection(String urlString) throws Exception {
- final URL url = new URL(urlString);
- return url.openConnection();
- }
-
- public static URL getUrl(String urlString) throws Exception {
- if (urlString.toLowerCase().contains("https")) {
- return getHTTPSUrl(urlString);
- } else if (urlString.toLowerCase().contains("http")) {
- return getURL(urlString);
- }
- throw new Exception("Invalid input argument url: " + urlString);
- }
-
- public static URL getURL(String urlString) throws MalformedURLException {
- return new URL(urlString);
- }
-
- public static URL getHTTPSUrl(String urlString) throws MalformedURLException, NoSuchAlgorithmException, KeyManagementException {
- // Create a trust manager that does not validate certificate chains
- final TrustManager[] trustAllCerts = new TrustManager[] {new TrustAllX509TrustManager()};
- // Install the all-trusting trust manager
- final SSLContext sc = SSLContext.getInstance("SSL");
- sc.init(null, trustAllCerts, new java.security.SecureRandom());
- HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
- // Create all-trusting host name verifier
- final HostnameVerifier allHostsValid = new HostnameVerifier() {
- public boolean verify(String hostname, SSLSession session) {
- return true;
- }
- };
- HttpsURLConnection.setDefaultHostnameVerifier(allHostsValid);
- return new URL(urlString);
- }
-
- public static URLConnection getHTTPSConnection(String urlString) throws IOException, KeyManagementException, NoSuchAlgorithmException {
- final URL url = getHTTPSUrl(urlString);
- return url.openConnection();
- }
-
- public static class TrustAllX509TrustManager implements X509TrustManager {
- @Override
- public void checkClientTrusted(
- java.security.cert.X509Certificate[] chain, String authType)
- throws CertificateException {
- }
-
- @Override
- public void checkServerTrusted(
- java.security.cert.X509Certificate[] chain, String authType)
- throws CertificateException {
- }
-
- @Override
- public java.security.cert.X509Certificate[] getAcceptedIssuers() {
- return null;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/ha/AbstractURLSelector.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/ha/AbstractURLSelector.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/ha/AbstractURLSelector.java
deleted file mode 100644
index d25d05b..0000000
--- a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/ha/AbstractURLSelector.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * 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.eagle.jpm.util.resourcefetch.ha;
-
-import org.apache.eagle.jpm.util.Constants;
-import org.apache.eagle.jpm.util.resourcefetch.connection.InputStreamUtils;
-import org.apache.hadoop.util.StringUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Arrays;
-
-public abstract class AbstractURLSelector implements HAURLSelector {
- private final String[] urls;
- private volatile String selectedUrl;
-
- private volatile boolean reselectInProgress;
- private final Constants.CompressionType compressionType;
-
- private static final long MAX_RETRY_TIME = 3;
- private static final Logger LOG = LoggerFactory.getLogger(HAURLSelectorImpl.class);
-
- public AbstractURLSelector(String[] urls, Constants.CompressionType compressionType) {
- this.urls = urls;
- this.compressionType = compressionType;
- }
-
- public boolean checkUrl(String urlString) {
- InputStream is = null;
- try {
- is = InputStreamUtils.getInputStream(urlString, null, compressionType);
- } catch (Exception ex) {
- LOG.info("get input stream from url: " + urlString + " failed. ");
- return false;
- } finally {
- if (is != null) {
- try {
- is.close();
- } catch (IOException e) {
- LOG.warn("{}", e);
- }
- }
- }
- return true;
- }
-
- @Override
- public String getSelectedUrl() {
- if (selectedUrl == null) {
- selectedUrl = urls[0];
- }
- return selectedUrl;
- }
-
- @Override
- public void reSelectUrl() throws IOException {
- if (reselectInProgress) {
- return;
- }
- synchronized (this) {
- if (reselectInProgress) {
- return;
- }
- reselectInProgress = true;
- try {
- LOG.info("Going to reselect url");
- for (int i = 0; i < urls.length; i++) {
- String urlToCheck = urls[i];
- LOG.info("Going to try url :" + urlToCheck);
- for (int time = 0; time < MAX_RETRY_TIME; time++) {
- if (checkUrl(buildTestURL(urlToCheck))) {
- selectedUrl = urls[i];
- LOG.info("Successfully switch to new url : " + selectedUrl);
- return;
- }
- LOG.info("try url " + urlToCheck + "fail for " + (time + 1) + " times, sleep 5 seconds before try again. ");
- try {
- Thread.sleep(5 * 1000);
- } catch (InterruptedException ex) {
- LOG.warn("{}", ex);
- }
- }
- }
- throw new IOException("No alive url found: " + StringUtils.join(";", Arrays.asList(this.urls)));
- } finally {
- reselectInProgress = false;
- }
- }
- }
-
- protected abstract String buildTestURL(String urlToCheck);
-}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/ha/HAURLSelector.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/ha/HAURLSelector.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/ha/HAURLSelector.java
deleted file mode 100644
index fa9b52b..0000000
--- a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/ha/HAURLSelector.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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.eagle.jpm.util.resourcefetch.ha;
-
-import java.io.IOException;
-
-public interface HAURLSelector {
-
- boolean checkUrl(String url);
-
- void reSelectUrl() throws IOException;
-
- String getSelectedUrl();
-}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/ha/HAURLSelectorImpl.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/ha/HAURLSelectorImpl.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/ha/HAURLSelectorImpl.java
deleted file mode 100644
index a083ef2..0000000
--- a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/ha/HAURLSelectorImpl.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * 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.eagle.jpm.util.resourcefetch.ha;
-
-import org.apache.eagle.jpm.util.Constants;
-import org.apache.eagle.jpm.util.resourcefetch.connection.InputStreamUtils;
-import org.apache.eagle.jpm.util.resourcefetch.url.ServiceURLBuilder;
-import org.apache.hadoop.util.StringUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Arrays;
-
-public class HAURLSelectorImpl implements HAURLSelector {
-
- private final String[] urls;
- private volatile String selectedUrl;
- private final ServiceURLBuilder builder;
-
- private volatile boolean reselectInProgress;
- private final Constants.CompressionType compressionType;
- private static final long MAX_RETRY_TIME = 2;
- private static final Logger LOG = LoggerFactory.getLogger(HAURLSelectorImpl.class);
-
- public HAURLSelectorImpl(String[] urls, ServiceURLBuilder builder, Constants.CompressionType compressionType) {
- this.urls = urls;
- this.compressionType = compressionType;
- this.builder = builder;
- }
-
- public boolean checkUrl(String urlString) {
- InputStream is = null;
- try {
- is = InputStreamUtils.getInputStream(urlString, null, compressionType);
- } catch (Exception ex) {
- LOG.info("get inputstream from url: " + urlString + " failed. ");
- return false;
- } finally {
- if (is != null) {
- try {
- is.close();
- } catch (IOException e) {
- LOG.warn("{}", e);
- }
- }
- }
- return true;
- }
-
- @Override
- public String getSelectedUrl() {
- if (selectedUrl == null) {
- selectedUrl = urls[0];
- }
- return selectedUrl;
- }
-
- @Override
- public void reSelectUrl() throws IOException {
- if (reselectInProgress) {
- return;
- }
- synchronized (this) {
- if (reselectInProgress) {
- return;
- }
- reselectInProgress = true;
- try {
- LOG.info("Going to reselect url");
- for (int i = 0; i < urls.length; i++) {
- String urlToCheck = urls[i];
- LOG.info("Going to try url :" + urlToCheck);
- for (int time = 0; time < MAX_RETRY_TIME; time++) {
- if (checkUrl(builder.build(urlToCheck, Constants.JobState.RUNNING.name()))) {
- selectedUrl = urls[i];
- LOG.info("Successfully switch to new url : " + selectedUrl);
- return;
- }
- LOG.info("try url " + urlToCheck + "fail for " + (time + 1) + " times, sleep 5 seconds before try again. ");
- try {
- Thread.sleep(1000);
- } catch (InterruptedException ex) {
- LOG.warn("{}", ex);
- }
- }
- }
- throw new IOException("No alive url found: " + StringUtils.join(";", Arrays.asList(this.urls)));
- } finally {
- reselectInProgress = false;
- }
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/AppInfo.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/AppInfo.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/AppInfo.java
deleted file mode 100644
index f769217..0000000
--- a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/AppInfo.java
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
- * 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.eagle.jpm.util.resourcefetch.model;
-
-import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.map.annotate.JsonSerialize;
-
-import java.io.Serializable;
-
-@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class AppInfo implements Serializable {
- private static final long serialVersionUID = 1L;
-
- private String id;
- private String user;
- private String name;
- private String queue;
- private String state;
- private String finalStatus;
- private double progress;
- private String trackingUI;
- private String trackingUrl;
- private String diagnostics;
- private String clusterId;
- private String applicationType;
- private long startedTime;
- private long finishedTime;
- private long elapsedTime;
- private String amContainerLogs;
- private String amHostHttpAddress;
- private long allocatedMB;
- private int allocatedVCores;
- private int runningContainers;
-
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public String getUser() {
- return user;
- }
-
- public void setUser(String user) {
- this.user = user;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getQueue() {
- return queue;
- }
-
- public void setQueue(String queue) {
- this.queue = queue;
- }
-
- public String getState() {
- return state;
- }
-
- public void setState(String state) {
- this.state = state;
- }
-
- public String getFinalStatus() {
- return finalStatus;
- }
-
- public void setFinalStatus(String finalStatus) {
- this.finalStatus = finalStatus;
- }
-
- public double getProgress() {
- return progress;
- }
-
- public void setProgress(double progress) {
- this.progress = progress;
- }
-
- public String getTrackingUI() {
- return trackingUI;
- }
-
- public void setTrackingUI(String trackingUI) {
- this.trackingUI = trackingUI;
- }
-
- public String getTrackingUrl() {
- return trackingUrl;
- }
-
- public void setTrackingUrl(String trackingUrl) {
- this.trackingUrl = trackingUrl;
- }
-
- public String getDiagnostics() {
- return diagnostics;
- }
-
- public void setDiagnostics(String diagnostics) {
- this.diagnostics = diagnostics;
- }
-
- public String getClusterId() {
- return clusterId;
- }
-
- public void setClusterId(String clusterId) {
- this.clusterId = clusterId;
- }
-
- public String getApplicationType() {
- return applicationType;
- }
-
- public void setApplicationType(String applicationType) {
- this.applicationType = applicationType;
- }
-
- public long getStartedTime() {
- return startedTime;
- }
-
- public void setStartedTime(long startedTime) {
- this.startedTime = startedTime;
- }
-
- public long getFinishedTime() {
- return finishedTime;
- }
-
- public void setFinishedTime(long finishedTime) {
- this.finishedTime = finishedTime;
- }
-
- public long getElapsedTime() {
- return elapsedTime;
- }
-
- public void setElapsedTime(long elapsedTime) {
- this.elapsedTime = elapsedTime;
- }
-
- public String getAmContainerLogs() {
- return amContainerLogs;
- }
-
- public void setAmContainerLogs(String amContainerLogs) {
- this.amContainerLogs = amContainerLogs;
- }
-
- public String getAmHostHttpAddress() {
- return amHostHttpAddress;
- }
-
- public void setAmHostHttpAddress(String amHostHttpAddress) {
- this.amHostHttpAddress = amHostHttpAddress;
- }
-
- public long getAllocatedMB() {
- return allocatedMB;
- }
-
- public void setAllocatedMB(long allocatedMB) {
- this.allocatedMB = allocatedMB;
- }
-
- public int getAllocatedVCores() {
- return allocatedVCores;
- }
-
- public void setAllocatedVCores(int allocatedVCores) {
- this.allocatedVCores = allocatedVCores;
- }
-
- public int getRunningContainers() {
- return runningContainers;
- }
-
- public void setRunningContainers(int runningContainers) {
- this.runningContainers = runningContainers;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/Applications.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/Applications.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/Applications.java
deleted file mode 100644
index 22ee2b9..0000000
--- a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/Applications.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * 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.eagle.jpm.util.resourcefetch.model;
-
-import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.map.annotate.JsonSerialize;
-
-import java.util.List;
-
-@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class Applications {
-
- private List<AppInfo> app;
-
- public List<AppInfo> getApp() {
- return app;
- }
-
- public void setApp(List<AppInfo> app) {
- this.app = app;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/AppsWrapper.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/AppsWrapper.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/AppsWrapper.java
deleted file mode 100644
index 63e37eb..0000000
--- a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/AppsWrapper.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * 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.eagle.jpm.util.resourcefetch.model;
-
-import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.map.annotate.JsonSerialize;
-
-@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class AppsWrapper {
- private static final long serialVersionUID = 1L;
-
- private Applications apps;
-
- public Applications getApps() {
- return apps;
- }
-
- public void setApps(Applications apps) {
- this.apps = apps;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/ClusterInfo.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/ClusterInfo.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/ClusterInfo.java
deleted file mode 100644
index 6e16b7f..0000000
--- a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/ClusterInfo.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * 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.eagle.jpm.util.resourcefetch.model;
-
-import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.map.annotate.JsonSerialize;
-
-import java.io.Serializable;
-
-@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class ClusterInfo implements Serializable {
- private static final long serialVersionUID = 1L;
-
- private long id;
- private long startedOn;
- private String state;
- private String haState;
- private String resourceManagerVersion;
- private String resourceManagerBuildVersion;
- private String resourceManagerVersionBuiltOn;
- private String hadoopVersion;
- private String hadoopBuildVersion;
- private String hadoopVersionBuiltOn;
-
- public long getId() {
- return id;
- }
-
- public void setId(long id) {
- this.id = id;
- }
-
- public long getStartedOn() {
- return startedOn;
- }
-
- public void setStartedOn(long startedOn) {
- this.startedOn = startedOn;
- }
-
- public String getState() {
- return state;
- }
-
- public void setState(String state) {
- this.state = state;
- }
-
- public String getHaState() {
- return haState;
- }
-
- public void setHaState(String haState) {
- this.haState = haState;
- }
-
- public String getResourceManagerVersion() {
- return resourceManagerVersion;
- }
-
- public void setResourceManagerVersion(String resourceManagerVersion) {
- this.resourceManagerVersion = resourceManagerVersion;
- }
-
- public String getResourceManagerBuildVersion() {
- return resourceManagerBuildVersion;
- }
-
- public void setResourceManagerBuildVersion(String resourceManagerBuildVersion) {
- this.resourceManagerBuildVersion = resourceManagerBuildVersion;
- }
-
- public String getResourceManagerVersionBuiltOn() {
- return resourceManagerVersionBuiltOn;
- }
-
- public void setResourceManagerVersionBuiltOn(String resourceManagerVersionBuiltOn) {
- this.resourceManagerVersionBuiltOn = resourceManagerVersionBuiltOn;
- }
-
- public String getHadoopVersion() {
- return hadoopVersion;
- }
-
- public void setHadoopVersion(String hadoopVersion) {
- this.hadoopVersion = hadoopVersion;
- }
-
- public String getHadoopBuildVersion() {
- return hadoopBuildVersion;
- }
-
- public void setHadoopBuildVersion(String hadoopBuildVersion) {
- this.hadoopBuildVersion = hadoopBuildVersion;
- }
-
- public String getHadoopVersionBuiltOn() {
- return hadoopVersionBuiltOn;
- }
-
- public void setHadoopVersionBuiltOn(String hadoopVersionBuiltOn) {
- this.hadoopVersionBuiltOn = hadoopVersionBuiltOn;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/ClusterInfoWrapper.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/ClusterInfoWrapper.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/ClusterInfoWrapper.java
deleted file mode 100644
index 4359e66..0000000
--- a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/ClusterInfoWrapper.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * 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.eagle.jpm.util.resourcefetch.model;
-
-import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.map.annotate.JsonSerialize;
-
-@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class ClusterInfoWrapper {
- private ClusterInfo clusterInfo;
-
- public ClusterInfo getClusterInfo() {
- return clusterInfo;
- }
-
- public void setClusterInfo(ClusterInfo clusterInfo) {
- this.clusterInfo = clusterInfo;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/JobCounterGroup.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/JobCounterGroup.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/JobCounterGroup.java
deleted file mode 100644
index 189767b..0000000
--- a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/JobCounterGroup.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * 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.eagle.jpm.util.resourcefetch.model;
-
-import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.map.annotate.JsonSerialize;
-
-import java.util.List;
-
-@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class JobCounterGroup {
- private String counterGroupName;
- private List<JobCounterItem> counter;
-
- public String getCounterGroupName() {
- return counterGroupName;
- }
-
- public void setCounterGroupName(String counterGroupName) {
- this.counterGroupName = counterGroupName;
- }
-
- public List<JobCounterItem> getCounter() {
- return counter;
- }
-
- public void setCounter(List<JobCounterItem> counter) {
- this.counter = counter;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/JobCounterItem.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/JobCounterItem.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/JobCounterItem.java
deleted file mode 100644
index 001c5ff..0000000
--- a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/JobCounterItem.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * 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.eagle.jpm.util.resourcefetch.model;
-
-import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.map.annotate.JsonSerialize;
-
-@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class JobCounterItem {
- private String name;
- private long totalCounterValue;
- private long mapCounterValue;
- private long reduceCounterValue;
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public long getTotalCounterValue() {
- return totalCounterValue;
- }
-
- public void setTotalCounterValue(long totalCounterValue) {
- this.totalCounterValue = totalCounterValue;
- }
-
- public long getMapCounterValue() {
- return mapCounterValue;
- }
-
- public void setMapCounterValue(long mapCounterValue) {
- this.mapCounterValue = mapCounterValue;
- }
-
- public long getReduceCounterValue() {
- return reduceCounterValue;
- }
-
- public void setReduceCounterValue(long reduceCounterValue) {
- this.reduceCounterValue = reduceCounterValue;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/JobCounters.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/JobCounters.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/JobCounters.java
deleted file mode 100644
index cc0709f..0000000
--- a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/JobCounters.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * 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.eagle.jpm.util.resourcefetch.model;
-
-import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.map.annotate.JsonSerialize;
-
-import java.util.List;
-
-@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class JobCounters {
- private String id;
- private List<JobCounterGroup> counterGroup;
-
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public List<JobCounterGroup> getCounterGroup() {
- return counterGroup;
- }
-
- public void setCounterGroup(List<JobCounterGroup> counterGroup) {
- this.counterGroup = counterGroup;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/JobCountersWrapper.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/JobCountersWrapper.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/JobCountersWrapper.java
deleted file mode 100644
index f6bb29c..0000000
--- a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/JobCountersWrapper.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * 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.eagle.jpm.util.resourcefetch.model;
-
-import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.map.annotate.JsonSerialize;
-
-@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class JobCountersWrapper {
- public JobCounters getJobCounters() {
- return jobCounters;
- }
-
- public void setJobCounters(JobCounters jobCounters) {
- this.jobCounters = jobCounters;
- }
-
- private JobCounters jobCounters;
-}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/MRJob.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/MRJob.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/MRJob.java
deleted file mode 100644
index f12a5d7..0000000
--- a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/MRJob.java
+++ /dev/null
@@ -1,289 +0,0 @@
-/*
- *
- * * 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.eagle.jpm.util.resourcefetch.model;
-
-import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.map.annotate.JsonSerialize;
-
-@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class MRJob {
- private long startTime;
- private long finishTime;
- private long elapsedTime;
- private String id;
- private String name;
- private String user;
- private String state;
- private int mapsTotal;
- private int mapsCompleted;
- private int reducesTotal;
- private int reducesCompleted;
- private double mapProgress;
- private double reduceProgress;
- private int mapsPending;
- private int mapsRunning;
- private int reducesPending;
- private int reducesRunning;
- private boolean uberized;
- private String diagnostics;
- private int newReduceAttempts;
- private int runningReduceAttempts;
- private int failedReduceAttempts;
- private int killedReduceAttempts;
- private int successfulReduceAttempts;
- private int newMapAttempts;
- private int runningMapAttempts;
- private int failedMapAttempts;
- private int killedMapAttempts;
- private int successfulMapAttempts;
-
- public long getStartTime() {
- return startTime;
- }
-
- public void setStartTime(long startTime) {
- this.startTime = startTime;
- }
-
- public long getFinishTime() {
- return finishTime;
- }
-
- public void setFinishTime(long finishTime) {
- this.finishTime = finishTime;
- }
-
- public long getElapsedTime() {
- return elapsedTime;
- }
-
- public void setElapsedTime(long elapsedTime) {
- this.elapsedTime = elapsedTime;
- }
-
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getUser() {
- return user;
- }
-
- public void setUser(String user) {
- this.user = user;
- }
-
- public String getState() {
- return state;
- }
-
- public void setState(String state) {
- this.state = state;
- }
-
- public int getMapsTotal() {
- return mapsTotal;
- }
-
- public void setMapsTotal(int mapsTotal) {
- this.mapsTotal = mapsTotal;
- }
-
- public int getMapsCompleted() {
- return mapsCompleted;
- }
-
- public void setMapsCompleted(int mapsCompleted) {
- this.mapsCompleted = mapsCompleted;
- }
-
- public int getReducesTotal() {
- return reducesTotal;
- }
-
- public void setReducesTotal(int reducesTotal) {
- this.reducesTotal = reducesTotal;
- }
-
- public int getReducesCompleted() {
- return reducesCompleted;
- }
-
- public void setReducesCompleted(int reducesCompleted) {
- this.reducesCompleted = reducesCompleted;
- }
-
- public double getMapProgress() {
- return mapProgress;
- }
-
- public void setMapProgress(double mapProgress) {
- this.mapProgress = mapProgress;
- }
-
- public double getReduceProgress() {
- return reduceProgress;
- }
-
- public void setReduceProgress(double reduceProgress) {
- this.reduceProgress = reduceProgress;
- }
-
- public int getMapsPending() {
- return mapsPending;
- }
-
- public void setMapsPending(int mapsPending) {
- this.mapsPending = mapsPending;
- }
-
- public int getMapsRunning() {
- return mapsRunning;
- }
-
- public void setMapsRunning(int mapsRunning) {
- this.mapsRunning = mapsRunning;
- }
-
- public int getReducesPending() {
- return reducesPending;
- }
-
- public void setReducesPending(int reducesPending) {
- this.reducesPending = reducesPending;
- }
-
- public int getReducesRunning() {
- return reducesRunning;
- }
-
- public void setReducesRunning(int reducesRunning) {
- this.reducesRunning = reducesRunning;
- }
-
- public boolean isUberized() {
- return uberized;
- }
-
- public void setUberized(boolean uberized) {
- this.uberized = uberized;
- }
-
- public String getDiagnostics() {
- return diagnostics;
- }
-
- public void setDiagnostics(String diagnostics) {
- this.diagnostics = diagnostics;
- }
-
- public int getNewReduceAttempts() {
- return newReduceAttempts;
- }
-
- public void setNewReduceAttempts(int newReduceAttempts) {
- this.newReduceAttempts = newReduceAttempts;
- }
-
- public int getRunningReduceAttempts() {
- return runningReduceAttempts;
- }
-
- public void setRunningReduceAttempts(int runningReduceAttempts) {
- this.runningReduceAttempts = runningReduceAttempts;
- }
-
- public int getFailedReduceAttempts() {
- return failedReduceAttempts;
- }
-
- public void setFailedReduceAttempts(int failedReduceAttempts) {
- this.failedReduceAttempts = failedReduceAttempts;
- }
-
- public int getKilledReduceAttempts() {
- return killedReduceAttempts;
- }
-
- public void setKilledReduceAttempts(int killedReduceAttempts) {
- this.killedReduceAttempts = killedReduceAttempts;
- }
-
- public int getSuccessfulReduceAttempts() {
- return successfulReduceAttempts;
- }
-
- public void setSuccessfulReduceAttempts(int successfulReduceAttempts) {
- this.successfulReduceAttempts = successfulReduceAttempts;
- }
-
- public int getNewMapAttempts() {
- return newMapAttempts;
- }
-
- public void setNewMapAttempts(int newMapAttempts) {
- this.newMapAttempts = newMapAttempts;
- }
-
- public int getRunningMapAttempts() {
- return runningMapAttempts;
- }
-
- public void setRunningMapAttempts(int runningMapAttempts) {
- this.runningMapAttempts = runningMapAttempts;
- }
-
- public int getFailedMapAttempts() {
- return failedMapAttempts;
- }
-
- public void setFailedMapAttempts(int failedMapAttempts) {
- this.failedMapAttempts = failedMapAttempts;
- }
-
- public int getKilledMapAttempts() {
- return killedMapAttempts;
- }
-
- public void setKilledMapAttempts(int killedMapAttempts) {
- this.killedMapAttempts = killedMapAttempts;
- }
-
- public int getSuccessfulMapAttempts() {
- return successfulMapAttempts;
- }
-
- public void setSuccessfulMapAttempts(int successfulMapAttempts) {
- this.successfulMapAttempts = successfulMapAttempts;
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/MRJobsWrapper.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/MRJobsWrapper.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/MRJobsWrapper.java
deleted file mode 100644
index acd316f..0000000
--- a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/MRJobsWrapper.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- *
- * * 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.eagle.jpm.util.resourcefetch.model;
-
-import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.map.annotate.JsonSerialize;
-
-@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class MRJobsWrapper {
- public MrJobs getJobs() {
- return jobs;
- }
-
- public void setJobs(MrJobs jobs) {
- this.jobs = jobs;
- }
-
- private MrJobs jobs;
-}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/MRTask.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/MRTask.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/MRTask.java
deleted file mode 100644
index 4a549de..0000000
--- a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/MRTask.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- *
- * * 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.eagle.jpm.util.resourcefetch.model;
-
-import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.map.annotate.JsonSerialize;
-
-@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class MRTask {
- private long startTime;
- private long finishTime;
- private long elapsedTime;
- private double progress;
- private String id;
- private String state;
- private String type;
- private String successfulAttempt;
- private String status;
-
- public long getStartTime() {
- return startTime;
- }
-
- public void setStartTime(long startTime) {
- this.startTime = startTime;
- }
-
- public long getFinishTime() {
- return finishTime;
- }
-
- public void setFinishTime(long finishTime) {
- this.finishTime = finishTime;
- }
-
- public long getElapsedTime() {
- return elapsedTime;
- }
-
- public void setElapsedTime(long elapsedTime) {
- this.elapsedTime = elapsedTime;
- }
-
- public double getProgress() {
- return progress;
- }
-
- public void setProgress(double progress) {
- this.progress = progress;
- }
-
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public String getState() {
- return state;
- }
-
- public void setState(String state) {
- this.state = state;
- }
-
- public String getType() {
- return type;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- public String getSuccessfulAttempt() {
- return successfulAttempt;
- }
-
- public void setSuccessfulAttempt(String successfulAttempt) {
- this.successfulAttempt = successfulAttempt;
- }
-
- public String getStatus() {
- return status;
- }
-
- public void setStatus(String status) {
- this.status = status;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/MRTaskAttempt.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/MRTaskAttempt.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/MRTaskAttempt.java
deleted file mode 100644
index 218d021..0000000
--- a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/MRTaskAttempt.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- *
- * * 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.eagle.jpm.util.resourcefetch.model;
-
-import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.map.annotate.JsonSerialize;
-
-@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class MRTaskAttempt {
- private long startTime;
- private long finishTime;
- private long elapsedTime;
- private double progress;
- private String id;
- private String rack;
- private String state;
- private String status;
- private String nodeHttpAddress;
- private String diagnostics;
- private String type;
- private String assignedContainerId;
-
- public long getStartTime() {
- return startTime;
- }
-
- public void setStartTime(long startTime) {
- this.startTime = startTime;
- }
-
- public long getFinishTime() {
- return finishTime;
- }
-
- public void setFinishTime(long finishTime) {
- this.finishTime = finishTime;
- }
-
- public long getElapsedTime() {
- return elapsedTime;
- }
-
- public void setElapsedTime(long elapsedTime) {
- this.elapsedTime = elapsedTime;
- }
-
- public double getProgress() {
- return progress;
- }
-
- public void setProgress(double progress) {
- this.progress = progress;
- }
-
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public String getRack() {
- return rack;
- }
-
- public void setRack(String rack) {
- this.rack = rack;
- }
-
- public String getState() {
- return state;
- }
-
- public void setState(String state) {
- this.state = state;
- }
-
- public String getStatus() {
- return status;
- }
-
- public void setStatus(String status) {
- this.status = status;
- }
-
- public String getNodeHttpAddress() {
- return nodeHttpAddress;
- }
-
- public void setNodeHttpAddress(String nodeHttpAddress) {
- this.nodeHttpAddress = nodeHttpAddress;
- }
-
- public String getDiagnostics() {
- return diagnostics;
- }
-
- public void setDiagnostics(String diagnostics) {
- this.diagnostics = diagnostics;
- }
-
- public String getType() {
- return type;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- public String getAssignedContainerId() {
- return assignedContainerId;
- }
-
- public void setAssignedContainerId(String assignedContainerId) {
- this.assignedContainerId = assignedContainerId;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/MRTaskAttemptWrapper.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/MRTaskAttemptWrapper.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/MRTaskAttemptWrapper.java
deleted file mode 100644
index 005b73a..0000000
--- a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourceFetch/model/MRTaskAttemptWrapper.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- *
- * * 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.eagle.jpm.util.resourcefetch.model;
-
-import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.map.annotate.JsonSerialize;
-
-@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class MRTaskAttemptWrapper {
- public MRTaskAttempts getTaskAttempts() {
- return taskAttempts;
- }
-
- public void setTaskAttempts(MRTaskAttempts taskAttempts) {
- this.taskAttempts = taskAttempts;
- }
-
- private MRTaskAttempts taskAttempts;
-}
[2/4] incubator-eagle git commit: [minor] Change resourceFetch to
resourcefetch
Posted by qi...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/connection/URLConnectionUtils.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/connection/URLConnectionUtils.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/connection/URLConnectionUtils.java
new file mode 100644
index 0000000..2cd60ba
--- /dev/null
+++ b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/connection/URLConnectionUtils.java
@@ -0,0 +1,101 @@
+/*
+ * 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.eagle.jpm.util.resourcefetch.connection;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLConnection;
+import java.security.KeyManagementException;
+import java.security.NoSuchAlgorithmException;
+import java.security.cert.CertificateException;
+import javax.net.ssl.*;
+
+public final class URLConnectionUtils {
+ //TODO: change some public method to private
+ private static final Logger LOG = LoggerFactory.getLogger(URLConnectionUtils.class);
+
+ public static URLConnection getConnection(String url) throws Exception {
+ if (url.startsWith("https://")) {
+ return getHTTPSConnection(url);
+ } else if (url.startsWith("http://")) {
+ return getHTTPConnection(url);
+ }
+ throw new Exception("Invalid input argument url: " + url);
+ }
+
+ public static URLConnection getHTTPConnection(String urlString) throws Exception {
+ final URL url = new URL(urlString);
+ return url.openConnection();
+ }
+
+ public static URL getUrl(String urlString) throws Exception {
+ if (urlString.toLowerCase().contains("https")) {
+ return getHTTPSUrl(urlString);
+ } else if (urlString.toLowerCase().contains("http")) {
+ return getURL(urlString);
+ }
+ throw new Exception("Invalid input argument url: " + urlString);
+ }
+
+ public static URL getURL(String urlString) throws MalformedURLException {
+ return new URL(urlString);
+ }
+
+ public static URL getHTTPSUrl(String urlString) throws MalformedURLException, NoSuchAlgorithmException, KeyManagementException {
+ // Create a trust manager that does not validate certificate chains
+ final TrustManager[] trustAllCerts = new TrustManager[] {new TrustAllX509TrustManager()};
+ // Install the all-trusting trust manager
+ final SSLContext sc = SSLContext.getInstance("SSL");
+ sc.init(null, trustAllCerts, new java.security.SecureRandom());
+ HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
+ // Create all-trusting host name verifier
+ final HostnameVerifier allHostsValid = new HostnameVerifier() {
+ public boolean verify(String hostname, SSLSession session) {
+ return true;
+ }
+ };
+ HttpsURLConnection.setDefaultHostnameVerifier(allHostsValid);
+ return new URL(urlString);
+ }
+
+ public static URLConnection getHTTPSConnection(String urlString) throws IOException, KeyManagementException, NoSuchAlgorithmException {
+ final URL url = getHTTPSUrl(urlString);
+ return url.openConnection();
+ }
+
+ public static class TrustAllX509TrustManager implements X509TrustManager {
+ @Override
+ public void checkClientTrusted(
+ java.security.cert.X509Certificate[] chain, String authType)
+ throws CertificateException {
+ }
+
+ @Override
+ public void checkServerTrusted(
+ java.security.cert.X509Certificate[] chain, String authType)
+ throws CertificateException {
+ }
+
+ @Override
+ public java.security.cert.X509Certificate[] getAcceptedIssuers() {
+ return null;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/ha/AbstractURLSelector.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/ha/AbstractURLSelector.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/ha/AbstractURLSelector.java
new file mode 100644
index 0000000..d25d05b
--- /dev/null
+++ b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/ha/AbstractURLSelector.java
@@ -0,0 +1,110 @@
+/*
+ * 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.eagle.jpm.util.resourcefetch.ha;
+
+import org.apache.eagle.jpm.util.Constants;
+import org.apache.eagle.jpm.util.resourcefetch.connection.InputStreamUtils;
+import org.apache.hadoop.util.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Arrays;
+
+public abstract class AbstractURLSelector implements HAURLSelector {
+ private final String[] urls;
+ private volatile String selectedUrl;
+
+ private volatile boolean reselectInProgress;
+ private final Constants.CompressionType compressionType;
+
+ private static final long MAX_RETRY_TIME = 3;
+ private static final Logger LOG = LoggerFactory.getLogger(HAURLSelectorImpl.class);
+
+ public AbstractURLSelector(String[] urls, Constants.CompressionType compressionType) {
+ this.urls = urls;
+ this.compressionType = compressionType;
+ }
+
+ public boolean checkUrl(String urlString) {
+ InputStream is = null;
+ try {
+ is = InputStreamUtils.getInputStream(urlString, null, compressionType);
+ } catch (Exception ex) {
+ LOG.info("get input stream from url: " + urlString + " failed. ");
+ return false;
+ } finally {
+ if (is != null) {
+ try {
+ is.close();
+ } catch (IOException e) {
+ LOG.warn("{}", e);
+ }
+ }
+ }
+ return true;
+ }
+
+ @Override
+ public String getSelectedUrl() {
+ if (selectedUrl == null) {
+ selectedUrl = urls[0];
+ }
+ return selectedUrl;
+ }
+
+ @Override
+ public void reSelectUrl() throws IOException {
+ if (reselectInProgress) {
+ return;
+ }
+ synchronized (this) {
+ if (reselectInProgress) {
+ return;
+ }
+ reselectInProgress = true;
+ try {
+ LOG.info("Going to reselect url");
+ for (int i = 0; i < urls.length; i++) {
+ String urlToCheck = urls[i];
+ LOG.info("Going to try url :" + urlToCheck);
+ for (int time = 0; time < MAX_RETRY_TIME; time++) {
+ if (checkUrl(buildTestURL(urlToCheck))) {
+ selectedUrl = urls[i];
+ LOG.info("Successfully switch to new url : " + selectedUrl);
+ return;
+ }
+ LOG.info("try url " + urlToCheck + "fail for " + (time + 1) + " times, sleep 5 seconds before try again. ");
+ try {
+ Thread.sleep(5 * 1000);
+ } catch (InterruptedException ex) {
+ LOG.warn("{}", ex);
+ }
+ }
+ }
+ throw new IOException("No alive url found: " + StringUtils.join(";", Arrays.asList(this.urls)));
+ } finally {
+ reselectInProgress = false;
+ }
+ }
+ }
+
+ protected abstract String buildTestURL(String urlToCheck);
+}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/ha/HAURLSelector.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/ha/HAURLSelector.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/ha/HAURLSelector.java
new file mode 100644
index 0000000..fa9b52b
--- /dev/null
+++ b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/ha/HAURLSelector.java
@@ -0,0 +1,28 @@
+/*
+ * 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.eagle.jpm.util.resourcefetch.ha;
+
+import java.io.IOException;
+
+public interface HAURLSelector {
+
+ boolean checkUrl(String url);
+
+ void reSelectUrl() throws IOException;
+
+ String getSelectedUrl();
+}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/ha/HAURLSelectorImpl.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/ha/HAURLSelectorImpl.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/ha/HAURLSelectorImpl.java
new file mode 100644
index 0000000..a083ef2
--- /dev/null
+++ b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/ha/HAURLSelectorImpl.java
@@ -0,0 +1,109 @@
+/*
+ * 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.eagle.jpm.util.resourcefetch.ha;
+
+import org.apache.eagle.jpm.util.Constants;
+import org.apache.eagle.jpm.util.resourcefetch.connection.InputStreamUtils;
+import org.apache.eagle.jpm.util.resourcefetch.url.ServiceURLBuilder;
+import org.apache.hadoop.util.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Arrays;
+
+public class HAURLSelectorImpl implements HAURLSelector {
+
+ private final String[] urls;
+ private volatile String selectedUrl;
+ private final ServiceURLBuilder builder;
+
+ private volatile boolean reselectInProgress;
+ private final Constants.CompressionType compressionType;
+ private static final long MAX_RETRY_TIME = 2;
+ private static final Logger LOG = LoggerFactory.getLogger(HAURLSelectorImpl.class);
+
+ public HAURLSelectorImpl(String[] urls, ServiceURLBuilder builder, Constants.CompressionType compressionType) {
+ this.urls = urls;
+ this.compressionType = compressionType;
+ this.builder = builder;
+ }
+
+ public boolean checkUrl(String urlString) {
+ InputStream is = null;
+ try {
+ is = InputStreamUtils.getInputStream(urlString, null, compressionType);
+ } catch (Exception ex) {
+ LOG.info("get inputstream from url: " + urlString + " failed. ");
+ return false;
+ } finally {
+ if (is != null) {
+ try {
+ is.close();
+ } catch (IOException e) {
+ LOG.warn("{}", e);
+ }
+ }
+ }
+ return true;
+ }
+
+ @Override
+ public String getSelectedUrl() {
+ if (selectedUrl == null) {
+ selectedUrl = urls[0];
+ }
+ return selectedUrl;
+ }
+
+ @Override
+ public void reSelectUrl() throws IOException {
+ if (reselectInProgress) {
+ return;
+ }
+ synchronized (this) {
+ if (reselectInProgress) {
+ return;
+ }
+ reselectInProgress = true;
+ try {
+ LOG.info("Going to reselect url");
+ for (int i = 0; i < urls.length; i++) {
+ String urlToCheck = urls[i];
+ LOG.info("Going to try url :" + urlToCheck);
+ for (int time = 0; time < MAX_RETRY_TIME; time++) {
+ if (checkUrl(builder.build(urlToCheck, Constants.JobState.RUNNING.name()))) {
+ selectedUrl = urls[i];
+ LOG.info("Successfully switch to new url : " + selectedUrl);
+ return;
+ }
+ LOG.info("try url " + urlToCheck + "fail for " + (time + 1) + " times, sleep 5 seconds before try again. ");
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException ex) {
+ LOG.warn("{}", ex);
+ }
+ }
+ }
+ throw new IOException("No alive url found: " + StringUtils.join(";", Arrays.asList(this.urls)));
+ } finally {
+ reselectInProgress = false;
+ }
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/AppInfo.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/AppInfo.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/AppInfo.java
new file mode 100644
index 0000000..f769217
--- /dev/null
+++ b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/AppInfo.java
@@ -0,0 +1,210 @@
+/*
+ * 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.eagle.jpm.util.resourcefetch.model;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
+import java.io.Serializable;
+
+@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class AppInfo implements Serializable {
+ private static final long serialVersionUID = 1L;
+
+ private String id;
+ private String user;
+ private String name;
+ private String queue;
+ private String state;
+ private String finalStatus;
+ private double progress;
+ private String trackingUI;
+ private String trackingUrl;
+ private String diagnostics;
+ private String clusterId;
+ private String applicationType;
+ private long startedTime;
+ private long finishedTime;
+ private long elapsedTime;
+ private String amContainerLogs;
+ private String amHostHttpAddress;
+ private long allocatedMB;
+ private int allocatedVCores;
+ private int runningContainers;
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getUser() {
+ return user;
+ }
+
+ public void setUser(String user) {
+ this.user = user;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getQueue() {
+ return queue;
+ }
+
+ public void setQueue(String queue) {
+ this.queue = queue;
+ }
+
+ public String getState() {
+ return state;
+ }
+
+ public void setState(String state) {
+ this.state = state;
+ }
+
+ public String getFinalStatus() {
+ return finalStatus;
+ }
+
+ public void setFinalStatus(String finalStatus) {
+ this.finalStatus = finalStatus;
+ }
+
+ public double getProgress() {
+ return progress;
+ }
+
+ public void setProgress(double progress) {
+ this.progress = progress;
+ }
+
+ public String getTrackingUI() {
+ return trackingUI;
+ }
+
+ public void setTrackingUI(String trackingUI) {
+ this.trackingUI = trackingUI;
+ }
+
+ public String getTrackingUrl() {
+ return trackingUrl;
+ }
+
+ public void setTrackingUrl(String trackingUrl) {
+ this.trackingUrl = trackingUrl;
+ }
+
+ public String getDiagnostics() {
+ return diagnostics;
+ }
+
+ public void setDiagnostics(String diagnostics) {
+ this.diagnostics = diagnostics;
+ }
+
+ public String getClusterId() {
+ return clusterId;
+ }
+
+ public void setClusterId(String clusterId) {
+ this.clusterId = clusterId;
+ }
+
+ public String getApplicationType() {
+ return applicationType;
+ }
+
+ public void setApplicationType(String applicationType) {
+ this.applicationType = applicationType;
+ }
+
+ public long getStartedTime() {
+ return startedTime;
+ }
+
+ public void setStartedTime(long startedTime) {
+ this.startedTime = startedTime;
+ }
+
+ public long getFinishedTime() {
+ return finishedTime;
+ }
+
+ public void setFinishedTime(long finishedTime) {
+ this.finishedTime = finishedTime;
+ }
+
+ public long getElapsedTime() {
+ return elapsedTime;
+ }
+
+ public void setElapsedTime(long elapsedTime) {
+ this.elapsedTime = elapsedTime;
+ }
+
+ public String getAmContainerLogs() {
+ return amContainerLogs;
+ }
+
+ public void setAmContainerLogs(String amContainerLogs) {
+ this.amContainerLogs = amContainerLogs;
+ }
+
+ public String getAmHostHttpAddress() {
+ return amHostHttpAddress;
+ }
+
+ public void setAmHostHttpAddress(String amHostHttpAddress) {
+ this.amHostHttpAddress = amHostHttpAddress;
+ }
+
+ public long getAllocatedMB() {
+ return allocatedMB;
+ }
+
+ public void setAllocatedMB(long allocatedMB) {
+ this.allocatedMB = allocatedMB;
+ }
+
+ public int getAllocatedVCores() {
+ return allocatedVCores;
+ }
+
+ public void setAllocatedVCores(int allocatedVCores) {
+ this.allocatedVCores = allocatedVCores;
+ }
+
+ public int getRunningContainers() {
+ return runningContainers;
+ }
+
+ public void setRunningContainers(int runningContainers) {
+ this.runningContainers = runningContainers;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/Applications.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/Applications.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/Applications.java
new file mode 100644
index 0000000..22ee2b9
--- /dev/null
+++ b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/Applications.java
@@ -0,0 +1,38 @@
+/*
+ * 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.eagle.jpm.util.resourcefetch.model;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
+import java.util.List;
+
+@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class Applications {
+
+ private List<AppInfo> app;
+
+ public List<AppInfo> getApp() {
+ return app;
+ }
+
+ public void setApp(List<AppInfo> app) {
+ this.app = app;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/AppsWrapper.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/AppsWrapper.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/AppsWrapper.java
new file mode 100644
index 0000000..63e37eb
--- /dev/null
+++ b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/AppsWrapper.java
@@ -0,0 +1,37 @@
+/*
+ * 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.eagle.jpm.util.resourcefetch.model;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
+@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class AppsWrapper {
+ private static final long serialVersionUID = 1L;
+
+ private Applications apps;
+
+ public Applications getApps() {
+ return apps;
+ }
+
+ public void setApps(Applications apps) {
+ this.apps = apps;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/ClusterInfo.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/ClusterInfo.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/ClusterInfo.java
new file mode 100644
index 0000000..6e16b7f
--- /dev/null
+++ b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/ClusterInfo.java
@@ -0,0 +1,119 @@
+/*
+ * 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.eagle.jpm.util.resourcefetch.model;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
+import java.io.Serializable;
+
+@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class ClusterInfo implements Serializable {
+ private static final long serialVersionUID = 1L;
+
+ private long id;
+ private long startedOn;
+ private String state;
+ private String haState;
+ private String resourceManagerVersion;
+ private String resourceManagerBuildVersion;
+ private String resourceManagerVersionBuiltOn;
+ private String hadoopVersion;
+ private String hadoopBuildVersion;
+ private String hadoopVersionBuiltOn;
+
+ public long getId() {
+ return id;
+ }
+
+ public void setId(long id) {
+ this.id = id;
+ }
+
+ public long getStartedOn() {
+ return startedOn;
+ }
+
+ public void setStartedOn(long startedOn) {
+ this.startedOn = startedOn;
+ }
+
+ public String getState() {
+ return state;
+ }
+
+ public void setState(String state) {
+ this.state = state;
+ }
+
+ public String getHaState() {
+ return haState;
+ }
+
+ public void setHaState(String haState) {
+ this.haState = haState;
+ }
+
+ public String getResourceManagerVersion() {
+ return resourceManagerVersion;
+ }
+
+ public void setResourceManagerVersion(String resourceManagerVersion) {
+ this.resourceManagerVersion = resourceManagerVersion;
+ }
+
+ public String getResourceManagerBuildVersion() {
+ return resourceManagerBuildVersion;
+ }
+
+ public void setResourceManagerBuildVersion(String resourceManagerBuildVersion) {
+ this.resourceManagerBuildVersion = resourceManagerBuildVersion;
+ }
+
+ public String getResourceManagerVersionBuiltOn() {
+ return resourceManagerVersionBuiltOn;
+ }
+
+ public void setResourceManagerVersionBuiltOn(String resourceManagerVersionBuiltOn) {
+ this.resourceManagerVersionBuiltOn = resourceManagerVersionBuiltOn;
+ }
+
+ public String getHadoopVersion() {
+ return hadoopVersion;
+ }
+
+ public void setHadoopVersion(String hadoopVersion) {
+ this.hadoopVersion = hadoopVersion;
+ }
+
+ public String getHadoopBuildVersion() {
+ return hadoopBuildVersion;
+ }
+
+ public void setHadoopBuildVersion(String hadoopBuildVersion) {
+ this.hadoopBuildVersion = hadoopBuildVersion;
+ }
+
+ public String getHadoopVersionBuiltOn() {
+ return hadoopVersionBuiltOn;
+ }
+
+ public void setHadoopVersionBuiltOn(String hadoopVersionBuiltOn) {
+ this.hadoopVersionBuiltOn = hadoopVersionBuiltOn;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/ClusterInfoWrapper.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/ClusterInfoWrapper.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/ClusterInfoWrapper.java
new file mode 100644
index 0000000..4359e66
--- /dev/null
+++ b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/ClusterInfoWrapper.java
@@ -0,0 +1,35 @@
+/*
+ * 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.eagle.jpm.util.resourcefetch.model;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
+@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class ClusterInfoWrapper {
+ private ClusterInfo clusterInfo;
+
+ public ClusterInfo getClusterInfo() {
+ return clusterInfo;
+ }
+
+ public void setClusterInfo(ClusterInfo clusterInfo) {
+ this.clusterInfo = clusterInfo;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/JobCounterGroup.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/JobCounterGroup.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/JobCounterGroup.java
new file mode 100644
index 0000000..189767b
--- /dev/null
+++ b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/JobCounterGroup.java
@@ -0,0 +1,46 @@
+/*
+ * 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.eagle.jpm.util.resourcefetch.model;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
+import java.util.List;
+
+@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class JobCounterGroup {
+ private String counterGroupName;
+ private List<JobCounterItem> counter;
+
+ public String getCounterGroupName() {
+ return counterGroupName;
+ }
+
+ public void setCounterGroupName(String counterGroupName) {
+ this.counterGroupName = counterGroupName;
+ }
+
+ public List<JobCounterItem> getCounter() {
+ return counter;
+ }
+
+ public void setCounter(List<JobCounterItem> counter) {
+ this.counter = counter;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/JobCounterItem.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/JobCounterItem.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/JobCounterItem.java
new file mode 100644
index 0000000..001c5ff
--- /dev/null
+++ b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/JobCounterItem.java
@@ -0,0 +1,62 @@
+/*
+ * 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.eagle.jpm.util.resourcefetch.model;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
+@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class JobCounterItem {
+ private String name;
+ private long totalCounterValue;
+ private long mapCounterValue;
+ private long reduceCounterValue;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public long getTotalCounterValue() {
+ return totalCounterValue;
+ }
+
+ public void setTotalCounterValue(long totalCounterValue) {
+ this.totalCounterValue = totalCounterValue;
+ }
+
+ public long getMapCounterValue() {
+ return mapCounterValue;
+ }
+
+ public void setMapCounterValue(long mapCounterValue) {
+ this.mapCounterValue = mapCounterValue;
+ }
+
+ public long getReduceCounterValue() {
+ return reduceCounterValue;
+ }
+
+ public void setReduceCounterValue(long reduceCounterValue) {
+ this.reduceCounterValue = reduceCounterValue;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/JobCounters.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/JobCounters.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/JobCounters.java
new file mode 100644
index 0000000..cc0709f
--- /dev/null
+++ b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/JobCounters.java
@@ -0,0 +1,46 @@
+/*
+ * 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.eagle.jpm.util.resourcefetch.model;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
+import java.util.List;
+
+@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class JobCounters {
+ private String id;
+ private List<JobCounterGroup> counterGroup;
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public List<JobCounterGroup> getCounterGroup() {
+ return counterGroup;
+ }
+
+ public void setCounterGroup(List<JobCounterGroup> counterGroup) {
+ this.counterGroup = counterGroup;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/JobCountersWrapper.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/JobCountersWrapper.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/JobCountersWrapper.java
new file mode 100644
index 0000000..f6bb29c
--- /dev/null
+++ b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/JobCountersWrapper.java
@@ -0,0 +1,35 @@
+/*
+ * 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.eagle.jpm.util.resourcefetch.model;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
+@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class JobCountersWrapper {
+ public JobCounters getJobCounters() {
+ return jobCounters;
+ }
+
+ public void setJobCounters(JobCounters jobCounters) {
+ this.jobCounters = jobCounters;
+ }
+
+ private JobCounters jobCounters;
+}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/MRJob.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/MRJob.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/MRJob.java
new file mode 100644
index 0000000..f12a5d7
--- /dev/null
+++ b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/MRJob.java
@@ -0,0 +1,289 @@
+/*
+ *
+ * * 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.eagle.jpm.util.resourcefetch.model;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
+@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class MRJob {
+ private long startTime;
+ private long finishTime;
+ private long elapsedTime;
+ private String id;
+ private String name;
+ private String user;
+ private String state;
+ private int mapsTotal;
+ private int mapsCompleted;
+ private int reducesTotal;
+ private int reducesCompleted;
+ private double mapProgress;
+ private double reduceProgress;
+ private int mapsPending;
+ private int mapsRunning;
+ private int reducesPending;
+ private int reducesRunning;
+ private boolean uberized;
+ private String diagnostics;
+ private int newReduceAttempts;
+ private int runningReduceAttempts;
+ private int failedReduceAttempts;
+ private int killedReduceAttempts;
+ private int successfulReduceAttempts;
+ private int newMapAttempts;
+ private int runningMapAttempts;
+ private int failedMapAttempts;
+ private int killedMapAttempts;
+ private int successfulMapAttempts;
+
+ public long getStartTime() {
+ return startTime;
+ }
+
+ public void setStartTime(long startTime) {
+ this.startTime = startTime;
+ }
+
+ public long getFinishTime() {
+ return finishTime;
+ }
+
+ public void setFinishTime(long finishTime) {
+ this.finishTime = finishTime;
+ }
+
+ public long getElapsedTime() {
+ return elapsedTime;
+ }
+
+ public void setElapsedTime(long elapsedTime) {
+ this.elapsedTime = elapsedTime;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getUser() {
+ return user;
+ }
+
+ public void setUser(String user) {
+ this.user = user;
+ }
+
+ public String getState() {
+ return state;
+ }
+
+ public void setState(String state) {
+ this.state = state;
+ }
+
+ public int getMapsTotal() {
+ return mapsTotal;
+ }
+
+ public void setMapsTotal(int mapsTotal) {
+ this.mapsTotal = mapsTotal;
+ }
+
+ public int getMapsCompleted() {
+ return mapsCompleted;
+ }
+
+ public void setMapsCompleted(int mapsCompleted) {
+ this.mapsCompleted = mapsCompleted;
+ }
+
+ public int getReducesTotal() {
+ return reducesTotal;
+ }
+
+ public void setReducesTotal(int reducesTotal) {
+ this.reducesTotal = reducesTotal;
+ }
+
+ public int getReducesCompleted() {
+ return reducesCompleted;
+ }
+
+ public void setReducesCompleted(int reducesCompleted) {
+ this.reducesCompleted = reducesCompleted;
+ }
+
+ public double getMapProgress() {
+ return mapProgress;
+ }
+
+ public void setMapProgress(double mapProgress) {
+ this.mapProgress = mapProgress;
+ }
+
+ public double getReduceProgress() {
+ return reduceProgress;
+ }
+
+ public void setReduceProgress(double reduceProgress) {
+ this.reduceProgress = reduceProgress;
+ }
+
+ public int getMapsPending() {
+ return mapsPending;
+ }
+
+ public void setMapsPending(int mapsPending) {
+ this.mapsPending = mapsPending;
+ }
+
+ public int getMapsRunning() {
+ return mapsRunning;
+ }
+
+ public void setMapsRunning(int mapsRunning) {
+ this.mapsRunning = mapsRunning;
+ }
+
+ public int getReducesPending() {
+ return reducesPending;
+ }
+
+ public void setReducesPending(int reducesPending) {
+ this.reducesPending = reducesPending;
+ }
+
+ public int getReducesRunning() {
+ return reducesRunning;
+ }
+
+ public void setReducesRunning(int reducesRunning) {
+ this.reducesRunning = reducesRunning;
+ }
+
+ public boolean isUberized() {
+ return uberized;
+ }
+
+ public void setUberized(boolean uberized) {
+ this.uberized = uberized;
+ }
+
+ public String getDiagnostics() {
+ return diagnostics;
+ }
+
+ public void setDiagnostics(String diagnostics) {
+ this.diagnostics = diagnostics;
+ }
+
+ public int getNewReduceAttempts() {
+ return newReduceAttempts;
+ }
+
+ public void setNewReduceAttempts(int newReduceAttempts) {
+ this.newReduceAttempts = newReduceAttempts;
+ }
+
+ public int getRunningReduceAttempts() {
+ return runningReduceAttempts;
+ }
+
+ public void setRunningReduceAttempts(int runningReduceAttempts) {
+ this.runningReduceAttempts = runningReduceAttempts;
+ }
+
+ public int getFailedReduceAttempts() {
+ return failedReduceAttempts;
+ }
+
+ public void setFailedReduceAttempts(int failedReduceAttempts) {
+ this.failedReduceAttempts = failedReduceAttempts;
+ }
+
+ public int getKilledReduceAttempts() {
+ return killedReduceAttempts;
+ }
+
+ public void setKilledReduceAttempts(int killedReduceAttempts) {
+ this.killedReduceAttempts = killedReduceAttempts;
+ }
+
+ public int getSuccessfulReduceAttempts() {
+ return successfulReduceAttempts;
+ }
+
+ public void setSuccessfulReduceAttempts(int successfulReduceAttempts) {
+ this.successfulReduceAttempts = successfulReduceAttempts;
+ }
+
+ public int getNewMapAttempts() {
+ return newMapAttempts;
+ }
+
+ public void setNewMapAttempts(int newMapAttempts) {
+ this.newMapAttempts = newMapAttempts;
+ }
+
+ public int getRunningMapAttempts() {
+ return runningMapAttempts;
+ }
+
+ public void setRunningMapAttempts(int runningMapAttempts) {
+ this.runningMapAttempts = runningMapAttempts;
+ }
+
+ public int getFailedMapAttempts() {
+ return failedMapAttempts;
+ }
+
+ public void setFailedMapAttempts(int failedMapAttempts) {
+ this.failedMapAttempts = failedMapAttempts;
+ }
+
+ public int getKilledMapAttempts() {
+ return killedMapAttempts;
+ }
+
+ public void setKilledMapAttempts(int killedMapAttempts) {
+ this.killedMapAttempts = killedMapAttempts;
+ }
+
+ public int getSuccessfulMapAttempts() {
+ return successfulMapAttempts;
+ }
+
+ public void setSuccessfulMapAttempts(int successfulMapAttempts) {
+ this.successfulMapAttempts = successfulMapAttempts;
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/MRJobsWrapper.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/MRJobsWrapper.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/MRJobsWrapper.java
new file mode 100644
index 0000000..acd316f
--- /dev/null
+++ b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/MRJobsWrapper.java
@@ -0,0 +1,37 @@
+/*
+ *
+ * * 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.eagle.jpm.util.resourcefetch.model;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
+@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class MRJobsWrapper {
+ public MrJobs getJobs() {
+ return jobs;
+ }
+
+ public void setJobs(MrJobs jobs) {
+ this.jobs = jobs;
+ }
+
+ private MrJobs jobs;
+}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/MRTask.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/MRTask.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/MRTask.java
new file mode 100644
index 0000000..4a549de
--- /dev/null
+++ b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/MRTask.java
@@ -0,0 +1,109 @@
+/*
+ *
+ * * 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.eagle.jpm.util.resourcefetch.model;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
+@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class MRTask {
+ private long startTime;
+ private long finishTime;
+ private long elapsedTime;
+ private double progress;
+ private String id;
+ private String state;
+ private String type;
+ private String successfulAttempt;
+ private String status;
+
+ public long getStartTime() {
+ return startTime;
+ }
+
+ public void setStartTime(long startTime) {
+ this.startTime = startTime;
+ }
+
+ public long getFinishTime() {
+ return finishTime;
+ }
+
+ public void setFinishTime(long finishTime) {
+ this.finishTime = finishTime;
+ }
+
+ public long getElapsedTime() {
+ return elapsedTime;
+ }
+
+ public void setElapsedTime(long elapsedTime) {
+ this.elapsedTime = elapsedTime;
+ }
+
+ public double getProgress() {
+ return progress;
+ }
+
+ public void setProgress(double progress) {
+ this.progress = progress;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getState() {
+ return state;
+ }
+
+ public void setState(String state) {
+ this.state = state;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getSuccessfulAttempt() {
+ return successfulAttempt;
+ }
+
+ public void setSuccessfulAttempt(String successfulAttempt) {
+ this.successfulAttempt = successfulAttempt;
+ }
+
+ public String getStatus() {
+ return status;
+ }
+
+ public void setStatus(String status) {
+ this.status = status;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/MRTaskAttempt.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/MRTaskAttempt.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/MRTaskAttempt.java
new file mode 100644
index 0000000..218d021
--- /dev/null
+++ b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/MRTaskAttempt.java
@@ -0,0 +1,136 @@
+/*
+ *
+ * * 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.eagle.jpm.util.resourcefetch.model;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
+@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class MRTaskAttempt {
+ private long startTime;
+ private long finishTime;
+ private long elapsedTime;
+ private double progress;
+ private String id;
+ private String rack;
+ private String state;
+ private String status;
+ private String nodeHttpAddress;
+ private String diagnostics;
+ private String type;
+ private String assignedContainerId;
+
+ public long getStartTime() {
+ return startTime;
+ }
+
+ public void setStartTime(long startTime) {
+ this.startTime = startTime;
+ }
+
+ public long getFinishTime() {
+ return finishTime;
+ }
+
+ public void setFinishTime(long finishTime) {
+ this.finishTime = finishTime;
+ }
+
+ public long getElapsedTime() {
+ return elapsedTime;
+ }
+
+ public void setElapsedTime(long elapsedTime) {
+ this.elapsedTime = elapsedTime;
+ }
+
+ public double getProgress() {
+ return progress;
+ }
+
+ public void setProgress(double progress) {
+ this.progress = progress;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getRack() {
+ return rack;
+ }
+
+ public void setRack(String rack) {
+ this.rack = rack;
+ }
+
+ public String getState() {
+ return state;
+ }
+
+ public void setState(String state) {
+ this.state = state;
+ }
+
+ public String getStatus() {
+ return status;
+ }
+
+ public void setStatus(String status) {
+ this.status = status;
+ }
+
+ public String getNodeHttpAddress() {
+ return nodeHttpAddress;
+ }
+
+ public void setNodeHttpAddress(String nodeHttpAddress) {
+ this.nodeHttpAddress = nodeHttpAddress;
+ }
+
+ public String getDiagnostics() {
+ return diagnostics;
+ }
+
+ public void setDiagnostics(String diagnostics) {
+ this.diagnostics = diagnostics;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getAssignedContainerId() {
+ return assignedContainerId;
+ }
+
+ public void setAssignedContainerId(String assignedContainerId) {
+ this.assignedContainerId = assignedContainerId;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/MRTaskAttemptWrapper.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/MRTaskAttemptWrapper.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/MRTaskAttemptWrapper.java
new file mode 100644
index 0000000..005b73a
--- /dev/null
+++ b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/MRTaskAttemptWrapper.java
@@ -0,0 +1,37 @@
+/*
+ *
+ * * 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.eagle.jpm.util.resourcefetch.model;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
+@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class MRTaskAttemptWrapper {
+ public MRTaskAttempts getTaskAttempts() {
+ return taskAttempts;
+ }
+
+ public void setTaskAttempts(MRTaskAttempts taskAttempts) {
+ this.taskAttempts = taskAttempts;
+ }
+
+ private MRTaskAttempts taskAttempts;
+}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/MRTaskAttempts.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/MRTaskAttempts.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/MRTaskAttempts.java
new file mode 100644
index 0000000..03af0d7
--- /dev/null
+++ b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/MRTaskAttempts.java
@@ -0,0 +1,39 @@
+/*
+ *
+ * * 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.eagle.jpm.util.resourcefetch.model;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
+import java.util.List;
+
+@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class MRTaskAttempts {
+ public List<MRTaskAttempt> getTaskAttempt() {
+ return taskAttempt;
+ }
+
+ public void setTaskAttempt(List<MRTaskAttempt> taskAttempt) {
+ this.taskAttempt = taskAttempt;
+ }
+
+ private List<MRTaskAttempt> taskAttempt;
+}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/MRTasks.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/MRTasks.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/MRTasks.java
new file mode 100644
index 0000000..b23b23d
--- /dev/null
+++ b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/MRTasks.java
@@ -0,0 +1,40 @@
+/*
+ *
+ * * 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.eagle.jpm.util.resourcefetch.model;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
+import java.util.List;
+
+@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class MRTasks {
+ public List<MRTask> getTask() {
+ return task;
+ }
+
+ public void setTask(List<MRTask> task) {
+ this.task = task;
+ }
+
+ private List<MRTask> task;
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/MRTasksWrapper.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/MRTasksWrapper.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/MRTasksWrapper.java
new file mode 100644
index 0000000..f92234a
--- /dev/null
+++ b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/MRTasksWrapper.java
@@ -0,0 +1,37 @@
+/*
+ *
+ * * 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.eagle.jpm.util.resourcefetch.model;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
+@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class MRTasksWrapper {
+ public MRTasks getTasks() {
+ return tasks;
+ }
+
+ public void setTasks(MRTasks tasks) {
+ this.tasks = tasks;
+ }
+
+ private MRTasks tasks;
+}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/MrJobs.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/MrJobs.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/MrJobs.java
new file mode 100644
index 0000000..1d4871c
--- /dev/null
+++ b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/MrJobs.java
@@ -0,0 +1,39 @@
+/*
+ *
+ * * 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.eagle.jpm.util.resourcefetch.model;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
+import java.util.List;
+
+@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class MrJobs {
+ public List<MRJob> getJob() {
+ return job;
+ }
+
+ public void setJobs(List<MRJob> job) {
+ this.job = job;
+ }
+
+ private List<MRJob> job;
+}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/SparkApplication.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/SparkApplication.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/SparkApplication.java
new file mode 100644
index 0000000..299934e
--- /dev/null
+++ b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/SparkApplication.java
@@ -0,0 +1,57 @@
+/*
+ *
+ * * 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.eagle.jpm.util.resourcefetch.model;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
+import java.util.List;
+
+@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class SparkApplication {
+ String id;
+ String name;
+ List<SparkApplicationAttempt> attempts;
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public List<SparkApplicationAttempt> getAttempts() {
+ return attempts;
+ }
+
+ public void setAttempts(List<SparkApplicationAttempt> attempts) {
+ this.attempts = attempts;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/SparkApplicationAttempt.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/SparkApplicationAttempt.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/SparkApplicationAttempt.java
new file mode 100644
index 0000000..b437cc2
--- /dev/null
+++ b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/SparkApplicationAttempt.java
@@ -0,0 +1,73 @@
+/*
+ *
+ * * 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.eagle.jpm.util.resourcefetch.model;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
+@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class SparkApplicationAttempt {
+ String attemptId;
+ String sparkUser;
+ String startTime;
+ String endTime;
+ boolean completed;
+
+ public String getAttemptId() {
+ return attemptId;
+ }
+
+ public void setAttemptId(String attemptId) {
+ this.attemptId = attemptId;
+ }
+
+ public String getSparkUser() {
+ return sparkUser;
+ }
+
+ public void setSparkUser(String sparkUser) {
+ this.sparkUser = sparkUser;
+ }
+
+ public String getStartTime() {
+ return startTime;
+ }
+
+ public void setStartTime(String startTime) {
+ this.startTime = startTime;
+ }
+
+ public String getEndTime() {
+ return endTime;
+ }
+
+ public void setEndTime(String endTime) {
+ this.endTime = endTime;
+ }
+
+ public boolean isCompleted() {
+ return completed;
+ }
+
+ public void setCompleted(boolean completed) {
+ this.completed = completed;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/SparkApplicationWrapper.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/SparkApplicationWrapper.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/SparkApplicationWrapper.java
new file mode 100644
index 0000000..0b04f31
--- /dev/null
+++ b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/SparkApplicationWrapper.java
@@ -0,0 +1,38 @@
+/*
+ *
+ * * 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.eagle.jpm.util.resourcefetch.model;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
+@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class SparkApplicationWrapper {
+
+ SparkApplication app;
+
+ public SparkApplication getApp() {
+ return app;
+ }
+
+ public void setApp(SparkApplication app) {
+ this.app = app;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/SparkExecutor.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/SparkExecutor.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/SparkExecutor.java
new file mode 100644
index 0000000..c2a2115
--- /dev/null
+++ b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/SparkExecutor.java
@@ -0,0 +1,155 @@
+/*
+ *
+ * * 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.eagle.jpm.util.resourcefetch.model;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
+@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class SparkExecutor {
+ private String id;
+ private String hostPort;
+ private int rddBlocks;
+ private long memoryUsed;
+ private long diskUsed;
+ private int activeTasks;
+ private int failedTasks;
+ private int completedTasks;
+ private int totalTasks;
+ private long totalDuration;
+ private long totalInputBytes;
+ private long totalShuffleRead;
+ private long totalShuffleWrite;
+ private long maxMemory;
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getHostPort() {
+ return hostPort;
+ }
+
+ public void setHostPort(String hostPort) {
+ this.hostPort = hostPort;
+ }
+
+ public int getRddBlocks() {
+ return rddBlocks;
+ }
+
+ public void setRddBlocks(int rddBlocks) {
+ this.rddBlocks = rddBlocks;
+ }
+
+ public long getMemoryUsed() {
+ return memoryUsed;
+ }
+
+ public void setMemoryUsed(long memoryUsed) {
+ this.memoryUsed = memoryUsed;
+ }
+
+ public long getDiskUsed() {
+ return diskUsed;
+ }
+
+ public void setDiskUsed(long diskUsed) {
+ this.diskUsed = diskUsed;
+ }
+
+ public int getActiveTasks() {
+ return activeTasks;
+ }
+
+ public void setActiveTasks(int activeTasks) {
+ this.activeTasks = activeTasks;
+ }
+
+ public int getFailedTasks() {
+ return failedTasks;
+ }
+
+ public void setFailedTasks(int failedTasks) {
+ this.failedTasks = failedTasks;
+ }
+
+ public int getCompletedTasks() {
+ return completedTasks;
+ }
+
+ public void setCompletedTasks(int completedTasks) {
+ this.completedTasks = completedTasks;
+ }
+
+ public int getTotalTasks() {
+ return totalTasks;
+ }
+
+ public void setTotalTasks(int totalTasks) {
+ this.totalTasks = totalTasks;
+ }
+
+ public long getTotalDuration() {
+ return totalDuration;
+ }
+
+ public void setTotalDuration(long totalDuration) {
+ this.totalDuration = totalDuration;
+ }
+
+ public long getTotalInputBytes() {
+ return totalInputBytes;
+ }
+
+ public void setTotalInputBytes(long totalInputBytes) {
+ this.totalInputBytes = totalInputBytes;
+ }
+
+ public long getTotalShuffleRead() {
+ return totalShuffleRead;
+ }
+
+ public void setTotalShuffleRead(long totalShuffleRead) {
+ this.totalShuffleRead = totalShuffleRead;
+ }
+
+ public long getTotalShuffleWrite() {
+ return totalShuffleWrite;
+ }
+
+ public void setTotalShuffleWrite(long totalShuffleWrite) {
+ this.totalShuffleWrite = totalShuffleWrite;
+ }
+
+ public long getMaxMemory() {
+ return maxMemory;
+ }
+
+ public void setMaxMemory(long maxMemory) {
+ this.maxMemory = maxMemory;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/b5fd782c/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/SparkJob.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/SparkJob.java b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/SparkJob.java
new file mode 100644
index 0000000..280cf67
--- /dev/null
+++ b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/resourcefetch/model/SparkJob.java
@@ -0,0 +1,165 @@
+/*
+ *
+ * * 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.eagle.jpm.util.resourcefetch.model;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
+import java.util.List;
+
+@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class SparkJob {
+ private int jobId;
+ private String name;
+ private String submissionTime;
+ private String completionTime;
+ private List<Integer> stageIds;
+ private String status;
+ private int numTasks;
+ private int numActiveTasks;
+ private int numCompletedTasks;
+ private int numSkippedTasks;
+ private int numFailedTasks;
+ private int numActiveStages;
+ private int numCompletedStages;
+ private int numSkippedStages;
+ private int numFailedStages;
+
+ public int getJobId() {
+ return jobId;
+ }
+
+ public void setJobId(int jobId) {
+ this.jobId = jobId;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getSubmissionTime() {
+ return submissionTime;
+ }
+
+ public void setSubmissionTime(String submissionTime) {
+ this.submissionTime = submissionTime;
+ }
+
+ public String getCompletionTime() {
+ return completionTime;
+ }
+
+ public void setCompletionTime(String completionTime) {
+ this.completionTime = completionTime;
+ }
+
+ public List<Integer> getStageIds() {
+ return stageIds;
+ }
+
+ public void setStageIds(List<Integer> stageIds) {
+ this.stageIds = stageIds;
+ }
+
+ public String getStatus() {
+ return status;
+ }
+
+ public void setStatus(String status) {
+ this.status = status;
+ }
+
+ public int getNumTasks() {
+ return numTasks;
+ }
+
+ public void setNumTasks(int numTasks) {
+ this.numTasks = numTasks;
+ }
+
+ public int getNumActiveTasks() {
+ return numActiveTasks;
+ }
+
+ public void setNumActiveTasks(int numActiveTasks) {
+ this.numActiveTasks = numActiveTasks;
+ }
+
+ public int getNumCompletedTasks() {
+ return numCompletedTasks;
+ }
+
+ public void setNumCompletedTasks(int numCompletedTasks) {
+ this.numCompletedTasks = numCompletedTasks;
+ }
+
+ public int getNumSkippedTasks() {
+ return numSkippedTasks;
+ }
+
+ public void setNumSkippedTasks(int numSkippedTasks) {
+ this.numSkippedTasks = numSkippedTasks;
+ }
+
+ public int getNumFailedTasks() {
+ return numFailedTasks;
+ }
+
+ public void setNumFailedTasks(int numFailedTasks) {
+ this.numFailedTasks = numFailedTasks;
+ }
+
+ public int getNumActiveStages() {
+ return numActiveStages;
+ }
+
+ public void setNumActiveStages(int numActiveStages) {
+ this.numActiveStages = numActiveStages;
+ }
+
+ public int getNumCompletedStages() {
+ return numCompletedStages;
+ }
+
+ public void setNumCompletedStages(int numCompletedStages) {
+ this.numCompletedStages = numCompletedStages;
+ }
+
+ public int getNumSkippedStages() {
+ return numSkippedStages;
+ }
+
+ public void setNumSkippedStages(int numSkippedStages) {
+ this.numSkippedStages = numSkippedStages;
+ }
+
+ public int getNumFailedStages() {
+ return numFailedStages;
+ }
+
+ public void setNumFailedStages(int numFailedStages) {
+ this.numFailedStages = numFailedStages;
+ }
+}