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 E506018A5A for ; Wed, 14 Oct 2015 10:29:26 +0000 (UTC) Received: (qmail 59231 invoked by uid 500); 14 Oct 2015 10:29:26 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 59198 invoked by uid 500); 14 Oct 2015 10:29:26 -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 59189 invoked by uid 99); 14 Oct 2015 10:29:26 -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; Wed, 14 Oct 2015 10:29:26 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id A86C1E0441; Wed, 14 Oct 2015 10:29:26 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: vozerov@apache.org To: commits@ignite.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: ignite git commit: IGNITE-1642: Renamed events. Date: Wed, 14 Oct 2015 10:29:26 +0000 (UTC) Repository: ignite Updated Branches: refs/heads/ignite-1282 7c1ef1ae6 -> 52534c33a IGNITE-1642: Renamed events. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/52534c33 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/52534c33 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/52534c33 Branch: refs/heads/ignite-1282 Commit: 52534c33ab517981abb6356f550155bc8ae23761 Parents: 7c1ef1a Author: Pavel Tupitsyn Authored: Wed Oct 14 13:30:08 2015 +0300 Committer: vozerov-gridgain Committed: Wed Oct 14 13:30:08 2015 +0300 ---------------------------------------------------------------------- .../Apache.Ignite.Core.Tests/EventsTest.cs | 74 ++-- .../Apache.Ignite.Core/Events/EventType.cs | 344 +++++++++---------- .../Events/EventsExample.cs | 4 +- 3 files changed, 206 insertions(+), 216 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/52534c33/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 2c014e2..c271aa6 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/EventsTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/EventsTest.cs @@ -104,19 +104,19 @@ namespace Apache.Ignite.Core.Tests Assert.AreEqual(0, events.GetEnabledEvents().Count); - Assert.IsFalse(EventType.EventsCache.Any(events.IsEnabled)); + Assert.IsFalse(EventType.CacheAll.Any(events.IsEnabled)); - events.EnableLocal(EventType.EventsCache); + events.EnableLocal(EventType.CacheAll); - Assert.AreEqual(EventType.EventsCache, events.GetEnabledEvents()); + Assert.AreEqual(EventType.CacheAll, events.GetEnabledEvents()); - Assert.IsTrue(EventType.EventsCache.All(events.IsEnabled)); + Assert.IsTrue(EventType.CacheAll.All(events.IsEnabled)); - events.EnableLocal(EventType.EventsTaskExecution); + events.EnableLocal(EventType.TaskExecutionAll); - events.DisableLocal(EventType.EventsCache); + events.DisableLocal(EventType.CacheAll); - Assert.AreEqual(EventType.EventsTaskExecution, events.GetEnabledEvents()); + Assert.AreEqual(EventType.TaskExecutionAll, events.GetEnabledEvents()); } /// @@ -127,7 +127,7 @@ namespace Apache.Ignite.Core.Tests { var events = _grid1.GetEvents(); var listener = EventsTestHelper.GetListener(); - var eventType = EventType.EventsTaskExecution; + var eventType = EventType.TaskExecutionAll; events.EnableLocal(eventType); @@ -136,7 +136,7 @@ namespace Apache.Ignite.Core.Tests CheckSend(3); // 3 events per task * 3 grids // Check unsubscription for specific event - events.StopLocalListen(listener, EventType.EventTaskReduced); + events.StopLocalListen(listener, EventType.TaskReduced); CheckSend(2); @@ -146,7 +146,7 @@ namespace Apache.Ignite.Core.Tests CheckNoEvent(); // Check unsubscription by filter - events.LocalListen(listener, EventType.EventTaskReduced); + events.LocalListen(listener, EventType.TaskReduced); CheckSend(); @@ -166,7 +166,7 @@ namespace Apache.Ignite.Core.Tests { var events = _grid1.GetEvents(); var listener = EventsTestHelper.GetListener(); - var eventType = EventType.EventsTaskExecution; + var eventType = EventType.TaskExecutionAll; events.EnableLocal(eventType); @@ -234,7 +234,7 @@ namespace Apache.Ignite.Core.Tests { yield return new EventTestCase { - EventType = EventType.EventsCache, + EventType = EventType.CacheAll, EventObjectType = typeof (CacheEvent), GenerateEvent = g => g.GetCache(null).Put(1, 1), VerifyEvents = (e, g) => VerifyCacheEvents(e, g), @@ -243,7 +243,7 @@ namespace Apache.Ignite.Core.Tests yield return new EventTestCase { - EventType = EventType.EventsTaskExecution, + EventType = EventType.TaskExecutionAll, EventObjectType = typeof (TaskEvent), GenerateEvent = g => GenerateTaskEvent(g), VerifyEvents = (e, g) => VerifyTaskEvents(e), @@ -252,7 +252,7 @@ namespace Apache.Ignite.Core.Tests yield return new EventTestCase { - EventType = EventType.EventsJobExecution, + EventType = EventType.JobExecutionAll, EventObjectType = typeof (JobEvent), GenerateEvent = g => GenerateTaskEvent(g), EventCount = 9 @@ -260,7 +260,7 @@ namespace Apache.Ignite.Core.Tests yield return new EventTestCase { - EventType = new[] {EventType.EventCacheQueryExecuted}, + EventType = new[] {EventType.CacheQueryExecuted}, EventObjectType = typeof (CacheQueryExecutedEvent), GenerateEvent = g => GenerateCacheQueryEvent(g), EventCount = 1 @@ -268,7 +268,7 @@ namespace Apache.Ignite.Core.Tests yield return new EventTestCase { - EventType = new[] { EventType.EventCacheQueryObjectRead }, + EventType = new[] { EventType.CacheQueryObjectRead }, EventObjectType = typeof (CacheQueryReadEvent), GenerateEvent = g => GenerateCacheQueryEvent(g), EventCount = 1 @@ -284,7 +284,7 @@ namespace Apache.Ignite.Core.Tests { var events = _grid1.GetEvents(); - var eventType = EventType.EventsTaskExecution; + var eventType = EventType.TaskExecutionAll; events.EnableLocal(eventType); @@ -311,7 +311,7 @@ namespace Apache.Ignite.Core.Tests if (async) events = events.WithAsync(); - var eventType = EventType.EventsTaskExecution; + var eventType = EventType.TaskExecutionAll; events.EnableLocal(eventType); @@ -340,27 +340,27 @@ namespace Apache.Ignite.Core.Tests waitTask.Wait(timeout); // Event types - waitTask = getWaitTask(() => events.WaitForLocal(EventType.EventTaskReduced)); + waitTask = getWaitTask(() => events.WaitForLocal(EventType.TaskReduced)); Assert.IsTrue(waitTask.Wait(timeout)); Assert.IsInstanceOf(typeof(TaskEvent), waitTask.Result); - Assert.AreEqual(EventType.EventTaskReduced, waitTask.Result.Type); + Assert.AreEqual(EventType.TaskReduced, waitTask.Result.Type); // Filter waitTask = getWaitTask(() => events.WaitForLocal( - new EventFilter((g, e) => e.Type == EventType.EventTaskReduced))); + new EventFilter((g, e) => e.Type == EventType.TaskReduced))); Assert.IsTrue(waitTask.Wait(timeout)); Assert.IsInstanceOf(typeof(TaskEvent), waitTask.Result); - Assert.AreEqual(EventType.EventTaskReduced, waitTask.Result.Type); + Assert.AreEqual(EventType.TaskReduced, waitTask.Result.Type); // Filter & types waitTask = getWaitTask(() => events.WaitForLocal( - new EventFilter((g, e) => e.Type == EventType.EventTaskReduced), EventType.EventTaskReduced)); + new EventFilter((g, e) => e.Type == EventType.TaskReduced), EventType.TaskReduced)); Assert.IsTrue(waitTask.Wait(timeout)); Assert.IsInstanceOf(typeof(TaskEvent), waitTask.Result); - Assert.AreEqual(EventType.EventTaskReduced, waitTask.Result.Type); + Assert.AreEqual(EventType.TaskReduced, waitTask.Result.Type); } /// @@ -374,13 +374,13 @@ namespace Apache.Ignite.Core.Tests { foreach (var g in _grids) { - g.GetEvents().EnableLocal(EventType.EventsJobExecution); - g.GetEvents().EnableLocal(EventType.EventsTaskExecution); + g.GetEvents().EnableLocal(EventType.JobExecutionAll); + g.GetEvents().EnableLocal(EventType.TaskExecutionAll); } var events = _grid1.GetEvents(); - var expectedType = EventType.EventJobStarted; + var expectedType = EventType.JobStarted; var remoteFilter = portable ? (IEventFilter) new RemoteEventPortableFilter(expectedType) @@ -401,7 +401,7 @@ namespace Apache.Ignite.Core.Tests CheckSend(3, typeof(JobEvent), expectedType); - _grid3.GetEvents().DisableLocal(EventType.EventsJobExecution); + _grid3.GetEvents().DisableLocal(EventType.JobExecutionAll); CheckSend(2, typeof(JobEvent), expectedType); @@ -435,11 +435,11 @@ namespace Apache.Ignite.Core.Tests public void TestRemoteQuery([Values(true, false)] bool async) { foreach (var g in _grids) - g.GetEvents().EnableLocal(EventType.EventsJobExecution); + g.GetEvents().EnableLocal(EventType.JobExecutionAll); var events = _grid1.GetEvents(); - var eventFilter = new RemoteEventFilter(EventType.EventJobStarted); + var eventFilter = new RemoteEventFilter(EventType.JobStarted); var oldEvents = events.RemoteQuery(eventFilter); @@ -448,7 +448,7 @@ namespace Apache.Ignite.Core.Tests GenerateTaskEvent(); - var remoteQuery = events.RemoteQuery(eventFilter, EventsTestHelper.Timeout, EventType.EventsJobExecution); + var remoteQuery = events.RemoteQuery(eventFilter, EventsTestHelper.Timeout, EventType.JobExecutionAll); if (async) { @@ -461,7 +461,7 @@ namespace Apache.Ignite.Core.Tests Assert.AreEqual(_grids.Length, qryResult.Count); - Assert.IsTrue(qryResult.All(x => x.Type == EventType.EventJobStarted)); + Assert.IsTrue(qryResult.All(x => x.Type == EventType.JobStarted)); } /// @@ -577,7 +577,7 @@ namespace Apache.Ignite.Core.Tests Assert.AreEqual(locNode, evt.Node); Assert.AreEqual("msg", evt.Message); - Assert.AreEqual(EventType.EventSwapSpaceCleared, evt.Type); + Assert.AreEqual(EventType.SwapSpaceCleared, evt.Type); Assert.IsNotNullOrEmpty(evt.Name); Assert.AreNotEqual(Guid.Empty, evt.Id.GlobalId); Assert.IsTrue((evt.Timestamp - DateTime.Now).TotalSeconds < 10); @@ -596,7 +596,7 @@ namespace Apache.Ignite.Core.Tests GenerateTaskEvent(); EventsTestHelper.VerifyReceive(repeat, eventObjectType ?? typeof (TaskEvent), - eventType.Any() ? eventType : EventType.EventsTaskExecution); + eventType.Any() ? eventType : EventType.TaskExecutionAll); } /// @@ -651,7 +651,7 @@ namespace Apache.Ignite.Core.Tests // started, reduced, finished Assert.AreEqual( - new[] {EventType.EventTaskStarted, EventType.EventTaskReduced, EventType.EventTaskFinished}, + new[] {EventType.TaskStarted, EventType.TaskReduced, EventType.TaskFinished}, e.Select(x => x.Type).ToArray()); } @@ -687,12 +687,12 @@ namespace Apache.Ignite.Core.Tests Assert.AreEqual(false, cacheEvent.HasOldValue); Assert.AreEqual(null, cacheEvent.OldValue); - if (cacheEvent.Type == EventType.EventCacheObjectPut) + if (cacheEvent.Type == EventType.CacheObjectPut) { Assert.AreEqual(true, cacheEvent.HasNewValue); Assert.AreEqual(1, cacheEvent.NewValue); } - else if (cacheEvent.Type == EventType.EventCacheEntryCreated) + else if (cacheEvent.Type == EventType.CacheEntryCreated) { Assert.AreEqual(false, cacheEvent.HasNewValue); Assert.AreEqual(null, cacheEvent.NewValue); http://git-wip-us.apache.org/repos/asf/ignite/blob/52534c33/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 1c56de2..56a1b83 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Events/EventType.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Events/EventType.cs @@ -15,10 +15,12 @@ * limitations under the License. */ +// ReSharper disable ConvertToConstant.Global +// ReSharper disable MemberCanBePrivate.Global +// ReSharper disable UnusedMember.Global namespace Apache.Ignite.Core.Events { using System.Collections.Generic; - using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Reflection; @@ -39,556 +41,544 @@ namespace Apache.Ignite.Core.Events /// /// Built-in event type: checkpoint was saved. /// - public static readonly int EventCheckpointSaved = 1; + public static readonly int CheckpointSaved = 1; /// /// Built-in event type: checkpoint was loaded. /// - public static readonly int EventCheckpointLoaded = 2; + public static readonly int CheckpointLoaded = 2; /// /// Built-in event type: checkpoint was removed. Reasons are: timeout expired, or or it was manually removed, /// or it was automatically removed by the task session. /// - public static readonly int EventCheckpointRemoved = 3; + public static readonly int CheckpointRemoved = 3; /// /// Built-in event type: node joined topology. New node has been discovered and joined grid topology. Note that /// even though a node has been discovered there could be a number of warnings in the log. In certain /// situations Ignite doesn't prevent a node from joining but prints warning messages into the log. /// - public static readonly int EventNodeJoined = 10; + public static readonly int NodeJoined = 10; /// /// Built-in event type: node has normally left topology. /// - public static readonly int EventNodeLeft = 11; + public static readonly int NodeLeft = 11; /// /// Built-in event type: node failed. Ignite detected that node has presumably crashed and is considered /// failed. /// - public static readonly int EventNodeFailed = 12; + public static readonly int NodeFailed = 12; /// /// Built-in event type: node metrics updated. Generated when node's metrics are updated. In most cases this /// callback is invoked with every heartbeat received from a node (including local node). /// - public static readonly int EventNodeMetricsUpdated = 13; + public static readonly int NodeMetricsUpdated = 13; /// /// Built-in event type: local node segmented. Generated when node determines that it runs in invalid network /// segment. /// - public static readonly int EventNodeSegmented = 14; + public static readonly int NodeSegmented = 14; /// /// Built-in event type: client node disconnected. /// - public static readonly int EventClientNodeDisconnected = 16; + public static readonly int ClientNodeDisconnected = 16; /// /// Built-in event type: client node reconnected. /// - public static readonly int EventClientNodeReconnected = 17; + public static readonly int ClientNodeReconnected = 17; /// /// Built-in event type: task started. /// - public static readonly int EventTaskStarted = 20; + public static readonly int TaskStarted = 20; /// /// Built-in event type: task finished. Task got finished. This event is triggered every time a task finished /// without exception. /// - public static readonly int EventTaskFinished = 21; + public static readonly int TaskFinished = 21; /// /// Built-in event type: task failed. Task failed. This event is triggered every time a task finished with an /// exception. Note that prior to this event, there could be other events recorded specific to the failure. /// - public static readonly int EventTaskFailed = 22; + public static readonly int TaskFailed = 22; /// /// Built-in event type: task timed out. /// - public static readonly int EventTaskTimedout = 23; + public static readonly int TaskTimedout = 23; /// /// Built-in event type: task session attribute set. /// - public static readonly int EventTaskSessionAttrSet = 24; + public static readonly int TaskSessionAttrSet = 24; /// /// Built-in event type: task reduced. /// - public static readonly int EventTaskReduced = 25; + public static readonly int TaskReduced = 25; /// /// Built-in event type: Ignite job was mapped in {@link org.apache.ignite.compute.ComputeTask#map(List, Object)} /// method. /// - public static readonly int EventJobMapped = 40; + public static readonly int JobMapped = 40; /// /// Built-in event type: Ignite job result was received by {@link /// org.apache.ignite.compute.ComputeTask#result(org.apache.ignite.compute.ComputeJobResult, List)} method. /// - public static readonly int EventJobResulted = 41; + public static readonly int JobResulted = 41; /// /// Built-in event type: Ignite job failed over. /// - public static readonly int EventJobFailedOver = 43; + public static readonly int JobFailedOver = 43; /// /// Built-in event type: Ignite job started. /// - public static readonly int EventJobStarted = 44; + public static readonly int JobStarted = 44; /// /// Built-in event type: Ignite job finished. Job has successfully completed and produced a result which from the /// user perspective can still be either negative or positive. /// - public static readonly int EventJobFinished = 45; + public static readonly int JobFinished = 45; /// /// Built-in event type: Ignite job timed out. /// - public static readonly int EventJobTimedout = 46; + public static readonly int JobTimedout = 46; /// /// Built-in event type: Ignite job rejected during collision resolution. /// - public static readonly int EventJobRejected = 47; + public static readonly int JobRejected = 47; /// /// Built-in event type: Ignite job failed. Job has failed. This means that there was some error event during job /// execution and job did not produce a result. /// - public static readonly int EventJobFailed = 48; + public static readonly int JobFailed = 48; /// /// Built-in event type: Ignite job queued. Job arrived for execution and has been queued (added to passive queue /// during collision resolution). /// - public static readonly int EventJobQueued = 49; + public static readonly int JobQueued = 49; /// /// Built-in event type: Ignite job cancelled. /// - public static readonly int EventJobCancelled = 50; + public static readonly int JobCancelled = 50; /// /// Built-in event type: entry created. /// - public static readonly int EventCacheEntryCreated = 60; + public static readonly int CacheEntryCreated = 60; /// /// Built-in event type: entry destroyed. /// - public static readonly int EventCacheEntryDestroyed = 61; + public static readonly int CacheEntryDestroyed = 61; /// /// Built-in event type: entry evicted. /// - public static readonly int EventCacheEntryEvicted = 62; + public static readonly int CacheEntryEvicted = 62; /// /// Built-in event type: object put. /// - public static readonly int EventCacheObjectPut = 63; + public static readonly int CacheObjectPut = 63; /// /// Built-in event type: object read. /// - public static readonly int EventCacheObjectRead = 64; + public static readonly int CacheObjectRead = 64; /// /// Built-in event type: object removed. /// - public static readonly int EventCacheObjectRemoved = 65; + public static readonly int CacheObjectRemoved = 65; /// /// Built-in event type: object locked. /// - public static readonly int EventCacheObjectLocked = 66; + public static readonly int CacheObjectLocked = 66; /// /// Built-in event type: object unlocked. /// - public static readonly int EventCacheObjectUnlocked = 67; + public static readonly int CacheObjectUnlocked = 67; /// /// Built-in event type: cache object swapped from swap storage. /// - public static readonly int EventCacheObjectSwapped = 68; + public static readonly int CacheObjectSwapped = 68; /// /// Built-in event type: cache object unswapped from swap storage. /// - public static readonly int EventCacheObjectUnswapped = 69; + public static readonly int CacheObjectUnswapped = 69; /// /// Built-in event type: cache object was expired when reading it. /// - public static readonly int EventCacheObjectExpired = 70; + public static readonly int CacheObjectExpired = 70; /// /// Built-in event type: swap space data read. /// - public static readonly int EventSwapSpaceDataRead = 71; + public static readonly int SwapSpaceDataRead = 71; /// /// Built-in event type: swap space data stored. /// - public static readonly int EventSwapSpaceDataStored = 72; + public static readonly int SwapSpaceDataStored = 72; /// /// Built-in event type: swap space data removed. /// - public static readonly int EventSwapSpaceDataRemoved = 73; + public static readonly int SwapSpaceDataRemoved = 73; /// /// Built-in event type: swap space cleared. /// - public static readonly int EventSwapSpaceCleared = 74; + public static readonly int SwapSpaceCleared = 74; /// /// Built-in event type: swap space data evicted. /// - public static readonly int EventSwapSpaceDataEvicted = 75; + public static readonly int SwapSpaceDataEvicted = 75; /// /// Built-in event type: cache object stored in off-heap storage. /// - public static readonly int EventCacheObjectToOffheap = 76; + public static readonly int CacheObjectToOffheap = 76; /// /// Built-in event type: cache object moved from off-heap storage back into memory. /// - public static readonly int EventCacheObjectFromOffheap = 77; + public static readonly int CacheObjectFromOffheap = 77; /// /// Built-in event type: cache rebalance started. /// - public static readonly int EventCacheRebalanceStarted = 80; + public static readonly int CacheRebalanceStarted = 80; /// /// Built-in event type: cache rebalance stopped. /// - public static readonly int EventCacheRebalanceStopped = 81; + public static readonly int CacheRebalanceStopped = 81; /// /// Built-in event type: cache partition loaded. /// - public static readonly int EventCacheRebalancePartLoaded = 82; + public static readonly int CacheRebalancePartLoaded = 82; /// /// Built-in event type: cache partition unloaded. /// - public static readonly int EventCacheRebalancePartUnloaded = 83; + public static readonly int CacheRebalancePartUnloaded = 83; /// /// Built-in event type: cache entry rebalanced. /// - public static readonly int EventCacheRebalanceObjectLoaded = 84; + public static readonly int CacheRebalanceObjectLoaded = 84; /// /// Built-in event type: cache entry unloaded. /// - public static readonly int EventCacheRebalanceObjectUnloaded = 85; + public static readonly int CacheRebalanceObjectUnloaded = 85; /// /// Built-in event type: all nodes that hold partition left topology. /// - public static readonly int EventCacheRebalancePartDataLost = 86; + public static readonly int CacheRebalancePartDataLost = 86; /// /// Built-in event type: query executed. /// - public static readonly int EventCacheQueryExecuted = 96; + public static readonly int CacheQueryExecuted = 96; /// /// Built-in event type: query entry read. /// - public static readonly int EventCacheQueryObjectRead = 97; + public static readonly int CacheQueryObjectRead = 97; /// /// Built-in event type: cache started. /// - public static readonly int EventCacheStarted = 98; + public static readonly int CacheStarted = 98; /// /// Built-in event type: cache started. /// - public static readonly int EventCacheStopped = 99; + public static readonly int CacheStopped = 99; /// /// Built-in event type: cache nodes left. /// - public static readonly int EventCacheNodesLeft = 100; + public static readonly int CacheNodesLeft = 100; /// /// All events indicating an error or failure condition. It is convenient to use when fetching all events /// indicating error or failure. /// - private static readonly ICollection EventsError0 = new[] + private static readonly ICollection ErrorAll0 = new[] { - EventJobTimedout, - EventJobFailed, - EventJobFailedOver, - EventJobRejected, - EventJobCancelled, - EventTaskTimedout, - EventTaskFailed, - EventCacheRebalanceStarted, - EventCacheRebalanceStopped + JobTimedout, + JobFailed, + JobFailedOver, + JobRejected, + JobCancelled, + TaskTimedout, + TaskFailed, + CacheRebalanceStarted, + CacheRebalanceStopped }.AsReadOnly(); /// - /// All discovery events except for . Subscription to can generate massive amount of event processing in most cases is not + /// All discovery events except for . Subscription to 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 array. + /// cref="DiscoveryAll0" /> array. /// - private static readonly ICollection EventsDiscovery0 = new[] + private static readonly ICollection DiscoveryAllMinusMetrics0 = new[] { - EventNodeJoined, - EventNodeLeft, - EventNodeFailed, - EventNodeSegmented, - EventClientNodeDisconnected, - EventClientNodeReconnected + NodeJoined, + NodeLeft, + NodeFailed, + NodeSegmented, + ClientNodeDisconnected, + ClientNodeReconnected }.AsReadOnly(); /// /// All discovery events. /// - private static readonly ICollection EventsDiscoveryAll0 = new[] + private static readonly ICollection DiscoveryAll0 = new[] { - EventNodeJoined, - EventNodeLeft, - EventNodeFailed, - EventNodeSegmented, - EventNodeMetricsUpdated, - EventClientNodeDisconnected, - EventClientNodeReconnected + NodeJoined, + NodeLeft, + NodeFailed, + NodeSegmented, + NodeMetricsUpdated, + ClientNodeDisconnected, + ClientNodeReconnected }.AsReadOnly(); /// /// All Ignite job execution events. /// - private static readonly ICollection EventsJobExecution0 = new[] + private static readonly ICollection JobExecutionAll0 = new[] { - EventJobMapped, - EventJobResulted, - EventJobFailedOver, - EventJobStarted, - EventJobFinished, - EventJobTimedout, - EventJobRejected, - EventJobFailed, - EventJobQueued, - EventJobCancelled + JobMapped, + JobResulted, + JobFailedOver, + JobStarted, + JobFinished, + JobTimedout, + JobRejected, + JobFailed, + JobQueued, + JobCancelled }.AsReadOnly(); /// /// All Ignite task execution events. /// - private static readonly ICollection EventsTaskExecution0 = new[] + private static readonly ICollection TaskExecutionAll0 = new[] { - EventTaskStarted, - EventTaskFinished, - EventTaskFailed, - EventTaskTimedout, - EventTaskSessionAttrSet, - EventTaskReduced + TaskStarted, + TaskFinished, + TaskFailed, + TaskTimedout, + TaskSessionAttrSet, + TaskReduced }.AsReadOnly(); /// /// All cache events. /// - private static readonly ICollection EventsCache0 = new[] + private static readonly ICollection CacheAll0 = new[] { - EventCacheEntryCreated, - EventCacheEntryDestroyed, - EventCacheObjectPut, - EventCacheObjectRead, - EventCacheObjectRemoved, - EventCacheObjectLocked, - EventCacheObjectUnlocked, - EventCacheObjectSwapped, - EventCacheObjectUnswapped, - EventCacheObjectExpired + CacheEntryCreated, + CacheEntryDestroyed, + CacheObjectPut, + CacheObjectRead, + CacheObjectRemoved, + CacheObjectLocked, + CacheObjectUnlocked, + CacheObjectSwapped, + CacheObjectUnswapped, + CacheObjectExpired }.AsReadOnly(); /// /// All cache rebalance events. /// - private static readonly ICollection EventsCacheRebalance0 = new[] + private static readonly ICollection CacheRebalanceAll0 = new[] { - EventCacheRebalanceStarted, - EventCacheRebalanceStopped, - EventCacheRebalancePartLoaded, - EventCacheRebalancePartUnloaded, - EventCacheRebalanceObjectLoaded, - EventCacheRebalanceObjectUnloaded, - EventCacheRebalancePartDataLost + CacheRebalanceStarted, + CacheRebalanceStopped, + CacheRebalancePartLoaded, + CacheRebalancePartUnloaded, + CacheRebalanceObjectLoaded, + CacheRebalanceObjectUnloaded, + CacheRebalancePartDataLost }.AsReadOnly(); /// /// All cache lifecycle events. /// - private static readonly ICollection EventsCacheLifecycle0 = new[] + private static readonly ICollection CacheLifecycleAll0 = new[] { - EventCacheStarted, - EventCacheStopped, - EventCacheNodesLeft + CacheStarted, + CacheStopped, + CacheNodesLeft }.AsReadOnly(); /// /// All cache query events. /// - private static readonly ICollection EventsCacheQuery0 = new[] + private static readonly ICollection CacheQueryAll0 = new[] { - EventCacheQueryExecuted, - EventCacheQueryObjectRead + CacheQueryExecuted, + CacheQueryObjectRead }.AsReadOnly(); /// /// All swap space events. /// - private static readonly ICollection EventsSwapspace0 = new[] + private static readonly ICollection SwapspaceAll0 = new[] { - EventSwapSpaceCleared, - EventSwapSpaceDataRemoved, - EventSwapSpaceDataRead, - EventSwapSpaceDataStored, - EventSwapSpaceDataEvicted + SwapSpaceCleared, + SwapSpaceDataRemoved, + SwapSpaceDataRead, + SwapSpaceDataStored, + SwapSpaceDataEvicted }.AsReadOnly(); /// /// All Ignite events. /// - private static readonly ICollection EventsAll0 = GetAllEvents().AsReadOnly(); + private static readonly ICollection All0 = GetAllEvents().AsReadOnly(); /// /// All Ignite events (excluding metric update event). /// - private static readonly ICollection EventsAllMinusMetricUpdate0 = - EventsAll0.Where(x => x != EventNodeMetricsUpdated).ToArray().AsReadOnly(); + private static readonly ICollection AllMinusMetricUpdate0 = + All0.Where(x => x != NodeMetricsUpdated).ToArray().AsReadOnly(); /// /// All events indicating an error or failure condition. It is convenient to use when fetching all events /// indicating error or failure. /// - [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] - public static ICollection EventsError + public static ICollection ErrorAll { - get { return EventsError0; } + get { return ErrorAll0; } } /// /// All Ignite events (excluding metric update event). /// - [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] - public static ICollection EventsAllMinusMetricUpdate + public static ICollection AllMinusMetricUpdate { - get { return EventsAllMinusMetricUpdate0; } + get { return AllMinusMetricUpdate0; } } /// /// All swap space events. /// - [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] - public static ICollection EventsSwapspace + public static ICollection SwapspaceAll { - get { return EventsSwapspace0; } + get { return SwapspaceAll0; } } /// /// All cache query events. /// - [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] - public static ICollection EventsCacheQuery + public static ICollection CacheQueryAll { - get { return EventsCacheQuery0; } + get { return CacheQueryAll0; } } /// /// All cache lifecycle events. /// - [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] - public static ICollection EventsCacheLifecycle + public static ICollection CacheLifecycleAll { - get { return EventsCacheLifecycle0; } + get { return CacheLifecycleAll0; } } /// /// All cache rebalance events. /// - [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] - public static ICollection EventsCacheRebalance + public static ICollection CacheRebalanceAll { - get { return EventsCacheRebalance0; } + get { return CacheRebalanceAll0; } } /// /// All cache events. /// - [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] - public static ICollection EventsCache + public static ICollection CacheAll { - get { return EventsCache0; } + get { return CacheAll0; } } /// /// All Ignite task execution events. /// - [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] - public static ICollection EventsTaskExecution + public static ICollection TaskExecutionAll { - get { return EventsTaskExecution0; } + get { return TaskExecutionAll0; } } /// /// All Ignite job execution events. /// - [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] - public static ICollection EventsJobExecution + public static ICollection JobExecutionAll { - get { return EventsJobExecution0; } + get { return JobExecutionAll0; } } /// /// All discovery events. /// - [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] - public static ICollection EventsDiscoveryAll + public static ICollection DiscoveryAll { - get { return EventsDiscoveryAll0; } + get { return DiscoveryAll0; } } /// - /// All discovery events except for . Subscription to can generate massive amount of event processing in most cases is not + /// All discovery events except for . Subscription to 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 array. + /// cref="DiscoveryAll0" /> array. /// - [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] - public static ICollection EventsDiscovery + public static ICollection DiscoveryAllMinusMetrics { - get { return EventsDiscovery0; } + get { return DiscoveryAllMinusMetrics0; } } /// /// All Ignite events. /// - [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] - public static ICollection EventsAll + public static ICollection All { - get { return EventsAll0; } + get { return All0; } } /// http://git-wip-us.apache.org/repos/asf/ignite/blob/52534c33/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Events/EventsExample.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Events/EventsExample.cs b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Events/EventsExample.cs index ed87309..c1f3035 100644 --- a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Events/EventsExample.cs +++ b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Events/EventsExample.cs @@ -63,7 +63,7 @@ namespace Apache.Ignite.Examples.Events Console.WriteLine(">>> Listening for a local event..."); var listener = new LocalListener(); - ignite.GetEvents().LocalListen(listener, EventType.EventsTaskExecution); + ignite.GetEvents().LocalListen(listener, EventType.TaskExecutionAll); ExecuteTask(ignite); @@ -79,7 +79,7 @@ namespace Apache.Ignite.Examples.Events var remoteFilter = new RemoteFilter(); var listenId = ignite.GetEvents().RemoteListen(localListener: localListener, - remoteFilter: remoteFilter, types: EventType.EventsJobExecution); + remoteFilter: remoteFilter, types: EventType.JobExecutionAll); if (listenId == null) throw new InvalidOperationException("Subscription failed.");