ISSUE-2640: BP-43: Gradle integration with RAT plugin - #2683
Merged
merlimat merged 2 commits intoApr 12, 2021
Conversation
merlimat
approved these changes
Apr 12, 2021
hsaputra
pushed a commit
that referenced
this pull request
Apr 16, 2021
### Motivation
**Migrate bookkeeper to gradle spotbug plugin.**
spotbugs is gradle as well as maven plugin which checks for obvious bugs in source code.
**How to run**
`./gradlew spotbugsMain `
### Changes
- Integrate gradle build with spotbugs plugin
- Second commit is for fixing issues reported by spotbugs plugin
### Test
Just to validate it's working.
I introduced following bug.
```
public void test() {
+
+ String[] field = {"a", "b", "c", "s", "e"};
+
+ //concatenates strings using + in a loop
+ String ip = "127.0.0.1";
+ String s = "";
+ for (int i = 0; i < field.length; ++i) {
+ s = s + field[i];
+ }
+
+ System.out.println(ip);
+
+ }
```
spotbugs plugin reported following violation.
```
<BugInstance type="SBSC_USE_STRINGBUFFER_CONCATENATION" priority="2" rank="18" abbrev="SBSC" category="PERFORMANCE" instanceHash="2aa8e4ebcc4cd86190fe3e7bd8a4913c" instanceOccurrenceNum="0" instanceOccurrenceMax="0">
<ShortMessage>Method concatenates strings using + in a loop</ShortMessage>
<LongMessage>org.apache.bookkeeper.meta.LongZkLedgerIdGenerator.test() concatenates strings using + in a loop</LongMessage>
<Class classname="org.apache.bookkeeper.meta.LongZkLedgerIdGenerator" primary="true">
<SourceLine classname="org.apache.bookkeeper.meta.LongZkLedgerIdGenerator" start="58" end="350" sourcefile="LongZkLedgerIdGenerator.java" sourcepath="org/apache/bookkeeper/meta/LongZkLedgerIdGenerator.java" relSourcepath="java/org/apache/bookkeeper/meta/LongZkLedgerIdGenerator.java">
<Message>At LongZkLedgerIdGenerator.java:[lines 58-350]</Message>
</SourceLine>
<Message>In class org.apache.bookkeeper.meta.LongZkLedgerIdGenerator</Message>
</Class>
```
Master Issue: #2640
Reviewers: Henry Saputra <hsaputra@apache.org>, Enrico Olivelli <eolivelli@gmail.com>
This closes #2682 from pkumar-singh/merge_internal_gradle_spotbugs, closes #2640 and squashes the following commits:
5883732 [Prashant] Fix for gradle spotbug plugin found violation
2bc79b0 [Prashant] ISSUE-2640: BP-43 Gradle migration integrating with spotbug gradle plugin
f1a1f12 [Surinder Singh] staging and setting up vote for release candidates (#2681)
2dd4afe [Prashant Kumar] ISSUE-2640: BP-43: Gradle integration with RAT plugin (#2683)
79768fe [Jack Vanlightly] ISSUE #2615: Fix for invalid ensemble issue during ledger recovery
646e590 [Prashant Kumar] ISSUE #2640: BP-43 integrate gradle javadoc plugin
d70153f [hangc0276] Update documentation with default value for openLedgerRereplicationGracePeriod config option
hsaputra
pushed a commit
that referenced
this pull request
Apr 19, 2021
### Motivation After deleting many ledgers, seeking to the end of the RocksDB metadata can take a long time and trigger timeouts upstream. Address this by improving the seek logic as well as compacting out tombstones in situations where we've just deleted many entries. This affects the entry location index and the ledger metadata index. Reviewers: Andrey Yegorov, Prashant Kumar This closes #2686 from mauricebarnum/rocksdb-tombstones and squashes the following commits: c029968 [Maurice Barnum] Partially compact RocksDB after removing deleted ledgers 0be68a1 [Maurice Barnum] KeyValueStorageRocksDB bounded key iterator: use RocksDB upper bound 0c5ef8f [Maurice Barnum] KeyValueStorageRocksDB.getFloor() - reimplement to avoid two seeks 114cc73 [Maurice Barnum] update rocksdb to 6.16.4 f489a05 [Surinder Singh] Fix test cases using gradle build (#2689) 9256dba [Lari Hotari] Add current ip address, long hostname and short hostname to /etc/hosts (#2688) f1a1f12 [Surinder Singh] staging and setting up vote for release candidates (#2681) 2dd4afe [Prashant Kumar] ISSUE-2640: BP-43: Gradle integration with RAT plugin (#2683) 79768fe [Jack Vanlightly] ISSUE #2615: Fix for invalid ensemble issue during ledger recovery 646e590 [Prashant Kumar] ISSUE #2640: BP-43 integrate gradle javadoc plugin d70153f [hangc0276] Update documentation with default value for openLedgerRereplicationGracePeriod config option
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Migrate bookkeeper to gradle rat plugin.
rat plugin is gradle as well as maven plugin which checks for valid apache certificates in the source files.
How to run
./gradlew ratChanges
Test
prashantk@C02CRB6HMD6M bookkeeper % ./gradlew rat
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.8.3/userguide/command_line_interface.html#sec:command_line_warnings
BUILD SUCCESSFUL in 6s
59 actionable tasks: 1 executed, 58 up-to-date
prashantk@C02CRB6HMD6M bookkeeper %
Master Issue: #2640