This is an automated email from the ASF dual-hosted git repository. mmiller pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/accumulo.git
The following commit(s) were added to refs/heads/master by this push: new 4eba932 Drop MemoryManager from properties (#1660) 4eba932 is described below commit 4eba9329b9056948f745c8ee4d26fa4510a19659 Author: Mike Miller <mmil...@apache.org> AuthorDate: Fri Jul 17 09:18:10 2020 -0400 Drop MemoryManager from properties (#1660) --- .../org/apache/accumulo/core/conf/Property.java | 3 -- .../tabletserver/LargestFirstMemoryManager.java | 7 +-- .../server/tabletserver/MemoryManager.java | 55 ---------------------- .../tserver/TabletServerResourceManager.java | 9 ++-- 4 files changed, 4 insertions(+), 70 deletions(-) diff --git a/core/src/main/java/org/apache/accumulo/core/conf/Property.java b/core/src/main/java/org/apache/accumulo/core/conf/Property.java index 0f453dc..15b80e4 100644 --- a/core/src/main/java/org/apache/accumulo/core/conf/Property.java +++ b/core/src/main/java/org/apache/accumulo/core/conf/Property.java @@ -380,9 +380,6 @@ public enum Property { + " memory usage table.compaction.minor.logs.threshold and" + " tserver.walog.max.size. Ensure that table.compaction.minor.logs.threshold" + " * tserver.walog.max.size >= this property."), - TSERV_MEM_MGMT("tserver.memory.manager", - "org.apache.accumulo.server.tabletserver.LargestFirstMemoryManager", PropertyType.CLASSNAME, - "An implementation of MemoryManger that accumulo will use."), TSERV_SESSION_MAXIDLE("tserver.session.idle.max", "1m", PropertyType.TIMEDURATION, "When a tablet server's SimpleTimer thread triggers to check idle" + " sessions, this configurable option will be used to evaluate scan sessions" diff --git a/server/base/src/main/java/org/apache/accumulo/server/tabletserver/LargestFirstMemoryManager.java b/server/base/src/main/java/org/apache/accumulo/server/tabletserver/LargestFirstMemoryManager.java index dedc4a6..7e8990c 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/tabletserver/LargestFirstMemoryManager.java +++ b/server/base/src/main/java/org/apache/accumulo/server/tabletserver/LargestFirstMemoryManager.java @@ -40,7 +40,7 @@ import org.slf4j.LoggerFactory; * suggest, it flushes the tablet with the highest memory footprint. However, it actually chooses * the tablet as a function of its size doubled for every 15 minutes of idle time. */ -public class LargestFirstMemoryManager implements MemoryManager { +public class LargestFirstMemoryManager { private static final Logger log = LoggerFactory.getLogger(LargestFirstMemoryManager.class); private static final long ZERO_TIME = System.currentTimeMillis(); @@ -121,7 +121,6 @@ public class LargestFirstMemoryManager implements MemoryManager { } } - @Override public void init(ServerConfiguration conf) { this.config = conf; maxMemory = conf.getSystemConfiguration().getAsBytes(Property.TSERV_MAXMEM); @@ -148,7 +147,6 @@ public class LargestFirstMemoryManager implements MemoryManager { return config.getTableConfiguration(tableId) != null; } - @Override public MemoryManagementActions getMemoryManagementActions(List<TabletState> tablets) { if (maxMemory < 0) throw new IllegalStateException( @@ -286,9 +284,6 @@ public class LargestFirstMemoryManager implements MemoryManager { return System.currentTimeMillis(); } - @Override - public void tabletClosed(KeyExtent extent) {} - // The load function: memory times the idle time, doubling every 15 mins static long timeMemoryLoad(long mem, long time) { double minutesIdle = time / 60000.0; diff --git a/server/base/src/main/java/org/apache/accumulo/server/tabletserver/MemoryManager.java b/server/base/src/main/java/org/apache/accumulo/server/tabletserver/MemoryManager.java deleted file mode 100644 index 8d3c06b..0000000 --- a/server/base/src/main/java/org/apache/accumulo/server/tabletserver/MemoryManager.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * 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.server.tabletserver; - -import java.util.List; - -import org.apache.accumulo.core.dataImpl.KeyExtent; -import org.apache.accumulo.server.conf.ServerConfiguration; - -/** - * A MemoryManager in accumulo currently determines when minor compactions should occur and when - * ingest should be put on hold. The goal of a memory manager implementation is to maximize ingest - * throughput and minimize the number of minor compactions. - */ -public interface MemoryManager { - - /** - * Initialize the memory manager. - */ - void init(ServerConfiguration conf); - - /** - * An implementation of this function will be called periodically by accumulo and should return a - * list of tablets to minor compact. - * - * Instructing a tablet that is already minor compacting (this can be inferred from the - * TabletState) to minor compact has no effect. - * - * Holding all ingest does not affect metadata tablets. - */ - - MemoryManagementActions getMemoryManagementActions(List<TabletState> tablets); - - /** - * This method is called when a tablet is closed. A memory manger can clean up any per tablet - * state it is keeping when this is called. - */ - void tabletClosed(KeyExtent extent); -} diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServerResourceManager.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServerResourceManager.java index d569005..4c68cd2 100644 --- a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServerResourceManager.java +++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServerResourceManager.java @@ -71,7 +71,6 @@ import org.apache.accumulo.server.ServerContext; import org.apache.accumulo.server.ServiceEnvironmentImpl; import org.apache.accumulo.server.tabletserver.LargestFirstMemoryManager; import org.apache.accumulo.server.tabletserver.MemoryManagementActions; -import org.apache.accumulo.server.tabletserver.MemoryManager; import org.apache.accumulo.server.tabletserver.TabletState; import org.apache.accumulo.server.util.time.SimpleTimer; import org.apache.accumulo.tserver.FileManager.ScanFileManager; @@ -115,7 +114,7 @@ public class TabletServerResourceManager { private final FileManager fileManager; - private final MemoryManager memoryManager; + private final LargestFirstMemoryManager memoryManager; private final MemoryManagementFramework memMgmt; @@ -409,8 +408,7 @@ public class TabletServerResourceManager { fileManager = new FileManager(context, context.getVolumeManager(), maxOpenFiles, fileLenCache); - memoryManager = Property.createInstanceFromPropertyName(acuConf, Property.TSERV_MEM_MGMT, - MemoryManager.class, new LargestFirstMemoryManager()); + memoryManager = new LargestFirstMemoryManager(); memoryManager.init(context.getServerConfFactory()); memMgmt = new MemoryManagementFramework(); memMgmt.startThreads(); @@ -643,7 +641,7 @@ public class TabletServerResourceManager { // log.debug("mma.tabletsToMinorCompact = "+mma.tabletsToMinorCompact); } } catch (Throwable t) { - log.error("Minor compactions for memory managment failed", t); + log.error("Minor compactions for memory management failed", t); } sleepUninterruptibly(250, TimeUnit.MILLISECONDS); @@ -820,7 +818,6 @@ public class TabletServerResourceManager { } memMgmt.tabletClosed(extent); - memoryManager.tabletClosed(extent); closed = true; }