Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-629-1 50998c504 -> 67bb43aaf


#ignite-611: Remove projection from code.


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

Branch: refs/heads/ignite-629-1
Commit: 0351668feeac3ee4bca756866d363c25f0465297
Parents: ea90377
Author: ivasilinets <[email protected]>
Authored: Thu Mar 26 18:24:25 2015 +0300
Committer: ivasilinets <[email protected]>
Committed: Thu Mar 26 18:24:25 2015 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCacheProcessor.java    |  3 +-
 .../CacheDataStructuresManager.java             |  4 +-
 .../GridCacheConcurrentTxMultiNodeTest.java     | 28 -----------
 ...achePartitionedMultiNodeFullApiSelfTest.java | 22 ---------
 .../hadoop/jobtracker/HadoopJobTracker.java     | 11 ++---
 .../cache/GridCacheCrossCacheQuerySelfTest.java | 52 +++++++-------------
 6 files changed, 26 insertions(+), 94 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0351668f/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 c918ed4..caeead6 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
@@ -2189,7 +2189,8 @@ public class GridCacheProcessor extends 
GridProcessorAdapter {
      * @return Projection over utility cache.
      */
     public <K extends GridCacheUtilityKey, V> GridCacheProjectionEx<K, V> 
utilityCache(Class<K> keyCls, Class<V> valCls) {
-        return (GridCacheProjectionEx<K, 
V>)cache(CU.UTILITY_CACHE_NAME).projection(keyCls, valCls);
+        GridCache<K, V> cache = cache(CU.UTILITY_CACHE_NAME);
+        return (GridCacheProjectionEx<K, V>)cache;
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0351668f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java
index 2de56b5..ac48b03 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java
@@ -56,7 +56,7 @@ public class CacheDataStructuresManager extends 
GridCacheManagerAdapter {
     private final ConcurrentMap<IgniteUuid, GridCacheQueueProxy> queuesMap;
 
     /** Queue header view.  */
-    private CacheProjection<GridCacheQueueHeaderKey, GridCacheQueueHeader> 
queueHdrView;
+    private GridCache<GridCacheQueueHeaderKey, GridCacheQueueHeader> 
queueHdrView;
 
     /** Query notifying about queue update. */
     private UUID queueQryId;
@@ -85,7 +85,7 @@ public class CacheDataStructuresManager extends 
GridCacheManagerAdapter {
     /** {@inheritDoc} */
     @Override protected void onKernalStart0() throws IgniteCheckedException {
         try {
-            queueHdrView = 
cctx.cache().projection(GridCacheQueueHeaderKey.class, 
GridCacheQueueHeader.class);
+            queueHdrView = cctx.grid().cachex(cctx.name());
 
             initFlag = true;
         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0351668f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentTxMultiNodeTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentTxMultiNodeTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentTxMultiNodeTest.java
index c2f69ce..79339cd 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentTxMultiNodeTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentTxMultiNodeTest.java
@@ -670,34 +670,6 @@ public class GridCacheConcurrentTxMultiNodeTest extends 
GridCommonAbstractTest {
         }
 
         /**
-         * @param msgId Message ID.
-         * @return Request.
-         */
-        private Request findRequestWithMessageId(Long msgId) {
-            CacheProjection<Object, Request> cache = 
((IgniteKernal)ignite).getCache(null).projection(Object.class, Request.class);
-
-            CacheQuery<Map.Entry<Object, Request>> qry = 
cache.queries().createSqlQuery(
-                Request.class, "messageId = ?");
-
-            try {
-                // taking out localNode() doesn't change the eviction timeout 
future
-                // problem
-                Map.Entry<Object, Request> entry =
-                    
F.first(qry.projection(ignite.cluster().forLocal()).execute(msgId).get());
-
-                if (entry == null)
-                    return null;
-
-                return entry.getValue();
-            }
-            catch (IgniteCheckedException e) {
-                e.printStackTrace();
-
-                return null;
-            }
-        }
-
-        /**
          * @param o Object to put.
          * @param cacheKey Cache key.
          * @param terminalId Terminal ID.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0351668f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMultiNodeFullApiSelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMultiNodeFullApiSelfTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMultiNodeFullApiSelfTest.java
index 2502942..0c1977e 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMultiNodeFullApiSelfTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMultiNodeFullApiSelfTest.java
@@ -332,28 +332,6 @@ public class GridCachePartitionedMultiNodeFullApiSelfTest 
extends GridCacheParti
 
         assertEquals(nearEnabled() ? 2 : 0, cache2.nearSize());
         assertEquals(0, cache2.size() - cache2.nearSize());
-
-        CacheEntryPredicate prjFilter = new CacheEntryPredicateAdapter() {
-            @Override public boolean apply(GridCacheEntryEx e) {
-                try {
-                    Integer val = CU.value(e.rawGetOrUnmarshal(false), 
e.context(), false);
-
-                    return val != null && val >= 1 && val <= 3;
-                }
-                catch (IgniteCheckedException err) {
-                    throw new IgniteException(err);
-                }
-            }
-        };
-
-        assertEquals(0, cache0.projection(prjFilter).nearSize());
-        assertEquals(3, cache0.projection(prjFilter).size() - 
cache0.projection(prjFilter).nearSize());
-
-        assertEquals(0, cache1.projection(prjFilter).nearSize());
-        assertEquals(3, cache1.projection(prjFilter).size() - 
cache1.projection(prjFilter).nearSize());
-
-        assertEquals(nearEnabled() ? 1 : 0, 
cache2.projection(prjFilter).nearSize());
-        assertEquals(0, cache2.projection(prjFilter).size() - 
cache2.projection(prjFilter).nearSize());
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0351668f/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/jobtracker/HadoopJobTracker.java
----------------------------------------------------------------------
diff --git 
a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/jobtracker/HadoopJobTracker.java
 
b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/jobtracker/HadoopJobTracker.java
index 9e959a2..973b731 100644
--- 
a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/jobtracker/HadoopJobTracker.java
+++ 
b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/jobtracker/HadoopJobTracker.java
@@ -57,7 +57,7 @@ public class HadoopJobTracker extends HadoopComponent {
     private final GridMutex mux = new GridMutex();
 
     /** */
-    private volatile GridCacheProjectionEx<HadoopJobId, HadoopJobMetadata> 
jobMetaPrj;
+    private volatile GridCacheAdapter<HadoopJobId, HadoopJobMetadata> 
jobMetaPrj;
 
     /** Projection with expiry policy for finished job updates. */
     private volatile GridCacheProjectionEx<HadoopJobId, HadoopJobMetadata> 
finishedJobMetaPrj;
@@ -108,13 +108,13 @@ public class HadoopJobTracker extends HadoopComponent {
      */
     @SuppressWarnings("NonPrivateFieldAccessedInSynchronizedContext")
     private GridCacheProjectionEx<HadoopJobId, HadoopJobMetadata> 
jobMetaCache() {
-        GridCacheProjectionEx<HadoopJobId, HadoopJobMetadata> prj = jobMetaPrj;
+        GridCacheAdapter<HadoopJobId, HadoopJobMetadata> prj = jobMetaPrj;
 
         if (prj == null) {
             synchronized (mux) {
                 if ((prj = jobMetaPrj) == null) {
-                    CacheProjection<Object, Object> sysCache = 
ctx.kernalContext().cache()
-                        .cache(CU.SYS_CACHE_HADOOP_MR);
+                    GridCacheAdapter<HadoopJobId, HadoopJobMetadata> sysCache 
= ctx.kernalContext().cache()
+                        .internalCache(CU.SYS_CACHE_HADOOP_MR);
 
                     assert sysCache != null;
 
@@ -129,8 +129,7 @@ public class HadoopJobTracker extends HadoopComponent {
                         throw new IllegalStateException(e);
                     }
 
-                    jobMetaPrj = prj = (GridCacheProjectionEx<HadoopJobId, 
HadoopJobMetadata>)
-                        sysCache.projection(HadoopJobId.class, 
HadoopJobMetadata.class);
+                    jobMetaPrj = prj = sysCache;
 
                     if (ctx.configuration().getFinishedJobInfoTtl() > 0) {
                         ExpiryPolicy finishedJobPlc = new ModifiedExpiryPolicy(

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0351668f/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 50ca5b4..cc5f914 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
@@ -294,36 +294,42 @@ public class GridCacheCrossCacheQuerySelfTest extends 
GridCommonAbstractTest {
     private void fillCaches() throws IgniteCheckedException {
         int idGen = 0;
 
-        GridCache<Integer, Object> dimCache = 
((IgniteKernal)ignite).getCache("replicated");
+        GridCacheAdapter<Integer, Object> dimCache = 
((IgniteKernal)ignite).internalCache("replicated");
+
+        List<DimStore> dimStores = new ArrayList<>();
+
+        List<DimProduct> dimProds = new ArrayList<>();
 
         for (int i = 0; i < 2; i++) {
             int id = idGen++;
 
-            dimCache.put(id, new DimStore(id, "Store" + id));
+            DimStore v = new DimStore(id, "Store" + id);
+
+            dimCache.put(id, v);
+
+            dimStores.add(v);
         }
 
         for (int i = 0; i < 5; i++) {
             int id = idGen++;
 
-            dimCache.put(id, new DimProduct(id, "Product" + id));
-        }
+            DimProduct v = new DimProduct(id, "Product" + id);
+
+            dimCache.put(id, v);
 
-        CacheProjection<Integer, DimStore> stores = 
dimCache.projection(Integer.class, DimStore.class);
-        CacheProjection<Integer, DimProduct> prods = 
dimCache.projection(Integer.class, DimProduct.class);
+            dimProds.add(v);
+        }
 
-        GridCache<Integer, FactPurchase> factCache = 
((IgniteKernal)ignite).getCache("partitioned");
+        GridCacheAdapter<Integer, FactPurchase> factCache = 
((IgniteKernal)ignite).internalCache("partitioned");
 
-        List<DimStore> dimStores = new ArrayList<>(stores.values());
         Collections.sort(dimStores, new Comparator<DimStore>() {
             @Override public int compare(DimStore o1, DimStore o2) {
                 return o1.getId() > o2.getId() ? 1 : o1.getId() < o2.getId() ? 
-1 : 0;
             }
         });
 
-        List<DimProduct> dimProds = new ArrayList<>(prods.values());
         Collections.sort(dimProds, new Comparator<DimProduct>() {
-            @Override
-            public int compare(DimProduct o1, DimProduct o2) {
+            @Override public int compare(DimProduct o1, DimProduct o2) {
                 return o1.getId() > o2.getId() ? 1 : o1.getId() < o2.getId() ? 
-1 : 0;
             }
         });
@@ -339,30 +345,6 @@ public class GridCacheCrossCacheQuerySelfTest extends 
GridCommonAbstractTest {
     }
 
     /**
-     * Fills the caches with data and executes the query.
-     *
-     * @param prj Cache projection.
-     * @throws Exception If failed.
-     * @return Result.
-     */
-    private List<Map.Entry<Integer, FactPurchase>> 
body(CacheProjection<Integer, FactPurchase> prj)
-        throws Exception {
-        CacheQuery<Map.Entry<Integer, FactPurchase>> qry = (prj == null ?
-            ((IgniteKernal)ignite)
-                .<Integer, FactPurchase>getCache("partitioned") : 
prj).queries().createSqlQuery(FactPurchase.class,
-            "from \"replicated\".DimStore, \"partitioned\".FactPurchase where 
DimStore.id = FactPurchase.storeId");
-
-        List<Map.Entry<Integer, FactPurchase>> res = new 
ArrayList<>(qry.execute().get());
-        Collections.sort(res, new Comparator<Map.Entry<Integer, 
FactPurchase>>() {
-            @Override public int compare(Map.Entry<Integer, FactPurchase> o1, 
Map.Entry<Integer, FactPurchase> o2) {
-                return o1.getKey() > o2.getKey() ? 1 : o1.getKey() < 
o2.getKey() ? -1 : 0;
-            }
-        });
-
-        return res;
-    }
-
-    /**
      * Checks result.
      * @param res Result to check.
      */

Reply via email to