Skip to content

Commit aa3d579

Browse files
author
Heesung Sohn
committed
check style
1 parent c3ebcf9 commit aa3d579

File tree

5 files changed

+25
-26
lines changed

5 files changed

+25
-26
lines changed

pulsar-inttest-lib/src/main/java/org/apache/pulsar/tests/integration/suites/PulsarTestSuite.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,13 @@ public final void tearDownAfterClass() throws Exception {
3535
cleanup();
3636
}
3737

38-
public static void retryStrategically(Predicate<Void> predicate, int retryCount, long intSleepTimeInMillis) throws Exception {
38+
public static void retryStrategically(Predicate<Void> predicate, int retryCount, long intSleepTimeInMillis)
39+
throws Exception {
3940
retryStrategically(predicate, retryCount, intSleepTimeInMillis, false);
4041
}
4142

42-
public static void retryStrategically(Predicate<Void> predicate, int retryCount, long intSleepTimeInMillis, boolean throwException)
43+
public static void retryStrategically(Predicate<Void> predicate, int retryCount, long intSleepTimeInMillis,
44+
boolean throwException)
4345
throws Exception {
4446

4547
for (int i = 0; i < retryCount; i++) {
@@ -56,7 +58,7 @@ public static void retryStrategically(Predicate<Void> predicate, int retryCount,
5658
}
5759
}
5860

59-
Thread.sleep(intSleepTimeInMillis + (intSleepTimeInMillis * i));
61+
Thread.sleep(intSleepTimeInMillis + (intSleepTimeInMillis * i));
6062
}
6163
}
6264
}

pulsar-inttest-lib/src/main/java/org/apache/pulsar/tests/integration/topologies/PulsarCluster.java

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,14 @@
2525
import static org.apache.pulsar.tests.integration.containers.PulsarContainer.CS_PORT;
2626
import static org.apache.pulsar.tests.integration.containers.PulsarContainer.PULSAR_CONTAINERS_LEAVE_RUNNING;
2727
import static org.apache.pulsar.tests.integration.containers.PulsarContainer.ZK_PORT;
28-
import com.google.common.collect.Lists;
29-
import com.google.common.collect.Maps;
3028
import java.util.ArrayList;
3129
import java.util.Collection;
3230
import java.util.Collections;
3331
import java.util.Iterator;
3432
import java.util.List;
3533
import java.util.Map;
3634
import java.util.Objects;
35+
import java.util.TreeMap;
3736
import java.util.function.Function;
3837
import lombok.Cleanup;
3938
import lombok.Getter;
@@ -43,13 +42,13 @@
4342
import org.apache.pulsar.tests.integration.containers.BKContainer;
4443
import org.apache.pulsar.tests.integration.containers.BrokerContainer;
4544
import org.apache.pulsar.tests.integration.containers.CSContainer;
45+
import org.apache.pulsar.tests.integration.containers.OxiaContainer;
4646
import org.apache.pulsar.tests.integration.containers.ProxyContainer;
4747
import org.apache.pulsar.tests.integration.containers.PulsarContainer;
4848
import org.apache.pulsar.tests.integration.containers.PulsarInitMetadataContainer;
4949
import org.apache.pulsar.tests.integration.containers.WorkerContainer;
5050
import org.apache.pulsar.tests.integration.containers.ZKContainer;
5151
import org.apache.pulsar.tests.integration.docker.ContainerExecResult;
52-
import org.apache.pulsar.tests.integration.containers.OxiaContainer;
5352
import org.testcontainers.containers.BindMode;
5453
import org.testcontainers.containers.GenericContainer;
5554
import org.testcontainers.containers.Network;
@@ -66,7 +65,7 @@ public class PulsarCluster {
6665
public static final String CURL = "/usr/bin/curl";
6766

6867
/**
69-
* Pulsar Cluster Spec
68+
* Pulsar Cluster Spec.
7069
*
7170
* @param spec pulsar cluster spec.
7271
* @return the built pulsar cluster
@@ -151,9 +150,9 @@ private PulsarCluster(PulsarClusterSpec spec, Network network, CSContainer csCon
151150

152151
this.csContainer = csContainer;
153152

154-
this.bookieContainers = Maps.newTreeMap();
155-
this.brokerContainers = Maps.newTreeMap();
156-
this.workerContainers = Maps.newTreeMap();
153+
this.bookieContainers = new TreeMap<>();
154+
this.brokerContainers = new TreeMap<>();
155+
this.workerContainers = new TreeMap<>();
157156

158157
this.proxyContainer = new ProxyContainer(clusterName, appendClusterName(ProxyContainer.NAME), spec.enableTls)
159158
.withNetwork(network)
@@ -440,7 +439,7 @@ public static void stopService(String networkAlias,
440439
private static <T extends PulsarContainer> Map<String, T> runNumContainers(String serviceName,
441440
int numContainers,
442441
Function<String, T> containerCreator) {
443-
Map<String, T> containers = Maps.newTreeMap();
442+
Map<String, T> containers = new TreeMap<>();
444443
for (int i = 0; i < numContainers; i++) {
445444
String name = "pulsar-" + serviceName + "-" + i;
446445
T container = containerCreator.apply(name);
@@ -632,7 +631,7 @@ public synchronized WorkerContainer getWorker(String workerName) {
632631
}
633632

634633
private <T> T getAnyContainer(Map<String, T> containers, String serviceName) {
635-
List<T> containerList = Lists.newArrayList();
634+
List<T> containerList = new ArrayList<>();
636635
containerList.addAll(containers.values());
637636
Collections.shuffle(containerList);
638637
checkArgument(!containerList.isEmpty(), "No " + serviceName + " is alive");

pulsar-inttest-lib/src/main/java/org/apache/pulsar/tests/integration/topologies/PulsarClusterSpec.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public class PulsarClusterSpec {
8080
int numFunctionWorkers = 0;
8181

8282
/**
83-
* Allow to query the last message
83+
* Allow to query the last message.
8484
*/
8585
@Default
8686
boolean queryLastMessage = false;
@@ -94,8 +94,7 @@ public class PulsarClusterSpec {
9494
FunctionRuntimeType functionRuntimeType = FunctionRuntimeType.PROCESS;
9595

9696
/**
97-
* Returns the list of external services to start with
98-
* this cluster.
97+
* Returns the list of external services to start with this cluster.
9998
*
10099
* @return the list of external services to start with the cluster.
101100
*/
@@ -117,19 +116,19 @@ public class PulsarClusterSpec {
117116
boolean enableContainerLog = false;
118117

119118
/**
120-
* Provide a map of paths (in the classpath) to mount as volumes inside the containers
119+
* Provide a map of paths (in the classpath) to mount as volumes inside the containers.
121120
*/
122121
@Default
123122
Map<String, String> classPathVolumeMounts = new TreeMap<>();
124123

125124
/**
126-
* Data container
125+
* Data container.
127126
*/
128127
@Default
129128
GenericContainer<?> dataContainer = null;
130129

131130
/**
132-
* Pulsar Test Image Name
131+
* Pulsar Test Image Name.
133132
*
134133
* @return the version of the pulsar test image to use
135134
*/

pulsar-inttest-lib/src/main/java/org/apache/pulsar/tests/integration/topologies/PulsarClusterTestBase.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
@Slf4j
3838
public abstract class PulsarClusterTestBase extends PulsarTestBase {
3939

40-
public final static String CLIENT_CONFIG_FILE_PATH_PROPERTY_NAME = "client.config.file.path";
40+
public static final String CLIENT_CONFIG_FILE_PATH_PROPERTY_NAME = "client.config.file.path";
4141

4242
protected final Map<String, String> brokerEnvs = new HashMap<>();
4343
protected final Map<String, String> bookkeeperEnvs = new HashMap<>();
@@ -46,7 +46,6 @@ public abstract class PulsarClusterTestBase extends PulsarTestBase {
4646
protected final List<Integer> bookieAdditionalPorts = new LinkedList<>();
4747

4848

49-
5049
private Map<String, Object> readClientConfigs(String clientConfFilePath) throws IOException {
5150
Properties prop = new Properties(System.getProperties());
5251
try (FileInputStream input = new FileInputStream(clientConfFilePath)) {
@@ -91,7 +90,7 @@ protected final void cleanup() throws Exception {
9190

9291
@DataProvider(name = "ServiceUrlAndTopics")
9392
public Object[][] serviceUrlAndTopics() {
94-
return new Object[][] {
93+
return new Object[][]{
9594
// plain text, persistent topic
9695
{
9796
stringSupplier(() -> getPulsarCluster().getPlainTextServiceUrl()),
@@ -107,7 +106,7 @@ public Object[][] serviceUrlAndTopics() {
107106

108107
@DataProvider(name = "ServiceUrls")
109108
public Object[][] serviceUrls() {
110-
return new Object[][] {
109+
return new Object[][]{
111110
// plain text
112111
{
113112
stringSupplier(() -> getPulsarCluster().getPlainTextServiceUrl())
@@ -117,7 +116,7 @@ public Object[][] serviceUrls() {
117116

118117
@DataProvider(name = "ServiceAndAdminUrls")
119118
public Object[][] serviceAndAdminUrls() {
120-
return new Object[][] {
119+
return new Object[][]{
121120
// plain text
122121
{
123122
stringSupplier(() -> getPulsarCluster().getPlainTextServiceUrl()),
@@ -128,7 +127,7 @@ public Object[][] serviceAndAdminUrls() {
128127

129128
@DataProvider
130129
public Object[][] serviceUrlAndTopicDomain() {
131-
return new Object[][] {
130+
return new Object[][]{
132131
{
133132
stringSupplier(() -> getPulsarCluster().getPlainTextServiceUrl()),
134133
TopicDomain.persistent
@@ -142,7 +141,7 @@ public Object[][] serviceUrlAndTopicDomain() {
142141

143142
@DataProvider(name = "topicDomain")
144143
public Object[][] topicDomain() {
145-
return new Object[][] {
144+
return new Object[][]{
146145
{
147146
TopicDomain.persistent
148147
},

pulsar-inttest-lib/src/main/java/org/apache/pulsar/tests/integration/topologies/PulsarGeoCluster.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public class PulsarGeoCluster {
3636
private final PulsarCluster[] clusters;
3737

3838
/**
39-
* Pulsar Cluster Spec
39+
* Pulsar Cluster Spec.
4040
*
4141
* @param specs each pulsar cluster spec.
4242
* @return the built a pulsar cluster with geo replication

0 commit comments

Comments
 (0)