Return-Path: X-Original-To: apmail-ignite-commits-archive@minotaur.apache.org Delivered-To: apmail-ignite-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3B00D17A47 for ; Fri, 11 Sep 2015 11:36:22 +0000 (UTC) Received: (qmail 9229 invoked by uid 500); 11 Sep 2015 11:36:12 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 9147 invoked by uid 500); 11 Sep 2015 11:36:12 -0000 Mailing-List: contact commits-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list commits@ignite.apache.org Received: (qmail 8687 invoked by uid 99); 11 Sep 2015 11:36:12 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Sep 2015 11:36:12 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 59298E08EF; Fri, 11 Sep 2015 11:36:12 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sboikov@apache.org To: commits@ignite.apache.org Date: Fri, 11 Sep 2015 11:36:20 -0000 Message-Id: <127b5b9a1ea04cf1aa640712e61ba6a2@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [09/22] ignite git commit: IGNITE-1396: Hidden .Net platform API for a while. IGNITE-1396: Hidden .Net platform API for a while. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/d96e0d24 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/d96e0d24 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/d96e0d24 Branch: refs/heads/ignite-1093-2 Commit: d96e0d2410ee8dfa94af93b0b6aa6517dd2dedde Parents: 45df2a7 Author: vozerov-gridgain Authored: Thu Sep 10 11:41:19 2015 +0300 Committer: vozerov-gridgain Committed: Thu Sep 10 11:41:19 2015 +0300 ---------------------------------------------------------------------- .../internal/portable/PortableContext.java | 6 +- .../dotnet/PlatformDotNetConfiguration.java | 119 +++++++++ .../PlatformDotNetPortableConfiguration.java | 228 +++++++++++++++++ ...PlatformDotNetPortableTypeConfiguration.java | 248 +++++++++++++++++++ .../dotnet/PlatformDotNetConfiguration.java | 119 --------- .../PlatformDotNetPortableConfiguration.java | 228 ----------------- ...PlatformDotNetPortableTypeConfiguration.java | 248 ------------------- .../PlatformDotNetConfigurationClosure.java | 1 - .../dotnet/PlatformDotNetConfigurationEx.java | 1 - .../Config/Compute/compute-standalone.xml | 8 +- .../Config/cache-portables.xml | 4 +- .../Config/cache-query.xml | 4 +- .../native-client-test-cache-affinity.xml | 6 +- 13 files changed, 609 insertions(+), 611 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/d96e0d24/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableContext.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableContext.java b/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableContext.java index 52df2a0..c64adc8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableContext.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableContext.java @@ -61,9 +61,9 @@ import org.apache.ignite.lang.IgniteBiTuple; import org.apache.ignite.marshaller.MarshallerContext; import org.apache.ignite.marshaller.optimized.OptimizedMarshaller; import org.apache.ignite.marshaller.portable.PortableMarshaller; -import org.apache.ignite.platform.dotnet.PlatformDotNetConfiguration; -import org.apache.ignite.platform.dotnet.PlatformDotNetPortableConfiguration; -import org.apache.ignite.platform.dotnet.PlatformDotNetPortableTypeConfiguration; +import org.apache.ignite.internal.processors.platform.dotnet.PlatformDotNetConfiguration; +import org.apache.ignite.internal.processors.platform.dotnet.PlatformDotNetPortableConfiguration; +import org.apache.ignite.internal.processors.platform.dotnet.PlatformDotNetPortableTypeConfiguration; import org.apache.ignite.portable.PortableException; import org.apache.ignite.portable.PortableIdMapper; import org.apache.ignite.portable.PortableInvalidClassException; http://git-wip-us.apache.org/repos/asf/ignite/blob/d96e0d24/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetConfiguration.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetConfiguration.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetConfiguration.java new file mode 100644 index 0000000..fac69fb --- /dev/null +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetConfiguration.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.internal.processors.platform.dotnet; + +import org.apache.ignite.internal.processors.platform.PlatformConfiguration; +import org.apache.ignite.internal.util.typedef.internal.S; +import org.apache.ignite.portable.PortableException; +import org.apache.ignite.portable.PortableMarshalAware; +import org.apache.ignite.portable.PortableRawReader; +import org.apache.ignite.portable.PortableRawWriter; +import org.apache.ignite.portable.PortableReader; +import org.apache.ignite.portable.PortableWriter; + +import java.util.ArrayList; +import java.util.List; + +/** + * Mirror of .Net class Configuration.cs + */ +public class PlatformDotNetConfiguration implements PlatformConfiguration, PortableMarshalAware { + /** */ + private PlatformDotNetPortableConfiguration portableCfg; + + /** */ + private List assemblies; + + /** + * Default constructor. + */ + public PlatformDotNetConfiguration() { + // No-op. + } + + /** + * Copy constructor. + * + * @param cfg Configuration to copy. + */ + public PlatformDotNetConfiguration(PlatformDotNetConfiguration cfg) { + if (cfg.getPortableConfiguration() != null) + portableCfg = new PlatformDotNetPortableConfiguration(cfg.getPortableConfiguration()); + + if (cfg.getAssemblies() != null) + assemblies = new ArrayList<>(cfg.getAssemblies()); + } + + /** + * @return Configuration. + */ + public PlatformDotNetPortableConfiguration getPortableConfiguration() { + return portableCfg; + } + + /** + * @param portableCfg Configuration. + */ + public void setPortableConfiguration(PlatformDotNetPortableConfiguration portableCfg) { + this.portableCfg = portableCfg; + } + + /** + * @return Assemblies. + */ + public List getAssemblies() { + return assemblies; + } + + /** + * + * @param assemblies Assemblies. + */ + public void setAssemblies(List assemblies) { + this.assemblies = assemblies; + } + + /** + * @return Configuration copy. + */ + @SuppressWarnings("UnusedDeclaration") + private PlatformDotNetConfiguration copy() { + return new PlatformDotNetConfiguration(this); + } + + /** {@inheritDoc} */ + @Override public void writePortable(PortableWriter writer) throws PortableException { + PortableRawWriter rawWriter = writer.rawWriter(); + + rawWriter.writeObject(portableCfg); + rawWriter.writeCollection(assemblies); + } + + /** {@inheritDoc} */ + @Override public void readPortable(PortableReader reader) throws PortableException { + PortableRawReader rawReader = reader.rawReader(); + + portableCfg = rawReader.readObject(); + assemblies = (List)rawReader.readCollection(); + } + + /** {@inheritDoc} */ + @Override public String toString() { + return S.toString(PlatformDotNetConfiguration.class, this); + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/d96e0d24/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetPortableConfiguration.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetPortableConfiguration.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetPortableConfiguration.java new file mode 100644 index 0000000..a9b6022 --- /dev/null +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetPortableConfiguration.java @@ -0,0 +1,228 @@ +/* + * 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.platform.dotnet; + +import org.apache.ignite.internal.util.typedef.internal.S; +import org.apache.ignite.portable.PortableException; +import org.apache.ignite.portable.PortableMarshalAware; +import org.apache.ignite.portable.PortableRawReader; +import org.apache.ignite.portable.PortableRawWriter; +import org.apache.ignite.portable.PortableReader; +import org.apache.ignite.portable.PortableWriter; + +import java.util.ArrayList; +import java.util.Collection; + +/** + * Mirror of .Net class PortableConfiguration.cs + */ +public class PlatformDotNetPortableConfiguration implements PortableMarshalAware { + /** Type cfgs. */ + private Collection typesCfg; + + /** Types. */ + private Collection types; + + /** Default name mapper. */ + private String dfltNameMapper; + + /** Default id mapper. */ + private String dfltIdMapper; + + /** Default serializer. */ + private String dfltSerializer; + + /** Default metadata enabled. */ + private boolean dfltMetadataEnabled = true; + + /** Whether to cache deserialized value in IGridPortableObject */ + private boolean dfltKeepDeserialized = true; + + /** + * Default constructor. + */ + public PlatformDotNetPortableConfiguration() { + // No-op. + } + + /** + * Copy constructor. + * @param cfg configuration to copy. + */ + public PlatformDotNetPortableConfiguration(PlatformDotNetPortableConfiguration cfg) { + if (cfg.getTypesConfiguration() != null) { + typesCfg = new ArrayList<>(); + + for (PlatformDotNetPortableTypeConfiguration typeCfg : cfg.getTypesConfiguration()) + typesCfg.add(new PlatformDotNetPortableTypeConfiguration(typeCfg)); + } + + if (cfg.getTypes() != null) + types = new ArrayList<>(cfg.getTypes()); + + dfltNameMapper = cfg.getDefaultNameMapper(); + dfltIdMapper = cfg.getDefaultIdMapper(); + dfltSerializer = cfg.getDefaultSerializer(); + dfltMetadataEnabled = cfg.isDefaultMetadataEnabled(); + dfltKeepDeserialized = cfg.isDefaultKeepDeserialized(); + } + + /** + * @return Type cfgs. + */ + public Collection getTypesConfiguration() { + return typesCfg; + } + + /** + * @param typesCfg New type cfgs. + */ + public void setTypesConfiguration(Collection typesCfg) { + this.typesCfg = typesCfg; + } + + /** + * @return Types. + */ + public Collection getTypes() { + return types; + } + + /** + * @param types New types. + */ + public void setTypes(Collection types) { + this.types = types; + } + + /** + * @return Default name mapper. + */ + public String getDefaultNameMapper() { + return dfltNameMapper; + } + + /** + * @param dfltNameMapper New default name mapper. + */ + public void setDefaultNameMapper(String dfltNameMapper) { + this.dfltNameMapper = dfltNameMapper; + } + + /** + * @return Default id mapper. + */ + public String getDefaultIdMapper() { + return dfltIdMapper; + } + + /** + * @param dfltIdMapper New default id mapper. + */ + public void setDefaultIdMapper(String dfltIdMapper) { + this.dfltIdMapper = dfltIdMapper; + } + + /** + * @return Default serializer. + */ + public String getDefaultSerializer() { + return dfltSerializer; + } + + /** + * @param dfltSerializer New default serializer. + */ + public void setDefaultSerializer(String dfltSerializer) { + this.dfltSerializer = dfltSerializer; + } + + /** + * Gets default metadata enabled flag. See {@link #setDefaultMetadataEnabled(boolean)} for more information. + * + * @return Default metadata enabled flag. + */ + public boolean isDefaultMetadataEnabled() { + return dfltMetadataEnabled; + } + + /** + * Sets default metadata enabled flag. When set to {@code true} all portable types will save it's metadata to + * cluster. + *

+ * Can be overridden for particular type using + * {@link PlatformDotNetPortableTypeConfiguration#setMetadataEnabled(Boolean)}. + * + * @param dfltMetadataEnabled Default metadata enabled flag. + */ + public void setDefaultMetadataEnabled(boolean dfltMetadataEnabled) { + this.dfltMetadataEnabled = dfltMetadataEnabled; + } + + /** + * Gets default keep deserialized flag. See {@link #setDefaultKeepDeserialized(boolean)} for more information. + * + * @return Flag indicates whether to cache deserialized value in IGridPortableObject. + */ + public boolean isDefaultKeepDeserialized() { + return dfltKeepDeserialized; + } + + /** + * Sets default keep deserialized flag. + *

+ * Can be overridden for particular type using + * {@link PlatformDotNetPortableTypeConfiguration#setKeepDeserialized(Boolean)}. + * + * @param keepDeserialized Keep deserialized flag. + */ + public void setDefaultKeepDeserialized(boolean keepDeserialized) { + this.dfltKeepDeserialized = keepDeserialized; + } + + /** {@inheritDoc} */ + @Override public void writePortable(PortableWriter writer) throws PortableException { + PortableRawWriter rawWriter = writer.rawWriter(); + + rawWriter.writeCollection(typesCfg); + rawWriter.writeCollection(types); + rawWriter.writeString(dfltNameMapper); + rawWriter.writeString(dfltIdMapper); + rawWriter.writeString(dfltSerializer); + rawWriter.writeBoolean(dfltMetadataEnabled); + rawWriter.writeBoolean(dfltKeepDeserialized); + } + + /** {@inheritDoc} */ + @Override public void readPortable(PortableReader reader) throws PortableException { + PortableRawReader rawReader = reader.rawReader(); + + typesCfg = rawReader.readCollection(); + types = rawReader.readCollection(); + dfltNameMapper = rawReader.readString(); + dfltIdMapper = rawReader.readString(); + dfltSerializer = rawReader.readString(); + dfltMetadataEnabled = rawReader.readBoolean(); + dfltKeepDeserialized = rawReader.readBoolean(); + } + + /** {@inheritDoc} */ + @Override public String toString() { + return S.toString(PlatformDotNetPortableConfiguration.class, this); + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/d96e0d24/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetPortableTypeConfiguration.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetPortableTypeConfiguration.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetPortableTypeConfiguration.java new file mode 100644 index 0000000..d7f1ab1 --- /dev/null +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetPortableTypeConfiguration.java @@ -0,0 +1,248 @@ +/* + * 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.platform.dotnet; + +import org.apache.ignite.internal.util.typedef.internal.S; +import org.apache.ignite.portable.PortableException; +import org.apache.ignite.portable.PortableMarshalAware; +import org.apache.ignite.portable.PortableRawReader; +import org.apache.ignite.portable.PortableRawWriter; +import org.apache.ignite.portable.PortableReader; +import org.apache.ignite.portable.PortableWriter; +import org.jetbrains.annotations.Nullable; + +/** + * Mirror of .Net class GridDotNetPortableTypeConfiguration.cs + */ +public class PlatformDotNetPortableTypeConfiguration implements PortableMarshalAware { + /** Assembly name. */ + private String assemblyName; + + /** Type name. */ + private String typeName; + + /** Name mapper. */ + private String nameMapper; + + /** Id mapper. */ + private String idMapper; + + /** Serializer. */ + private String serializer; + + /** Affinity key field name. */ + private String affinityKeyFieldName; + + /** Metadata enabled. */ + private Boolean metadataEnabled; + + /** Whether to cache deserialized value in IGridPortableObject. */ + private Boolean keepDeserialized; + + /** + * Default constructor. + */ + public PlatformDotNetPortableTypeConfiguration() { + // No-op. + } + + /** + * Copy constructor. + * @param cfg configuration to copy. + */ + public PlatformDotNetPortableTypeConfiguration(PlatformDotNetPortableTypeConfiguration cfg) { + assemblyName = cfg.getAssemblyName(); + typeName = cfg.getTypeName(); + nameMapper = cfg.getNameMapper(); + idMapper = cfg.getIdMapper(); + serializer = cfg.getSerializer(); + affinityKeyFieldName = cfg.getAffinityKeyFieldName(); + metadataEnabled = cfg.getMetadataEnabled(); + keepDeserialized = cfg.isKeepDeserialized(); + } + + /** + * @return Assembly name. + */ + public String getAssemblyName() { + return assemblyName; + } + + /** + * @param assemblyName New assembly name. + */ + public void setAssemblyName(String assemblyName) { + this.assemblyName = assemblyName; + } + + /** + * @return Type name. + */ + public String getTypeName() { + return typeName; + } + + /** + * @param typeName New type name. + */ + public void setTypeName(String typeName) { + this.typeName = typeName; + } + + /** + * @return Name mapper. + */ + public String getNameMapper() { + return nameMapper; + } + + /** + * @param nameMapper New name mapper. + */ + public void setNameMapper(String nameMapper) { + this.nameMapper = nameMapper; + } + + /** + * @return Id mapper. + */ + public String getIdMapper() { + return idMapper; + } + + /** + * @param idMapper New id mapper. + */ + public void setIdMapper(String idMapper) { + this.idMapper = idMapper; + } + + /** + * @return Serializer. + */ + public String getSerializer() { + return serializer; + } + + /** + * @param serializer New serializer. + */ + public void setSerializer(String serializer) { + this.serializer = serializer; + } + + /** + * Gets metadata enabled flag. See {@link #setMetadataEnabled(Boolean)} for more information. + * + * @return Metadata enabled flag. + */ + public Boolean getMetadataEnabled() { + return metadataEnabled; + } + + /** + * Sets metadata enabled flag. + *

+ * When set to {@code null} default value taken from + * {@link PlatformDotNetPortableConfiguration#isDefaultMetadataEnabled()} will be used. + * + * @param metadataEnabled New metadata enabled. + */ + public void setMetadataEnabled(Boolean metadataEnabled) { + this.metadataEnabled = metadataEnabled; + } + + /** + * @return Affinity key field name. + */ + public String getAffinityKeyFieldName() { + return affinityKeyFieldName; + } + + /** + * @param affinityKeyFieldName Affinity key field name. + */ + public void setAffinityKeyFieldName(String affinityKeyFieldName) { + this.affinityKeyFieldName = affinityKeyFieldName; + } + + /** + * Gets keep deserialized flag. + * + * @return Flag indicates whether to cache deserialized value in IGridPortableObject. + * @deprecated Use {@link #getKeepDeserialized()} instead. + */ + @Deprecated + @Nullable public Boolean isKeepDeserialized() { + return keepDeserialized; + } + + /** + * Gets keep deserialized flag. See {@link #setKeepDeserialized(Boolean)} for more information. + * + * @return Flag indicates whether to cache deserialized value in IGridPortableObject. + */ + @Nullable public Boolean getKeepDeserialized() { + return keepDeserialized; + } + + /** + * Sets keep deserialized flag. + *

+ * When set to {@code null} default value taken from + * {@link PlatformDotNetPortableConfiguration#isDefaultKeepDeserialized()} will be used. + * + * @param keepDeserialized Keep deserialized flag. + */ + public void setKeepDeserialized(@Nullable Boolean keepDeserialized) { + this.keepDeserialized = keepDeserialized; + } + + /** {@inheritDoc} */ + @Override public void writePortable(PortableWriter writer) throws PortableException { + PortableRawWriter rawWriter = writer.rawWriter(); + + rawWriter.writeString(assemblyName); + rawWriter.writeString(typeName); + rawWriter.writeString(nameMapper); + rawWriter.writeString(idMapper); + rawWriter.writeString(serializer); + rawWriter.writeString(affinityKeyFieldName); + rawWriter.writeObject(metadataEnabled); + rawWriter.writeObject(keepDeserialized); + } + + /** {@inheritDoc} */ + @Override public void readPortable(PortableReader reader) throws PortableException { + PortableRawReader rawReader = reader.rawReader(); + + assemblyName = rawReader.readString(); + typeName = rawReader.readString(); + nameMapper = rawReader.readString(); + idMapper = rawReader.readString(); + serializer = rawReader.readString(); + affinityKeyFieldName = rawReader.readString(); + metadataEnabled = rawReader.readObject(); + keepDeserialized = rawReader.readObject(); + } + + /** {@inheritDoc} */ + @Override public String toString() { + return S.toString(PlatformDotNetPortableTypeConfiguration.class, this); + } +} http://git-wip-us.apache.org/repos/asf/ignite/blob/d96e0d24/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 deleted file mode 100644 index bbeee3b..0000000 --- a/modules/core/src/main/java/org/apache/ignite/platform/dotnet/PlatformDotNetConfiguration.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.dotnet; - -import org.apache.ignite.internal.processors.platform.PlatformConfiguration; -import org.apache.ignite.internal.util.typedef.internal.S; -import org.apache.ignite.portable.PortableException; -import org.apache.ignite.portable.PortableMarshalAware; -import org.apache.ignite.portable.PortableRawReader; -import org.apache.ignite.portable.PortableRawWriter; -import org.apache.ignite.portable.PortableReader; -import org.apache.ignite.portable.PortableWriter; - -import java.util.ArrayList; -import java.util.List; - -/** - * Mirror of .Net class Configuration.cs - */ -public class PlatformDotNetConfiguration implements PlatformConfiguration, PortableMarshalAware { - /** */ - private PlatformDotNetPortableConfiguration portableCfg; - - /** */ - private List assemblies; - - /** - * Default constructor. - */ - public PlatformDotNetConfiguration() { - // No-op. - } - - /** - * Copy constructor. - * - * @param cfg Configuration to copy. - */ - public PlatformDotNetConfiguration(PlatformDotNetConfiguration cfg) { - if (cfg.getPortableConfiguration() != null) - portableCfg = new PlatformDotNetPortableConfiguration(cfg.getPortableConfiguration()); - - if (cfg.getAssemblies() != null) - assemblies = new ArrayList<>(cfg.getAssemblies()); - } - - /** - * @return Configuration. - */ - public PlatformDotNetPortableConfiguration getPortableConfiguration() { - return portableCfg; - } - - /** - * @param portableCfg Configuration. - */ - public void setPortableConfiguration(PlatformDotNetPortableConfiguration portableCfg) { - this.portableCfg = portableCfg; - } - - /** - * @return Assemblies. - */ - public List getAssemblies() { - return assemblies; - } - - /** - * - * @param assemblies Assemblies. - */ - public void setAssemblies(List assemblies) { - this.assemblies = assemblies; - } - - /** - * @return Configuration copy. - */ - @SuppressWarnings("UnusedDeclaration") - private PlatformDotNetConfiguration copy() { - return new PlatformDotNetConfiguration(this); - } - - /** {@inheritDoc} */ - @Override public void writePortable(PortableWriter writer) throws PortableException { - PortableRawWriter rawWriter = writer.rawWriter(); - - rawWriter.writeObject(portableCfg); - rawWriter.writeCollection(assemblies); - } - - /** {@inheritDoc} */ - @Override public void readPortable(PortableReader reader) throws PortableException { - PortableRawReader rawReader = reader.rawReader(); - - portableCfg = rawReader.readObject(); - assemblies = (List)rawReader.readCollection(); - } - - /** {@inheritDoc} */ - @Override public String toString() { - return S.toString(PlatformDotNetConfiguration.class, this); - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/d96e0d24/modules/core/src/main/java/org/apache/ignite/platform/dotnet/PlatformDotNetPortableConfiguration.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/platform/dotnet/PlatformDotNetPortableConfiguration.java b/modules/core/src/main/java/org/apache/ignite/platform/dotnet/PlatformDotNetPortableConfiguration.java deleted file mode 100644 index 644a8e6..0000000 --- a/modules/core/src/main/java/org/apache/ignite/platform/dotnet/PlatformDotNetPortableConfiguration.java +++ /dev/null @@ -1,228 +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.dotnet; - -import org.apache.ignite.internal.util.typedef.internal.S; -import org.apache.ignite.portable.PortableException; -import org.apache.ignite.portable.PortableMarshalAware; -import org.apache.ignite.portable.PortableRawReader; -import org.apache.ignite.portable.PortableRawWriter; -import org.apache.ignite.portable.PortableReader; -import org.apache.ignite.portable.PortableWriter; - -import java.util.ArrayList; -import java.util.Collection; - -/** - * Mirror of .Net class PortableConfiguration.cs - */ -public class PlatformDotNetPortableConfiguration implements PortableMarshalAware { - /** Type cfgs. */ - private Collection typesCfg; - - /** Types. */ - private Collection types; - - /** Default name mapper. */ - private String dfltNameMapper; - - /** Default id mapper. */ - private String dfltIdMapper; - - /** Default serializer. */ - private String dfltSerializer; - - /** Default metadata enabled. */ - private boolean dfltMetadataEnabled = true; - - /** Whether to cache deserialized value in IGridPortableObject */ - private boolean dfltKeepDeserialized = true; - - /** - * Default constructor. - */ - public PlatformDotNetPortableConfiguration() { - // No-op. - } - - /** - * Copy constructor. - * @param cfg configuration to copy. - */ - public PlatformDotNetPortableConfiguration(PlatformDotNetPortableConfiguration cfg) { - if (cfg.getTypesConfiguration() != null) { - typesCfg = new ArrayList<>(); - - for (PlatformDotNetPortableTypeConfiguration typeCfg : cfg.getTypesConfiguration()) - typesCfg.add(new PlatformDotNetPortableTypeConfiguration(typeCfg)); - } - - if (cfg.getTypes() != null) - types = new ArrayList<>(cfg.getTypes()); - - dfltNameMapper = cfg.getDefaultNameMapper(); - dfltIdMapper = cfg.getDefaultIdMapper(); - dfltSerializer = cfg.getDefaultSerializer(); - dfltMetadataEnabled = cfg.isDefaultMetadataEnabled(); - dfltKeepDeserialized = cfg.isDefaultKeepDeserialized(); - } - - /** - * @return Type cfgs. - */ - public Collection getTypesConfiguration() { - return typesCfg; - } - - /** - * @param typesCfg New type cfgs. - */ - public void setTypesConfiguration(Collection typesCfg) { - this.typesCfg = typesCfg; - } - - /** - * @return Types. - */ - public Collection getTypes() { - return types; - } - - /** - * @param types New types. - */ - public void setTypes(Collection types) { - this.types = types; - } - - /** - * @return Default name mapper. - */ - public String getDefaultNameMapper() { - return dfltNameMapper; - } - - /** - * @param dfltNameMapper New default name mapper. - */ - public void setDefaultNameMapper(String dfltNameMapper) { - this.dfltNameMapper = dfltNameMapper; - } - - /** - * @return Default id mapper. - */ - public String getDefaultIdMapper() { - return dfltIdMapper; - } - - /** - * @param dfltIdMapper New default id mapper. - */ - public void setDefaultIdMapper(String dfltIdMapper) { - this.dfltIdMapper = dfltIdMapper; - } - - /** - * @return Default serializer. - */ - public String getDefaultSerializer() { - return dfltSerializer; - } - - /** - * @param dfltSerializer New default serializer. - */ - public void setDefaultSerializer(String dfltSerializer) { - this.dfltSerializer = dfltSerializer; - } - - /** - * Gets default metadata enabled flag. See {@link #setDefaultMetadataEnabled(boolean)} for more information. - * - * @return Default metadata enabled flag. - */ - public boolean isDefaultMetadataEnabled() { - return dfltMetadataEnabled; - } - - /** - * Sets default metadata enabled flag. When set to {@code true} all portable types will save it's metadata to - * cluster. - *

- * Can be overridden for particular type using - * {@link PlatformDotNetPortableTypeConfiguration#setMetadataEnabled(Boolean)}. - * - * @param dfltMetadataEnabled Default metadata enabled flag. - */ - public void setDefaultMetadataEnabled(boolean dfltMetadataEnabled) { - this.dfltMetadataEnabled = dfltMetadataEnabled; - } - - /** - * Gets default keep deserialized flag. See {@link #setDefaultKeepDeserialized(boolean)} for more information. - * - * @return Flag indicates whether to cache deserialized value in IGridPortableObject. - */ - public boolean isDefaultKeepDeserialized() { - return dfltKeepDeserialized; - } - - /** - * Sets default keep deserialized flag. - *

- * Can be overridden for particular type using - * {@link PlatformDotNetPortableTypeConfiguration#setKeepDeserialized(Boolean)}. - * - * @param keepDeserialized Keep deserialized flag. - */ - public void setDefaultKeepDeserialized(boolean keepDeserialized) { - this.dfltKeepDeserialized = keepDeserialized; - } - - /** {@inheritDoc} */ - @Override public void writePortable(PortableWriter writer) throws PortableException { - PortableRawWriter rawWriter = writer.rawWriter(); - - rawWriter.writeCollection(typesCfg); - rawWriter.writeCollection(types); - rawWriter.writeString(dfltNameMapper); - rawWriter.writeString(dfltIdMapper); - rawWriter.writeString(dfltSerializer); - rawWriter.writeBoolean(dfltMetadataEnabled); - rawWriter.writeBoolean(dfltKeepDeserialized); - } - - /** {@inheritDoc} */ - @Override public void readPortable(PortableReader reader) throws PortableException { - PortableRawReader rawReader = reader.rawReader(); - - typesCfg = rawReader.readCollection(); - types = rawReader.readCollection(); - dfltNameMapper = rawReader.readString(); - dfltIdMapper = rawReader.readString(); - dfltSerializer = rawReader.readString(); - dfltMetadataEnabled = rawReader.readBoolean(); - dfltKeepDeserialized = rawReader.readBoolean(); - } - - /** {@inheritDoc} */ - @Override public String toString() { - return S.toString(PlatformDotNetPortableConfiguration.class, this); - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/d96e0d24/modules/core/src/main/java/org/apache/ignite/platform/dotnet/PlatformDotNetPortableTypeConfiguration.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/platform/dotnet/PlatformDotNetPortableTypeConfiguration.java b/modules/core/src/main/java/org/apache/ignite/platform/dotnet/PlatformDotNetPortableTypeConfiguration.java deleted file mode 100644 index b6fdbde..0000000 --- a/modules/core/src/main/java/org/apache/ignite/platform/dotnet/PlatformDotNetPortableTypeConfiguration.java +++ /dev/null @@ -1,248 +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.dotnet; - -import org.apache.ignite.internal.util.typedef.internal.S; -import org.apache.ignite.portable.PortableException; -import org.apache.ignite.portable.PortableMarshalAware; -import org.apache.ignite.portable.PortableRawReader; -import org.apache.ignite.portable.PortableRawWriter; -import org.apache.ignite.portable.PortableReader; -import org.apache.ignite.portable.PortableWriter; -import org.jetbrains.annotations.Nullable; - -/** - * Mirror of .Net class GridDotNetPortableTypeConfiguration.cs - */ -public class PlatformDotNetPortableTypeConfiguration implements PortableMarshalAware { - /** Assembly name. */ - private String assemblyName; - - /** Type name. */ - private String typeName; - - /** Name mapper. */ - private String nameMapper; - - /** Id mapper. */ - private String idMapper; - - /** Serializer. */ - private String serializer; - - /** Affinity key field name. */ - private String affinityKeyFieldName; - - /** Metadata enabled. */ - private Boolean metadataEnabled; - - /** Whether to cache deserialized value in IGridPortableObject. */ - private Boolean keepDeserialized; - - /** - * Default constructor. - */ - public PlatformDotNetPortableTypeConfiguration() { - // No-op. - } - - /** - * Copy constructor. - * @param cfg configuration to copy. - */ - public PlatformDotNetPortableTypeConfiguration(PlatformDotNetPortableTypeConfiguration cfg) { - assemblyName = cfg.getAssemblyName(); - typeName = cfg.getTypeName(); - nameMapper = cfg.getNameMapper(); - idMapper = cfg.getIdMapper(); - serializer = cfg.getSerializer(); - affinityKeyFieldName = cfg.getAffinityKeyFieldName(); - metadataEnabled = cfg.getMetadataEnabled(); - keepDeserialized = cfg.isKeepDeserialized(); - } - - /** - * @return Assembly name. - */ - public String getAssemblyName() { - return assemblyName; - } - - /** - * @param assemblyName New assembly name. - */ - public void setAssemblyName(String assemblyName) { - this.assemblyName = assemblyName; - } - - /** - * @return Type name. - */ - public String getTypeName() { - return typeName; - } - - /** - * @param typeName New type name. - */ - public void setTypeName(String typeName) { - this.typeName = typeName; - } - - /** - * @return Name mapper. - */ - public String getNameMapper() { - return nameMapper; - } - - /** - * @param nameMapper New name mapper. - */ - public void setNameMapper(String nameMapper) { - this.nameMapper = nameMapper; - } - - /** - * @return Id mapper. - */ - public String getIdMapper() { - return idMapper; - } - - /** - * @param idMapper New id mapper. - */ - public void setIdMapper(String idMapper) { - this.idMapper = idMapper; - } - - /** - * @return Serializer. - */ - public String getSerializer() { - return serializer; - } - - /** - * @param serializer New serializer. - */ - public void setSerializer(String serializer) { - this.serializer = serializer; - } - - /** - * Gets metadata enabled flag. See {@link #setMetadataEnabled(Boolean)} for more information. - * - * @return Metadata enabled flag. - */ - public Boolean getMetadataEnabled() { - return metadataEnabled; - } - - /** - * Sets metadata enabled flag. - *

- * When set to {@code null} default value taken from - * {@link PlatformDotNetPortableConfiguration#isDefaultMetadataEnabled()} will be used. - * - * @param metadataEnabled New metadata enabled. - */ - public void setMetadataEnabled(Boolean metadataEnabled) { - this.metadataEnabled = metadataEnabled; - } - - /** - * @return Affinity key field name. - */ - public String getAffinityKeyFieldName() { - return affinityKeyFieldName; - } - - /** - * @param affinityKeyFieldName Affinity key field name. - */ - public void setAffinityKeyFieldName(String affinityKeyFieldName) { - this.affinityKeyFieldName = affinityKeyFieldName; - } - - /** - * Gets keep deserialized flag. - * - * @return Flag indicates whether to cache deserialized value in IGridPortableObject. - * @deprecated Use {@link #getKeepDeserialized()} instead. - */ - @Deprecated - @Nullable public Boolean isKeepDeserialized() { - return keepDeserialized; - } - - /** - * Gets keep deserialized flag. See {@link #setKeepDeserialized(Boolean)} for more information. - * - * @return Flag indicates whether to cache deserialized value in IGridPortableObject. - */ - @Nullable public Boolean getKeepDeserialized() { - return keepDeserialized; - } - - /** - * Sets keep deserialized flag. - *

- * When set to {@code null} default value taken from - * {@link PlatformDotNetPortableConfiguration#isDefaultKeepDeserialized()} will be used. - * - * @param keepDeserialized Keep deserialized flag. - */ - public void setKeepDeserialized(@Nullable Boolean keepDeserialized) { - this.keepDeserialized = keepDeserialized; - } - - /** {@inheritDoc} */ - @Override public void writePortable(PortableWriter writer) throws PortableException { - PortableRawWriter rawWriter = writer.rawWriter(); - - rawWriter.writeString(assemblyName); - rawWriter.writeString(typeName); - rawWriter.writeString(nameMapper); - rawWriter.writeString(idMapper); - rawWriter.writeString(serializer); - rawWriter.writeString(affinityKeyFieldName); - rawWriter.writeObject(metadataEnabled); - rawWriter.writeObject(keepDeserialized); - } - - /** {@inheritDoc} */ - @Override public void readPortable(PortableReader reader) throws PortableException { - PortableRawReader rawReader = reader.rawReader(); - - assemblyName = rawReader.readString(); - typeName = rawReader.readString(); - nameMapper = rawReader.readString(); - idMapper = rawReader.readString(); - serializer = rawReader.readString(); - affinityKeyFieldName = rawReader.readString(); - metadataEnabled = rawReader.readObject(); - keepDeserialized = rawReader.readObject(); - } - - /** {@inheritDoc} */ - @Override public String toString() { - return S.toString(PlatformDotNetPortableTypeConfiguration.class, this); - } -} http://git-wip-us.apache.org/repos/asf/ignite/blob/d96e0d24/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetConfigurationClosure.java ---------------------------------------------------------------------- diff --git a/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetConfigurationClosure.java b/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetConfigurationClosure.java index 6c3128a..6e03dfe 100644 --- a/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetConfigurationClosure.java +++ b/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetConfigurationClosure.java @@ -37,7 +37,6 @@ import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.lifecycle.LifecycleBean; import org.apache.ignite.marshaller.Marshaller; import org.apache.ignite.marshaller.portable.PortableMarshaller; -import org.apache.ignite.platform.dotnet.PlatformDotNetConfiguration; import org.apache.ignite.platform.dotnet.PlatformDotNetLifecycleBean; import org.apache.ignite.portable.PortableException; import org.apache.ignite.portable.PortableMetadata; http://git-wip-us.apache.org/repos/asf/ignite/blob/d96e0d24/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetConfigurationEx.java ---------------------------------------------------------------------- diff --git a/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetConfigurationEx.java b/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetConfigurationEx.java index eaf0997..11e0476 100644 --- a/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetConfigurationEx.java +++ b/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetConfigurationEx.java @@ -21,7 +21,6 @@ import org.apache.ignite.internal.processors.platform.PlatformConfigurationEx; import org.apache.ignite.internal.processors.platform.callback.PlatformCallbackGateway; import org.apache.ignite.internal.processors.platform.memory.PlatformMemoryManagerImpl; import org.apache.ignite.internal.processors.platform.utils.PlatformUtils; -import org.apache.ignite.platform.dotnet.PlatformDotNetConfiguration; import java.util.Collection; http://git-wip-us.apache.org/repos/asf/ignite/blob/d96e0d24/modules/platform/src/test/dotnet/Apache.Ignite.Core.Tests/Config/Compute/compute-standalone.xml ---------------------------------------------------------------------- diff --git a/modules/platform/src/test/dotnet/Apache.Ignite.Core.Tests/Config/Compute/compute-standalone.xml b/modules/platform/src/test/dotnet/Apache.Ignite.Core.Tests/Config/Compute/compute-standalone.xml index bd34958..617c889 100644 --- a/modules/platform/src/test/dotnet/Apache.Ignite.Core.Tests/Config/Compute/compute-standalone.xml +++ b/modules/platform/src/test/dotnet/Apache.Ignite.Core.Tests/Config/Compute/compute-standalone.xml @@ -54,9 +54,9 @@ - + - + Apache.Ignite.Core.Tests.ExecutableTest+RemoteConfiguration @@ -70,10 +70,10 @@ - + - + http://git-wip-us.apache.org/repos/asf/ignite/blob/d96e0d24/modules/platform/src/test/dotnet/Apache.Ignite.Core.Tests/Config/cache-portables.xml ---------------------------------------------------------------------- diff --git a/modules/platform/src/test/dotnet/Apache.Ignite.Core.Tests/Config/cache-portables.xml b/modules/platform/src/test/dotnet/Apache.Ignite.Core.Tests/Config/cache-portables.xml index 84f9e5a..ea8a4f5 100644 --- a/modules/platform/src/test/dotnet/Apache.Ignite.Core.Tests/Config/cache-portables.xml +++ b/modules/platform/src/test/dotnet/Apache.Ignite.Core.Tests/Config/cache-portables.xml @@ -30,9 +30,9 @@ - + - + Apache.Ignite.Core.Tests.TestGenericPortable[System.Int64] http://git-wip-us.apache.org/repos/asf/ignite/blob/d96e0d24/modules/platform/src/test/dotnet/Apache.Ignite.Core.Tests/Config/cache-query.xml ---------------------------------------------------------------------- diff --git a/modules/platform/src/test/dotnet/Apache.Ignite.Core.Tests/Config/cache-query.xml b/modules/platform/src/test/dotnet/Apache.Ignite.Core.Tests/Config/cache-query.xml index 787a921..ce45725 100644 --- a/modules/platform/src/test/dotnet/Apache.Ignite.Core.Tests/Config/cache-query.xml +++ b/modules/platform/src/test/dotnet/Apache.Ignite.Core.Tests/Config/cache-query.xml @@ -30,9 +30,9 @@ - + - + Apache.Ignite.Core.Tests.Cache.Query.QueryPerson http://git-wip-us.apache.org/repos/asf/ignite/blob/d96e0d24/modules/platform/src/test/dotnet/Apache.Ignite.Core.Tests/Config/native-client-test-cache-affinity.xml ---------------------------------------------------------------------- diff --git a/modules/platform/src/test/dotnet/Apache.Ignite.Core.Tests/Config/native-client-test-cache-affinity.xml b/modules/platform/src/test/dotnet/Apache.Ignite.Core.Tests/Config/native-client-test-cache-affinity.xml index f08018d..f0dd111 100644 --- a/modules/platform/src/test/dotnet/Apache.Ignite.Core.Tests/Config/native-client-test-cache-affinity.xml +++ b/modules/platform/src/test/dotnet/Apache.Ignite.Core.Tests/Config/native-client-test-cache-affinity.xml @@ -27,12 +27,12 @@ - + - + - +