This is an automated email from the ASF dual-hosted git repository.
zhangliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new 8d6327f97b2 Add PersistCoordinatorFacade (#34205)
8d6327f97b2 is described below
commit 8d6327f97b2561e7f6e2cf4f3b2161f24395a312
Author: Liang Zhang <[email protected]>
AuthorDate: Sun Dec 29 23:44:22 2024 +0800
Add PersistCoordinatorFacade (#34205)
* Add PersistCoordinatorFacade
* Add PersistCoordinatorFacade
* Add PersistCoordinatorFacade
* Add PersistCoordinatorFacade
---
.../mode/manager/ContextManager.java | 4 ++
.../coordinator/PersistCoordinatorFacade.java | 37 +++++++++++
.../PersistCoordinatorFacadeBuilder.java | 37 +++++++++++
.../ProcessPersistCoordinator.java} | 26 +-------
.../service/divided/ProcessPersistService.java | 16 -----
.../PersistCoordinatorFacadeBuilderFixture.java | 40 ++++++++++++
...ist.coordinator.PersistCoordinatorFacadeBuilder | 18 +++++
.../type/ProcessListChangedSubscriber.java | 6 +-
.../ClusterPersistCoordinatorFacadeBuilder.java | 38 +++++++++++
.../ClusterProcessPersistCoordinator.java | 55 ++++++++++++++++
.../service/ClusterProcessPersistService.java | 17 -----
...ist.coordinator.PersistCoordinatorFacadeBuilder | 18 +++++
.../type/ProcessListChangedSubscriberTest.java | 6 +-
.../ClusterProcessPersistCoordinatorTest.java | 76 ++++++++++++++++++++++
.../service/ClusterProcessPersistServiceTest.java | 24 -------
...StandalonePersistCoordinatorFacadeBuilder.java} | 30 ++++-----
.../service/StandaloneProcessPersistService.java | 8 ---
...ist.coordinator.PersistCoordinatorFacadeBuilder | 18 +++++
.../ProxyDatabaseConnectionManagerTest.java | 3 +-
.../backend/connector/ProxySQLExecutorTest.java | 3 +-
.../proxy/backend/context/ProxyContextTest.java | 2 +-
.../ral/updatable/SetDistVariableExecutorTest.java | 3 +-
.../frontend/state/impl/OKProxyStateTest.java | 3 +-
23 files changed, 368 insertions(+), 120 deletions(-)
diff --git
a/mode/core/src/main/java/org/apache/shardingsphere/mode/manager/ContextManager.java
b/mode/core/src/main/java/org/apache/shardingsphere/mode/manager/ContextManager.java
index 71c3f8ab855..4ad11c2200d 100644
---
a/mode/core/src/main/java/org/apache/shardingsphere/mode/manager/ContextManager.java
+++
b/mode/core/src/main/java/org/apache/shardingsphere/mode/manager/ContextManager.java
@@ -37,6 +37,7 @@ import
org.apache.shardingsphere.mode.manager.listener.ContextManagerLifecycleLi
import org.apache.shardingsphere.mode.metadata.MetaDataContextManager;
import org.apache.shardingsphere.mode.metadata.MetaDataContexts;
import org.apache.shardingsphere.mode.persist.PersistServiceFacade;
+import
org.apache.shardingsphere.mode.persist.coordinator.PersistCoordinatorFacade;
import org.apache.shardingsphere.mode.spi.PersistRepository;
import org.apache.shardingsphere.mode.state.ClusterStateContext;
@@ -64,6 +65,8 @@ public final class ContextManager implements AutoCloseable {
private final MetaDataContextManager metaDataContextManager;
+ private final PersistCoordinatorFacade persistCoordinatorFacade;
+
public ContextManager(final MetaDataContexts metaDataContexts, final
ComputeNodeInstanceContext computeNodeInstanceContext, final PersistRepository
repository) {
this.metaDataContexts = new AtomicReference<>(metaDataContexts);
this.computeNodeInstanceContext = computeNodeInstanceContext;
@@ -74,6 +77,7 @@ public final class ContextManager implements AutoCloseable {
for (ContextManagerLifecycleListener each :
ShardingSphereServiceLoader.getServiceInstances(ContextManagerLifecycleListener.class))
{
each.onInitialized(this);
}
+ persistCoordinatorFacade = new PersistCoordinatorFacade(repository,
computeNodeInstanceContext.getModeConfiguration());
}
/**
diff --git
a/mode/core/src/main/java/org/apache/shardingsphere/mode/persist/coordinator/PersistCoordinatorFacade.java
b/mode/core/src/main/java/org/apache/shardingsphere/mode/persist/coordinator/PersistCoordinatorFacade.java
new file mode 100644
index 00000000000..28f1a4e72de
--- /dev/null
+++
b/mode/core/src/main/java/org/apache/shardingsphere/mode/persist/coordinator/PersistCoordinatorFacade.java
@@ -0,0 +1,37 @@
+/*
+ * 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.shardingsphere.mode.persist.coordinator;
+
+import lombok.Getter;
+import org.apache.shardingsphere.infra.config.mode.ModeConfiguration;
+import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader;
+import org.apache.shardingsphere.mode.spi.PersistRepository;
+
+/**
+ * Persist coordinator facade.
+ */
+@Getter
+public final class PersistCoordinatorFacade {
+
+ private final ProcessPersistCoordinator processPersistCoordinator;
+
+ public PersistCoordinatorFacade(final PersistRepository repository, final
ModeConfiguration modeConfig) {
+ PersistCoordinatorFacadeBuilder builder =
TypedSPILoader.getService(PersistCoordinatorFacadeBuilder.class,
modeConfig.getType());
+ processPersistCoordinator =
builder.buildProcessPersistCoordinator(repository);
+ }
+}
diff --git
a/mode/core/src/main/java/org/apache/shardingsphere/mode/persist/coordinator/PersistCoordinatorFacadeBuilder.java
b/mode/core/src/main/java/org/apache/shardingsphere/mode/persist/coordinator/PersistCoordinatorFacadeBuilder.java
new file mode 100644
index 00000000000..be24d682a3b
--- /dev/null
+++
b/mode/core/src/main/java/org/apache/shardingsphere/mode/persist/coordinator/PersistCoordinatorFacadeBuilder.java
@@ -0,0 +1,37 @@
+/*
+ * 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.shardingsphere.mode.persist.coordinator;
+
+import org.apache.shardingsphere.infra.spi.annotation.SingletonSPI;
+import org.apache.shardingsphere.infra.spi.type.typed.TypedSPI;
+import org.apache.shardingsphere.mode.spi.PersistRepository;
+
+/**
+ * Persist coordinator facade builder.
+ */
+@SingletonSPI
+public interface PersistCoordinatorFacadeBuilder extends TypedSPI {
+
+ /**
+ * Build process persist coordinator.
+ *
+ * @param repository persist repository
+ * @return built process persist coordinator
+ */
+ ProcessPersistCoordinator buildProcessPersistCoordinator(PersistRepository
repository);
+}
diff --git
a/mode/core/src/main/java/org/apache/shardingsphere/mode/persist/service/divided/ProcessPersistService.java
b/mode/core/src/main/java/org/apache/shardingsphere/mode/persist/coordinator/ProcessPersistCoordinator.java
similarity index 67%
copy from
mode/core/src/main/java/org/apache/shardingsphere/mode/persist/service/divided/ProcessPersistService.java
copy to
mode/core/src/main/java/org/apache/shardingsphere/mode/persist/coordinator/ProcessPersistCoordinator.java
index 894424fc4b9..46d56418f79 100644
---
a/mode/core/src/main/java/org/apache/shardingsphere/mode/persist/service/divided/ProcessPersistService.java
+++
b/mode/core/src/main/java/org/apache/shardingsphere/mode/persist/coordinator/ProcessPersistCoordinator.java
@@ -15,17 +15,12 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.mode.persist.service.divided;
-
-import org.apache.shardingsphere.infra.executor.sql.process.Process;
-
-import java.sql.SQLException;
-import java.util.Collection;
+package org.apache.shardingsphere.mode.persist.coordinator;
/**
- * Process persist service.
+ * Process persist coordinator.
*/
-public interface ProcessPersistService {
+public interface ProcessPersistCoordinator {
/**
* Report local processes.
@@ -35,21 +30,6 @@ public interface ProcessPersistService {
*/
void reportLocalProcesses(String instanceId, String taskId);
- /**
- * Get process list.
- *
- * @return collection of process
- */
- Collection<Process> getProcessList();
-
- /**
- * Kill process.
- *
- * @param processId process id
- * @throws SQLException SQL exception
- */
- void killProcess(String processId) throws SQLException;
-
/**
* Clean process.
*
diff --git
a/mode/core/src/main/java/org/apache/shardingsphere/mode/persist/service/divided/ProcessPersistService.java
b/mode/core/src/main/java/org/apache/shardingsphere/mode/persist/service/divided/ProcessPersistService.java
index 894424fc4b9..0794364a6b8 100644
---
a/mode/core/src/main/java/org/apache/shardingsphere/mode/persist/service/divided/ProcessPersistService.java
+++
b/mode/core/src/main/java/org/apache/shardingsphere/mode/persist/service/divided/ProcessPersistService.java
@@ -27,14 +27,6 @@ import java.util.Collection;
*/
public interface ProcessPersistService {
- /**
- * Report local processes.
- *
- * @param instanceId instance ID
- * @param taskId task ID
- */
- void reportLocalProcesses(String instanceId, String taskId);
-
/**
* Get process list.
*
@@ -49,12 +41,4 @@ public interface ProcessPersistService {
* @throws SQLException SQL exception
*/
void killProcess(String processId) throws SQLException;
-
- /**
- * Clean process.
- *
- * @param instanceId instance ID
- * @param processId process ID
- */
- void cleanProcess(String instanceId, String processId);
}
diff --git
a/mode/core/src/test/java/org/apache/shardingsphere/mode/fixture/PersistCoordinatorFacadeBuilderFixture.java
b/mode/core/src/test/java/org/apache/shardingsphere/mode/fixture/PersistCoordinatorFacadeBuilderFixture.java
new file mode 100644
index 00000000000..8c780c2be3e
--- /dev/null
+++
b/mode/core/src/test/java/org/apache/shardingsphere/mode/fixture/PersistCoordinatorFacadeBuilderFixture.java
@@ -0,0 +1,40 @@
+/*
+ * 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.shardingsphere.mode.fixture;
+
+import
org.apache.shardingsphere.mode.persist.coordinator.PersistCoordinatorFacadeBuilder;
+import
org.apache.shardingsphere.mode.persist.coordinator.ProcessPersistCoordinator;
+import org.apache.shardingsphere.mode.spi.PersistRepository;
+
+public final class PersistCoordinatorFacadeBuilderFixture implements
PersistCoordinatorFacadeBuilder {
+
+ @Override
+ public ProcessPersistCoordinator buildProcessPersistCoordinator(final
PersistRepository repository) {
+ return null;
+ }
+
+ @Override
+ public Object getType() {
+ return "foo_type";
+ }
+
+ @Override
+ public boolean isDefault() {
+ return true;
+ }
+}
diff --git
a/mode/core/src/test/resources/META-INF/services/org.apache.shardingsphere.mode.persist.coordinator.PersistCoordinatorFacadeBuilder
b/mode/core/src/test/resources/META-INF/services/org.apache.shardingsphere.mode.persist.coordinator.PersistCoordinatorFacadeBuilder
new file mode 100644
index 00000000000..b662f6af130
--- /dev/null
+++
b/mode/core/src/test/resources/META-INF/services/org.apache.shardingsphere.mode.persist.coordinator.PersistCoordinatorFacadeBuilder
@@ -0,0 +1,18 @@
+#
+# 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.
+#
+
+org.apache.shardingsphere.mode.fixture.PersistCoordinatorFacadeBuilderFixture
diff --git
a/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/event/dispatch/subscriber/type/ProcessListChangedSubscriber.java
b/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/event/dispatch/subscriber/type/ProcessListChangedSubscriber.java
index 32f22434919..4216bc6a19a 100644
---
a/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/event/dispatch/subscriber/type/ProcessListChangedSubscriber.java
+++
b/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/event/dispatch/subscriber/type/ProcessListChangedSubscriber.java
@@ -26,7 +26,7 @@ import
org.apache.shardingsphere.mode.manager.cluster.event.dispatch.event.state
import
org.apache.shardingsphere.mode.manager.cluster.event.dispatch.event.state.compute.ReportLocalProcessesCompletedEvent;
import
org.apache.shardingsphere.mode.manager.cluster.event.dispatch.event.state.compute.ReportLocalProcessesEvent;
import
org.apache.shardingsphere.mode.manager.cluster.event.dispatch.subscriber.DispatchEventSubscriber;
-import
org.apache.shardingsphere.mode.persist.service.divided.ProcessPersistService;
+import
org.apache.shardingsphere.mode.persist.coordinator.ProcessPersistCoordinator;
import java.sql.SQLException;
@@ -37,11 +37,11 @@ public final class ProcessListChangedSubscriber implements
DispatchEventSubscrib
private final String instanceId;
- private final ProcessPersistService processPersistService;
+ private final ProcessPersistCoordinator processPersistService;
public ProcessListChangedSubscriber(final ContextManager contextManager) {
instanceId =
contextManager.getComputeNodeInstanceContext().getInstance().getMetaData().getId();
- processPersistService =
contextManager.getPersistServiceFacade().getProcessPersistService();
+ processPersistService =
contextManager.getPersistCoordinatorFacade().getProcessPersistCoordinator();
}
/**
diff --git
a/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/persist/coordinator/ClusterPersistCoordinatorFacadeBuilder.java
b/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/persist/coordinator/ClusterPersistCoordinatorFacadeBuilder.java
new file mode 100644
index 00000000000..6d16b0316e6
--- /dev/null
+++
b/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/persist/coordinator/ClusterPersistCoordinatorFacadeBuilder.java
@@ -0,0 +1,38 @@
+/*
+ * 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.shardingsphere.mode.manager.cluster.persist.coordinator;
+
+import
org.apache.shardingsphere.mode.persist.coordinator.PersistCoordinatorFacadeBuilder;
+import
org.apache.shardingsphere.mode.persist.coordinator.ProcessPersistCoordinator;
+import org.apache.shardingsphere.mode.spi.PersistRepository;
+
+/**
+ * Cluster persist coordinator facade builder.
+ */
+public final class ClusterPersistCoordinatorFacadeBuilder implements
PersistCoordinatorFacadeBuilder {
+
+ @Override
+ public ProcessPersistCoordinator buildProcessPersistCoordinator(final
PersistRepository repository) {
+ return new ClusterProcessPersistCoordinator(repository);
+ }
+
+ @Override
+ public Object getType() {
+ return "Cluster";
+ }
+}
diff --git
a/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/persist/coordinator/ClusterProcessPersistCoordinator.java
b/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/persist/coordinator/ClusterProcessPersistCoordinator.java
new file mode 100644
index 00000000000..083cb50f1cf
--- /dev/null
+++
b/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/persist/coordinator/ClusterProcessPersistCoordinator.java
@@ -0,0 +1,55 @@
+/*
+ * 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.shardingsphere.mode.manager.cluster.persist.coordinator;
+
+import lombok.RequiredArgsConstructor;
+import org.apache.shardingsphere.infra.executor.sql.process.Process;
+import org.apache.shardingsphere.infra.executor.sql.process.ProcessRegistry;
+import
org.apache.shardingsphere.infra.executor.sql.process.yaml.swapper.YamlProcessListSwapper;
+import org.apache.shardingsphere.infra.util.yaml.YamlEngine;
+import org.apache.shardingsphere.metadata.persist.node.ComputeNode;
+import org.apache.shardingsphere.metadata.persist.node.ProcessNode;
+import
org.apache.shardingsphere.mode.persist.coordinator.ProcessPersistCoordinator;
+import org.apache.shardingsphere.mode.spi.PersistRepository;
+
+import java.util.Collection;
+
+/**
+ * Cluster process persist coordinator.
+ */
+@RequiredArgsConstructor
+public final class ClusterProcessPersistCoordinator implements
ProcessPersistCoordinator {
+
+ private final PersistRepository repository;
+
+ private final YamlProcessListSwapper swapper = new
YamlProcessListSwapper();
+
+ @Override
+ public void reportLocalProcesses(final String instanceId, final String
taskId) {
+ Collection<Process> processes =
ProcessRegistry.getInstance().listAll();
+ if (!processes.isEmpty()) {
+ repository.persist(ProcessNode.getProcessListInstancePath(taskId,
instanceId), YamlEngine.marshal(swapper.swapToYamlConfiguration(processes)));
+ }
+
repository.delete(ComputeNode.getProcessTriggerInstanceNodePath(instanceId,
taskId));
+ }
+
+ @Override
+ public void cleanProcess(final String instanceId, final String processId) {
+
repository.delete(ComputeNode.getProcessKillInstanceIdNodePath(instanceId,
processId));
+ }
+}
diff --git
a/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/persist/service/ClusterProcessPersistService.java
b/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/persist/service/ClusterProcessPersistService.java
index 9bcc9470062..3bc48b500c1 100644
---
a/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/persist/service/ClusterProcessPersistService.java
+++
b/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/persist/service/ClusterProcessPersistService.java
@@ -19,7 +19,6 @@ package
org.apache.shardingsphere.mode.manager.cluster.persist.service;
import lombok.RequiredArgsConstructor;
import org.apache.shardingsphere.infra.executor.sql.process.Process;
-import org.apache.shardingsphere.infra.executor.sql.process.ProcessRegistry;
import
org.apache.shardingsphere.infra.executor.sql.process.lock.ProcessOperationLockRegistry;
import
org.apache.shardingsphere.infra.executor.sql.process.yaml.YamlProcessList;
import
org.apache.shardingsphere.infra.executor.sql.process.yaml.swapper.YamlProcessListSwapper;
@@ -44,17 +43,6 @@ public final class ClusterProcessPersistService implements
ProcessPersistService
private final PersistRepository repository;
- private final YamlProcessListSwapper swapper = new
YamlProcessListSwapper();
-
- @Override
- public void reportLocalProcesses(final String instanceId, final String
taskId) {
- Collection<Process> processes =
ProcessRegistry.getInstance().listAll();
- if (!processes.isEmpty()) {
- repository.persist(ProcessNode.getProcessListInstancePath(taskId,
instanceId), YamlEngine.marshal(swapper.swapToYamlConfiguration(processes)));
- }
-
repository.delete(ComputeNode.getProcessTriggerInstanceNodePath(instanceId,
taskId));
- }
-
@Override
public Collection<Process> getProcessList() {
String taskId = new UUID(ThreadLocalRandom.current().nextLong(),
ThreadLocalRandom.current().nextLong()).toString().replace("-", "");
@@ -110,9 +98,4 @@ public final class ClusterProcessPersistService implements
ProcessPersistService
private boolean isReady(final Collection<String> paths) {
return paths.stream().noneMatch(each -> null !=
repository.query(each));
}
-
- @Override
- public void cleanProcess(final String instanceId, final String processId) {
-
repository.delete(ComputeNode.getProcessKillInstanceIdNodePath(instanceId,
processId));
- }
}
diff --git
a/mode/type/cluster/core/src/main/resources/META-INF/services/org.apache.shardingsphere.mode.persist.coordinator.PersistCoordinatorFacadeBuilder
b/mode/type/cluster/core/src/main/resources/META-INF/services/org.apache.shardingsphere.mode.persist.coordinator.PersistCoordinatorFacadeBuilder
new file mode 100644
index 00000000000..10ecee97a07
--- /dev/null
+++
b/mode/type/cluster/core/src/main/resources/META-INF/services/org.apache.shardingsphere.mode.persist.coordinator.PersistCoordinatorFacadeBuilder
@@ -0,0 +1,18 @@
+#
+# 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.
+#
+
+org.apache.shardingsphere.mode.manager.cluster.persist.coordinator.ClusterPersistCoordinatorFacadeBuilder
diff --git
a/mode/type/cluster/core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/event/dispatch/subscriber/type/ProcessListChangedSubscriberTest.java
b/mode/type/cluster/core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/event/dispatch/subscriber/type/ProcessListChangedSubscriberTest.java
index 5cd48c2be7b..c5198c25d3a 100644
---
a/mode/type/cluster/core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/event/dispatch/subscriber/type/ProcessListChangedSubscriberTest.java
+++
b/mode/type/cluster/core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/event/dispatch/subscriber/type/ProcessListChangedSubscriberTest.java
@@ -71,7 +71,7 @@ class ProcessListChangedSubscriberTest {
void assertReportLocalProcesses() {
when(ProcessRegistry.getInstance().listAll()).thenReturn(Collections.emptyList());
subscriber.reportLocalProcesses(new
ReportLocalProcessesEvent("foo_instance_id", "foo_task_id"));
-
verify(contextManager.getPersistServiceFacade().getProcessPersistService()).reportLocalProcesses("foo_instance_id",
"foo_task_id");
+
verify(contextManager.getPersistCoordinatorFacade().getProcessPersistCoordinator()).reportLocalProcesses("foo_instance_id",
"foo_task_id");
}
@Test
@@ -83,13 +83,13 @@ class ProcessListChangedSubscriberTest {
@Test
void assertKillLocalProcessWithCurrentInstance() throws SQLException {
subscriber.killLocalProcess(new
KillLocalProcessEvent("foo_instance_id", "foo_pid"));
-
verify(contextManager.getPersistServiceFacade().getProcessPersistService()).cleanProcess("foo_instance_id",
"foo_pid");
+
verify(contextManager.getPersistCoordinatorFacade().getProcessPersistCoordinator()).cleanProcess("foo_instance_id",
"foo_pid");
}
@Test
void assertKillLocalProcessWithNotCurrentInstance() throws SQLException {
subscriber.killLocalProcess(new
KillLocalProcessEvent("bar_instance_id", "foo_pid"));
-
verify(contextManager.getPersistServiceFacade().getProcessPersistService(),
times(0)).cleanProcess("bar_instance_id", "foo_pid");
+
verify(contextManager.getPersistCoordinatorFacade().getProcessPersistCoordinator(),
times(0)).cleanProcess("bar_instance_id", "foo_pid");
}
@Test
diff --git
a/mode/type/cluster/core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/persist/coordinator/ClusterProcessPersistCoordinatorTest.java
b/mode/type/cluster/core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/persist/coordinator/ClusterProcessPersistCoordinatorTest.java
new file mode 100644
index 00000000000..4ad1ddd6823
--- /dev/null
+++
b/mode/type/cluster/core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/persist/coordinator/ClusterProcessPersistCoordinatorTest.java
@@ -0,0 +1,76 @@
+/*
+ * 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.shardingsphere.mode.manager.cluster.persist.coordinator;
+
+import org.apache.shardingsphere.infra.executor.sql.process.Process;
+import org.apache.shardingsphere.infra.executor.sql.process.ProcessRegistry;
+import
org.apache.shardingsphere.mode.persist.coordinator.ProcessPersistCoordinator;
+import org.apache.shardingsphere.mode.spi.PersistRepository;
+import org.apache.shardingsphere.test.mock.AutoMockExtension;
+import org.apache.shardingsphere.test.mock.StaticMockSettings;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.mockito.Mock;
+
+import java.util.Collections;
+
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.RETURNS_DEEP_STUBS;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+@ExtendWith(AutoMockExtension.class)
+@StaticMockSettings(ProcessRegistry.class)
+class ClusterProcessPersistCoordinatorTest {
+
+ @Mock
+ private PersistRepository repository;
+
+ private ProcessPersistCoordinator processPersistCoordinator;
+
+ @BeforeEach
+ void setUp() {
+ processPersistCoordinator = new
ClusterProcessPersistCoordinator(repository);
+ }
+
+ @Test
+ void assertReportEmptyLocalProcesses() {
+
when(ProcessRegistry.getInstance().listAll()).thenReturn(Collections.emptyList());
+ processPersistCoordinator.reportLocalProcesses("foo_instance_id",
"foo_task_id");
+ verify(repository, times(0)).persist(any(), any());
+
verify(repository).delete("/nodes/compute_nodes/show_process_list_trigger/foo_instance_id:foo_task_id");
+ }
+
+ @Test
+ void assertReportNotEmptyLocalProcesses() {
+
when(ProcessRegistry.getInstance().listAll()).thenReturn(Collections.singleton(mock(Process.class,
RETURNS_DEEP_STUBS)));
+ processPersistCoordinator.reportLocalProcesses("foo_instance_id",
"foo_task_id");
+
verify(repository).persist(eq("/execution_nodes/foo_task_id/foo_instance_id"),
any());
+
verify(repository).delete("/nodes/compute_nodes/show_process_list_trigger/foo_instance_id:foo_task_id");
+ }
+
+ @Test
+ void assertCleanProcess() {
+ processPersistCoordinator.cleanProcess("foo_instance_id", "foo_pid");
+
verify(repository).delete("/nodes/compute_nodes/kill_process_trigger/foo_instance_id:foo_pid");
+ }
+}
diff --git
a/mode/type/cluster/core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/persist/service/ClusterProcessPersistServiceTest.java
b/mode/type/cluster/core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/persist/service/ClusterProcessPersistServiceTest.java
index 5a888875f8d..df844197ba6 100644
---
a/mode/type/cluster/core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/persist/service/ClusterProcessPersistServiceTest.java
+++
b/mode/type/cluster/core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/persist/service/ClusterProcessPersistServiceTest.java
@@ -41,8 +41,6 @@ import static org.hamcrest.MatcherAssert.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.contains;
import static org.mockito.ArgumentMatchers.eq;
-import static org.mockito.Mockito.RETURNS_DEEP_STUBS;
-import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@@ -61,22 +59,6 @@ class ClusterProcessPersistServiceTest {
processPersistService = new ClusterProcessPersistService(repository);
}
- @Test
- void assertReportEmptyLocalProcesses() {
-
when(ProcessRegistry.getInstance().listAll()).thenReturn(Collections.emptyList());
- processPersistService.reportLocalProcesses("foo_instance_id",
"foo_task_id");
- verify(repository, times(0)).persist(any(), any());
-
verify(repository).delete("/nodes/compute_nodes/show_process_list_trigger/foo_instance_id:foo_task_id");
- }
-
- @Test
- void assertReportNotEmptyLocalProcesses() {
-
when(ProcessRegistry.getInstance().listAll()).thenReturn(Collections.singleton(mock(Process.class,
RETURNS_DEEP_STUBS)));
- processPersistService.reportLocalProcesses("foo_instance_id",
"foo_task_id");
-
verify(repository).persist(eq("/execution_nodes/foo_task_id/foo_instance_id"),
any());
-
verify(repository).delete("/nodes/compute_nodes/show_process_list_trigger/foo_instance_id:foo_task_id");
- }
-
@Test
void assertGetCompletedProcessList() {
when(ProcessOperationLockRegistry.getInstance().waitUntilReleaseReady(any(),
any())).thenReturn(true);
@@ -130,10 +112,4 @@ class ClusterProcessPersistServiceTest {
processPersistService.killProcess("foo_process_id");
verify(repository).persist("/nodes/compute_nodes/kill_process_trigger/abc:foo_process_id",
"");
}
-
- @Test
- void assertCleanProcess() {
- processPersistService.cleanProcess("foo_instance_id", "foo_pid");
-
verify(repository).delete("/nodes/compute_nodes/kill_process_trigger/foo_instance_id:foo_pid");
- }
}
diff --git
a/mode/type/standalone/core/src/main/java/org/apache/shardingsphere/mode/manager/standalone/persist/service/StandaloneProcessPersistService.java
b/mode/type/standalone/core/src/main/java/org/apache/shardingsphere/mode/manager/standalone/persist/coordinator/StandalonePersistCoordinatorFacadeBuilder.java
similarity index 52%
copy from
mode/type/standalone/core/src/main/java/org/apache/shardingsphere/mode/manager/standalone/persist/service/StandaloneProcessPersistService.java
copy to
mode/type/standalone/core/src/main/java/org/apache/shardingsphere/mode/manager/standalone/persist/coordinator/StandalonePersistCoordinatorFacadeBuilder.java
index d7c0e6e5057..e3d0a81c8dc 100644
---
a/mode/type/standalone/core/src/main/java/org/apache/shardingsphere/mode/manager/standalone/persist/service/StandaloneProcessPersistService.java
+++
b/mode/type/standalone/core/src/main/java/org/apache/shardingsphere/mode/manager/standalone/persist/coordinator/StandalonePersistCoordinatorFacadeBuilder.java
@@ -15,35 +15,29 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.mode.manager.standalone.persist.service;
+package org.apache.shardingsphere.mode.manager.standalone.persist.coordinator;
-import org.apache.shardingsphere.infra.executor.sql.process.Process;
-import org.apache.shardingsphere.infra.executor.sql.process.ProcessRegistry;
-import
org.apache.shardingsphere.mode.persist.service.divided.ProcessPersistService;
-
-import java.sql.SQLException;
-import java.util.Collection;
+import
org.apache.shardingsphere.mode.persist.coordinator.PersistCoordinatorFacadeBuilder;
+import
org.apache.shardingsphere.mode.persist.coordinator.ProcessPersistCoordinator;
+import org.apache.shardingsphere.mode.spi.PersistRepository;
/**
- * Standalone process persist service.
+ * Standalone persist coordinator facade builder.
*/
-public final class StandaloneProcessPersistService implements
ProcessPersistService {
-
- @Override
- public void reportLocalProcesses(final String instanceId, final String
taskId) {
- }
+public final class StandalonePersistCoordinatorFacadeBuilder implements
PersistCoordinatorFacadeBuilder {
@Override
- public Collection<Process> getProcessList() {
- return ProcessRegistry.getInstance().listAll();
+ public ProcessPersistCoordinator buildProcessPersistCoordinator(final
PersistRepository repository) {
+ return null;
}
@Override
- public void killProcess(final String processId) throws SQLException {
- ProcessRegistry.getInstance().kill(processId);
+ public Object getType() {
+ return "Standalone";
}
@Override
- public void cleanProcess(final String instanceId, final String processId) {
+ public boolean isDefault() {
+ return true;
}
}
diff --git
a/mode/type/standalone/core/src/main/java/org/apache/shardingsphere/mode/manager/standalone/persist/service/StandaloneProcessPersistService.java
b/mode/type/standalone/core/src/main/java/org/apache/shardingsphere/mode/manager/standalone/persist/service/StandaloneProcessPersistService.java
index d7c0e6e5057..01f2ac8c5e8 100644
---
a/mode/type/standalone/core/src/main/java/org/apache/shardingsphere/mode/manager/standalone/persist/service/StandaloneProcessPersistService.java
+++
b/mode/type/standalone/core/src/main/java/org/apache/shardingsphere/mode/manager/standalone/persist/service/StandaloneProcessPersistService.java
@@ -29,10 +29,6 @@ import java.util.Collection;
*/
public final class StandaloneProcessPersistService implements
ProcessPersistService {
- @Override
- public void reportLocalProcesses(final String instanceId, final String
taskId) {
- }
-
@Override
public Collection<Process> getProcessList() {
return ProcessRegistry.getInstance().listAll();
@@ -42,8 +38,4 @@ public final class StandaloneProcessPersistService implements
ProcessPersistServ
public void killProcess(final String processId) throws SQLException {
ProcessRegistry.getInstance().kill(processId);
}
-
- @Override
- public void cleanProcess(final String instanceId, final String processId) {
- }
}
diff --git
a/mode/type/standalone/core/src/main/resources/META-INF/services/org.apache.shardingsphere.mode.persist.coordinator.PersistCoordinatorFacadeBuilder
b/mode/type/standalone/core/src/main/resources/META-INF/services/org.apache.shardingsphere.mode.persist.coordinator.PersistCoordinatorFacadeBuilder
new file mode 100644
index 00000000000..ec4247fc7ca
--- /dev/null
+++
b/mode/type/standalone/core/src/main/resources/META-INF/services/org.apache.shardingsphere.mode.persist.coordinator.PersistCoordinatorFacadeBuilder
@@ -0,0 +1,18 @@
+#
+# 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.
+#
+
+org.apache.shardingsphere.mode.manager.standalone.persist.coordinator.StandalonePersistCoordinatorFacadeBuilder
diff --git
a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/connector/ProxyDatabaseConnectionManagerTest.java
b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/connector/ProxyDatabaseConnectionManagerTest.java
index 41ee0021660..a986669913d 100644
---
a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/connector/ProxyDatabaseConnectionManagerTest.java
+++
b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/connector/ProxyDatabaseConnectionManagerTest.java
@@ -126,7 +126,8 @@ class ProxyDatabaseConnectionManagerTest {
when(metaData.getGlobalRuleMetaData()).thenReturn(new
RuleMetaData(Collections.singletonList(transactionRule)));
ComputeNodeInstanceContext computeNodeInstanceContext =
mock(ComputeNodeInstanceContext.class);
when(computeNodeInstanceContext.getModeConfiguration()).thenReturn(mock(ModeConfiguration.class));
- return new
ContextManager(MetaDataContextsFactory.create(mock(MetaDataPersistService.class),
metaData), computeNodeInstanceContext, mock(PersistRepository.class));
+ return new ContextManager(
+
MetaDataContextsFactory.create(mock(MetaDataPersistService.class), metaData),
computeNodeInstanceContext, mock(PersistRepository.class));
}
@AfterEach
diff --git
a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/connector/ProxySQLExecutorTest.java
b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/connector/ProxySQLExecutorTest.java
index 87bc4e883ed..6e3bbf47e2c 100644
---
a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/connector/ProxySQLExecutorTest.java
+++
b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/connector/ProxySQLExecutorTest.java
@@ -108,8 +108,7 @@ class ProxySQLExecutorTest {
when(metaData.getGlobalRuleMetaData()).thenReturn(new
RuleMetaData(Arrays.asList(mock(SQLFederationRule.class), transactionRule)));
ComputeNodeInstanceContext computeNodeInstanceContext =
mock(ComputeNodeInstanceContext.class);
when(computeNodeInstanceContext.getModeConfiguration()).thenReturn(mock(ModeConfiguration.class));
- ContextManager contextManager = new
ContextManager(MetaDataContextsFactory.create(mock(MetaDataPersistService.class),
metaData), computeNodeInstanceContext,
- mock(PersistRepository.class));
+ ContextManager contextManager = new
ContextManager(MetaDataContextsFactory.create(mock(MetaDataPersistService.class),
metaData), computeNodeInstanceContext, mock(PersistRepository.class));
when(ProxyContext.getInstance().getContextManager()).thenReturn(contextManager);
}
diff --git
a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/context/ProxyContextTest.java
b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/context/ProxyContextTest.java
index 7b94bce84c5..543ea1f293f 100644
---
a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/context/ProxyContextTest.java
+++
b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/context/ProxyContextTest.java
@@ -25,12 +25,12 @@ import
org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
import
org.apache.shardingsphere.infra.metadata.database.resource.ResourceMetaData;
import org.apache.shardingsphere.infra.metadata.database.rule.RuleMetaData;
import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader;
-import org.apache.shardingsphere.mode.state.ClusterState;
import org.apache.shardingsphere.metadata.persist.MetaDataPersistService;
import org.apache.shardingsphere.mode.manager.ContextManager;
import org.apache.shardingsphere.mode.metadata.MetaDataContexts;
import org.apache.shardingsphere.mode.metadata.MetaDataContextsFactory;
import org.apache.shardingsphere.mode.spi.PersistRepository;
+import org.apache.shardingsphere.mode.state.ClusterState;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
diff --git
a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/SetDistVariableExecutorTest.java
b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/SetDistVariableExecutorTest.java
index 0d0c811034f..5e37937e452 100644
---
a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/SetDistVariableExecutorTest.java
+++
b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/SetDistVariableExecutorTest.java
@@ -34,7 +34,6 @@ import
org.apache.shardingsphere.metadata.persist.MetaDataPersistService;
import
org.apache.shardingsphere.metadata.persist.service.config.global.PropertiesPersistService;
import org.apache.shardingsphere.mode.manager.ContextManager;
import org.apache.shardingsphere.mode.metadata.MetaDataContextsFactory;
-import org.apache.shardingsphere.mode.spi.PersistRepository;
import org.apache.shardingsphere.proxy.backend.context.ProxyContext;
import org.apache.shardingsphere.test.mock.AutoMockExtension;
import org.apache.shardingsphere.test.mock.StaticMockSettings;
@@ -111,6 +110,6 @@ class SetDistVariableExecutorTest {
ComputeNodeInstanceContext computeNodeInstanceContext = new
ComputeNodeInstanceContext(
new ComputeNodeInstance(mock(InstanceMetaData.class)), new
ModeConfiguration("Standalone", null), new EventBusContext());
computeNodeInstanceContext.init(mock(WorkerIdGenerator.class),
mock(LockContext.class));
- return new
ContextManager(MetaDataContextsFactory.create(metaDataPersistService, new
ShardingSphereMetaData()), computeNodeInstanceContext,
mock(PersistRepository.class));
+ return new
ContextManager(MetaDataContextsFactory.create(metaDataPersistService, new
ShardingSphereMetaData()), computeNodeInstanceContext, mock());
}
}
diff --git
a/proxy/frontend/core/src/test/java/org/apache/shardingsphere/proxy/frontend/state/impl/OKProxyStateTest.java
b/proxy/frontend/core/src/test/java/org/apache/shardingsphere/proxy/frontend/state/impl/OKProxyStateTest.java
index 7ec5669f11d..5f0420d356b 100644
---
a/proxy/frontend/core/src/test/java/org/apache/shardingsphere/proxy/frontend/state/impl/OKProxyStateTest.java
+++
b/proxy/frontend/core/src/test/java/org/apache/shardingsphere/proxy/frontend/state/impl/OKProxyStateTest.java
@@ -31,7 +31,6 @@ import
org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader;
import org.apache.shardingsphere.metadata.persist.MetaDataPersistService;
import org.apache.shardingsphere.mode.manager.ContextManager;
import org.apache.shardingsphere.mode.metadata.MetaDataContextsFactory;
-import org.apache.shardingsphere.mode.spi.PersistRepository;
import org.apache.shardingsphere.proxy.backend.context.ProxyContext;
import org.apache.shardingsphere.proxy.backend.session.ConnectionSession;
import org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask;
@@ -96,7 +95,7 @@ class OKProxyStateTest {
when(metaData.getGlobalRuleMetaData()).thenReturn(new
RuleMetaData(Collections.singletonList(transactionRule)));
ComputeNodeInstanceContext computeNodeInstanceContext =
mock(ComputeNodeInstanceContext.class);
when(computeNodeInstanceContext.getModeConfiguration()).thenReturn(mock(ModeConfiguration.class));
- return new
ContextManager(MetaDataContextsFactory.create(mock(MetaDataPersistService.class),
metaData), computeNodeInstanceContext, mock(PersistRepository.class));
+ return new
ContextManager(MetaDataContextsFactory.create(mock(MetaDataPersistService.class),
metaData), computeNodeInstanceContext, mock());
}
@SuppressWarnings({"unchecked", "SameParameterValue"})