accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ktur...@apache.org
Subject [accumulo] branch master updated: ACCUMULO-2968: Axe TabletServer.majorCompactorDisabled (#302)
Date Wed, 04 Oct 2017 13:46:47 GMT
This is an automated email from the ASF dual-hosted git repository.

kturner 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 8096446  ACCUMULO-2968: Axe TabletServer.majorCompactorDisabled (#302)
8096446 is described below

commit 80964461b47ddbb99e82e894bb27f61eeacadc19
Author: Mark Owens <31573345+jmark99@users.noreply.github.com>
AuthorDate: Wed Oct 4 09:46:44 2017 -0400

    ACCUMULO-2968: Axe TabletServer.majorCompactorDisabled (#302)
    
    * ACCUMULO-2968: Axe TabletServer.majorCompactorDisabled
    
    Removed references to majorCompatorDisabled variable defined in
    accumulo/tserver/TabletServer.java.  This private variable was
    defined as 'false' and never modified in source and additionally
    no means were provided to alter the value in the code.
    
    Several locations within TabletServer.java where updated. This
    included a couple of 'if' statement that would never be executed as well
    as some return statement where a constant value of true was
    unneccessarily included.
    
    There was one reference each with CompationRunner.java and Tablet.java
    which were removed also.
    
    The change of most note is probably the while loop within the run method
    in TableServer. Previously the while check read:
       while(!majorCompatorDisabled)....
    
    whereas now it reads:
       while(true)...
    
    which was what it would always equate too. This could be seen to be a
    loss of information perhaps. A comment was added to describe what
    existed prior to the update.
---
 .../java/org/apache/accumulo/tserver/TabletServer.java  | 17 +++--------------
 .../accumulo/tserver/tablet/CompactionRunner.java       |  6 ------
 .../java/org/apache/accumulo/tserver/tablet/Tablet.java |  2 +-
 3 files changed, 4 insertions(+), 21 deletions(-)

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 20f00ca..5e24e59 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
@@ -330,7 +330,6 @@ public class TabletServer extends AccumuloServerContext implements Runnable
{
   private HostAndPort clientAddress;
 
   private volatile boolean serverStopRequested = false;
-  private volatile boolean majorCompactorDisabled = false;
   private volatile boolean shutdownComplete = false;
 
   private ZooLock tabletServerLock;
@@ -1925,20 +1924,10 @@ public class TabletServer extends AccumuloServerContext implements
Runnable {
 
     @Override
     public void run() {
-      if (majorCompactorDisabled) {
-        // this will make split task that were queued when shutdown was
-        // initiated exit
-        return;
-      }
-
       splitTablet(tablet);
     }
   }
 
-  public boolean isMajorCompactionDisabled() {
-    return majorCompactorDisabled;
-  }
-
   public long updateTotalQueuedMutationSize(long additionalMutationSize) {
     return totalQueuedMutationSize.addAndGet(additionalMutationSize);
   }
@@ -1963,7 +1952,7 @@ public class TabletServer extends AccumuloServerContext implements Runnable
{
 
     @Override
     public void run() {
-      while (!majorCompactorDisabled) {
+      while (true) {
         try {
           sleepUninterruptibly(getConfiguration().getTimeInMillis(Property.TSERV_MAJC_DELAY),
TimeUnit.MILLISECONDS);
 
@@ -1980,7 +1969,7 @@ public class TabletServer extends AccumuloServerContext implements Runnable
{
           Iterator<Entry<KeyExtent,Tablet>> iter = copyOnlineTablets.entrySet().iterator();
 
           // bail early now if we're shutting down
-          while (iter.hasNext() && !majorCompactorDisabled) {
+          while (iter.hasNext()) {
 
             Entry<KeyExtent,Tablet> entry = iter.next();
 
@@ -2015,7 +2004,7 @@ public class TabletServer extends AccumuloServerContext implements Runnable
{
             // idle compactions
             iter = copyOnlineTablets.entrySet().iterator();
 
-            while (iter.hasNext() && !majorCompactorDisabled && numMajorCompactionsInProgress
< idleCompactionsToStart) {
+            while (iter.hasNext() && numMajorCompactionsInProgress < idleCompactionsToStart)
{
               Entry<KeyExtent,Tablet> entry = iter.next();
               Tablet tablet = entry.getValue();
 
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactionRunner.java
b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactionRunner.java
index a5f618d..58b3bb8 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactionRunner.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactionRunner.java
@@ -34,12 +34,6 @@ final class CompactionRunner implements Runnable, Comparable<CompactionRunner>
{
 
   @Override
   public void run() {
-    if (tablet.getTabletServer().isMajorCompactionDisabled()) {
-      // this will make compaction tasks that were queued when shutdown was
-      // initiated exit
-      tablet.removeMajorCompactionQueuedReason(reason);
-      return;
-    }
 
     tablet.majorCompact(reason, queued);
 
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java
index 62c5c4f..647587c 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java
@@ -1686,7 +1686,7 @@ public class Tablet implements TabletCommitter {
   // BEGIN PRIVATE METHODS RELATED TO MAJOR COMPACTION
 
   private boolean isCompactionEnabled() {
-    return !isClosing() && !getTabletServer().isMajorCompactionDisabled();
+    return !isClosing();
   }
 
   private CompactionStats _majorCompact(MajorCompactionReason reason) throws IOException,
CompactionCanceledException {

-- 
To stop receiving notification emails like this one, please contact
['"commits@accumulo.apache.org" <commits@accumulo.apache.org>'].

Mime
View raw message