Hello everyone, I've tried a few things while working on this but would appreciate some suggestions on how to move forward. Or perhaps decide not to.
I've pushed a very limited version of this up here: https://github.com/jacobwil/incubator-pirk/compare/master...jacobwil:EnumForTypesInDataPartitioner In this limited version we move knowledge of the size of each type (and appropriate number of partitions) into the enum making it easier to reuse that logic without reproducing entire getNumPartitions and getBits methods in each DataPartitioner implementation. I think this is worth keeping. Basically, I made PrimitiveTypeEnum which holds each of the primitive types, can provide their bit size, and their number of partitions. Callers to PrimitiveTypePartitioner still provide types as strings which PrimitiveTypePartitioner converts into PrimitiveTypeEnums. In my original attempt I took this further and started to change interface DataPartitioner into DataPartitioner<T extends TypeEnum> and PrimitiveTypePartitioner into PrimitiveTypePartitioner<PrimitiveTypeEnum>, etc. I managed to push the string-to-enum conversion most of the way up to LoadDataSchemas. That's when I started to wrestle with just how much more complex this was becoming. While it's possible to have the instantiation of the DataPartitioner (as requested by the XML file) provide a factory method that converts string-represented-type information into the correct TypeEnum, I'd appreciate some feedback on if we consider this to truly be valuable. — Jacob WIlder
