IGNITE-1881: Internal portable -> binary renamings.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/d69362f8 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/d69362f8 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/d69362f8 Branch: refs/heads/ignite-1753-1282 Commit: d69362f86b3da5b29f42366938ba1c82403dcb2a Parents: fff85cb Author: Pavel Tupitsyn <ptupit...@gridgain.com> Authored: Tue Nov 17 16:58:53 2015 +0300 Committer: vozerov-gridgain <voze...@gridgain.com> Committed: Tue Nov 17 16:58:53 2015 +0300 ---------------------------------------------------------------------- .../dotnet/PlatformDotNetConfiguration.java | 2 +- ...CacheAtomicReferenceApiSelfAbstractTest.java | 10 +- .../platform/PlatformComputeBinarizable.java | 42 + .../PlatformComputeBinarizableArgTask.java | 119 + .../platform/PlatformComputeEchoTask.java | 12 +- .../PlatformComputeJavaBinarizable.java | 39 + .../platform/PlatformComputeJavaPortable.java | 39 - .../platform/PlatformComputePortable.java | 42 - .../PlatformComputePortableArgTask.java | 119 - .../Apache.Ignite.Benchmarks.csproj | 4 +- .../Apache.Ignite.Benchmarks/BenchmarkRunner.cs | 4 +- .../Binary/BinarizableReadBenchmark.cs | 125 + .../Binary/BinarizableWriteBenchmark.cs | 135 ++ .../Interop/PlatformBenchmarkBase.cs | 8 +- .../Portable/PortableReadBenchmark.cs | 126 - .../Portable/PortableWriteBenchmark.cs | 135 -- .../Apache.Ignite.Core.Tests.csproj | 27 +- .../Apache.Ignite.Core.Tests.nunit | 7 + .../Binary/BinaryBuilderSelfTest.cs | 1721 ++++++++++++++ .../Binary/BinarySelfTest.cs | 2157 ++++++++++++++++++ .../Binary/BinaryStructureTest.cs | 250 ++ .../BinaryConfigurationTest.cs | 173 ++ .../Cache/CacheAbstractTest.cs | 94 +- .../Cache/CacheAffinityTest.cs | 4 +- .../Cache/CacheDynamicStartTest.cs | 6 +- .../Cache/Query/CacheQueriesTest.cs | 80 +- .../Continuous/ContinuousQueryAbstractTest.cs | 210 +- .../ContinuousQueryNoBackupAbstractTest.cs | 4 +- .../Cache/Store/CacheStoreTest.cs | 68 +- .../Compute/AbstractTaskTest.cs | 8 +- .../Compute/BinarizableClosureTaskTest.cs | 185 ++ .../Compute/BinarizableTaskTest.cs | 269 +++ .../Compute/ComputeApiTest.cs | 62 +- .../Compute/FailoverTaskSelfTest.cs | 18 +- .../Forked/ForkedBinarizableClosureTaskTest.cs | 30 + .../Forked/ForkedPortableClosureTaskTest.cs | 30 - .../Compute/Forked/ForkedResourceTaskTest.cs | 3 - .../Forked/ForkedSerializableClosureTaskTest.cs | 3 - .../Compute/PortableClosureTaskTest.cs | 217 -- .../Compute/PortableTaskTest.cs | 269 --- .../Compute/TaskAdapterTest.cs | 14 +- .../Compute/TaskResultTest.cs | 46 +- .../Config/Compute/compute-grid1.xml | 6 +- .../Config/Compute/compute-standalone.xml | 14 +- .../Apache.Ignite.Core.Tests/Config/binary.xml | 56 + .../Config/cache-binarizables.xml | 78 + .../Config/cache-portables.xml | 78 - .../Config/cache-query-continuous.xml | 8 +- .../Config/marshaller-explicit.xml | 47 + .../Config/marshaller-portable.xml | 43 - .../Config/native-client-test-cache-store.xml | 2 +- .../Config/native-client-test-cache.xml | 51 - .../Config/portable.xml | 56 - .../Dataload/DataStreamerTest.cs | 42 +- .../Apache.Ignite.Core.Tests/EventsTest.cs | 16 +- .../Apache.Ignite.Core.Tests/ExceptionsTest.cs | 28 +- .../Apache.Ignite.Core.Tests/FutureTest.cs | 10 +- .../Apache.Ignite.Core.Tests/MarshallerTest.cs | 10 +- .../Portable/PortableApiSelfTest.cs | 1777 --------------- .../Portable/PortableSelfTest.cs | 2157 ------------------ .../Portable/PortableStructureTest.cs | 250 -- .../PortableConfigurationTest.cs | 173 -- .../Query/BinarizablePerson.cs | 69 + .../Query/ImplicitBinarizablePerson.cs | 46 + .../Query/ImplicitPortablePerson.cs | 46 - .../Query/NoDefBinarizablePerson.cs | 35 + .../Query/NoDefPortablePerson.cs | 35 - .../Query/PortablePerson.cs | 69 - .../Services/ServiceProxyTest.cs | 130 +- .../Services/ServicesTest.cs | 88 +- .../TypeResolverTest.cs | 20 +- .../Impl/Unmanaged/UnmanagedCallbacks.cs | 20 +- .../examples/Config/example-cache-query.xml | 12 +- .../dotnet/examples/Config/example-cache.xml | 12 +- parent/pom.xml | 1 + 75 files changed, 6133 insertions(+), 6268 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/d69362f8/modules/core/src/main/java/org/apache/ignite/platform/dotnet/PlatformDotNetConfiguration.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/platform/dotnet/PlatformDotNetConfiguration.java b/modules/core/src/main/java/org/apache/ignite/platform/dotnet/PlatformDotNetConfiguration.java index ff5656b..f323085 100644 --- a/modules/core/src/main/java/org/apache/ignite/platform/dotnet/PlatformDotNetConfiguration.java +++ b/modules/core/src/main/java/org/apache/ignite/platform/dotnet/PlatformDotNetConfiguration.java @@ -24,7 +24,7 @@ import java.util.ArrayList; import java.util.List; /** - * Mirror of .Net class Configuration.cs + * Mirror of .Net class IgniteConfiguration.cs */ public class PlatformDotNetConfiguration implements PlatformConfiguration { /** */ http://git-wip-us.apache.org/repos/asf/ignite/blob/d69362f8/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheAtomicReferenceApiSelfAbstractTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheAtomicReferenceApiSelfAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheAtomicReferenceApiSelfAbstractTest.java index 416776a..278bcf9 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheAtomicReferenceApiSelfAbstractTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheAtomicReferenceApiSelfAbstractTest.java @@ -97,15 +97,13 @@ public abstract class GridCacheAtomicReferenceApiSelfAbstractTest extends Ignite String initVal = "qwerty"; - IgniteAtomicReference<String> atomic = grid(0).atomicReference(atomicName, null, true); + IgniteAtomicReference<String> atomic = grid(0).atomicReference(atomicName, initVal, true); - assertEquals(null, atomic.get()); + assertEquals(initVal, atomic.get()); - boolean res = atomic.compareAndSet(null, "x"); + atomic.compareAndSet("h", "j"); - assertEquals(null, atomic.get()); // ok - assertTrue(res); // fail - assertEquals("x", atomic.get()); // fail + assertEquals(initVal, atomic.get()); atomic.compareAndSet(initVal, null); http://git-wip-us.apache.org/repos/asf/ignite/blob/d69362f8/modules/core/src/test/java/org/apache/ignite/platform/PlatformComputeBinarizable.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/platform/PlatformComputeBinarizable.java b/modules/core/src/test/java/org/apache/ignite/platform/PlatformComputeBinarizable.java new file mode 100644 index 0000000..55b3099 --- /dev/null +++ b/modules/core/src/test/java/org/apache/ignite/platform/PlatformComputeBinarizable.java @@ -0,0 +1,42 @@ +/* + * 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.platform; + +/** + * Binarizable object for task tests. + */ +public class PlatformComputeBinarizable { + /** Field. */ + public int field; + + /** + * Constructor. + */ + public PlatformComputeBinarizable() { + // No-op. + } + + /** + * Constructor, + * + * @param field Field. + */ + public PlatformComputeBinarizable(int field) { + this.field = field; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/d69362f8/modules/core/src/test/java/org/apache/ignite/platform/PlatformComputeBinarizableArgTask.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/platform/PlatformComputeBinarizableArgTask.java b/modules/core/src/test/java/org/apache/ignite/platform/PlatformComputeBinarizableArgTask.java new file mode 100644 index 0000000..77c7e3a --- /dev/null +++ b/modules/core/src/test/java/org/apache/ignite/platform/PlatformComputeBinarizableArgTask.java @@ -0,0 +1,119 @@ +/* + * 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.platform; + +import org.apache.ignite.Ignite; +import org.apache.ignite.IgniteException; +import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.compute.ComputeJob; +import org.apache.ignite.compute.ComputeJobAdapter; +import org.apache.ignite.compute.ComputeJobResult; +import org.apache.ignite.compute.ComputeTaskAdapter; +import org.apache.ignite.internal.util.typedef.F; +import org.apache.ignite.binary.BinaryType; +import org.apache.ignite.binary.BinaryObject; +import org.apache.ignite.resources.IgniteInstanceResource; +import org.jetbrains.annotations.Nullable; + +import java.io.Externalizable; +import java.io.IOException; +import java.io.ObjectInput; +import java.io.ObjectOutput; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +/** + * Task working with binarizable argument. + */ +public class PlatformComputeBinarizableArgTask extends ComputeTaskAdapter<Object, Integer> { + /** {@inheritDoc} */ + @Nullable @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, @Nullable Object arg) { + return Collections.singletonMap(new BinarizableArgJob(arg), F.first(subgrid)); + } + + /** {@inheritDoc} */ + @SuppressWarnings("ThrowableResultOfMethodCallIgnored") + @Nullable @Override public Integer reduce(List<ComputeJobResult> results) { + ComputeJobResult res = results.get(0); + + if (res.getException() != null) + throw res.getException(); + else + return results.get(0).getData(); + } + + /** + * Job. + */ + private static class BinarizableArgJob extends ComputeJobAdapter implements Externalizable { + /** */ + @IgniteInstanceResource + private Ignite ignite; + + /** Argument. */ + private Object arg; + + /** + * Constructor. + */ + public BinarizableArgJob() { + // No-op. + } + + /** + * Constructor. + * + * @param arg Argument. + */ + private BinarizableArgJob(Object arg) { + this.arg = arg; + } + + /** {@inheritDoc} */ + @Nullable @Override public Object execute() { + BinaryObject arg0 = ((BinaryObject)arg); + + BinaryType meta = ignite.binary().metadata(arg0.typeId()); + + if (meta == null) + throw new IgniteException("Metadata doesn't exist."); + + if (meta.fields() == null || !meta.fields().contains("Field")) + throw new IgniteException("Field metadata doesn't exist."); + + if (!F.eq("int", meta.fieldTypeName("Field"))) + throw new IgniteException("Invalid field type: " + meta.fieldTypeName("Field")); + + if (meta.affinityKeyFieldName() != null) + throw new IgniteException("Unexpected affinity key: " + meta.affinityKeyFieldName()); + + return arg0.field("field"); + } + + /** {@inheritDoc} */ + @Override public void writeExternal(ObjectOutput out) throws IOException { + out.writeObject(arg); + } + + /** {@inheritDoc} */ + @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { + arg = in.readObject(); + } + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/d69362f8/modules/core/src/test/java/org/apache/ignite/platform/PlatformComputeEchoTask.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/platform/PlatformComputeEchoTask.java b/modules/core/src/test/java/org/apache/ignite/platform/PlatformComputeEchoTask.java index f64ca7d..fe4e01c 100644 --- a/modules/core/src/test/java/org/apache/ignite/platform/PlatformComputeEchoTask.java +++ b/modules/core/src/test/java/org/apache/ignite/platform/PlatformComputeEchoTask.java @@ -155,19 +155,19 @@ public class PlatformComputeEchoTask extends ComputeTaskAdapter<Integer, Object> return Collections.singletonMap(1, 1); case TYPE_PORTABLE: - return new PlatformComputePortable(1); + return new PlatformComputeBinarizable(1); case TYPE_PORTABLE_JAVA: - return new PlatformComputeJavaPortable(1); + return new PlatformComputeJavaBinarizable(1); case TYPE_OBJ_ARRAY: return new String[] { "foo", "bar", "baz" }; case TYPE_PORTABLE_ARRAY: - return new PlatformComputePortable[] { - new PlatformComputePortable(1), - new PlatformComputePortable(2), - new PlatformComputePortable(3) + return new PlatformComputeBinarizable[] { + new PlatformComputeBinarizable(1), + new PlatformComputeBinarizable(2), + new PlatformComputeBinarizable(3) }; case TYPE_ENUM: http://git-wip-us.apache.org/repos/asf/ignite/blob/d69362f8/modules/core/src/test/java/org/apache/ignite/platform/PlatformComputeJavaBinarizable.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/platform/PlatformComputeJavaBinarizable.java b/modules/core/src/test/java/org/apache/ignite/platform/PlatformComputeJavaBinarizable.java new file mode 100644 index 0000000..ade09db --- /dev/null +++ b/modules/core/src/test/java/org/apache/ignite/platform/PlatformComputeJavaBinarizable.java @@ -0,0 +1,39 @@ +/* + * 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.platform; + +/** + * Binarizable object defined only in Java. + */ +public class PlatformComputeJavaBinarizable extends PlatformComputeBinarizable { + /** + * Constructor. + */ + public PlatformComputeJavaBinarizable() { + // No-op. + } + + /** + * Constructor. + * + * @param field Field. + */ + public PlatformComputeJavaBinarizable(int field) { + super(field); + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/d69362f8/modules/core/src/test/java/org/apache/ignite/platform/PlatformComputeJavaPortable.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/platform/PlatformComputeJavaPortable.java b/modules/core/src/test/java/org/apache/ignite/platform/PlatformComputeJavaPortable.java deleted file mode 100644 index 7a940c4..0000000 --- a/modules/core/src/test/java/org/apache/ignite/platform/PlatformComputeJavaPortable.java +++ /dev/null @@ -1,39 +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.platform; - -/** - * Portable object defined only in Java. - */ -public class PlatformComputeJavaPortable extends PlatformComputePortable { - /** - * Constructor. - */ - public PlatformComputeJavaPortable() { - // No-op. - } - - /** - * Constructor. - * - * @param field Field. - */ - public PlatformComputeJavaPortable(int field) { - super(field); - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/d69362f8/modules/core/src/test/java/org/apache/ignite/platform/PlatformComputePortable.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/platform/PlatformComputePortable.java b/modules/core/src/test/java/org/apache/ignite/platform/PlatformComputePortable.java deleted file mode 100644 index f31f093..0000000 --- a/modules/core/src/test/java/org/apache/ignite/platform/PlatformComputePortable.java +++ /dev/null @@ -1,42 +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.platform; - -/** - * Portable object for task tests. - */ -public class PlatformComputePortable { - /** Field. */ - public int field; - - /** - * Constructor. - */ - public PlatformComputePortable() { - // No-op. - } - - /** - * Constructor, - * - * @param field Field. - */ - public PlatformComputePortable(int field) { - this.field = field; - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/d69362f8/modules/core/src/test/java/org/apache/ignite/platform/PlatformComputePortableArgTask.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/platform/PlatformComputePortableArgTask.java b/modules/core/src/test/java/org/apache/ignite/platform/PlatformComputePortableArgTask.java deleted file mode 100644 index 1e3c499..0000000 --- a/modules/core/src/test/java/org/apache/ignite/platform/PlatformComputePortableArgTask.java +++ /dev/null @@ -1,119 +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.platform; - -import org.apache.ignite.Ignite; -import org.apache.ignite.IgniteException; -import org.apache.ignite.cluster.ClusterNode; -import org.apache.ignite.compute.ComputeJob; -import org.apache.ignite.compute.ComputeJobAdapter; -import org.apache.ignite.compute.ComputeJobResult; -import org.apache.ignite.compute.ComputeTaskAdapter; -import org.apache.ignite.internal.util.typedef.F; -import org.apache.ignite.binary.BinaryType; -import org.apache.ignite.binary.BinaryObject; -import org.apache.ignite.resources.IgniteInstanceResource; -import org.jetbrains.annotations.Nullable; - -import java.io.Externalizable; -import java.io.IOException; -import java.io.ObjectInput; -import java.io.ObjectOutput; -import java.util.Collections; -import java.util.List; -import java.util.Map; - -/** - * Task working with portable argument. - */ -public class PlatformComputePortableArgTask extends ComputeTaskAdapter<Object, Integer> { - /** {@inheritDoc} */ - @Nullable @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, @Nullable Object arg) { - return Collections.singletonMap(new PortableArgJob(arg), F.first(subgrid)); - } - - /** {@inheritDoc} */ - @SuppressWarnings("ThrowableResultOfMethodCallIgnored") - @Nullable @Override public Integer reduce(List<ComputeJobResult> results) { - ComputeJobResult res = results.get(0); - - if (res.getException() != null) - throw res.getException(); - else - return results.get(0).getData(); - } - - /** - * Job. - */ - private static class PortableArgJob extends ComputeJobAdapter implements Externalizable { - /** */ - @IgniteInstanceResource - private Ignite ignite; - - /** Argument. */ - private Object arg; - - /** - * Constructor. - */ - public PortableArgJob() { - // No-op. - } - - /** - * Constructor. - * - * @param arg Argument. - */ - private PortableArgJob(Object arg) { - this.arg = arg; - } - - /** {@inheritDoc} */ - @Nullable @Override public Object execute() { - BinaryObject arg0 = ((BinaryObject)arg); - - BinaryType meta = ignite.binary().metadata(arg0.typeId()); - - if (meta == null) - throw new IgniteException("Metadata doesn't exist."); - - if (meta.fields() == null || !meta.fields().contains("Field")) - throw new IgniteException("Field metadata doesn't exist."); - - if (!F.eq("int", meta.fieldTypeName("Field"))) - throw new IgniteException("Invalid field type: " + meta.fieldTypeName("Field")); - - if (meta.affinityKeyFieldName() != null) - throw new IgniteException("Unexpected affinity key: " + meta.affinityKeyFieldName()); - - return arg0.field("field"); - } - - /** {@inheritDoc} */ - @Override public void writeExternal(ObjectOutput out) throws IOException { - out.writeObject(arg); - } - - /** {@inheritDoc} */ - @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { - arg = in.readObject(); - } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/d69362f8/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Apache.Ignite.Benchmarks.csproj ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Apache.Ignite.Benchmarks.csproj b/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Apache.Ignite.Benchmarks.csproj index 99737b8..14b6466 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Apache.Ignite.Benchmarks.csproj +++ b/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Apache.Ignite.Benchmarks.csproj @@ -63,8 +63,8 @@ <Compile Include="Model\Employee.cs" /> <Compile Include="Model\Sex.cs" /> <Compile Include="Model\TestModel.cs" /> - <Compile Include="Portable\PortableReadBenchmark.cs" /> - <Compile Include="Portable\PortableWriteBenchmark.cs" /> + <Compile Include="Binary\BinarizableReadBenchmark.cs" /> + <Compile Include="Binary\BinarizableWriteBenchmark.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Result\BenchmarkConsoleResultWriter.cs" /> <Compile Include="Result\BenchmarkFileResultWriter.cs" /> http://git-wip-us.apache.org/repos/asf/ignite/blob/d69362f8/modules/platforms/dotnet/Apache.Ignite.Benchmarks/BenchmarkRunner.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Benchmarks/BenchmarkRunner.cs b/modules/platforms/dotnet/Apache.Ignite.Benchmarks/BenchmarkRunner.cs index 2d0d348..5d8e78a 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Benchmarks/BenchmarkRunner.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Benchmarks/BenchmarkRunner.cs @@ -20,7 +20,7 @@ namespace Apache.Ignite.Benchmarks using System; using System.Diagnostics; using System.Text; - using Apache.Ignite.Benchmarks.Portable; + using Apache.Ignite.Benchmarks.Binary; /// <summary> /// Benchmark runner. @@ -35,7 +35,7 @@ namespace Apache.Ignite.Benchmarks public static void Main(string[] args) { args = new[] { - typeof(PortableReadBenchmark).FullName, + typeof(BinarizableReadBenchmark).FullName, "-ConfigPath", @"modules\platforms\dotnet\Apache.Ignite.Benchmarks\Config\benchmark.xml", "-Threads", "1", "-Warmup", "0", http://git-wip-us.apache.org/repos/asf/ignite/blob/d69362f8/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Binary/BinarizableReadBenchmark.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Binary/BinarizableReadBenchmark.cs b/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Binary/BinarizableReadBenchmark.cs new file mode 100644 index 0000000..09e588e --- /dev/null +++ b/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Binary/BinarizableReadBenchmark.cs @@ -0,0 +1,125 @@ +/* + * 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. + */ + +namespace Apache.Ignite.Benchmarks.Binary +{ + using System; + using System.Collections.Generic; + using System.Linq; + using Apache.Ignite.Benchmarks.Model; + using Apache.Ignite.Core.Binary; + using Apache.Ignite.Core.Impl.Binary; + using Apache.Ignite.Core.Impl.Memory; + + /// <summary> + /// Binary read benchmark. + /// </summary> + internal class BinarizableReadBenchmark : BenchmarkBase + { + /** Marshaller. */ + private readonly Marshaller _marsh; + + /** Memory manager. */ + private readonly PlatformMemoryManager _memMgr = new PlatformMemoryManager(1024); + + /** Memory chunk. */ + private readonly IPlatformMemory _mem; + + /** Pre-allocated address. */ + private readonly Address _address = BenchmarkUtils.GetRandomAddress(); + + /** Pre-allocated model. */ + private readonly TestModel _model = new TestModel + { + Byte = 5, + Boolean = true, + BooleanArray = new[] {true, false, false, false, true, true}, + ByteArray = new byte[] {128, 1, 2, 3, 5, 6, 8, 9, 14}, + Char = 'h', + CharArray = new[] {'b', 'n', 'm', 'q', 'w', 'e', 'r', 't', 'y'}, + Date = DateTime.Now, + DateArray = Enumerable.Range(1, 15).Select(x => (DateTime?) DateTime.Now.AddDays(x)).ToArray(), + Decimal = decimal.MinValue, + DecimalArray = new decimal?[] {1.1M, decimal.MinValue, decimal.MaxValue, decimal.MinusOne, decimal.One}, + Double = double.MaxValue/2, + DoubleArray = new[] {double.MaxValue, double.MinValue, double.Epsilon, double.NegativeInfinity}, + Float = 98, + FloatArray = new[] {float.MinValue, float.MaxValue, 10F, 36F}, + Guid = Guid.NewGuid(), + GuidArray = Enumerable.Range(1, 9).Select(x => (Guid?) Guid.NewGuid()).ToArray(), + Int = -90, + IntArray = new[] {128, 1, 2, 3, 5, 6, 8, 9, 14}, + Long = long.MinValue, + LongArray = Enumerable.Range(1, 12).Select(x => (long) x).ToArray(), + Short = 67, + ShortArray = Enumerable.Range(100, 12).Select(x => (short) x).ToArray(), + String = "String value test 123", + StringArray = Enumerable.Range(1, 13).Select(x => Guid.NewGuid().ToString()).ToArray() + }; + + /// <summary> + /// Initializes a new instance of the <see cref="BinarizableReadBenchmark"/> class. + /// </summary> + public BinarizableReadBenchmark() + { + _marsh = new Marshaller(new BinaryConfiguration + { + TypeConfigurations = new List<BinaryTypeConfiguration> + { + new BinaryTypeConfiguration(typeof (Address)), + new BinaryTypeConfiguration(typeof (TestModel)) + } + }); + + _mem = _memMgr.Allocate(); + + var stream = _mem.GetStream(); + + //_marsh.StartMarshal(stream).Write(_model); + _marsh.StartMarshal(stream).Write(_address); + + stream.SynchronizeOutput(); + } + + /// <summary> + /// Populate descriptors. + /// </summary> + /// <param name="descs">Descriptors.</param> + protected override void GetDescriptors(ICollection<BenchmarkOperationDescriptor> descs) + { + descs.Add(BenchmarkOperationDescriptor.Create("ReadTestModel", ReadTestModel, 1)); + } + + /// <summary> + /// Write address. + /// </summary> + /// <param name="state">State.</param> + private void ReadTestModel(BenchmarkState state) + { + //var model = _marsh.StartUnmarshal(_mem.GetStream()).ReadObject<TestModel>(); + + //if (model.Byte != _model.Byte) + // throw new InvalidOperationException(); + + var model = _marsh.StartUnmarshal(_mem.GetStream()).ReadObject<Address>(); + + if (model.FlatNumber != _address.FlatNumber) + throw new InvalidOperationException(); + + } + } +} http://git-wip-us.apache.org/repos/asf/ignite/blob/d69362f8/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Binary/BinarizableWriteBenchmark.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Binary/BinarizableWriteBenchmark.cs b/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Binary/BinarizableWriteBenchmark.cs new file mode 100644 index 0000000..c4d375f --- /dev/null +++ b/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Binary/BinarizableWriteBenchmark.cs @@ -0,0 +1,135 @@ +/* + * 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. + */ + +namespace Apache.Ignite.Benchmarks.Binary +{ + using System; + using System.Collections.Generic; + using System.Linq; + using Apache.Ignite.Benchmarks.Model; + using Apache.Ignite.Core.Binary; + using Apache.Ignite.Core.Impl.Binary; + using Apache.Ignite.Core.Impl.Memory; + + /// <summary> + /// Binary write benchmark. + /// </summary> + internal class BinarizableWriteBenchmark : BenchmarkBase + { + /** Marshaller. */ + private readonly Marshaller _marsh; + + /** Memory manager. */ + private readonly PlatformMemoryManager _memMgr = new PlatformMemoryManager(1024); + + /** Pre-allocated address. */ + private readonly Address _address = BenchmarkUtils.GetRandomAddress(); + + /** Pre-allocated model. */ + private readonly TestModel _model = new TestModel + { + Byte = 5, + Boolean = true, + BooleanArray = new[] {true, false, false, false, true, true}, + ByteArray = new byte[] {128, 1, 2, 3, 5, 6, 8, 9, 14}, + Char = 'h', + CharArray = new[] {'b', 'n', 'm', 'q', 'w', 'e', 'r', 't', 'y'}, + Date = DateTime.Now, + DateArray = Enumerable.Range(1, 15).Select(x => (DateTime?) DateTime.Now.AddDays(x)).ToArray(), + Decimal = decimal.MinValue, + DecimalArray = new decimal?[] {1.1M, decimal.MinValue, decimal.MaxValue, decimal.MinusOne, decimal.One}, + Double = double.MaxValue/2, + DoubleArray = new[] {double.MaxValue, double.MinValue, double.Epsilon, double.NegativeInfinity}, + Float = 98, + FloatArray = new[] {float.MinValue, float.MaxValue, 10F, 36F}, + Guid = Guid.NewGuid(), + GuidArray = Enumerable.Range(1, 9).Select(x => (Guid?) Guid.NewGuid()).ToArray(), + Int = -90, + IntArray = new[] {128, 1, 2, 3, 5, 6, 8, 9, 14}, + Long = long.MinValue, + LongArray = Enumerable.Range(1, 12).Select(x => (long) x).ToArray(), + Short = 67, + ShortArray = Enumerable.Range(100, 12).Select(x => (short) x).ToArray(), + String = "String value test 123", + StringArray = Enumerable.Range(1, 13).Select(x => Guid.NewGuid().ToString()).ToArray() + }; + + /// <summary> + /// Initializes a new instance of the <see cref="BinarizableWriteBenchmark"/> class. + /// </summary> + public BinarizableWriteBenchmark() + { + _marsh = new Marshaller(new BinaryConfiguration + { + TypeConfigurations = new List<BinaryTypeConfiguration> + { + new BinaryTypeConfiguration(typeof (Address)) + //new BinaryTypeConfiguration(typeof (TestModel)) + } + }); + } + + /// <summary> + /// Populate descriptors. + /// </summary> + /// <param name="descs">Descriptors.</param> + protected override void GetDescriptors(ICollection<BenchmarkOperationDescriptor> descs) + { + descs.Add(BenchmarkOperationDescriptor.Create("WriteAddress", WriteAddress, 1)); + //descs.Add(BenchmarkOperationDescriptor.Create("WriteTestModel", WriteTestModel, 1)); + } + + /// <summary> + /// Write address. + /// </summary> + /// <param name="state">State.</param> + private void WriteAddress(BenchmarkState state) + { + var mem = _memMgr.Allocate(); + + try + { + var stream = mem.GetStream(); + + _marsh.StartMarshal(stream).Write(_address); + } + finally + { + mem.Release(); + } + } + /// <summary> + /// Write address. + /// </summary> + /// <param name="state">State.</param> + private void WriteTestModel(BenchmarkState state) + { + var mem = _memMgr.Allocate(); + + try + { + var stream = mem.GetStream(); + + _marsh.StartMarshal(stream).Write(_model); + } + finally + { + mem.Release(); + } + } + } +} http://git-wip-us.apache.org/repos/asf/ignite/blob/d69362f8/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Interop/PlatformBenchmarkBase.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Interop/PlatformBenchmarkBase.cs b/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Interop/PlatformBenchmarkBase.cs index 67809d5..eeebed0 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Interop/PlatformBenchmarkBase.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Interop/PlatformBenchmarkBase.cs @@ -58,7 +58,7 @@ namespace Apache.Ignite.Benchmarks.Interop var cfg = new IgniteConfiguration { - BinaryConfiguration = GetPortableConfiguration(), + BinaryConfiguration = GetBinaryConfiguration(), JvmOptions = new List<string> { "-Xms2g", @@ -75,10 +75,10 @@ namespace Apache.Ignite.Benchmarks.Interop } /// <summary> - /// Get portable configuration. + /// Get binary configuration. /// </summary> - /// <returns>Portable configuration.</returns> - private static BinaryConfiguration GetPortableConfiguration() + /// <returns>Gets binary configuration.</returns> + private static BinaryConfiguration GetBinaryConfiguration() { return new BinaryConfiguration { http://git-wip-us.apache.org/repos/asf/ignite/blob/d69362f8/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Portable/PortableReadBenchmark.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Portable/PortableReadBenchmark.cs b/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Portable/PortableReadBenchmark.cs deleted file mode 100644 index ad9ae39..0000000 --- a/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Portable/PortableReadBenchmark.cs +++ /dev/null @@ -1,126 +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. - */ - -namespace Apache.Ignite.Benchmarks.Portable -{ - using System; - using System.Collections.Generic; - using System.Linq; - using Apache.Ignite.Benchmarks.Model; - using Apache.Ignite.Core.Binary; - using Apache.Ignite.Core.Impl.Binary; - using Apache.Ignite.Core.Impl.Memory; - - /// <summary> - /// Portable read benchmark. - /// </summary> - internal class PortableReadBenchmark : BenchmarkBase - { - /** Marshaller. */ - private readonly Marshaller _marsh; - - /** Memory manager. */ - private readonly PlatformMemoryManager _memMgr = new PlatformMemoryManager(1024); - - /** Memory chunk. */ - private readonly IPlatformMemory _mem; - - /** Pre-allocated address. */ - private readonly Address _address = BenchmarkUtils.GetRandomAddress(); - - - /** Pre-allocated model. */ - private readonly TestModel _model = new TestModel - { - Byte = 5, - Boolean = true, - BooleanArray = new[] {true, false, false, false, true, true}, - ByteArray = new byte[] {128, 1, 2, 3, 5, 6, 8, 9, 14}, - Char = 'h', - CharArray = new[] {'b', 'n', 'm', 'q', 'w', 'e', 'r', 't', 'y'}, - Date = DateTime.Now, - DateArray = Enumerable.Range(1, 15).Select(x => (DateTime?) DateTime.Now.AddDays(x)).ToArray(), - Decimal = decimal.MinValue, - DecimalArray = new decimal?[] {1.1M, decimal.MinValue, decimal.MaxValue, decimal.MinusOne, decimal.One}, - Double = double.MaxValue/2, - DoubleArray = new[] {double.MaxValue, double.MinValue, double.Epsilon, double.NegativeInfinity}, - Float = 98, - FloatArray = new[] {float.MinValue, float.MaxValue, 10F, 36F}, - Guid = Guid.NewGuid(), - GuidArray = Enumerable.Range(1, 9).Select(x => (Guid?) Guid.NewGuid()).ToArray(), - Int = -90, - IntArray = new[] {128, 1, 2, 3, 5, 6, 8, 9, 14}, - Long = long.MinValue, - LongArray = Enumerable.Range(1, 12).Select(x => (long) x).ToArray(), - Short = 67, - ShortArray = Enumerable.Range(100, 12).Select(x => (short) x).ToArray(), - String = "String value test 123", - StringArray = Enumerable.Range(1, 13).Select(x => Guid.NewGuid().ToString()).ToArray() - }; - - /// <summary> - /// Initializes a new instance of the <see cref="PortableReadBenchmark"/> class. - /// </summary> - public PortableReadBenchmark() - { - _marsh = new Marshaller(new BinaryConfiguration - { - TypeConfigurations = new List<BinaryTypeConfiguration> - { - new BinaryTypeConfiguration(typeof (Address)), - new BinaryTypeConfiguration(typeof (TestModel)) - } - }); - - _mem = _memMgr.Allocate(); - - var stream = _mem.GetStream(); - - //_marsh.StartMarshal(stream).Write(_model); - _marsh.StartMarshal(stream).Write(_address); - - stream.SynchronizeOutput(); - } - - /// <summary> - /// Populate descriptors. - /// </summary> - /// <param name="descs">Descriptors.</param> - protected override void GetDescriptors(ICollection<BenchmarkOperationDescriptor> descs) - { - descs.Add(BenchmarkOperationDescriptor.Create("ReadTestModel", ReadTestModel, 1)); - } - - /// <summary> - /// Write address. - /// </summary> - /// <param name="state">State.</param> - private void ReadTestModel(BenchmarkState state) - { - //var model = _marsh.StartUnmarshal(_mem.GetStream()).ReadObject<TestModel>(); - - //if (model.Byte != _model.Byte) - // throw new InvalidOperationException(); - - var model = _marsh.StartUnmarshal(_mem.GetStream()).ReadObject<Address>(); - - if (model.FlatNumber != _address.FlatNumber) - throw new InvalidOperationException(); - - } - } -} http://git-wip-us.apache.org/repos/asf/ignite/blob/d69362f8/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Portable/PortableWriteBenchmark.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Portable/PortableWriteBenchmark.cs b/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Portable/PortableWriteBenchmark.cs deleted file mode 100644 index a630161..0000000 --- a/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Portable/PortableWriteBenchmark.cs +++ /dev/null @@ -1,135 +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. - */ - -namespace Apache.Ignite.Benchmarks.Portable -{ - using System; - using System.Collections.Generic; - using System.Linq; - using Apache.Ignite.Benchmarks.Model; - using Apache.Ignite.Core.Binary; - using Apache.Ignite.Core.Impl.Binary; - using Apache.Ignite.Core.Impl.Memory; - - /// <summary> - /// Portable write benchmark. - /// </summary> - internal class PortableWriteBenchmark : BenchmarkBase - { - /** Marshaller. */ - private readonly Marshaller _marsh; - - /** Memory manager. */ - private readonly PlatformMemoryManager _memMgr = new PlatformMemoryManager(1024); - - /** Pre-allocated address. */ - private readonly Address _address = BenchmarkUtils.GetRandomAddress(); - - /** Pre-allocated model. */ - private readonly TestModel _model = new TestModel - { - Byte = 5, - Boolean = true, - BooleanArray = new[] {true, false, false, false, true, true}, - ByteArray = new byte[] {128, 1, 2, 3, 5, 6, 8, 9, 14}, - Char = 'h', - CharArray = new[] {'b', 'n', 'm', 'q', 'w', 'e', 'r', 't', 'y'}, - Date = DateTime.Now, - DateArray = Enumerable.Range(1, 15).Select(x => (DateTime?) DateTime.Now.AddDays(x)).ToArray(), - Decimal = decimal.MinValue, - DecimalArray = new decimal?[] {1.1M, decimal.MinValue, decimal.MaxValue, decimal.MinusOne, decimal.One}, - Double = double.MaxValue/2, - DoubleArray = new[] {double.MaxValue, double.MinValue, double.Epsilon, double.NegativeInfinity}, - Float = 98, - FloatArray = new[] {float.MinValue, float.MaxValue, 10F, 36F}, - Guid = Guid.NewGuid(), - GuidArray = Enumerable.Range(1, 9).Select(x => (Guid?) Guid.NewGuid()).ToArray(), - Int = -90, - IntArray = new[] {128, 1, 2, 3, 5, 6, 8, 9, 14}, - Long = long.MinValue, - LongArray = Enumerable.Range(1, 12).Select(x => (long) x).ToArray(), - Short = 67, - ShortArray = Enumerable.Range(100, 12).Select(x => (short) x).ToArray(), - String = "String value test 123", - StringArray = Enumerable.Range(1, 13).Select(x => Guid.NewGuid().ToString()).ToArray() - }; - - /// <summary> - /// Initializes a new instance of the <see cref="PortableWriteBenchmark"/> class. - /// </summary> - public PortableWriteBenchmark() - { - _marsh = new Marshaller(new BinaryConfiguration - { - TypeConfigurations = new List<BinaryTypeConfiguration> - { - new BinaryTypeConfiguration(typeof (Address)) - //new PortableTypeConfiguration(typeof (TestModel)) - } - }); - } - - /// <summary> - /// Populate descriptors. - /// </summary> - /// <param name="descs">Descriptors.</param> - protected override void GetDescriptors(ICollection<BenchmarkOperationDescriptor> descs) - { - descs.Add(BenchmarkOperationDescriptor.Create("WriteAddress", WriteAddress, 1)); - //descs.Add(BenchmarkOperationDescriptor.Create("WriteTestModel", WriteTestModel, 1)); - } - - /// <summary> - /// Write address. - /// </summary> - /// <param name="state">State.</param> - private void WriteAddress(BenchmarkState state) - { - var mem = _memMgr.Allocate(); - - try - { - var stream = mem.GetStream(); - - _marsh.StartMarshal(stream).Write(_address); - } - finally - { - mem.Release(); - } - } - /// <summary> - /// Write address. - /// </summary> - /// <param name="state">State.</param> - private void WriteTestModel(BenchmarkState state) - { - var mem = _memMgr.Allocate(); - - try - { - var stream = mem.GetStream(); - - _marsh.StartMarshal(stream).Write(_model); - } - finally - { - mem.Release(); - } - } - } -} http://git-wip-us.apache.org/repos/asf/ignite/blob/d69362f8/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj index 10b3dcd..a5bb7a8 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj @@ -84,7 +84,7 @@ <Compile Include="Cache\Store\CacheStoreTest.cs" /> <Compile Include="Cache\Store\CacheTestParallelLoadStore.cs" /> <Compile Include="Cache\Store\CacheTestStore.cs" /> - <Compile Include="Compute\Forked\ForkedPortableClosureTaskTest.cs" /> + <Compile Include="Compute\Forked\ForkedBinarizableClosureTaskTest.cs" /> <Compile Include="Compute\Forked\ForkedResourceTaskTest.cs" /> <Compile Include="Compute\Forked\ForkedSerializableClosureTaskTest.cs" /> <Compile Include="Compute\Forked\ForkedTaskAdapterTest.cs" /> @@ -94,8 +94,8 @@ <Compile Include="Compute\ComputeMultithreadedTest.cs" /> <Compile Include="Compute\IgniteExceptionTaskSelfTest.cs" /> <Compile Include="Compute\FailoverTaskSelfTest.cs" /> - <Compile Include="Compute\PortableClosureTaskTest.cs" /> - <Compile Include="Compute\PortableTaskTest.cs" /> + <Compile Include="Compute\BinarizableClosureTaskTest.cs" /> + <Compile Include="Compute\BinarizableTaskTest.cs" /> <Compile Include="Compute\ResourceTaskTest.cs" /> <Compile Include="Compute\SerializableClosureTaskTest.cs" /> <Compile Include="Compute\TaskAdapterTest.cs" /> @@ -116,21 +116,21 @@ <Compile Include="IgniteManagerTest.cs" /> <Compile Include="MarshallerTest.cs" /> <Compile Include="MessagingTest.cs" /> - <Compile Include="PortableConfigurationTest.cs" /> - <Compile Include="Portable\PortableStructureTest.cs" /> + <Compile Include="BinaryConfigurationTest.cs" /> + <Compile Include="Binary\BinaryStructureTest.cs" /> <Compile Include="SerializationTest.cs" /> <Compile Include="IgniteStartStopTest.cs" /> <Compile Include="TestUtils.cs" /> <Compile Include="Memory\InteropMemoryTest.cs" /> - <Compile Include="Portable\PortableApiSelfTest.cs" /> - <Compile Include="Portable\PortableSelfTest.cs" /> + <Compile Include="Binary\BinaryBuilderSelfTest.cs" /> + <Compile Include="Binary\BinarySelfTest.cs" /> <Compile Include="Process\IgniteProcess.cs" /> <Compile Include="Process\IgniteProcessConsoleOutputReader.cs" /> <Compile Include="Process\IIgniteProcessOutputReader.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> - <Compile Include="Query\ImplicitPortablePerson.cs" /> - <Compile Include="Query\NoDefPortablePerson.cs" /> - <Compile Include="Query\PortablePerson.cs" /> + <Compile Include="Query\ImplicitBinarizablePerson.cs" /> + <Compile Include="Query\NoDefBinarizablePerson.cs" /> + <Compile Include="Query\BinarizablePerson.cs" /> <Compile Include="Services\ServicesTest.cs" /> <Compile Include="Services\ServicesTestAsync.cs" /> <Compile Include="Services\ServiceProxyTest.cs" /> @@ -161,7 +161,7 @@ </ProjectReference> </ItemGroup> <ItemGroup> - <Content Include="Config\cache-portables.xml"> + <Content Include="Config\cache-binarizables.xml"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </Content> <Content Include="Config\cache-query-continuous.xml"> @@ -207,7 +207,7 @@ <Content Include="Config\marshaller-invalid.xml"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </Content> - <Content Include="Config\marshaller-portable.xml"> + <Content Include="Config\marshaller-explicit.xml"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </Content> <Content Include="Config\native-client-test-cache-affinity.xml"> @@ -222,7 +222,7 @@ <Content Include="Config\native-client-test-cache.xml"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </Content> - <Content Include="Config\portable.xml"> + <Content Include="Config\binary.xml"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </Content> <Content Include="Config\start-test-grid1.xml"> @@ -241,6 +241,7 @@ </Content> </ItemGroup> <ItemGroup> + <None Include="Apache.Ignite.Core.Tests.nunit" /> <None Include="Apache.Ignite.Core.Tests.snk" /> </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> http://git-wip-us.apache.org/repos/asf/ignite/blob/d69362f8/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.nunit ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.nunit b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.nunit new file mode 100644 index 0000000..7aeb108 --- /dev/null +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.nunit @@ -0,0 +1,7 @@ +<NUnitProject> + <Settings activeconfig="Debug" /> + <Config name="Debug" binpathtype="Auto"> + <assembly path="bin\x64\Debug\Apache.Ignite.Core.Tests.exe" /> + </Config> + <Config name="Release" binpathtype="Auto" /> +</NUnitProject> \ No newline at end of file