在java spark代码中有一个二进制对象。我们希望将其保存为hadoop目录。我们怎么能这样呢。在纯java中,我们执行以下操作
File oldFile = new File("C:\\Documents\\obj.binary");
oldFile.delete();
File newFile = new File("C:\\Documents\\obj.binary");
FileOutputStream fout = new FileOutputStream(newFile);
ObjectOutputStream Objso = new ObjectOutputStream(fout);
Objso.writeObject(model);
Objso.flush();
Objso.close();
我怎样才能在hadoop(sparkjava)中做到这一点。
我们有Hadoop2.6.2,spark 1.6.1
谢谢
巴拉
暂无答案!
目前还没有任何答案,快来回答吧!