Java library implementing the access expression DSL which can be used to determine if data is visible to an entity with a set of authorizations. For a conceptual overview of what an access expression is, see the specification document. See the Getting Started section for an example of how to use this java library.
This library provides the same functionality, semantics, and syntax as the Apache Accumulo ColumnVisibility and VisibilityEvaluator classes. This functionality is provided in a standalone java library that has no dependencies (for example no Hadoop, Zookeeper, Thrift, etc dependencies).
The following types constitute the public API of this library. All other types are package private and are not part of the public API.
- Access.
- AuthorizationValidator.
- InvalidAccessExpressionException.
- AccessEvaluator.
- AccessExpression.
- ParsedAccessExpression.
- ExpressionType.
- Authorizations.
Add the library to your CLASSPATH. For Maven, use:
<dependencies>
<dependency>
<groupId>org.apache.accumulo</groupId>
<artifactId>accumulo-access</artifactId>
<version>${version.accumulo-access}</version>
</dependency>
</dependencies>Running the Examples
To run AccessExample,
set the version variable to this project's version and execute:
mvn clean package
java --module-path=modules/core/target/accumulo-access-core-$version.jar:modules/examples/target/accumulo-access-examples-$version.jar --module=org.apache.accumulo.access.examples/org.apache.accumulo.access.examples.AccessExample
java --module-path=modules/core/target/accumulo-access-core-$version.jar:modules/examples/target/accumulo-access-examples-$version.jar --module=org.apache.accumulo.access.examples/org.apache.accumulo.access.examples.AccessExample RED BLUENote that data6 is always returned, because it has no access expression. And
remember, authorizations are case-sensitive.
To run ParseExamples,
set the version variable to this project's version and execute:
mvn clean package
java --module-path=modules/core/target/accumulo-access-core-$version.jar:modules/examples/target/accumulo-access-examples-$version.jar --module=org.apache.accumulo.access.examples/org.apache.accumulo.access.examples.ParseExamplesFor an ANTLRv4 example, see its README.
This project includes JMH Benchmarks. To run them, execute the benchmark profile:
mvn clean verify -Dbenchmark # run all benchmarks; alternatively, use `-Pbenchmark`
mvn clean verify -Dbenchmark=AccessExpressionAntlrBenchmark # run only the Antlr benchmarks
mvn clean verify -Dbenchmark='AccessExpressionBenchmark[.]measure.*Evaluation' # run specific tests matching the pattern
mvn clean verify -Dbenchmark -Dbenchmark.jfr # enable Java Flight Recorder for AccessExpressionBenchmark; use -Dbenchmark.jfr.outputDir=/path/to/outputLocation