private static PartitionResolver getResolver(PartitionedRegion pr, Object key,
      Object callbackArgument) {
    // First choice is one associated with the region
    PartitionResolver result = pr.getPartitionResolver();
    if (result != null) {
      return result;
    }

    // Second is the key
    if (key != null && key instanceof PartitionResolver) {
      return (PartitionResolver) key;
    }

    // Third is the callback argument
    if (callbackArgument != null && callbackArgument instanceof PartitionResolver) {
      return (PartitionResolver) callbackArgument;
    }

    // There is no resolver.
    return null;
  }
Runs hashCode() on given key producing a long value and then finds absolute value of the
modulus with bucketSize. For better key distribution, possibly use MD5 or SHA or any unique ID
generator for the hash function.

@param pr the partitioned region on which to operate
@param key the key on which to determine the hash key
@return the bucket id the key hashes to
geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegionHelper.java