Skip to content

Commit

Permalink
[FLINK-22001] Rename JobMasterServiceFactoryNg to JobMasterServiceFac…
Browse files Browse the repository at this point in the history
…tory
  • Loading branch information
tillrohrmann committed Apr 21, 2021
1 parent 6842f3e commit 7b7e8a4
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import org.apache.flink.runtime.jobmaster.JobMasterConfiguration;
import org.apache.flink.runtime.jobmaster.JobMasterServiceLeadershipRunner;
import org.apache.flink.runtime.jobmaster.SlotPoolServiceSchedulerFactory;
import org.apache.flink.runtime.jobmaster.factories.DefaultJobMasterServiceFactoryNg;
import org.apache.flink.runtime.jobmaster.factories.DefaultJobMasterServiceFactory;
import org.apache.flink.runtime.jobmaster.factories.DefaultJobMasterServiceProcessFactory;
import org.apache.flink.runtime.jobmaster.factories.JobManagerJobMetricGroupFactory;
import org.apache.flink.runtime.leaderelection.LeaderElectionService;
Expand Down Expand Up @@ -98,8 +98,8 @@ public JobManagerRunner createJobManagerRunner(
jobGraph.getUserJarBlobKeys(), jobGraph.getClasspaths())
.asClassLoader();

final DefaultJobMasterServiceFactoryNg jobMasterServiceFactory =
new DefaultJobMasterServiceFactoryNg(
final DefaultJobMasterServiceFactory jobMasterServiceFactory =
new DefaultJobMasterServiceFactory(
jobManagerServices.getScheduledExecutorService(),
rpcService,
jobMasterConfiguration,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import org.apache.flink.runtime.concurrent.FutureUtils;
import org.apache.flink.runtime.executiongraph.ArchivedExecutionGraph;
import org.apache.flink.runtime.jobmanager.OnCompletionActions;
import org.apache.flink.runtime.jobmaster.factories.JobMasterServiceFactoryNg;
import org.apache.flink.runtime.jobmaster.factories.JobMasterServiceFactory;
import org.apache.flink.runtime.scheduler.ExecutionGraphInfo;
import org.apache.flink.util.FlinkException;

Expand Down Expand Up @@ -84,7 +84,7 @@ public class DefaultJobMasterServiceProcess
public DefaultJobMasterServiceProcess(
JobID jobId,
UUID leaderSessionId,
JobMasterServiceFactoryNg jobMasterServiceFactory,
JobMasterServiceFactory jobMasterServiceFactory,
Function<Throwable, ArchivedExecutionGraph> failedArchivedExecutionGraphFactory) {
this.jobId = jobId;
this.leaderSessionId = leaderSessionId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.Executor;

public class DefaultJobMasterServiceFactoryNg implements JobMasterServiceFactoryNg {
public class DefaultJobMasterServiceFactory implements JobMasterServiceFactory {

private final Executor executor;
private final RpcService rpcService;
Expand All @@ -57,7 +57,7 @@ public class DefaultJobMasterServiceFactoryNg implements JobMasterServiceFactory
private final ShuffleMaster<?> shuffleMaster;
private final long initializationTimestamp;

public DefaultJobMasterServiceFactoryNg(
public DefaultJobMasterServiceFactory(
Executor executor,
RpcService rpcService,
JobMasterConfiguration jobMasterConfiguration,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ public class DefaultJobMasterServiceProcessFactory implements JobMasterServicePr
private final String jobName;
private final long initializationTimestamp;

private final JobMasterServiceFactoryNg jobMasterServiceFactory;
private final JobMasterServiceFactory jobMasterServiceFactory;

public DefaultJobMasterServiceProcessFactory(
JobID jobId,
String jobName,
long initializationTimestamp,
JobMasterServiceFactoryNg jobMasterServiceFactory) {
JobMasterServiceFactory jobMasterServiceFactory) {
this.jobId = jobId;
this.jobName = jobName;
this.initializationTimestamp = initializationTimestamp;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import java.util.concurrent.CompletableFuture;

/** Factory for the {@link JobMasterService}. */
public interface JobMasterServiceFactoryNg {
public interface JobMasterServiceFactory {

/**
* Creates a new {@link JobMasterService} for the given leaderSessionId and onCompletionActions.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
import org.apache.flink.runtime.jobmaster.TestingJobMasterService;
import org.apache.flink.runtime.jobmaster.factories.DefaultJobMasterServiceProcessFactory;
import org.apache.flink.runtime.jobmaster.factories.JobManagerJobMetricGroupFactory;
import org.apache.flink.runtime.jobmaster.factories.TestingJobMasterServiceFactoryNg;
import org.apache.flink.runtime.jobmaster.factories.TestingJobMasterServiceFactory;
import org.apache.flink.runtime.jobmaster.utils.TestingJobMasterGateway;
import org.apache.flink.runtime.jobmaster.utils.TestingJobMasterGatewayBuilder;
import org.apache.flink.runtime.leaderelection.TestingLeaderElectionService;
Expand Down Expand Up @@ -806,7 +806,7 @@ public JobManagerRunner createJobManagerRunner(
jobGraph.getJobID(),
jobGraph.getName(),
initializationTimestamp,
new TestingJobMasterServiceFactoryNg(
new TestingJobMasterServiceFactory(
() -> {
initLatch.trigger();
final CompletableFuture<JobMasterService> result =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ public class DefaultJobMasterServiceProcessTest extends TestLogger {
jobId, "test", JobStatus.FAILED, throwable, 1337));

private CompletableFuture<JobMasterService> jobMasterServiceFuture = new CompletableFuture<>();
private TestingJobMasterServiceProcessFactory.TestingFutureJobMasterServiceFactoryNg
private TestingJobMasterServiceProcessFactory.TestingFutureJobMasterServiceFactory
jobMasterServiceFactoryNg =
new TestingJobMasterServiceProcessFactory
.TestingFutureJobMasterServiceFactoryNg(jobMasterServiceFuture);
new TestingJobMasterServiceProcessFactory.TestingFutureJobMasterServiceFactory(
jobMasterServiceFuture);

@Test
public void testCloseAfterInitializationFailure()
Expand Down Expand Up @@ -183,7 +183,7 @@ private DefaultJobMasterServiceProcess resetTestAndCreateInstance() {
jobMasterServiceFuture = new CompletableFuture<>();

jobMasterServiceFactoryNg =
new TestingJobMasterServiceProcessFactory.TestingFutureJobMasterServiceFactoryNg(
new TestingJobMasterServiceProcessFactory.TestingFutureJobMasterServiceFactory(
jobMasterServiceFuture);
return new DefaultJobMasterServiceProcess(
jobId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
import org.apache.flink.runtime.jobgraph.JobGraphTestUtils;
import org.apache.flink.runtime.jobgraph.JobVertex;
import org.apache.flink.runtime.jobmaster.factories.DefaultJobMasterServiceProcessFactory;
import org.apache.flink.runtime.jobmaster.factories.JobMasterServiceFactoryNg;
import org.apache.flink.runtime.jobmaster.factories.JobMasterServiceFactory;
import org.apache.flink.runtime.jobmaster.factories.JobMasterServiceProcessFactory;
import org.apache.flink.runtime.jobmaster.factories.TestingJobMasterServiceFactoryNg;
import org.apache.flink.runtime.jobmaster.factories.TestingJobMasterServiceFactory;
import org.apache.flink.runtime.jobmaster.factories.TestingJobMasterServiceProcessFactory;
import org.apache.flink.runtime.jobmaster.utils.TestingJobMasterGatewayBuilder;
import org.apache.flink.runtime.leaderelection.TestingLeaderElectionService;
Expand Down Expand Up @@ -193,7 +193,7 @@ public void testConcurrentLeadershipOperationsBlockingClose() throws Exception {
jobGraph.getJobID(),
jobGraph.getName(),
1L,
new TestingJobMasterServiceFactoryNg(
new TestingJobMasterServiceFactory(
() ->
CompletableFuture.completedFuture(
testingJobMasterServices.poll()))));
Expand Down Expand Up @@ -574,8 +574,8 @@ public static class BlockingJobMasterServiceProcessFactory

private final CompletableFuture<JobMasterService> jobMasterServiceFuture =
new CompletableFuture<>();
private final JobMasterServiceFactoryNg jobMasterServiceFactoryNg =
new TestingJobMasterServiceProcessFactory.TestingFutureJobMasterServiceFactoryNg(
private final JobMasterServiceFactory jobMasterServiceFactoryNg =
new TestingJobMasterServiceProcessFactory.TestingFutureJobMasterServiceFactory(
jobMasterServiceFuture);

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@
import java.util.concurrent.CompletableFuture;
import java.util.function.Supplier;

/** Testing implementation of the {@link JobMasterServiceFactoryNg}. */
public class TestingJobMasterServiceFactoryNg implements JobMasterServiceFactoryNg {
/** Testing implementation of the {@link JobMasterServiceFactory}. */
public class TestingJobMasterServiceFactory implements JobMasterServiceFactory {
private final Supplier<CompletableFuture<JobMasterService>> jobMasterServiceSupplier;

public TestingJobMasterServiceFactoryNg(
public TestingJobMasterServiceFactory(
Supplier<CompletableFuture<JobMasterService>> jobMasterServiceSupplier) {
this.jobMasterServiceSupplier = jobMasterServiceSupplier;
}

public TestingJobMasterServiceFactoryNg() {
public TestingJobMasterServiceFactory() {
this(() -> CompletableFuture.completedFuture(new TestingJobMasterService()));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ public class TestingJobMasterServiceProcessFactory implements JobMasterServicePr

private final CompletableFuture<JobMasterService> jobMasterServiceFuture;
private final JobID jobId;
private final JobMasterServiceFactoryNg jobMasterServiceFactoryNg;
private final JobMasterServiceFactory jobMasterServiceFactoryNg;

public TestingJobMasterServiceProcessFactory(
JobID jobId, CompletableFuture<JobMasterService> jobMasterServiceFuture) {
this.jobId = jobId;
this.jobMasterServiceFuture = jobMasterServiceFuture;
this.jobMasterServiceFactoryNg =
new TestingFutureJobMasterServiceFactoryNg(jobMasterServiceFuture);
new TestingFutureJobMasterServiceFactory(jobMasterServiceFuture);
}

public TestingJobMasterServiceProcessFactory(JobID jobId) {
Expand Down Expand Up @@ -76,12 +76,11 @@ public ArchivedExecutionGraph createArchivedExecutionGraph(
jobId, "test-job", jobStatus, cause, System.currentTimeMillis());
}

public static class TestingFutureJobMasterServiceFactoryNg
implements JobMasterServiceFactoryNg {
public static class TestingFutureJobMasterServiceFactory implements JobMasterServiceFactory {

final CompletableFuture<JobMasterService> jobMasterServiceFuture;

public TestingFutureJobMasterServiceFactoryNg(
public TestingFutureJobMasterServiceFactory(
CompletableFuture<JobMasterService> jobMasterServiceFuture) {
this.jobMasterServiceFuture = jobMasterServiceFuture;
}
Expand Down

0 comments on commit 7b7e8a4

Please sign in to comment.