def delete_from_chunk_servers(self, file):
if file.type == NodeType.directory:
for c in list(file.children):
self.delete_from_chunk_servers(c)
else:
print('Start delete file', file.get_full_path())
for f_path, servers in file.chunks.items():
for cs in servers:
try:
cl = ServerProxy(cs)
print('Send delete', f_path, 'to', cs)
cl.delete_chunk(f_path)
except:
print('Failed to delete', f_path, 'from', cs)
# get file\directory info by given path
# path format: /my_dir/index/some.file
# response format:
# { 'status': Status.ok
# 'type': NodeType.type
# 'path': '/my_dir/index/some.file' - full path for directory
# 'size': 2014 - size in bytes
# 'chunks': {
# '/my_dir/index/some.file_0': cs-2
# }
评论列表
文章目录