private void registerPatternInMap(Object interest, Set keysRegistered, Long clientID,
      Map<Object, Map<Object, Pattern>> pats) {
    Pattern pattern = Pattern.compile((String) interest);
    Map<Object, Pattern> interestMap = pats.get(clientID);
    if (interestMap == null) {
      interestMap = new CopyOnWriteHashMap<>();
      pats.put(clientID, interestMap);
    }
    Pattern oldPattern = interestMap.put(interest, pattern);
    if (oldPattern == null) {
      // If the pattern didn't exist, add it to the set of keys to pass to any listeners.
      keysRegistered.add(interest);
    }
  }
Registers interest in the input region name and key

@param inputClientID The identity of the interested client
@param interest The key in which to register interest
@param typeOfInterest the type of interest the client is registering
@param updatesAsInvalidates whether the client just wants invalidations
@return a set of the keys that were registered, which may be null
geode-core/src/main/java/org/apache/geode/internal/cache/FilterProfile.java