本文整理汇总了Python中framework.Framework.clearBlock方法的典型用法代码示例。如果您正苦于以下问题:Python Framework.clearBlock方法的具体用法?Python Framework.clearBlock怎么用?Python Framework.clearBlock使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类framework.Framework
的用法示例。
在下文中一共展示了Framework.clearBlock方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: rcv_pingrsp
# 需要导入模块: from framework import Framework [as 别名]
# 或者: from framework.Framework import clearBlock [as 别名]
def rcv_pingrsp(self, pingmsg):
# Remove all instances of recovered node from failed node list
recovered_node = pingmsg.from_node
while recovered_node in self.failed_nodes:
self.failed_nodes.remove(recovered_node)
Framework.clearBlock(recovered_node)
if recovered_node in self.pending_handoffs:
for key in self.pending_handoffs[recovered_node]:
#print 'recovery ---------------------------------'
# Send our latest value for this key
(value, metadata) = self.retrieve(key)
putmsg = PutReq(self, recovered_node, key, value, metadata)
Framework.send_message(putmsg)
#print 'schedule'
Framework.schedule(timers_to_process=0)
del self.pending_handoffs[recovered_node]
示例2: recovery
# 需要导入模块: from framework import Framework [as 别名]
# 或者: from framework.Framework import clearBlock [as 别名]
def recovery(self, node):
# Remove all instances of recovered node from failed node list
#print 'recover+++++++++++++++++++++++++++'
recovered_node = node
while recovered_node in self.failed_nodes:
self.failed_nodes.remove(recovered_node)
Framework.clearBlock(recovered_node)
if recovered_node in self.pending_handoffs:
for key in self.pending_handoffs[recovered_node]:
#print 'recovery ---------------------------------'
# Send our latest value for this key
(value, metadata) = self.retrieve(key)
putmsg = PutReq(self.addr, recovered_node, key, value, metadata)
Framework.send_message(putmsg)
Framework.schedule()
del self.pending_handoffs[recovered_node]