You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/main/asciidoc/_chapters/snapshot_scanner.adoc
+20-15Lines changed: 20 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,7 +31,7 @@
31
31
32
32
In HBase, a scan of a table costs server-side HBase resources reading, formating, and returning data back to the client.
33
33
Luckily, HBase provides a TableSnapshotScanner and TableSnapshotInputFormat (introduced by link:https://issues.apache.org/jira/browse/HBASE-8369[HBASE-8369]),
34
-
which scan snapshot the HBase-written HFiles directly in the HDFS filesystem completely by-passing hbase. This access mode
34
+
which can scan HBase-written HFiles directly in the HDFS filesystem completely by-passing hbase. This access mode
35
35
performs better than going via HBase and can be used with an offline HBase with in-place or exported
36
36
snapshot HFiles.
37
37
@@ -41,14 +41,14 @@ To read HFiles directly, the user must have sufficient permissions to access sna
41
41
42
42
TableSnapshotScanner provides a means for running a single client-side scan over snapshot files.
43
43
When using TableSnapshotScanner, we must specify a temporary directory to copy the snapshot files into.
44
-
The client user should have write permissions to this directory, and it should not be a subdirectory of
44
+
The client user should have write permissions to this directory, and the dir should not be a subdirectory of
45
45
the hbase.rootdir. The scanner deletes the contents of the directory once the scanner is closed.
46
46
47
47
.Use TableSnapshotScanner
48
48
====
49
49
[source,java]
50
50
----
51
-
Path restoreDir = new Path("XX"); // restore dir should not be a subdirectory HBase hbase.rootdir
51
+
Path restoreDir = new Path("XX"); // restore dir should not be a subdirectory of hbase.rootdir
52
52
Scan scan = new Scan();
53
53
try (TableSnapshotScanner scanner = new TableSnapshotScanner(conf, restoreDir, snapshotName, scan)) {
54
54
Result result = scanner.next();
@@ -61,14 +61,14 @@ try (TableSnapshotScanner scanner = new TableSnapshotScanner(conf, restoreDir, s
61
61
====
62
62
63
63
=== TableSnapshotInputFormat
64
-
TableSnapshotInputFormat provide a way to scan over snapshot files in a MapReduce job.
64
+
TableSnapshotInputFormat provides a way to scan over snapshot HFiles in a MapReduce job.
65
65
66
66
.Use TableSnapshotInputFormat
67
67
====
68
68
[source,java]
69
69
----
70
70
Job job = new Job(conf);
71
-
Path restoreDir = new Path("XX"); // restore dir should not be a subdirectory HBase rootdir
71
+
Path restoreDir = new Path("XX"); // restore dir should not be a subdirectory of hbase.rootdir
Generally, only the HBase owner or the HDFS admin have the permission to access HFiles.
79
79
80
-
link:https://issues.apache.org/jira/browse/HBASE-18659[HBASE-18659] use HDFS ACLs to make HBase granted user have the permission to access the snapshot files.
80
+
link:https://issues.apache.org/jira/browse/HBASE-18659[HBASE-18659] uses HDFS ACLs to make HBase granted user have permission to access snapshot files.
* Modify table scheme to enable this feature for a specified table, this config is
122
-
false by default for every table, this means the HBase granted acls will not be synced to HDFS
122
+
false by default for every table, this means the HBase granted ACLs will not be synced to HDFS
123
123
----
124
124
alter 't1', CONFIGURATION => {'hbase.acl.sync.to.hdfs.enable' => 'true'}
125
125
----
@@ -137,11 +137,16 @@ HDFS has a config which limits the max ACL entries num for one directory or file
137
137
----
138
138
dfs.namenode.acls.max.entries = 32(default value)
139
139
----
140
-
The 32 entries include four fixed users for each directory or file: owner, group, other and mask. For a directory, the four users contain 8 ACL entries(access and default) and for a file, the four users contain 4 ACL entries(access). This means there are 24 ACL entries left for named users or groups.
140
+
The 32 entries include four fixed users for each directory or file: owner, group, other, and mask.
141
+
For a directory, the four users contain 8 ACL entries(access and default) and for a file, the four
142
+
users contain 4 ACL entries(access). This means there are 24 ACL entries left for named users or groups.
141
143
142
-
Based on this limitation, we can only sync up to 12 HBase granted users' ACLs. This means, if a table enable this feature, then the total users with table, namespace of this table, global READ permission should not be greater than 12.
144
+
Based on this limitation, we can only sync up to 12 HBase granted users' ACLs. This means, if a table
145
+
enables this feature, then the total users with table, namespace of this table, global READ permission
146
+
should not be greater than 12.
143
147
=====
144
148
145
149
=====
146
-
There are some cases that this coprocessor has not handled or could not handle, so the user HDFS ACLs are not syned normally. Such as a reference link to another hfile of other tables.
150
+
There are some cases that this coprocessor has not handled or could not handle, so the user HDFS ACLs
151
+
are not synced normally. It will not make a reference link to another hfile of other tables.
0 commit comments