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

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


The following commit(s) were added to refs/heads/main by this push:
     new 60f46e1abd minor QA fixes (#3894)
60f46e1abd is described below

commit 60f46e1abd8ea53ca7f87076c2b62dace4bd0953
Author: EdColeman <d...@etcoleman.com>
AuthorDate: Fri Oct 27 09:12:37 2023 -0400

    minor QA fixes (#3894)
---
 .../apache/accumulo/tserver/TabletClientHandler.java    | 15 +++++++--------
 .../apache/accumulo/tserver/session/SessionManager.java | 17 +++++------------
 2 files changed, 12 insertions(+), 20 deletions(-)

diff --git 
a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletClientHandler.java
 
b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletClientHandler.java
index ec6e417bce..4256064e8e 100644
--- 
a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletClientHandler.java
+++ 
b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletClientHandler.java
@@ -142,7 +142,7 @@ public class TabletClientHandler implements 
TabletServerClientService.Iface,
 
   private static final Logger log = 
LoggerFactory.getLogger(TabletClientHandler.class);
   private final long MAX_TIME_TO_WAIT_FOR_SCAN_RESULT_MILLIS;
-  private static final long RECENTLY_SPLIT_MILLIES = MINUTES.toMillis(1);
+  private static final long RECENTLY_SPLIT_MILLIS = MINUTES.toMillis(1);
   private final TabletServer server;
   protected final TransactionWatcher watcher;
   protected final ServerContext context;
@@ -263,7 +263,6 @@ public class TabletClientHandler implements 
TabletServerClientService.Iface,
       us.currentTablet = null;
       us.authFailures.put(keyExtent, SecurityErrorCode.TABLE_DOESNT_EXIST);
       server.updateMetrics.addUnknownTabletErrors(0);
-      return;
     } catch (ThriftSecurityException e) {
       log.error("Denying permission to check user " + us.getUser() + " with 
user " + e.getUser(),
           e);
@@ -272,7 +271,6 @@ public class TabletClientHandler implements 
TabletServerClientService.Iface,
       us.currentTablet = null;
       us.authFailures.put(keyExtent, e.getCode());
       server.updateMetrics.addPermissionErrors(0);
-      return;
     }
   }
 
@@ -539,7 +537,8 @@ public class TabletClientHandler implements 
TabletServerClientService.Iface,
           us.authFailures.entrySet().stream()
               .collect(Collectors.toMap(e -> e.getKey().toThrift(), 
Entry::getValue)));
     } finally {
-      // Atomically unreserve and delete the session. If there any write 
stragglers, they will fail
+      // Atomically unreserve and delete the session. If there are any write 
stragglers, they will
+      // fail
       // after this point.
       server.sessionManager.removeSession(updateID, true);
     }
@@ -761,7 +760,7 @@ public class TabletClientHandler implements 
TabletServerClientService.Iface,
       String classLoaderContext) throws ThriftSecurityException, TException {
 
     TableId tableId = TableId.of(tableIdStr);
-    Authorizations userauths = null;
+    Authorizations userauths;
     NamespaceId namespaceId = getNamespaceId(credentials, tableId);
     if (!security.canConditionallyUpdate(credentials, tableId, namespaceId)) {
       throw new ThriftSecurityException(credentials.getPrincipal(),
@@ -834,7 +833,7 @@ public class TabletClientHandler implements 
TabletServerClientService.Iface,
     } catch (IOException ioe) {
       throw new TException(ioe);
     } catch (Exception e) {
-      log.warn("Exception returned for conditionalUpdate {}", e);
+      log.warn("Exception returned for conditionalUpdate. tableId: {}, opid: 
{}", tid, opid, e);
       throw e;
     } finally {
       writeTracker.finishWrite(opid);
@@ -1017,7 +1016,7 @@ public class TabletClientHandler implements 
TabletServerClientService.Iface,
             for (KeyExtent e2 : onlineOverlapping) {
               Tablet tablet = server.getOnlineTablet(e2);
               if (System.currentTimeMillis() - tablet.getSplitCreationTime()
-                  < RECENTLY_SPLIT_MILLIES) {
+                  < RECENTLY_SPLIT_MILLIS) {
                 all.remove(e2);
               }
             }
@@ -1283,7 +1282,7 @@ public class TabletClientHandler implements 
TabletServerClientService.Iface,
   @Override
   public List<String> getActiveLogs(TInfo tinfo, TCredentials credentials) {
     String log = server.logger.getLogFile();
-    // Might be null if there no active logger
+    // Might be null if there is no active logger
     if (log == null) {
       return Collections.emptyList();
     }
diff --git 
a/server/tserver/src/main/java/org/apache/accumulo/tserver/session/SessionManager.java
 
b/server/tserver/src/main/java/org/apache/accumulo/tserver/session/SessionManager.java
index a8a2cc50dc..7ff5b70e35 100644
--- 
a/server/tserver/src/main/java/org/apache/accumulo/tserver/session/SessionManager.java
+++ 
b/server/tserver/src/main/java/org/apache/accumulo/tserver/session/SessionManager.java
@@ -70,12 +70,11 @@ public class SessionManager {
   private final long maxUpdateIdle;
   private final BlockingQueue<Session> deferredCleanupQueue = new 
ArrayBlockingQueue<>(5000);
   private final Long expiredSessionMarker = (long) -1;
-  private final AccumuloConfiguration aconf;
   private final ServerContext ctx;
 
   public SessionManager(ServerContext context) {
     this.ctx = context;
-    this.aconf = context.getConfiguration();
+    final AccumuloConfiguration aconf = context.getConfiguration();
     maxUpdateIdle = 
aconf.getTimeInMillis(Property.TSERV_UPDATE_SESSION_MAXIDLE);
     maxIdle = aconf.getTimeInMillis(Property.TSERV_SESSION_MAXIDLE);
 
@@ -230,22 +229,16 @@ public class SessionManager {
       return true;
     }
 
-    boolean removed = false;
-
     synchronized (session) {
       if (session.state == State.RESERVED) {
         return false;
       }
-
       session.state = State.REMOVED;
-      removed = true;
     }
 
-    if (removed) {
-      sessions.remove(sessionId);
-    }
+    sessions.remove(sessionId);
 
-    return removed;
+    return true;
   }
 
   static void cleanup(BlockingQueue<Session> deferredCleanupQueue, Session 
session) {
@@ -351,7 +344,7 @@ public class SessionManager {
 
     Set<Entry<Long,Session>> copiedIdleSessions = new HashSet<>();
 
-    /**
+    /*
      * Add sessions so that get the list returned in the active scans call
      */
     for (Session session : deferredCleanupQueue) {
@@ -391,7 +384,7 @@ public class SessionManager {
     final long ct = System.currentTimeMillis();
     final Set<Entry<Long,Session>> copiedIdleSessions = new HashSet<>();
 
-    /**
+    /*
      * Add sessions so that get the list returned in the active scans call
      */
     for (Session session : deferredCleanupQueue) {

Reply via email to