from hdfs import Config
client = Config().get_client()
'''
list_file = client.list('/data01')
print(list_file)
with client.read('/data01/README.txt', chunk_size=1280) as reader:
for chunk in reader:
print(chunk.decode().replace(' ', '\n '))
'''
with open('/root/docu/nginx-access.log') as opener, client.write('/data01/nginx.log') as writer:
for line in opener:
writer.write(bytes(line, encoding='utf-8'))