You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by "ddanielr (via GitHub)" <gi...@apache.org> on 2023/06/13 04:35:08 UTC
[GitHub] [accumulo] ddanielr commented on a diff in pull request #3460: Partially moves compactions into the manager
ddanielr commented on code in PR #3460:
URL: https://github.com/apache/accumulo/pull/3460#discussion_r1227519535
##########
server/manager/src/main/java/org/apache/accumulo/manager/compaction/queue/CompactionJobPriorityQueue.java:
##########
@@ -0,0 +1,188 @@
+/*
+ * 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
+ *
+ * https://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.manager.compaction.queue;
+
+import static com.google.common.base.Preconditions.checkState;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.TreeMap;
+
+import org.apache.accumulo.core.dataImpl.KeyExtent;
+import org.apache.accumulo.core.metadata.schema.TabletMetadata;
+import org.apache.accumulo.core.spi.compaction.CompactionExecutorId;
+import org.apache.accumulo.core.spi.compaction.CompactionJob;
+import org.apache.accumulo.core.util.compaction.CompactionJobPrioritizer;
+
+import com.google.common.base.Preconditions;
+
+/**
+ * Priority Queue for {@link CompactionJob}s that supports a maximum size. When a job is added and
+ * the queue is at maximum size the new job is compared to the lowest job with the lowest priority.
+ * The new job will either replace the lowest priority one or be ignored.
+ *
+ * <p>
+ * When jobs are added for tablet, any previous jobs that are queued for the tablet are removed.
+ * </p>
+ */
+public class CompactionJobPriorityQueue {
+ // ELASTICITY_TODO unit test this class
+ private final CompactionExecutorId executorId;
+
+ private class CjqpKey implements Comparable<CjqpKey> {
Review Comment:
It doesn't really matter since you were consistent with the naming prefix, but is there a particular reason you swapped the q and p for your abbreviation of CompactionJobPriorityQueue? "cjpq" vs "cjqp"
--
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