Permalink
Browse files

BOOKKEEPER-452: Rename ClientConfiguration multiplexing_enabled to su…

…bscription_connection_sharing_enabled (sijie via ivank)

git-svn-id: https://svn.apache.org/repos/asf/zookeeper/bookkeeper/trunk@1406541 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
1 parent 2dd4ff7 commit da1b308ba8eb4dc0cd93b5ad19065067c354f242 @ivankelly ivankelly committed Nov 7, 2012
View
@@ -122,6 +122,8 @@ Trunk (unreleased changes)
BOOKKEEPER-434: [Hedwig CPP Client] Delay resolving default host until necessary. (sijie via ivank)
+ BOOKKEEPER-452: Rename ClientConfiguration multiplexing_enabled to subscription_connection_sharing_enabled (sijie via ivank)
+
hedwig-server:
BOOKKEEPER-302: No more messages delivered when hub server scans messages over two ledgers. (sijie via ivank)
@@ -49,7 +49,7 @@ namespace Hedwig {
static const std::string NUM_DISPATCH_THREADS;
static const std::string SSL_ENABLED;
static const std::string SSL_PEM_FILE;
- static const std::string ENABLE_MULTIPLEXING;
+ static const std::string SUBSCRIPTION_CHANNEL_SHARING_ENABLED;
/**
* The maximum number of messages the hub will queue for subscriptions
* created using this configuration. The hub will always queue the most
@@ -41,7 +41,7 @@ const std::string Configuration::NUM_DISPATCH_THREADS = "hedwig.cpp.num_dispatch
const std::string Configuration::SUBSCRIPTION_MESSAGE_BOUND = "hedwig.cpp.subscription_message_bound";
const std::string Configuration::SSL_ENABLED = "hedwig.cpp.ssl_enabled";
const std::string Configuration::SSL_PEM_FILE = "hedwig.cpp.ssl_pem";
-const std::string Configuration::ENABLE_MULTIPLEXING = "hedwig.cpp.enable_multiplexing";
+const std::string Configuration::SUBSCRIPTION_CHANNEL_SHARING_ENABLED = "hedwig.cpp.subscription_channel_sharing_enabled";
Client::Client(const Configuration& conf) {
LOG4CXX_DEBUG(logger, "Client::Client (" << this << ")");
@@ -333,7 +333,7 @@ void SubscriptionEventEmitter::emitSubscriptionEvent(
DuplexChannelManagerPtr DuplexChannelManager::create(const Configuration& conf) {
DuplexChannelManager * managerPtr;
- if (conf.getBool(Configuration::ENABLE_MULTIPLEXING, false)) {
+ if (conf.getBool(Configuration::SUBSCRIPTION_CHANNEL_SHARING_ENABLED, false)) {
managerPtr = new MultiplexDuplexChannelManager(conf);
} else {
managerPtr = new SimpleDuplexChannelManager(conf);
@@ -40,7 +40,7 @@ class MultiplexConfiguration : public TestServerConfiguration {
virtual bool getBool(const std::string& key, bool defaultVal) const {
if (key == Configuration::SUBSCRIBER_AUTOCONSUME) {
return false;
- } else if (key == Configuration::ENABLE_MULTIPLEXING) {
+ } else if (key == Configuration::SUBSCRIPTION_CHANNEL_SHARING_ENABLED) {
return true;
} else {
return TestServerConfiguration::getBool(key, defaultVal);
@@ -183,7 +183,7 @@ class TestServerConfiguration : public Hedwig::Configuration {
virtual bool getBool(const std::string& key, bool defaultVal) const {
if (key == Configuration::SSL_ENABLED) {
return isSSL;
- } else if (key == Configuration::ENABLE_MULTIPLEXING) {
+ } else if (key == Configuration::SUBSCRIPTION_CHANNEL_SHARING_ENABLED) {
return multiplexing;
}
return defaultVal;
@@ -42,7 +42,7 @@
protected static final String TIMEOUT_THREAD_RUN_INTERVAL = "timeout_thread_run_interval";
protected static final String SSL_ENABLED = "ssl_enabled";
protected static final String SUBSCRIPTION_MESSAGE_BOUND = "subscription_message_bound";
- protected static final String MULTIPLEXING_ENABLED = "multiplexing_enabled";
+ protected static final String SUBSCRIPTION_CHANNEL_SHARING_ENABLED = "subscription_channel_sharing_enabled";
// Singletons we want to instantiate only once per ClientConfiguration
protected HedwigSocketAddress myDefaultServerAddress = null;
@@ -144,8 +144,8 @@ public boolean isSSLEnabled() {
* This parameter is a boolean flag indicating if multiplexing subscription
* channels.
*/
- public boolean isMultiplexingEnabled() {
- return conf.getBoolean(MULTIPLEXING_ENABLED, false);
+ public boolean isSubscriptionChannelSharingEnabled() {
+ return conf.getBoolean(SUBSCRIPTION_CHANNEL_SHARING_ENABLED, false);
}
/**
@@ -74,7 +74,7 @@ protected HedwigClientImpl(ClientConfiguration cfg) {
protected HedwigClientImpl(ClientConfiguration cfg, ChannelFactory socketFactory) {
this.cfg = cfg;
this.socketFactory = socketFactory;
- if (cfg.isMultiplexingEnabled()) {
+ if (cfg.isSubscriptionChannelSharingEnabled()) {
channelManager = new MultiplexHChannelManager(cfg, socketFactory);
} else {
channelManager = new SimpleHChannelManager(cfg, socketFactory);
@@ -161,10 +161,10 @@ public void run() {
return Arrays.asList(new Object[][] { { true }, { false } });
}
- protected boolean isMultiplexingEnabled;
+ protected boolean isSubscriptionChannelSharingEnabled;
- public TestPubSubClient(boolean isMultiplexingEnabled) {
- this.isMultiplexingEnabled = isMultiplexingEnabled;
+ public TestPubSubClient(boolean isSubscriptionChannelSharingEnabled) {
+ this.isSubscriptionChannelSharingEnabled = isSubscriptionChannelSharingEnabled;
}
@Override
@@ -173,8 +173,8 @@ public void setUp() throws Exception {
super.setUp();
client = new HedwigClient(new ClientConfiguration() {
@Override
- public boolean isMultiplexingEnabled() {
- return TestPubSubClient.this.isMultiplexingEnabled;
+ public boolean isSubscriptionChannelSharingEnabled() {
+ return TestPubSubClient.this.isSubscriptionChannelSharingEnabled;
}
});
publisher = client.getPublisher();
@@ -229,7 +229,7 @@ public void setUp() throws Exception {
super.setUp();
client = new HedwigClient(new ClientConfiguration() {
@Override
- public boolean isMultiplexingEnabled() {
+ public boolean isSubscriptionChannelSharingEnabled() {
return true;
}
@Override
@@ -93,8 +93,8 @@ public boolean isAutoSendConsumeMessageEnabled() {
}
@Override
- public boolean isMultiplexingEnabled() {
- return isMultiplexingEnabled;
+ public boolean isSubscriptionChannelSharingEnabled() {
+ return isSubscriptionChannelSharingEnabled;
}
}
@@ -170,10 +170,10 @@ public synchronized void deliver(ByteString topic, ByteString subscriberId,
return Arrays.asList(new Object[][] { { false }, { true } });
}
- protected boolean isMultiplexingEnabled;
+ protected boolean isSubscriptionChannelSharingEnabled;
- public TestThrottlingDelivery(boolean isMultiplexingEnabled) {
- this.isMultiplexingEnabled = isMultiplexingEnabled;
+ public TestThrottlingDelivery(boolean isSubscriptionChannelSharingEnabled) {
+ this.isSubscriptionChannelSharingEnabled = isSubscriptionChannelSharingEnabled;
}
@Override
@@ -91,11 +91,11 @@
}
protected Mode mode;
- protected boolean isMultiplexingEnabled;
+ protected boolean isSubscriptionChannelSharingEnabled;
- public TestHedwigHub(Mode mode, boolean isMultiplexingEnabled) {
+ public TestHedwigHub(Mode mode, boolean isSubscriptionChannelSharingEnabled) {
this.mode = mode;
- this.isMultiplexingEnabled = isMultiplexingEnabled;
+ this.isSubscriptionChannelSharingEnabled = isSubscriptionChannelSharingEnabled;
}
protected HedwigProxy proxy;
@@ -210,8 +210,8 @@ public boolean isSSLEnabled() {
}
@Override
- public boolean isMultiplexingEnabled() {
- return isMultiplexingEnabled;
+ public boolean isSubscriptionChannelSharingEnabled() {
+ return isSubscriptionChannelSharingEnabled;
}
}
@@ -66,8 +66,8 @@ public int getRetryRemoteSubscribeThreadRunInterval() {
protected class NewRegionClientConfiguration extends ClientConfiguration {
@Override
- public boolean isMultiplexingEnabled() {
- return isMultiplexingEnabled;
+ public boolean isSubscriptionChannelSharingEnabled() {
+ return isSubscriptionChannelSharingEnabled;
}
}
@@ -84,10 +84,10 @@ protected ClientConfiguration getRegionClientConfiguration() {
return Arrays.asList(new Object[][] { { false }, { true } });
}
- protected boolean isMultiplexingEnabled;
+ protected boolean isSubscriptionChannelSharingEnabled;
- public TestHedwigRegion(boolean isMultiplexingEnabled) {
- this.isMultiplexingEnabled = isMultiplexingEnabled;
+ public TestHedwigRegion(boolean isSubscriptionChannelSharingEnabled) {
+ this.isSubscriptionChannelSharingEnabled = isSubscriptionChannelSharingEnabled;
}
@Override

0 comments on commit da1b308

Please sign in to comment.