aboutsummaryrefslogtreecommitdiff
path: root/scalastyle-config.xml
diff options
context:
space:
mode:
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 -->
<!-- ================================================================================ -->