You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2019/12/12 18:21:57 UTC

[GitHub] [accumulo] keith-turner commented on a change in pull request #1453: WIP Update Last Location. Solution for #1169

keith-turner commented on a change in pull request #1453: WIP Update Last Location. Solution for #1169
URL: https://github.com/apache/accumulo/pull/1453#discussion_r357298509
 
 

 ##########
 File path: server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java
 ##########
 @@ -2730,6 +2730,44 @@ public void updateTabletDataFile(long maxCommittedTime, FileRef newDatafile, Fil
 
   }
 
+  /**
+   * Handles updating a tablets last Location
+   */
+  public void updateLastLocation(){
+    //unsure if this sync block is needed here. Need input.
+    synchronized (timeLock){
+    persistedTime = tabletTime.getAndUpdateTime();
+
+      MasterMetadataUtil.updateLastLocation(getTabletServer().getContext(), extent, tabletTime.getMetadataTime(persistedTime),
+                tabletServer.getClientAddressString(), tabletServer.getLock(),
+                lastLocation);
+
+      lastLocation = null;
+    }
+  }
+
+  /**
+   * Checks if a tablets last location needs to be updated
+   */
+  public boolean needsLastUpdate() {
+    boolean needsUpdate = false;
+    if (isClosing() || isClosed()) {
+      return false;
+    }
+    
+    Tablet t = tabletServer.getOnlineTablet(extent);
+    //will keep looking for a better way to check if a tablet is old and needs to be updated or not. In the mean time, this works and is adjustable.
+    long currentTime = tabletTime.getAndUpdateTime();
 
 Review comment:
   tabletTime is not suitable for this type of timing information.  It tracks the time stamp that should be placed in keys and its implementation could just be a one 64bit counter that has nothing to do with wall clock time.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services