Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 7EB40200B7C for ; Thu, 25 Aug 2016 07:02:56 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 7A06B160AC2; Thu, 25 Aug 2016 05:02:56 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id D1C81160AC1 for ; Thu, 25 Aug 2016 07:02:54 +0200 (CEST) Received: (qmail 47995 invoked by uid 500); 25 Aug 2016 05:02:54 -0000 Mailing-List: contact commits-help@eagle.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@eagle.incubator.apache.org Delivered-To: mailing list commits@eagle.incubator.apache.org Received: (qmail 47986 invoked by uid 99); 25 Aug 2016 05:02:54 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Aug 2016 05:02:54 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 9455D180584 for ; Thu, 25 Aug 2016 05:02:53 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -4.646 X-Spam-Level: X-Spam-Status: No, score=-4.646 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-1.426] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id sHLbOctnqo1D for ; Thu, 25 Aug 2016 05:02:46 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id 8FE7B5F54E for ; Thu, 25 Aug 2016 05:02:44 +0000 (UTC) Received: (qmail 47868 invoked by uid 99); 25 Aug 2016 05:02:43 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Aug 2016 05:02:43 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id A119AE00DB; Thu, 25 Aug 2016 05:02:43 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: qingwzhao@apache.org To: commits@eagle.incubator.apache.org Date: Thu, 25 Aug 2016 05:02:43 -0000 Message-Id: <48801fac20264fdf856a857f728fa0d3@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/4] incubator-eagle git commit: [minor] Change resourceFetch to resourcefetch archived-at: Thu, 25 Aug 2016 05:02:56 -0000 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 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 getTasks() { + return tasks; + } + + public void setTasks(Map 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 getCounter() { + return counter; + } + + public void setCounter(List counter) { + this.counter = counter; + } + + private String counterGroupName; + private List 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 getTaskCounterGroup() { + return taskCounterGroup; + } + + public void setTaskCounterGroup(List taskCounterGroup) { + this.taskCounterGroup = taskCounterGroup; + } + + private String id; + private List 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); + } +}