Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[STORM-3037] Lowering CheckStyle Violations across all modules #2641

Merged
merged 24 commits into from Apr 26, 2018

Conversation

kishorvpatil
Copy link
Contributor

Below is the list of modules affected by this patch. The max allowed violations are going down by 17000+.

Module Name Max Allowed Exceptions Before Max Allowed Exceptions After
storm-client 10079 3298
storm-server 2585 783
storm-eventhubs 1765 45
storm-starter 1538 263
storm-hdfs 1406 189
storm-sql-core 1286 59
storm-redis 602 64
storm-cassandra 578 159
storm-kafka 557 180
storm-hbase 371 100
storm-maven-plugins 269 11
storm-hive 259 58
storm-core 254 73
storm-jms 235 63
storm-hdfs-examples 224 29
storm-kafka-monitor 178 87
storm-mqtt 158 39
storm-jdbc 149 36
storm-solr 108 47
storm-perf 100 65
storm-hbase-examples 55 16
maven-shade-clojure-transformer 16 0

count = 0;
System.out.println("Pending count: " + this.pending.size() + ", total: " + this.total);
}
Thread.yield();
}

public void ack(Object msgId) {
// System.out.println("ACK");
// System.out.println("ACK");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we just remove this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is attempt to only fix format to allow for checkstyle to pass it. I did not go into each comment for its validity for deletion.

Copy link
Contributor

@Ethanlm Ethanlm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great work . But it's too much to review it at once. I will come back to review it later.

* with the License. You may obtain a copy of the License at
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version
* 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we change this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The line length allowed is 140 characters. So the paragraphs are reformatted

@@ -1,25 +1,24 @@
/*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be /** here?

// threeProducer1Consumer(1); // -- measurement 3
// oneProducer1Consumer(1000); // -- measurement 1
// twoProducer1Consumer(1000); // -- measurement 2
// threeProducer1Consumer(1); // -- measurement 3
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to just remove these? Otherwise, delete the spaces between // and the actual code, e.g. //threeProducer1Consumer(1); to make it look better

// twoProducer1Consumer();
// threeProducer1Consumer();
// oneProducer2Consumers();
// producerFwdConsumer();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: spaces between // and code

@@ -64,7 +63,7 @@ static StormTopology getTopology(Map<String, Object> conf) {
BoltDeclarer bd = builder.setBolt(BOLT_ID, bolt, Helper.getInt(conf, BOLT_COUNT, 1));

bd.localOrShuffleGrouping(SPOUT_ID);
// bd.shuffleGrouping(SPOUT_ID);
// bd.shuffleGrouping(SPOUT_ID);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: space?

}
return result;
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like you just moved the location of the function. Is there any particular reason to do it?

String str = Utils.join(header, ",");
writer.println(str);
writer.println("------------------------------------------------------------------------------------------------------------------");
writer
.println("------------------------------------------------------------------------------------------------------------------");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be good to be consistent about this writer.println()? Here we have

writer.println(
            "\n---...

and

 writer
            .println("---

@@ -160,7 +159,7 @@ private static MetricsSample getMetricsSample(TopologyInfo topInfo) {
ret.spoutEmitted = spoutEmitted;
ret.spoutTransferred = spoutTransferred;
ret.sampleTime = System.currentTimeMillis();
// ret.numSupervisors = clusterSummary.get_supervisors_size();
// ret.numSupervisors = clusterSummary.get_supervisors_size();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this line ? or delete the space?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed

throw new RuntimeException(exp);
}
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we moving locations of the functions

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are checkstyle conditions that decide import order, modified overloaded method order and at-clause orders. To avoid these violations, we need to put these methods in right order.

Copy link
Contributor

@revans2 revans2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 this is definitely a step in the right direction. It may not be perfect but there is more good in here.

Please upmerge as I merged one thing in that messed this up, sorry I'll try to hold off on more merges.

Also please respond to or address Ethan's concerns.

@revans2
Copy link
Contributor

revans2 commented Apr 26, 2018

Still +1

@asfgit asfgit merged commit d9ca88a into apache:master Apr 26, 2018
asfgit pushed a commit that referenced this pull request Apr 26, 2018
…-storm into STORM-3037

STORM-3037: Lowering CheckStyle Violations across all modules

This closes #2641
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants