我位于包含我的 Python (2.7) 类的目录中的虚拟机上。我正在尝试将类的实例pickle 到HDFS 中的目录中。
我正在尝试做一些事情:
import pickle
my_obj = MyClass() # the class instance that I want to pickle
with open('hdfs://domain.example.com/path/to/directory/') as hdfs_loc:
pickle.dump(my_obj, hdfs_loc)
Run Code Online (Sandbox Code Playgroud)
根据我所做的研究,我认为像蛇咬伤这样的东西可能会有所帮助......但是有人有更具体的建议吗?