Elffuss BraidHub

kikocis/java-driver public

Add updateDSENodeConfig as updatedseconf now supports node level ops.
Changeset2204d64a11c88ab45fdde35b02e385712b93050308b6d8401b83d55716d6b521
AuthorAndrew Tolbert <andrew.tolbert@datastax.com> · 2016-03-20 20:43 -05:00
Committerolim7t <omichallat+github@gmail.com> · 2016-04-01 19:51 +02:00
Parents77adf3ba1b9a

Browse the files at this changeset

4 files changed

modified driver-core/src/test/java/com/datastax/driver/core/CCMAccess.java +14 −0
@@ -202,6 +202,20 @@
202202 */
203203 void updateNodeConfig(int n, Map<String, Object> configs);
204204
205+ /**
206+ * Updates the {@code nth} host's dse config file in the CCM cluster.
207+ *
208+ * @param n the node number (starting from 1).
209+ */
210+ void updateDSENodeConfig(int n, String key, Object value);
211+
212+ /**
213+ * Updates the {@code nth} host's dse config file in the CCM cluster.
214+ *
215+ * @param n the node number (starting from 1).
216+ */
217+ void updateDSENodeConfig(int n, Map<String, Object> configs);
218+
205219 /**
206220 * Sets the workload(s) for the {@code nth} host in the CCM cluster.
207221 *
modified driver-core/src/test/java/com/datastax/driver/core/CCMBridge.java +18 −0
@@ -536,6 +536,24 @@
536536 execute(CCM_COMMAND + " node%s updateconf %s", n, confStr);
537537 }
538538
539+ @Override
540+ public void updateDSENodeConfig(int n, String key, Object value) {
541+ updateDSENodeConfig(n, ImmutableMap.<String, Object>builder().put(key, value).build());
542+ }
543+
544+ @Override
545+ public void updateDSENodeConfig(int n, Map<String, Object> configs) {
546+ StringBuilder confStr = new StringBuilder();
547+ for (Map.Entry<String, Object> entry : configs.entrySet()) {
548+ confStr
549+ .append(entry.getKey())
550+ .append(":")
551+ .append(entry.getValue())
552+ .append(" ");
553+ }
554+ execute(CCM_COMMAND + " node%s updatedseconf %s", n, confStr);
555+ }
556+
539557 @Override
540558 public void setWorkload(int node, Workload... workload) {
541559 String workloadStr = Joiner.on(",").join(workload);
modified driver-core/src/test/java/com/datastax/driver/core/CCMCache.java +10 −0
@@ -190,6 +190,16 @@
190190 ccm.updateNodeConfig(n, configs);
191191 }
192192
193+ @Override
194+ public void updateDSENodeConfig(int n, String key, Object value) {
195+ ccm.updateDSENodeConfig(n, key, value);
196+ }
197+
198+ @Override
199+ public void updateDSENodeConfig(int n, Map<String, Object> configs) {
200+ ccm.updateDSENodeConfig(n, configs);
201+ }
202+
193203 @Override
194204 public void setWorkload(int n, Workload... workload) {
195205 ccm.setWorkload(n, workload);
modified driver-core/src/test/java/com/datastax/driver/core/CCMTestsSupport.java +11 −0
@@ -212,6 +212,16 @@
212212 throw new UnsupportedOperationException("This CCM cluster is read-only");
213213 }
214214
215+ @Override
216+ public void updateDSENodeConfig(int n, String key, Object value) {
217+ throw new UnsupportedOperationException("This CCM cluster is read-only");
218+ }
219+
220+ @Override
221+ public void updateDSENodeConfig(int n, Map<String, Object> configs) {
222+ throw new UnsupportedOperationException("This CCM cluster is read-only");
223+ }
224+
215225 @Override
216226 public void setWorkload(int node, Workload... workload) {
217227 throw new UnsupportedOperationException("This CCM cluster is read-only");
@@ -758,6 +768,7 @@
758768 }
759769 }
760770 }
771+
761772 /**
762773 * Signals that the test has encountered an unexpected error.
763774 * <p/>