Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

CBQE-817: add internalSettings params in NodeInitializeTask

Change-Id: I06bee5cd4dabac53a67fecfd883740c3a28a6789
Reviewed-on: http://review.couchbase.org/22643
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Andrei Baranouski <andrei.baranouski@gmail.com>
  • Loading branch information...
commit 1876e482b181314ee7656d5c53373788ae1d8d5d 1 parent 99e2a6f
@andreibaranouski andreibaranouski authored
View
11 lib/couchbase/cluster.py
@@ -75,7 +75,9 @@ def async_bucket_delete(self, server, bucket='default'):
self.task_manager.schedule(_task)
return _task
- def async_init_node(self, server, disabled_consistent_view=None):
+ def async_init_node(self, server, disabled_consistent_view=None,
+ rebalanceIndexWaitingDisabled=None, rebalanceIndexPausingDisabled=None,
+ maxParallelIndexers=None, maxParallelReplicaIndexers=None):
"""Asynchronously initializes a node
The task scheduled will initialize a nodes username and password and will establish
@@ -84,10 +86,15 @@ def async_init_node(self, server, disabled_consistent_view=None):
Parameters:
server - The server to initialize. (TestInputServer)
disabled_consistent_view - disable consistent view
+ rebalanceIndexWaitingDisabled - index waiting during rebalance(Boolean)
+ rebalanceIndexPausingDisabled - index pausing during rebalance(Boolean)
+ maxParallelIndexers - max parallel indexers threads(Int)
+ maxParallelReplicaIndexers - max parallel replica indexers threads(int)
Returns:
NodeInitTask - A task future that is a handle to the scheduled task."""
- _task = NodeInitializeTask(server, disabled_consistent_view)
+ _task = NodeInitializeTask(server, disabled_consistent_view, rebalanceIndexWaitingDisabled,
+ rebalanceIndexPausingDisabled, maxParallelIndexers, maxParallelReplicaIndexers)
self.task_manager.schedule(_task)
return _task
View
22 lib/tasks/task.py
@@ -63,11 +63,20 @@ def check(self, task_manager):
raise NotImplementedError
class NodeInitializeTask(Task):
- def __init__(self, server, disabled_consistent_view=None):
+ def __init__(self, server, disabled_consistent_view=None,
+ rebalanceIndexWaitingDisabled=None,
+ rebalanceIndexPausingDisabled=None,
+ maxParallelIndexers=None,
+ maxParallelReplicaIndexers=None):
Task.__init__(self, "node_init_task")
self.server = server
self.quota = 0
self.disable_consistent_view = disabled_consistent_view
+ self.rebalanceIndexWaitingDisabled = rebalanceIndexWaitingDisabled
+ self.rebalanceIndexPausingDisabled = rebalanceIndexPausingDisabled
+ self.maxParallelIndexers = maxParallelIndexers
+ self.maxParallelReplicaIndexers = maxParallelReplicaIndexers
+
def execute(self, task_manager):
try:
@@ -79,7 +88,16 @@ def execute(self, task_manager):
username = self.server.rest_username
password = self.server.rest_password
- rest.set_reb_cons_view(self.disable_consistent_view)
+ if self.disable_consistent_view is None:
+ rest.set_reb_cons_view(self.disable_consistent_view)
+ if self.disable_consistent_view is None:
+ rest.set_reb_index_waiting(self.rebalanceIndexWaitingDisabled)
+ if self.rebalanceIndexPausingDisabled is not None:
+ rest.set_rebalance_index_pausing(self.rebalanceIndexPausingDisabled)
+ if self.maxParallelIndexers is not None:
+ rest.set_max_parallel_indexers(self.maxParallelIndexers)
+ if self.maxParallelReplicaIndexers is not None:
+ rest.set_max_parallel_replica_indexers(self.maxParallelReplicaIndexers)
rest.init_cluster(username, password)
info = rest.get_nodes_self()
View
14 pytests/basetestcase.py
@@ -50,6 +50,10 @@ def setUp(self):
self.max_verify = self.input.param("max_verify", None)
#we don't change consistent_view on server by default
self.disabled_consistent_view = self.input.param("disabled_consistent_view", None)
+ self.rebalanceIndexWaitingDisabled = self.input.param("rebalanceIndexWaitingDisabled", None)
+ self.rebalanceIndexPausingDisabled = self.input.param("rebalanceIndexPausingDisabled", None)
+ self.maxParallelIndexers = self.input.param("maxParallelIndexers", None)
+ self.maxParallelReplicaIndexers = self.input.param("maxParallelReplicaIndexers", None)
self.log.info("============== basetestcase setup was started for test #{0} {1}=============="\
.format(self.case_number, self._testMethodName))
#avoid clean up if the previous test has been tear down
@@ -61,7 +65,9 @@ def setUp(self):
self.cluster.rebalance(self.servers[:self.num_servers], self.servers[1:self.num_servers], [])
elif self.nodes_init > 1:
self.cluster.rebalance(self.servers[:1], self.servers[1:self.nodes_init], [])
- self.quota = self._initialize_nodes(self.cluster, self.servers, self.disabled_consistent_view)
+ self.quota = self._initialize_nodes(self.cluster, self.servers, self.disabled_consistent_view,
+ self.rebalanceIndexWaitingDisabled, self.rebalanceIndexPausingDisabled,
+ self.maxParallelIndexers, self.maxParallelReplicaIndexers)
if self.dgm_run:
self.quota = 256
if self.total_buckets > 0:
@@ -122,11 +128,13 @@ def _log_finish(self):
except:
pass
- def _initialize_nodes(self, cluster, servers, disabled_consistent_view=None):
+ def _initialize_nodes(self, cluster, servers, disabled_consistent_view=None, rebalanceIndexWaitingDisabled=None,
+ rebalanceIndexPausingDisabled=None, maxParallelIndexers=None, maxParallelReplicaIndexers=None):
quota = 0
init_tasks = []
for server in servers:
- init_tasks.append(cluster.async_init_node(server, disabled_consistent_view))
+ init_tasks.append(cluster.async_init_node(server, disabled_consistent_view, rebalanceIndexWaitingDisabled,
+ rebalanceIndexPausingDisabled, maxParallelIndexers, maxParallelReplicaIndexers))
for task in init_tasks:
node_quota = task.result()
if node_quota < quota or quota == 0:
Please sign in to comment.
Something went wrong with that request. Please try again.