aboutsummaryrefslogtreecommitdiff
path: root/core/src/test/java
diff options
context:
space:
mode:
authorReynold Xin <rxin@databricks.com>2015-02-03 00:46:04 -0800
committerReynold Xin <rxin@databricks.com>2015-02-03 00:46:04 -0800
commitbebf4c42bef3e75d31ffce9bfdb331c16f34ddb1 (patch)
tree3c87c85407ff969743c6a2a5af8f1f741df046e3 /core/src/test/java
parent523a93523d0f9fc12de1ba2dc1acc360cdbc7027 (diff)
downloadspark-bebf4c42bef3e75d31ffce9bfdb331c16f34ddb1.tar.gz
spark-bebf4c42bef3e75d31ffce9bfdb331c16f34ddb1.tar.bz2
spark-bebf4c42bef3e75d31ffce9bfdb331c16f34ddb1.zip
[SPARK-5549] Define TaskContext interface in Scala.
So the interface documentation shows up in ScalaDoc. Author: Reynold Xin <rxin@databricks.com> Closes #4324 from rxin/TaskContext-scala and squashes the following commits: 2480a17 [Reynold Xin] comment 573756f [Reynold Xin] style fixes and javadoc fixes. 87dd537 [Reynold Xin] [SPARK-5549] Define TaskContext interface in Scala.
Diffstat (limited to 'core/src/test/java')
-rw-r--r--core/src/test/java/test/org/apache/spark/JavaTaskCompletionListenerImpl.java (renamed from core/src/test/java/org/apache/spark/util/JavaTaskCompletionListenerImpl.java)3
-rw-r--r--core/src/test/java/test/org/apache/spark/JavaTaskContextCompileCheck.java41
2 files changed, 43 insertions, 1 deletions
diff --git a/core/src/test/java/org/apache/spark/util/JavaTaskCompletionListenerImpl.java b/core/src/test/java/test/org/apache/spark/JavaTaskCompletionListenerImpl.java
index e9ec700e32..e38bc38949 100644
--- a/core/src/test/java/org/apache/spark/util/JavaTaskCompletionListenerImpl.java
+++ b/core/src/test/java/test/org/apache/spark/JavaTaskCompletionListenerImpl.java
@@ -15,9 +15,10 @@
* limitations under the License.
*/
-package org.apache.spark.util;
+package test.org.apache.spark;
import org.apache.spark.TaskContext;
+import org.apache.spark.util.TaskCompletionListener;
/**
diff --git a/core/src/test/java/test/org/apache/spark/JavaTaskContextCompileCheck.java b/core/src/test/java/test/org/apache/spark/JavaTaskContextCompileCheck.java
new file mode 100644
index 0000000000..4a918f725d
--- /dev/null
+++ b/core/src/test/java/test/org/apache/spark/JavaTaskContextCompileCheck.java
@@ -0,0 +1,41 @@
+/*
+ * 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 test.org.apache.spark;
+
+import org.apache.spark.TaskContext;
+
+/**
+ * Something to make sure that TaskContext can be used in Java.
+ */
+public class JavaTaskContextCompileCheck {
+
+ public static void test() {
+ TaskContext tc = TaskContext.get();
+
+ tc.isCompleted();
+ tc.isInterrupted();
+ tc.isRunningLocally();
+
+ tc.addTaskCompletionListener(new JavaTaskCompletionListenerImpl());
+
+ tc.attemptNumber();
+ tc.partitionId();
+ tc.stageId();
+ tc.taskAttemptId();
+ }
+}