cshannon opened a new pull request, #3417:
URL: https://github.com/apache/accumulo/pull/3417

   This PR fixes #2830  (not having a hashcode/equals in StoredTabletFile) by 
leveraging the newly added 
[AbstractTabletFile](https://github.com/apache/accumulo/blob/4d933f1a285fb1a5c323bf58062fb05d3110dd91/core/src/main/java/org/apache/accumulo/core/metadata/AbstractTabletFile.java)
 class and by changing `StoredTabletFile` to extend that class and become a 
sibling of `TabletFile`. Also, there is now a composition relationship between 
StoredTabletFile and TabletFile instead of "is a" relationship. 
(StoredTabletFile now contains a TabletFile).
   
   The composition relationship fixes the issues of equality using the same 
strategy as the [fix](https://github.com/apache/accumulo/pull/3257) for #3254. 
Also, by updating `StoredTabletFile` to extend `AbstractTabletFile` this has 
the nice side effect of being able to directly pass it to FileOperations as 
FileOperations now 
[supports](https://github.com/apache/accumulo/blob/4d933f1a285fb1a5c323bf58062fb05d3110dd91/core/src/main/java/org/apache/accumulo/core/file/FileOperations.java#L190)
 AbstractTabletFile. Lastly, by using composition we can still leverage the 
existing 
[validation](https://github.com/apache/accumulo/blob/4d933f1a285fb1a5c323bf58062fb05d3110dd91/core/src/main/java/org/apache/accumulo/core/metadata/TabletFile.java#L55-L74)
 checks done in TabletFile when that object is created in the StoredTabletFile 
constructor.
   
   StoredTabletFile now implements hashcode, equals, and compareTo() and uses 
the metadataString (exact String in the metadata table) as the comparision. I 
also added a few delegation methods to TabletFile just as a shortcut to make it 
easier to call certain methods.
   
   As part of these changes I updated each place in the code with the correct 
usage, either StoredTabletFile or TabletFile. Several places in the code used 
to interchangeably jump back and forth between the two (since there was an "is 
a" relationship) and that has now been fixed. The end result is every place in 
the code where we are using files loaded from metadata ends up being a 
StoredTabletFile and in other case just TabletFile is used.
   
   This fixes #2830


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