本文整理汇总了Python中scalaris.ScalarisVM.shutdownNodes方法的典型用法代码示例。如果您正苦于以下问题:Python ScalarisVM.shutdownNodes方法的具体用法?Python ScalarisVM.shutdownNodes怎么用?Python ScalarisVM.shutdownNodes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类scalaris.ScalarisVM
的用法示例。
在下文中一共展示了ScalarisVM.shutdownNodes方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testShutdownNodes_NotConnected
# 需要导入模块: from scalaris import ScalarisVM [as 别名]
# 或者: from scalaris.ScalarisVM import shutdownNodes [as 别名]
def testShutdownNodes_NotConnected(self):
"""Test method for ScalarisVM.shutdownNodes() with a closed connection."""
vm = ScalarisVM()
vm.close_connection()
#self.assertRaises(scalaris.ConnectionError, vm.shutdownNodes(0))
vm.shutdownNodes(0)
vm.close_connection()
示例2: _testDeleteNodes
# 需要导入模块: from scalaris import ScalarisVM [as 别名]
# 或者: from scalaris.ScalarisVM import shutdownNodes [as 别名]
def _testDeleteNodes(self, nodesToRemove, action):
"""Test method for ScalarisVM.shutdownNode() and ScalarisVM.killNode()."""
vm = ScalarisVM()
size = vm.getNumberOfNodes();
if nodesToRemove >= 1:
vm.addNodes(nodesToRemove)
self.assertEqual(size + nodesToRemove, vm.getNumberOfNodes())
if action == 'shutdown':
result = vm.shutdownNodes(nodesToRemove)
elif action == 'kill':
result = vm.killNodes(nodesToRemove)
self.assertEqual(nodesToRemove, len(result))
self.assertEqual(size, vm.getNumberOfNodes())
nodes = vm.getNodes()
for name in result:
self.assertTrue(not name in nodes, str(nodes) + " should not contain " + name)
vm.close_connection()