public IgniteUuid affinityKey(long blockOff,boolean includeMoved){
  if (ranges == null)   return null;
  assert !ranges.isEmpty();
  int leftIdx=0, rightIdx=ranges.size() - 1;
  IgfsFileAffinityRange leftRange=ranges.get(leftIdx);
  IgfsFileAffinityRange rightRange=ranges.get(rightIdx);
  if (leftRange.less(blockOff))   return null;
  if (leftRange.belongs(blockOff))   return leftRange.status() != RANGE_STATUS_MOVED ? leftRange.affinityKey() : includeMoved ? leftRange.affinityKey() : null;
  if (rightRange.greater(blockOff))   return null;
  if (rightRange.belongs(blockOff))   return rightRange.status() != RANGE_STATUS_MOVED ? rightRange.affinityKey() : includeMoved ? leftRange.affinityKey() : null;
  while (rightIdx - leftIdx > 1) {
    int midIdx=(leftIdx + rightIdx) / 2;
    IgfsFileAffinityRange midRange=ranges.get(midIdx);
    if (midRange.belongs(blockOff))     return midRange.status() != RANGE_STATUS_MOVED ? midRange.affinityKey() : includeMoved ? leftRange.affinityKey() : null;
    if (midRange.less(blockOff))     rightIdx=midIdx;
 else {
      assert midRange.greater(blockOff);
      leftIdx=midIdx;
    }
  }
  return null;
}

public IgniteUuid affinityKey ( long blockOff , boolean includeMoved ) { if ( ranges == null ) return null ; assert ! ranges . isEmpty ( ) ; int leftIdx = 0 , rightIdx = ranges . size ( ) - 1 ; IgfsFileAffinityRange leftRange = ranges . get ( leftIdx ) ; IgfsFileAffinityRange rightRange = ranges . get ( rightIdx ) ; if ( leftRange . less ( blockOff ) ) return null ; if ( leftRange . belongs ( blockOff ) ) return leftRange . status ( ) != RANGE_STATUS_MOVED ? leftRange . affinityKey ( ) : includeMoved ? leftRange . affinityKey ( ) : null ; if ( rightRange . greater ( blockOff ) ) return null ; if ( rightRange . belongs ( blockOff ) ) return rightRange . status ( ) != RANGE_STATUS_MOVED ? rightRange . affinityKey ( ) : includeMoved ? leftRange . affinityKey ( ) : null ; while ( rightIdx - leftIdx > 1 ) { int midIdx = ( leftIdx + rightIdx ) / 2 ; IgfsFileAffinityRange midRange = ranges . get ( midIdx ) ; if ( midRange . belongs ( blockOff ) ) return midRange . status ( ) != RANGE_STATUS_MOVED ? midRange . affinityKey ( ) : includeMoved ? leftRange . affinityKey ( ) : null ; if ( midRange . less ( blockOff ) ) rightIdx = midIdx ; else { assert midRange . greater ( blockOff ) ; leftIdx = midIdx ; } } return null ; }
gets affinity key from file map based on block start offset .
