@Override
        public int compare(TopicPartitionReplicaUpdater.TopicPartitionReplica p1, TopicPartitionReplicaUpdater.TopicPartitionReplica p2) {
            boolean isCritical1 = GoalUtils.isCriticalTopic(p1.getTopicPartition().topic());
            boolean isCritical2 = GoalUtils.isCriticalTopic(p2.getTopicPartition().topic());
            if (isCritical1 && !isCritical2) {
                return 1;
            } else if (!isCritical1 && isCritical2) {
                return -1;
            }
            return Double.compare(p2.loadValue(resource), p1.loadValue(resource));
        }
Try to increase resource load by move or swap replicas in.

@param actionType       type of action
@param cluster          cluster model
@param srcBroker        broker to increase load
@param candidateBrokers candidate brokers to move replicas from, or swap replicas with
@param goalsByPriority  all configured goals sorted by priority
@return a list of actions able to increase load of srcBroker along with load change
core/src/main/java/kafka/autobalancer/goals/AbstractResourceGoal.java