|
480 | 480 | ))))
|
481 | 481 | )))
|
482 | 482 |
|
| 483 | +(deftest test-rebalance-change-parallelism |
| 484 | + (with-simulated-time-local-cluster [cluster :supervisors 4 :ports-per-supervisor 3 |
| 485 | + :daemon-conf {SUPERVISOR-ENABLE false |
| 486 | + NIMBUS-MONITOR-FREQ-SECS 10 |
| 487 | + TOPOLOGY-ACKER-EXECUTORS 0}] |
| 488 | + (letlocals |
| 489 | + (bind topology (thrift/mk-topology |
| 490 | + {"1" (thrift/mk-spout-spec (TestPlannerSpout. true) |
| 491 | + :parallelism-hint 6 |
| 492 | + :conf {TOPOLOGY-TASKS 12})} |
| 493 | + {})) |
| 494 | + (bind state (:storm-cluster-state cluster)) |
| 495 | + (submit-local-topology (:nimbus cluster) |
| 496 | + "test" |
| 497 | + {TOPOLOGY-WORKERS 3 |
| 498 | + TOPOLOGY-MESSAGE-TIMEOUT-SECS 30} topology) |
| 499 | + (bind storm-id (get-storm-id state "test")) |
| 500 | + (bind checker (fn [distribution] |
| 501 | + (check-executor-distribution |
| 502 | + (slot-assignments cluster storm-id) |
| 503 | + distribution))) |
| 504 | + (checker [2 2 2]) |
| 505 | + |
| 506 | + (.rebalance (:nimbus cluster) "test" |
| 507 | + (doto (RebalanceOptions.) |
| 508 | + (.set_num_workers 6) |
| 509 | + )) |
| 510 | + (advance-cluster-time cluster 29) |
| 511 | + (checker [2 2 2]) |
| 512 | + (advance-cluster-time cluster 3) |
| 513 | + (checker [1 1 1 1 1 1]) |
| 514 | + |
| 515 | + (.rebalance (:nimbus cluster) "test" |
| 516 | + (doto (RebalanceOptions.) |
| 517 | + (.set_num_executors {"1" 1}) |
| 518 | + )) |
| 519 | + (advance-cluster-time cluster 29) |
| 520 | + (checker [1 1 1 1 1 1]) |
| 521 | + (advance-cluster-time cluster 3) |
| 522 | + (checker [1]) |
| 523 | + |
| 524 | + (.rebalance (:nimbus cluster) "test" |
| 525 | + (doto (RebalanceOptions.) |
| 526 | + (.set_num_executors {"1" 8}) |
| 527 | + (.set_num_workers 4) |
| 528 | + )) |
| 529 | + (advance-cluster-time cluster 32) |
| 530 | + (checker [2 2 2 2]) |
| 531 | + (check-consistency cluster "test") |
| 532 | + |
| 533 | + (bind executor-info (->> (storm-component->executor-info cluster "test") |
| 534 | + (map-val #(map executor-id->tasks %)))) |
| 535 | + (check-distribution (executor-info "1") [2 2 2 2 1 1 1 1]) |
| 536 | + |
| 537 | + ))) |
| 538 | + |
483 | 539 | (deftest test-submit-invalid
|
484 | 540 | (with-simulated-time-local-cluster [cluster
|
485 | 541 | :daemon-conf {SUPERVISOR-ENABLE false
|
|
0 commit comments