Skip to content

Commit 5c3fa97

Browse files
tolbertamolim7t
authored andcommitted
Add updateDSENodeConfig as updatedseconf now supports node level ops.
1 parent 3030948 commit 5c3fa97

File tree

4 files changed

+53
-0
lines changed

4 files changed

+53
-0
lines changed

driver-core/src/test/java/com/datastax/driver/core/CCMAccess.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,20 @@ enum Workload {cassandra, solr, hadoop, spark, cfs, graph}
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
*

driver-core/src/test/java/com/datastax/driver/core/CCMBridge.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,24 @@ public void updateNodeConfig(int n, Map<String, Object> configs) {
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);

driver-core/src/test/java/com/datastax/driver/core/CCMCache.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,16 @@ public void updateNodeConfig(int n, Map<String, Object> configs) {
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);

driver-core/src/test/java/com/datastax/driver/core/CCMTestsSupport.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,16 @@ public void updateNodeConfig(int n, Map<String, Object> configs) {
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 @@ public void execute(Collection<String> statements) {
758768
}
759769
}
760770
}
771+
761772
/**
762773
* Signals that the test has encountered an unexpected error.
763774
* <p/>

0 commit comments

Comments
 (0)