You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bahir.apache.org by ck...@apache.org on 2017/01/19 22:51:35 UTC
bahir git commit: [MINOR] update ImportOrderChecker
Repository: bahir
Updated Branches:
refs/heads/master b7cb52bab -> 560a799cf
[MINOR] update ImportOrderChecker
Update Scalastyle configuration to group org.apache.bahir.* import statements below org.apache.spark.* imports
Closes #30
Project: http://git-wip-us.apache.org/repos/asf/bahir/repo
Commit: http://git-wip-us.apache.org/repos/asf/bahir/commit/560a799c
Tree: http://git-wip-us.apache.org/repos/asf/bahir/tree/560a799c
Diff: http://git-wip-us.apache.org/repos/asf/bahir/diff/560a799c
Branch: refs/heads/master
Commit: 560a799cf7900d960dc7381962c23b78dc46a183
Parents: b7cb52b
Author: Christian Kadner <ck...@us.ibm.com>
Authored: Mon Jan 9 14:46:17 2017 -0800
Committer: Christian Kadner <ck...@us.ibm.com>
Committed: Wed Jan 18 14:46:16 2017 -0800
----------------------------------------------------------------------
scalastyle-config.xml | 14 +++++++-------
.../bahir/sql/streaming/mqtt/MQTTStreamSource.scala | 3 ++-
.../bahir/sql/streaming/mqtt/MessageStore.scala | 3 ++-
.../sql/streaming/mqtt/LocalMessageStoreSuite.scala | 4 +++-
.../sql/streaming/mqtt/MQTTStreamSourceSuite.scala | 4 +++-
.../bahir/sql/streaming/mqtt/MQTTTestUtils.scala | 4 +++-
6 files changed, 20 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/bahir/blob/560a799c/scalastyle-config.xml
----------------------------------------------------------------------
diff --git a/scalastyle-config.xml b/scalastyle-config.xml
index c6aa3d9..0422503 100644
--- a/scalastyle-config.xml
+++ b/scalastyle-config.xml
@@ -212,13 +212,14 @@ This file is divided into 3 sections:
<check level="error" class="org.scalastyle.scalariform.ImportOrderChecker" enabled="true">
<parameters>
- <parameter name="groups">java,scala,3rdParty,spark</parameter>
+ <parameter name="groups">java,scala,3rdParty,spark,bahir</parameter>
<parameter name="group.java">javax?\..*</parameter>
<parameter name="group.scala">scala\..*</parameter>
- <parameter name="group.3rdParty">(?!org\.apache\.spark\.).*</parameter>
+ <parameter name="group.3rdParty">(?!org\.apache\.(spark|bahir)\.).*</parameter>
<parameter name="group.spark">org\.apache\.spark\..*</parameter>
+ <parameter name="group.bahir">org\.apache\.bahir\..*</parameter>
</parameters>
- <customMessage>Imports should be grouped and ordered: java,scala,3rdParty,spark</customMessage>
+ <customMessage>Imports should be grouped and ordered: java, scala, 3rd-party, spark, bahir</customMessage>
</check>
<check level="error" class="org.scalastyle.scalariform.DisallowSpaceBeforeTokenChecker" enabled="true">
@@ -245,6 +246,8 @@ This file is divided into 3 sections:
<customMessage>Omit braces in case clauses.</customMessage>
</check>
+ <check level="error" class="org.scalastyle.scalariform.EqualsHashCodeChecker" enabled="true"></check>
+
<!-- ================================================================================ -->
<!-- rules we'd like to enforce, but haven't cleaned up the codebase yet -->
<!-- ================================================================================ -->
@@ -262,9 +265,6 @@ This file is divided into 3 sections:
</parameters>
</check>
- <!-- Should turn this on, but we have a few places that need to be fixed first -->
- <check level="error" class="org.scalastyle.scalariform.EqualsHashCodeChecker" enabled="true"></check>
-
<!-- ================================================================================ -->
<!-- rules we don't want -->
<!-- ================================================================================ -->
@@ -274,7 +274,7 @@ This file is divided into 3 sections:
<customMessage>Illegal import of sun._ or java.awt._</customMessage>
</check>
- <!-- We want the opposite of this: NewLineAtEofChecker -->
+ <!-- We want the opposite of this: NewLineAtEofChecker is enabled above -->
<check level="error" class="org.scalastyle.file.NoNewLineAtEofChecker" enabled="false"></check>
<!-- This one complains about all kinds of random things. Disable. -->
http://git-wip-us.apache.org/repos/asf/bahir/blob/560a799c/sql-streaming-mqtt/src/main/scala/org/apache/bahir/sql/streaming/mqtt/MQTTStreamSource.scala
----------------------------------------------------------------------
diff --git a/sql-streaming-mqtt/src/main/scala/org/apache/bahir/sql/streaming/mqtt/MQTTStreamSource.scala b/sql-streaming-mqtt/src/main/scala/org/apache/bahir/sql/streaming/mqtt/MQTTStreamSource.scala
index 8857edb..1739ff3 100644
--- a/sql-streaming-mqtt/src/main/scala/org/apache/bahir/sql/streaming/mqtt/MQTTStreamSource.scala
+++ b/sql-streaming-mqtt/src/main/scala/org/apache/bahir/sql/streaming/mqtt/MQTTStreamSource.scala
@@ -27,7 +27,6 @@ import scala.collection.concurrent.TrieMap
import scala.collection.mutable.ArrayBuffer
import scala.util.{Failure, Success, Try}
-import org.apache.bahir.utils.Logging
import org.eclipse.paho.client.mqttv3._
import org.eclipse.paho.client.mqttv3.persist.{MemoryPersistence, MqttDefaultFilePersistence}
@@ -36,6 +35,8 @@ import org.apache.spark.sql.execution.streaming.{LongOffset, Offset, Source}
import org.apache.spark.sql.sources.{DataSourceRegister, StreamSourceProvider}
import org.apache.spark.sql.types.{StringType, StructField, StructType, TimestampType}
+import org.apache.bahir.utils.Logging
+
object MQTTStreamConstants {
http://git-wip-us.apache.org/repos/asf/bahir/blob/560a799c/sql-streaming-mqtt/src/main/scala/org/apache/bahir/sql/streaming/mqtt/MessageStore.scala
----------------------------------------------------------------------
diff --git a/sql-streaming-mqtt/src/main/scala/org/apache/bahir/sql/streaming/mqtt/MessageStore.scala b/sql-streaming-mqtt/src/main/scala/org/apache/bahir/sql/streaming/mqtt/MessageStore.scala
index e8e0f7d..84fd8c4 100644
--- a/sql-streaming-mqtt/src/main/scala/org/apache/bahir/sql/streaming/mqtt/MessageStore.scala
+++ b/sql-streaming-mqtt/src/main/scala/org/apache/bahir/sql/streaming/mqtt/MessageStore.scala
@@ -23,12 +23,13 @@ import java.util
import scala.reflect.ClassTag
-import org.apache.bahir.utils.Logging
import org.eclipse.paho.client.mqttv3.{MqttClientPersistence, MqttPersistable, MqttPersistenceException}
import org.apache.spark.SparkConf
import org.apache.spark.serializer.{JavaSerializer, Serializer, SerializerInstance}
+import org.apache.bahir.utils.Logging
+
/** A message store for MQTT stream source for SQL Streaming. */
trait MessageStore {
http://git-wip-us.apache.org/repos/asf/bahir/blob/560a799c/sql-streaming-mqtt/src/test/scala/org/apache/bahir/sql/streaming/mqtt/LocalMessageStoreSuite.scala
----------------------------------------------------------------------
diff --git a/sql-streaming-mqtt/src/test/scala/org/apache/bahir/sql/streaming/mqtt/LocalMessageStoreSuite.scala b/sql-streaming-mqtt/src/test/scala/org/apache/bahir/sql/streaming/mqtt/LocalMessageStoreSuite.scala
index 44da041..9c678cb 100644
--- a/sql-streaming-mqtt/src/test/scala/org/apache/bahir/sql/streaming/mqtt/LocalMessageStoreSuite.scala
+++ b/sql-streaming-mqtt/src/test/scala/org/apache/bahir/sql/streaming/mqtt/LocalMessageStoreSuite.scala
@@ -19,13 +19,15 @@ package org.apache.bahir.sql.streaming.mqtt
import java.io.File
-import org.apache.bahir.utils.BahirUtils
import org.eclipse.paho.client.mqttv3.persist.MqttDefaultFilePersistence
import org.scalatest.BeforeAndAfter
import org.apache.spark.{SparkConf, SparkFunSuite}
import org.apache.spark.serializer.JavaSerializer
+import org.apache.bahir.utils.BahirUtils
+
+
class LocalMessageStoreSuite extends SparkFunSuite with BeforeAndAfter {
private val testData = Seq(1, 2, 3, 4, 5, 6)
http://git-wip-us.apache.org/repos/asf/bahir/blob/560a799c/sql-streaming-mqtt/src/test/scala/org/apache/bahir/sql/streaming/mqtt/MQTTStreamSourceSuite.scala
----------------------------------------------------------------------
diff --git a/sql-streaming-mqtt/src/test/scala/org/apache/bahir/sql/streaming/mqtt/MQTTStreamSourceSuite.scala b/sql-streaming-mqtt/src/test/scala/org/apache/bahir/sql/streaming/mqtt/MQTTStreamSourceSuite.scala
index f9a4bed..38971a0 100644
--- a/sql-streaming-mqtt/src/test/scala/org/apache/bahir/sql/streaming/mqtt/MQTTStreamSourceSuite.scala
+++ b/sql-streaming-mqtt/src/test/scala/org/apache/bahir/sql/streaming/mqtt/MQTTStreamSourceSuite.scala
@@ -24,7 +24,6 @@ import scala.collection.JavaConverters._
import scala.collection.mutable
import scala.concurrent.Future
-import org.apache.bahir.utils.BahirUtils
import org.eclipse.paho.client.mqttv3.MqttException
import org.scalatest.BeforeAndAfter
@@ -32,6 +31,9 @@ import org.apache.spark.{SharedSparkContext, SparkFunSuite}
import org.apache.spark.sql.{DataFrame, SQLContext}
import org.apache.spark.sql.execution.streaming.LongOffset
+import org.apache.bahir.utils.BahirUtils
+
+
class MQTTStreamSourceSuite extends SparkFunSuite with SharedSparkContext with BeforeAndAfter {
protected var mqttTestUtils: MQTTTestUtils = _
http://git-wip-us.apache.org/repos/asf/bahir/blob/560a799c/sql-streaming-mqtt/src/test/scala/org/apache/bahir/sql/streaming/mqtt/MQTTTestUtils.scala
----------------------------------------------------------------------
diff --git a/sql-streaming-mqtt/src/test/scala/org/apache/bahir/sql/streaming/mqtt/MQTTTestUtils.scala b/sql-streaming-mqtt/src/test/scala/org/apache/bahir/sql/streaming/mqtt/MQTTTestUtils.scala
index bebeeef..9c7399f 100644
--- a/sql-streaming-mqtt/src/test/scala/org/apache/bahir/sql/streaming/mqtt/MQTTTestUtils.scala
+++ b/sql-streaming-mqtt/src/test/scala/org/apache/bahir/sql/streaming/mqtt/MQTTTestUtils.scala
@@ -21,10 +21,12 @@ import java.io.File
import java.net.{ServerSocket, URI}
import org.apache.activemq.broker.{BrokerService, TransportConnector}
-import org.apache.bahir.utils.Logging
import org.eclipse.paho.client.mqttv3._
import org.eclipse.paho.client.mqttv3.persist.MqttDefaultFilePersistence
+import org.apache.bahir.utils.Logging
+
+
class MQTTTestUtils(tempDir: File, port: Int = 0) extends Logging {
private val persistenceDir = tempDir.getAbsolutePath