You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2022/03/15 08:14:12 UTC
[GitHub] [ignite] ptupitsyn commented on a change in pull request #9891: IGNITE-16687 .NET: Fix platform service with node filter cancellation…
ptupitsyn commented on a change in pull request #9891:
URL: https://github.com/apache/ignite/pull/9891#discussion_r826685110
##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/service/ServiceDeploymentActions.java
##########
@@ -43,11 +48,42 @@
/** Services deployment errors. */
private Map<IgniteUuid, Collection<byte[]>> depErrors;
+ /** Kernal context. */
+ private final GridKernalContext ctx;
+
+ /**
+ * @param ctx Kernal context.
+ */
+ public ServiceDeploymentActions(GridKernalContext ctx) {
+ this.ctx = ctx;
+ }
+
/**
* @param servicesToDeploy Services info to deploy.
*/
public void servicesToDeploy(@NotNull Map<IgniteUuid, ServiceInfo> servicesToDeploy) {
- this.servicesToDeploy = servicesToDeploy;
+ Map<IgniteUuid, ServiceInfo> res = new HashMap<>();
+ for (Map.Entry<IgniteUuid, ServiceInfo> kv: servicesToDeploy.entrySet()) {
+ ServiceInfo dsc = kv.getValue();
+
+ ServiceConfiguration cfg = dsc.configuration();
+
+ if (!ctx.platform().hasContext() ||
+ !PlatformUtils.PLATFORM_DOTNET.equals(ctx.platform().context().platform())) {
+ if (cfg instanceof LazyServiceConfiguration) {
+ String svcClsName = ((LazyServiceConfiguration)cfg).serviceClassName();
+
+ if (PlatformDotNetServiceImpl.class.getName().equals(svcClsName))
+ continue;
+ }
+ else if (cfg instanceof ServiceConfiguration && cfg.getService() instanceof PlatformDotNetServiceImpl)
+ continue;
+ }
Review comment:
This set of conditions is quite hard to understand. Can we do something like this?
```
var nodePlatform = ctx.platform().hasContext() ? ctx.platform().context() : "";
var servicePlatform = getServicePlatform(cfg); // Extract a method to detect platform name by service class
if (!nodePlatform.equals(servicePlatform))
continue;
```
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org