You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2019/02/01 23:52:55 UTC

[GitHub] milleruntime commented on a change in pull request #935: Merged multiple compaction strategies into one.

milleruntime commented on a change in pull request #935: Merged multiple compaction strategies into one.
URL: https://github.com/apache/accumulo/pull/935#discussion_r253235599
 
 

 ##########
 File path: server/tserver/src/main/java/org/apache/accumulo/tserver/compaction/strategies/BasicCompactionStrategy.java
 ##########
 @@ -0,0 +1,164 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.accumulo.tserver.compaction.strategies;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.accumulo.core.conf.ConfigurationTypeHelper;
+import org.apache.accumulo.core.conf.Property;
+import org.apache.accumulo.core.metadata.schema.DataFileValue;
+import org.apache.accumulo.server.fs.FileRef;
+import org.apache.accumulo.tserver.compaction.CompactionPlan;
+import org.apache.accumulo.tserver.compaction.DefaultCompactionStrategy;
+import org.apache.accumulo.tserver.compaction.MajorCompactionRequest;
+import org.apache.accumulo.tserver.compaction.WriteParameters;
+import org.apache.log4j.Logger;
+
+/**
+ * A compaction strategy that covers the following uses cases.
+ *
+ * <ul>
+ * <li>Filtering out input files larger than a specified size. These are never considered for
+ * compaction.
+ * <li>Compressing output files differently when the sum of the input files exceeds a specified
+ * size.
+ * </ul>
+ *
+ * <p>
+ * To filter out input files based on size set
+ * {@code table.majc.compaction.strategy.opts.filter.size} to the desired size.
+ *
+ * <p>
+ * To use a different compression for larger inputs set
+ * {@code table.majc.compaction.strategy.opts.large.compress.threshold } to bytes and
+ * {@code  table.majc.compaction.strategy.opts.large.compress.type} to a compression type like gz or
+ * snappy. When setting one of these properties then the other must be set. When the total size of
+ * files being compacted is larger than the threshold then the specified compression type is used.
+ *
+ * <p>
+ * To use this strategy with Minor Compactions set {@code table.file.compress.type=snappy} and set a
+ * different compress type in {@code table.majc.compaction.strategy.opts.large.compress.type} for
+ * larger files.
+ *
+ * <p>
+ * The options that take sizes are in bytes and the suffixes K,M,and G can be used.
+ */
+public class BasicCompactionStrategy extends DefaultCompactionStrategy {
 
 Review comment:
   Could call it ConfigurableCompactionStrategy and rename the current ConfigurableCompactionStrategy to ShellCompactionStrategy since its less configurable and seems to be only used by the shell compact command. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services