Avoid checking Accumulo table exists before creation (#74)
authorMark Owens <jmark99@apache.org>
Fri, 7 May 2021 12:16:44 +0000 (08:16 -0400)
committerGitHub <noreply@github.com>
Fri, 7 May 2021 12:16:44 +0000 (08:16 -0400)
commitef2e04e78cc08ce1d1a4b3f67947e5fe1f874c89
tree91bf6fb821f788a680852c2501991bc444afae11
parentaed79ea9edb739c90805202314fadb3455a644e2
Avoid checking Accumulo table exists before creation (#74)

The initial focus of this ticket was to remove the check for table existence and just create and catch and then ignore TableExistsException instead.

After initial work (see previous comments), it was decided to update the code to work more realistically. Primarily, do not ignore the exceptions and at least alert the user that the table existed prior and let the user decide whether to remove the table and re-run the example.

Another concern was the fear of interfering with an existing table on a users system.

The primary changes then became to update table creation and provide feedback via logs to situations where prior tables already existed. In order to prevent table name collision, the examples were modified to make use of Accumulo namespaces. The classes and documentation were update to create an 'examples' namespace wherein all the table are created.

Along the way several other smaller tweaks were made also. Some of these are listed below.

* The process of table creation was re-factored into a <code>Commons</code> class. All examples now use a method in that class to create both the namespace and tablename. A couple of constants used throughout the example classes are defined there as well.
* The bloom classes now have a couple of methods that helped to remove some redundant code.
* An unneeded import was removed from the CharacterHistogram.java class.
* Most of the use of System.out.println was replace with logging instead.
* Update SequentialBatchWriter to exit if required table for scanning does not exist.
* A majority of the documentation was updated to included the creation of the necessary 'examples' namespace.
* The config command was updated to use the table.class.loader.context rather than the deprecated table.classpath.context.
* Update the constraints example to work with the new location of the contraints classes in Accumulo.
* Update filedata documentation to note that the ChunkCombiner class must be avaiable in the accumulo lib directory or on the classpath somewhere in order to scan the create examples.dataTable.

Closes #13
54 files changed:
.gitignore
docs/batch.md
docs/bloom.md
docs/bulkIngest.md
docs/classpath.md
docs/combiner.md
docs/compactionStrategy.md
docs/constraints.md
docs/deleteKeyValuePair.md
docs/dirlist.md
docs/export.md
docs/filedata.md
docs/filter.md
docs/helloworld.md
docs/isolation.md
docs/regex.md
docs/reservations.md
docs/rgbalancer.md
docs/rowhash.md
docs/sample.md
docs/shard.md
docs/tabletofile.md
docs/terasort.md
docs/visibility.md
docs/wordcount.md
spark/src/main/java/org/apache/accumulo/spark/CopyPlus5K.java
src/main/java/org/apache/accumulo/examples/Common.java [new file with mode: 0644]
src/main/java/org/apache/accumulo/examples/bloom/BloomBatchScanner.java
src/main/java/org/apache/accumulo/examples/bloom/BloomCommon.java [new file with mode: 0644]
src/main/java/org/apache/accumulo/examples/bloom/BloomFilters.java
src/main/java/org/apache/accumulo/examples/bloom/BloomFiltersNotFound.java
src/main/java/org/apache/accumulo/examples/client/RandomBatchScanner.java
src/main/java/org/apache/accumulo/examples/client/ReadWriteExample.java
src/main/java/org/apache/accumulo/examples/client/RowOperations.java
src/main/java/org/apache/accumulo/examples/client/SequentialBatchWriter.java
src/main/java/org/apache/accumulo/examples/client/TracingExample.java
src/main/java/org/apache/accumulo/examples/combiner/StatsCombiner.java
src/main/java/org/apache/accumulo/examples/constraints/AlphaNumKeyConstraint.java
src/main/java/org/apache/accumulo/examples/constraints/ConstraintsCommon.java [new file with mode: 0644]
src/main/java/org/apache/accumulo/examples/constraints/MaxMutationSize.java
src/main/java/org/apache/accumulo/examples/constraints/NumericValueConstraint.java
src/main/java/org/apache/accumulo/examples/dirlist/Ingest.java
src/main/java/org/apache/accumulo/examples/filedata/CharacterHistogram.java
src/main/java/org/apache/accumulo/examples/filedata/FileDataIngest.java
src/main/java/org/apache/accumulo/examples/helloworld/Insert.java
src/main/java/org/apache/accumulo/examples/helloworld/Read.java
src/main/java/org/apache/accumulo/examples/isolation/InterferenceTest.java
src/main/java/org/apache/accumulo/examples/mapreduce/NGramIngest.java
src/main/java/org/apache/accumulo/examples/mapreduce/WordCount.java
src/main/java/org/apache/accumulo/examples/mapreduce/bulk/BulkIngestExample.java
src/main/java/org/apache/accumulo/examples/mapreduce/bulk/SetupTable.java
src/main/java/org/apache/accumulo/examples/mapreduce/bulk/VerifyIngest.java
src/main/java/org/apache/accumulo/examples/sample/SampleExample.java
src/main/java/org/apache/accumulo/examples/shard/Reverse.java