Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 831750 Details for
Bug 1033943
RFE: Allow setting of DCAwareRoundRobinPolicy for supporting multiple datacenters
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Patch to master c39bcd8571
0001-BZ-1033943-Support-for-DCAwareRoundRobinPolicy.patch (text/plain), 3.86 KB, created by
Elias Ross
on 2013-12-02 19:20:16 UTC
(
hide
)
Description:
Patch to master c39bcd8571
Filename:
MIME Type:
Creator:
Elias Ross
Created:
2013-12-02 19:20:16 UTC
Size:
3.86 KB
patch
obsolete
>From 6840185ba61cdb41670277f562a52a36e6bcbc0d Mon Sep 17 00:00:00 2001 >From: Elias Ross <elias_ross@apple.com> >Date: Sun, 24 Nov 2013 07:20:50 -0800 >Subject: [PATCH] BZ 1033943 - Support for DCAwareRoundRobinPolicy > >Add system property rhq.storage.dc that allows this to come on >--- > .../src/main/resources/cassandra.properties | 4 ++++ > .../server/storage/StorageClientManagerBean.java | 16 ++++++++++++++-- > 2 files changed, 18 insertions(+), 2 deletions(-) > >diff --git a/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/resources/cassandra.properties b/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/resources/cassandra.properties >index 3f565c1..4e6cdf4 100644 >--- a/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/resources/cassandra.properties >+++ b/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/resources/cassandra.properties >@@ -12,6 +12,10 @@ rhq.storage.basedir=${rhq.rootDir} > # The password with which to authenticate requests to Cassandra. > # rhq.storage.password= > >+# The datacenter setting for load balancing connections to Cassandra. >+# If set, DCAwareRoundRobinPolicy is used. If not set, RoundRobinPolicy is used. >+# rhq.storage.dc= >+ > # Defines the number of tokens randomly assigned to a node on the ring. The more tokens, > # relative to other nodes, the larger the proportion of data that this node will store. You > # probably want all nodes to have the same number of tokens assuming they have equal >diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClientManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClientManagerBean.java >index dc8c554..5ba85a8 100644 >--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClientManagerBean.java >+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClientManagerBean.java >@@ -44,13 +44,14 @@ > import com.datastax.driver.core.ProtocolOptions; > import com.datastax.driver.core.Session; > import com.datastax.driver.core.exceptions.NoHostAvailableException; >+import com.datastax.driver.core.policies.DCAwareRoundRobinPolicy; > import com.datastax.driver.core.policies.DefaultRetryPolicy; >+import com.datastax.driver.core.policies.LoadBalancingPolicy; > import com.datastax.driver.core.policies.LoggingRetryPolicy; > import com.datastax.driver.core.policies.RoundRobinPolicy; > > import org.apache.commons.logging.Log; > import org.apache.commons.logging.LogFactory; >- > import org.rhq.cassandra.schema.SchemaManager; > import org.rhq.cassandra.util.ClusterBuilder; > import org.rhq.core.domain.cloud.StorageNode; >@@ -74,6 +75,7 @@ > > private final Log log = LogFactory.getLog(StorageClientManagerBean.class); > >+ private static final String DC_PROP = "rhq.storage.dc"; > private static final String RHQ_KEYSPACE = "rhq"; > > @EJB >@@ -349,9 +351,19 @@ private Session createSession() { > } > int port = storageNodes.get(0).getCqlPort(); > >+ LoadBalancingPolicy policy; >+ String localDC = System.getProperty(DC_PROP); >+ if (localDC != null) { >+ log.info(DC_PROP + " set to datacenter " + localDC); >+ policy = new DCAwareRoundRobinPolicy(localDC); >+ } else { >+ log.info(DC_PROP + " not set, using round-robin policy"); >+ policy = new RoundRobinPolicy(); >+ } >+ > cluster = new ClusterBuilder().addContactPoints(hostNames.toArray(new String[hostNames.size()])) > .withCredentialsObfuscated(this.cachedStorageUsername, this.cachedStoragePassword).withPort(port) >- .withLoadBalancingPolicy(new RoundRobinPolicy()) >+ .withLoadBalancingPolicy(policy) > .withRetryPolicy(new LoggingRetryPolicy(DefaultRetryPolicy.INSTANCE)).withCompression( > ProtocolOptions.Compression.NONE).build(); > >-- >1.8.1.2 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1033943
:
831749
| 831750