Skip to content

Conversation

@pkumar-singh
Copy link
Member

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 rat

Changes

  • Integrate gradle build with rat plugin

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

@merlimat merlimat merged commit 2dd4afe into apache:master 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants