aboutsummaryrefslogtreecommitdiff
path: root/scalastyle-config.xml
diff options
context:
space:
mode:
authorJosh Rosen <joshrosen@databricks.com>2015-09-12 16:23:55 -0700
committerJosh Rosen <joshrosen@databricks.com>2015-09-12 16:23:55 -0700
commitb3a7480ab0821ab38f710de96e3ac4a13f62dbca (patch)
tree2a286b61a1a7e22cc0f0306b0c073b0ae3ac9e89 /scalastyle-config.xml
parentf4a22808e03fa12bfe1bfc82cf713cfda7e063a9 (diff)
downloadspark-b3a7480ab0821ab38f710de96e3ac4a13f62dbca.tar.gz
spark-b3a7480ab0821ab38f710de96e3ac4a13f62dbca.tar.bz2
spark-b3a7480ab0821ab38f710de96e3ac4a13f62dbca.zip
[SPARK-10330] Add Scalastyle rule to require use of SparkHadoopUtil JobContext methods
This is a followup to #8499 which adds a Scalastyle rule to mandate the use of SparkHadoopUtil's JobContext accessor methods and fixes the existing violations. Author: Josh Rosen <joshrosen@databricks.com> Closes #8521 from JoshRosen/SPARK-10330-part2.
Diffstat (limited to 'scalastyle-config.xml')
-rw-r--r--scalastyle-config.xml8
1 files changed, 8 insertions, 0 deletions
diff --git a/scalastyle-config.xml b/scalastyle-config.xml
index 68fdb4141c..64a0c71bbe 100644
--- a/scalastyle-config.xml
+++ b/scalastyle-config.xml
@@ -168,6 +168,14 @@ This file is divided into 3 sections:
scala.collection.JavaConverters._ and use .asScala / .asJava methods</customMessage>
</check>
+ <!-- As of SPARK-10330 JobContext methods should not be called directly -->
+ <check customId="jobcontext" level="error" class="org.scalastyle.scalariform.TokenChecker" enabled="true">
+ <parameters><parameter name="regex">^getConfiguration$|^getTaskAttemptID$</parameter></parameters>
+ <customMessage>Instead of calling .getConfiguration() or .getTaskAttemptID() directly,
+ use SparkHadoopUtil's getConfigurationFromJobContext() and getTaskAttemptIDFromTaskAttemptContext() methods.
+ </customMessage>
+ </check>
+
<!-- ================================================================================ -->
<!-- rules we'd like to enforce, but haven't cleaned up the codebase yet -->
<!-- ================================================================================ -->