ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject ignite git commit: GridCacheContinuousQueryConcurrentTest: code style.
Date Fri, 30 Dec 2016 12:08:20 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-3477 5475bfda2 -> a940fc3ad


GridCacheContinuousQueryConcurrentTest: code style.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/a940fc3a
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/a940fc3a
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/a940fc3a

Branch: refs/heads/ignite-3477
Commit: a940fc3adbe36917ac80c06580a25ca0d0ba92c8
Parents: 5475bfd
Author: sboikov <sboikov@gridgain.com>
Authored: Fri Dec 30 15:08:18 2016 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Fri Dec 30 15:08:18 2016 +0300

----------------------------------------------------------------------
 .../GridCacheContinuousQueryConcurrentTest.java | 47 +++++++++++---------
 1 file changed, 25 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/a940fc3a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryConcurrentTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryConcurrentTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryConcurrentTest.java
index 29b351b..e0d6162 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryConcurrentTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryConcurrentTest.java
@@ -60,6 +60,7 @@ import static javax.cache.configuration.FactoryBuilder.factoryOf;
 /**
  *
  */
+@SuppressWarnings("unchecked")
 public class GridCacheContinuousQueryConcurrentTest extends GridCommonAbstractTest {
     /** */
     private static TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
@@ -152,9 +153,10 @@ public class GridCacheContinuousQueryConcurrentTest extends GridCommonAbstractTe
     }
 
     /**
+     * @param ccfg Cache configuration.
      * @throws Exception If failed.
      */
-    public void testRegistration(CacheConfiguration ccfg) throws Exception {
+    private void testRegistration(CacheConfiguration ccfg) throws Exception {
         ExecutorService execSrv = newSingleThreadExecutor();
 
         try {
@@ -171,16 +173,16 @@ public class GridCacheContinuousQueryConcurrentTest extends GridCommonAbstractTe
                 Future<List<IgniteFuture<String>>> fut = execSrv.submit(
                     new Callable<List<IgniteFuture<String>>>() {
                         @Override public List<IgniteFuture<String>> call() throws
Exception {
-                            int count = 0;
+                            int cnt = 0;
                             List<IgniteFuture<String>> futures = new ArrayList<>();
 
                             while (!stop.get()) {
-                                futures.add(waitForKey(i0, cache, count));
+                                futures.add(waitForKey(i0, cache, cnt));
 
                                 if (log.isDebugEnabled())
-                                    log.debug("Started cont query count: " + count);
+                                    log.debug("Started cont query count: " + cnt);
 
-                                if (++count >= conQryCnt)
+                                if (++cnt >= conQryCnt)
                                     latch.countDown();
                             }
 
@@ -208,9 +210,10 @@ public class GridCacheContinuousQueryConcurrentTest extends GridCommonAbstractTe
     }
 
     /**
+     * @param ccfg Cache configuration.
      * @throws Exception If failed.
      */
-    public void testRestartRegistration(CacheConfiguration ccfg) throws Exception {
+    private void testRestartRegistration(CacheConfiguration ccfg) throws Exception {
         ExecutorService execSrv = newSingleThreadExecutor();
 
         final AtomicBoolean stopRes = new AtomicBoolean(false);
@@ -261,16 +264,16 @@ public class GridCacheContinuousQueryConcurrentTest extends GridCommonAbstractTe
                 Future<List<IgniteFuture<String>>> fut = execSrv.submit(
                     new Callable<List<IgniteFuture<String>>>() {
                         @Override public List<IgniteFuture<String>> call() throws
Exception {
-                            int count = 0;
+                            int cnt = 0;
                             List<IgniteFuture<String>> futures = new ArrayList<>();
 
                             while (!stop.get()) {
-                                futures.add(waitForKey(i0, cache, count));
+                                futures.add(waitForKey(i0, cache, cnt));
 
                                 if (log.isDebugEnabled())
-                                    log.debug("Started cont query count: " + count);
+                                    log.debug("Started cont query count: " + cnt);
 
-                                if (++count >= conQryCnt)
+                                if (++cnt >= conQryCnt)
                                     latch.countDown();
                             }
 
@@ -313,7 +316,7 @@ public class GridCacheContinuousQueryConcurrentTest extends GridCommonAbstractTe
      * @param id ID.
      * @return Future.
      */
-    public IgniteFuture<String> waitForKey(Integer key, final IgniteCache<Integer,
String> cache, final int id) {
+    private IgniteFuture<String> waitForKey(Integer key, final IgniteCache<Integer,
String> cache, final int id) {
         String v = cache.get(key);
 
         // From now on, all futures will be completed immediately (since the key has been
@@ -327,7 +330,7 @@ public class GridCacheContinuousQueryConcurrentTest extends GridCommonAbstractTe
             createCacheListener(key, promise, id);
 
         promise.listen(new IgniteInClosure<IgniteFuture<String>>() {
-            @Override public void apply(IgniteFuture<String> future) {
+            @Override public void apply(IgniteFuture<String> fut) {
                 GridTestUtils.runAsync(new Callable<Object>() {
                     @Override public Object call() throws Exception {
                         cache.deregisterCacheEntryListener(cfg);
@@ -351,9 +354,9 @@ public class GridCacheContinuousQueryConcurrentTest extends GridCommonAbstractTe
         // Complete the promise if the key was inserted concurrently.
         asyncCache.<String>future().listen(new IgniteInClosure<IgniteFuture<String>>()
{
             @Override public void apply(IgniteFuture<String> f) {
-                String value = f.get();
+                String val = f.get();
 
-                if (value != null) {
+                if (val != null) {
                     log.info("Completed by get: " + id);
 
                     (((GridFutureAdapter)((IgniteFutureImpl)promise).internalFuture())).onDone("by
get");
@@ -366,16 +369,16 @@ public class GridCacheContinuousQueryConcurrentTest extends GridCommonAbstractTe
 
     /**
      * @param key Key.
-     * @param result Result.
+     * @param res Result.
      * @param id Listener ID.
      * @return Listener
      */
     private CacheEntryListenerConfiguration<Integer, String> createCacheListener(
         Integer key,
-        IgniteFuture<String> result,
+        IgniteFuture<String> res,
         int id) {
         return new MutableCacheEntryListenerConfiguration<>(
-            factoryOf(new CacheListener(result, id)),
+            factoryOf(new CacheListener(res, id)),
             new SingletonFactory<>(new KeyEventFilter(key, id)), false, true);
     }
 
@@ -405,23 +408,23 @@ public class GridCacheContinuousQueryConcurrentTest extends GridCommonAbstractTe
      */
     private static class CacheListener implements CacheEntryCreatedListener<Integer, String>,
Serializable {
         /** */
-        final IgniteFuture<String> result;
+        final IgniteFuture<String> res;
 
         /** */
         private final int id;
 
         /**
-         * @param result Result.
+         * @param res Result.
          * @param id ID.
          */
-        CacheListener(IgniteFuture<String> result, int id) {
-            this.result = result;
+        CacheListener(IgniteFuture<String> res, int id) {
+            this.res = res;
             this.id = id;
         }
 
         /** {@inheritDoc} */
         @Override public void onCreated(Iterable<CacheEntryEvent<? extends Integer,
? extends String>> evts) {
-            (((GridFutureAdapter)((IgniteFutureImpl)result).internalFuture())).onDone("by
listener");
+            (((GridFutureAdapter)((IgniteFutureImpl)res).internalFuture())).onDone("by listener");
         }
     }
 


Mime
View raw message