This is an automated email from the ASF dual-hosted git repository.

kturner pushed a commit to branch elasticity
in repository https://gitbox.apache.org/repos/asf/accumulo.git


The following commit(s) were added to refs/heads/elasticity by this push:
     new 037dba45cb Removed unused code from tablet server. (#3618)
037dba45cb is described below

commit 037dba45cb606496fb19a10448ea08ddb7717a54
Author: Keith Turner <ktur...@apache.org>
AuthorDate: Mon Jul 17 15:02:03 2023 -0400

    Removed unused code from tablet server. (#3618)
    
    Follow up to #3604. Used IDE to find more unused code.
---
 .../org/apache/accumulo/tserver/TabletServer.java  |  4 --
 .../tserver/TabletServerResourceManager.java       |  9 ----
 .../apache/accumulo/tserver/TabletStatsKeeper.java | 43 ++---------------
 .../tserver/metrics/TabletServerMetricsUtil.java   |  4 --
 .../tserver/metrics/TabletServerScanMetrics.java   |  4 --
 .../accumulo/tserver/tablet/DatafileManager.java   | 14 ------
 .../accumulo/tserver/tablet/SplitRowSpec.java      | 31 ------------
 .../org/apache/accumulo/tserver/tablet/Tablet.java | 56 ----------------------
 8 files changed, 3 insertions(+), 162 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 8b3f55e15c..b1818db63d 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
@@ -1089,10 +1089,6 @@ public class TabletServer extends AbstractServer 
implements TabletHostingServer
     return resourceManager.holdTime();
   }
 
-  public SecurityOperation getSecurityOperation() {
-    return security;
-  }
-
   // avoid unnecessary redundant markings to meta
   final ConcurrentHashMap<DfsLogger,EnumSet<TabletLevel>> metadataTableLogs =
       new ConcurrentHashMap<>();
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 ce90527c4f..58db890afe 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
@@ -650,11 +650,6 @@ public class TabletServerResourceManager {
     }
 
     // BEGIN methods that Tablets call to manage their set of open data files
-
-    public void importedDataFiles() {
-      lastReportedCommitTime = System.currentTimeMillis();
-    }
-
     public synchronized ScanFileManager newScanFileManager(ScanDispatch 
scanDispatch) {
       if (closed) {
         throw new IllegalStateException("closed");
@@ -733,10 +728,6 @@ public class TabletServerResourceManager {
         }
       }
     }
-
-    public TabletServerResourceManager getTabletServerResourceManager() {
-      return TabletServerResourceManager.this;
-    }
   }
 
   public void executeReadAhead(KeyExtent tablet, ScanDispatcher dispatcher, 
ScanSession scanInfo,
diff --git 
a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletStatsKeeper.java
 
b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletStatsKeeper.java
index 9fe303bcf9..fb2838b425 100644
--- 
a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletStatsKeeper.java
+++ 
b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletStatsKeeper.java
@@ -25,16 +25,14 @@ import org.apache.accumulo.server.util.ActionStatsUpdator;
 public class TabletStatsKeeper {
 
   // suspect we need more synchronization in this class
-  private ActionStats major = new ActionStats();
   private ActionStats minor = new ActionStats();
-  private ActionStats split = new ActionStats();
 
   public enum Operation {
     // TODO delete split
-    MAJOR, SPLIT, MINOR
+    MINOR
   }
 
-  private ActionStats[] map = {major, split, minor};
+  private ActionStats[] map = {minor};
 
   public void updateTime(Operation operation, long queued, long start, long 
count, boolean failed) {
     try {
@@ -63,37 +61,11 @@ public class TabletStatsKeeper {
 
   }
 
-  public void updateTime(Operation operation, long start, boolean failed) {
-    try {
-      ActionStats data = map[operation.ordinal()];
-      if (failed) {
-        data.fail++;
-        data.status--;
-      } else {
-        double t = (System.currentTimeMillis() - start) / 1000.0;
-
-        data.status--;
-        data.num++;
-        data.elapsed += t;
-        data.sumDev += t * t;
-
-        if (data.elapsed < 0 || data.sumDev < 0 || data.queueSumDev < 0 || 
data.queueTime < 0) {
-          resetTimes();
-        }
-      }
-    } catch (Exception E) {
-      resetTimes();
-    }
-
-  }
-
   public void saveMajorMinorTimes(TabletStats t) {
     ActionStatsUpdator.update(minor, t.minors);
   }
 
   private void resetTimes() {
-    major = new ActionStats();
-    split = new ActionStats();
     minor = new ActionStats();
   }
 
@@ -101,16 +73,7 @@ public class TabletStatsKeeper {
     minor.status++;
   }
 
-  public void incrementStatusMajor() {
-    major.status++;
-  }
-
-  // TODO remove
-  void incrementStatusSplit() {
-    split.status++;
-  }
-
   public TabletStats getTabletStats() {
-    return new TabletStats(null, null, minor, split, 0, 0, 0);
+    return new TabletStats(null, null, minor, null, 0, 0, 0);
   }
 }
diff --git 
a/server/tserver/src/main/java/org/apache/accumulo/tserver/metrics/TabletServerMetricsUtil.java
 
b/server/tserver/src/main/java/org/apache/accumulo/tserver/metrics/TabletServerMetricsUtil.java
index 02d59f910a..fd07dc0e89 100644
--- 
a/server/tserver/src/main/java/org/apache/accumulo/tserver/metrics/TabletServerMetricsUtil.java
+++ 
b/server/tserver/src/main/java/org/apache/accumulo/tserver/metrics/TabletServerMetricsUtil.java
@@ -117,10 +117,6 @@ public class TabletServerMetricsUtil {
     return tserver.getUnopenedCount();
   }
 
-  public String getName() {
-    return tserver.getClientAddressString();
-  }
-
   public long getTotalMinorCompactions() {
     return tserver.getTotalMinorCompactions();
   }
diff --git 
a/server/tserver/src/main/java/org/apache/accumulo/tserver/metrics/TabletServerScanMetrics.java
 
b/server/tserver/src/main/java/org/apache/accumulo/tserver/metrics/TabletServerScanMetrics.java
index 57e33d2334..e8ce7fb75f 100644
--- 
a/server/tserver/src/main/java/org/apache/accumulo/tserver/metrics/TabletServerScanMetrics.java
+++ 
b/server/tserver/src/main/java/org/apache/accumulo/tserver/metrics/TabletServerScanMetrics.java
@@ -73,10 +73,6 @@ public class TabletServerScanMetrics implements 
MetricsProducer {
     return this.queryResultBytes.sum();
   }
 
-  public void incrementScannedCount(long amount) {
-    this.scannedCount.add(amount);
-  }
-
   public LongAdder getScannedCounter() {
     return this.scannedCount;
   }
diff --git 
a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/DatafileManager.java
 
b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/DatafileManager.java
index ccdc7437cf..f7f707202a 100644
--- 
a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/DatafileManager.java
+++ 
b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/DatafileManager.java
@@ -52,9 +52,6 @@ class DatafileManager {
       Collections.synchronizedMap(new TreeMap<>());
   private final Tablet tablet;
 
-  // ensure we only have one reader/writer of our bulk file notes at a time
-  private final Object bulkFileImportLock = new Object();
-
   // This must be incremented before and after datafileSizes and metadata 
table updates. These
   // counts allow detection of overlapping operations w/o placing a lock 
around metadata table
   // updates and datafileSizes updates. There is a periodic metadata 
consistency check that runs in
@@ -276,17 +273,6 @@ class DatafileManager {
     }
   }
 
-  public Set<StoredTabletFile> getFiles() {
-    synchronized (tablet) {
-      HashSet<StoredTabletFile> files = new HashSet<>(datafileSizes.keySet());
-      return Collections.unmodifiableSet(files);
-    }
-  }
-
-  public int getNumFiles() {
-    return datafileSizes.size();
-  }
-
   public MetadataUpdateCount getUpdateCount() {
     return metadataUpdateCount.get();
   }
diff --git 
a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/SplitRowSpec.java
 
b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/SplitRowSpec.java
deleted file mode 100644
index e8d29e52f5..0000000000
--- 
a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/SplitRowSpec.java
+++ /dev/null
@@ -1,31 +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
- *
- *   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.tserver.tablet;
-
-import org.apache.hadoop.io.Text;
-
-class SplitRowSpec {
-  final double splitRatio;
-  final Text row;
-
-  SplitRowSpec(double splitRatio, Text row) {
-    this.splitRatio = splitRatio;
-    this.row = row;
-  }
-}
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 1cd1b2f3c9..d212c3bcc3 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
@@ -75,7 +75,6 @@ import 
org.apache.accumulo.core.tabletserver.thrift.TabletStats;
 import org.apache.accumulo.core.trace.TraceUtil;
 import org.apache.accumulo.core.util.Pair;
 import org.apache.accumulo.server.compaction.CompactionStats;
-import org.apache.accumulo.server.compaction.PausedCompactionMetrics;
 import org.apache.accumulo.server.fs.VolumeUtil;
 import org.apache.accumulo.server.fs.VolumeUtil.TabletFiles;
 import org.apache.accumulo.server.problems.ProblemReport;
@@ -995,22 +994,6 @@ public class Tablet extends TabletBase {
     }
   }
 
-  /**
-   * Returns an int representing the total block size of the files served by 
this tablet.
-   *
-   * @return size
-   */
-  // this is the size of just the files
-  public long estimateTabletSize() {
-    long size = 0L;
-
-    for (DataFileValue sz : getDatafileManager().getDatafileSizes().values()) {
-      size += sz.getSize();
-    }
-
-    return size;
-  }
-
   synchronized void computeNumEntries() {
     Collection<DataFileValue> vals = 
getDatafileManager().getDatafileSizes().values();
 
@@ -1105,18 +1088,6 @@ public class Tablet extends TabletBase {
     return this.ingestBytes;
   }
 
-  public long totalQueryResultsBytes() {
-    return this.queryResultBytes.get();
-  }
-
-  public long totalScannedCount() {
-    return this.scannedCount.get();
-  }
-
-  public long totalLookupCount() {
-    return this.lookupCount.get();
-  }
-
   public synchronized void updateRates(long now) {
     queryRate.update(now, this.queryResultCount.get());
     queryByteRate.update(now, this.queryResultBytes.get());
@@ -1343,15 +1314,6 @@ public class Tablet extends TabletBase {
     getTabletResources().updateMemoryUsageStats(this, size, mincSize);
   }
 
-  public void updateTimer(Operation operation, long queued, long start, long 
count,
-      boolean failed) {
-    timer.updateTime(operation, queued, start, count, failed);
-  }
-
-  public void incrementStatusMajor() {
-    timer.incrementStatusMajor();
-  }
-
   TabletServer getTabletServer() {
     return tabletServer;
   }
@@ -1385,10 +1347,6 @@ public class Tablet extends TabletBase {
     return getTabletServer().getScanMetrics();
   }
 
-  public PausedCompactionMetrics getPausedCompactionMetrics() {
-    return getTabletServer().getPausedCompactionMetrics();
-  }
-
   DatafileManager getDatafileManager() {
     return datafileManager;
   }
@@ -1421,10 +1379,6 @@ public class Tablet extends TabletBase {
     getTabletMemory().returnIterators(iters);
   }
 
-  public long getAndUpdateTime() {
-    return tabletTime.getAndUpdateTime();
-  }
-
   public void flushComplete(long flushId) {
     lastLocation = null;
     dataSourceDeletions.incrementAndGet();
@@ -1433,12 +1387,6 @@ public class Tablet extends TabletBase {
     computeNumEntries();
   }
 
-  public Location resetLastLocation() {
-    Location result = lastLocation;
-    lastLocation = null;
-    return result;
-  }
-
   public void minorCompactionWaitingToStart() {
     minorCompactionState = CompactionState.WAITING_TO_START;
   }
@@ -1455,10 +1403,6 @@ public class Tablet extends TabletBase {
     return timer.getTabletStats();
   }
 
-  public String getDirName() {
-    return dirName;
-  }
-
   public boolean isOnDemand() {
     return goal == TabletHostingGoal.ONDEMAND;
   }

Reply via email to