IGNITE-1282: Added FxCop warnings suppression.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/b9256a1e Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/b9256a1e Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/b9256a1e Branch: refs/heads/ignite-1282 Commit: b9256a1e7ead475277e8ef2504a736b74ca58ebf Parents: f6111b5 Author: vozerov-gridgain <[email protected]> Authored: Wed Sep 30 10:29:30 2015 +0300 Committer: vozerov-gridgain <[email protected]> Committed: Wed Sep 30 10:29:30 2015 +0300 ---------------------------------------------------------------------- .../Compute/TaskAdapterTest.cs | 8 +- .../Compute/TaskResultTest.cs | 4 +- .../Apache.Ignite.Core.Tests/EventsTest.cs | 2 +- .../Apache.Ignite.Core.csproj | 5 +- .../Cache/Expiry/IExpiryPolicy.cs | 4 + .../dotnet/Apache.Ignite.Core/Cache/ICache.cs | 4 + .../Query/Continuous/IContinuousQueryHandle.cs | 2 + .../Cache/Query/IQueryCursor.cs | 4 + .../Apache.Ignite.Core/Cache/Query/SqlQuery.cs | 33 +-- .../Apache.Ignite.Core/Cache/Query/TextQuery.cs | 42 +-- .../Store/CacheParallelLoadStoreAdapter.cs | 2 + .../Apache.Ignite.Core/Cluster/ICluster.cs | 2 + .../Apache.Ignite.Core/Cluster/IClusterGroup.cs | 8 + .../Cluster/IClusterMetrics.cs | 286 ++++--------------- .../Apache.Ignite.Core/Cluster/IClusterNode.cs | 3 + .../Apache.Ignite.Core/Common/IgniteGuid.cs | 4 +- .../Compute/ComputeJobAdapter.cs | 16 +- .../Apache.Ignite.Core/Compute/IComputeJob.cs | 1 + .../Apache.Ignite.Core/Events/CacheEvent.cs | 4 +- .../Events/CacheQueryExecutedEvent.cs | 6 +- .../Events/CacheQueryReadEvent.cs | 8 +- .../Events/CacheRebalancingEvent.cs | 8 +- .../Events/CheckpointEvent.cs | 3 +- .../Apache.Ignite.Core/Events/DiscoveryEvent.cs | 4 +- .../Apache.Ignite.Core/Events/EventBase.cs | 13 +- .../Apache.Ignite.Core/Events/EventType.cs | 181 +++++++++--- .../dotnet/Apache.Ignite.Core/Events/IEvent.cs | 2 +- .../Apache.Ignite.Core/Events/JobEvent.cs | 8 +- .../Apache.Ignite.Core/Events/SwapSpaceEvent.cs | 3 +- .../Apache.Ignite.Core/Events/TaskEvent.cs | 6 +- .../dotnet/Apache.Ignite.Core/IIgnite.cs | 8 + .../Apache.Ignite.Core/IgniteConfiguration.cs | 3 + .../dotnet/Apache.Ignite.Core/Ignition.cs | 13 +- .../Apache.Ignite.Core/Impl/Cache/CacheEntry.cs | 3 +- .../Cache/CacheEntryProcessorResultHolder.cs | 5 +- .../Impl/Cache/CacheEnumeratorProxy.cs | 3 + .../Continuous/ContinuousQueryHandleImpl.cs | 3 + .../Impl/Cluster/ClusterGroupImpl.cs | 2 +- .../Impl/Cluster/ClusterMetricsImpl.cs | 8 +- .../Impl/Collections/MultiValueDictionary.cs | 2 + .../Impl/Common/CompletedAsyncResult.cs | 11 - .../Common/CopyOnWriteConcurrentDictionary.cs | 2 + .../Impl/Common/DelegateTypeDescriptor.cs | 6 +- .../Apache.Ignite.Core/Impl/Common/Future.cs | 3 +- .../Impl/Common/FutureType.cs | 3 + .../Impl/Common/IgniteArgumentCheck.cs | 13 +- .../Impl/Common/TypeCaster.cs | 7 + .../Impl/Compute/ComputeAsync.cs | 6 +- .../Impl/Datastream/DataStreamerBatch.cs | 1 + .../Impl/Datastream/DataStreamerImpl.cs | 8 + .../Apache.Ignite.Core/Impl/ExceptionUtils.cs | 4 + .../Impl/Handle/HandleRegistry.cs | 5 +- .../dotnet/Apache.Ignite.Core/Impl/Ignite.cs | 5 + .../Apache.Ignite.Core/Impl/IgniteManager.cs | 27 +- .../Apache.Ignite.Core/Impl/IgniteProxy.cs | 3 + .../Apache.Ignite.Core/Impl/IgniteUtils.cs | 16 +- .../Impl/Memory/PlatformMemory.cs | 14 +- .../Impl/Memory/PlatformMemoryManager.cs | 2 +- .../Impl/Memory/PlatformMemoryPool.cs | 10 +- .../Impl/Memory/PlatformMemoryStream.cs | 80 ++++-- .../Impl/Memory/PlatformMemoryUtils.cs | 40 +-- .../Impl/Memory/PlatformPooledMemory.cs | 14 +- .../Impl/Memory/PlatformUnpooledMemory.cs | 6 +- .../Impl/Portable/Io/IPortableStream.cs | 2 + .../Impl/Portable/Io/PortableAbstractStream.cs | 58 ++-- .../Impl/Portable/PortableBuilderImpl.cs | 18 +- .../Impl/Portable/PortableMarshaller.cs | 3 +- .../Impl/Portable/PortableSystemHandlers.cs | 9 +- .../Impl/Portable/PortableUtils.cs | 8 +- .../Impl/Portable/PortablesImpl.cs | 13 - .../Impl/Portable/TypeResolver.cs | 8 +- .../Impl/Services/ServiceProxyInvoker.cs | 17 +- .../Impl/Transactions/Transaction.cs | 3 + .../Impl/Transactions/TransactionImpl.cs | 6 +- .../Impl/Unmanaged/UnmanagedCallbacks.cs | 2 + .../Unmanaged/UnmanagedNonReleaseableTarget.cs | 3 + .../Impl/Unmanaged/UnmanagedUtils.cs | 12 +- .../Portable/IPortableObject.cs | 4 + .../Portable/PortableConfiguration.cs | 3 + .../Apache.Ignite.Core/Services/IServices.cs | 3 + .../Transactions/ITransactions.cs | 3 + modules/platforms/dotnet/Apache.Ignite.FxCop | 117 ++++++++ modules/platforms/dotnet/Apache.Ignite.sln | 6 + parent/pom.xml | 10 +- 84 files changed, 768 insertions(+), 552 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/b9256a1e/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/TaskAdapterTest.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/TaskAdapterTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/TaskAdapterTest.cs index f7fb422..7c4d52e 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/TaskAdapterTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/TaskAdapterTest.cs @@ -223,11 +223,11 @@ namespace Apache.Ignite.Core.Tests.Compute Assert.NotNull(_grid); - int arg1 = Argument<int>(0); + int arg1 = GetArgument<int>(0); Assert.AreEqual(100, arg1); - string arg2 = Argument<string>(1); + string arg2 = GetArgument<string>(1); Assert.AreEqual("str", arg2); @@ -259,11 +259,11 @@ namespace Apache.Ignite.Core.Tests.Compute Assert.NotNull(_grid); - int arg1 = Argument<int>(0); + int arg1 = GetArgument<int>(0); Assert.AreEqual(100, arg1); - string arg2 = Argument<string>(1); + string arg2 = GetArgument<string>(1); Assert.AreEqual("str", arg2); http://git-wip-us.apache.org/repos/asf/ignite/blob/b9256a1e/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/TaskResultTest.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/TaskResultTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/TaskResultTest.cs index e7c5ac9..0073d47 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/TaskResultTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/TaskResultTest.cs @@ -407,7 +407,7 @@ namespace Apache.Ignite.Core.Tests.Compute _gridName = _grid.Name; - T res = Argument<T>(0); + T res = GetArgument<T>(0); return res; } @@ -428,7 +428,7 @@ namespace Apache.Ignite.Core.Tests.Compute _gridName = _grid.Name; - PortableResult res = Argument<PortableResult>(0); + PortableResult res = GetArgument<PortableResult>(0); return res; } http://git-wip-us.apache.org/repos/asf/ignite/blob/b9256a1e/modules/platforms/dotnet/Apache.Ignite.Core.Tests/EventsTest.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/EventsTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/EventsTest.cs index aa103d4..fa2fddc 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/EventsTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/EventsTest.cs @@ -578,7 +578,7 @@ namespace Apache.Ignite.Core.Tests Assert.AreEqual(EventType.EvtSwapSpaceCleared, evt.Type); Assert.IsNotNullOrEmpty(evt.Name); Assert.AreNotEqual(Guid.Empty, evt.Id.GlobalId); - Assert.IsTrue((evt.TimeStamp - DateTime.Now).TotalSeconds < 10); + Assert.IsTrue((evt.Timestamp - DateTime.Now).TotalSeconds < 10); } /// <summary> http://git-wip-us.apache.org/repos/asf/ignite/blob/b9256a1e/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.csproj ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.csproj b/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.csproj index 3f20324..561273a 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.csproj +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.csproj @@ -16,7 +16,7 @@ <PlatformTarget>x64</PlatformTarget> <OutputPath>bin\x64\Debug\</OutputPath> <AllowUnsafeBlocks>true</AllowUnsafeBlocks> - <DefineConstants>DEBUG</DefineConstants> + <DefineConstants>DEBUG;CODE_ANALYSIS</DefineConstants> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'"> <PlatformTarget>x64</PlatformTarget> @@ -27,7 +27,7 @@ <PlatformTarget>x86</PlatformTarget> <OutputPath>bin\x86\Debug\</OutputPath> <AllowUnsafeBlocks>true</AllowUnsafeBlocks> - <DefineConstants>DEBUG</DefineConstants> + <DefineConstants>DEBUG;CODE_ANALYSIS</DefineConstants> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'"> <PlatformTarget>x86</PlatformTarget> @@ -128,6 +128,7 @@ <Compile Include="Events\JobEvent.cs" /> <Compile Include="Events\SwapSpaceEvent.cs" /> <Compile Include="Events\TaskEvent.cs" /> + <Compile Include="GlobalSuppressions.cs" /> <Compile Include="IgniteConfiguration.cs" /> <Compile Include="Ignition.cs" /> <Compile Include="Common\AsyncSupportedAttribute.cs" /> http://git-wip-us.apache.org/repos/asf/ignite/blob/b9256a1e/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Expiry/IExpiryPolicy.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Expiry/IExpiryPolicy.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Expiry/IExpiryPolicy.cs index ff627ae..19f18bf 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Expiry/IExpiryPolicy.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Expiry/IExpiryPolicy.cs @@ -18,6 +18,7 @@ namespace Apache.Ignite.Core.Cache.Expiry { using System; + using System.Diagnostics.CodeAnalysis; /// <summary> /// Defines functions to determine when cache entries will expire based on @@ -34,6 +35,7 @@ namespace Apache.Ignite.Core.Cache.Expiry /// If <c>null</c> is returned, no change to previously understood expiry is performed. /// </summary> /// <returns>Expiry for create opeartion.</returns> + [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", Justification = "Semantics.")] TimeSpan? GetExpiryForCreate(); /// <summary> @@ -44,6 +46,7 @@ namespace Apache.Ignite.Core.Cache.Expiry /// If <c>null</c> is returned, no change to previously understood expiry is performed. /// </summary> /// <returns>Expiry for update operation.</returns> + [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", Justification = "Semantics.")] TimeSpan? GetExpiryForUpdate(); /// <summary> @@ -54,6 +57,7 @@ namespace Apache.Ignite.Core.Cache.Expiry /// If <c>null</c> is returned, no change to previously understood expiry is performed. /// </summary> /// <returns>Expiry for access operation.</returns> + [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", Justification = "Semantics.")] TimeSpan? GetExpiryForAccess(); } } http://git-wip-us.apache.org/repos/asf/ignite/blob/b9256a1e/modules/platforms/dotnet/Apache.Ignite.Core/Cache/ICache.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/ICache.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/ICache.cs index 5116839..097ab66 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/ICache.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/ICache.cs @@ -20,6 +20,7 @@ namespace Apache.Ignite.Core.Cache using System; using System.Collections; using System.Collections.Generic; + using System.Diagnostics.CodeAnalysis; using Apache.Ignite.Core.Cache.Expiry; using Apache.Ignite.Core.Cache.Query; using Apache.Ignite.Core.Cache.Query.Continuous; @@ -51,6 +52,7 @@ namespace Apache.Ignite.Core.Cache /// </summary> /// <typeparam name="TK">Key type.</typeparam> /// <typeparam name="TV">Value type.</typeparam> + [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix")] public interface ICache<TK, TV> : IAsyncSupport<ICache<TK, TV>>, IEnumerable<ICacheEntry<TK, TV>> { /// <summary> @@ -518,6 +520,8 @@ namespace Apache.Ignite.Core.Cache /// Gets snapshot metrics (statistics) for this cache. /// </summary> /// <returns>Cache metrics.</returns> + [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", + Justification = "Expensive operation.")] ICacheMetrics GetMetrics(); /// <summary> http://git-wip-us.apache.org/repos/asf/ignite/blob/b9256a1e/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/Continuous/IContinuousQueryHandle.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/Continuous/IContinuousQueryHandle.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/Continuous/IContinuousQueryHandle.cs index 03f8e05..ca8131b 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/Continuous/IContinuousQueryHandle.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/Continuous/IContinuousQueryHandle.cs @@ -40,6 +40,8 @@ namespace Apache.Ignite.Core.Cache.Query.Continuous /// Can be called only once, throws exception on consequent calls. /// </summary> /// <returns>Initial query cursor.</returns> + [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", + Justification = "Semantics: result differs from call to call.")] IQueryCursor<T> GetInitialQueryCursor(); } } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/b9256a1e/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/IQueryCursor.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/IQueryCursor.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/IQueryCursor.cs index 9745765..ffa0565 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/IQueryCursor.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/IQueryCursor.cs @@ -19,6 +19,7 @@ namespace Apache.Ignite.Core.Cache.Query { using System; using System.Collections.Generic; + using System.Diagnostics.CodeAnalysis; /// <summary> /// Query result cursor. Can be processed either in iterative mode, or by taking @@ -28,6 +29,7 @@ namespace Apache.Ignite.Core.Cache.Query /// cursor lifetime. Any further attempts to get enumerator or all entries will result /// in exception. /// </summary> + [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix")] public interface IQueryCursor<T> : IEnumerable<T>, IDisposable { /// <summary> @@ -35,6 +37,8 @@ namespace Apache.Ignite.Core.Cache.Query /// result is relatively small and will not cause memory utilization issues. /// </summary> /// <returns>List containing all query results.</returns> + [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", + Justification = "Expensive operation.")] IList<T> GetAll(); } } http://git-wip-us.apache.org/repos/asf/ignite/blob/b9256a1e/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/SqlQuery.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/SqlQuery.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/SqlQuery.cs index 303048b..52efc26 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/SqlQuery.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/SqlQuery.cs @@ -30,10 +30,10 @@ namespace Apache.Ignite.Core.Cache.Query /// <summary> /// Constructor. /// </summary> - /// <param name="typ">Type.</param> + /// <param name="queryType">Type.</param> /// <param name="sql">SQL.</param> /// <param name="args">Arguments.</param> - public SqlQuery(Type typ, string sql, params object[] args) : this(typ, sql, false, args) + public SqlQuery(Type queryType, string sql, params object[] args) : this(queryType, sql, false, args) { // No-op. } @@ -41,11 +41,12 @@ namespace Apache.Ignite.Core.Cache.Query /// <summary> /// Constructor. /// </summary> - /// <param name="typ">Type.</param> + /// <param name="queryType">Type.</param> /// <param name="sql">SQL.</param> - /// <param name="loc">Whether query should be executed locally.</param> + /// <param name="local">Whether query should be executed locally.</param> /// <param name="args">Arguments.</param> - public SqlQuery(Type typ, string sql, bool loc, params object[] args) : this(typ.Name, sql, loc, args) + public SqlQuery(Type queryType, string sql, bool local, params object[] args) + : this(queryType.Name, sql, local, args) { // No-op. } @@ -53,10 +54,10 @@ namespace Apache.Ignite.Core.Cache.Query /// <summary> /// Constructor. /// </summary> - /// <param name="typ">Type.</param> + /// <param name="queryType">Type.</param> /// <param name="sql">SQL.</param> /// <param name="args">Arguments.</param> - public SqlQuery(string typ, string sql, params object[] args) : this(typ, sql, false, args) + public SqlQuery(string queryType, string sql, params object[] args) : this(queryType, sql, false, args) { // No-op. } @@ -64,22 +65,22 @@ namespace Apache.Ignite.Core.Cache.Query /// <summary> /// Constructor. /// </summary> - /// <param name="typ">Type.</param> + /// <param name="queryType">Type.</param> /// <param name="sql">SQL.</param> - /// <param name="loc">Whether query should be executed locally.</param> + /// <param name="local">Whether query should be executed locally.</param> /// <param name="args">Arguments.</param> - public SqlQuery(string typ, string sql, bool loc, params object[] args) + public SqlQuery(string queryType, string sql, bool local, params object[] args) { - Type = typ; + QueryType = queryType; Sql = sql; - Local = loc; + Local = local; Arguments = args; } /// <summary> /// Type. /// </summary> - public string Type { get; set; } + public string QueryType { get; set; } /// <summary> /// SQL. @@ -98,13 +99,13 @@ namespace Apache.Ignite.Core.Cache.Query if (string.IsNullOrEmpty(Sql)) throw new ArgumentException("Sql cannot be null or empty"); - if (string.IsNullOrEmpty(Type)) - throw new ArgumentException("Type cannot be null or empty"); + if (string.IsNullOrEmpty(QueryType)) + throw new ArgumentException("QueryType cannot be null or empty"); // 2. Prepare. writer.WriteBoolean(Local); writer.WriteString(Sql); - writer.WriteString(Type); + writer.WriteString(QueryType); writer.WriteInt(PageSize); WriteQueryArgs(writer, Arguments); http://git-wip-us.apache.org/repos/asf/ignite/blob/b9256a1e/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/TextQuery.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/TextQuery.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/TextQuery.cs index 835271b..3f52f6f 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/TextQuery.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/TextQuery.cs @@ -29,9 +29,9 @@ namespace Apache.Ignite.Core.Cache.Query /// <summary> /// Constructor. /// </summary> - /// <param name="typ">Type.</param> - /// <param name="txt">Text.</param> - public TextQuery(Type typ, string txt) : this(typ, txt, false) + /// <param name="queryType">Type.</param> + /// <param name="text">Text.</param> + public TextQuery(Type queryType, string text) : this(queryType, text, false) { // No-op. } @@ -39,10 +39,10 @@ namespace Apache.Ignite.Core.Cache.Query /// <summary> /// Constructor. /// </summary> - /// <param name="typ">Type.</param> - /// <param name="txt">Text.</param> - /// <param name="loc">Whether query should be executed locally.</param> - public TextQuery(Type typ, string txt, bool loc) : this(typ.Name, txt, loc) + /// <param name="queryType">Type.</param> + /// <param name="text">Text.</param> + /// <param name="local">Whether query should be executed locally.</param> + public TextQuery(Type queryType, string text, bool local) : this(queryType.Name, text, local) { // No-op. } @@ -50,9 +50,9 @@ namespace Apache.Ignite.Core.Cache.Query /// <summary> /// Constructor. /// </summary> - /// <param name="typ">Type.</param> - /// <param name="txt">Text.</param> - public TextQuery(string typ, string txt) : this(typ, txt, false) + /// <param name="queryType">Type.</param> + /// <param name="text">Text.</param> + public TextQuery(string queryType, string text) : this(queryType, text, false) { // No-op. } @@ -60,20 +60,20 @@ namespace Apache.Ignite.Core.Cache.Query /// <summary> /// Constructor. /// </summary> - /// <param name="typ">Type.</param> - /// <param name="txt">Text.</param> - /// <param name="loc">Whether query should be executed locally.</param> - public TextQuery(string typ, string txt, bool loc) + /// <param name="queryType">Type.</param> + /// <param name="text">Text.</param> + /// <param name="local">Whether query should be executed locally.</param> + public TextQuery(string queryType, string text, bool local) { - Type = typ; - Text = txt; - Local = loc; + QueryType = queryType; + Text = text; + Local = local; } /// <summary> /// Type. /// </summary> - public string Type { get; set; } + public string QueryType { get; set; } /// <summary> /// Text. @@ -86,12 +86,12 @@ namespace Apache.Ignite.Core.Cache.Query if (string.IsNullOrEmpty(Text)) throw new ArgumentException("Text cannot be null or empty"); - if (string.IsNullOrEmpty(Type)) - throw new ArgumentException("Type cannot be null or empty"); + if (string.IsNullOrEmpty(QueryType)) + throw new ArgumentException("QueryType cannot be null or empty"); writer.WriteBoolean(Local); writer.WriteString(Text); - writer.WriteString(Type); + writer.WriteString(QueryType); writer.WriteInt(PageSize); } http://git-wip-us.apache.org/repos/asf/ignite/blob/b9256a1e/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Store/CacheParallelLoadStoreAdapter.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Store/CacheParallelLoadStoreAdapter.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Store/CacheParallelLoadStoreAdapter.cs index cf4a77d..e80f1a7 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Store/CacheParallelLoadStoreAdapter.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Store/CacheParallelLoadStoreAdapter.cs @@ -20,6 +20,7 @@ namespace Apache.Ignite.Core.Cache.Store using System; using System.Collections; using System.Collections.Generic; + using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Threading.Tasks; @@ -81,6 +82,7 @@ namespace Apache.Ignite.Core.Cache.Store /// <summary> /// Gets the input data sequence to be used in LoadCache. /// </summary> + [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", Justification = "Semantics.")] protected abstract IEnumerable GetInputData(); /// <summary> http://git-wip-us.apache.org/repos/asf/ignite/blob/b9256a1e/modules/platforms/dotnet/Apache.Ignite.Core/Cluster/ICluster.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Cluster/ICluster.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Cluster/ICluster.cs index 02d9a78..353ec34 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Cluster/ICluster.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Cluster/ICluster.cs @@ -19,6 +19,7 @@ namespace Apache.Ignite.Core.Cluster { using System; using System.Collections.Generic; + using System.Diagnostics.CodeAnalysis; using Apache.Ignite.Core.Common; /// <summary> @@ -38,6 +39,7 @@ namespace Apache.Ignite.Core.Cluster /// Gets local Ignite node. /// </summary> /// <returns>Local Ignite node.</returns> + [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", Justification = "Semantics.")] IClusterNode GetLocalNode(); /// <summary> http://git-wip-us.apache.org/repos/asf/ignite/blob/b9256a1e/modules/platforms/dotnet/Apache.Ignite.Core/Cluster/IClusterGroup.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Cluster/IClusterGroup.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Cluster/IClusterGroup.cs index 433ba40..4c2df73 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Cluster/IClusterGroup.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Cluster/IClusterGroup.cs @@ -19,6 +19,7 @@ namespace Apache.Ignite.Core.Cluster { using System; using System.Collections.Generic; + using System.Diagnostics.CodeAnalysis; using Apache.Ignite.Core.Compute; using Apache.Ignite.Core.Events; using Apache.Ignite.Core.Messaging; @@ -64,6 +65,7 @@ namespace Apache.Ignite.Core.Cluster /// this projection. /// </summary> /// <returns>Compute instance over this grid projection.</returns> + [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", Justification = "Semantics.")] ICompute GetCompute(); /// <summary> @@ -181,6 +183,7 @@ namespace Apache.Ignite.Core.Cluster /// Gets read-only collections of nodes in this projection. /// </summary> /// <returns>All nodes in this projection.</returns> + [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", Justification = "Semantics.")] ICollection<IClusterNode> GetNodes(); /// <summary> @@ -195,12 +198,14 @@ namespace Apache.Ignite.Core.Cluster /// Gets first node from the list of nodes in this projection. /// </summary> /// <returns>Node.</returns> + [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", Justification = "Semantics.")] IClusterNode GetNode(); /// <summary> /// Gets a metrics snapshot for this projection /// </summary> /// <returns>Grid projection metrics snapshot.</returns> + [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", Justification = "Semantics.")] IClusterMetrics GetMetrics(); /// <summary> @@ -208,6 +213,7 @@ namespace Apache.Ignite.Core.Cluster /// <see cref="IMessaging"/>> instance will only include nodes from current cluster group. /// </summary> /// <returns>Messaging instance over this cluster group.</returns> + [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", Justification = "Semantics.")] IMessaging GetMessaging(); /// <summary> @@ -215,6 +221,7 @@ namespace Apache.Ignite.Core.Cluster /// <see cref="IEvents"/>> instance will only include nodes from current cluster group. /// </summary> /// <returns>Events instance over this cluster group.</returns> + [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", Justification = "Semantics.")] IEvents GetEvents(); /// <summary> @@ -222,6 +229,7 @@ namespace Apache.Ignite.Core.Cluster /// <see cref="IServices"/>> instance will only include nodes from current cluster group. /// </summary> /// <returns>Services instance over this cluster group.</returns> + [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", Justification = "Semantics.")] IServices GetServices(); } } http://git-wip-us.apache.org/repos/asf/ignite/blob/b9256a1e/modules/platforms/dotnet/Apache.Ignite.Core/Cluster/IClusterMetrics.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Cluster/IClusterMetrics.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Cluster/IClusterMetrics.cs index 4ea690c..d0a51aa 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Cluster/IClusterMetrics.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Cluster/IClusterMetrics.cs @@ -36,259 +36,163 @@ namespace Apache.Ignite.Core.Cluster /// <summary> /// Last update time of this node metrics. /// </summary> - DateTime LastUpdateTime - { - get; - } + DateTime LastUpdateTime { get; } /// <summary> /// Maximum number of jobs that ever ran concurrently on this node. /// </summary> - int MaximumActiveJobs - { - get; - } + int MaximumActiveJobs { get; } /// <summary> /// Number of currently active jobs concurrently executing on the node. /// </summary> - int CurrentActiveJobs - { - get; - } + int CurrentActiveJobs { get; } /// <summary> /// Average number of active jobs. /// </summary> - float AverageActiveJobs - { - get; - } + float AverageActiveJobs { get; } /// <summary> /// Maximum number of waiting jobs. /// </summary> - int MaximumWaitingJobs - { - get; - } - + int MaximumWaitingJobs { get; } + /// <summary> /// Number of queued jobs currently waiting to be executed. /// </summary> - int CurrentWaitingJobs - { - get; - } + int CurrentWaitingJobs { get; } /// <summary> /// Average number of waiting jobs. /// </summary> - float AverageWaitingJobs - { - get; - } + float AverageWaitingJobs { get; } /// <summary> /// Maximum number of jobs rejected at once. /// </summary> - int MaximumRejectedJobs - { - get; - } + int MaximumRejectedJobs { get; } /// <summary> /// Number of jobs rejected after more recent collision resolution operation. /// </summary> - int CurrentRejectedJobs - { - get; - } + int CurrentRejectedJobs { get; } /// <summary> /// Average number of jobs this node rejects during collision resolution operations. /// </summary> - float AverageRejectedJobs - { - get; - } + float AverageRejectedJobs { get; } /// <summary> /// Total number of jobs this node rejects during collision resolution operations since node startup. /// </summary> - int TotalRejectedJobs - { - get; - } + int TotalRejectedJobs { get; } /// <summary> /// Maximum number of cancelled jobs ever had running concurrently. /// </summary> - int MaximumCancelledJobs - { - get; - } + int MaximumCancelledJobs { get; } /// <summary> /// Number of cancelled jobs that are still running. /// </summary> - int CurrentCancelledJobs - { - get; - } + int CurrentCancelledJobs { get; } /// <summary> /// Average number of cancelled jobs. /// </summary> - float AverageCancelledJobs - { - get; - } + float AverageCancelledJobs { get; } /// <summary> /// Total number of cancelled jobs since node startup. /// </summary> - int TotalCancelledJobs - { - get; - } + int TotalCancelledJobs { get; } /// <summary> /// Total number of jobs handled by the node since node startup. /// </summary> - int TotalExecutedJobs - { - get; - } + int TotalExecutedJobs { get; } /// <summary> /// Maximum time a job ever spent waiting in a queue to be executed. /// </summary> - long MaximumJobWaitTime - { - get; - } + long MaximumJobWaitTime { get; } /// <summary> /// Current time an oldest jobs has spent waiting to be executed. /// </summary> - long CurrentJobWaitTime - { - get; - } + long CurrentJobWaitTime { get; } /// <summary> /// Average time jobs spend waiting in the queue to be executed. /// </summary> - double AverageJobWaitTime - { - get; - } + double AverageJobWaitTime { get; } /// <summary> /// Time it took to execute the longest job on the node. /// </summary> - long MaximumJobExecuteTime - { - get; - } + long MaximumJobExecuteTime { get; } /// <summary> /// Longest time a current job has been executing for. /// </summary> - long CurrentJobExecuteTime - { - get; - } + long CurrentJobExecuteTime { get; } /// <summary> /// Average job execution time. /// </summary> - double AverageJobExecuteTime - { - get; - } + double AverageJobExecuteTime { get; } /// <summary> /// Total number of jobs handled by the node. /// </summary> - int TotalExecutedTasks - { - get; - } + int TotalExecutedTasks { get; } /// <summary> /// Total time this node spent executing jobs. /// </summary> - long TotalBusyTime - { - get; - } + long TotalBusyTime { get; } /// <summary> /// Total time this node spent idling. /// </summary> - long TotalIdleTime - { - get; - } + long TotalIdleTime { get; } /// <summary> /// Time this node spend idling since executing last job. /// </summary> - long CurrentIdleTime - { - get; - } + long CurrentIdleTime { get; } /// <summary> /// Percentage of time this node is busy. /// </summary> - float BusyTimePercentage - { - get; - } + float BusyTimePercentage { get; } /// <summary> /// Percentage of time this node is idle /// </summary> - float IdleTimePercentage - { - get; - } + float IdleTimePercentage { get; } /// <summary> /// Returns the number of CPUs available to the Java Virtual Machine. /// </summary> - int TotalCpus - { - get; - } + int TotalCpus { get; } /// <summary> /// Returns the CPU usage usage in [0, 1] range. /// </summary> - double CurrentCpuLoad - { - get; - } + double CurrentCpuLoad { get; } /// <summary> /// Average of CPU load values in [0, 1] range over all metrics kept in the history. /// </summary> - double AverageCpuLoad - { - get; - } + double AverageCpuLoad { get; } /// <summary> /// Average time spent in CG since the last update. /// </summary> - double CurrentGcCpuLoad - { - get; - } - + double CurrentGcCpuLoad { get; } + /// <summary> /// Amount of heap memory in bytes that the JVM /// initially requests from the operating system for memory management. @@ -297,10 +201,7 @@ namespace Apache.Ignite.Core.Cluster /// This value represents a setting of the heap memory for Java VM and is /// not a sum of all initial heap values for all memory pools. /// </summary> - long HeapMemoryInitialized - { - get; - } + long HeapMemoryInitialized { get; } /// <summary> /// Current heap size that is used for object allocation. @@ -311,20 +212,14 @@ namespace Apache.Ignite.Core.Cluster /// occupied by both live objects and garbage objects that have not /// been collected, if any. /// </summary> - long HeapMemoryUsed - { - get; - } + long HeapMemoryUsed { get; } /// <summary> /// Amount of heap memory in bytes that is committed for the JVM to use. This amount of memory is /// guaranteed for the JVM to use. The heap consists of one or more memory pools. This value is /// the sum of committed heap memory values of all heap memory pools. /// </summary> - long HeapMemoryCommitted - { - get; - } + long HeapMemoryCommitted { get; } /// <summary> /// Mmaximum amount of heap memory in bytes that can be used for memory management. @@ -337,10 +232,7 @@ namespace Apache.Ignite.Core.Cluster /// This value represents a setting of the heap memory for Java VM and is /// not a sum of all initial heap values for all memory pools. /// </summary> - long HeapMemoryMaximum - { - get; - } + long HeapMemoryMaximum { get; } /// <summary> /// Total amount of heap memory in bytes. This method returns <code>-1</code> @@ -353,163 +245,103 @@ namespace Apache.Ignite.Core.Cluster /// This value represents a setting of the heap memory for Java VM and is /// not a sum of all initial heap values for all memory pools. /// </summary> - long HeapMemoryTotal - { - get; - } + long HeapMemoryTotal { get; } /// <summary> /// Amount of non-heap memory in bytes that the JVM initially requests from the operating /// system for memory management. /// </summary> - long NonHeapMemoryInitialized - { - get; - } + long NonHeapMemoryInitialized { get; } /// <summary> /// Current non-heap memory size that is used by Java VM. /// </summary> - long NonHeapMemoryUsed - { - get; - } + long NonHeapMemoryUsed { get; } /// <summary> /// Amount of non-heap memory in bytes that is committed for the JVM to use. /// </summary> - long NonHeapMemoryCommitted - { - get; - } - + long NonHeapMemoryCommitted { get; } + /// <summary> /// Maximum amount of non-heap memory in bytes that can be used for memory management. /// </summary> - long NonHeapMemoryMaximum - { - get; - } + long NonHeapMemoryMaximum { get; } /// <summary> /// Total amount of non-heap memory in bytes that can be used for memory management. /// </summary> - long NonHeapMemoryTotal - { - get; - } + long NonHeapMemoryTotal { get; } /// <summary> /// Uptime of the JVM in milliseconds. /// </summary> - long UpTime - { - get; - } + long Uptime { get; } /// <summary> /// Start time of the JVM in milliseconds. /// </summary> - DateTime StartTime - { - get; - } + DateTime StartTime { get; } /// <summary> /// Start time of the Ignite node in milliseconds. /// </summary> - DateTime NodeStartTime - { - get; - } + DateTime NodeStartTime { get; } /// <summary> /// Current number of live threads. /// </summary> - int CurrentThreadCount - { - get; - } + int CurrentThreadCount { get; } /// <summary> /// The peak live thread count. /// </summary> - int MaximumThreadCount - { - get; - } + int MaximumThreadCount { get; } /// <summary> /// The total number of threads started. /// </summary> - long TotalStartedThreadCount - { - get; - } + long TotalStartedThreadCount { get; } /// <summary> /// Current number of live daemon threads. /// </summary> - int CurrentDaemonThreadCount - { - get; - } + int CurrentDaemonThreadCount { get; } /// <summary> /// Ignite assigns incremental versions to all cache operations. This property provides /// the latest data version on the node. /// </summary> - long LastDataVersion - { - get; - } + long LastDataVersion { get; } /// <summary> /// Sent messages count /// </summary> - int SentMessagesCount - { - get; - } + int SentMessagesCount { get; } /// <summary> /// Sent bytes count. /// </summary> - long SentBytesCount - { - get; - } + long SentBytesCount { get; } /// <summary> /// Received messages count. /// </summary> - int ReceivedMessagesCount - { - get; - } + int ReceivedMessagesCount { get; } /// <summary> /// Received bytes count. /// </summary> - long ReceivedBytesCount - { - get; - } + long ReceivedBytesCount { get; } /// <summary> /// Outbound messages queue size. /// </summary> - int OutboundMessagesQueueSize - { - get; - } + int OutboundMessagesQueueSize { get; } /// <summary> /// Gets total number of nodes. /// </summary> - int TotalNodes - { - get; - } + int TotalNodes { get; } } } http://git-wip-us.apache.org/repos/asf/ignite/blob/b9256a1e/modules/platforms/dotnet/Apache.Ignite.Core/Cluster/IClusterNode.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Cluster/IClusterNode.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Cluster/IClusterNode.cs index 11b4c4a..8287821 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Cluster/IClusterNode.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Cluster/IClusterNode.cs @@ -19,6 +19,7 @@ namespace Apache.Ignite.Core.Cluster { using System; using System.Collections.Generic; + using System.Diagnostics.CodeAnalysis; /// <summary> /// Interface representing a single cluster node. Use <see cref="GetAttribute{T}"/> or @@ -64,6 +65,7 @@ namespace Apache.Ignite.Core.Cluster /// Note that attributes cannot be changed at runtime. /// </summary> /// <returns>All node attributes.</returns> + [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", Justification = "Semantics.")] IDictionary<string, object> GetAttributes(); /// <summary> @@ -116,6 +118,7 @@ namespace Apache.Ignite.Core.Cluster /// update will happen every <code>2</code> seconds. /// </summary> /// <returns>Runtime metrics snapshot for this node.</returns> + [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", Justification = "Semantics.")] IClusterMetrics GetMetrics(); } } http://git-wip-us.apache.org/repos/asf/ignite/blob/b9256a1e/modules/platforms/dotnet/Apache.Ignite.Core/Common/IgniteGuid.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Common/IgniteGuid.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Common/IgniteGuid.cs index 53c7151..6c77531 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Common/IgniteGuid.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Common/IgniteGuid.cs @@ -18,6 +18,7 @@ namespace Apache.Ignite.Core.Common { using System; + using System.Globalization; using Apache.Ignite.Core.Portable; /// <summary> @@ -83,7 +84,8 @@ namespace Apache.Ignite.Core.Common /** <inheritDoc /> */ public override string ToString() { - return string.Format("IgniteGuid [GlobalId={0}, LocalId={1}]", GlobalId, LocalId); + return string.Format(CultureInfo.InvariantCulture, + "IgniteGuid [GlobalId={0}, LocalId={1}]", GlobalId, LocalId); } /// <summary> http://git-wip-us.apache.org/repos/asf/ignite/blob/b9256a1e/modules/platforms/dotnet/Apache.Ignite.Core/Compute/ComputeJobAdapter.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Compute/ComputeJobAdapter.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Compute/ComputeJobAdapter.cs index 92c6492..a472b50 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Compute/ComputeJobAdapter.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Compute/ComputeJobAdapter.cs @@ -28,7 +28,7 @@ namespace Apache.Ignite.Core.Compute /// </li> /// <li> /// Ability to set and get job arguments via <see cref="ComputeJobAdapter{T}.SetArguments(object[])"/> - /// and <see cref="ComputeJobAdapter{T}.Argument{T}(int)"/> methods. + /// and <see cref="GetArgument{TArg}"/> methods. /// </li> /// </ul> /// </summary> @@ -40,7 +40,7 @@ namespace Apache.Ignite.Core.Compute private volatile bool _cancelled; /** Arguments. */ - protected object[] Args; + private object[] _args; /// <summary> /// No-arg constructor. @@ -56,7 +56,7 @@ namespace Apache.Ignite.Core.Compute /// <param name="args">Optional job arguments.</param> protected ComputeJobAdapter(params object[] args) { - Args = args; + _args = args; } /// <summary> @@ -78,19 +78,19 @@ namespace Apache.Ignite.Core.Compute /// <param name="args">Optional job arguments to set.</param> public void SetArguments(params object[] args) { - Args = args; + _args = args; } /// <summary> /// Sets given arguments. /// </summary> /// <param name="idx">Index of the argument.</param> - public TArg Argument<TArg>(int idx) + public TArg GetArgument<TArg>(int idx) { - if (idx < 0 || idx >= Args.Length) - throw new ArgumentException("Invalid argument index: " + idx); + if (_args == null || idx < 0 || idx >= _args.Length) + throw new IndexOutOfRangeException("Invalid argument index: " + idx); - return (TArg)Args[idx]; + return (TArg)_args[idx]; } /// <summary> http://git-wip-us.apache.org/repos/asf/ignite/blob/b9256a1e/modules/platforms/dotnet/Apache.Ignite.Core/Compute/IComputeJob.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Compute/IComputeJob.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Compute/IComputeJob.cs index 3b8ac60..a755bac 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Compute/IComputeJob.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Compute/IComputeJob.cs @@ -18,6 +18,7 @@ namespace Apache.Ignite.Core.Compute { using System.Collections.Generic; + using Apache.Ignite.Core.Cluster; using Apache.Ignite.Core.Resource; /// <summary> http://git-wip-us.apache.org/repos/asf/ignite/blob/b9256a1e/modules/platforms/dotnet/Apache.Ignite.Core/Events/CacheEvent.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Events/CacheEvent.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Events/CacheEvent.cs index ff5084b..bd8a41a 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Events/CacheEvent.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Events/CacheEvent.cs @@ -18,6 +18,7 @@ namespace Apache.Ignite.Core.Events { using System; + using System.Globalization; using Apache.Ignite.Core.Cluster; using Apache.Ignite.Core.Common; using Apache.Ignite.Core.Portable; @@ -169,7 +170,8 @@ namespace Apache.Ignite.Core.Events /** <inheritDoc /> */ public override string ToShortString() { - return string.Format("{0}: IsNear={1}, Key={2}, HasNewValue={3}, HasOldValue={4}, NodeId={5}", Name, + return string.Format(CultureInfo.InvariantCulture, + "{0}: IsNear={1}, Key={2}, HasNewValue={3}, HasOldValue={4}, NodeId={5}", Name, _isNear, _key, HasNewValue, HasOldValue, Node.Id); } } http://git-wip-us.apache.org/repos/asf/ignite/blob/b9256a1e/modules/platforms/dotnet/Apache.Ignite.Core/Events/CacheQueryExecutedEvent.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Events/CacheQueryExecutedEvent.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Events/CacheQueryExecutedEvent.cs index 8443c68..5107b84 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Events/CacheQueryExecutedEvent.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Events/CacheQueryExecutedEvent.cs @@ -18,6 +18,7 @@ namespace Apache.Ignite.Core.Events { using System; + using System.Globalization; using Apache.Ignite.Core.Portable; /// <summary> @@ -90,8 +91,9 @@ namespace Apache.Ignite.Core.Events /** <inheritDoc /> */ public override string ToShortString() { - return string.Format("{0}: QueryType={1}, CacheName={2}, ClassName={3}, Clause={4}, SubjectId={5}, " + - "TaskName={6}", Name, QueryType, CacheName, ClassName, Clause, SubjectId, TaskName); + return string.Format(CultureInfo.InvariantCulture, + "{0}: QueryType={1}, CacheName={2}, ClassName={3}, Clause={4}, SubjectId={5}, " + + "TaskName={6}", Name, QueryType, CacheName, ClassName, Clause, SubjectId, TaskName); } } } http://git-wip-us.apache.org/repos/asf/ignite/blob/b9256a1e/modules/platforms/dotnet/Apache.Ignite.Core/Events/CacheQueryReadEvent.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Events/CacheQueryReadEvent.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Events/CacheQueryReadEvent.cs index 7338eab..ea99927 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Events/CacheQueryReadEvent.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Events/CacheQueryReadEvent.cs @@ -18,6 +18,7 @@ namespace Apache.Ignite.Core.Events { using System; + using System.Globalization; using Apache.Ignite.Core.Portable; /// <summary> @@ -126,9 +127,10 @@ namespace Apache.Ignite.Core.Events /** <inheritDoc /> */ public override string ToShortString() { - return string.Format("{0}: QueryType={1}, CacheName={2}, ClassName={3}, Clause={4}, SubjectId={5}, " + - "TaskName={6}, Key={7}, Value={8}, OldValue={9}, Row={10}", Name, QueryType, - CacheName, ClassName, Clause, SubjectId, TaskName, Key, Value, OldValue, Row); + return string.Format(CultureInfo.InvariantCulture, + "{0}: QueryType={1}, CacheName={2}, ClassName={3}, Clause={4}, SubjectId={5}, " + + "TaskName={6}, Key={7}, Value={8}, OldValue={9}, Row={10}", Name, QueryType, + CacheName, ClassName, Clause, SubjectId, TaskName, Key, Value, OldValue, Row); } } } http://git-wip-us.apache.org/repos/asf/ignite/blob/b9256a1e/modules/platforms/dotnet/Apache.Ignite.Core/Events/CacheRebalancingEvent.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Events/CacheRebalancingEvent.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Events/CacheRebalancingEvent.cs index 656550a..620c675 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Events/CacheRebalancingEvent.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Events/CacheRebalancingEvent.cs @@ -17,6 +17,7 @@ namespace Apache.Ignite.Core.Events { + using System.Globalization; using Apache.Ignite.Core.Cluster; using Apache.Ignite.Core.Portable; @@ -90,9 +91,10 @@ namespace Apache.Ignite.Core.Events /** <inheritDoc /> */ public override string ToShortString() { - return string.Format("{0}: CacheName={1}, Partition={2}, DiscoveryNode={3}, DiscoveryEventType={4}, " + - "DiscoveryEventName={5}, DiscoveryTimestamp={6}", Name, CacheName, Partition, - DiscoveryNode, DiscoveryEventType, DiscoveryEventName, DiscoveryTimestamp); + return string.Format(CultureInfo.InvariantCulture, + "{0}: CacheName={1}, Partition={2}, DiscoveryNode={3}, DiscoveryEventType={4}, " + + "DiscoveryEventName={5}, DiscoveryTimestamp={6}", Name, CacheName, Partition, + DiscoveryNode, DiscoveryEventType, DiscoveryEventName, DiscoveryTimestamp); } } } http://git-wip-us.apache.org/repos/asf/ignite/blob/b9256a1e/modules/platforms/dotnet/Apache.Ignite.Core/Events/CheckpointEvent.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Events/CheckpointEvent.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Events/CheckpointEvent.cs index 7b7ea59..298eed8 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Events/CheckpointEvent.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Events/CheckpointEvent.cs @@ -17,6 +17,7 @@ namespace Apache.Ignite.Core.Events { + using System.Globalization; using Apache.Ignite.Core.Portable; /// <summary> @@ -44,7 +45,7 @@ namespace Apache.Ignite.Core.Events /** <inheritDoc /> */ public override string ToShortString() { - return string.Format("{0}: Key={1}", Name, Key); + return string.Format(CultureInfo.InvariantCulture, "{0}: Key={1}", Name, Key); } } } http://git-wip-us.apache.org/repos/asf/ignite/blob/b9256a1e/modules/platforms/dotnet/Apache.Ignite.Core/Events/DiscoveryEvent.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Events/DiscoveryEvent.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Events/DiscoveryEvent.cs index 5b5443c..16b7a6a 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Events/DiscoveryEvent.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Events/DiscoveryEvent.cs @@ -19,6 +19,7 @@ namespace Apache.Ignite.Core.Events { using System.Collections.Generic; using System.Collections.ObjectModel; + using System.Globalization; using Apache.Ignite.Core.Cluster; using Apache.Ignite.Core.Impl; using Apache.Ignite.Core.Portable; @@ -73,7 +74,8 @@ namespace Apache.Ignite.Core.Events /** <inheritDoc /> */ public override string ToShortString() { - return string.Format("{0}: EventNode={1}, TopologyVersion={2}, TopologyNodes={3}", Name, EventNode, + return string.Format(CultureInfo.InvariantCulture, + "{0}: EventNode={1}, TopologyVersion={2}, TopologyNodes={3}", Name, EventNode, TopologyVersion, TopologyNodes.Count); } } http://git-wip-us.apache.org/repos/asf/ignite/blob/b9256a1e/modules/platforms/dotnet/Apache.Ignite.Core/Events/EventBase.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Events/EventBase.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Events/EventBase.cs index 2b905a1..a03c373 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Events/EventBase.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Events/EventBase.cs @@ -18,6 +18,7 @@ namespace Apache.Ignite.Core.Events { using System; + using System.Globalization; using Apache.Ignite.Core.Cluster; using Apache.Ignite.Core.Common; using Apache.Ignite.Core.Impl.Portable; @@ -47,7 +48,7 @@ namespace Apache.Ignite.Core.Events private readonly string _name; /** */ - private readonly DateTime _timeStamp; + private readonly DateTime _timestamp; /// <summary> /// Initializes a new instance of the <see cref="EventBase"/> class. @@ -64,7 +65,7 @@ namespace Apache.Ignite.Core.Events _message = r.ReadString(); _type = r.ReadInt(); _name = r.ReadString(); - _timeStamp = r.ReadDate() ?? DateTime.Now; + _timestamp = r.ReadDate() ?? DateTime.Now; } /** <inheritDoc /> */ @@ -104,9 +105,9 @@ namespace Apache.Ignite.Core.Events } /** <inheritDoc /> */ - public DateTime TimeStamp + public DateTime Timestamp { - get { return _timeStamp; } + get { return _timestamp; } } /** <inheritDoc /> */ @@ -143,8 +144,8 @@ namespace Apache.Ignite.Core.Events /** <inheritDoc /> */ public override string ToString() { - return string.Format("CacheEntry [Name={0}, Type={1}, TimeStamp={2}, Message={3}]", Name, Type, TimeStamp, - Message); + return string.Format(CultureInfo.InvariantCulture, + "CacheEntry [Name={0}, Type={1}, Timestamp={2}, Message={3}]", Name, Type, Timestamp, Message); } /// <summary> http://git-wip-us.apache.org/repos/asf/ignite/blob/b9256a1e/modules/platforms/dotnet/Apache.Ignite.Core/Events/EventType.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Events/EventType.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Events/EventType.cs index 1e649bb..5ac4330 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Events/EventType.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Events/EventType.cs @@ -1,4 +1,4 @@ -/* +/* * 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. @@ -17,6 +17,7 @@ namespace Apache.Ignite.Core.Events { + using System; using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Reflection; @@ -330,9 +331,7 @@ namespace Apache.Ignite.Core.Events /// All events indicating an error or failure condition. It is convenient to use when fetching all events /// indicating error or failure. /// </summary> - [SuppressMessage("Microsoft.Security", "CA2105:ArrayFieldsShouldNotBeReadOnly", - Justification = "Breaking change. Should be fixed in the next non-compatible release.")] - public static readonly int[] EvtsError = + private static readonly int[] EvtsError0 = { EvtJobTimedout, EvtJobFailed, @@ -349,11 +348,9 @@ namespace Apache.Ignite.Core.Events /// All discovery events except for <see cref="EvtNodeMetricsUpdated" />. Subscription to <see /// cref="EvtNodeMetricsUpdated" /> can generate massive amount of event processing in most cases is not /// necessary. If this event is indeed required you can subscribe to it individually or use <see - /// cref="EvtsDiscoveryAll" /> array. + /// cref="EvtsDiscoveryAll0" /> array. /// </summary> - [SuppressMessage("Microsoft.Security", "CA2105:ArrayFieldsShouldNotBeReadOnly", - Justification = "Breaking change. Should be fixed in the next non-compatible release.")] - public static readonly int[] EvtsDiscovery = + private static readonly int[] EvtsDiscovery0 = { EvtNodeJoined, EvtNodeLeft, @@ -366,9 +363,7 @@ namespace Apache.Ignite.Core.Events /// <summary> /// All discovery events. /// </summary> - [SuppressMessage("Microsoft.Security", "CA2105:ArrayFieldsShouldNotBeReadOnly", - Justification = "Breaking change. Should be fixed in the next non-compatible release.")] - public static readonly int[] EvtsDiscoveryAll = + private static readonly int[] EvtsDiscoveryAll0 = { EvtNodeJoined, EvtNodeLeft, @@ -382,9 +377,7 @@ namespace Apache.Ignite.Core.Events /// <summary> /// All Ignite job execution events. /// </summary> - [SuppressMessage("Microsoft.Security", "CA2105:ArrayFieldsShouldNotBeReadOnly", - Justification = "Breaking change. Should be fixed in the next non-compatible release.")] - public static readonly int[] EvtsJobExecution = + private static readonly int[] EvtsJobExecution0 = { EvtJobMapped, EvtJobResulted, @@ -401,9 +394,7 @@ namespace Apache.Ignite.Core.Events /// <summary> /// All Ignite task execution events. /// </summary> - [SuppressMessage("Microsoft.Security", "CA2105:ArrayFieldsShouldNotBeReadOnly", - Justification = "Breaking change. Should be fixed in the next non-compatible release.")] - public static readonly int[] EvtsTaskExecution = + private static readonly int[] EvtsTaskExecution0 = { EvtTaskStarted, EvtTaskFinished, @@ -416,9 +407,7 @@ namespace Apache.Ignite.Core.Events /// <summary> /// All cache events. /// </summary> - [SuppressMessage("Microsoft.Security", "CA2105:ArrayFieldsShouldNotBeReadOnly", - Justification = "Breaking change. Should be fixed in the next non-compatible release.")] - public static readonly int[] EvtsCache = + private static readonly int[] EvtsCache0 = { EvtCacheEntryCreated, EvtCacheEntryDestroyed, @@ -435,9 +424,7 @@ namespace Apache.Ignite.Core.Events /// <summary> /// All cache rebalance events. /// </summary> - [SuppressMessage("Microsoft.Security", "CA2105:ArrayFieldsShouldNotBeReadOnly", - Justification = "Breaking change. Should be fixed in the next non-compatible release.")] - public static readonly int[] EvtsCacheRebalance = + private static readonly int[] EvtsCacheRebalance0 = { EvtCacheRebalanceStarted, EvtCacheRebalanceStopped, @@ -451,9 +438,7 @@ namespace Apache.Ignite.Core.Events /// <summary> /// All cache lifecycle events. /// </summary> - [SuppressMessage("Microsoft.Security", "CA2105:ArrayFieldsShouldNotBeReadOnly", - Justification = "Breaking change. Should be fixed in the next non-compatible release.")] - public static readonly int[] EvtsCacheLifecycle = + private static readonly int[] EvtsCacheLifecycle0 = { EvtCacheStarted, EvtCacheStopped, @@ -463,9 +448,7 @@ namespace Apache.Ignite.Core.Events /// <summary> /// All cache query events. /// </summary> - [SuppressMessage("Microsoft.Security", "CA2105:ArrayFieldsShouldNotBeReadOnly", - Justification = "Breaking change. Should be fixed in the next non-compatible release.")] - public static readonly int[] EvtsCacheQuery = + private static readonly int[] EvtsCacheQuery0 = { EvtCacheQueryExecuted, EvtCacheQueryObjectRead @@ -474,9 +457,7 @@ namespace Apache.Ignite.Core.Events /// <summary> /// All swap space events. /// </summary> - [SuppressMessage("Microsoft.Security", "CA2105:ArrayFieldsShouldNotBeReadOnly", - Justification = "Breaking change. Should be fixed in the next non-compatible release.")] - public static readonly int[] EvtsSwapspace = + private static readonly int[] EvtsSwapspace0 = { EvtSwapSpaceCleared, EvtSwapSpaceDataRemoved, @@ -488,17 +469,125 @@ namespace Apache.Ignite.Core.Events /// <summary> /// All Ignite events. /// </summary> - [SuppressMessage("Microsoft.Security", "CA2105:ArrayFieldsShouldNotBeReadOnly", - Justification = "Breaking change. Should be fixed in the next non-compatible release.")] - public static readonly int[] EvtsAll = GetAllEvents(); + private static readonly int[] EvtsAll0 = GetAllEvents(); /// <summary> /// All Ignite events (<b>excluding</b> metric update event). /// </summary> - [SuppressMessage("Microsoft.Security", "CA2105:ArrayFieldsShouldNotBeReadOnly", - Justification = "Breaking change. Should be fixed in the next non-compatible release.")] - public static readonly int[] EvtsAllMinusMetricUpdate = - EvtsAll.Where(x => x != EvtNodeMetricsUpdated).ToArray(); + private static readonly int[] EvtsAllMinusMetricUpdate0 = + EvtsAll0.Where(x => x != EvtNodeMetricsUpdated).ToArray(); + + /// <summary> + /// All events indicating an error or failure condition. It is convenient to use when fetching all events + /// indicating error or failure. + /// </summary> + [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] + public static int[] EvtsError + { + get { return CloneArray(EvtsError0); } + } + + /// <summary> + /// All Ignite events (<b>excluding</b> metric update event). + /// </summary> + [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] + public static int[] EvtsAllMinusMetricUpdate + { + get { return CloneArray(EvtsAllMinusMetricUpdate0); } + } + + /// <summary> + /// All swap space events. + /// </summary> + [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] + public static int[] EvtsSwapspace + { + get { return CloneArray(EvtsSwapspace0); } + } + + /// <summary> + /// All cache query events. + /// </summary> + [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] + public static int[] EvtsCacheQuery + { + get { return CloneArray(EvtsCacheQuery0); } + } + + /// <summary> + /// All cache lifecycle events. + /// </summary> + [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] + public static int[] EvtsCacheLifecycle + { + get { return CloneArray(EvtsCacheLifecycle0); } + } + + /// <summary> + /// All cache rebalance events. + /// </summary> + [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] + public static int[] EvtsCacheRebalance + { + get { return CloneArray(EvtsCacheRebalance0); } + } + + /// <summary> + /// All cache events. + /// </summary> + [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] + public static int[] EvtsCache + { + get { return CloneArray(EvtsCache0); } + } + + /// <summary> + /// All Ignite task execution events. + /// </summary> + [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] + public static int[] EvtsTaskExecution + { + get { return CloneArray(EvtsTaskExecution0); } + } + + /// <summary> + /// All Ignite job execution events. + /// </summary> + [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] + public static int[] EvtsJobExecution + { + get { return CloneArray(EvtsJobExecution0); } + } + + /// <summary> + /// All discovery events. + /// </summary> + [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] + public static int[] EvtsDiscoveryAll + { + get { return CloneArray(EvtsDiscoveryAll0); } + } + + /// <summary> + /// All discovery events except for <see cref="EvtNodeMetricsUpdated" />. Subscription to <see + /// cref="EvtNodeMetricsUpdated" /> can generate massive amount of event processing in most cases is not + /// necessary. If this event is indeed required you can subscribe to it individually or use <see + /// cref="EvtsDiscoveryAll0" /> array. + /// </summary> + [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] + public static int[] EvtsDiscovery + { + get { return CloneArray(EvtsDiscovery0); } + } + + /// <summary> + /// All Ignite events. + /// </summary> + [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] + public static int[] EvtsAll + { + get { return CloneArray(EvtsAll0); } + } /// <summary> /// Gets all the events. @@ -510,5 +599,19 @@ namespace Apache.Ignite.Core.Events .Where(x => x.FieldType == typeof (int)) .Select(x => (int) x.GetValue(null)).ToArray(); } + + /// <summary> + /// Clones an array to return to the user. + /// </summary> + /// <param name="array">The array.</param> + /// <returns>Shallow copy of the array.</returns> + private static int[] CloneArray(int[] array) + { + var res = new int[array.Length]; + + Array.Copy(array, res, array.Length); + + return res; + } } } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/b9256a1e/modules/platforms/dotnet/Apache.Ignite.Core/Events/IEvent.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Events/IEvent.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Events/IEvent.cs index 181aeef..e94374c 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Events/IEvent.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Events/IEvent.cs @@ -64,7 +64,7 @@ namespace Apache.Ignite.Core.Events /// Note that more than one event can be generated with the same timestamp. /// For ordering purposes use <see cref="LocalOrder"/> instead. /// </summary> - DateTime TimeStamp { get; } + DateTime Timestamp { get; } /// <summary> /// Gets shortened version of ToString result. http://git-wip-us.apache.org/repos/asf/ignite/blob/b9256a1e/modules/platforms/dotnet/Apache.Ignite.Core/Events/JobEvent.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Events/JobEvent.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Events/JobEvent.cs index 81d537f..87090e4 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Events/JobEvent.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Events/JobEvent.cs @@ -18,6 +18,7 @@ namespace Apache.Ignite.Core.Events { using System; + using System.Globalization; using Apache.Ignite.Core.Cluster; using Apache.Ignite.Core.Common; using Apache.Ignite.Core.Portable; @@ -92,9 +93,10 @@ namespace Apache.Ignite.Core.Events /** <inheritDoc /> */ public override string ToShortString() { - return string.Format("{0}: TaskName={1}, TaskClassName={2}, TaskSessionId={3}, JobId={4}, TaskNode={5}, " + - "TaskSubjectId={6}", Name, TaskName, TaskClassName, TaskSessionId, JobId, TaskNode, - TaskSubjectId); + return string.Format(CultureInfo.InvariantCulture, + "{0}: TaskName={1}, TaskClassName={2}, TaskSessionId={3}, JobId={4}, TaskNode={5}, " + + "TaskSubjectId={6}", Name, TaskName, TaskClassName, TaskSessionId, JobId, TaskNode, + TaskSubjectId); } } } http://git-wip-us.apache.org/repos/asf/ignite/blob/b9256a1e/modules/platforms/dotnet/Apache.Ignite.Core/Events/SwapSpaceEvent.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Events/SwapSpaceEvent.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Events/SwapSpaceEvent.cs index 676c2e0..9eb7096 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Events/SwapSpaceEvent.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Events/SwapSpaceEvent.cs @@ -17,6 +17,7 @@ namespace Apache.Ignite.Core.Events { + using System.Globalization; using Apache.Ignite.Core.Portable; /// <summary> @@ -44,7 +45,7 @@ namespace Apache.Ignite.Core.Events /** <inheritDoc /> */ public override string ToShortString() { - return string.Format("{0}: Space={1}", Name, Space); + return string.Format(CultureInfo.InvariantCulture, "{0}: Space={1}", Name, Space); } } } http://git-wip-us.apache.org/repos/asf/ignite/blob/b9256a1e/modules/platforms/dotnet/Apache.Ignite.Core/Events/TaskEvent.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Events/TaskEvent.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Events/TaskEvent.cs index 7149fb3..c17e72b 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Events/TaskEvent.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Events/TaskEvent.cs @@ -18,6 +18,7 @@ namespace Apache.Ignite.Core.Events { using System; + using System.Globalization; using Apache.Ignite.Core.Common; using Apache.Ignite.Core.Portable; @@ -84,8 +85,9 @@ namespace Apache.Ignite.Core.Events /** <inheritDoc /> */ public override string ToShortString() { - return string.Format("{0}: TaskName={1}, TaskClassName={2}, TaskSessionId={3}, Internal={4}, " + - "SubjectId={5}", Name, TaskName, TaskClassName, TaskSessionId, Internal, SubjectId); + return string.Format(CultureInfo.InvariantCulture, + "{0}: TaskName={1}, TaskClassName={2}, TaskSessionId={3}, Internal={4}, " + + "SubjectId={5}", Name, TaskName, TaskClassName, TaskSessionId, Internal, SubjectId); } } } http://git-wip-us.apache.org/repos/asf/ignite/blob/b9256a1e/modules/platforms/dotnet/Apache.Ignite.Core/IIgnite.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/IIgnite.cs b/modules/platforms/dotnet/Apache.Ignite.Core/IIgnite.cs index a9fae89..851f231 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/IIgnite.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/IIgnite.cs @@ -18,6 +18,7 @@ namespace Apache.Ignite.Core { using System; + using System.Diagnostics.CodeAnalysis; using Apache.Ignite.Core.Cache; using Apache.Ignite.Core.Cluster; using Apache.Ignite.Core.Compute; @@ -54,6 +55,7 @@ namespace Apache.Ignite.Core /// <summary> /// Gets an instance of <see cref="ICluster" /> interface. /// </summary> + [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", Justification = "Semantics.")] ICluster GetCluster(); /// <summary> @@ -62,6 +64,7 @@ namespace Apache.Ignite.Core /// this projection. /// </summary> /// <returns>Compute instance over this grid projection.</returns> + [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", Justification = "Semantics.")] ICompute GetCompute(); /// <summary> @@ -109,6 +112,7 @@ namespace Apache.Ignite.Core /// Gets an instance of <see cref="IPortables"/> interface. /// </summary> /// <returns>Instance of <see cref="IPortables"/> interface</returns> + [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", Justification = "Semantics.")] IPortables GetPortables(); /// <summary> @@ -121,24 +125,28 @@ namespace Apache.Ignite.Core /// <summary> /// Gets Ignite transactions facade. /// </summary> + [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", Justification = "Semantics.")] ITransactions GetTransactions(); /// <summary> /// Gets messaging facade over all cluster nodes. /// </summary> /// <returns>Messaging instance over all cluster nodes.</returns> + [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", Justification = "Semantics.")] IMessaging GetMessaging(); /// <summary> /// Gets events facade over all cluster nodes. /// </summary> /// <returns>Events facade over all cluster nodes.</returns> + [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", Justification = "Semantics.")] IEvents GetEvents(); /// <summary> /// Gets services facade over all cluster nodes. /// </summary> /// <returns>Services facade over all cluster nodes.</returns> + [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", Justification = "Semantics.")] IServices GetServices(); } } http://git-wip-us.apache.org/repos/asf/ignite/blob/b9256a1e/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfiguration.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfiguration.cs b/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfiguration.cs index 5a03e93..c921ef7 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfiguration.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfiguration.cs @@ -106,6 +106,7 @@ namespace Apache.Ignite.Core /// <summary> /// Collection of options passed to JVM on Ignite start. /// </summary> + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public ICollection<string> JvmOptions { get; set; } /// <summary> @@ -113,6 +114,7 @@ namespace Apache.Ignite.Core /// fully qualified assembly name, path to assembly to DLL or path to a directory when /// assemblies reside. /// </summary> + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public IList<string> Assemblies { get; set; } /// <summary> @@ -123,6 +125,7 @@ namespace Apache.Ignite.Core /// <summary> /// Lifecycle beans. /// </summary> + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public ICollection<ILifecycleBean> LifecycleBeans { get; set; } /// <summary> http://git-wip-us.apache.org/repos/asf/ignite/blob/b9256a1e/modules/platforms/dotnet/Apache.Ignite.Core/Ignition.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Ignition.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Ignition.cs index 96d002f..a34c4e5 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Ignition.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Ignition.cs @@ -21,6 +21,7 @@ namespace Apache.Ignite.Core { using System; using System.Collections.Generic; + using System.Diagnostics.CodeAnalysis; using System.IO; using System.Linq; using System.Reflection; @@ -98,6 +99,7 @@ namespace Apache.Ignite.Core /// <summary> /// Static initializer. /// </summary> + [SuppressMessage("Microsoft.Performance", "CA1810:InitializeReferenceTypeStaticFieldsInline")] static Ignition() { AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve; @@ -165,7 +167,7 @@ namespace Apache.Ignite.Core var cbs = new UnmanagedCallbacks(); - void* ctx = IgniteManager.GetContext(cfg, cbs); + IgniteManager.CreateJvmContext(cfg, cbs); sbyte* cfgPath0 = IgniteUtils.StringToUtf8Unmanaged(cfg.SpringConfigUrl ?? DefaultCfg); @@ -173,7 +175,7 @@ namespace Apache.Ignite.Core sbyte* gridName0 = IgniteUtils.StringToUtf8Unmanaged(gridName); // 3. Create startup object which will guide us through the rest of the process. - _startup = new Startup(cfg, cbs) { Context = ctx }; + _startup = new Startup(cfg, cbs); IUnmanagedTarget interopProc = null; @@ -606,7 +608,7 @@ namespace Apache.Ignite.Core /// <summary> /// Value object to pass data between .Net methods during startup bypassing Java. /// </summary> - private unsafe class Startup + private class Startup { /// <summary> /// Constructor. @@ -649,11 +651,6 @@ namespace Apache.Ignite.Core internal Exception Error { get; set; } /// <summary> - /// Gets or sets the context. - /// </summary> - internal void* Context { get; set; } - - /// <summary> /// Gets or sets the ignite. /// </summary> internal Ignite Ignite { get; set; } http://git-wip-us.apache.org/repos/asf/ignite/blob/b9256a1e/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheEntry.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheEntry.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheEntry.cs index e28b3e2..5537489 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheEntry.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheEntry.cs @@ -18,6 +18,7 @@ namespace Apache.Ignite.Core.Impl.Cache { using System.Collections.Generic; + using System.Globalization; using Apache.Ignite.Core.Cache; /// <summary> @@ -94,7 +95,7 @@ namespace Apache.Ignite.Core.Impl.Cache /** <inheritDoc /> */ public override string ToString() { - return string.Format("CacheEntry [Key={0}, Value={1}]", _key, _val); + return string.Format(CultureInfo.CurrentCulture, "CacheEntry [Key={0}, Value={1}]", _key, _val); } /// <summary> http://git-wip-us.apache.org/repos/asf/ignite/blob/b9256a1e/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheEntryProcessorResultHolder.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheEntryProcessorResultHolder.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheEntryProcessorResultHolder.cs index 04cd557..02928e9 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheEntryProcessorResultHolder.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheEntryProcessorResultHolder.cs @@ -19,6 +19,7 @@ namespace Apache.Ignite.Core.Impl.Cache { using System; using System.Diagnostics.CodeAnalysis; + using System.Globalization; using System.IO; using Apache.Ignite.Core.Impl.Common; using Apache.Ignite.Core.Impl.Portable; @@ -111,13 +112,13 @@ namespace Apache.Ignite.Core.Impl.Cache if (Error == null) { - writer.WriteString(string.Format( + writer.WriteString(string.Format(CultureInfo.InvariantCulture, "CacheEntryProcessor completed with error, but result serialization failed [errType={0}, " + "err={1}, serializationErrMsg={2}]", marshErr.GetType().Name, marshErr, marshErr.Message)); } else { - writer.WriteString(string.Format( + writer.WriteString(string.Format(CultureInfo.InvariantCulture, "CacheEntryProcessor completed with error, and error serialization failed [errType={0}, " + "err={1}, serializationErrMsg={2}]", marshErr.GetType().Name, marshErr, marshErr.Message)); }
