HBASE 知识整理

HBase Snapshot 之后HDFS目录结构变化

2019-12-19  本文已影响0人  步闲

Snapshot 之前结构请参考:HBase新建表后目录结构
Snapshot 我们看一下:

$ hdfs dfs -ls /apps/hbase/data/.hbase-snapshot
Found 2 items
drwxr-xr-x   - hbase hdfs          0 2019-12-19 15:34 /apps/hbase/data/.hbase-snapshot/.tmp
drwxr-xr-x   - hbase hdfs          0 2019-12-19 15:34 /apps/hbase/data/.hbase-snapshot/dalishen_test_zpb_snapshot
$ hdfs dfs -ls /apps/hbase/data/.hbase-snapshot/dalishen_test_zpb_snapshot
Found 2 items
-rw-r--r--   3 hbase hdfs         58 2019-12-19 15:34 /apps/hbase/data/.hbase-snapshot/dalishen_test_zpb_snapshot/.snapshotinfo
-rw-r--r--   3 hbase hdfs       2043 2019-12-19 15:34 /apps/hbase/data/.hbase-snapshot/dalishen_test_zpb_snapshot/data.manifest

其中:
.snapshotinfo: 基本信息,包含Snapshot的表名和Snapshot名。
data.manifest:元数据信息,HFile名及startkey/endkey,表名。
思考:为什么不需要RegionName呢?

$ hdfs dfs -cat /apps/hbase/data/.hbase-snapshot/dalishen_test_zpb_snapshot/.snapshotinfo

dalishen_test_zpb_snapshotdalishen:test_zpb¥ᑨ󫞁(
$ hdfs dfs -cat /apps/hbase/data/.hbase-snapshot/dalishen_test_zpb_snapshot/data.manifest

¡
                                                                                                                                                                                            dalishetest_zpb
IS_METAfalse
f

BLOOMFILTERROW                                                                                                                                                                              VERSIONS1
    IN_MEMORYfalse
EEP_DELETED_CELLSFALSE
DATA_BLOCK_ENCODING FAST_DIFF
TTL
2147483647

COMPRESSIONSNAPPY

MIN_VERSIONS0

BLOCKCACHEtrue
    BLOCKSIZE65536
REPLICATION_SCOPE02½侑˭                                                                                                                                                                     dalishetest_zpb0e"0f(08
f2½侑˭                                                                                                                                                                                      dalishetest_zpb1f"20(08
f2½侑˭                                                                                                                                                                                      dalishetest_zpb18"19(08
f2½侑˭                                                                                                                                                                                      dalishetest_zpb1c"1d(08
f2½侑˭                                                                                                                                                                                      dalishetest_zpb1d"1e(08
f2½侑˭                                                                                                                                                                                      dalishetest_zpb06"07(08
f2½侑˭                                                                                                                                                                                      dalishetest_zpb14"15(08
f2½侑˭                                                                                                                                                                                      dalishetest_zpb15"16(08
f2½侑˭                                                                                                                                                                                      dalishetest_zpb04"05(08
f2½侑˭                                                                                                                                                                                      dalishetest_zpb0c"0d(08
f2½侑˭                                                                                                                                                                                      dalishetest_zpb03"04(08
f2½侑˭                                                                                                                                                                                      dalishetest_zpb08"09(08
f2½侑˭                                                                                                                                                                                      dalishetest_zpb12"13(08
f2½侑˭                                                                                                                                                                                      dalishetest_zpb0a"0b(08
f2½侑˭                                                                                                                                                                                      dalishetest_zpb1e"1f(08
f2½侑˭                                                                                                                                                                                      dalishetest_zpb1b"1c(08
f2½侑˭                                                                                                                                                                                      dalishetest_zpb01"02(08
f2½侑˭                                                                                                                                                                                      dalishetest_zpb17"18(08
f2½侑˭                                                                                                                                                                                      dalishetest_zpb19"1a(08
f0½侑˭                                                                                                                                                                                      dalishetest_zpb20"(08
f2½侑˭                                                                                                                                                                                      dalishetest_zpb16"17(08
f2½侑˭                                                                                                                                                                                      dalishetest_zpb07"08(08
f2½侑˭                                                                                                                                                                                      dalishetest_zpb09"0a(08
f2½侑˭                                                                                                                                                                                      dalishetest_zpb11"12(08
f2½侑˭                                                                                                                                                                                      dalishetest_zpb0b"0c(08
f2½侑˭                                                                                                                                                                                      dalishetest_zpb1a"1b(08
f2½侑˭                                                                                                                                                                                      dalishetest_zpb02"03(08
f2½侑˭                                                                                                                                                                                      dalishetest_zpb05"06(08
f2½侑˭                                                                                                                                                                                      dalishetest_zpb0d"0e(08
f2½侑˭                                                                                                                                                                                      dalishetest_zpb10"11(08
f2½侑˭                                                                                                                                                                                      dalishetest_zpb13"14(08
f0½侑˭                                                                                                                                                                                      dalishetest_zpb"01(08
fY½侑˭                                                                                                                                                                                      dalishetest_zpb0f"10(08*
f%
 eb701646aa20492b812283272edaa636´&

现在我们基于快照克隆一张表,看下HDFS变化。

hbase(main):053:0> clone_snapshot 'dalishen_test_zpb_snapshot', 'dalishen:test_zpb_clone', {RESTORE_ACL=>true}
0 row(s) in 0.7060 seconds

如下:

$ hdfs dfs -ls /apps/hbase/data/data/dalishen/test_zpb_clone/*
Found 1 items
-rw-r--r--   3 hbase hdfs        299 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/.tabledesc/.tableinfo.0000000001
Found 3 items
-rw-r--r--   3 hbase hdfs         54 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/062130ce9f09075f07ea80ece94c78f1/.regioninfo
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/062130ce9f09075f07ea80ece94c78f1/f
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/062130ce9f09075f07ea80ece94c78f1/recovered.edits
Found 3 items
-rw-r--r--   3 hbase hdfs         52 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/071f064fb235b0d9f8cc71e3b5cb6b27/.regioninfo
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/071f064fb235b0d9f8cc71e3b5cb6b27/f
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/071f064fb235b0d9f8cc71e3b5cb6b27/recovered.edits
Found 3 items
-rw-r--r--   3 hbase hdfs         54 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/12f712f7bab2a40436d2f6e27411cdd3/.regioninfo
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/12f712f7bab2a40436d2f6e27411cdd3/f
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/12f712f7bab2a40436d2f6e27411cdd3/recovered.edits
Found 3 items
-rw-r--r--   3 hbase hdfs         54 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/196f966f9dbd3467ac877178b77f9035/.regioninfo
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/196f966f9dbd3467ac877178b77f9035/f
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/196f966f9dbd3467ac877178b77f9035/recovered.edits
Found 3 items
-rw-r--r--   3 hbase hdfs         54 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/26fcca678038164520c6cfeffc4b46c0/.regioninfo
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/26fcca678038164520c6cfeffc4b46c0/f
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/26fcca678038164520c6cfeffc4b46c0/recovered.edits
Found 3 items
-rw-r--r--   3 hbase hdfs         54 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/2734ca51507c7d3444882f882bbdb70c/.regioninfo
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/2734ca51507c7d3444882f882bbdb70c/f
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/2734ca51507c7d3444882f882bbdb70c/recovered.edits
Found 3 items
-rw-r--r--   3 hbase hdfs         54 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/2c0d61a9cff60ac7f9587af4e20b781a/.regioninfo
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/2c0d61a9cff60ac7f9587af4e20b781a/f
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/2c0d61a9cff60ac7f9587af4e20b781a/recovered.edits
Found 3 items
-rw-r--r--   3 hbase hdfs         54 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/33c1f98a1a215d9f9eee0b702c36e139/.regioninfo
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/33c1f98a1a215d9f9eee0b702c36e139/f
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/33c1f98a1a215d9f9eee0b702c36e139/recovered.edits
Found 3 items
-rw-r--r--   3 hbase hdfs         54 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/3d280a03825dea40cdc974fc9a19e33e/.regioninfo
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/3d280a03825dea40cdc974fc9a19e33e/f
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/3d280a03825dea40cdc974fc9a19e33e/recovered.edits
Found 3 items
-rw-r--r--   3 hbase hdfs         54 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/4e71d68616c8e88e850d0b6af5c278f6/.regioninfo
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/4e71d68616c8e88e850d0b6af5c278f6/f
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/4e71d68616c8e88e850d0b6af5c278f6/recovered.edits
Found 3 items
-rw-r--r--   3 hbase hdfs         54 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/5483cfde3282b62d23d78c7c45325889/.regioninfo
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/5483cfde3282b62d23d78c7c45325889/f
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/5483cfde3282b62d23d78c7c45325889/recovered.edits
Found 3 items
-rw-r--r--   3 hbase hdfs         54 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/5725ba16d334145074422eb7c0c7d50a/.regioninfo
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/5725ba16d334145074422eb7c0c7d50a/f
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/5725ba16d334145074422eb7c0c7d50a/recovered.edits
Found 3 items
-rw-r--r--   3 hbase hdfs         54 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/57f3110d810aebcf145dc73d8c6d1e2e/.regioninfo
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/57f3110d810aebcf145dc73d8c6d1e2e/f
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/57f3110d810aebcf145dc73d8c6d1e2e/recovered.edits
Found 3 items
-rw-r--r--   3 hbase hdfs         54 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/5f117c3642133f7d321c72d0be543283/.regioninfo
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/5f117c3642133f7d321c72d0be543283/f
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/5f117c3642133f7d321c72d0be543283/recovered.edits
Found 3 items
-rw-r--r--   3 hbase hdfs         54 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/618a60376b40d24c1578b612f00efd1d/.regioninfo
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/618a60376b40d24c1578b612f00efd1d/f
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/618a60376b40d24c1578b612f00efd1d/recovered.edits
Found 3 items
-rw-r--r--   3 hbase hdfs         54 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/62b94b675dad9fb8e313a15c53356b2e/.regioninfo
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/62b94b675dad9fb8e313a15c53356b2e/f
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/62b94b675dad9fb8e313a15c53356b2e/recovered.edits
Found 3 items
-rw-r--r--   3 hbase hdfs         52 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/65c0a7f7accf895588c1aa86d88e924e/.regioninfo
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/65c0a7f7accf895588c1aa86d88e924e/f
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/65c0a7f7accf895588c1aa86d88e924e/recovered.edits
Found 3 items
-rw-r--r--   3 hbase hdfs         54 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/66641f6f5f911d83bbadda04a6ebc0a8/.regioninfo
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/66641f6f5f911d83bbadda04a6ebc0a8/f
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/66641f6f5f911d83bbadda04a6ebc0a8/recovered.edits
Found 3 items
-rw-r--r--   3 hbase hdfs         54 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/81401ae4a97cb5345d98426e29313679/.regioninfo
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/81401ae4a97cb5345d98426e29313679/f
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/81401ae4a97cb5345d98426e29313679/recovered.edits
Found 3 items
-rw-r--r--   3 hbase hdfs         54 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/825d0e618559a0dbe596280040ec7a7e/.regioninfo
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/825d0e618559a0dbe596280040ec7a7e/f
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/825d0e618559a0dbe596280040ec7a7e/recovered.edits
Found 3 items
-rw-r--r--   3 hbase hdfs         54 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/92e64669dabf10d753f76e21429f8eda/.regioninfo
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/92e64669dabf10d753f76e21429f8eda/f
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/92e64669dabf10d753f76e21429f8eda/recovered.edits
Found 3 items
-rw-r--r--   3 hbase hdfs         54 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/934d58374e05002bc20e4f6e0b5230ec/.regioninfo
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/934d58374e05002bc20e4f6e0b5230ec/f
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/934d58374e05002bc20e4f6e0b5230ec/recovered.edits
Found 3 items
-rw-r--r--   3 hbase hdfs         54 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/ae50072de299307b4e69cf42dffbe912/.regioninfo
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/ae50072de299307b4e69cf42dffbe912/f
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/ae50072de299307b4e69cf42dffbe912/recovered.edits
Found 3 items
-rw-r--r--   3 hbase hdfs         54 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/b61b5bec5b6a9fd6f5de95d1fb35a80f/.regioninfo
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/b61b5bec5b6a9fd6f5de95d1fb35a80f/f
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/b61b5bec5b6a9fd6f5de95d1fb35a80f/recovered.edits
Found 3 items
-rw-r--r--   3 hbase hdfs         54 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/c26ad2fdabd9c1cf115ecce00ecbcc7c/.regioninfo
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/c26ad2fdabd9c1cf115ecce00ecbcc7c/f
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/c26ad2fdabd9c1cf115ecce00ecbcc7c/recovered.edits
Found 3 items
-rw-r--r--   3 hbase hdfs         54 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/c79e59d0d043d93b452179ba88757968/.regioninfo
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/c79e59d0d043d93b452179ba88757968/f
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/c79e59d0d043d93b452179ba88757968/recovered.edits
Found 3 items
-rw-r--r--   3 hbase hdfs         54 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/cdb10f37406cb3b6fa2f250619dc19fb/.regioninfo
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/cdb10f37406cb3b6fa2f250619dc19fb/f
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/cdb10f37406cb3b6fa2f250619dc19fb/recovered.edits
Found 3 items
-rw-r--r--   3 hbase hdfs         54 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/d100df4b4d89914e5e15dba90da812b8/.regioninfo
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/d100df4b4d89914e5e15dba90da812b8/f
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/d100df4b4d89914e5e15dba90da812b8/recovered.edits
Found 3 items
-rw-r--r--   3 hbase hdfs         54 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/d4c8c8555fe04bc284486692628d5eec/.regioninfo
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/d4c8c8555fe04bc284486692628d5eec/f
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/d4c8c8555fe04bc284486692628d5eec/recovered.edits
Found 3 items
-rw-r--r--   3 hbase hdfs         54 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/d7348d1cfbe543958ecafa5d2493bcad/.regioninfo
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/d7348d1cfbe543958ecafa5d2493bcad/f
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/d7348d1cfbe543958ecafa5d2493bcad/recovered.edits
Found 3 items
-rw-r--r--   3 hbase hdfs         54 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/f3bf3d7c47a8989386cd5ef55703013f/.regioninfo
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/f3bf3d7c47a8989386cd5ef55703013f/f
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/f3bf3d7c47a8989386cd5ef55703013f/recovered.edits
Found 3 items
-rw-r--r--   3 hbase hdfs         54 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/f5398fc32a3cde6d683034d22f52ee8b/.regioninfo
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/f5398fc32a3cde6d683034d22f52ee8b/f
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/f5398fc32a3cde6d683034d22f52ee8b/recovered.edits
Found 3 items
-rw-r--r--   3 hbase hdfs         54 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/f6fdbaec9ad0b0170340a01eacf7aa23/.regioninfo
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/f6fdbaec9ad0b0170340a01eacf7aa23/f
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/f6fdbaec9ad0b0170340a01eacf7aa23/recovered.edits

在原表进行Compaction前会将原始数据表复制到archive目录下。

$ hdfs dfs -ls /apps/hbase/data/archive/data/dalishen/test_zpb/dc12fd61f4905fe26a83297e5929e486/f
Found 1 items
drwxr-xr-x   - hbase hdfs          0 2019-12-19 17:28 hdfs dfs -cat /apps/hbase/data/archive/data/dalishen/test_zpb/dc12fd61f4905fe26a83297e5929e486/f/.links-eb701646aa20492b812283272edaa636/5f117c3642133f7d321c72d0be543283.dalishen=test_zpb_clone

在原表进行Compaction前或是delete原表前会将原始数据表复制到archive目录下。

hdfs dfs -ls /apps/hbase/data/data/dalishen/test_zpb_clone/*/f/*
-rw-r--r--   3 hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/5f117c3642133f7d321c72d0be543283/f/dalishen=test_zpb=dc12fd61f4905fe26a83297e5929e486-eb701646aa20492b812283272edaa636

此时,只有一个Hfile文件。
重点是:Hfile文件指向了一个引用:dalishen=test_zpb=dc12fd61f4905fe26a83297e5929e486-eb701646aa20492b812283272edaa636

这个过程是不涉及数据拷贝的,只有新表在执行compaction 时才会进行数据迁移,此时引用失效。

删除原表后:

$ hdfs dfs -ls /apps/hbase/data/archive/data/dalishen/test_zpb/*/f/*
Found 1 items
-rw-r--r--   3 hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/archive/data/dalishen/test_zpb/dc12fd61f4905fe26a83297e5929e486/f/.links-eb701646aa20492b812283272edaa636/5f117c3642133f7d321c72d0be543283.dalishen=test_zpb_clone
-rw-r--r--   3 hbase hdfs       4916 2019-12-19 17:51 /apps/hbase/data/archive/data/dalishen/test_zpb/dc12fd61f4905fe26a83297e5929e486/f/eb701646aa20492b812283272edaa636


$ hdfs dfs -ls /apps/hbase/data/data/dalishen/test_zpb_clone/*/f/*
-rw-r--r--   3 hbase hdfs          0 2019-12-19 17:28 /apps/hbase/data/data/dalishen/test_zpb_clone/5f117c3642133f7d321c72d0be543283/f/dalishen=test_zpb=dc12fd61f4905fe26a83297e5929e486-eb701646aa20492b812283272edaa636

新表执行compact操作:

hbase(main):060:0> compact 'dalishen:test_zpb_clone'
0 row(s) in 0.2000 seconds

$ hdfs dfs -ls /apps/hbase/data/data/dalishen/test_zpb_clone/*/f/*
-rw-r--r--   3 hbase hdfs       4916 2019-12-19 18:00 /apps/hbase/data/data/dalishen/test_zpb_clone/5f117c3642133f7d321c72d0be543283/f/c8699d932654490f9c8935c4d3989134

$ hdfs dfs -ls /apps/hbase/data/archive/data/dalishen/test_zpb/*/f/*
-rw-r--r--   3 hbase hdfs       4916 2019-12-19 17:51 /apps/hbase/data/archive/data/dalishen/test_zpb/dc12fd61f4905fe26a83297e5929e486/f/eb701646aa20492b812283272edaa636
上一篇下一篇

猜你喜欢

热点阅读