You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by "jmark99 (via GitHub)" <gi...@apache.org> on 2023/02/27 16:43:03 UTC

[GitHub] [accumulo-examples] jmark99 commented on a diff in pull request #117: Update Compaction Strategy example

jmark99 commented on code in PR #117:
URL: https://github.com/apache/accumulo-examples/pull/117#discussion_r1119007851


##########
docs/compactionStrategy.md:
##########
@@ -16,64 +16,137 @@ limitations under the License.
 -->
 # Apache Accumulo Customizing the Compaction Strategy
 
-This tutorial uses the following Java classes, which can be found in org.apache.accumulo.tserver.compaction: 
-
- * DefaultCompactionStrategy.java - determines which files to compact based on table.compaction.major.ratio and table.file.max
- * EverythingCompactionStrategy.java - compacts all files
- * SizeLimitCompactionStrategy.java - compacts files no bigger than table.majc.compaction.strategy.opts.sizeLimit
- * BasicCompactionStrategy.java - uses default compression table.majc.compaction.strategy.opts.filter.size to filter input 
-                                  files based on size set and table.majc.compaction.strategy.opts.large.compress.threshold
-                                  and table.majc.compaction.strategy.opts.file.large.compress.type for larger files.                            
-                                  
-
 This is an example of how to configure a compaction strategy. By default, Accumulo will always use the DefaultCompactionStrategy, unless 
 these steps are taken to change the configuration.  Use the strategy and settings that best fits your Accumulo setup. This example shows
-how to configure and test one of the more complicated strategies, the BasicCompactionStrategy. Note that this example requires hadoop
-native libraries built with snappy in order to use snappy compression.
+how to configure a non-default strategy. Note that this example requires hadoop native libraries built with snappy in order to 
+use snappy compression. Within this example, commands starting with `user@uno>` are run from within the Accumulo shell, whereas
+commands beginning with `$` are executed from the command line terminal.
 
-To begin, run the command to create a table for testing.
+Start by creating a table that will be used for the compactions.
 
-```bash
-$ accumulo shell -u <username> -p <password> -e "createnamespace examples"
-$ accumulo shell -u <username> -p <password> -e "createtable examples.test1"
-```
+    user@uno> createnamespace examples
+    user@uno> createtable examples.test1
+
+Take note of the TableID for examples.test1. This will be needed later. The TableID can be found by running:
+
+
+    user@uno> tables -l
+    accumulo.metadata    =>        !0
+    accumulo.replication =>      +rep
+    accumulo.root        =>        +r
+    examples.test1       =>         2
 
-The commands below will configure the BasicCompactionStrategy to:
- - Avoid compacting files over 250M
- - Compact files over 100M using gz
+The commands below will configure the desired compaction strategy. The goals are:
+
+ - Avoid compacting files over 250M.
+ - Compact files over 100M using gz.
  - Compact files less than 100M using snappy.
- 
-```bash
- $ accumulo shell -u <username> -p <password> -e "config -t examples.test1 -s table.file.compress.type=snappy"
- $ accumulo shell -u <username> -p <password> -e "config -t examples.test1 -s table.majc.compaction.strategy=org.apache.accumulo.tserver.compaction.strategies.BasicCompactionStrategy"
- $ accumulo shell -u <username> -p <password> -e "config -t examples.test1 -s table.majc.compaction.strategy.opts.filter.size=250M"
- $ accumulo shell -u <username> -p <password> -e "config -t examples.test1 -s table.majc.compaction.strategy.opts.large.compress.threshold=100M"
- $ accumulo shell -u <username> -p <password> -e "config -t examples.test1 -s table.majc.compaction.strategy.opts.large.compress.type=gz"
-```
+ - Limit the compaction throughput to 40M.

Review Comment:
   @dlmarion , with this clarification updated, are you good with me merging this example?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org