This is an automated email from the ASF dual-hosted git repository.

jmark99 pushed a commit to branch 2.1
in repository https://gitbox.apache.org/repos/asf/accumulo-examples.git


The following commit(s) were added to refs/heads/2.1 by this push:
     new 3b8088a  Update SampleExample and documentation (#116)
3b8088a is described below

commit 3b8088a64187d6f19a28bb357a7c105b1aaf754a
Author: Mark Owens <jmar...@apache.org>
AuthorDate: Fri Jan 27 10:37:19 2023 -0500

    Update SampleExample and documentation (#116)
    
    * Added BatchWriter flush command to SampleExample.java to ensure updated   
sample data is output when executing SampleExample via the runex  command
    * Updated Sample.md documentation to correctly display changes with the   
update to Accumulo 2.1
    * Updated Shard.md documentation to correctly display changes with the 
update to Accumulo 2.1
---
 docs/sample.md                                     |  2 +-
 docs/shard.md                                      | 42 ++++++++++------------
 .../accumulo/examples/sample/SampleExample.java    |  1 +
 3 files changed, 20 insertions(+), 25 deletions(-)

diff --git a/docs/sample.md b/docs/sample.md
index 33c9e81..9990907 100644
--- a/docs/sample.md
+++ b/docs/sample.md
@@ -79,7 +79,7 @@ failure and fixing the problem with a compaction.
     root@instance examples.sampex> compact -t examples.sampex --sf-no-sample
     2015-09-09 12:23:07,242 [shell.Shell] INFO : Compaction of table sampex 
started for given range
     root@instance examples.sampex> scan --sample
-    2317 doc:content []    milk, eggs, bread, parmigiano-reggiano
+    2317 doc:content []    milk, eggs, bread, parmigiano-reggiano, butter
     2317 doc:url []    file://groceries/9.txt
     3900 doc:content []    EC2 ate my homework
     3900 doc:uril []    file://final_project.txt
diff --git a/docs/shard.md b/docs/shard.md
index d779c6f..05beea3 100644
--- a/docs/shard.md
+++ b/docs/shard.md
@@ -30,36 +30,29 @@ To run these example programs, create two tables like below.
     username@instance> createtable examples.shard
     username@instance examples.shard> createtable examples.doc2term
 
-After creating the tables, index some files. The following command indexes all 
of the java files in the Accumulo source code.
+After creating the tables, index some files. The following command indexes all 
the java files in the Accumulo source code.
 
     $ find /path/to/accumulo/core -name "*.java" | xargs ./bin/runex 
shard.Index -t examples.shard --partitions 30
 
 The following command queries the index to find all files containing 'foo' and 
'bar'.
 
     $ ./bin/runex shard.Query -t examples.shard foo bar
-      
/path/to/accumulo/core/src/test/java/org/apache/accumulo/core/replication/ReplicationTargetTest.java
-      
/path/to/accumulo/core/src/test/java/org/apache/accumulo/core/client/admin/NewTableConfigurationTest.java
-      
/path/to/accumulo/core/src/test/java/org/apache/accumulo/core/spi/balancer/HostRegexTableLoadBalancerTest.java
-      
/path/to/accumulo/core/src/test/java/org/apache/accumulo/core/data/KeyExtentTest.java
+      
/path/to/accumulo/core/src/test/java/org/apache/accumulo/core/spi/balancer/BaseHostRegexTableLoadBalancerTest.java
       
/path/to/accumulo/core/src/test/java/org/apache/accumulo/core/iterators/user/WholeRowIteratorTest.java
-      
/path/to/accumulo/core/src/test/java/org/apache/accumulo/core/iterators/user/WholeColumnFamilyIteratorTest.java
+      
/path/to/accumulo/core/src/test/java/org/apache/accumulo/core/iteratorsImpl/IteratorConfigUtilTest.java
       
/path/to/accumulo/core/src/test/java/org/apache/accumulo/core/data/KeyBuilderTest.java
+      
/path/to/accumulo/core/src/test/java/org/apache/accumulo/core/spi/balancer/HostRegexTableLoadBalancerReconfigurationTest.java
       
/path/to/accumulo/core/src/test/java/org/apache/accumulo/core/security/ColumnVisibilityTest.java
-      
/path/to/accumulo/core/src/test/java/org/apache/accumulo/core/conf/IterConfigUtilTest.java
       
/path/to/accumulo/core/src/test/java/org/apache/accumulo/core/summary/SummaryCollectionTest.java
-      
/path/to/accumulo/core/src/test/java/org/apache/accumulo/core/clientImpl/TableOperationsHelperTest.java
-      
/path/to/accumulo/core/src/test/java/org/apache/accumulo/core/clientImpl/mapreduce/BatchInputSplitTest.java
-      
/path/to/accumulo/core/src/test/java/org/apache/accumulo/core/spi/balancer/HostRegexTableLoadBalancerReconfigurationTest.java
+      
/path/to/accumulo/core/src/test/java/org/apache/accumulo/core/spi/balancer/HostRegexTableLoadBalancerTest.java
       
/path/to/accumulo/core/src/test/java/org/apache/accumulo/core/client/IteratorSettingTest.java
-      
/path/to/accumulo/core/src/test/java/org/apache/accumulo/core/client/mapred/RangeInputSplitTest.java
+      
/path/to/accumulo/core/src/test/java/org/apache/accumulo/core/data/KeyExtentTest.java
+      
/path/to/accumulo/core/src/test/java/org/apache/accumulo/core/security/VisibilityEvaluatorTest.java
       
/path/to/accumulo/core/src/test/java/org/apache/accumulo/core/iterators/user/TransformingIteratorTest.java
-      
/path/to/accumulo/core/src/test/java/org/apache/accumulo/core/spi/balancer/BaseHostRegexTableLoadBalancerTest.java
+      
/path/to/accumulo/core/src/test/java/org/apache/accumulo/core/client/admin/NewTableConfigurationTest.java
       
/path/to/accumulo/core/src/test/java/org/apache/accumulo/core/conf/HadoopCredentialProviderTest.java
-      
/path/to/accumulo/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloInputFormatTest.java
-      
/path/to/accumulo/core/src/test/java/org/apache/accumulo/core/replication/ReplicationSchemaTest.java
-      
/path/to/accumulo/core/src/test/java/org/apache/accumulo/core/client/mapreduce/RangeInputSplitTest.java
-      
/path/to/accumulo/core/src/test/java/org/apache/accumulo/core/security/VisibilityEvaluatorTest.java
-
+      
/path/to/accumulo/core/src/test/java/org/apache/accumulo/core/clientImpl/TableOperationsHelperTest.java
+      
/path/to/accumulo/core/src/test/java/org/apache/accumulo/core/iterators/user/WholeColumnFamilyIteratorTest.java
 
 In order to run ContinuousQuery, we need to run Reverse.java to populate the 
`examples.doc2term` table.
 
@@ -69,13 +62,14 @@ Below ContinuousQuery is run using 5 terms. So it selects 5 
random terms from ea
 randomly selects one set of 5 terms and queries. It prints the number of 
matching documents and the time in seconds.
 
     $ ./bin/runex shard.ContinuousQuery --shardTable examples.shard --doc2Term 
examples.doc2term --terms 5
-    [public, core, class, binarycomparable, b] 2  0.081
-    [wordtodelete, unindexdocument, doctablename, putdelete, insert] 1  0.041
-    [import, columnvisibilityinterpreterfactory, illegalstateexception, cv, 
columnvisibility] 1  0.049
-    [getpackage, testversion, util, version, 55] 1  0.048
-    [for, static, println, public, the] 55  0.211
-    [sleeptime, wrappingiterator, options, long, utilwaitthread] 1  0.057
-    [string, public, long, 0, wait] 12  0.132
+      [string, protected, sizeopt, cache, build] 1  0.084
+      [public, these, exception, to, as] 25  0.267   
+      [by, encodeprevendrow, 0, work, as] 4  0.056
+      [except, to, a, limitations, one] 969  0.197           
+      [copy, as, asf, version, is] 969  0.341                                  
               
+      [core, class, may, regarding, without] 862  0.437
+      [max_data_to_print, default_visibility_cache_size, use, 
accumulo_export_info, fate] 1  0.066
+
 
 [Index.java]: ../src/main/java/org/apache/accumulo/examples/shard/Index.java
 [Query.java]: ../src/main/java/org/apache/accumulo/examples/shard/Query.java
diff --git 
a/src/main/java/org/apache/accumulo/examples/sample/SampleExample.java 
b/src/main/java/org/apache/accumulo/examples/sample/SampleExample.java
index 2e27811..6b5e3c8 100644
--- a/src/main/java/org/apache/accumulo/examples/sample/SampleExample.java
+++ b/src/main/java/org/apache/accumulo/examples/sample/SampleExample.java
@@ -111,6 +111,7 @@ public class SampleExample {
         // update a document in the sample data
         bw.addMutation(createMutation("2317", "milk, eggs, bread, 
parmigiano-reggiano, butter",
             "file://groceries/9/txt"));
+        bw.flush();
 
         System.out.println(
             "Scanning sample after updating content for docId 2317 (should see 
content change in sample data) : ");

Reply via email to