0
有沒有人有通過駱駝將文件寫入hdfs2的很好的例子?通過駱駝將文件複製到HDFS2不起作用
我嘗試下面的代碼:
import org.apache.camel.CamelContext;
import org.apache.camel.ProducerTemplate;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.impl.DefaultCamelContext;
public final class Main {
private Main() {
}
public static void main(String args[]) throws Exception {
CamelContext context = new DefaultCamelContext();
context.addRoutes(new RouteBuilder() {
public void configure() {
from("file:C:\\FILES\\SRC\\2015-03-31_16-58-56.png?noop=true")
.to("hdfs2://xxxx:9000/testCamel/D2/qwe.png");
//.to("file:C:\\FILES\\OUT");
}
});
//ProducerTemplate template = context.createProducerTemplate();
context.start();
context.stop();
}
}
的文件在HDFS創建,但所有的人都爲空(0字節)。
你可以在你的問題上添加一些細節(通過編輯你的問題)?你是否遇到異常或文件是否被複制? – fxm 2015-04-01 09:47:26
在我的Hadoop文件中創建,但它們是0字節 – Andrey 2015-04-01 09:49:45