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 2020/05/06 23:41:36 UTC

[GitHub] [accumulo] keith-turner commented on a change in pull request #1589: WIP #564 Add support for multiple compaction executors

keith-turner commented on a change in pull request #1589:
URL: https://github.com/apache/accumulo/pull/1589#discussion_r421154342



##########
File path: core/src/main/java/org/apache/accumulo/core/spi/compaction/LarsmaCompactionPlanner.java
##########
@@ -0,0 +1,350 @@
+/*
+ * 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.core.spi.compaction;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Objects;
+import java.util.Set;
+
+import org.apache.accumulo.core.client.admin.compaction.CompactableFile;
+import org.apache.accumulo.core.conf.ConfigurationTypeHelper;
+import org.apache.accumulo.core.conf.Property;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.google.common.base.Preconditions;
+import com.google.gson.Gson;
+
+/**
+ * Finds the largest continuous set of small files that meet the compaction ratio and do not prevent
+ * future compactions.
+ *
+ * <p>
+ * The following configuration options are supported. Replace {@code <service>} with the name of the
+ * compaction service you are configuring.
+ *
+ * <ul>
+ * <li>{@code tserver.compaction.service.<service>.opts.executors} This is a json array of objects
+ * where each object has the fields: name, maxSize, and numThreads. The maxSize field determine the
+ * maximum size of compaction that will run on an executor. The maxSize field can have a suffix of
+ * K,M,G for kilobytes, megabytes, or gigabytes. One executor can have no max size and it will run
+ * everything that is too large for the other executors. If all executors have a max size, then
+ * system compactions will only run for compactions smaller than the largest max size. User, chop,
+ * and selector compactions will always run, even if there is no executor for their size. These
+ * compaction will run on the executor with the largest max size. The value for this field should
+ * look like
+ * {@code [{"name":"executor1","maxSize":"100M","numThreads":3},{"name":"executor2","maxSize":"500M","numThreads":3},{"executor3":"huge","numThreads":3}]}.
+ * This configuration would run compactions less than 100M on executor1, compactions less than 500M
+ * on executor2, and all other on executor3.
+ * <li>{@code tserver.compaction.service.<service>.opts.maxOpen} This determines the maximum number
+ * of files that will be included in a single compaction.
+ * </ul>
+ *
+ * @since 2.1.0
+ * @see org.apache.accumulo.core.spi.compaction
+ */
+
+public class LarsmaCompactionPlanner implements CompactionPlanner {

Review comment:
       I renamed it to DefaultCompactionPlanner in b764df9




----------------------------------------------------------------
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.

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