kikocis/java-driver public
Changesets · Branches · Tags · Compare
| Changeset | 3f96eab68455be5970ddd0d29bdda159895d5919f089007de29bf993a4138dac |
|---|---|
| Author | Alexandre Dutra <alexandre.dutra@datastax.com> · 2017-03-23 12:33 +01:00 |
| Committer | Alexandre Dutra <alexandre.dutra@datastax.com> · 2017-03-23 12:33 +01:00 |
| Parents | c2d22a2950fa |
4 files changed
modified driver-core/src/test/java/com/datastax/driver/core/CCMAccess.java +14 −0
| @@ -168,6 +168,20 @@ | ||
| 168 | 168 | */ |
| 169 | 169 | void forceStop(int n); |
| 170 | 170 | |
| 171 | + /** | |
| 172 | + * Pauses the {@code nth} host in the CCM cluster. | |
| 173 | + * | |
| 174 | + * @param n the node number (starting from 1). | |
| 175 | + */ | |
| 176 | + void pause(int n); | |
| 177 | + | |
| 178 | + /** | |
| 179 | + * Resumes the {@code nth} host in the CCM cluster. | |
| 180 | + * | |
| 181 | + * @param n the node number (starting from 1). | |
| 182 | + */ | |
| 183 | + void resume(int n); | |
| 184 | + | |
| 171 | 185 | /** |
| 172 | 186 | * Removes the {@code nth} host in the CCM cluster. |
| 173 | 187 | * |
modified driver-core/src/test/java/com/datastax/driver/core/CCMBridge.java +14 −0
| @@ -521,6 +521,18 @@ | ||
| 521 | 521 | execute(CCM_COMMAND + " node%d stop --not-gently", n); |
| 522 | 522 | } |
| 523 | 523 | |
| 524 | + @Override | |
| 525 | + public void pause(int n) { | |
| 526 | + logger.debug(String.format("Pausing: node %s (%s%s:%s) in %s", n, TestUtils.IP_PREFIX, n, binaryPort, this)); | |
| 527 | + execute(CCM_COMMAND + " node%d pause", n); | |
| 528 | + } | |
| 529 | + | |
| 530 | + @Override | |
| 531 | + public void resume(int n) { | |
| 532 | + logger.debug(String.format("Resuming: node %s (%s%s:%s) in %s", n, TestUtils.IP_PREFIX, n, binaryPort, this)); | |
| 533 | + execute(CCM_COMMAND + " node%d resume", n); | |
| 534 | + } | |
| 535 | + | |
| 524 | 536 | @Override |
| 525 | 537 | public void remove(int n) { |
| 526 | 538 | logger.debug(String.format("Removing: node %s (%s%s:%s) from %s", n, TestUtils.IP_PREFIX, n, binaryPort, this)); |
| @@ -679,6 +691,7 @@ | ||
| 679 | 691 | /** |
| 680 | 692 | * Waits for a host to be up by pinging the TCP socket directly, without using the Java driver's API. |
| 681 | 693 | */ |
| 694 | + @Override | |
| 682 | 695 | public void waitForUp(int node) { |
| 683 | 696 | TestUtils.waitUntilPortIsUp(addressOfNode(node)); |
| 684 | 697 | } |
| @@ -686,6 +699,7 @@ | ||
| 686 | 699 | /** |
| 687 | 700 | * Waits for a host to be down by pinging the TCP socket directly, without using the Java driver's API. |
| 688 | 701 | */ |
| 702 | + @Override | |
| 689 | 703 | public void waitForDown(int node) { |
| 690 | 704 | TestUtils.waitUntilPortIsDown(addressOfNode(node)); |
| 691 | 705 | } |
modified driver-core/src/test/java/com/datastax/driver/core/CCMCache.java +10 −0
| @@ -165,6 +165,16 @@ | ||
| 165 | 165 | ccm.forceStop(n); |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | + @Override | |
| 169 | + public void pause(int n) { | |
| 170 | + ccm.pause(n); | |
| 171 | + } | |
| 172 | + | |
| 173 | + @Override | |
| 174 | + public void resume(int n) { | |
| 175 | + ccm.resume(n); | |
| 176 | + } | |
| 177 | + | |
| 168 | 178 | @Override |
| 169 | 179 | public void remove(int n) { |
| 170 | 180 | ccm.remove(n); |
modified driver-core/src/test/java/com/datastax/driver/core/CCMTestsSupport.java +10 −0
| @@ -177,6 +177,16 @@ | ||
| 177 | 177 | throw new UnsupportedOperationException("This CCM cluster is read-only"); |
| 178 | 178 | } |
| 179 | 179 | |
| 180 | + @Override | |
| 181 | + public void pause(int n) { | |
| 182 | + throw new UnsupportedOperationException("This CCM cluster is read-only"); | |
| 183 | + } | |
| 184 | + | |
| 185 | + @Override | |
| 186 | + public void resume(int n) { | |
| 187 | + throw new UnsupportedOperationException("This CCM cluster is read-only"); | |
| 188 | + } | |
| 189 | + | |
| 180 | 190 | @Override |
| 181 | 191 | public void remove(int n) { |
| 182 | 192 | throw new UnsupportedOperationException("This CCM cluster is read-only"); |