This is an automated email from the ASF dual-hosted git repository.

srdo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/storm.git


The following commit(s) were added to refs/heads/master by this push:
     new 8f9fedf  STORM-3420: Fix checkstyle violations in storm-mqtt
     new 91c8cde  Merge pull request #3037 from krichter722/checkstyle-mqtt
8f9fedf is described below

commit 8f9fedf37ba09f0d0d75e6d0232da10a8767833f
Author: Karl-Philipp Richter <krich...@posteo.de>
AuthorDate: Mon Jun 24 00:33:15 2019 +0200

    STORM-3420: Fix checkstyle violations in storm-mqtt
---
 external/storm-mqtt/pom.xml                        |  2 +-
 .../org/apache/storm/mqtt/MqttTupleMapper.java     |  4 +--
 .../org/apache/storm/mqtt/common/MqttOptions.java  | 32 ++--------------------
 .../apache/storm/mqtt/common/MqttPublisher.java    |  2 +-
 .../org/apache/storm/mqtt/common/MqttUtils.java    |  2 +-
 .../org/apache/storm/mqtt/common/SslUtils.java     |  5 ++--
 .../org/apache/storm/mqtt/spout/MqttSpout.java     | 11 ++++----
 7 files changed, 15 insertions(+), 43 deletions(-)

diff --git a/external/storm-mqtt/pom.xml b/external/storm-mqtt/pom.xml
index 35a237a..ad9ffcf 100644
--- a/external/storm-mqtt/pom.xml
+++ b/external/storm-mqtt/pom.xml
@@ -138,7 +138,7 @@
                 <artifactId>maven-checkstyle-plugin</artifactId>
                 <!--Note - the version would be inherited-->
                 <configuration>
-                    <maxAllowedViolations>39</maxAllowedViolations>
+                    <maxAllowedViolations>0</maxAllowedViolations>
                 </configuration>
             </plugin>
             <plugin>
diff --git 
a/external/storm-mqtt/src/main/java/org/apache/storm/mqtt/MqttTupleMapper.java 
b/external/storm-mqtt/src/main/java/org/apache/storm/mqtt/MqttTupleMapper.java
index d3762b0..58473b7 100644
--- 
a/external/storm-mqtt/src/main/java/org/apache/storm/mqtt/MqttTupleMapper.java
+++ 
b/external/storm-mqtt/src/main/java/org/apache/storm/mqtt/MqttTupleMapper.java
@@ -12,8 +12,8 @@
 
 package org.apache.storm.mqtt;
 
-
 import java.io.Serializable;
+
 import org.apache.storm.tuple.ITuple;
 
 /**
@@ -22,7 +22,7 @@ import org.apache.storm.tuple.ITuple;
 public interface MqttTupleMapper extends Serializable {
 
     /**
-     * Converts a Tuple to a MqttMessage
+     * Converts a Tuple to a MqttMessage.
      * @param tuple the incoming tuple
      * @return the message to publish
      */
diff --git 
a/external/storm-mqtt/src/main/java/org/apache/storm/mqtt/common/MqttOptions.java
 
b/external/storm-mqtt/src/main/java/org/apache/storm/mqtt/common/MqttOptions.java
index 1e9c925..90c9222 100644
--- 
a/external/storm-mqtt/src/main/java/org/apache/storm/mqtt/common/MqttOptions.java
+++ 
b/external/storm-mqtt/src/main/java/org/apache/storm/mqtt/common/MqttOptions.java
@@ -16,7 +16,7 @@ import java.io.Serializable;
 import java.util.List;
 
 /**
- * MQTT Configuration Options
+ * MQTT Configuration Options.
  */
 public class MqttOptions implements Serializable {
     private String url = "tcp://localhost:1883";
@@ -44,10 +44,7 @@ public class MqttOptions implements Serializable {
     }
 
     /**
-     * Sets the url for connecting to the MQTT broker.
-     *
-     * Default: `tcp://localhost:1883'
-     * @param url
+     * Sets the url for connecting to the MQTT broker, e.g. {@code 
tcp://localhost:1883}.
      */
     public void setUrl(String url) {
         this.url = url;
@@ -59,8 +56,6 @@ public class MqttOptions implements Serializable {
 
     /**
      * A list of MQTT topics to subscribe to.
-     *
-     * @param topics
      */
     public void setTopics(List<String> topics) {
         this.topics = topics;
@@ -73,8 +68,6 @@ public class MqttOptions implements Serializable {
     /**
      * Set to false if you want the MQTT server to persist topic subscriptions 
and ack positions across client sessions.
      * Defaults to false.
-     *
-     * @param cleanConnection
      */
     public void setCleanConnection(boolean cleanConnection) {
         this.cleanConnection = cleanConnection;
@@ -87,8 +80,6 @@ public class MqttOptions implements Serializable {
     /**
      * If set the server will publish the client's Will message to the 
specified topics if the client has an unexpected
      * disconnection.
-     *
-     * @param willTopic
      */
     public void setWillTopic(String willTopic) {
         this.willTopic = willTopic;
@@ -100,8 +91,6 @@ public class MqttOptions implements Serializable {
 
     /**
      * The Will message to send. Defaults to a zero length message.
-     *
-     * @param willPayload
      */
     public void setWillPayload(String willPayload) {
         this.willPayload = willPayload;
@@ -113,8 +102,6 @@ public class MqttOptions implements Serializable {
 
     /**
      * How long to wait in ms before the first reconnect attempt. Defaults to 
10.
-     *
-     * @param reconnectDelay
      */
     public void setReconnectDelay(long reconnectDelay) {
         this.reconnectDelay = reconnectDelay;
@@ -126,8 +113,6 @@ public class MqttOptions implements Serializable {
 
     /**
      * The maximum amount of time in ms to wait between reconnect attempts. 
Defaults to 30,000.
-     *
-     * @param reconnectDelayMax
      */
     public void setReconnectDelayMax(long reconnectDelayMax) {
         this.reconnectDelayMax = reconnectDelayMax;
@@ -140,8 +125,6 @@ public class MqttOptions implements Serializable {
     /**
      * The Exponential backoff be used between reconnect attempts. Set to 1 to 
disable exponential backoff. Defaults to
      * 2.
-     *
-     * @param reconnectBackOffMultiplier
      */
     public void setReconnectBackOffMultiplier(double 
reconnectBackOffMultiplier) {
         this.reconnectBackOffMultiplier = reconnectBackOffMultiplier;
@@ -154,8 +137,6 @@ public class MqttOptions implements Serializable {
     /**
      * The maximum number of reconnect attempts before an error is reported 
back to the client after a server
      * connection had previously been established. Set to -1 to use unlimited 
attempts. Defaults to -1.
-     *
-     * @param reconnectAttemptsMax
      */
     public void setReconnectAttemptsMax(long reconnectAttemptsMax) {
         this.reconnectAttemptsMax = reconnectAttemptsMax;
@@ -168,8 +149,6 @@ public class MqttOptions implements Serializable {
     /**
      * The maximum number of reconnect attempts before an error is reported 
back to the client on the first attempt by
      * the client to connect to a server. Set to -1 to use unlimited attempts. 
Defaults to -1.
-     *
-     * @param connectAttemptsMax
      */
     public void setConnectAttemptsMax(long connectAttemptsMax) {
         this.connectAttemptsMax = connectAttemptsMax;
@@ -181,8 +160,6 @@ public class MqttOptions implements Serializable {
 
     /**
      * The username for authenticated sessions.
-     *
-     * @param userName
      */
     public void setUserName(String userName) {
         this.userName = userName;
@@ -194,7 +171,6 @@ public class MqttOptions implements Serializable {
 
     /**
      * The password for authenticated sessions.
-     * @param password
      */
     public void setPassword(String password) {
         this.password = password;
@@ -206,7 +182,6 @@ public class MqttOptions implements Serializable {
 
     /**
      * Sets the quality of service to use for MQTT messages. Defaults to 1 (at 
least once).
-     * @param qos
      */
     public void setQos(int qos) {
         if (qos < 0 || qos > 2) {
@@ -221,8 +196,6 @@ public class MqttOptions implements Serializable {
 
     /**
      * Sets the quality of service to use for the MQTT Will message. Defaults 
to 1 (at least once).
-     *
-     * @param qos
      */
     public void setWillQos(int qos) {
         if (qos < 0 || qos > 2) {
@@ -237,7 +210,6 @@ public class MqttOptions implements Serializable {
 
     /**
      * Set to true if you want the Will message to be published with the 
retain option.
-     * @param retain
      */
     public void setWillRetain(boolean retain) {
         this.willRetain = retain;
diff --git 
a/external/storm-mqtt/src/main/java/org/apache/storm/mqtt/common/MqttPublisher.java
 
b/external/storm-mqtt/src/main/java/org/apache/storm/mqtt/common/MqttPublisher.java
index 5ea1da8..1f70b93 100644
--- 
a/external/storm-mqtt/src/main/java/org/apache/storm/mqtt/common/MqttPublisher.java
+++ 
b/external/storm-mqtt/src/main/java/org/apache/storm/mqtt/common/MqttPublisher.java
@@ -12,9 +12,9 @@
 
 package org.apache.storm.mqtt.common;
 
-
 import org.apache.storm.mqtt.MqttMessage;
 import org.apache.storm.mqtt.ssl.KeyStoreLoader;
+
 import org.fusesource.mqtt.client.BlockingConnection;
 import org.fusesource.mqtt.client.MQTT;
 import org.fusesource.mqtt.client.QoS;
diff --git 
a/external/storm-mqtt/src/main/java/org/apache/storm/mqtt/common/MqttUtils.java 
b/external/storm-mqtt/src/main/java/org/apache/storm/mqtt/common/MqttUtils.java
index 4995fd0..029b4c6 100644
--- 
a/external/storm-mqtt/src/main/java/org/apache/storm/mqtt/common/MqttUtils.java
+++ 
b/external/storm-mqtt/src/main/java/org/apache/storm/mqtt/common/MqttUtils.java
@@ -12,8 +12,8 @@
 
 package org.apache.storm.mqtt.common;
 
-
 import java.net.URI;
+
 import org.apache.storm.mqtt.MqttLogger;
 import org.apache.storm.mqtt.ssl.KeyStoreLoader;
 import org.fusesource.mqtt.client.MQTT;
diff --git 
a/external/storm-mqtt/src/main/java/org/apache/storm/mqtt/common/SslUtils.java 
b/external/storm-mqtt/src/main/java/org/apache/storm/mqtt/common/SslUtils.java
index 6ea3d0c..83f311f 100644
--- 
a/external/storm-mqtt/src/main/java/org/apache/storm/mqtt/common/SslUtils.java
+++ 
b/external/storm-mqtt/src/main/java/org/apache/storm/mqtt/common/SslUtils.java
@@ -12,7 +12,6 @@
 
 package org.apache.storm.mqtt.common;
 
-
 import java.net.URI;
 import java.security.KeyStore;
 import javax.net.ssl.KeyManagerFactory;
@@ -31,8 +30,8 @@ public class SslUtils {
             throw new IllegalArgumentException("Unrecognized URI scheme: " + 
scheme);
         }
         if (!scheme.equalsIgnoreCase("tcp") && loader == null) {
-            throw new IllegalStateException("A TLS/SSL MQTT URL was specified, 
but no KeyStoreLoader configured. " +
-                                            "A KeyStoreLoader implementation 
is required when using TLS/SSL.");
+            throw new IllegalStateException("A TLS/SSL MQTT URL was specified, 
but no KeyStoreLoader configured. "
+                    + "A KeyStoreLoader implementation is required when using 
TLS/SSL.");
         }
     }
 
diff --git 
a/external/storm-mqtt/src/main/java/org/apache/storm/mqtt/spout/MqttSpout.java 
b/external/storm-mqtt/src/main/java/org/apache/storm/mqtt/spout/MqttSpout.java
index 1e8cf46..265a6f9 100644
--- 
a/external/storm-mqtt/src/main/java/org/apache/storm/mqtt/spout/MqttSpout.java
+++ 
b/external/storm-mqtt/src/main/java/org/apache/storm/mqtt/spout/MqttSpout.java
@@ -107,8 +107,9 @@ public class MqttSpout implements IRichSpout, Listener {
     }
 
     private void connectMqtt() throws Exception {
-        String clientId = this.topologyName + "-" + 
this.context.getThisComponentId() + "-" +
-                          this.context.getThisTaskId();
+        String clientId = this.topologyName + "-"
+                + this.context.getThisComponentId() + "-"
+                + this.context.getThisTaskId();
 
         MQTT client = MqttUtils.configureClient(this.options, clientId, 
this.keyStoreLoader);
         this.connection = client.callbackConnection();
@@ -171,7 +172,7 @@ public class MqttSpout implements IRichSpout, Listener {
      * has been fully processed. Typically, an implementation of this method 
will take that
      * message off the queue and prevent it from being replayed.
      *
-     * @param msgId
+     * @param msgId the id of the message to acknowledge
      */
     @Override
     public void ack(Object msgId) {
@@ -184,7 +185,7 @@ public class MqttSpout implements IRichSpout, Listener {
      * fully processed. Typically, an implementation of this method will put 
that
      * message back on the queue to be replayed at a later time.
      *
-     * @param msgId
+     * @param msgId the id of the failed message
      */
     @Override
     public void fail(Object msgId) {
@@ -256,7 +257,7 @@ public class MqttSpout implements IRichSpout, Listener {
     // ################# Subscribe Callback Implementation 
######################
     private class DisconnectCallback implements Callback<Void> {
         @Override
-        public void onSuccess(Void aVoid) {
+        public void onSuccess(Void theVoid) {
             LOG.info("MQTT Disconnect successful.");
         }
 

Reply via email to