merge eaf8ae24: IGNITE-4034 Get rid of specialized methods in platform targets
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/e73125d9 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/e73125d9 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/e73125d9 Branch: refs/heads/master Commit: e73125d96c2a8d1f5a53a5fc3d3ed58db1dc7713 Parents: f97170b Author: Pavel Tupitsyn <[email protected]> Authored: Mon Oct 24 12:50:22 2016 +0300 Committer: Pavel Tupitsyn <[email protected]> Committed: Mon Oct 24 12:50:22 2016 +0300 ---------------------------------------------------------------------- .../platform/cache/PlatformCache.java | 23 ++++++++++++++++---- .../platform/cluster/PlatformClusterGroup.java | 16 +++++++------- modules/platforms/cpp/jni/project/vs/module.def | 1 - .../Apache.Ignite.Core.csproj | 1 - .../Impl/Cluster/ClusterGroupImpl.cs | 12 +++++++--- 5 files changed, 36 insertions(+), 17 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/e73125d9/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCache.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCache.java index 6ce900a..d3fa2c8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCache.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCache.java @@ -281,6 +281,7 @@ public class PlatformCache extends PlatformAbstractTarget { * @param cache Underlying cache. * @param keepBinary Keep binary flag. */ + @SuppressWarnings("ZeroLengthArrayAllocation") public PlatformCache(PlatformContext platformCtx, IgniteCache cache, boolean keepBinary) { this(platformCtx, cache, keepBinary, new PlatformCacheExtension[0]); } @@ -503,11 +504,25 @@ public class PlatformCache extends PlatformAbstractTarget { }); } - case OP_LOCK: - return registerLock(cache.lock(reader.readObjectDetached())); + case OP_LOCK: { + long id = registerLock(cache.lock(reader.readObjectDetached())); - case OP_LOCK_ALL: - return registerLock(cache.lockAll(PlatformUtils.readCollection(reader))); + return writeResult(mem, id, new PlatformWriterClosure<Long>() { + @Override public void write(BinaryRawWriterEx writer, Long val) { + writer.writeLong(val); + } + }); + } + + case OP_LOCK_ALL: { + long id = registerLock(cache.lockAll(PlatformUtils.readCollection(reader))); + + return writeResult(mem, id, new PlatformWriterClosure<Long>() { + @Override public void write(BinaryRawWriterEx writer, Long val) { + writer.writeLong(val); + } + }); + } case OP_EXTENSION: PlatformCacheExtension ext = extension(reader.readInt()); http://git-wip-us.apache.org/repos/asf/ignite/blob/e73125d9/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cluster/PlatformClusterGroup.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cluster/PlatformClusterGroup.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cluster/PlatformClusterGroup.java index 403c8ba..d09506b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cluster/PlatformClusterGroup.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cluster/PlatformClusterGroup.java @@ -29,6 +29,7 @@ import org.apache.ignite.internal.binary.BinaryRawWriterEx; import org.apache.ignite.internal.processors.platform.PlatformAbstractTarget; import org.apache.ignite.internal.processors.platform.PlatformContext; import org.apache.ignite.internal.processors.platform.utils.PlatformUtils; +import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi; import org.jetbrains.annotations.Nullable; /** @@ -102,6 +103,9 @@ public class PlatformClusterGroup extends PlatformAbstractTarget { /** */ private static final int OP_RESET_METRICS = 22; + /** */ + private static final int OP_FOR_SERVERS = 23; + /** Projection. */ private final ClusterGroupEx prj; @@ -316,6 +320,9 @@ public class PlatformClusterGroup extends PlatformAbstractTarget { case OP_FOR_YOUNGEST: return new PlatformClusterGroup(platformCtx, (ClusterGroupEx)prj.forYoungest()); + + case OP_FOR_SERVERS: + return new PlatformClusterGroup(platformCtx, (ClusterGroupEx)prj.forServers()); } return super.processOutObject(type); @@ -337,13 +344,6 @@ public class PlatformClusterGroup extends PlatformAbstractTarget { } /** - * @return New projection. - */ - public PlatformClusterGroup forServers() { - return new PlatformClusterGroup(platformCtx, (ClusterGroupEx)prj.forServers()); - } - - /** * @return Projection. */ public ClusterGroupEx projection() { @@ -367,7 +367,7 @@ public class PlatformClusterGroup extends PlatformAbstractTarget { * @return Collection of grid nodes which represented by specified topology version, * if it is present in history storage, {@code null} otherwise. * @throws UnsupportedOperationException If underlying SPI implementation does not support - * topology history. Currently only {@link org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi} + * topology history. Currently only {@link TcpDiscoverySpi} * supports topology history. */ private Collection<ClusterNode> topology(long topVer) { http://git-wip-us.apache.org/repos/asf/ignite/blob/e73125d9/modules/platforms/cpp/jni/project/vs/module.def ---------------------------------------------------------------------- diff --git a/modules/platforms/cpp/jni/project/vs/module.def b/modules/platforms/cpp/jni/project/vs/module.def index 85fcac5..2e76bf7 100644 --- a/modules/platforms/cpp/jni/project/vs/module.def +++ b/modules/platforms/cpp/jni/project/vs/module.def @@ -50,7 +50,6 @@ IgniteProcessorAtomicReference @128 IgniteProcessorCreateNearCache @131 IgniteProcessorGetOrCreateNearCache @132 IgniteProcessorGetCacheNames @133 -IgniteProjectionForServers @134 IgniteSetConsoleHandler @135 IgniteRemoveConsoleHandler @136 IgniteProcessorLoggerIsLevelEnabled @137 http://git-wip-us.apache.org/repos/asf/ignite/blob/e73125d9/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.csproj ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.csproj b/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.csproj index 8d81bc2..08d742a 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.csproj +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.csproj @@ -182,7 +182,6 @@ <Compile Include="Impl\Cache\Affinity\AffinityFunctionSerializer.cs" /> <Compile Include="Impl\Cache\Affinity\PlatformAffinityFunction.cs" /> <Compile Include="Impl\Common\ObjectInfoHolder.cs" /> - <Compile Include="Impl\Common\Platform.cs" /> <Compile Include="Impl\Cache\Event\JavaCacheEntryEventFilter.cs" /> <Compile Include="Impl\Common\PlatformJavaObjectFactoryProxy.cs" /> <Compile Include="Compute\ComputeExecutionRejectedException.cs" /> http://git-wip-us.apache.org/repos/asf/ignite/blob/e73125d9/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cluster/ClusterGroupImpl.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cluster/ClusterGroupImpl.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cluster/ClusterGroupImpl.cs index e1b5861..388be82 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cluster/ClusterGroupImpl.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cluster/ClusterGroupImpl.cs @@ -101,7 +101,10 @@ namespace Apache.Ignite.Core.Impl.Cluster /** */ private const int OpForRemotes = 17; - + + /** */ + public const int OpForDaemons = 18; + /** */ private const int OpForRandom = 19; @@ -114,6 +117,9 @@ namespace Apache.Ignite.Core.Impl.Cluster /** */ public const int OpResetMetrics = 22; + /** */ + public const int OpForServers = 23; + /** Initial Ignite instance. */ private readonly Ignite _ignite; @@ -299,7 +305,7 @@ namespace Apache.Ignite.Core.Impl.Cluster /** <inheritDoc /> */ public IClusterGroup ForDaemons() { - return GetClusterGroup(UU.ProjectionForDaemons(Target)); + return GetClusterGroup(DoOutOpObject(OpForDaemons)); } /** <inheritDoc /> */ @@ -336,7 +342,7 @@ namespace Apache.Ignite.Core.Impl.Cluster /** <inheritDoc /> */ public IClusterGroup ForServers() { - return GetClusterGroup(UU.ProjectionForServers(Target)); + return GetClusterGroup(DoOutOpObject(OpForServers)); } /** <inheritDoc /> */
