quixey / dragon-oss

HDFS Driver for Aliyun's Open Storage Service
Apache License 2.0
7 stars 1 forks source link

How to use dragon oss to copy file from HDFS to OSS? #2

Closed judechen closed 9 years ago

judechen commented 9 years ago

Could you please provide sample code to copy file from HDFS to OSS?

wisematthew commented 9 years ago

from the command line:

hdfs dfs -cp hdfs:///path/to/file oss://bucket/path/

judechen commented 9 years ago

How to do it in java code?

wisematthew commented 9 years ago

Dragon is an implementation of the Hadoop Filesystem for OSS. You can copy to/from oss the same way you access hdfs in Java. Use the oss scheme instead of the hdfs scheme when specifying paths.

https://hadoop.apache.org/docs/current/api/org/apache/hadoop/fs/FileSystem.html