Skip to content

Commit d2aabda

Browse files
committed
Fix checkstyle
1 parent 687a359 commit d2aabda

2 files changed

Lines changed: 16 additions & 12 deletions

File tree

bookkeeper-server/src/main/java/org/apache/bookkeeper/zookeeper/CustomZooKeeperHostProvider.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
import org.slf4j.LoggerFactory;
4040

4141
/**
42-
* ZooKeeper HostProvider with a workaround for https://issues.apache.org/jira/browse/ZOOKEEPER-3825
42+
* ZooKeeper HostProvider with a workaround for https://issues.apache.org/jira/browse/ZOOKEEPER-3825.
4343
* Based on ZooKeeper's StaticHostProvider
4444
*/
4545
public final class CustomZooKeeperHostProvider implements HostProvider {
@@ -53,7 +53,7 @@ public final class CustomZooKeeperHostProvider implements HostProvider {
5353
private int currentIndex = -1;
5454

5555
/**
56-
* The following fields are used to migrate clients during reconfiguration
56+
* The following fields are used to migrate clients during reconfiguration.
5757
*/
5858
private boolean reconfigMode = false;
5959

@@ -87,7 +87,8 @@ public CustomZooKeeperHostProvider(Collection<InetSocketAddress> serverAddresses
8787
/**
8888
* Constructs a SimpleHostSet.
8989
*
90-
* Introduced for testing purposes. getAllByName() is a static method of InetAddress, therefore cannot be easily mocked.
90+
* Introduced for testing purposes. getAllByName() is a static method of InetAddress, therefore cannot be easily
91+
* mocked.
9192
* By abstraction of Resolver interface we can easily inject a mocked implementation in tests.
9293
*
9394
* @param serverAddresses
@@ -100,8 +101,8 @@ public CustomZooKeeperHostProvider(Collection<InetSocketAddress> serverAddresses
100101
}
101102

102103
/**
103-
* Constructs a SimpleHostSet. This constructor is used from StaticHostProviderTest to produce deterministic test results
104-
* by initializing sourceOfRandomness with the same seed
104+
* Constructs a SimpleHostSet. This constructor is used from StaticHostProviderTest to produce deterministic test
105+
* results by initializing sourceOfRandomness with the same seed
105106
*
106107
* @param serverAddresses
107108
* possibly unresolved ZooKeeper server addresses
@@ -127,7 +128,8 @@ private void init(Collection<InetSocketAddress> serverAddresses, long randomness
127128
private InetSocketAddress resolve(InetSocketAddress address) {
128129
try {
129130
String curHostString = address.getHostString();
130-
List<InetAddress> resolvedAddresses = new ArrayList<>(Arrays.asList(this.resolver.getAllByName(curHostString)));
131+
List<InetAddress> resolvedAddresses =
132+
new ArrayList<>(Arrays.asList(this.resolver.getAllByName(curHostString)));
131133
if (resolvedAddresses.isEmpty()) {
132134
return address;
133135
}

tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/integration/utils/CustomZooKeeperHostProvider.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
import org.slf4j.LoggerFactory;
3939

4040
/**
41-
* ZooKeeper HostProvider with a workaround for https://issues.apache.org/jira/browse/ZOOKEEPER-3825
41+
* ZooKeeper HostProvider with a workaround for https://issues.apache.org/jira/browse/ZOOKEEPER-3825.
4242
* Based on ZooKeeper's StaticHostProvider
4343
*/
4444
public final class CustomZooKeeperHostProvider implements HostProvider {
@@ -52,7 +52,7 @@ public final class CustomZooKeeperHostProvider implements HostProvider {
5252
private int currentIndex = -1;
5353

5454
/**
55-
* The following fields are used to migrate clients during reconfiguration
55+
* The following fields are used to migrate clients during reconfiguration.
5656
*/
5757
private boolean reconfigMode = false;
5858

@@ -86,7 +86,8 @@ public CustomZooKeeperHostProvider(Collection<InetSocketAddress> serverAddresses
8686
/**
8787
* Constructs a SimpleHostSet.
8888
*
89-
* Introduced for testing purposes. getAllByName() is a static method of InetAddress, therefore cannot be easily mocked.
89+
* Introduced for testing purposes. getAllByName() is a static method of InetAddress, therefore cannot be easily
90+
* mocked.
9091
* By abstraction of Resolver interface we can easily inject a mocked implementation in tests.
9192
*
9293
* @param serverAddresses
@@ -99,8 +100,8 @@ public CustomZooKeeperHostProvider(Collection<InetSocketAddress> serverAddresses
99100
}
100101

101102
/**
102-
* Constructs a SimpleHostSet. This constructor is used from StaticHostProviderTest to produce deterministic test results
103-
* by initializing sourceOfRandomness with the same seed
103+
* Constructs a SimpleHostSet. This constructor is used from StaticHostProviderTest to produce deterministic test
104+
* results by initializing sourceOfRandomness with the same seed
104105
*
105106
* @param serverAddresses
106107
* possibly unresolved ZooKeeper server addresses
@@ -126,7 +127,8 @@ private void init(Collection<InetSocketAddress> serverAddresses, long randomness
126127
private InetSocketAddress resolve(InetSocketAddress address) {
127128
try {
128129
String curHostString = address.getHostString();
129-
List<InetAddress> resolvedAddresses = new ArrayList<>(Arrays.asList(this.resolver.getAllByName(curHostString)));
130+
List<InetAddress> resolvedAddresses =
131+
new ArrayList<>(Arrays.asList(this.resolver.getAllByName(curHostString)));
130132
if (resolvedAddresses.isEmpty()) {
131133
return address;
132134
}

0 commit comments

Comments
 (0)