You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by sr...@apache.org on 2019/07/06 11:01:33 UTC
[storm] branch master updated: STORM-3454: hbase-examples: fix all
checkstyle warnings
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 247d7f0 STORM-3454: hbase-examples: fix all checkstyle warnings
new f2a4d06 Merge pull request #3072 from krichter722/checkstyle-hbase-example
247d7f0 is described below
commit 247d7f0038de23c50c7f5b1dca851ac30e0adfab
Author: Karl-Philipp Richter <kr...@posteo.de>
AuthorDate: Thu Jul 4 21:28:07 2019 +0200
STORM-3454: hbase-examples: fix all checkstyle warnings
---
examples/storm-hbase-examples/pom.xml | 2 +-
.../java/org/apache/storm/hbase/topology/LookupWordCount.java | 10 +++++-----
.../org/apache/storm/hbase/topology/PersistentWordCount.java | 7 ++++---
.../java/org/apache/storm/hbase/topology/TotalWordCounter.java | 4 ++--
.../java/org/apache/storm/hbase/topology/WordCountClient.java | 2 +-
.../org/apache/storm/hbase/topology/WordCountValueMapper.java | 7 +++----
.../main/java/org/apache/storm/hbase/topology/WordCounter.java | 4 ++--
7 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/examples/storm-hbase-examples/pom.xml b/examples/storm-hbase-examples/pom.xml
index dd733dc..65b71fe 100644
--- a/examples/storm-hbase-examples/pom.xml
+++ b/examples/storm-hbase-examples/pom.xml
@@ -87,7 +87,7 @@
<artifactId>maven-checkstyle-plugin</artifactId>
<!--Note - the version would be inherited-->
<configuration>
- <maxAllowedViolations>16</maxAllowedViolations>
+ <maxAllowedViolations>0</maxAllowedViolations>
</configuration>
</plugin>
<plugin>
diff --git a/examples/storm-hbase-examples/src/main/java/org/apache/storm/hbase/topology/LookupWordCount.java b/examples/storm-hbase-examples/src/main/java/org/apache/storm/hbase/topology/LookupWordCount.java
index 1c365c4..7f3afb1 100644
--- a/examples/storm-hbase-examples/src/main/java/org/apache/storm/hbase/topology/LookupWordCount.java
+++ b/examples/storm-hbase-examples/src/main/java/org/apache/storm/hbase/topology/LookupWordCount.java
@@ -38,7 +38,6 @@ public class LookupWordCount {
config.put("hbase.conf", hbConf);
WordSpout spout = new WordSpout();
- TotalWordCounter totalBolt = new TotalWordCounter();
SimpleHBaseMapper mapper = new SimpleHBaseMapper().withRowKeyField("word");
HBaseProjectionCriteria projectionCriteria = new HBaseProjectionCriteria();
@@ -46,14 +45,15 @@ public class LookupWordCount {
WordCountValueMapper rowToTupleMapper = new WordCountValueMapper();
- HBaseLookupBolt hBaseLookupBolt = new HBaseLookupBolt("WordCount", mapper, rowToTupleMapper)
- .withConfigKey("hbase.conf")
- .withProjectionCriteria(projectionCriteria);
+ HBaseLookupBolt lookupBolt = new HBaseLookupBolt("WordCount", mapper, rowToTupleMapper)
+ .withConfigKey("hbase.conf")
+ .withProjectionCriteria(projectionCriteria);
//wordspout -> lookupbolt -> totalCountBolt
TopologyBuilder builder = new TopologyBuilder();
builder.setSpout(WORD_SPOUT, spout, 1);
- builder.setBolt(LOOKUP_BOLT, hBaseLookupBolt, 1).shuffleGrouping(WORD_SPOUT);
+ builder.setBolt(LOOKUP_BOLT, lookupBolt, 1).shuffleGrouping(WORD_SPOUT);
+ TotalWordCounter totalBolt = new TotalWordCounter();
builder.setBolt(TOTAL_COUNT_BOLT, totalBolt, 1).fieldsGrouping(LOOKUP_BOLT, new Fields("columnName"));
String topoName = "test";
if (args.length == 1) {
diff --git a/examples/storm-hbase-examples/src/main/java/org/apache/storm/hbase/topology/PersistentWordCount.java b/examples/storm-hbase-examples/src/main/java/org/apache/storm/hbase/topology/PersistentWordCount.java
index 015ce85..0c929a3 100644
--- a/examples/storm-hbase-examples/src/main/java/org/apache/storm/hbase/topology/PersistentWordCount.java
+++ b/examples/storm-hbase-examples/src/main/java/org/apache/storm/hbase/topology/PersistentWordCount.java
@@ -12,7 +12,6 @@
package org.apache.storm.hbase.topology;
-
import java.util.HashMap;
import java.util.Map;
import org.apache.storm.Config;
@@ -63,8 +62,10 @@ public class PersistentWordCount {
if (args.length == 2) {
topoName = args[0];
} else if (args.length == 4) {
- System.out.println("hdfs url: " + args[0] + ", keytab file: " + args[2] +
- ", principal name: " + args[3] + ", toplogy name: " + args[1]);
+ System.out.println("hdfs url: " + args[0]
+ + ", keytab file: " + args[2]
+ + ", principal name: " + args[3]
+ + ", toplogy name: " + args[1]);
hbConf.put(HBaseSecurityUtil.STORM_KEYTAB_FILE_KEY, args[2]);
hbConf.put(HBaseSecurityUtil.STORM_USER_NAME_KEY, args[3]);
config.setNumWorkers(3);
diff --git a/examples/storm-hbase-examples/src/main/java/org/apache/storm/hbase/topology/TotalWordCounter.java b/examples/storm-hbase-examples/src/main/java/org/apache/storm/hbase/topology/TotalWordCounter.java
index a1017df..4199319 100644
--- a/examples/storm-hbase-examples/src/main/java/org/apache/storm/hbase/topology/TotalWordCounter.java
+++ b/examples/storm-hbase-examples/src/main/java/org/apache/storm/hbase/topology/TotalWordCounter.java
@@ -12,6 +12,8 @@
package org.apache.storm.hbase.topology;
+import static org.apache.storm.utils.Utils.tuple;
+
import java.math.BigInteger;
import java.util.Map;
import java.util.Random;
@@ -24,8 +26,6 @@ import org.apache.storm.tuple.Tuple;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import static org.apache.storm.utils.Utils.tuple;
-
public class TotalWordCounter implements IBasicBolt {
private static final Logger LOG = LoggerFactory.getLogger(TotalWordCounter.class);
diff --git a/examples/storm-hbase-examples/src/main/java/org/apache/storm/hbase/topology/WordCountClient.java b/examples/storm-hbase-examples/src/main/java/org/apache/storm/hbase/topology/WordCountClient.java
index 33acfab..d8f6eb2 100644
--- a/examples/storm-hbase-examples/src/main/java/org/apache/storm/hbase/topology/WordCountClient.java
+++ b/examples/storm-hbase-examples/src/main/java/org/apache/storm/hbase/topology/WordCountClient.java
@@ -24,7 +24,7 @@ import org.apache.hadoop.hbase.util.Bytes;
/**
* Connects to the 'WordCount' table and prints counts for each word.
*
- * Assumes you have run (or are running) <code>PersistentWordCount</code>
+ * <p>Assumes you have run (or are running) <code>PersistentWordCount</code>
*/
public class WordCountClient {
diff --git a/examples/storm-hbase-examples/src/main/java/org/apache/storm/hbase/topology/WordCountValueMapper.java b/examples/storm-hbase-examples/src/main/java/org/apache/storm/hbase/topology/WordCountValueMapper.java
index 15ece78..9cb8115 100644
--- a/examples/storm-hbase-examples/src/main/java/org/apache/storm/hbase/topology/WordCountValueMapper.java
+++ b/examples/storm-hbase-examples/src/main/java/org/apache/storm/hbase/topology/WordCountValueMapper.java
@@ -12,7 +12,6 @@
package org.apache.storm.hbase.topology;
-
import java.util.ArrayList;
import java.util.List;
import org.apache.hadoop.hbase.Cell;
@@ -26,15 +25,15 @@ import org.apache.storm.tuple.ITuple;
import org.apache.storm.tuple.Values;
/**
- * Takes a Hbase result and returns a value list that has a value instance for each column and corresponding value. So if the result from
- * Hbase was
+ * Takes a Hbase result and returns a value list that has a value instance for each column and corresponding value. So
+ * if the result from Hbase was
* <pre>
* WORD, COUNT
* apple, 10
* bannana, 20
* </pre>
*
- * this will return
+ * <p>this will return
* <pre>
* [WORD, apple]
* [COUNT, 10]
diff --git a/examples/storm-hbase-examples/src/main/java/org/apache/storm/hbase/topology/WordCounter.java b/examples/storm-hbase-examples/src/main/java/org/apache/storm/hbase/topology/WordCounter.java
index 699b2ca..b2cadb8 100644
--- a/examples/storm-hbase-examples/src/main/java/org/apache/storm/hbase/topology/WordCounter.java
+++ b/examples/storm-hbase-examples/src/main/java/org/apache/storm/hbase/topology/WordCounter.java
@@ -12,6 +12,8 @@
package org.apache.storm.hbase.topology;
+import static org.apache.storm.utils.Utils.tuple;
+
import java.util.Map;
import org.apache.storm.task.TopologyContext;
import org.apache.storm.topology.BasicOutputCollector;
@@ -20,8 +22,6 @@ import org.apache.storm.topology.OutputFieldsDeclarer;
import org.apache.storm.tuple.Fields;
import org.apache.storm.tuple.Tuple;
-import static org.apache.storm.utils.Utils.tuple;
-
public class WordCounter implements IBasicBolt {