aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorKaren Feng <karenfeng.us@gmail.com>2013-07-10 15:44:28 -0700
committerKaren Feng <karenfeng.us@gmail.com>2013-07-10 15:44:28 -0700
commit74bd3fc6806a4185a95a19c107e1a4776582db44 (patch)
treebe131bb009e8d4e8d775060e33033fb302c5d612 /core
parent24196c91f0bd560c08399eed3cb1903248ca497a (diff)
downloadspark-74bd3fc6806a4185a95a19c107e1a4776582db44.tar.gz
spark-74bd3fc6806a4185a95a19c107e1a4776582db44.tar.bz2
spark-74bd3fc6806a4185a95a19c107e1a4776582db44.zip
Added byte range on log pages
Diffstat (limited to 'core')
-rw-r--r--core/src/main/scala/spark/deploy/worker/ui/WorkerWebUI.scala10
1 files changed, 7 insertions, 3 deletions
diff --git a/core/src/main/scala/spark/deploy/worker/ui/WorkerWebUI.scala b/core/src/main/scala/spark/deploy/worker/ui/WorkerWebUI.scala
index 490fe15fcf..cac281eef6 100644
--- a/core/src/main/scala/spark/deploy/worker/ui/WorkerWebUI.scala
+++ b/core/src/main/scala/spark/deploy/worker/ui/WorkerWebUI.scala
@@ -86,7 +86,10 @@ class WorkerWebUI(val worker: ActorRef, val workDir: File, requestedPort: Option
else if (offset > logLength) logLength
else offset
- val logText = <node>{Utils.offsetBytes(path, fixedOffset, fixedOffset+logPageLength)}</node>
+ val endOffset = math.min(fixedOffset+logPageLength, logLength)
+
+ val range = <h3>Bytes {fixedOffset.toString} - {(endOffset).toString} of {logLength}</h3>
+ val logText = <node>{Utils.offsetBytes(path, fixedOffset, endOffset)}</node>
val backButton =
if (fixedOffset > 0) {
@@ -101,9 +104,9 @@ class WorkerWebUI(val worker: ActorRef, val workDir: File, requestedPort: Option
}
val nextButton =
- if (fixedOffset+logPageLength < logLength) {
+ if (endOffset < logLength) {
<a href={"?appId=%s&executorId=%s&logType=%s&offset=%s&byteLength=%s".
- format(appId, executorId, logType, fixedOffset+logPageLength, logPageLength)}>
+ format(appId, executorId, logType, endOffset, logPageLength)}>
<button style="float:right">next</button>
</a>
}
@@ -114,6 +117,7 @@ class WorkerWebUI(val worker: ActorRef, val workDir: File, requestedPort: Option
val content =
<html>
<body>
+ {range}
<hr></hr>
{backButton}
{nextButton}