public Collection<Address> getWriteOwners(Collection<?> keys) {
      if (keys.isEmpty()) {
         return Collections.emptySet();
      }
      if (isDistributed || isScattered) {
         if (keys.size() == 1) {
            Object singleKey = keys.iterator().next();
            return getDistribution(singleKey).writeOwners();
         } else {
            IntSet segments = IntSets.mutableEmptySet(numSegments);
            // Expecting some overlap between keys
            Set<Address> owners = new HashSet<>(2 * maxOwners);
            for (Object key : keys) {
               int segment = keyPartitioner.getSegment(key);
               if (segments.add(segment)) {
                  owners.addAll(getSegmentDistribution(segment).writeOwners());
               }
            }
            return owners;
         }
      } else {
         return getSegmentDistribution(0).writeOwners();
      }
   }
public Collection < Address > getWriteOwners ( Collection < ? > keys ) { if ( keys . isEmpty ( ) ) { return Collections . emptySet ( ) ; } if ( isDistributed || isScattered ) { if ( keys . size ( ) == 1 ) { Object singleKey = keys . iterator ( ) . next ( ) ; return getDistribution ( singleKey ) . writeOwners ( ) ; } else { IntSet segments = IntSets . mutableEmptySet ( numSegments ) ; Set < Address > owners = new HashSet < > ( 2 * maxOwners ) ; for ( Object key : keys ) { int segment = keyPartitioner . getSegment ( key ) ; if ( segments . add ( segment ) ) { owners . addAll ( getSegmentDistribution ( segment ) . writeOwners ( ) ) ; } } return owners ; } } else { return getSegmentDistribution ( 0 ) . writeOwners ( ) ; } }
@return An unordered collection with the write owners of {@code keys}.