file write to hdfs 본문

Programming/Hadoop

file write to hdfs

halatha 2013. 9. 13. 18:15

어떤 size 단위로 hdfs에 file write을 하는 경우 FSDataOutputStream 사용(http://wiki.apache.org/hadoop/HadoopDfsReadWriteExample)


FileSystem#append를 사용하는 건 아직 불안정하다고 함. Xmx option을 사용해도 조금 더 오래 동작하다가 오류 발생 http://stackoverflow.com/questions/15609909/error-java-heap-space


StringBuffer의 append로 String을 모아 일정 size를 넘으면 한 번 file write을 하고, 기존의 object를 재활용하는 방식을 했더니 StringBuffer에서 heap OutOfMemory가 발생

sb.length(0)를 사용했지만 소용 없음 http://stackoverflow.com/questions/2242471/java-clearing-the-string-buffer-after-loop

Comments