cameronlee314 commented on a change in pull request #1515: URL: https://github.com/apache/samza/pull/1515#discussion_r694384924
########## File path: samza-core/src/main/java/org/apache/samza/coordinator/JobModelCalculator.java ########## @@ -0,0 +1,239 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.samza.coordinator; + +import java.util.ArrayList; +import java.util.Comparator; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Optional; +import java.util.Set; +import java.util.TreeMap; +import java.util.function.Function; +import java.util.regex.Pattern; +import java.util.stream.Collectors; +import org.apache.samza.Partition; +import org.apache.samza.config.ClusterManagerConfig; +import org.apache.samza.config.Config; +import org.apache.samza.config.ConfigException; +import org.apache.samza.config.JobConfig; +import org.apache.samza.config.MapConfig; +import org.apache.samza.config.RegExTopicGenerator; +import org.apache.samza.config.TaskConfig; +import org.apache.samza.container.TaskName; +import org.apache.samza.container.grouper.stream.SSPGrouperProxy; +import org.apache.samza.container.grouper.stream.SystemStreamPartitionGrouper; +import org.apache.samza.container.grouper.stream.SystemStreamPartitionGrouperFactory; +import org.apache.samza.container.grouper.task.GrouperMetadata; +import org.apache.samza.container.grouper.task.TaskNameGrouperFactory; +import org.apache.samza.container.grouper.task.TaskNameGrouperProxy; +import org.apache.samza.job.model.ContainerModel; +import org.apache.samza.job.model.JobModel; +import org.apache.samza.job.model.TaskModel; +import org.apache.samza.system.StreamMetadataCache; +import org.apache.samza.system.SystemStream; +import org.apache.samza.system.SystemStreamMetadata; +import org.apache.samza.system.SystemStreamPartition; +import org.apache.samza.system.SystemStreamPartitionMatcher; +import org.apache.samza.util.ConfigUtil; +import org.apache.samza.util.ReflectionUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import scala.collection.JavaConverters; + + +public class JobModelCalculator { Review comment: This will be injected as a dependency into a component in an upcoming PR. It's used like a utility class in these current places for compatibility with existing usage. For testing, it is harder to mock `final` classes, so I'd like to leave this as non-final for the future tests for when this is injected as a dependency instead of using a static method call. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
