$ hadoop fs -rmr /user/iteblog/test.txt
Moved: 'hdfs://iteblogcluster/user/iteblog/test.txt' to trash at: hdfs://iteblogcluster/user/iteblog/.Trash/Current
$ hadoop fs -ls /user/iteblog/.Trash/Current/user/iteblog
-rw-r--r-- 3 iteblog iteblog 103 2017-05-15 17:24 /user/iteblog/.Trash/Current/user/iteblog/test.txt
$ hadoop fs -mv /user/iteblog/.Trash/Current/user/iteblog/test.txt /user/iteblog/
$ hadoop fs -ls /user/iteblog/test.txt
-rw-r--r-- 3 iteblog iteblog 103 2017-05-15 17:24 test.txt
<property>
<name>fs.trash.interval</name>
<value>1440</value>
<description>
Number of minutes after which the checkpoint gets deleted. If zero, the trash feature is disabled. This option may
be configured both on the server and the client. If trash is disabled server side then the client side configuration
is checked. If trash is enabled on the server side then the value configured on the server is used and the client
configuration value is ignored.
</description>
</property>
$ hadoop fs -mkdir /user/iteblog/important/
$ echo "important data" | hadoop fs -put - /user/iteblog/important/important-file.txt
$ hadoop fs -cat /user/iteblog/important/important-file.txt
important data
$ hadoop dfsadmin -allowSnapshot /user/iteblog/important
$ hadoop fs -createSnapshot /user/iteblog/important important-snapshot
$ hadoop fs -rm -r /user/iteblog/important/important-file.txt
$ hadoop fs -ls /user/iteblog/important/.snapshot/
$ hadoop fs -cp /user/iteblog/important/.snapshot/important-snapshot/important-file.txt /user/iteblog/important/
$ hadoop fs -cat /user/iteblog/important/important-file.txt
important data
$ hadoop fs -rmr -skipTrash /user/iteblog/important-file.txt
$ hdfs oev -i edits_inprogress_0000000000000001512 -o edits_inprogress_0000000000000001512.xml
<RECORD>
<OPCODE>OP_DELETE</OPCODE>
<DATA>
<TXID>1624</TXID>
<LENGTH>0</LENGTH>
<PATH>/user/iteblog/important-file.txt</PATH>
<TIMESTAMP>1515724198362</TIMESTAMP>
<RPC_CLIENTID>34809cac-a89f-4113-98b5-10c54d7aac1a</RPC_CLIENTID>
<RPC_CALLID>1</RPC_CALLID>
</DATA>
</RECORD>
$ hdfs oev -i edits_inprogress_0000000000000001512.xml -o edits_inprogress_0000000000000001512 -p binary
免责申明:
本文系转载,版权归原作者所有,如若侵权请联系我们进行删除!
《数据治理行业实践白皮书》下载地址:https://fs80.cn/4w2atu
《数栈V6.0产品白皮书》下载地址:https://fs80.cn/cw0iw1
想了解或咨询更多有关袋鼠云大数据产品、行业解决方案、客户案例的朋友,浏览袋鼠云官网:https://www.dtstack.com/?src=bbs
同时,欢迎对大数据开源项目有兴趣的同学加入「袋鼠云开源框架钉钉技术群」,交流最新开源技术信息,群号码:30537511,项目地址:https://github.com/DTStack