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

 ##########
 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:
   Good to know, I will look for an alternative solution.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to