Return-Path: X-Original-To: apmail-accumulo-commits-archive@www.apache.org Delivered-To: apmail-accumulo-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8D7BF19A3D for ; Thu, 31 Mar 2016 18:56:17 +0000 (UTC) Received: (qmail 88270 invoked by uid 500); 31 Mar 2016 18:56:17 -0000 Delivered-To: apmail-accumulo-commits-archive@accumulo.apache.org Received: (qmail 88236 invoked by uid 500); 31 Mar 2016 18:56:17 -0000 Mailing-List: contact commits-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@accumulo.apache.org Delivered-To: mailing list commits@accumulo.apache.org Received: (qmail 88227 invoked by uid 99); 31 Mar 2016 18:56:17 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 31 Mar 2016 18:56:17 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 5E5B1DFC6E; Thu, 31 Mar 2016 18:56:17 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: dlmarion@apache.org To: commits@accumulo.apache.org Date: Thu, 31 Mar 2016 18:56:17 -0000 Message-Id: <745b813b4dd546709c3b1a4e30dccb78@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/3] accumulo git commit: ACCUMULO-4169: Close contexts that are not in the configuration. Repository: accumulo Updated Branches: refs/heads/master 1d490300a -> 173d80e11 ACCUMULO-4169: Close contexts that are not in the configuration. Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/f6bfe901 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/f6bfe901 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/f6bfe901 Branch: refs/heads/master Commit: f6bfe9018d1136e2ff972b8bb8a43732ee625fef Parents: b040557 Author: Dave Marion Authored: Thu Mar 31 14:10:18 2016 -0400 Committer: Dave Marion Committed: Thu Mar 31 14:10:18 2016 -0400 ---------------------------------------------------------------------- assemble/conf/templates/accumulo-env.sh | 2 +- .../apache/accumulo/tserver/TabletServer.java | 25 ++++---------------- .../start/classloader/vfs/ContextManager.java | 7 ++++-- 3 files changed, 11 insertions(+), 23 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/f6bfe901/assemble/conf/templates/accumulo-env.sh ---------------------------------------------------------------------- diff --git a/assemble/conf/templates/accumulo-env.sh b/assemble/conf/templates/accumulo-env.sh index e136a3f..a06a4cd 100644 --- a/assemble/conf/templates/accumulo-env.sh +++ b/assemble/conf/templates/accumulo-env.sh @@ -51,7 +51,7 @@ test -z "$ACCUMULO_TSERVER_OPTS" && export ACCUMULO_TSERVER_OPTS="${POLICY} ${tS test -z "$ACCUMULO_MASTER_OPTS" && export ACCUMULO_MASTER_OPTS="${POLICY} ${masterHigh_masterLow}" test -z "$ACCUMULO_MONITOR_OPTS" && export ACCUMULO_MONITOR_OPTS="${POLICY} ${monitorHigh_monitorLow}" test -z "$ACCUMULO_GC_OPTS" && export ACCUMULO_GC_OPTS="${gcHigh_gcLow}" -test -z "$ACCUMULO_GENERAL_OPTS" && export ACCUMULO_GENERAL_OPTS="-XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -Djava.net.preferIPv4Stack=true" +test -z "$ACCUMULO_GENERAL_OPTS" && export ACCUMULO_GENERAL_OPTS="-XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -Djava.net.preferIPv4Stack=true -XX:+CMSClassUnloadingEnabled" test -z "$ACCUMULO_OTHER_OPTS" && export ACCUMULO_OTHER_OPTS="${otherHigh_otherLow}" # what do when the JVM runs out of heap memory export ACCUMULO_KILL_CMD='kill -9 %p' http://git-wip-us.apache.org/repos/asf/accumulo/blob/f6bfe901/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java ---------------------------------------------------------------------- diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java index f3748d7..ac8f2ec 100644 --- a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java +++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java @@ -3588,29 +3588,14 @@ public class TabletServer extends AbstractMetricsImpl implements org.apache.accu Runnable contextCleaner = new Runnable() { @Override public void run() { - ArrayList extents; - - synchronized (onlineTablets) { - extents = new ArrayList(onlineTablets.keySet()); - } - - Set tables = new HashSet(); - - for (KeyExtent keyExtent : extents) { - tables.add(keyExtent.getTableId()); - } - - HashSet contexts = new HashSet(); - - for (Text tableid : tables) { - String context = getTableConfiguration(new KeyExtent(tableid, null, null)).get(Property.TABLE_CLASSPATH); - if (!context.equals("")) { - contexts.add(context); - } + Set contextProperties = getSystemConfiguration().getAllPropertiesWithPrefix(Property.VFS_CONTEXT_CLASSPATH_PROPERTY).keySet(); + Set configuredContexts = new HashSet(); + for (String prop : contextProperties) { + configuredContexts.add(prop.substring(Property.VFS_CONTEXT_CLASSPATH_PROPERTY.name().length())); } try { - AccumuloVFSClassLoader.getContextManager().removeUnusedContexts(contexts); + AccumuloVFSClassLoader.getContextManager().removeUnusedContexts(configuredContexts); } catch (IOException e) { log.warn(e.getMessage(), e); } http://git-wip-us.apache.org/repos/asf/accumulo/blob/f6bfe901/start/src/main/java/org/apache/accumulo/start/classloader/vfs/ContextManager.java ---------------------------------------------------------------------- diff --git a/start/src/main/java/org/apache/accumulo/start/classloader/vfs/ContextManager.java b/start/src/main/java/org/apache/accumulo/start/classloader/vfs/ContextManager.java index c9ebc52..981322c 100644 --- a/start/src/main/java/org/apache/accumulo/start/classloader/vfs/ContextManager.java +++ b/start/src/main/java/org/apache/accumulo/start/classloader/vfs/ContextManager.java @@ -189,13 +189,16 @@ public class ContextManager { } } - public void removeUnusedContexts(Set inUse) { + public void removeUnusedContexts(Set configuredContexts) { Map unused; + // ContextManager knows of some set of contexts. This method will be called with + // the set of currently configured contexts. We will close the contexts that are + // no longer in the configuration. synchronized (this) { unused = new HashMap(contexts); - unused.keySet().removeAll(inUse); + unused.keySet().removeAll(configuredContexts); contexts.keySet().removeAll(unused.keySet()); }