當前位置: 首頁>>代碼示例>>Python>>正文


Python ClusterOperationHelper.flushctl_set方法代碼示例

本文整理匯總了Python中lib.membase.helper.cluster_helper.ClusterOperationHelper.flushctl_set方法的典型用法代碼示例。如果您正苦於以下問題:Python ClusterOperationHelper.flushctl_set方法的具體用法?Python ClusterOperationHelper.flushctl_set怎麽用?Python ClusterOperationHelper.flushctl_set使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在lib.membase.helper.cluster_helper.ClusterOperationHelper的用法示例。


在下文中一共展示了ClusterOperationHelper.flushctl_set方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_eventing_processes_mutations_when_mutated_through_subdoc_api_and_set_expiry_through_sdk

# 需要導入模塊: from lib.membase.helper.cluster_helper import ClusterOperationHelper [as 別名]
# 或者: from lib.membase.helper.cluster_helper.ClusterOperationHelper import flushctl_set [as 別名]
 def test_eventing_processes_mutations_when_mutated_through_subdoc_api_and_set_expiry_through_sdk(self):
     # set expiry pager interval
     ClusterOperationHelper.flushctl_set(self.master, "exp_pager_stime", 1, bucket=self.src_bucket_name)
     url = 'couchbase://{ip}/{name}'.format(ip=self.master.ip, name=self.src_bucket_name)
     bucket = Bucket(url, username="cbadminbucket", password="password")
     for docid in ['customer123', 'customer1234', 'customer12345']:
         bucket.insert(docid, {'some': 'value'})
     body = self.create_save_function_body(self.function_name, self.handler_code,
                                           dcp_stream_boundary="from_now")
     # deploy eventing function
     self.deploy_function(body)
     # upserting a new sub-document
     bucket.mutate_in('customer123', SD.upsert('fax', '775-867-5309'))
     # inserting a sub-document
     bucket.mutate_in('customer1234', SD.insert('purchases.complete', [42, True, None], create_parents=True))
     # Creating and populating an array document
     bucket.mutate_in('customer12345', SD.array_append('purchases.complete', ['Hello'], create_parents=True))
     self.verify_eventing_results(self.function_name, 3, skip_stats_validation=True)
     for docid in ['customer123', 'customer1234', 'customer12345']:
         # set expiry on all the docs created using sub doc API
         bucket.touch(docid, ttl=5)
     self.sleep(10, "wait for expiry of the documents")
     # Wait for eventing to catch up with all the expiry mutations and verify results
     self.verify_eventing_results(self.function_name, 0, skip_stats_validation=True)
     self.undeploy_and_delete_function(body)
開發者ID:arod1987,項目名稱:testrunner,代碼行數:27,代碼來源:eventing_dataset.py


注:本文中的lib.membase.helper.cluster_helper.ClusterOperationHelper.flushctl_set方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。