Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 5 additions & 20 deletions docs/classpath.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,32 +17,16 @@ limitations under the License.
# Apache Accumulo Classpath Example

This example shows how to use per table classpaths. The example leverages a
test jar which contains a Filter that suppresses rows containing "foo". The
example shows copying the FooFilter.jar into HDFS and then making an Accumulo
table reference that jar. For this example, a directory, `/user1/lib`, is
assumed to exist in HDFS.

Create `/user1/lib` in HDFS if it does not exist.

hadoop fs -mkdir -p /user1/lib

Execute the following command in the shell. Note that the `FooFilter.jar`
is located within the Accumulo source distribution.

$ hadoop fs -copyFromLocal /path/to/accumulo/test/src/main/resources/org/apache/accumulo/test/FooFilter.jar /user1/lib

Execute following in Accumulo shell to setup classpath context

root@uno> config -s general.vfs.context.classpath.cx1=hdfs://<namenode host>:<namenode port>/user1/lib/[^.].*.jar
test jar which contains a Filter that suppresses rows containing "foo".
Comment thread
DomGarguilo marked this conversation as resolved.
Outdated

Create a namespace and table

root@uno> createnamespace examples
root@uno> createtable examples.nofoo

The following command makes this table use the configured classpath context
The following command makes this table use the configured classpath context to `FooFilter.jar`

root@uno examples.nofoo> config -t examples.nofoo -s table.class.loader.context=cx1
root@uno examples.nofoo> config -t examples.nofoo -s table.class.loader.context=file://<your-root-directory>/github/accumulo/test/src/main/resources/org/apache/accumulo/test/FooFilter.jar
Comment thread
Amemeda marked this conversation as resolved.
Outdated

The following command configures an iterator that's in FooFilter.jar

Expand All @@ -66,7 +50,8 @@ use cx1.
root@uno examples.nofootwo> setiter -n foofilter -p 10 -scan -minc -majc -class org.apache.accumulo.test.FooFilter
2013-05-03 12:49:35,943 [shell.Shell] ERROR: org.apache.accumulo.shell.ShellCommandException: Command could
not be initialized (Unable to load org.apache.accumulo.test.FooFilter; class not found.)
root@uno examples.nofootwo> config -t examples.nofootwo -s table.class.loader.context=cx1
root@uno examples.nofootwo> config -t examples.nofootwo -s table.class.loader.context=file://<your-root-directory>/github/accumulo/test/src/main/resources/org/apache/accumulo/test/FooFilter.jar

root@uno examples.nofootwo> setiter -n foofilter -p 10 -scan -minc -majc -class org.apache.accumulo.test.FooFilter
Filter accepts or rejects each Key/Value pair
----------> set FooFilter parameter negate, default false keeps k/v that pass accept method, true rejects k/v that pass accept method: false
Expand Down
Loading