private boolean shouldDoCleanUpPropertyStore(String instance, Set<String> liveInstances,
      Set<String> instancesInIdealStateAndExternalView) {
    if(liveInstances.contains(instance)) {
      logger.trace("Instance {} is live, skipping cleanup", instance);
      return false;
    }
    if(instancesInIdealStateAndExternalView.contains(instance)) {
      logger.trace("Instance {} is present in ideal state or external view, skipping cleanup", instance);
      return false;
    }
    return true;
  }
Cleanup should be done if the instance is not live and not present in ideal state or external view
@param liveInstances Set of live instances
@param instancesInIdealStateAndExternalView Set of instances in ideal state and external view
@return
ambry-clustermap/src/main/java/com/github/ambry/clustermap/PropertyStoreCleanUpTask.java