当前位置: 首页>>代码示例>>Python>>正文


Python History.ladder方法代码示例

本文整理汇总了Python中history.History.ladder方法的典型用法代码示例。如果您正苦于以下问题:Python History.ladder方法的具体用法?Python History.ladder怎么用?Python History.ladder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在history.History的用法示例。


在下文中一共展示了History.ladder方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_simple_put

# 需要导入模块: from history import History [as 别名]
# 或者: from history.History import ladder [as 别名]
 def test_simple_put(self):
     for _ in range(6):
         dynamo1.DynamoNode()
     a = dynamo1.DynamoClientNode('a')
     a.put('K1', None, 1)
     Framework.schedule()
     print History.ladder()
开发者ID:TaoZong,项目名称:Python,代码行数:9,代码来源:test_dynamo.py

示例2: test_partition

# 需要导入模块: from history import History [as 别名]
# 或者: from history.History import ladder [as 别名]
    def test_partition(self):
        dynamomessages._show_metadata = True
        all_nodes = self.partition()

        # Display, tweaking ordering of nodes so partition is in the middle
        print History.ladder(force_include=all_nodes, spacing=16, key=lambda x: ' ' if x.name == 'b' else x.name)
        dynamomessages._show_metadata = False
开发者ID:TaoZong,项目名称:Python,代码行数:9,代码来源:test_dynamo.py

示例3: test_put2_fail_nodes23_5

# 需要导入模块: from history import History [as 别名]
# 或者: from history.History import ladder [as 别名]
 def test_put2_fail_nodes23_5(self):
     """Show Put after a failure including handoff, and the resulting Pings"""
     (a, pref_list) = self.put_fail_nodes23(dynamo4)
     coordinator = pref_list[0]
     from_line = len(History.history)
     a.put('K1', None, 2, destnode=coordinator)  # Send client request to coordinator for clarity
     Framework.schedule(timers_to_process=10)
     print History.ladder(force_include=pref_list, start_line=from_line, spacing=16)
开发者ID:TaoZong,项目名称:Python,代码行数:10,代码来源:test_dynamo.py

示例4: test_put2_fail_nodes23_2

# 需要导入模块: from history import History [as 别名]
# 或者: from history.History import ladder [as 别名]
 def test_put2_fail_nodes23_2(self):
     """Show second request for same key skipping failed nodes"""
     (a, pref_list) = self.put_fail_nodes23(dynamo2)
     coordinator = pref_list[0]
     from_line = len(History.history)
     a.put('K1', None, 2, destnode=coordinator)  # Send client request to coordinator for clarity
     Framework.schedule()
     print History.ladder(force_include=pref_list, start_line=from_line, spacing=16)
开发者ID:TaoZong,项目名称:Python,代码行数:10,代码来源:test_dynamo.py

示例5: test_get_put_put

# 需要导入模块: from history import History [as 别名]
# 或者: from history.History import ladder [as 别名]
 def test_get_put_put(self):
     """Show get-then-put-then-put operation"""
     dynamomessages._show_metadata = True
     (a, pref_list) = self.get_put_get_put()
     coordinator = pref_list[0]
     from_line = len(History.history)
     self.get_put_put(a, coordinator)
     print History.ladder(force_include=pref_list, start_line=from_line, spacing=16)
     dynamomessages._show_metadata = False
开发者ID:TaoZong,项目名称:Python,代码行数:11,代码来源:test_dynamo.py

示例6: test_put2_fail_nodes23_3

# 需要导入模块: from history import History [as 别名]
# 或者: from history.History import ladder [as 别名]
 def test_put2_fail_nodes23_3(self):
     """Show PingReq failing"""
     (a, pref_list) = self.put_fail_nodes23(dynamo4)
     coordinator = pref_list[0]
     a.put('K1', None, 2, destnode=coordinator)  # Send client request to coordinator for clarity
     Framework.schedule(timers_to_process=0)
     from_line = len(History.history)
     Framework.schedule(timers_to_process=3)
     print History.ladder(force_include=pref_list, start_line=from_line, spacing=16)
开发者ID:TaoZong,项目名称:Python,代码行数:11,代码来源:test_dynamo.py

示例7: test_simple_get

# 需要导入模块: from history import History [as 别名]
# 或者: from history.History import ladder [as 别名]
 def test_simple_get(self):
     for _ in range(6):
         dynamo1.DynamoNode()
     a = dynamo1.DynamoClientNode('a')
     a.put('K1', None, 1)
     Framework.schedule()
     from_line = len(History.history)
     a.get('K1')
     Framework.schedule()
     print History.ladder(start_line=from_line)
开发者ID:TaoZong,项目名称:Python,代码行数:12,代码来源:test_dynamo.py

示例8: test_double_put

# 需要导入模块: from history import History [as 别名]
# 或者: from history.History import ladder [as 别名]
 def test_double_put(self):
     for _ in range(6):
         dynamo1.DynamoNode()
     a = dynamo1.DynamoClientNode('a')
     b = dynamo1.DynamoClientNode('b')
     a.put('K1', None, 1)
     Framework.schedule(1)
     b.put('K2', None, 17)
     Framework.schedule()
     print History.ladder(spacing=14)
开发者ID:TaoZong,项目名称:Python,代码行数:12,代码来源:test_dynamo.py

示例9: put_fail_initial_node

# 需要导入模块: from history import History [as 别名]
# 或者: from history.History import ladder [as 别名]
 def put_fail_initial_node(self, cls):
     for _ in range(6):
         cls.DynamoNode()
     a = cls.DynamoClientNode('a')
     destnode = random.choice(cls.DynamoNode.nodelist)
     a.put('K1', None, 1, destnode=destnode)
     # Fail at the forwarding node before it gets a chance to forward
     destnode.fail()
     Framework.schedule()
     print History.ladder()
开发者ID:TaoZong,项目名称:Python,代码行数:12,代码来源:test_dynamo.py

示例10: test_put2_fail_nodes23_6

# 需要导入模块: from history import History [as 别名]
# 或者: from history.History import ladder [as 别名]
 def test_put2_fail_nodes23_6(self):
     """Show hinted handoff after recovery"""
     (a, pref_list) = self.put_fail_nodes23(dynamo4)
     coordinator = pref_list[0]
     a.put('K1', None, 2, destnode=coordinator)  # Send client request to coordinator for clarity
     Framework.schedule(timers_to_process=10)
     from_line = len(History.history)
     pref_list[1].recover()
     pref_list[2].recover()
     Framework.schedule(timers_to_process=15)
     print History.ladder(force_include=pref_list, start_line=from_line, spacing=16)
开发者ID:TaoZong,项目名称:Python,代码行数:13,代码来源:test_dynamo.py

示例11: test_put2_fail_nodes23_4b

# 需要导入模块: from history import History [as 别名]
# 或者: from history.History import ladder [as 别名]
 def test_put2_fail_nodes23_4b(self):
     """Show PingReq recovering, and a subsequent Put returning to the original preference list"""
     (a, pref_list) = self.put_fail_nodes23(dynamo3)
     coordinator = pref_list[0]
     a.put('K1', None, 2, destnode=coordinator)  # Send client request to coordinator for clarity
     Framework.schedule(timers_to_process=10)
     from_line = len(History.history)
     pref_list[1].recover()
     pref_list[2].recover()
     Framework.schedule(timers_to_process=15)
     a.put('K1', None, 3, destnode=coordinator)
     Framework.schedule(timers_to_process=5)
     print History.ladder(force_include=pref_list, start_line=from_line, spacing=16)
开发者ID:TaoZong,项目名称:Python,代码行数:15,代码来源:test_dynamo.py

示例12: test_put2_fail_nodes23_4a

# 需要导入模块: from history import History [as 别名]
# 或者: from history.History import ladder [as 别名]
 def test_put2_fail_nodes23_4a(self):
     """Show PingReq recovering but an inconsistent Get being returned"""
     (a, pref_list) = self.put_fail_nodes23(dynamo3)
     coordinator = pref_list[0]
     a.put('K1', None, 2, destnode=coordinator)  # Send client request to coordinator for clarity
     Framework.schedule(timers_to_process=10)
     from_line = len(History.history)
     pref_list[1].recover()
     pref_list[2].recover()
     Framework.schedule(timers_to_process=10)
     a.get('K1', destnode=coordinator)
     Framework.schedule(timers_to_process=0)
     print History.ladder(force_include=pref_list, start_line=from_line, spacing=16)
开发者ID:TaoZong,项目名称:Python,代码行数:15,代码来源:test_dynamo.py

示例13: put_fail_node2

# 需要导入模块: from history import History [as 别名]
# 或者: from history.History import ladder [as 别名]
 def put_fail_node2(self, cls):
     for _ in range(6):
         cls.DynamoNode()
     a = cls.DynamoClientNode('a')
     a.put('K1', None, 1)
     # Fail the second node in the preference list
     pref_list = cls.DynamoNode.chash.find_nodes('K1', 3)[0]
     Framework.schedule(1)
     pref_list[1].fail()
     Framework.schedule()
     a.get('K1')
     Framework.schedule()
     print History.ladder()
开发者ID:TaoZong,项目名称:Python,代码行数:15,代码来源:test_dynamo.py

示例14: test_partition_restore

# 需要导入模块: from history import History [as 别名]
# 或者: from history.History import ladder [as 别名]
    def test_partition_restore(self):
        dynamomessages._show_metadata = True
        all_nodes = self.partition()
        self.partition_repair()
        from_line = len(History.history)

        # Put a new value, which coalesces
        a = Node.node['a']
        getrsp = a.last_msg
        a.put('K1', getrsp.metadata, 101)
        Framework.schedule(timers_to_process=0)

        # Display, tweaking ordering of nodes so partition is in the middle
        print History.ladder(force_include=all_nodes, start_line=from_line, spacing=16, key=lambda x: ' ' if x.name == 'b' else x.name)
        dynamomessages._show_metadata = False
开发者ID:TaoZong,项目名称:Python,代码行数:17,代码来源:test_dynamo.py

示例15: test_metadata_simple_fail

# 需要导入模块: from history import History [as 别名]
# 或者: from history.History import ladder [as 别名]
 def test_metadata_simple_fail(self):
     """Show a vector clock not mattering on simple failures"""
     dynamomessages._show_metadata = True
     (a, pref_list) = self.get_put_get_put()
     coordinator = pref_list[0]
     self.get_put_put(a, coordinator)
     from_line = len(History.history)
     metadata = [a.last_msg.metadata]  # PutRsp has a single VectorClock
     # Fail the coordinator
     coordinator.fail()
     # Send in another put
     a.put('K1', metadata, 11, destnode=pref_list[1])
     Framework.schedule(timers_to_process=0)
     # Send in a get
     a.get('K1', destnode=pref_list[1])
     Framework.schedule(timers_to_process=0)
     print History.ladder(force_include=pref_list, start_line=from_line, spacing=16)
     dynamomessages._show_metadata = False
开发者ID:TaoZong,项目名称:Python,代码行数:20,代码来源:test_dynamo.py


注:本文中的history.History.ladder方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。