Thank you for the detailed review Sean Busbey.
It would be nice if the returned values from getAllStoragePolicies were usable in a setStoragePolicy method.
getAllStoragePolicies returns a collection, you can use BlockStoragePolicySpi#getName on a collection element as the parameter to setStoragePolicy.
Could we update the FileSystem specification documents?
Which specification docs are you referring to?
Note that it's an optional operation and some implementations will throw UnsupportOperationException.
Let's do that separately for all FileSystem API calls that fit the same pattern.
The method "getStoragePolicyNames" didn't make it into the patch. Update to point at new method?
Should this return type be Collection<? extends BlockStoragePolicySpi> ? does the ordering matter? Maybe it should be a Set?
Fixed to return a Collection.
Could we switch to calling the interface BlockStoragePolicy and make the one in HDFS "DFSBlockStoragePolicy" or the like? "Spi" is a term of art that's going to be less accessible for folks.
Should the various return types in BlockStoragePolicySpi be returning List or Set or SortedSet?
I agree on both points. However it's likely incompatible since BlockStoragePolicy was exposed via a limited private interface in 2.6.
nit: this whitespace fix doesn't appear related to the rest of the changes in the file (but I'm not sure what Hadoop's norm is for 'related')
Good catch, IntelliJ slipped that in. Fixed.