#ignite-758: small fixes.

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

Branch: refs/heads/ignite-737
Commit: a64810a32ffa0446bc0f84bb3379b5b693248870
Parents: e3e263b
Author: ivasilinets <ivasilin...@gridgain.com>
Authored: Fri Apr 17 15:09:52 2015 +0300
Committer: ivasilinets <ivasilin...@gridgain.com>
Committed: Fri Apr 17 15:09:52 2015 +0300

----------------------------------------------------------------------
 .../processors/cache/CacheOperationContext.java |  4 +-
 .../processors/cache/GridCacheAdapter.java      | 16 ++---
 .../cache/GridCacheConcurrentMap.java           | 14 ++---
 .../processors/cache/GridCacheContext.java      |  8 +--
 .../processors/cache/GridCacheProcessor.java    |  5 +-
 .../cache/query/GridCacheQueryManager.java      | 64 ++++++++++----------
 .../cache/hibernate/HibernateRegionFactory.java |  2 +-
 .../GridCacheAbstractFieldsQuerySelfTest.java   | 10 +--
 .../cache/GridCacheCrossCacheQuerySelfTest.java |  7 +--
 9 files changed, 64 insertions(+), 66 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a64810a3/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOperationContext.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOperationContext.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOperationContext.java
index 3c64a50..34d2bf4 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOperationContext.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOperationContext.java
@@ -36,13 +36,13 @@ public class CacheOperationContext implements Serializable {
     @GridToStringInclude
     private final boolean skipStore;
 
-    /** Client ID which operates over this projection, if any, */
+    /** Client ID which operates over this projection. */
     private final UUID subjId;
 
     /** Keep portable flag. */
     private final boolean keepPortable;
 
-    /** Expiricy policy. */
+    /** Expiry policy. */
     private final ExpiryPolicy expiryPlc;
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a64810a3/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
index a860503..694f3d8 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
@@ -363,9 +363,9 @@ public abstract class GridCacheAdapter<K, V> implements 
IgniteInternalCache<K, V
 
     /** {@inheritDoc} */
     @Override public GridCacheProxyImpl<K, V> forSubjectId(UUID subjId) {
-        CacheOperationContext prj = new CacheOperationContext(false, subjId, 
false, null);
+        CacheOperationContext opCtx = new CacheOperationContext(false, subjId, 
false, null);
 
-        return new GridCacheProxyImpl<>(ctx, this, prj);
+        return new GridCacheProxyImpl<>(ctx, this, opCtx);
     }
 
     /** {@inheritDoc} */
@@ -375,16 +375,16 @@ public abstract class GridCacheAdapter<K, V> implements 
IgniteInternalCache<K, V
 
     /** {@inheritDoc} */
     @Override public GridCacheProxyImpl<K, V> setSkipStore(boolean skipStore) {
-        CacheOperationContext prj = new CacheOperationContext(true, null, 
false, null);
+        CacheOperationContext opCtx = new CacheOperationContext(true, null, 
false, null);
 
-        return new GridCacheProxyImpl<>(ctx, this, prj);
+        return new GridCacheProxyImpl<>(ctx, this, opCtx);
     }
 
     /** {@inheritDoc} */
     @Override public <K1, V1> GridCacheProxyImpl<K1, V1> keepPortable() {
-        CacheOperationContext prj = new CacheOperationContext(false, null, 
true, null);
+        CacheOperationContext opCtx = new CacheOperationContext(false, null, 
true, null);
 
-        return new GridCacheProxyImpl<>((GridCacheContext<K1, V1>)ctx, 
(GridCacheAdapter<K1, V1>)this, prj);
+        return new GridCacheProxyImpl<>((GridCacheContext<K1, V1>)ctx, 
(GridCacheAdapter<K1, V1>)this, opCtx);
     }
 
 
@@ -395,9 +395,9 @@ public abstract class GridCacheAdapter<K, V> implements 
IgniteInternalCache<K, V
 
     /** {@inheritDoc} */
     @Override public GridCacheProxyImpl<K, V> withExpiryPolicy(ExpiryPolicy 
plc) {
-        CacheOperationContext prj = new CacheOperationContext(false, null, 
false, plc);
+        CacheOperationContext opCtx = new CacheOperationContext(false, null, 
false, plc);
 
-        return new GridCacheProxyImpl<>(ctx, this, prj);
+        return new GridCacheProxyImpl<>(ctx, this, opCtx);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a64810a3/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java
index 6b3d7ad..bd3e0f2 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java
@@ -1963,7 +1963,7 @@ public class GridCacheConcurrentMap {
         private GridCacheContext<K, V> ctx;
 
         /** */
-        private CacheOperationContext prjPerCall;
+        private CacheOperationContext opCtxPerCall;
 
         /**
          * Empty constructor required for {@link Externalizable}.
@@ -1976,17 +1976,17 @@ public class GridCacheConcurrentMap {
          * @param map Cache map.
          * @param filter Entry filter.
          * @param ctx Cache context.
-         * @param prjPerCall Projection per call.
+         * @param opCtxPerCall Operation context per call.
          */
         EntryIterator(
             GridCacheConcurrentMap map,
             CacheEntryPredicate[] filter,
             GridCacheContext<K, V> ctx,
-            CacheOperationContext prjPerCall) {
+            CacheOperationContext opCtxPerCall) {
             it = new Iterator0<>(map, false, filter, -1, -1);
 
             this.ctx = ctx;
-            this.prjPerCall = prjPerCall;
+            this.opCtxPerCall = opCtxPerCall;
         }
 
         /** {@inheritDoc} */
@@ -1998,7 +1998,7 @@ public class GridCacheConcurrentMap {
         @Override public Cache.Entry<K, V> next() {
             CacheOperationContext old = ctx.operationContextPerCall();
 
-            ctx.operationContextPerCall(prjPerCall);
+            ctx.operationContextPerCall(opCtxPerCall);
 
             try {
                 return it.next().wrapLazyValue();
@@ -2017,7 +2017,7 @@ public class GridCacheConcurrentMap {
         @Override public void writeExternal(ObjectOutput out) throws 
IOException {
             out.writeObject(it);
             out.writeObject(ctx);
-            out.writeObject(prjPerCall);
+            out.writeObject(opCtxPerCall);
         }
 
         /** {@inheritDoc} */
@@ -2025,7 +2025,7 @@ public class GridCacheConcurrentMap {
         @Override public void readExternal(ObjectInput in) throws IOException, 
ClassNotFoundException {
             it = (Iterator0<K, V>)in.readObject();
             ctx = (GridCacheContext<K, V>)in.readObject();
-            prjPerCall = (CacheOperationContext)in.readObject();
+            opCtxPerCall = (CacheOperationContext)in.readObject();
         }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a64810a3/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
index a9988d2..2e62290 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
@@ -155,8 +155,8 @@ public class GridCacheContext<K, V> implements 
Externalizable {
     private ClusterNode locNode;
 
     /**
-     * Thread local projection. If it's set it means that method call was 
initiated
-     * by child projection of initial cache.
+     * Thread local operation context. If it's set it means that method call 
was initiated
+     * by child internal cache of initial cache.
      */
     private ThreadLocal<CacheOperationContext> opCtxPerCall = new 
ThreadLocal<>();
 
@@ -1285,7 +1285,7 @@ public class GridCacheContext<K, V> implements 
Externalizable {
     public Runnable projectSafe(final Runnable r) {
         assert r != null;
 
-        // Have to get projection per call used by calling thread to use it in 
a new thread.
+        // Have to get operation context per call used by calling thread to 
use it in a new thread.
         final CacheOperationContext opCtx = operationContextPerCall();
 
         if (opCtx == null)
@@ -1320,7 +1320,7 @@ public class GridCacheContext<K, V> implements 
Externalizable {
     public <T> Callable<T> projectSafe(final Callable<T> r) {
         assert r != null;
 
-        // Have to get projection per call used by calling thread to use it in 
a new thread.
+        // Have to get operation context per call used by calling thread to 
use it in a new thread.
         final CacheOperationContext opCtx = operationContextPerCall();
 
         if (opCtx == null)

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a64810a3/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
index fda420d..c270078 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
@@ -2451,7 +2451,8 @@ public class GridCacheProcessor extends 
GridProcessorAdapter {
      * @return All configured cache instances.
      */
     public Collection<IgniteInternalCache<?, ?>> caches() {
-        return F.viewReadOnly(jCacheProxies.values(), new 
IgniteClosure<IgniteCacheProxy<?, ?>, IgniteInternalCache<?, ?>>() {
+        return F.viewReadOnly(jCacheProxies.values(), new 
IgniteClosure<IgniteCacheProxy<?, ?>,
+            IgniteInternalCache<?, ?>>() {
             @Override public IgniteInternalCache<?, ?> 
apply(IgniteCacheProxy<?, ?> entries) {
                 return entries.legacyProxy();
             }
@@ -2514,7 +2515,7 @@ public class GridCacheProcessor extends 
GridProcessorAdapter {
         if (jcache == null)
             throw new IllegalArgumentException("Cache is not started: " + 
name);
 
-        return jcache.delegate();
+        return jcache.legacyProxy();
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a64810a3/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
index e158e4e..16063af 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
@@ -2907,12 +2907,12 @@ public abstract class GridCacheQueryManager<K, V> 
extends GridCacheManagerAdapte
      */
     public <R> CacheQuery<R> createSpiQuery(boolean keepPortable) {
         return new GridCacheQueryAdapter<>(cctx,
-                SPI,
-                null,
-                null,
-                null,
-                false,
-                keepPortable);
+            SPI,
+            null,
+            null,
+            null,
+            false,
+            keepPortable);
     }
 
     /**
@@ -2924,14 +2924,14 @@ public abstract class GridCacheQueryManager<K, V> 
extends GridCacheManagerAdapte
      */
     @SuppressWarnings("unchecked")
     public CacheQuery<Map.Entry<K, V>> createScanQuery(@Nullable 
IgniteBiPredicate<K, V> filter,
-                                                       boolean keepPortable) {
+        boolean keepPortable) {
         return new GridCacheQueryAdapter<>(cctx,
-                SCAN,
-                null,
-                null,
-                (IgniteBiPredicate<Object, Object>)filter,
-                false,
-                keepPortable);
+            SCAN,
+            null,
+            null,
+            (IgniteBiPredicate<Object, Object>)filter,
+            false,
+            keepPortable);
     }
 
     /**
@@ -2944,17 +2944,17 @@ public abstract class GridCacheQueryManager<K, V> 
extends GridCacheManagerAdapte
      * @return Created query.
      */
     public CacheQuery<Map.Entry<K, V>> createFullTextQuery(String clsName,
-                                                           String search, 
boolean keepPortable) {
+        String search, boolean keepPortable) {
         A.notNull("clsName", clsName);
         A.notNull("search", search);
 
         return new GridCacheQueryAdapter<>(cctx,
-                TEXT,
-                clsName,
-                search,
-                null,
-                false,
-                keepPortable);
+            TEXT,
+            clsName,
+            search,
+            null,
+            false,
+            keepPortable);
     }
 
     /**
@@ -2969,12 +2969,12 @@ public abstract class GridCacheQueryManager<K, V> 
extends GridCacheManagerAdapte
         A.notNull(qry, "qry");
 
         return new GridCacheQueryAdapter<>(cctx,
-                SQL_FIELDS,
-                null,
-                qry,
-                null,
-                false,
-                keepPortable);
+            SQL_FIELDS,
+            null,
+            qry,
+            null,
+            false,
+            keepPortable);
     }
 
     /**
@@ -2989,11 +2989,11 @@ public abstract class GridCacheQueryManager<K, V> 
extends GridCacheManagerAdapte
         assert qry != null;
 
         return new GridCacheQueryAdapter<>(cctx,
-                SQL_FIELDS,
-                null,
-                qry,
-                null,
-                incMeta,
-                keepPortable);
+            SQL_FIELDS,
+            null,
+            qry,
+            null,
+            incMeta,
+            keepPortable);
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a64810a3/modules/hibernate/src/main/java/org/apache/ignite/cache/hibernate/HibernateRegionFactory.java
----------------------------------------------------------------------
diff --git 
a/modules/hibernate/src/main/java/org/apache/ignite/cache/hibernate/HibernateRegionFactory.java
 
b/modules/hibernate/src/main/java/org/apache/ignite/cache/hibernate/HibernateRegionFactory.java
index 699f227..8d67643 100644
--- 
a/modules/hibernate/src/main/java/org/apache/ignite/cache/hibernate/HibernateRegionFactory.java
+++ 
b/modules/hibernate/src/main/java/org/apache/ignite/cache/hibernate/HibernateRegionFactory.java
@@ -47,7 +47,7 @@ import static org.hibernate.cache.spi.access.AccessType.*;
  * <pre name="code" class="brush: xml; gutter: false;">
  * org.apache.ignite.hibernate.grid_name=&lt;grid name&gt;
  * </pre>
- * Each Hibernate cache region must be associated with some {@link 
org.apache.ignite.internal.processors.cache.IgniteInternalCache}, by default it 
is assumed that
+ * Each Hibernate cache region must be associated with some {@link 
IgniteInternalCache}, by default it is assumed that
  * for each cache region there is a {@link IgniteInternalCache} with the same 
name. Also it is possible to define
  * region to cache mapping using properties with prefix {@code 
org.apache.ignite.hibernate.region_cache}.
  * For example if for region with name "region1" cache with name "cache1" 
should be used then following

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a64810a3/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFieldsQuerySelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFieldsQuerySelfTest.java
 
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFieldsQuerySelfTest.java
index 55ad281..062b429 100644
--- 
a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFieldsQuerySelfTest.java
+++ 
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFieldsQuerySelfTest.java
@@ -659,7 +659,7 @@ public abstract class GridCacheAbstractFieldsQuerySelfTest 
extends GridCommonAbs
     /** @throws Exception If failed. */
     public void testQueryString() throws Exception {
         CacheQuery<List<?>> qry = 
((IgniteKernal)grid(0)).getCache(null).context().queries().
-                createSqlFieldsQuery("select * from String", false);
+            createSqlFieldsQuery("select * from String", false);
 
         Collection<List<?>> res = qry.execute().get();
 
@@ -867,7 +867,7 @@ public abstract class GridCacheAbstractFieldsQuerySelfTest 
extends GridCommonAbs
         }
 
         Collection<List<?>> res = cache.context().queries().
-                createSqlFieldsQuery("select * from Person", 
false).execute().get();
+            createSqlFieldsQuery("select * from Person", 
false).execute().get();
 
         assertEquals(1, res.size());
 
@@ -911,7 +911,7 @@ public abstract class GridCacheAbstractFieldsQuerySelfTest 
extends GridCommonAbs
      */
     private void testPaginationIterator(@Nullable String cacheName) throws 
Exception {
         CacheQuery<List<?>> q = 
((IgniteKernal)grid(0)).getCache(cacheName).context().queries().
-                createSqlFieldsQuery("select _key, _val from " + "Integer", 
false)
+            createSqlFieldsQuery("select _key, _val from " + "Integer", false)
             .projection(grid(0).cluster());
 
         q.pageSize(10);
@@ -944,7 +944,7 @@ public abstract class GridCacheAbstractFieldsQuerySelfTest 
extends GridCommonAbs
     /** @throws Exception If failed. */
     public void testPaginationIteratorKeepAll() throws Exception {
         CacheQuery<List<?>> q = 
((IgniteKernal)grid(0)).getCache(null).context().queries().
-                createSqlFieldsQuery("select _key, _val from Integer", false);
+            createSqlFieldsQuery("select _key, _val from Integer", false);
 
         q.pageSize(10);
         q.keepAll(true);
@@ -1003,7 +1003,7 @@ public abstract class 
GridCacheAbstractFieldsQuerySelfTest extends GridCommonAbs
      */
     private void testPaginationGet(@Nullable String cacheName) throws 
Exception {
         CacheQuery<List<?>> q = 
((IgniteKernal)grid(0)).getCache(cacheName).context().queries().
-                createSqlFieldsQuery("select _key, _val from " + "Integer", 
false);
+            createSqlFieldsQuery("select _key, _val from " + "Integer", false);
 
         q.pageSize(10);
         q.keepAll(true);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a64810a3/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheCrossCacheQuerySelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheCrossCacheQuerySelfTest.java
 
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheCrossCacheQuerySelfTest.java
index 12a4af9..4e9bf31 100644
--- 
a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheCrossCacheQuerySelfTest.java
+++ 
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheCrossCacheQuerySelfTest.java
@@ -206,8 +206,7 @@ public class GridCacheCrossCacheQuerySelfTest extends 
GridCommonAbstractTest {
         int top = 6;
 
         qry = new SqlFieldsQuery("select top 3 distinct productId " +
-            "from FactPurchase f " +
-            "order by productId desc ");
+            "from FactPurchase f order by productId desc ");
 
         for (List<?> o : qryProc.queryTwoStep(cache.context(), qry).getAll()) {
             X.println("___ -> " + o);
@@ -220,9 +219,7 @@ public class GridCacheCrossCacheQuerySelfTest extends 
GridCommonAbstractTest {
         top = 5;
 
         qry = new SqlFieldsQuery("select distinct productId " +
-            "from FactPurchase f " +
-            "order by productId desc " +
-            "limit 2 offset 1");
+            "from FactPurchase f order by productId desc limit 2 offset 1");
 
         for (List<?> o : qryProc.queryTwoStep(cache.context(), qry).getAll()) {
             X.println("___ -> " + o);

Reply via email to