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

   Also add validation to StoredTabletFile validation method and on 
serialization.
   
   This makes 3 changes to the validation added in 
883d3d8b32faf839b98b6f3a604bc0d3f8813302
   
   1. Validation has been moved to the constructor of `AbstractTabletFile` from 
ReferencedTabletFile/StoredTabletFile as all TabletFiles should have the range 
validated to be a row range.
   2. Validation was added in the serialization method inside of 
StoredTabletFile so we can make sure that we validate before serialization as 
this method is public/static and can be called outside of the constructor.
   3. I also added row range validation to the validate() method inside of 
MetadataConstraints but this may not be needed because when metadata is read 
and deserialized the code that processes the json will only 
[construct](https://github.com/cshannon/accumulo/blob/3e764c50512298631c00ccd9056e4ef738674c60/core/src/main/java/org/apache/accumulo/core/metadata/StoredTabletFile.java#L209)
 the Range correctly with just the rows and correct inclusive/exclusive for 
start/end keys.
   
   I looked at adding a test to MetadataConstraintsTest but I couldn't figure 
out a good way because essentially all the validation checks and serialization 
code now prevent being able to screw things up because even if I manually 
modified metadata to store a bad Range it won't be read (such as adding a CF) 
because the format for storing in the table only stores the row portion of the 
ranges and re-constructs correctly.


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