This is an automated email from the ASF dual-hosted git repository.

mmuzaf pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
     new 41d395d  IGNITE-16190 Remove left classes related to legacy service 
grid (#9688)
41d395d is described below

commit 41d395d0c003b45a96c6e55166d7f6d28004a7f8
Author: Maxim Muzafarov <[email protected]>
AuthorDate: Thu Dec 23 18:53:05 2021 +0300

    IGNITE-16190 Remove left classes related to legacy service grid (#9688)
---
 .../processors/service/GridServiceAssignments.java | 132 ---------------------
 .../service/GridServiceAssignmentsKey.java         |  66 -----------
 .../processors/service/GridServiceDeployment.java  |  97 ---------------
 .../service/GridServiceDeploymentKey.java          |  66 -----------
 .../processors/service/ServiceDescriptorImpl.java  | 120 -------------------
 .../main/resources/META-INF/classnames.properties  |   5 -
 .../cluster/ClusterReadOnlyModeSelfTest.java       |  20 +++-
 7 files changed, 17 insertions(+), 489 deletions(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceAssignments.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceAssignments.java
deleted file mode 100644
index 290fbf4..0000000
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceAssignments.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * 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.ignite.internal.processors.service;
-
-import java.io.Serializable;
-import java.util.Collections;
-import java.util.Map;
-import java.util.UUID;
-import org.apache.ignite.cluster.ClusterNode;
-import org.apache.ignite.internal.processors.cache.GridCacheInternal;
-import org.apache.ignite.internal.util.tostring.GridToStringInclude;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.lang.IgnitePredicate;
-import org.apache.ignite.services.ServiceConfiguration;
-
-/**
- * Service per-node assignment.
- *
- * @deprecated Services internals use messages for deployment management 
instead of the utility cache, since Ignite 2.8.
- */
-@Deprecated
-public class GridServiceAssignments implements Serializable, GridCacheInternal 
{
-    /** Serialization version. */
-    private static final long serialVersionUID = 0L;
-
-    /** Node ID. */
-    private final UUID nodeId;
-
-    /** Topology version. */
-    private final long topVer;
-
-    /** Service configuration. */
-    private final ServiceConfiguration cfg;
-
-    /** Assignments. */
-    @GridToStringInclude
-    private Map<UUID, Integer> assigns = Collections.emptyMap();
-
-    /**
-     * @param cfg Configuration.
-     * @param nodeId Node ID.
-     * @param topVer Topology version.
-     */
-    public GridServiceAssignments(ServiceConfiguration cfg, UUID nodeId, long 
topVer) {
-        this.cfg = cfg;
-        this.nodeId = nodeId;
-        this.topVer = topVer;
-    }
-
-    /**
-     * @return Configuration.
-     */
-    public ServiceConfiguration configuration() {
-        return cfg;
-    }
-
-    /**
-     * @return Service name.
-     */
-    public String name() {
-        return cfg.getName();
-    }
-
-    /**
-     * @return Topology version.
-     */
-    public long topologyVersion() {
-        return topVer;
-    }
-
-    /**
-     * @return Cache name.
-     */
-    public String cacheName() {
-        return cfg.getCacheName();
-    }
-
-    /**
-     * @return Affinity key.
-     */
-    public Object affinityKey() {
-        return cfg.getAffinityKey();
-    }
-
-    /**
-     * @return Origin node ID.
-     */
-    public UUID nodeId() {
-        return nodeId;
-    }
-
-    /**
-     * @return Node filter.
-     */
-    public IgnitePredicate<ClusterNode> nodeFilter() {
-        return cfg.getNodeFilter();
-    }
-
-    /**
-     * @return Assignments.
-     */
-    public Map<UUID, Integer> assigns() {
-        return assigns;
-    }
-
-    /**
-     * @param assigns Assignments.
-     */
-    public void assigns(Map<UUID, Integer> assigns) {
-        this.assigns = assigns;
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(GridServiceAssignments.class, this);
-    }
-}
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceAssignmentsKey.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceAssignmentsKey.java
deleted file mode 100644
index 593ae5c..0000000
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceAssignmentsKey.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * 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.ignite.internal.processors.service;
-
-import org.apache.ignite.internal.processors.cache.GridCacheUtilityKey;
-import org.apache.ignite.internal.util.typedef.internal.S;
-
-/**
- * Service configuration key.
- *
- * @deprecated Services internals use messages for deployment management 
instead of the utility cache, since Ignite 2.8.
- */
-@Deprecated
-public class GridServiceAssignmentsKey extends 
GridCacheUtilityKey<GridServiceAssignmentsKey> {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** Service name. */
-    private final String name;
-
-    /**
-     * @param name Service ID.
-     */
-    public GridServiceAssignmentsKey(String name) {
-        assert name != null;
-
-        this.name = name;
-    }
-
-    /**
-     * @return Service name.
-     */
-    public String name() {
-        return name;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected boolean equalsx(GridServiceAssignmentsKey that) {
-        return name.equals(that.name);
-    }
-
-    /** {@inheritDoc} */
-    @Override public int hashCode() {
-        return name.hashCode();
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(GridServiceAssignmentsKey.class, this);
-    }
-}
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceDeployment.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceDeployment.java
deleted file mode 100644
index 30f5724..0000000
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceDeployment.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * 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.ignite.internal.processors.service;
-
-import java.io.Serializable;
-import java.util.UUID;
-import org.apache.ignite.internal.processors.cache.GridCacheInternal;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.services.ServiceConfiguration;
-
-/**
- * Service deployment.
- *
- * @deprecated Services internals use messages for deployment management 
instead of the utility cache, since Ignite 2.8.
- */
-@Deprecated
-public class GridServiceDeployment implements GridCacheInternal, Serializable {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** Node ID. */
-    private UUID nodeId;
-
-    /** Service configuration. */
-    private ServiceConfiguration cfg;
-
-    /**
-     * @param nodeId Node ID.
-     * @param cfg Service configuration.
-     */
-    public GridServiceDeployment(UUID nodeId, ServiceConfiguration cfg) {
-        this.nodeId = nodeId;
-        this.cfg = cfg;
-    }
-
-    /**
-     * @return Node ID.
-     */
-    public UUID nodeId() {
-        return nodeId;
-    }
-
-    /**
-     * @return Service configuration.
-     */
-    public ServiceConfiguration configuration() {
-        return cfg;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean equals(Object o) {
-        if (this == o)
-            return true;
-
-        if (o == null || getClass() != o.getClass())
-            return false;
-
-        GridServiceDeployment that = (GridServiceDeployment)o;
-
-        if (cfg != null ? !cfg.equals(that.cfg) : that.cfg != null)
-            return false;
-
-        if (nodeId != null ? !nodeId.equals(that.nodeId) : that.nodeId != null)
-            return false;
-
-        return true;
-    }
-
-    /** {@inheritDoc} */
-    @Override public int hashCode() {
-        int res = nodeId != null ? nodeId.hashCode() : 0;
-
-        res = 31 * res + (cfg != null ? cfg.hashCode() : 0);
-
-        return res;
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(GridServiceDeployment.class, this);
-    }
-}
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceDeploymentKey.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceDeploymentKey.java
deleted file mode 100644
index b5f21d9..0000000
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceDeploymentKey.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * 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.ignite.internal.processors.service;
-
-import org.apache.ignite.internal.processors.cache.GridCacheUtilityKey;
-import org.apache.ignite.internal.util.typedef.internal.S;
-
-/**
- * Service configuration key.
- *
- * @deprecated Services internals use messages for deployment management 
instead of the utility cache, since Ignite 2.8.
- */
-@Deprecated
-public class GridServiceDeploymentKey extends 
GridCacheUtilityKey<GridServiceDeploymentKey> {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** Service name. */
-    private final String name;
-
-    /**
-     * @param name Service ID.
-     */
-    public GridServiceDeploymentKey(String name) {
-        assert name != null;
-
-        this.name = name;
-    }
-
-    /**
-     * @return Service name.
-     */
-    public String name() {
-        return name;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected boolean equalsx(GridServiceDeploymentKey that) {
-        return name.equals(that.name);
-    }
-
-    /** {@inheritDoc} */
-    @Override public int hashCode() {
-        return name.hashCode();
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(GridServiceDeploymentKey.class, this);
-    }
-}
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/service/ServiceDescriptorImpl.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/service/ServiceDescriptorImpl.java
deleted file mode 100644
index 8d1d9a6..0000000
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/service/ServiceDescriptorImpl.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * 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.ignite.internal.processors.service;
-
-import java.util.Map;
-import java.util.UUID;
-import org.apache.ignite.IgniteException;
-import org.apache.ignite.internal.util.tostring.GridToStringInclude;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.services.Service;
-import org.apache.ignite.services.ServiceConfiguration;
-import org.apache.ignite.services.ServiceDescriptor;
-import org.jetbrains.annotations.Nullable;
-
-/**
- * Service descriptor.
- *
- * @deprecated This implementation is based on {@code GridServiceDeployment} 
which has been deprecated because of
- * services internals use messages for deployment management instead of the 
utility cache, since Ignite 2.8.
- */
-@Deprecated
-public class ServiceDescriptorImpl implements ServiceDescriptor {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** Configuration. */
-    @GridToStringInclude
-    private final GridServiceDeployment dep;
-
-    /** Topology snapshot. */
-    @GridToStringInclude
-    private Map<UUID, Integer> top;
-
-    /**
-     * @param dep Deployment.
-     */
-    public ServiceDescriptorImpl(GridServiceDeployment dep) {
-        this.dep = dep;
-    }
-
-    /** {@inheritDoc} */
-    @Override public String name() {
-        return dep.configuration().getName();
-    }
-
-    /** {@inheritDoc} */
-    @Override public Class<? extends Service> serviceClass() {
-        ServiceConfiguration cfg = dep.configuration();
-
-        if (cfg instanceof LazyServiceConfiguration) {
-            String clsName = 
((LazyServiceConfiguration)cfg).serviceClassName();
-
-            try {
-                return (Class<? extends Service>)Class.forName(clsName);
-            }
-            catch (ClassNotFoundException e) {
-                throw new IgniteException("Failed to find service class: " + 
clsName, e);
-            }
-        }
-        else
-            return dep.configuration().getService().getClass();
-    }
-
-    /** {@inheritDoc} */
-    @Override public int totalCount() {
-        return dep.configuration().getTotalCount();
-    }
-
-    /** {@inheritDoc} */
-    @Override public int maxPerNodeCount() {
-        return dep.configuration().getMaxPerNodeCount();
-    }
-
-    /** {@inheritDoc} */
-    @Nullable @Override public String cacheName() {
-        return dep.configuration().getCacheName();
-    }
-
-    /** {@inheritDoc} */
-    @Nullable @Override public <K> K affinityKey() {
-        return (K)dep.configuration().getAffinityKey();
-    }
-
-    /** {@inheritDoc} */
-    @Override public UUID originNodeId() {
-        return dep.nodeId();
-    }
-
-    /** {@inheritDoc} */
-    @Override public Map<UUID, Integer> topologySnapshot() {
-        return top;
-    }
-
-    /**
-     * @param top Topology snapshot.
-     */
-    void topologySnapshot(Map<UUID, Integer> top) {
-        this.top = top;
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(ServiceDescriptorImpl.class, this);
-    }
-}
diff --git a/modules/core/src/main/resources/META-INF/classnames.properties 
b/modules/core/src/main/resources/META-INF/classnames.properties
index 0b7f8b5..0406836 100644
--- a/modules/core/src/main/resources/META-INF/classnames.properties
+++ b/modules/core/src/main/resources/META-INF/classnames.properties
@@ -1675,10 +1675,6 @@ 
org.apache.ignite.internal.processors.rest.protocols.tcp.redis.GridRedisCommand
 org.apache.ignite.internal.processors.rest.protocols.tcp.redis.GridRedisMessage
 
org.apache.ignite.internal.processors.rest.protocols.tcp.redis.GridRedisNioListener$1
 org.apache.ignite.internal.processors.rest.request.RestQueryRequest$QueryType
-org.apache.ignite.internal.processors.service.GridServiceAssignments
-org.apache.ignite.internal.processors.service.GridServiceAssignmentsKey
-org.apache.ignite.internal.processors.service.GridServiceDeployment
-org.apache.ignite.internal.processors.service.GridServiceDeploymentKey
 
org.apache.ignite.internal.processors.service.GridServiceMethodNotFoundException
 org.apache.ignite.internal.processors.service.GridServiceNotFoundException
 org.apache.ignite.internal.processors.service.GridServiceProxy
@@ -1692,7 +1688,6 @@ 
org.apache.ignite.internal.processors.service.ServiceClusterDeploymentResultBatc
 org.apache.ignite.internal.processors.service.ServiceContextImpl
 org.apache.ignite.internal.processors.service.ServiceDeploymentProcessId
 org.apache.ignite.internal.processors.service.ServiceDeploymentRequest
-org.apache.ignite.internal.processors.service.ServiceDescriptorImpl
 org.apache.ignite.internal.processors.service.ServiceInfo
 
org.apache.ignite.internal.processors.service.ServiceProcessorCommonDiscoveryData
 
org.apache.ignite.internal.processors.service.ServiceProcessorJoinNodeDiscoveryData
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cluster/ClusterReadOnlyModeSelfTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cluster/ClusterReadOnlyModeSelfTest.java
index d390dc0..da360ad 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cluster/ClusterReadOnlyModeSelfTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cluster/ClusterReadOnlyModeSelfTest.java
@@ -17,6 +17,7 @@
 
 package org.apache.ignite.internal.processors.cluster;
 
+import java.util.HashSet;
 import java.util.concurrent.CountDownLatch;
 import java.util.stream.Stream;
 import javax.cache.CacheException;
@@ -28,10 +29,10 @@ import 
org.apache.ignite.configuration.DataStorageConfiguration;
 import org.apache.ignite.configuration.IgniteConfiguration;
 import org.apache.ignite.failure.StopNodeFailureHandler;
 import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.internal.processors.cache.GridCacheUtilityKey;
 import 
org.apache.ignite.internal.processors.cache.distributed.dht.IgniteClusterReadOnlyException;
 import 
org.apache.ignite.internal.processors.cache.persistence.IgniteCacheDatabaseSharedManager;
 import 
org.apache.ignite.internal.processors.cache.persistence.metastorage.MetaStorage;
-import org.apache.ignite.internal.processors.service.GridServiceAssignmentsKey;
 import org.apache.ignite.internal.util.typedef.internal.CU;
 import org.apache.ignite.testframework.GridTestUtils;
 import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
@@ -257,9 +258,22 @@ public class ClusterReadOnlyModeSelfTest extends 
GridCommonAbstractTest {
 
         checkClusterInReadOnlyMode(true, grid);
 
-        grid.utilityCache().put(new GridServiceAssignmentsKey("test"), "test");
+        GridCacheUtilityKey<?> key = new GridCacheUtilityKey() {
+            @Override protected boolean equalsx(GridCacheUtilityKey key) {
+                return false;
+            }
+
+            @Override public int hashCode() {
+                return 0;
+            }
+        };
+
+        HashSet<String> sysTypes = 
GridTestUtils.getFieldValue(grid.context().marshallerContext(), "sysTypesSet");
+        sysTypes.add(key.getClass().getName());
+
+        grid.utilityCache().put(key, "test");
 
-        assertEquals("test", grid.utilityCache().get(new 
GridServiceAssignmentsKey("test")));
+        assertEquals("test", grid.utilityCache().get(key));
     }
 
     /** */

Reply via email to