You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by bo...@apache.org on 2014/06/09 15:48:15 UTC
[10/32] git commit: STORM-297: remove config
storm.messaging.netty.blocking as we want async to be the default
STORM-297: remove config storm.messaging.netty.blocking as we want async to be the default
Project: http://git-wip-us.apache.org/repos/asf/incubator-storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-storm/commit/19e72e85
Tree: http://git-wip-us.apache.org/repos/asf/incubator-storm/tree/19e72e85
Diff: http://git-wip-us.apache.org/repos/asf/incubator-storm/diff/19e72e85
Branch: refs/heads/master
Commit: 19e72e852cb25caa1ee18b6c5ae1ae627e337bf1
Parents: 7b88cf3
Author: Sean Zhong <cl...@gmail.com>
Authored: Tue May 20 11:24:42 2014 +0800
Committer: Sean Zhong <cl...@gmail.com>
Committed: Tue May 20 11:24:42 2014 +0800
----------------------------------------------------------------------
storm-core/src/jvm/backtype/storm/Config.java | 6 ------
.../jvm/backtype/storm/messaging/netty/Client.java | 17 +++++------------
2 files changed, 5 insertions(+), 18 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/19e72e85/storm-core/src/jvm/backtype/storm/Config.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/Config.java b/storm-core/src/jvm/backtype/storm/Config.java
index fa5d9d1..d069293 100644
--- a/storm-core/src/jvm/backtype/storm/Config.java
+++ b/storm-core/src/jvm/backtype/storm/Config.java
@@ -92,12 +92,6 @@ public class Config extends HashMap<String, Object> {
public static final Object STORM_NETTY_MESSAGE_BATCH_SIZE_SCHEMA = Number.class;
/**
- * This control whether we do Netty message transfer in a synchronized way or async way.
- */
- public static final String STORM_NETTY_BLOCKING = "storm.messaging.netty.blocking";
- public static final Object STORM_NETTY_BLOCKING_SCHEMA = Boolean.class;
-
- /**
* We check with this interval that whether the Netty channel is writable and try to write pending messages
*/
public static final String STORM_NETTY_FLUSH_CHECK_INTERVAL_MS = "storm.messaging.netty.flush.check.interval.ms";
http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/19e72e85/storm-core/src/jvm/backtype/storm/messaging/netty/Client.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/messaging/netty/Client.java b/storm-core/src/jvm/backtype/storm/messaging/netty/Client.java
index 8f0d7af..18582b4 100644
--- a/storm-core/src/jvm/backtype/storm/messaging/netty/Client.java
+++ b/storm-core/src/jvm/backtype/storm/messaging/netty/Client.java
@@ -53,7 +53,6 @@ public class Client implements IConnection {
private boolean closing;
private Integer messageBatchSize;
- private Boolean blocking = false;
private AtomicLong pendings;
@@ -76,7 +75,6 @@ public class Client implements IConnection {
max_sleep_ms = Utils.getInt(storm_conf.get(Config.STORM_MESSAGING_NETTY_MAX_SLEEP_MS));
this.messageBatchSize = Utils.getInt(storm_conf.get(Config.STORM_NETTY_MESSAGE_BATCH_SIZE), 262144);
- blocking = Utils.getBoolean(storm_conf.get(Config.STORM_NETTY_BLOCKING), false);
flushCheckInterval = Utils.getInt(storm_conf.get(Config.STORM_NETTY_FLUSH_CHECK_INTERVAL_MS), 10); // default 10 ms
@@ -209,7 +207,7 @@ public class Client implements IConnection {
messageBatch.add(message);
if (messageBatch.isFull()) {
MessageBatch toBeFlushed = messageBatch;
- flushRequest(channel, toBeFlushed, blocking);
+ flushRequest(channel, toBeFlushed);
messageBatch = null;
}
}
@@ -221,7 +219,7 @@ public class Client implements IConnection {
// Flush as fast as we can to reduce the latency
MessageBatch toBeFlushed = messageBatch;
messageBatch = null;
- flushRequest(channel, toBeFlushed, blocking);
+ flushRequest(channel, toBeFlushed);
} else {
// when channel is NOT writable, it means the internal netty buffer is full.
@@ -246,7 +244,7 @@ public class Client implements IConnection {
Channel channel = channelRef.get();
if (channel != null) {
flushCheckTimer.set(Long.MAX_VALUE);
- flushRequest(channel, toBeFlushed, true);
+ flushRequest(channel, toBeFlushed);
}
messageBatch = null;
}
@@ -266,7 +264,7 @@ public class Client implements IConnection {
MessageBatch toBeFlushed = messageBatch;
Channel channel = channelRef.get();
if (channel != null) {
- flushRequest(channel, toBeFlushed, true);
+ flushRequest(channel, toBeFlushed);
}
messageBatch = null;
}
@@ -307,8 +305,7 @@ public class Client implements IConnection {
send(wrapper.iterator());
}
- private void flushRequest(Channel channel, final MessageBatch requests,
- boolean blocking) {
+ private void flushRequest(Channel channel, final MessageBatch requests) {
if (requests == null)
return;
@@ -334,9 +331,5 @@ public class Client implements IConnection {
}
}
});
-
- if (blocking) {
- future.awaitUninterruptibly();
- }
}
}
\ No newline at end of file