You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2015/01/19 07:58:19 UTC

[01/16] incubator-ignite git commit: # Fixed query with portables.

Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-42 5521dac5a -> 2bbf624ee


# Fixed query with portables.


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

Branch: refs/heads/ignite-42
Commit: e4c2bc4662f69fdb05d8d99779ebdface45c7c60
Parents: 0d5ea99
Author: AKuznetsov <ak...@gridgain.com>
Authored: Thu Jan 15 14:53:04 2015 +0700
Committer: AKuznetsov <ak...@gridgain.com>
Committed: Thu Jan 15 14:53:04 2015 +0700

----------------------------------------------------------------------
 .../grid/kernal/visor/query/VisorQueryTask.java | 53 ++++++++++++--------
 1 file changed, 32 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e4c2bc46/modules/core/src/main/java/org/gridgain/grid/kernal/visor/query/VisorQueryTask.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/visor/query/VisorQueryTask.java b/modules/core/src/main/java/org/gridgain/grid/kernal/visor/query/VisorQueryTask.java
index 1efc054..225eb79 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/visor/query/VisorQueryTask.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/visor/query/VisorQueryTask.java
@@ -129,6 +129,11 @@ public class VisorQueryTask extends VisorOneNodeTask<VisorQueryTask.VisorQueryAr
         /** Flag indicating that this furure was read from last check. */
         private Boolean accessed;
 
+        /**
+         * @param fut Future.
+         * @param next Next value.
+         * @param accessed {@code true} if query was accessed before remove timeout expired.
+         */
         public VisorFutureResultSetHolder(GridCacheQueryFuture<R> fut, R next, Boolean accessed) {
             this.fut = fut;
             this.next = next;
@@ -188,15 +193,19 @@ public class VisorQueryTask extends VisorOneNodeTask<VisorQueryTask.VisorQueryAr
             try {
                 Boolean scan = arg.queryTxt().toUpperCase().startsWith("SCAN");
 
-                String qryId = (scan ? VisorQueryUtils.SCAN_QRY_NAME : VisorQueryUtils.SQL_QRY_NAME) + "-" + UUID.randomUUID();
+                String qryId = (scan ? VisorQueryUtils.SCAN_QRY_NAME : VisorQueryUtils.SQL_QRY_NAME) + "-" +
+                    UUID.randomUUID();
 
                 GridCache<Object, Object> c = g.cachex(arg.cacheName());
 
                 if (c == null)
-                    return new IgniteBiTuple<>(new IgniteCheckedException("Cache not found: " + escapeName(arg.cacheName())), null);
+                    return new IgniteBiTuple<>(new IgniteCheckedException("Cache not found: " +
+                        escapeName(arg.cacheName())), null);
+
+                GridCacheProjection<Object, Object> cp = c.keepPortable();
 
                 if (scan) {
-                    GridCacheQueryFuture<Map.Entry<Object, Object>> fut = c.queries().createScanQuery(null)
+                    GridCacheQueryFuture<Map.Entry<Object, Object>> fut = cp.queries().createScanQuery(null)
                         .pageSize(arg.pageSize())
                         .projection(g.forNodeIds(arg.proj()))
                         .execute();
@@ -221,7 +230,7 @@ public class VisorQueryTask extends VisorOneNodeTask<VisorQueryTask.VisorQueryAr
                         VisorQueryUtils.SCAN_COL_NAMES, rows.get1(), next != null, duration));
                 }
                 else {
-                    GridCacheQueryFuture<List<?>> fut = ((GridCacheQueriesEx<?, ?>)c.queries())
+                    GridCacheQueryFuture<List<?>> fut = ((GridCacheQueriesEx<?, ?>)cp.queries())
                         .createSqlFieldsQuery(arg.queryTxt(), true)
                         .pageSize(arg.pageSize())
                         .projection(g.forNodeIds(arg.proj()))
@@ -245,7 +254,8 @@ public class VisorQueryTask extends VisorOneNodeTask<VisorQueryTask.VisorQueryAr
 
                         long start = U.currentTimeMillis();
 
-                        IgniteBiTuple<List<Object[]>, List<?>> rows = VisorQueryUtils.fetchSqlQueryRows(fut, firstRow, arg.pageSize());
+                        IgniteBiTuple<List<Object[]>, List<?>> rows =
+                            VisorQueryUtils.fetchSqlQueryRows(fut, firstRow, arg.pageSize());
 
                         long fetchDuration = U.currentTimeMillis() - start;
 
@@ -271,24 +281,25 @@ public class VisorQueryTask extends VisorOneNodeTask<VisorQueryTask.VisorQueryAr
          * @param id Uniq query result id.
          */
         private void scheduleResultSetHolderRemoval(final String id) {
-            ((GridKernal)g).context().timeout().addTimeoutObject(new GridTimeoutObjectAdapter(VisorQueryUtils.RMV_DELAY) {
-                @Override public void onTimeout() {
-                    ClusterNodeLocalMap<String, VisorFutureResultSetHolder> storage = g.nodeLocalMap();
-
-                    VisorFutureResultSetHolder<?> t = storage.get(id);
-
-                    if (t != null) {
-                        // If future was accessed since last scheduling,  set access flag to false and reschedule.
-                        if (t.accessed()) {
-                            t.accessed(false);
-
-                            scheduleResultSetHolderRemoval(id);
+            ((GridKernal)g).context().timeout()
+                .addTimeoutObject(new GridTimeoutObjectAdapter(VisorQueryUtils.RMV_DELAY) {
+                    @Override public void onTimeout() {
+                        ClusterNodeLocalMap<String, VisorFutureResultSetHolder> storage = g.nodeLocalMap();
+
+                        VisorFutureResultSetHolder<?> t = storage.get(id);
+
+                        if (t != null) {
+                            // If future was accessed since last scheduling,  set access flag to false and reschedule.
+                            if (t.accessed()) {
+                                t.accessed(false);
+
+                                scheduleResultSetHolderRemoval(id);
+                            }
+                            else
+                                storage.remove(id); // Remove stored future otherwise.
                         }
-                        else
-                            storage.remove(id); // Remove stored future otherwise.
                     }
-                }
-            });
+                });
         }
 
         /** {@inheritDoc} */


[03/16] incubator-ignite git commit: Merge remote-tracking branch 'remotes/origin/ignite-64'

Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-64'


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

Branch: refs/heads/ignite-42
Commit: 725d79ff46b280ab967b6988845240a5bd0022b0
Parents: e4c2bc4 779e5d5
Author: avinogradov <av...@gridgain.com>
Authored: Thu Jan 15 19:18:28 2015 +0300
Committer: avinogradov <av...@gridgain.com>
Committed: Thu Jan 15 19:18:28 2015 +0300

----------------------------------------------------------------------
 .../test/java/org/gridgain/grid/p2p/p2p.properties | 17 -----------------
 1 file changed, 17 deletions(-)
----------------------------------------------------------------------



[12/16] incubator-ignite git commit: # Cleanup code: remove unnecessary null-checking.

Posted by sb...@apache.org.
# Cleanup code: remove unnecessary null-checking.


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

Branch: refs/heads/ignite-42
Commit: 80b986f46340a811cd6d991218249a30f5a7ada3
Parents: 785bf10
Author: sevdokimov <se...@gridgain.com>
Authored: Fri Jan 16 16:49:13 2015 +0300
Committer: sevdokimov <se...@gridgain.com>
Committed: Fri Jan 16 16:49:13 2015 +0300

----------------------------------------------------------------------
 .../gridgain/grid/kernal/processors/cache/GridCacheMapEntry.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/80b986f4/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheMapEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheMapEntry.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheMapEntry.java
index 9b8945a..7b2b2a7 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheMapEntry.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheMapEntry.java
@@ -238,7 +238,7 @@ public abstract class GridCacheMapEntry<K, V> implements GridCacheEntryEx<K, V>
                 assert mem != null;
 
                 if (val != null || valBytes != null) {
-                    boolean valIsByteArr = val != null && val instanceof byte[];
+                    boolean valIsByteArr = val instanceof byte[];
 
                     if (valBytes == null && !valIsByteArr)
                         valBytes = CU.marshal(cctx.shared(), val);


[06/16] incubator-ignite git commit: IGNITE-59 Support lock, lockAll: Fix tests.

Posted by sb...@apache.org.
IGNITE-59 Support lock, lockAll: Fix tests.


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

Branch: refs/heads/ignite-42
Commit: 785bf106568963b2cd52706cb3654f8de76f4e89
Parents: c5fae8e
Author: sevdokimov <se...@gridgain.com>
Authored: Fri Jan 16 13:35:34 2015 +0300
Committer: sevdokimov <se...@gridgain.com>
Committed: Fri Jan 16 15:45:41 2015 +0300

----------------------------------------------------------------------
 .../internal/processors/cache/IgniteCacheProxy.java       | 10 +++++-----
 .../processors/cache/GridCacheBasicApiAbstractTest.java   |  6 ++++--
 .../near/GridCachePartitionedLockSelfTest.java            |  5 +++--
 .../cache/local/GridCacheLocalLockSelfTest.java           |  2 +-
 4 files changed, 13 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/785bf106/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
index 055827b..0c98124 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
@@ -273,7 +273,7 @@ public class IgniteCacheProxy<K, V> extends IgniteAsyncSupportAdapter implements
 
                 }
                 catch (IgniteCheckedException e) {
-                    throw new CacheException(e);
+                    throw new CacheException(e.getMessage(), e);
                 }
             }
 
@@ -291,7 +291,7 @@ public class IgniteCacheProxy<K, V> extends IgniteAsyncSupportAdapter implements
                     throw new InterruptedException();
                 }
                 catch (IgniteCheckedException e) {
-                    throw new CacheException(e);
+                    throw new CacheException(e.getMessage(), e);
                 }
             }
 
@@ -300,7 +300,7 @@ public class IgniteCacheProxy<K, V> extends IgniteAsyncSupportAdapter implements
                     return delegate.lockAll(keys, -1);
                 }
                 catch (IgniteCheckedException e) {
-                    throw new CacheException(e);
+                    throw new CacheException(e.getMessage(), e);
                 }
             }
 
@@ -315,7 +315,7 @@ public class IgniteCacheProxy<K, V> extends IgniteAsyncSupportAdapter implements
                     throw new InterruptedException();
                 }
                 catch (IgniteCheckedException e) {
-                    throw new CacheException(e);
+                    throw new CacheException(e.getMessage(), e);
                 }
             }
 
@@ -324,7 +324,7 @@ public class IgniteCacheProxy<K, V> extends IgniteAsyncSupportAdapter implements
                     delegate.unlockAll(keys);
                 }
                 catch (IgniteCheckedException e) {
-                    throw new CacheException(e);
+                    throw new CacheException(e.getMessage(), e);
                 }
             }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/785bf106/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheBasicApiAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheBasicApiAbstractTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheBasicApiAbstractTest.java
index 2e5d00e..62f64ca 100644
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheBasicApiAbstractTest.java
+++ b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheBasicApiAbstractTest.java
@@ -41,6 +41,7 @@ import static org.apache.ignite.events.IgniteEventType.*;
 /**
  * Test cases for multi-threaded tests.
  */
+@SuppressWarnings("LockAcquiredButNotSafelyReleased")
 public abstract class GridCacheBasicApiAbstractTest extends GridCommonAbstractTest {
     /** Grid. */
     private Ignite ignite;
@@ -129,6 +130,8 @@ public abstract class GridCacheBasicApiAbstractTest extends GridCommonAbstractTe
 
         Lock lock = cache.lock(1);
 
+        lock.lock();
+
         assert cache.isLocked(1);
         assert cache.isLockedByThread(1);
 
@@ -182,7 +185,7 @@ public abstract class GridCacheBasicApiAbstractTest extends GridCommonAbstractTe
             assert cache.isLockedByThread(key);
 
             try {
-                assert "1".equals(cache.remove(key));
+                assert "1".equals(cache.getAndRemove(key));
             }
             finally {
                 cache.lock(key).unlock();
@@ -432,7 +435,6 @@ public abstract class GridCacheBasicApiAbstractTest extends GridCommonAbstractTe
 
             info("Stop latch wait 3");
 
-            assert cache.containsKey(key);
             assert cache.isLocked(key);
         }
         finally {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/785bf106/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridCachePartitionedLockSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridCachePartitionedLockSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridCachePartitionedLockSelfTest.java
index 24d84ea..a0be693 100644
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridCachePartitionedLockSelfTest.java
+++ b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridCachePartitionedLockSelfTest.java
@@ -28,6 +28,7 @@ import org.gridgain.grid.kernal.processors.cache.distributed.*;
 import org.gridgain.grid.util.typedef.*;
 import org.gridgain.testframework.*;
 
+import javax.cache.*;
 import java.util.*;
 import java.util.concurrent.*;
 
@@ -76,13 +77,13 @@ public class GridCachePartitionedLockSelfTest extends GridCacheLockAbstractTest
             @Override public Object call() throws Exception {
                 return cache.lock(1).tryLock(Long.MAX_VALUE, TimeUnit.MILLISECONDS);
             }
-        }, IgniteCheckedException.class, "Locks are not supported");
+        }, CacheException.class, "Locks are not supported");
 
         GridTestUtils.assertThrows(log, new Callable<Object>() {
             @Override public Object call() throws Exception {
                 return cache.lockAll(Collections.singleton(1)).tryLock(Long.MAX_VALUE, TimeUnit.MILLISECONDS);
             }
-        }, IgniteCheckedException.class, "Locks are not supported");
+        }, CacheException.class, "Locks are not supported");
 
         final IgniteFuture<Boolean> lockFut1 = g0.cache(null).lockAsync(1, Long.MAX_VALUE);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/785bf106/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/local/GridCacheLocalLockSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/local/GridCacheLocalLockSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/local/GridCacheLocalLockSelfTest.java
index 49a83ac..de1da2b 100644
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/local/GridCacheLocalLockSelfTest.java
+++ b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/local/GridCacheLocalLockSelfTest.java
@@ -293,7 +293,7 @@ public class GridCacheLocalLockSelfTest extends GridCommonAbstractTest {
 
                 info("Put key-value pair into cache: 1='2'");
 
-                assert "2".equals(cache.remove(1));
+                assert "2".equals(cache.getAndRemove(1));
 
                 info("Removed key from cache: 1");