private HadoopVersion getHadoopVersionFromResult ( final JobHistoryKeys key , final NavigableMap < byte [ ] , byte [ ] > infoValues ) { byte [ ] value = infoValues . get ( JobHistoryKeys . KEYS_TO_BYTES . get ( key ) ) ; if ( value != null ) { String hv = Bytes . toString ( value ) ; // could throw an NPE or IllegalArgumentException return HadoopVersion . valueOf ( hv ) ; } else { // default is hadoop 1 return HadoopVersion . ONE ; } }
return an enum value from the NavigableMap for hadoop version