private AppKey getNewAppKeyFromResult ( Result result , long startTime , long endTime ) throws IOException { byte [ ] rowKey = result . getRow ( ) ; byte [ ] [ ] keyComponents = ByteUtil . split ( rowKey , Constants . SEP_BYTES ) ; String cluster = Bytes . toString ( keyComponents [ 0 ] ) ; String user = Bytes . toString ( keyComponents [ 1 ] ) ; String appId = Bytes . toString ( keyComponents [ 2 ] ) ; NavigableMap < byte [ ] , byte [ ] > valueMap = result . getFamilyMap ( Constants . INFO_FAM_BYTES ) ; long runId = Long . MAX_VALUE ; for ( Map . Entry < byte [ ] , byte [ ] > entry : valueMap . entrySet ( ) ) { long tsl = Bytes . toLong ( entry . getValue ( ) ) ; // get the earliest runid, which indicates the first time this app ran if ( tsl < runId ) { runId = tsl ; } } if ( ( runId >= startTime ) && ( runId <= endTime ) ) { AppKey ak = new AppKey ( cluster , user , appId ) ; return ak ; } return null ; }
constructs App key from the result set based on cluster user appId picks those results that satisfy the time range criteria