From a0b9af0a76cb0df5df47e6dcf963eeccb609ef38 Mon Sep 17 00:00:00 2001 From: Nikolay Date: Tue, 19 Dec 2023 15:14:13 +0300 Subject: [PATCH] IGNITE-14823 Event abbrevation (#11110) --- .../src/main/resources/abbrevations.csv | 3 +- .../EventListenerDemultiplexer.java | 12 ++--- .../affinity/GridAffinityAssignmentCache.java | 6 +-- .../platform/events/PlatformEvents.java | 8 ++-- .../service/ServiceDeploymentTask.java | 8 ++-- .../IgniteClientRequestEventListenerTest.java | 46 +++++++++--------- .../cluster/IgniteClusterIdTagTest.java | 48 +++++++++---------- .../IgniteCacheEntryListenerAbstractTest.java | 6 +-- .../IgniteCacheManyClientsTest.java | 6 +-- .../GridCacheRebalancingOrderingTest.java | 6 +-- ...ntinuousQueryFailoverAbstractSelfTest.java | 4 +- ...emoteFilterMissingInClassPathSelfTest.java | 6 +-- ...acheContinuousQueryImmutableEntryTest.java | 16 +++---- .../cluster/ClusterStateChangeEventTest.java | 18 +++---- .../ContinuousQueryBuffersCleanupTest.java | 4 +- ...ridServiceContinuousQueryRedeployTest.java | 4 +- .../P2PClassLoadingFailureHandlingTest.java | 4 +- .../PlatformEventsWriteEventTask.java | 24 +++++----- ...tionInverseConnectionEstablishingTest.java | 6 +-- ...cationSpiInverseConnectionLoggingTest.java | 6 +-- ...cpCommunicationSpiNodeLeftLoggingTest.java | 12 ++--- .../discovery/tcp/TcpDiscoverySelfTest.java | 6 +-- .../testframework/MemorizingAppenderTest.java | 10 ++-- .../ZookeeperDiscoverySpiTestHelper.java | 4 +- 24 files changed, 137 insertions(+), 136 deletions(-) diff --git a/modules/checkstyle/src/main/resources/abbrevations.csv b/modules/checkstyle/src/main/resources/abbrevations.csv index aa051de5cb411..674da91fd6c27 100644 --- a/modules/checkstyle/src/main/resources/abbrevations.csv +++ b/modules/checkstyle/src/main/resources/abbrevations.csv @@ -20,7 +20,8 @@ database,db default,dflt destination,dest directory,dir -#event,evt +event,evt +events,evts #exception,e,e2,ex #execute,exec #frequency,freq diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/monitoring/EventListenerDemultiplexer.java b/modules/core/src/main/java/org/apache/ignite/internal/client/monitoring/EventListenerDemultiplexer.java index af9f3c0b7e3fc..31d1eaa6eb91b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/monitoring/EventListenerDemultiplexer.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/monitoring/EventListenerDemultiplexer.java @@ -89,20 +89,20 @@ public static EventListenerDemultiplexer create(ClientConfiguration cfg) { if (F.isEmpty(cfg.getEventListeners())) return NO_OP; - List qryEventListeners = new ArrayList<>(); - List connEventListeners = new ArrayList<>(); + List qryEvtListeners = new ArrayList<>(); + List connEvtListeners = new ArrayList<>(); for (EventListener l: cfg.getEventListeners()) { if (l instanceof RequestEventListener) - qryEventListeners.add((RequestEventListener)l); + qryEvtListeners.add((RequestEventListener)l); else if (l instanceof ConnectionEventListener) - connEventListeners.add((ConnectionEventListener)l); + connEvtListeners.add((ConnectionEventListener)l); } - if (F.isEmpty(qryEventListeners) && F.isEmpty(connEventListeners)) + if (F.isEmpty(qryEvtListeners) && F.isEmpty(connEvtListeners)) return NO_OP; - return new EventListenerDemultiplexer(qryEventListeners, connEventListeners, NullLogger.whenNull(cfg.getLogger())); + return new EventListenerDemultiplexer(qryEvtListeners, connEvtListeners, NullLogger.whenNull(cfg.getLogger())); } /** diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java index 07f87c98b014f..b4956adc0e814 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java @@ -366,10 +366,10 @@ public IdealAffinityAssignment calculate( don't belong to affinity for current group (client node or filtered by nodeFilter). */ boolean skipCalculation = true; - for (DiscoveryEvent event : events.events()) { - boolean affNode = CU.affinityNode(event.eventNode(), nodeFilter); + for (DiscoveryEvent evt : events.events()) { + boolean affNode = CU.affinityNode(evt.eventNode(), nodeFilter); - if (affNode || event.type() == EVT_DISCOVERY_CUSTOM_EVT) { + if (affNode || evt.type() == EVT_DISCOVERY_CUSTOM_EVT) { skipCalculation = false; break; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/events/PlatformEvents.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/events/PlatformEvents.java index 5c463bf62bc74..4c72fb4ceeebf 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/events/PlatformEvents.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/events/PlatformEvents.java @@ -251,9 +251,9 @@ private EventAdapter startWaitForLocal(BinaryRawReaderEx reader, IgniteEvents ev IgnitePredicate filter = filterHnd != null ? localFilter(filterHnd) : null; - int[] eventTypes = readEventTypes(reader); + int[] evtTypes = readEventTypes(reader); - return (EventAdapter)events.waitForLocal(filter, eventTypes); + return (EventAdapter)events.waitForLocal(filter, evtTypes); } /** @@ -268,9 +268,9 @@ private IgniteFuture startWaitForLocalAsync(BinaryRawReaderEx read IgnitePredicate filter = filterHnd != null ? localFilter(filterHnd) : null; - int[] eventTypes = readEventTypes(reader); + int[] evtTypes = readEventTypes(reader); - return events.waitForLocalAsync(filter, eventTypes); + return events.waitForLocalAsync(filter, evtTypes); } /** diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/service/ServiceDeploymentTask.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/service/ServiceDeploymentTask.java index d644f90c28199..fa8ff33d6a505 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/service/ServiceDeploymentTask.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/service/ServiceDeploymentTask.java @@ -213,21 +213,21 @@ protected void init() throws IgniteCheckedException { else { assert evtType == EVT_NODE_JOINED || evtType == EVT_NODE_LEFT || evtType == EVT_NODE_FAILED; - final ClusterNode eventNode = evt.eventNode(); + final ClusterNode evtNode = evt.eventNode(); final Map deployedServices = srvcProc.deployedServices(); if (evtType == EVT_NODE_LEFT || evtType == EVT_NODE_FAILED) { deployedServices.forEach((srvcId, desc) -> { - if (desc.topologySnapshot().containsKey(eventNode.id()) || - (desc.cacheName() != null && !eventNode.isClient())) // If affinity service + if (desc.topologySnapshot().containsKey(evtNode.id()) || + (desc.cacheName() != null && !evtNode.isClient())) // If affinity service toDeploy.put(srvcId, desc); }); } else { toDeploy.putAll(deployedServices); - toDeploy.putAll(srvcProc.servicesReceivedFromJoin(eventNode.id())); + toDeploy.putAll(srvcProc.servicesReceivedFromJoin(evtNode.id())); } } diff --git a/modules/core/src/test/java/org/apache/ignite/internal/client/thin/events/IgniteClientRequestEventListenerTest.java b/modules/core/src/test/java/org/apache/ignite/internal/client/thin/events/IgniteClientRequestEventListenerTest.java index be5b2f26da493..64d4d5d82d4e4 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/client/thin/events/IgniteClientRequestEventListenerTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/client/thin/events/IgniteClientRequestEventListenerTest.java @@ -91,30 +91,30 @@ public void testQuerySuccessEvents() { assertEquals(2, evSet.size()); - RequestStartEvent startEvent = (RequestStartEvent)evSet.get(RequestStartEvent.class); + RequestStartEvent startEvt = (RequestStartEvent)evSet.get(RequestStartEvent.class); - assertTrue(startEvent.requestId() >= 0); + assertTrue(startEvt.requestId() >= 0); - ConnectionDescription connDesc = startEvent.connectionDescription(); + ConnectionDescription connDesc = startEvt.connectionDescription(); assertEquals(clientHost(grid(0).localNode()), connDesc.remoteAddress().getAddress().getHostAddress()); assertEquals(clientPort(grid(0).localNode()), connDesc.remoteAddress().getPort()); assertEquals(clientHost(grid(0).localNode()), connDesc.localAddress().getAddress().getHostAddress()); assertEquals(grid(0).localNode().id(), connDesc.serverNodeId()); - assertEquals(ClientOperation.CACHE_GET_NAMES.code(), startEvent.operationCode()); - assertEquals(ClientOperation.CACHE_GET_NAMES.name(), startEvent.operationName()); + assertEquals(ClientOperation.CACHE_GET_NAMES.code(), startEvt.operationCode()); + assertEquals(ClientOperation.CACHE_GET_NAMES.name(), startEvt.operationName()); - RequestSuccessEvent successEvent = (RequestSuccessEvent)evSet.get(RequestSuccessEvent.class); - assertEquals(successEvent.requestId(), successEvent.requestId()); + RequestSuccessEvent successEvt = (RequestSuccessEvent)evSet.get(RequestSuccessEvent.class); + assertEquals(successEvt.requestId(), successEvt.requestId()); - connDesc = startEvent.connectionDescription(); + connDesc = startEvt.connectionDescription(); assertEquals(clientHost(grid(0).localNode()), connDesc.remoteAddress().getAddress().getHostAddress()); assertEquals(clientPort(grid(0).localNode()), connDesc.remoteAddress().getPort()); assertEquals(clientHost(grid(0).localNode()), connDesc.localAddress().getAddress().getHostAddress()); assertEquals(grid(0).localNode().id(), connDesc.serverNodeId()); - assertEquals(ClientOperation.CACHE_GET_NAMES.code(), startEvent.operationCode()); - assertEquals(ClientOperation.CACHE_GET_NAMES.name(), startEvent.operationName()); + assertEquals(ClientOperation.CACHE_GET_NAMES.code(), startEvt.operationCode()); + assertEquals(ClientOperation.CACHE_GET_NAMES.name(), startEvt.operationName()); - assertTrue(System.nanoTime() - startTime >= successEvent.elapsedTime(TimeUnit.NANOSECONDS)); + assertTrue(System.nanoTime() - startTime >= successEvt.elapsedTime(TimeUnit.NANOSECONDS)); } } @@ -131,32 +131,32 @@ public void testQueryFailEvents() { catch (ClientException err) { assertEquals(2, evSet.size()); - RequestStartEvent startEvent = (RequestStartEvent)evSet.get(RequestStartEvent.class); + RequestStartEvent startEvt = (RequestStartEvent)evSet.get(RequestStartEvent.class); - assertTrue(startEvent.requestId() >= 0); + assertTrue(startEvt.requestId() >= 0); - ConnectionDescription connDesc = startEvent.connectionDescription(); + ConnectionDescription connDesc = startEvt.connectionDescription(); assertEquals(clientHost(grid(0).localNode()), connDesc.remoteAddress().getAddress().getHostAddress()); assertEquals(clientPort(grid(0).localNode()), connDesc.remoteAddress().getPort()); assertEquals(clientHost(grid(0).localNode()), connDesc.localAddress().getAddress().getHostAddress()); assertEquals(grid(0).localNode().id(), connDesc.serverNodeId()); - assertEquals(ClientOperation.CACHE_PUT.code(), startEvent.operationCode()); - assertEquals(ClientOperation.CACHE_PUT.name(), startEvent.operationName()); + assertEquals(ClientOperation.CACHE_PUT.code(), startEvt.operationCode()); + assertEquals(ClientOperation.CACHE_PUT.name(), startEvt.operationName()); - RequestFailEvent failEvent = (RequestFailEvent)evSet.get(RequestFailEvent.class); - assertEquals(failEvent.requestId(), failEvent.requestId()); + RequestFailEvent failEvt = (RequestFailEvent)evSet.get(RequestFailEvent.class); + assertEquals(failEvt.requestId(), failEvt.requestId()); - connDesc = startEvent.connectionDescription(); + connDesc = startEvt.connectionDescription(); assertEquals(clientHost(grid(0).localNode()), connDesc.remoteAddress().getAddress().getHostAddress()); assertEquals(clientPort(grid(0).localNode()), connDesc.remoteAddress().getPort()); assertEquals(clientHost(grid(0).localNode()), connDesc.localAddress().getAddress().getHostAddress()); assertEquals(grid(0).localNode().id(), connDesc.serverNodeId()); - assertEquals(ClientOperation.CACHE_PUT.code(), startEvent.operationCode()); - assertEquals(ClientOperation.CACHE_PUT.name(), startEvent.operationName()); + assertEquals(ClientOperation.CACHE_PUT.code(), startEvt.operationCode()); + assertEquals(ClientOperation.CACHE_PUT.name(), startEvt.operationName()); - assertEquals(err, failEvent.throwable()); + assertEquals(err, failEvt.throwable()); - assertTrue(System.nanoTime() - startTime >= failEvent.elapsedTime(TimeUnit.NANOSECONDS)); + assertTrue(System.nanoTime() - startTime >= failEvt.elapsedTime(TimeUnit.NANOSECONDS)); } } } diff --git a/modules/core/src/test/java/org/apache/ignite/internal/cluster/IgniteClusterIdTagTest.java b/modules/core/src/test/java/org/apache/ignite/internal/cluster/IgniteClusterIdTagTest.java index 11ebde86312e3..e52ec9a0f67b7 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/cluster/IgniteClusterIdTagTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/cluster/IgniteClusterIdTagTest.java @@ -139,10 +139,10 @@ public void testInMemoryClusterIdWithClientReconnect() throws Exception { IgniteEx client0 = startGrid("client0"); - AtomicBoolean reconnectEvent = new AtomicBoolean(false); + AtomicBoolean reconnectEvt = new AtomicBoolean(false); client0.events().localListen((e) -> { - reconnectEvent.set(true); + reconnectEvt.set(true); return true; }, EventType.EVT_CLIENT_NODE_RECONNECTED); @@ -157,7 +157,7 @@ public void testInMemoryClusterIdWithClientReconnect() throws Exception { assertNotSame(oldId, cluster0.id()); assertNotSame(oldTag, cluster0.tag()); - assertTrue(GridTestUtils.waitForCondition(reconnectEvent::get, 10_000)); + assertTrue(GridTestUtils.waitForCondition(reconnectEvt::get, 10_000)); assertEquals("OldID " + oldId, cluster0.id(), client0.cluster().id()); assertEquals(cluster0.tag(), client0.cluster().tag()); @@ -348,9 +348,9 @@ public void testTagChangedEvent() throws Exception { UUID clusterId = ig.cluster().id(); String generatedTag = ig.cluster().tag(); - AtomicReference clusterIdFromEvent = new AtomicReference<>(null); - AtomicReference oldTagFromEvent = new AtomicReference<>(null); - AtomicReference newTagFromEvent = new AtomicReference<>(null); + AtomicReference clusterIdFromEvt = new AtomicReference<>(null); + AtomicReference oldTagFromEvt = new AtomicReference<>(null); + AtomicReference newTagFromEvt = new AtomicReference<>(null); AtomicBoolean evtFired = new AtomicBoolean(false); @@ -359,9 +359,9 @@ public void testTagChangedEvent() throws Exception { ClusterTagUpdatedEvent tagUpdatedEvt = (ClusterTagUpdatedEvent)evt; - clusterIdFromEvent.set(tagUpdatedEvt.clusterId()); - oldTagFromEvent.set(tagUpdatedEvt.previousTag()); - newTagFromEvent.set(tagUpdatedEvt.newTag()); + clusterIdFromEvt.set(tagUpdatedEvt.clusterId()); + oldTagFromEvt.set(tagUpdatedEvt.previousTag()); + newTagFromEvt.set(tagUpdatedEvt.newTag()); return true; }, EventType.EVT_CLUSTER_TAG_UPDATED); @@ -370,9 +370,9 @@ public void testTagChangedEvent() throws Exception { assertTrue(GridTestUtils.waitForCondition(evtFired::get, 10_000)); - assertEquals(clusterId, clusterIdFromEvent.get()); - assertEquals(generatedTag, oldTagFromEvent.get()); - assertEquals(CUSTOM_TAG_0, newTagFromEvent.get()); + assertEquals(clusterId, clusterIdFromEvt.get()); + assertEquals(generatedTag, oldTagFromEvt.get()); + assertEquals(CUSTOM_TAG_0, newTagFromEvt.get()); } /** @@ -389,25 +389,25 @@ public void testTagChangedEventMultinodeWithRemoteFilter() throws Exception { UUID clusterId = ig0.cluster().id(); String generatedTag = ig0.cluster().tag(); - AtomicReference eventNodeId = new AtomicReference<>(null); + AtomicReference evtNodeId = new AtomicReference<>(null); - AtomicReference clusterIdFromEvent = new AtomicReference<>(null); - AtomicReference oldTagFromEvent = new AtomicReference<>(null); - AtomicReference newTagFromEvent = new AtomicReference<>(null); + AtomicReference clusterIdFromEvt = new AtomicReference<>(null); + AtomicReference oldTagFromEvt = new AtomicReference<>(null); + AtomicReference newTagFromEvt = new AtomicReference<>(null); AtomicBoolean evtFired = new AtomicBoolean(false); ig0.events(ig0.cluster().forRemotes()).remoteListen( (IgniteBiPredicate)(uuid, event) -> { - eventNodeId.set(uuid); + evtNodeId.set(uuid); evtFired.set(true); ClusterTagUpdatedEvent tagUpdatedEvt = (ClusterTagUpdatedEvent)event; - clusterIdFromEvent.set(tagUpdatedEvt.clusterId()); - oldTagFromEvent.set(tagUpdatedEvt.previousTag()); - newTagFromEvent.set(tagUpdatedEvt.newTag()); + clusterIdFromEvt.set(tagUpdatedEvt.clusterId()); + oldTagFromEvt.set(tagUpdatedEvt.previousTag()); + newTagFromEvt.set(tagUpdatedEvt.newTag()); return true; }, @@ -417,10 +417,10 @@ public void testTagChangedEventMultinodeWithRemoteFilter() throws Exception { assertTrue(GridTestUtils.waitForCondition(evtFired::get, 10_000)); - assertEquals(ig1.localNode().id(), eventNodeId.get()); + assertEquals(ig1.localNode().id(), evtNodeId.get()); - assertEquals(clusterId, clusterIdFromEvent.get()); - assertEquals(generatedTag, oldTagFromEvent.get()); - assertEquals(CUSTOM_TAG_0, newTagFromEvent.get()); + assertEquals(clusterId, clusterIdFromEvt.get()); + assertEquals(generatedTag, oldTagFromEvt.get()); + assertEquals(CUSTOM_TAG_0, newTagFromEvt.get()); } } diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheEntryListenerAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheEntryListenerAbstractTest.java index 5bc628ce02e1e..66f69de84b41f 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheEntryListenerAbstractTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheEntryListenerAbstractTest.java @@ -120,10 +120,10 @@ public abstract class IgniteCacheEntryListenerAbstractTest extends IgniteCacheAb @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); - MemoryEventStorageSpi eventSpi = new MemoryEventStorageSpi(); - eventSpi.setExpireCount(50); + MemoryEventStorageSpi evtSpi = new MemoryEventStorageSpi(); + evtSpi.setExpireCount(50); - cfg.setEventStorageSpi(eventSpi); + cfg.setEventStorageSpi(evtSpi); return cfg; } diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheManyClientsTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheManyClientsTest.java index e6dd119251315..0829e0349bd5c 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheManyClientsTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheManyClientsTest.java @@ -64,10 +64,10 @@ public class IgniteCacheManyClientsTest extends GridCommonAbstractTest { cfg.setPeerClassLoadingEnabled(false); cfg.setTimeServerPortRange(200); - MemoryEventStorageSpi eventSpi = new MemoryEventStorageSpi(); - eventSpi.setExpireCount(100); + MemoryEventStorageSpi evtSpi = new MemoryEventStorageSpi(); + evtSpi.setExpireCount(100); - cfg.setEventStorageSpi(eventSpi); + cfg.setEventStorageSpi(evtSpi); ((TcpCommunicationSpi)cfg.getCommunicationSpi()).setLocalPortRange(200); ((TcpCommunicationSpi)cfg.getCommunicationSpi()).setSharedMemoryPort(-1); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/GridCacheRebalancingOrderingTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/GridCacheRebalancingOrderingTest.java index e80b562aa6c88..b470a57a3a599 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/GridCacheRebalancingOrderingTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/GridCacheRebalancingOrderingTest.java @@ -596,15 +596,15 @@ public void sync() { }, this.causes); - for (Event event : evts) { + for (Event evt : evts) { // Events returned from localQuery() are ordered by increasing local ID. Update the sync ID // within a finally block to avoid applying duplicate events if the delegate listener // throws an exception while processing the event. try { - applyInternal(event); + applyInternal(evt); } finally { - this.syncedId = event.localOrder(); + this.syncedId = evt.localOrder(); } } diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryFailoverAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryFailoverAbstractSelfTest.java index 982c78b5573aa..18e81551fe61b 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryFailoverAbstractSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryFailoverAbstractSelfTest.java @@ -1203,8 +1203,8 @@ && equalOldValue(e, exp)) { if (dup) { for (List> e : lsnr.evts.values()) { if (!e.isEmpty()) { - for (CacheEntryEvent event : e) - log.error("Got duplicate event: " + event); + for (CacheEntryEvent evt : e) + log.error("Got duplicate event: " + evt); } } } diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/ContinuousQueryRemoteFilterMissingInClassPathSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/ContinuousQueryRemoteFilterMissingInClassPathSelfTest.java index b0b21b4e5a4ab..02e5714874ca4 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/ContinuousQueryRemoteFilterMissingInClassPathSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/ContinuousQueryRemoteFilterMissingInClassPathSelfTest.java @@ -259,10 +259,10 @@ private void executeContinuousQuery(IgniteCache cache) throws Ex qry.setLocalListener( new CacheEntryUpdatedListener() { - @Override public void onUpdated(Iterable> events) + @Override public void onUpdated(Iterable> evts) throws CacheEntryListenerException { - for (CacheEntryEvent event : events) - System.out.println("Key = " + event.getKey() + ", Value = " + event.getValue()); + for (CacheEntryEvent evt : evts) + System.out.println("Key = " + evt.getKey() + ", Value = " + evt.getValue()); } } ); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/IgniteCacheContinuousQueryImmutableEntryTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/IgniteCacheContinuousQueryImmutableEntryTest.java index 79f65a6740d0a..323ed2ad8f2ed 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/IgniteCacheContinuousQueryImmutableEntryTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/IgniteCacheContinuousQueryImmutableEntryTest.java @@ -56,7 +56,7 @@ public class IgniteCacheContinuousQueryImmutableEntryTest extends GridCommonAbst private static final int GRID_COUNT = 3; /** Events. */ - private static final ConcurrentLinkedQueue> events = new ConcurrentLinkedQueue<>(); + private static final ConcurrentLinkedQueue> evts = new ConcurrentLinkedQueue<>(); /** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { @@ -85,7 +85,7 @@ protected CacheAtomicityMode atomicityMode() { stopAllGrids(); - events.clear(); + evts.clear(); } /** @@ -119,12 +119,12 @@ public void testEventAvailabilityScope() throws Exception { } } - assertTrue("There are not filtered events", !events.isEmpty()); + assertTrue("There are not filtered events", !evts.isEmpty()); - for (CacheEntryEvent event : events) { - assertNotNull("Key is null", event.getKey()); - assertNotNull("Value is null", event.getValue()); - assertNotNull("Old value is null", event.getOldValue()); + for (CacheEntryEvent evt : evts) { + assertNotNull("Key is null", evt.getKey()); + assertNotNull("Value is null", evt.getValue()); + assertNotNull("Old value is null", evt.getOldValue()); } } @@ -192,7 +192,7 @@ private static class FilterFactory implements Factory, Serializable { /** {@inheritDoc} */ @Override public boolean evaluate(CacheEntryEvent evt) { - events.add(evt); + evts.add(evt); return false; } diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cluster/ClusterStateChangeEventTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cluster/ClusterStateChangeEventTest.java index a7c0fe2c04788..f6bbfaf558f78 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cluster/ClusterStateChangeEventTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cluster/ClusterStateChangeEventTest.java @@ -121,11 +121,11 @@ private void changeStateAndCheckEvents(ClusterState state) throws IgniteCheckedE Map> evtFuts = new HashMap<>(); for (Ignite node : G.allGrids()) { - Event event = max(node.events().localQuery(F.alwaysTrue(), EVT_CLUSTER_STATE_CHANGED), comparingLong(Event::localOrder)); + Event evt = max(node.events().localQuery(F.alwaysTrue(), EVT_CLUSTER_STATE_CHANGED), comparingLong(Event::localOrder)); - log.info("Event with highest local id for node: " + node.name() + " is: " + event); + log.info("Event with highest local id for node: " + node.name() + " is: " + evt); - evtFuts.put(node, waitForLocalEvent(node.events(), e -> e.localOrder() > event.localOrder(), EVT_CLUSTER_STATE_CHANGED)); + evtFuts.put(node, waitForLocalEvent(node.events(), e -> e.localOrder() > evt.localOrder(), EVT_CLUSTER_STATE_CHANGED)); } crd.cluster().state(state); @@ -139,18 +139,18 @@ private void changeStateAndCheckEvents(ClusterState state) throws IgniteCheckedE assertTrue(node.name() + " " + e, e instanceof ClusterStateChangeEvent); - ClusterStateChangeEvent changeEvent = (ClusterStateChangeEvent)e; + ClusterStateChangeEvent changeEvt = (ClusterStateChangeEvent)e; - assertEquals(prevState, changeEvent.previousState()); - assertEquals(state, changeEvent.state()); + assertEquals(prevState, changeEvt.previousState()); + assertEquals(state, changeEvt.state()); if (blt == null) - assertNull(node.name(), changeEvent.baselineNodes()); + assertNull(node.name(), changeEvt.baselineNodes()); else { - assertNotNull(changeEvent.baselineNodes()); + assertNotNull(changeEvt.baselineNodes()); Set bltIds = blt.stream().map(BaselineNode::consistentId).collect(toSet()); - Set evtBltIds = changeEvent.baselineNodes().stream().map(BaselineNode::consistentId).collect(toSet()); + Set evtBltIds = changeEvt.baselineNodes().stream().map(BaselineNode::consistentId).collect(toSet()); assertEqualsCollections(bltIds, evtBltIds); } diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/continuous/ContinuousQueryBuffersCleanupTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/continuous/ContinuousQueryBuffersCleanupTest.java index fefed88c45703..26187fe8050e4 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/continuous/ContinuousQueryBuffersCleanupTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/continuous/ContinuousQueryBuffersCleanupTest.java @@ -152,9 +152,9 @@ private void checkBuffersCleared(int primaryNodeIdx, Function, QueryCur // We repeatedly perform 5 cache operations that raise CREATE, UPDATE, REMOVED, EXPIRIED events. // The total number of events is selected in a such way as to check for a backup notification due to a // buffer overflow, and then by timeout. - int expEventsCnt = cacheOpRounds * 5; + int expEvtsCnt = cacheOpRounds * 5; - CountDownLatch cqListenerNotifiedLatch = new CountDownLatch(expEventsCnt); + CountDownLatch cqListenerNotifiedLatch = new CountDownLatch(expEvtsCnt); Query qry = new ContinuousQuery<>() .setLocalListener(events -> cqListenerNotifiedLatch.countDown()) diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceContinuousQueryRedeployTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceContinuousQueryRedeployTest.java index 5593296a20ab4..7ec09aa478101 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceContinuousQueryRedeployTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceContinuousQueryRedeployTest.java @@ -75,8 +75,8 @@ public void testServiceRedeploymentAfterCancel() throws Exception { qry.setLocalListener(new CacheEntryUpdatedListener() { @Override public void onUpdated( Iterable> iterable) throws CacheEntryListenerException { - for (CacheEntryEvent event : iterable) - evts.add(event); + for (CacheEntryEvent evt : iterable) + evts.add(evt); } }); diff --git a/modules/core/src/test/java/org/apache/ignite/p2p/P2PClassLoadingFailureHandlingTest.java b/modules/core/src/test/java/org/apache/ignite/p2p/P2PClassLoadingFailureHandlingTest.java index 10ab975e950b8..6a6d1661ef981 100644 --- a/modules/core/src/test/java/org/apache/ignite/p2p/P2PClassLoadingFailureHandlingTest.java +++ b/modules/core/src/test/java/org/apache/ignite/p2p/P2PClassLoadingFailureHandlingTest.java @@ -258,8 +258,8 @@ public void continuousQueryRemoteTransformerP2PClassLoadingProblemShouldNotCause /***/ @Test public void remoteEventListenerP2PClassLoadingProblemShouldNotCauseFailureHandling() throws Exception { - IgniteEvents events = client.events(client.cluster().forRemotes()); - events.remoteListen( + IgniteEvents evts = client.events(client.cluster().forRemotes()); + evts.remoteListen( (nodeId, event) -> true, instantiateClassLoadedWithExternalClassLoader( "org.apache.ignite.tests.p2p.classloadproblem.RemoteEventFilterCausingP2PClassLoadProblem" diff --git a/modules/core/src/test/java/org/apache/ignite/platform/PlatformEventsWriteEventTask.java b/modules/core/src/test/java/org/apache/ignite/platform/PlatformEventsWriteEventTask.java index 0a75ec51e4ec0..6d53c01e2654b 100644 --- a/modules/core/src/test/java/org/apache/ignite/platform/PlatformEventsWriteEventTask.java +++ b/modules/core/src/test/java/org/apache/ignite/platform/PlatformEventsWriteEventTask.java @@ -114,18 +114,18 @@ private Job(long ptr, ClusterNode node) { ctx.writeEvent(writer, new CheckpointEvent(node, msg, evtType, "cpKey")); - DiscoveryEvent discoveryEvent = new DiscoveryEvent(node, msg, evtType, node); - discoveryEvent.topologySnapshot(ignite.cluster().topologyVersion(), ignite.cluster().nodes()); - ctx.writeEvent(writer, discoveryEvent); - - JobEvent jobEvent = new JobEvent(node, msg, evtType); - jobEvent.jobId(igniteUuid); - jobEvent.taskClassName("taskClsName"); - jobEvent.taskName("taskName"); - jobEvent.taskNode(node); - jobEvent.taskSessionId(igniteUuid); - jobEvent.taskSubjectId(uuid); - ctx.writeEvent(writer, jobEvent); + DiscoveryEvent discoveryEvt = new DiscoveryEvent(node, msg, evtType, node); + discoveryEvt.topologySnapshot(ignite.cluster().topologyVersion(), ignite.cluster().nodes()); + ctx.writeEvent(writer, discoveryEvt); + + JobEvent jobEvt = new JobEvent(node, msg, evtType); + jobEvt.jobId(igniteUuid); + jobEvt.taskClassName("taskClsName"); + jobEvt.taskName("taskName"); + jobEvt.taskNode(node); + jobEvt.taskSessionId(igniteUuid); + jobEvt.taskSubjectId(uuid); + ctx.writeEvent(writer, jobEvt); ctx.writeEvent(writer, new TaskEvent(node, msg, evtType, igniteUuid, "taskName", "taskClsName", true, uuid)); diff --git a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationInverseConnectionEstablishingTest.java b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationInverseConnectionEstablishingTest.java index a270a415344f2..5ba125398efd9 100644 --- a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationInverseConnectionEstablishingTest.java +++ b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationInverseConnectionEstablishingTest.java @@ -336,13 +336,13 @@ public void testClientSkippingInverseConnResponseIsForciblyFailed() throws Excep UNREACHABLE_DESTINATION.set(UNRESOLVED_HOST); RESPOND_TO_INVERSE_REQUEST.set(false); - AtomicBoolean clientFailedEventFlag = new AtomicBoolean(false); + AtomicBoolean clientFailedEvtFlag = new AtomicBoolean(false); IgniteEx srv = startGrid(); srv.events().localListen(new IgnitePredicate() { @Override public boolean apply(Event event) { - clientFailedEventFlag.set(true); + clientFailedEvtFlag.set(true); return false; } @@ -363,7 +363,7 @@ public void testClientSkippingInverseConnResponseIsForciblyFailed() throws Excep srv.context().io().sendIoTest(clientNode, new byte[10], false).get() ); - assertTrue(GridTestUtils.waitForCondition(clientFailedEventFlag::get, 10_000)); + assertTrue(GridTestUtils.waitForCondition(clientFailedEvtFlag::get, 10_000)); } /** diff --git a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpiInverseConnectionLoggingTest.java b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpiInverseConnectionLoggingTest.java index 401d2a1302f90..198cacb2ddd55 100644 --- a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpiInverseConnectionLoggingTest.java +++ b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpiInverseConnectionLoggingTest.java @@ -114,11 +114,11 @@ public void logsWarnForExceptionMeaningSwitchToInverseConnection() throws Except sendFailingMessage(server, clientNode); - LogEvent event = log4jAppender.singleEventSatisfying( - evt -> evt.getMessage().getFormattedMessage().startsWith("Failed to send message to remote node ") + LogEvent evt = log4jAppender.singleEventSatisfying( + e -> e.getMessage().getFormattedMessage().startsWith("Failed to send message to remote node ") ); - assertThat(event.getLevel(), is(Level.WARN)); + assertThat(evt.getLevel(), is(Level.WARN)); } /** diff --git a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpiNodeLeftLoggingTest.java b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpiNodeLeftLoggingTest.java index 8196d6c44320f..b17b4fb85f9d9 100644 --- a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpiNodeLeftLoggingTest.java +++ b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpiNodeLeftLoggingTest.java @@ -93,11 +93,11 @@ public void logsWithErrorWhenCantSendMessageToServerWhichLeft() throws Exception sendFailingMessage(server1, server2Node); - LogEvent event = log4jAppender.singleEventSatisfying( - evt -> evt.getMessage().getFormattedMessage().startsWith("Failed to send message to remote node") + LogEvent evt = log4jAppender.singleEventSatisfying( + e -> e.getMessage().getFormattedMessage().startsWith("Failed to send message to remote node") ); - assertThat(event.getLevel(), is(Level.ERROR)); + assertThat(evt.getLevel(), is(Level.ERROR)); } /** @@ -143,10 +143,10 @@ public void logsWithWarnWhenCantSendMessageToClientWhichLeft() throws Exception sendFailingMessage(server, clientNode); - LogEvent event = log4jAppender.singleEventSatisfying( - evt -> evt.getMessage().getFormattedMessage().startsWith("Failed to send message to remote node") + LogEvent evt = log4jAppender.singleEventSatisfying( + e -> e.getMessage().getFormattedMessage().startsWith("Failed to send message to remote node") ); - assertThat(event.getLevel(), is(Level.WARN)); + assertThat(evt.getLevel(), is(Level.WARN)); } } diff --git a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySelfTest.java b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySelfTest.java index 6b06b459f27ac..bc86f655efb0e 100644 --- a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySelfTest.java @@ -477,7 +477,7 @@ public void testPingInterruptedOnNodeFailed() throws Exception { final CountDownLatch pingLatch = new CountDownLatch(1); - final CountDownLatch eventLatch = new CountDownLatch(1); + final CountDownLatch evtLatch = new CountDownLatch(1); final AtomicBoolean pingRes = new AtomicBoolean(true); @@ -490,7 +490,7 @@ public void testPingInterruptedOnNodeFailed() throws Exception { @Override public boolean apply(Event event) { if (((DiscoveryEvent)event).eventNode().id().equals(failedNodeId)) { failRes.set(true); - eventLatch.countDown(); + evtLatch.countDown(); } return true; @@ -531,7 +531,7 @@ public void testPingInterruptedOnNodeFailed() throws Exception { assertTrue(System.currentTimeMillis() - startTs < pingingNode.configuration().getFailureDetectionTimeout() / 2); - assertTrue(eventLatch.await(7, TimeUnit.SECONDS)); + assertTrue(evtLatch.await(7, TimeUnit.SECONDS)); assertTrue(failRes.get()); } finally { diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/MemorizingAppenderTest.java b/modules/core/src/test/java/org/apache/ignite/testframework/MemorizingAppenderTest.java index e8bbdb46a4841..3409fed4f984e 100644 --- a/modules/core/src/test/java/org/apache/ignite/testframework/MemorizingAppenderTest.java +++ b/modules/core/src/test/java/org/apache/ignite/testframework/MemorizingAppenderTest.java @@ -66,13 +66,13 @@ public void removeAppender() { public void memorizesLoggingEvents() { LogManager.getLogger(MemorizingAppenderTest.class).info("Hello!"); - List events = appender.events(); + List evts = appender.events(); - assertThat(events, hasSize(1)); + assertThat(evts, hasSize(1)); - LogEvent event = events.get(0); + LogEvent evt = evts.get(0); - assertThat(event.getLevel(), is(Level.INFO)); - assertThat(event.getMessage().getFormattedMessage(), is("Hello!")); + assertThat(evt.getLevel(), is(Level.INFO)); + assertThat(evt.getMessage().getFormattedMessage(), is("Hello!")); } } diff --git a/modules/zookeeper/src/test/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperDiscoverySpiTestHelper.java b/modules/zookeeper/src/test/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperDiscoverySpiTestHelper.java index 26fcde65049d8..7f20a8029206d 100644 --- a/modules/zookeeper/src/test/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperDiscoverySpiTestHelper.java +++ b/modules/zookeeper/src/test/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperDiscoverySpiTestHelper.java @@ -136,9 +136,9 @@ static DiscoveryEvent joinEvent(long topVer) { * @return Expected event instance. */ static DiscoveryEvent leftEvent(long topVer, boolean fail) { - int eventType = fail ? EventType.EVT_NODE_FAILED : EventType.EVT_NODE_LEFT; + int evtType = fail ? EventType.EVT_NODE_FAILED : EventType.EVT_NODE_LEFT; - DiscoveryEvent expEvt = new DiscoveryEvent(null, null, eventType, null); + DiscoveryEvent expEvt = new DiscoveryEvent(null, null, evtType, null); expEvt.topologySnapshot(topVer, null);