You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@distributedlog.apache.org by si...@apache.org on 2016/12/28 01:05:28 UTC
[20/20] incubator-distributedlog git commit: Address checkstyle
errors after merge
Address checkstyle errors after merge
Project: http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/commit/dd8ee62a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/tree/dd8ee62a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/diff/dd8ee62a
Branch: refs/heads/master
Commit: dd8ee62aebec27fb34ea6b9feefada9887fd6b1b
Parents: 01a7306
Author: Sijie Guo <si...@twitter.com>
Authored: Tue Dec 27 16:01:58 2016 -0800
Committer: Sijie Guo <si...@twitter.com>
Committed: Tue Dec 27 16:49:30 2016 -0800
----------------------------------------------------------------------
.../twitter/distributedlog/benchmark/ReaderWorker.java | 2 +-
.../benchmark/stream/SyncReaderBenchmark.java | 3 ++-
.../distributedlog/client/DistributedLogClientImpl.java | 10 ++++++----
.../distributedlog/client/proxy/ClusterClient.java | 2 +-
.../service/DistributedLogClientBuilder.java | 12 ++++++------
5 files changed, 16 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/dd8ee62a/distributedlog-benchmark/src/main/java/com/twitter/distributedlog/benchmark/ReaderWorker.java
----------------------------------------------------------------------
diff --git a/distributedlog-benchmark/src/main/java/com/twitter/distributedlog/benchmark/ReaderWorker.java b/distributedlog-benchmark/src/main/java/com/twitter/distributedlog/benchmark/ReaderWorker.java
index 9817d94..adbdeda 100644
--- a/distributedlog-benchmark/src/main/java/com/twitter/distributedlog/benchmark/ReaderWorker.java
+++ b/distributedlog-benchmark/src/main/java/com/twitter/distributedlog/benchmark/ReaderWorker.java
@@ -452,7 +452,7 @@ public class ReaderWorker implements Worker {
serverSet.close();
}
// Unregister gauges to prevent GC spirals
- for(StreamReader sr : streamReaders) {
+ for (StreamReader sr : streamReaders) {
sr.unregisterGauge();
}
}
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/dd8ee62a/distributedlog-benchmark/src/main/java/com/twitter/distributedlog/benchmark/stream/SyncReaderBenchmark.java
----------------------------------------------------------------------
diff --git a/distributedlog-benchmark/src/main/java/com/twitter/distributedlog/benchmark/stream/SyncReaderBenchmark.java b/distributedlog-benchmark/src/main/java/com/twitter/distributedlog/benchmark/stream/SyncReaderBenchmark.java
index 87006f4..122c8ef 100644
--- a/distributedlog-benchmark/src/main/java/com/twitter/distributedlog/benchmark/stream/SyncReaderBenchmark.java
+++ b/distributedlog-benchmark/src/main/java/com/twitter/distributedlog/benchmark/stream/SyncReaderBenchmark.java
@@ -143,7 +143,8 @@ public class SyncReaderBenchmark extends AbstractReaderBenchmark {
nonBlocking = true;
catchupStopwatch.stop();
logger.info("Catchup {} records (total {} bytes) in {} milliseconds",
- new Object[] { numCatchupReads, numCatchupBytes, stopwatch.elapsed(TimeUnit.MILLISECONDS) });
+ new Object[] { numCatchupReads, numCatchupBytes,
+ stopwatch.elapsed(TimeUnit.MILLISECONDS) });
}
stopwatch.reset();
} catch (IOException e) {
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/dd8ee62a/distributedlog-client/src/main/java/com/twitter/distributedlog/client/DistributedLogClientImpl.java
----------------------------------------------------------------------
diff --git a/distributedlog-client/src/main/java/com/twitter/distributedlog/client/DistributedLogClientImpl.java b/distributedlog-client/src/main/java/com/twitter/distributedlog/client/DistributedLogClientImpl.java
index 5125f28..634afe1 100644
--- a/distributedlog-client/src/main/java/com/twitter/distributedlog/client/DistributedLogClientImpl.java
+++ b/distributedlog-client/src/main/java/com/twitter/distributedlog/client/DistributedLogClientImpl.java
@@ -17,14 +17,16 @@
*/
package com.twitter.distributedlog.client;
+import static com.google.common.base.Preconditions.checkNotNull;
+
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Optional;
-import com.google.common.base.Preconditions;
import com.google.common.base.Stopwatch;
import com.google.common.collect.Sets;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
import com.twitter.distributedlog.DLSN;
import com.twitter.distributedlog.LogRecordSetBuffer;
+import com.twitter.distributedlog.client.monitor.MonitorServiceClient;
import com.twitter.distributedlog.client.ownership.OwnershipCache;
import com.twitter.distributedlog.client.proxy.ClusterClient;
import com.twitter.distributedlog.client.proxy.HostProvider;
@@ -240,7 +242,7 @@ public class DistributedLogClientImpl implements DistributedLogClient, MonitorSe
// to go so large for other reasons though.
this.results = new ArrayList<Promise<DLSN>>(data.size());
for (int i = 0; i < data.size(); i++) {
- Preconditions.checkNotNull(data.get(i));
+ checkNotNull(data.get(i));
this.results.add(new Promise<DLSN>());
}
}
@@ -871,8 +873,8 @@ public class DistributedLogClientImpl implements DistributedLogClient, MonitorSe
@Override
public void onSuccess(WriteResponse value) {
- if (StatusCode.FOUND == value.getHeader().getCode() &&
- null != value.getHeader().getLocation()) {
+ if (StatusCode.FOUND == value.getHeader().getCode()
+ && null != value.getHeader().getLocation()) {
SocketAddress addr;
try {
addr = DLSocketAddress.deserialize(value.getHeader().getLocation()).getSocketAddress();
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/dd8ee62a/distributedlog-client/src/main/java/com/twitter/distributedlog/client/proxy/ClusterClient.java
----------------------------------------------------------------------
diff --git a/distributedlog-client/src/main/java/com/twitter/distributedlog/client/proxy/ClusterClient.java b/distributedlog-client/src/main/java/com/twitter/distributedlog/client/proxy/ClusterClient.java
index bb95a97..f8bdae7 100644
--- a/distributedlog-client/src/main/java/com/twitter/distributedlog/client/proxy/ClusterClient.java
+++ b/distributedlog-client/src/main/java/com/twitter/distributedlog/client/proxy/ClusterClient.java
@@ -24,7 +24,7 @@ import com.twitter.util.Future;
import scala.runtime.BoxedUnit;
/**
- * Cluster client
+ * Cluster client.
*/
public class ClusterClient {
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/dd8ee62a/distributedlog-client/src/main/java/com/twitter/distributedlog/service/DistributedLogClientBuilder.java
----------------------------------------------------------------------
diff --git a/distributedlog-client/src/main/java/com/twitter/distributedlog/service/DistributedLogClientBuilder.java b/distributedlog-client/src/main/java/com/twitter/distributedlog/service/DistributedLogClientBuilder.java
index ec9a7c6..44d93ee 100644
--- a/distributedlog-client/src/main/java/com/twitter/distributedlog/service/DistributedLogClientBuilder.java
+++ b/distributedlog-client/src/main/java/com/twitter/distributedlog/service/DistributedLogClientBuilder.java
@@ -534,21 +534,21 @@ public final class DistributedLogClientBuilder {
@SuppressWarnings("unchecked")
ClusterClient buildServerRoutingServiceClient(String serverRoutingServiceFinagleName) {
- ClientBuilder builder = _clientBuilder;
+ ClientBuilder builder = this.clientBuilder;
if (null == builder) {
builder = ClientBuilder.get()
.tcpConnectTimeout(Duration.fromMilliseconds(200))
.connectTimeout(Duration.fromMilliseconds(200))
.requestTimeout(Duration.fromSeconds(1))
.retries(20);
- if (!_clientConfig.getThriftMux()) {
+ if (!clientConfig.getThriftMux()) {
builder = builder.hostConnectionLimit(1);
}
}
- if (_clientConfig.getThriftMux()) {
- builder = builder.stack(ThriftMux.client().withClientId(_clientId));
+ if (clientConfig.getThriftMux()) {
+ builder = builder.stack(ThriftMux.client().withClientId(clientId));
} else {
- builder = builder.codec(ThriftClientFramedCodec.apply(Option.apply(_clientId)));
+ builder = builder.codec(ThriftClientFramedCodec.apply(Option.apply(clientId)));
}
Name name;
@@ -562,7 +562,7 @@ public final class DistributedLogClientBuilder {
// builder the client
Service<ThriftClientRequest, byte[]> client =
ClientBuilder.safeBuildFactory(
- builder.dest(name).reportTo(_statsReceiver.scope("routing"))
+ builder.dest(name).reportTo(statsReceiver.scope("routing"))
).toService();
DistributedLogService.ServiceIface service =
new DistributedLogService.ServiceToClient(client, new TBinaryProtocol.Factory());