keith-turner commented on code in PR #3331:
URL: https://github.com/apache/accumulo/pull/3331#discussion_r1180523739


##########
server/manager/src/main/java/org/apache/accumulo/manager/TabletGroupWatcher.java:
##########
@@ -924,7 +925,8 @@ private void getAssignmentsFromBalancer(TabletLists tLists,
                   lastLocation.getHostPort());
             }
 
-            tLists.assignments.add(new Assignment(assignment.getKey(), 
assignment.getValue()));
+            tLists.assignments.add(new Assignment(assignment.getKey(), 
assignment.getValue(),
+                lastLocation != null ? Location.last(lastLocation) : null));

Review Comment:
   Looking around in the code I am not entirely sure `lastLocation` is actually 
a location from the last column. Not sure what the value in the map is for ATM. 
 Entries are added to the unassigned map in the following method and that does 
not look like its adding things from the last column to the map.
   
   
https://github.com/apache/accumulo/blob/9c459ce8f06d9d9e04280d020ea091fedf13749b/server/manager/src/main/java/org/apache/accumulo/manager/TabletGroupWatcher.java#L383-L399



##########
server/base/src/main/java/org/apache/accumulo/server/manager/state/Assignment.java:
##########
@@ -20,13 +20,16 @@
 
 import org.apache.accumulo.core.dataImpl.KeyExtent;
 import org.apache.accumulo.core.metadata.TServerInstance;
+import org.apache.accumulo.core.metadata.schema.TabletMetadata.Location;
 
 public class Assignment {
-  public KeyExtent tablet;
-  public TServerInstance server;
+  public final KeyExtent tablet;
+  public final TServerInstance server;
+  public final Location lastLocation;
 
-  public Assignment(KeyExtent tablet, TServerInstance server) {
+  public Assignment(KeyExtent tablet, TServerInstance server, Location 
lastLocation) {

Review Comment:
   ```suggestion
     public Assignment(KeyExtent tablet, TServerInstance server, Location 
lastLocation) {
       Preconditions.checkArgument(lastLocation == null || 
lastLocation.getType() == TabletMetadata.LocationType.LAST);
   ```



##########
server/base/src/main/java/org/apache/accumulo/server/util/ManagerMetadataUtil.java:
##########
@@ -253,18 +253,16 @@ public static Optional<StoredTabletFile> 
updateTabletDataFile(ServerContext cont
    * last location if needed and set the new last location
    *
    * @param context The server context
-   * @param ample The metadata persistence layer
    * @param tabletMutator The mutator being built
-   * @param extent The tablet extent
    * @param location The new location
+   * @param lastLocation The previous last location, which may be null
    */
-  public static void updateLastForAssignmentMode(ClientContext context, Ample 
ample,
-      Ample.TabletMutator tabletMutator, KeyExtent extent, TServerInstance 
location) {
+  public static void updateLastForAssignmentMode(ClientContext context,
+      Ample.TabletMutator tabletMutator, TServerInstance location, Location 
lastLocation) {
     // if the location mode is assignment, then preserve the current location 
in the last
     // location value
+    log.info("Loaded Last location: {}", lastLocation);

Review Comment:
   Was this added for your own debugging?  



##########
server/base/src/main/java/org/apache/accumulo/server/util/ManagerMetadataUtil.java:
##########
@@ -253,18 +253,16 @@ public static Optional<StoredTabletFile> 
updateTabletDataFile(ServerContext cont
    * last location if needed and set the new last location
    *
    * @param context The server context
-   * @param ample The metadata persistence layer
    * @param tabletMutator The mutator being built
-   * @param extent The tablet extent
    * @param location The new location
+   * @param lastLocation The previous last location, which may be null
    */
-  public static void updateLastForAssignmentMode(ClientContext context, Ample 
ample,
-      Ample.TabletMutator tabletMutator, KeyExtent extent, TServerInstance 
location) {
+  public static void updateLastForAssignmentMode(ClientContext context,
+      Ample.TabletMutator tabletMutator, TServerInstance location, Location 
lastLocation) {

Review Comment:
   ```suggestion
         Ample.TabletMutator tabletMutator, TServerInstance location, Location 
lastLocation) {
           Preconditions.checkArgument(lastLocation == null || 
lastLocation.getType() == TabletMetadata.LocationType.LAST);
   ```



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to