private void validateLogicalShardId(final long logicalShardId){
  if (logicalShardId < MIN_LOGICAL_SHARD_ID || logicalShardId > MAX_LOGICAL_SHARD_ID) {
    throw new InvalidLogicalShardIdException("The logical shard ID set in Redis is less than " + String.valueOf(MIN_LOGICAL_SHARD_ID) + " or is greater than the supported maximum of "+ String.valueOf(MAX_LOGICAL_SHARD_ID));
  }
}

private void validateLogicalShardId ( final long logicalShardId ) { if ( logicalShardId < MIN_LOGICAL_SHARD_ID || logicalShardId > MAX_LOGICAL_SHARD_ID ) { throw new InvalidLogicalShardIdException ( "The logical shard ID set in Redis is less than " + String . valueOf ( MIN_LOGICAL_SHARD_ID ) + " or is greater than the supported maximum of " + String . valueOf ( MAX_LOGICAL_SHARD_ID ) ) ; } }
check that the given logical shard id is within the bounds that we allow . this is important to check , as otherwise when bit - shifting we may lose digits outside of the bits we care about , introducing possible collisions .
