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

dlmarion 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 80452089b9 Modified UnloadTabletHandler to use Tablets metadata (#4368)
80452089b9 is described below

commit 80452089b9f9775d31b334d9acc06b6f006e58cd
Author: Dave Marion <dlmar...@apache.org>
AuthorDate: Mon Mar 18 07:34:53 2024 -0400

    Modified UnloadTabletHandler to use Tablets metadata (#4368)
    
    Resolved TODO in UnloadTabletHandler by using the Tablets
    metadata reference, removing the code that was looking up
    the tablet metadata.
---
 .../org/apache/accumulo/tserver/UnloadTabletHandler.java     | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git 
a/server/tserver/src/main/java/org/apache/accumulo/tserver/UnloadTabletHandler.java
 
b/server/tserver/src/main/java/org/apache/accumulo/tserver/UnloadTabletHandler.java
index f4ab2ec7b4..a1d46257ec 100644
--- 
a/server/tserver/src/main/java/org/apache/accumulo/tserver/UnloadTabletHandler.java
+++ 
b/server/tserver/src/main/java/org/apache/accumulo/tserver/UnloadTabletHandler.java
@@ -20,14 +20,10 @@ package org.apache.accumulo.tserver;
 
 import static java.util.concurrent.TimeUnit.NANOSECONDS;
 
-import org.apache.accumulo.core.client.admin.TabletAvailability;
 import org.apache.accumulo.core.conf.Property;
 import org.apache.accumulo.core.dataImpl.KeyExtent;
 import org.apache.accumulo.core.manager.thrift.TabletLoadState;
-import org.apache.accumulo.core.metadata.TServerInstance;
 import org.apache.accumulo.core.metadata.schema.TabletMetadata;
-import org.apache.accumulo.core.metadata.schema.TabletMetadata.ColumnType;
-import org.apache.accumulo.core.metadata.schema.TabletMetadata.Location;
 import org.apache.accumulo.core.tablet.thrift.TUnloadTabletGoal;
 import org.apache.accumulo.server.manager.state.DistributedStoreException;
 import org.apache.accumulo.server.manager.state.TabletStateStore;
@@ -109,13 +105,7 @@ class UnloadTabletHandler implements Runnable {
     server.onlineTablets.remove(extent);
 
     try {
-      TServerInstance instance = server.getTabletSession();
-      // ELASTICITY_TODO: Modify Tablet to keep a reference to TableMetadata 
so that we
-      // can avoid building a tablet metadata that may not have needed 
information, for example may
-      // need the last location
-      TabletMetadata tm = 
TabletMetadata.builder(extent).putLocation(Location.current(instance))
-          .putTabletAvailability(TabletAvailability.ONDEMAND)
-          .build(ColumnType.LAST, ColumnType.SUSPEND);
+      TabletMetadata tm = t.getMetadata();
       if (!goalState.equals(TUnloadTabletGoal.SUSPENDED) || 
extent.isRootTablet()
           || (extent.isMeta()
               && 
!server.getConfiguration().getBoolean(Property.MANAGER_METADATA_SUSPENDABLE))) {

Reply via email to