Skip to content

Commit

Permalink
HBASE-11533 Asciidoc Proof of Concept
Browse files Browse the repository at this point in the history
  • Loading branch information
Misty Stanley-Jones committed Jan 14, 2015
1 parent 608025a commit 1a21c16
Show file tree
Hide file tree
Showing 69 changed files with 23,681 additions and 104 deletions.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
144 changes: 44 additions & 100 deletions pom.xml
Expand Up @@ -791,15 +791,22 @@
</executions>
<configuration>
<transformationSets>
<!-- For asciidoc -->
<transformationSet>
<!--Reaching up and over into common sub-module for hbase-default.xml-->
<dir>${basedir}/hbase-common/src/main/resources/</dir>
<includes>
<include>hbase-default.xml</include>
</includes>
<stylesheet>${basedir}/src/main/xslt/configuration_to_docbook_section.xsl</stylesheet>
<outputDir>${basedir}/target/docbkx</outputDir>
</transformationSet>
<stylesheet>${basedir}/src/main/xslt/configuration_to_asciidoc_chapter.xsl</stylesheet>
<fileMappers>
<fileMapper implementation="org.codehaus.plexus.components.io.filemappers.RegExpFileMapper">
<pattern>^(.*)\.xml$</pattern>
<replacement>$1.adoc</replacement>
</fileMapper>
</fileMappers>
<outputDir>${basedir}/target/asciidoc</outputDir>
</transformationSet>
</transformationSets>
</configuration>
</plugin>
Expand Down Expand Up @@ -835,84 +842,6 @@
<suppressionsLocation>hbase/checkstyle-suppressions.xml</suppressionsLocation>
</configuration>
</plugin>
<!--Build the documentation. We build it twice. Once as a single page and then
again as multipage.-->
<plugin>
<groupId>com.agilejava.docbkx</groupId>
<artifactId>docbkx-maven-plugin</artifactId>
<version>2.0.15</version>
<inherited>false</inherited>
<dependencies>
<dependency>
<groupId>org.docbook</groupId>
<artifactId>docbook-xml</artifactId>
<version>4.4</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>net.sf.xslthl</groupId>
<artifactId>xslthl</artifactId>
<version>2.1.0</version>
<scope>runtime</scope>
</dependency>
</dependencies>
<configuration>
<highlightSource>1</highlightSource>
<imgSrcPath>images/</imgSrcPath>
<sourceDirectory>${basedir}/src/main/docbkx</sourceDirectory>
<xincludeSupported>true</xincludeSupported>
<useIdAsFilename>true</useIdAsFilename>
<sectionAutolabelMaxDepth>100</sectionAutolabelMaxDepth>
<sectionAutolabel>true</sectionAutolabel>
<htmlStylesheet>css/freebsd_docbook.css</htmlStylesheet>
<sectionLabelIncludesComponentLabel>true</sectionLabelIncludesComponentLabel>
<htmlCustomization>${basedir}/src/main/docbkx/customization.xsl</htmlCustomization>
<tocMaxDepth>2</tocMaxDepth>
<insertXrefPageNumber>yes</insertXrefPageNumber>
<chunkerOutputEncoding>UTF-8</chunkerOutputEncoding>
</configuration>
<executions>
<execution>
<id>multipage</id>
<goals>
<goal>generate-html</goal>
</goals>
<phase>pre-site</phase>
<configuration>
<navigShowtitles>true</navigShowtitles>
<chunkedOutput>true</chunkedOutput>
<targetDirectory>${basedir}/target/docbkx/book</targetDirectory>
<preProcess>
<copy todir="target/docbkx/book/images">
<fileset dir="src/main/site/resources/images/"/>
</copy>
<copy todir="target/docbkx/book/css">
<fileset dir="src/main/site/resources/css/"/>
</copy>
</preProcess>
</configuration>
</execution>
<execution>
<id>onepage</id>
<goals>
<goal>generate-html</goal>
</goals>
<phase>pre-site</phase>
<configuration>
<targetDirectory>${basedir}/target/docbkx/</targetDirectory>
<includes>book.xml</includes>
<preProcess>
<copy todir="target/docbkx/images">
<fileset dir="src/main/site/resources/images/"/>
</copy>
<copy todir="target/docbkx/css">
<fileset dir="src/main/site/resources/css/"/>
</copy>
</preProcess>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
Expand All @@ -937,24 +866,6 @@
</resources>
</configuration>
</execution>
<execution>
<id>copy-docbkx</id>
<goals>
<goal>copy-resources</goal>
</goals>
<phase>site</phase>
<configuration>
<outputDirectory>target/site</outputDirectory>
<resources>
<resource>
<directory>${basedir}/target/docbkx</directory>
<includes>
<include>**/**</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
<execution>
<id>copy-htaccess</id>
<goals>
Expand Down Expand Up @@ -1002,13 +913,44 @@
<artifactId>velocity</artifactId>
<version>1.7</version>
</dependency>
<!-- For building docs from asciidoctor -->
<!--<dependency>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctor-maven-plugin</artifactId>
<version>1.5.2</version>
</dependency>-->
</dependencies>
<configuration>
<siteDirectory>${basedir}/src/main/site</siteDirectory>
<inputEncoding>UTF-8</inputEncoding>
<outputEncoding>UTF-8</outputEncoding>
</configuration>
</plugin>
<!-- For AsciiDoc docs building -->
<plugin>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctor-maven-plugin</artifactId>
<version>1.5.2</version>
<executions>
<execution>
<id>output-html</id>
<goals>
<goal>process-asciidoc</goal>
</goals>
<phase>site</phase>
<configuration>
<imagesDir>./images</imagesDir>
<doctype>book</doctype>
<attributes>
<stylesheet>hbase.css</stylesheet>
</attributes>
<backend>html5</backend>
<sourceHighlighter>coderay</sourceHighlighter>
<outputDirectory>target/site</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
Expand Down Expand Up @@ -2480,6 +2422,8 @@
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<configuration>
<sourceFilesExclude>**/generated</sourceFilesExclude>
<excludePackageNames>org.apache.hadoop.hbase.generated.master</excludePackageNames>
<maxmemory>2048m</maxmemory>
<notimestamp>true</notimestamp>
</configuration>
Expand Down Expand Up @@ -2512,7 +2456,7 @@
<name>User API</name>
<description>The HBase Application Programmer's API</description>
<excludePackageNames>
org.apache.hadoop.hbase.backup*:org.apache.hadoop.hbase.catalog:org.apache.hadoop.hbase.client.coprocessor:org.apache.hadoop.hbase.client.metrics:org.apache.hadoop.hbase.codec*:org.apache.hadoop.hbase.constraint:org.apache.hadoop.hbase.coprocessor.*:org.apache.hadoop.hbase.executor:org.apache.hadoop.hbase.fs:org.apache.hadoop.hbase.generated.*:org.apache.hadoop.hbase.io.hfile.*:org.apache.hadoop.hbase.mapreduce.hadoopbackport:org.apache.hadoop.hbase.mapreduce.replication:org.apache.hadoop.hbase.master.*:org.apache.hadoop.hbase.metrics*:org.apache.hadoop.hbase.migration:org.apache.hadoop.hbase.monitoring:org.apache.hadoop.hbase.p*:org.apache.hadoop.hbase.regionserver.compactions:org.apache.hadoop.hbase.regionserver.handler:org.apache.hadoop.hbase.regionserver.snapshot:org.apache.hadoop.hbase.replication.*:org.apache.hadoop.hbase.rest.filter:org.apache.hadoop.hbase.rest.model:org.apache.hadoop.hbase.rest.p*:org.apache.hadoop.hbase.security.*:org.apache.hadoop.hbase.thrift*:org.apache.hadoop.hbase.tmpl.*:org.apache.hadoop.hbase.tool:org.apache.hadoop.hbase.trace:org.apache.hadoop.hbase.util.byterange*:org.apache.hadoop.hbase.util.test:org.apache.hadoop.hbase.util.vint:org.apache.hadoop.hbase.zookeeper.lock:org.apache.hadoop.metrics2*
org.apache.hadoop.hbase.backup*:org.apache.hadoop.hbase.catalog:org.apache.hadoop.hbase.client.coprocessor:org.apache.hadoop.hbase.client.metrics:org.apache.hadoop.hbase.codec*:org.apache.hadoop.hbase.constraint:org.apache.hadoop.hbase.coprocessor.*:org.apache.hadoop.hbase.executor:org.apache.hadoop.hbase.fs:*.generated.*:org.apache.hadoop.hbase.io.hfile.*:org.apache.hadoop.hbase.mapreduce.hadoopbackport:org.apache.hadoop.hbase.mapreduce.replication:org.apache.hadoop.hbase.master.*:org.apache.hadoop.hbase.metrics*:org.apache.hadoop.hbase.migration:org.apache.hadoop.hbase.monitoring:org.apache.hadoop.hbase.p*:org.apache.hadoop.hbase.regionserver.compactions:org.apache.hadoop.hbase.regionserver.handler:org.apache.hadoop.hbase.regionserver.snapshot:org.apache.hadoop.hbase.replication.*:org.apache.hadoop.hbase.rest.filter:org.apache.hadoop.hbase.rest.model:org.apache.hadoop.hbase.rest.p*:org.apache.hadoop.hbase.security.*:org.apache.hadoop.hbase.thrift*:org.apache.hadoop.hbase.tmpl.*:org.apache.hadoop.hbase.tool:org.apache.hadoop.hbase.trace:org.apache.hadoop.hbase.util.byterange*:org.apache.hadoop.hbase.util.test:org.apache.hadoop.hbase.util.vint:org.apache.hadoop.hbase.zookeeper.lock:org.apache.hadoop.metrics2*
</excludePackageNames>
<!-- switch on dependency-driven aggregation -->
<includeDependencySources>false</includeDependencySources>
Expand Down
133 changes: 133 additions & 0 deletions src/main/asciidoc/_chapters/appendix_acl_matrix.adoc
@@ -0,0 +1,133 @@
////
/**
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
////
[appendix]
[[appendix_acl_matrix]]
== Access Control Matrix
:doctype: book
:numbered:
:toc: left
:icons: font
:experimental:
:toc: left
:source-language: java
The following matrix shows the minimum permission set required to perform operations in HBase.
Before using the table, read through the information about how to interpret it.
.Interpreting the ACL Matrix Table
The following conventions are used in the ACL Matrix table:
=== Scopes
Permissions are evaluated starting at the widest scope and working to the narrowest scope.
A scope corresponds to a level of the data model. From broadest to narrowest, the scopes are as follows:
.Scopes
* Global
* Namespace (NS)
* Table
* Column Family (CF)
* Column Qualifier (CQ)
* Cell
For instance, a permission granted at table level dominates any grants done at the Column Family, Column Qualifier, or cell level. The user can do what that grant implies at any location in the table. A permission granted at global scope dominates all: the user is always allowed to take that action everywhere.
=== Permissions
Possible permissions include the following:
.Permissions
* Superuser - a special user that belongs to group "supergroup" and has unlimited access
* Admin (A)
* Create \(C)
* Write (W)
* Read \(R)
* Execute (X)
For the most part, permissions work in an expected way, with the following caveats:
Having Write permission does not imply Read permission.::
It is possible and sometimes desirable for a user to be able to write data that same user cannot read. One such example is a log-writing process.
The [systemitem]+hbase:meta+ table is readable by every user, regardless of the user's other grants or restrictions.::
This is a requirement for HBase to function correctly.
[code]+CheckAndPut+ and [code]+CheckAndDelete+ operations will fail if the user does not have both Write and Read permission.::
[code]+Increment+ and [code]+Append+ operations do not require Read access.::
The following table is sorted by the interface that provides each operation.
In case the table goes out of date, the unit tests which check for accuracy of permissions can be found in [path]_hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java_, and the access controls themselves can be examined in [path]_hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessController.java_.
.ACL Matrix
[cols="1,1,1,1", frame="all", options="header"]
|===
| Interface | Operation | Minimum Scope | Minimum Permission
| Master | createTable | Global | C
| | modifyTable | Table | A\|C
| | deleteTable | Table | A\|C
| | truncateTable | Table | A\|C
| | addColumn | Table | A\|C
| | modifyColumn | Table | A\|C
| | deleteColumn | Table | A\|C
| | disableTable | Table | A\|C
| | disableAclTable | None | Not allowed
| | enableTable | Table | A\|C
| | move | Global | A
| | assign | Global | A
| | unassign | Global | A
| | regionOffline | Global | A
| | balance | Global | A
| | balanceSwitch | Global | A
| | shutdown | Global | A
| | stopMaster | Global | A
| | snapshot | Global | A
| | clone | Global | A
| | restore | Global | A
| | deleteSnapshot | Global | A
| | createNamespace | Global | A
| | deleteNamespace | Namespace | A
| | modifyNamespace | Namespace | A
| | flushTable | Table | A\|C
| | getTableDescriptors | Global\|Table | A
| | mergeRegions | Global | A
| Region | openRegion | Global | A
| | closeRegion | Global | A
| | stopRegionServer | Global | A
| | rollHLog | Global | A
| | mergeRegions | Global | A
| | flush | Global\|Table | A\|C
| | split | Global\|Table | A
| | compact | Global\|Table | A\|C
| | bulkLoadHFile | Table | W
| | prepareBulkLoad | Table |C
| | cleanupBulkLoad | Table |W
| | checkAndDelete | Table\|CF\|CQ | RW
| | checkAndPut | Table\|CF\|CQ | RW
| | incrementColumnValue | Table\|CF\|CQ | RW
| | scannerClose | Table | R
| | scannerNext | Table | R
| | scannerOpen | Table\|CF\|CQ | R
| Endpoint | invoke | Endpoint | X
| AccessController | grant | Global\|Table\|NS | A
| | revoke | Global\|Table\|NS | A
| | getUserPermissions | Global\|Table\|NS | A
| | checkPermissions | Global\|Table\|NS | A
|===
:numbered:

0 comments on commit 1a21c16

Please sign in to comment.