本文整理汇总了Python中cassandra.pool.Host.is_up方法的典型用法代码示例。如果您正苦于以下问题:Python Host.is_up方法的具体用法?Python Host.is_up怎么用?Python Host.is_up使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cassandra.pool.Host
的用法示例。
在下文中一共展示了Host.is_up方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_wait_for_schema_agreement_rpc_lookup
# 需要导入模块: from cassandra.pool import Host [as 别名]
# 或者: from cassandra.pool.Host import is_up [as 别名]
def test_wait_for_schema_agreement_rpc_lookup(self):
"""
If the rpc_address is 0.0.0.0, the "peer" column should be used instead.
"""
self.connection.peer_results[1].append(["0.0.0.0", PEER_IP, "b", "dc1", "rack1", ["3", "103", "203"]])
host = Host("0.0.0.0", SimpleConvictionPolicy)
self.cluster.metadata.hosts[PEER_IP] = host
host.is_up = False
# even though the new host has a different schema version, it's
# marked as down, so the control connection shouldn't care
self.assertTrue(self.control_connection.wait_for_schema_agreement())
self.assertEqual(self.time.clock, 0)
# but once we mark it up, the control connection will care
host.is_up = True
self.assertFalse(self.control_connection.wait_for_schema_agreement())
self.assertGreaterEqual(self.time.clock, self.cluster.max_schema_agreement_wait)