ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [37/50] [abbrv] incubator-ignite git commit: #ignite-683: Rename put methods in GridCacheAdapter.
Date Tue, 14 Apr 2015 14:25:53 GMT
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b026f2cc/modules/geospatial/src/test/java/org/apache/ignite/internal/processors/query/h2/GridH2IndexingGeoSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/geospatial/src/test/java/org/apache/ignite/internal/processors/query/h2/GridH2IndexingGeoSelfTest.java
b/modules/geospatial/src/test/java/org/apache/ignite/internal/processors/query/h2/GridH2IndexingGeoSelfTest.java
index 1fcf299..9abf228 100644
--- a/modules/geospatial/src/test/java/org/apache/ignite/internal/processors/query/h2/GridH2IndexingGeoSelfTest.java
+++ b/modules/geospatial/src/test/java/org/apache/ignite/internal/processors/query/h2/GridH2IndexingGeoSelfTest.java
@@ -68,10 +68,10 @@ public class GridH2IndexingGeoSelfTest extends GridCacheAbstractSelfTest
{
 
         WKTReader r = new WKTReader();
 
-        cache.put(0, new EnemyCamp(r.read("POINT(25 75)"), "A"));
-        cache.put(1, new EnemyCamp(r.read("POINT(70 70)"), "B"));
-        cache.put(2, new EnemyCamp(r.read("POINT(70 30)"), "C"));
-        cache.put(3, new EnemyCamp(r.read("POINT(75 25)"), "D"));
+        cache.getAndPut(0, new EnemyCamp(r.read("POINT(25 75)"), "A"));
+        cache.getAndPut(1, new EnemyCamp(r.read("POINT(70 70)"), "B"));
+        cache.getAndPut(2, new EnemyCamp(r.read("POINT(70 30)"), "C"));
+        cache.getAndPut(3, new EnemyCamp(r.read("POINT(75 25)"), "D"));
 
         CacheQuery<Map.Entry<Integer, EnemyCamp>> qry = cache.queries().createSqlQuery(EnemyCamp.class,
             "coords && ?");
@@ -86,14 +86,14 @@ public class GridH2IndexingGeoSelfTest extends GridCacheAbstractSelfTest
{
         checkPoints(res, "C", "D");
 
         // Move B to the first polygon.
-        cache.put(1, new EnemyCamp(r.read("POINT(20 75)"), "B"));
+        cache.getAndPut(1, new EnemyCamp(r.read("POINT(20 75)"), "B"));
 
         res = qry.execute(r.read("POLYGON((5 70, 5 80, 30 80, 30 70, 5 70))")).get();
 
         checkPoints(res, "A", "B");
 
         // Move B to the second polygon.
-        cache.put(1, new EnemyCamp(r.read("POINT(30 30)"), "B"));
+        cache.getAndPut(1, new EnemyCamp(r.read("POINT(30 30)"), "B"));
 
         res = qry.execute(r.read("POLYGON((10 5, 10 35, 70 30, 75 25, 10 5))")).get();
 
@@ -134,7 +134,7 @@ public class GridH2IndexingGeoSelfTest extends GridCacheAbstractSelfTest
{
             int x = rnd.nextInt(1, 100);
             int y = rnd.nextInt(1, 100);
 
-            cache1.put(idx, new EnemyCamp(r.read("POINT(" + x + " " + y + ")"), Integer.toString(idx)));
+            cache1.getAndPut(idx, new EnemyCamp(r.read("POINT(" + x + " " + y + ")"), Integer.toString(idx)));
 
             points[idx] = Integer.toString(idx);
         }
@@ -159,7 +159,7 @@ public class GridH2IndexingGeoSelfTest extends GridCacheAbstractSelfTest
{
                     int x = rnd.nextInt(1, 100);
                     int y = rnd.nextInt(1, 100);
 
-                    cache.put(idx, new EnemyCamp(r.read("POINT(" + x + " " + y + ")"), Integer.toString(idx)));
+                    cache.getAndPut(idx, new EnemyCamp(r.read("POINT(" + x + " " + y + ")"),
Integer.toString(idx)));
 
                     U.sleep(50);
                 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b026f2cc/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 74cf03c..49e5121 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
@@ -275,7 +275,7 @@ public class HadoopJobTracker extends HadoopComponent {
             perfCntr.onJobPrepare(jobPrepare);
             perfCntr.onJobStart(jobStart);
 
-            if (jobMetaCache().putIfAbsent(jobId, meta) != null)
+            if (jobMetaCache().getAndPutIfAbsent(jobId, meta) != null)
                 throw new IgniteCheckedException("Failed to submit job. Job with the same
ID already exists: " + jobId);
 
             return completeFut;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b026f2cc/modules/hibernate/src/main/java/org/apache/ignite/cache/hibernate/HibernateAccessStrategyAdapter.java
----------------------------------------------------------------------
diff --git a/modules/hibernate/src/main/java/org/apache/ignite/cache/hibernate/HibernateAccessStrategyAdapter.java
b/modules/hibernate/src/main/java/org/apache/ignite/cache/hibernate/HibernateAccessStrategyAdapter.java
index b682912..28af870 100644
--- a/modules/hibernate/src/main/java/org/apache/ignite/cache/hibernate/HibernateAccessStrategyAdapter.java
+++ b/modules/hibernate/src/main/java/org/apache/ignite/cache/hibernate/HibernateAccessStrategyAdapter.java
@@ -139,7 +139,7 @@ public abstract class HibernateAccessStrategyAdapter {
      */
     protected void putFromLoad(Object key, Object val) throws CacheException {
         try {
-            cache.putx(key, val);
+            cache.put(key, val);
         }
         catch (IgniteCheckedException e) {
             throw new CacheException(e);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b026f2cc/modules/hibernate/src/main/java/org/apache/ignite/cache/hibernate/HibernateGeneralDataRegion.java
----------------------------------------------------------------------
diff --git a/modules/hibernate/src/main/java/org/apache/ignite/cache/hibernate/HibernateGeneralDataRegion.java
b/modules/hibernate/src/main/java/org/apache/ignite/cache/hibernate/HibernateGeneralDataRegion.java
index dceb79d..782dc0d 100644
--- a/modules/hibernate/src/main/java/org/apache/ignite/cache/hibernate/HibernateGeneralDataRegion.java
+++ b/modules/hibernate/src/main/java/org/apache/ignite/cache/hibernate/HibernateGeneralDataRegion.java
@@ -51,7 +51,7 @@ public class HibernateGeneralDataRegion extends HibernateRegion implements
Gener
     /** {@inheritDoc} */
     @Override public void put(Object key, Object val) throws CacheException {
         try {
-            cache.putx(key, val);
+            cache.put(key, val);
         } catch (IgniteCheckedException e) {
             throw new CacheException(e);
         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b026f2cc/modules/hibernate/src/main/java/org/apache/ignite/cache/hibernate/HibernateNonStrictAccessStrategy.java
----------------------------------------------------------------------
diff --git a/modules/hibernate/src/main/java/org/apache/ignite/cache/hibernate/HibernateNonStrictAccessStrategy.java
b/modules/hibernate/src/main/java/org/apache/ignite/cache/hibernate/HibernateNonStrictAccessStrategy.java
index acaa567..d00f818 100644
--- a/modules/hibernate/src/main/java/org/apache/ignite/cache/hibernate/HibernateNonStrictAccessStrategy.java
+++ b/modules/hibernate/src/main/java/org/apache/ignite/cache/hibernate/HibernateNonStrictAccessStrategy.java
@@ -126,7 +126,7 @@ public class HibernateNonStrictAccessStrategy extends HibernateAccessStrategyAda
     /** {@inheritDoc} */
     @Override protected boolean afterInsert(Object key, Object val) throws CacheException
{
         try {
-            cache.putx(key, val);
+            cache.put(key, val);
 
             return true;
         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b026f2cc/modules/hibernate/src/main/java/org/apache/ignite/cache/hibernate/HibernateReadOnlyAccessStrategy.java
----------------------------------------------------------------------
diff --git a/modules/hibernate/src/main/java/org/apache/ignite/cache/hibernate/HibernateReadOnlyAccessStrategy.java
b/modules/hibernate/src/main/java/org/apache/ignite/cache/hibernate/HibernateReadOnlyAccessStrategy.java
index 5502e56..10d5f91 100644
--- a/modules/hibernate/src/main/java/org/apache/ignite/cache/hibernate/HibernateReadOnlyAccessStrategy.java
+++ b/modules/hibernate/src/main/java/org/apache/ignite/cache/hibernate/HibernateReadOnlyAccessStrategy.java
@@ -70,7 +70,7 @@ public class HibernateReadOnlyAccessStrategy extends HibernateAccessStrategyAdap
     /** {@inheritDoc} */
     @Override protected boolean afterInsert(Object key, Object val) throws CacheException
{
         try {
-            cache.putx(key, val);
+            cache.put(key, val);
 
             return true;
         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b026f2cc/modules/hibernate/src/main/java/org/apache/ignite/cache/hibernate/HibernateReadWriteAccessStrategy.java
----------------------------------------------------------------------
diff --git a/modules/hibernate/src/main/java/org/apache/ignite/cache/hibernate/HibernateReadWriteAccessStrategy.java
b/modules/hibernate/src/main/java/org/apache/ignite/cache/hibernate/HibernateReadWriteAccessStrategy.java
index 72d59c6..dd5ce68 100644
--- a/modules/hibernate/src/main/java/org/apache/ignite/cache/hibernate/HibernateReadWriteAccessStrategy.java
+++ b/modules/hibernate/src/main/java/org/apache/ignite/cache/hibernate/HibernateReadWriteAccessStrategy.java
@@ -97,7 +97,7 @@ public class HibernateReadWriteAccessStrategy extends HibernateAccessStrategyAda
         boolean success = false;
 
         try {
-            cache.putx(key, val);
+            cache.put(key, val);
 
             success = true;
         }
@@ -172,7 +172,7 @@ public class HibernateReadWriteAccessStrategy extends HibernateAccessStrategyAda
             TxContext ctx = txCtx.get();
 
             if (ctx != null) {
-                cache.putx(key, val);
+                cache.put(key, val);
 
                 unlock(ctx, key);
 
@@ -202,7 +202,7 @@ public class HibernateReadWriteAccessStrategy extends HibernateAccessStrategyAda
         boolean success = false;
 
         try {
-            cache.putx(key, val);
+            cache.put(key, val);
 
             success = true;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b026f2cc/modules/hibernate/src/main/java/org/apache/ignite/cache/hibernate/HibernateTransactionalAccessStrategy.java
----------------------------------------------------------------------
diff --git a/modules/hibernate/src/main/java/org/apache/ignite/cache/hibernate/HibernateTransactionalAccessStrategy.java
b/modules/hibernate/src/main/java/org/apache/ignite/cache/hibernate/HibernateTransactionalAccessStrategy.java
index db5d9fd..6f6200b 100644
--- a/modules/hibernate/src/main/java/org/apache/ignite/cache/hibernate/HibernateTransactionalAccessStrategy.java
+++ b/modules/hibernate/src/main/java/org/apache/ignite/cache/hibernate/HibernateTransactionalAccessStrategy.java
@@ -76,7 +76,7 @@ public class HibernateTransactionalAccessStrategy extends HibernateAccessStrateg
     /** {@inheritDoc} */
     @Override protected void putFromLoad(Object key, Object val) throws CacheException {
         try {
-            cache.putx(key, val);
+            cache.put(key, val);
         }
         catch (IgniteCheckedException e) {
             throw new CacheException(e);
@@ -96,7 +96,7 @@ public class HibernateTransactionalAccessStrategy extends HibernateAccessStrateg
     /** {@inheritDoc} */
     @Override protected boolean update(Object key, Object val) throws CacheException {
         try {
-            cache.putx(key, val);
+            cache.put(key, val);
 
             return true;
         }
@@ -113,7 +113,7 @@ public class HibernateTransactionalAccessStrategy extends HibernateAccessStrateg
     /** {@inheritDoc} */
     @Override protected boolean insert(Object key, Object val) throws CacheException {
         try {
-            cache.putx(key, val);
+            cache.put(key, val);
 
             return true;
         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b026f2cc/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 8cb04f2..7f6619a 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
@@ -177,7 +177,7 @@ public abstract class GridCacheAbstractFieldsQuerySelfTest extends GridCommonAbs
     /** @throws Exception If failed. */
     public void testCacheMetaData() throws Exception {
         // Put internal key to test filtering of internal objects.
-        ((IgniteKernal)grid(0)).getCache(null).put(new GridCacheInternalKeyImpl("LONG"),
new GridCacheAtomicLongValue(0));
+        ((IgniteKernal)grid(0)).getCache(null).getAndPut(new GridCacheInternalKeyImpl("LONG"),
new GridCacheAtomicLongValue(0));
 
         try {
             Collection<GridCacheSqlMetadata> metas =
@@ -767,7 +767,7 @@ public abstract class GridCacheAbstractFieldsQuerySelfTest extends GridCommonAbs
         GridCacheAdapter<Integer, Integer> cache = ((IgniteKernal)grid(0)).internalCache(CACHE);
 
         for (int i = 0; i < 200; i++)
-            cache.put(i, i);
+            cache.getAndPut(i, i);
 
         CacheQuery<List<?>> qry =
             cache.queries().createSqlFieldsQuery("select * from Integer").projection(grid(0).cluster());
@@ -785,7 +785,7 @@ public abstract class GridCacheAbstractFieldsQuerySelfTest extends GridCommonAbs
         
         GridCacheAdapter<Object, Object> cache = ((IgniteKernal)grid(0)).internalCache(CACHE_NO_PRIMITIVES);
 
-        cache.put("key", "val");
+        cache.getAndPut("key", "val");
 
         Collection<GridCacheSqlMetadata> metas = ((GridCacheQueriesEx<?, ?>)cache.queries()).sqlMetadata();
 
@@ -812,7 +812,7 @@ public abstract class GridCacheAbstractFieldsQuerySelfTest extends GridCommonAbs
         PersonKey key = new PersonKey(id);
         Person val = new Person("John", 20, 1);
 
-        cache.put(key, val);
+        cache.getAndPut(key, val);
 
         Collection<GridCacheSqlMetadata> metas = ((GridCacheQueriesEx<?, ?>)cache.queries()).sqlMetadata();
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b026f2cc/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 cc5f914..f5c9d22 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
@@ -305,7 +305,7 @@ public class GridCacheCrossCacheQuerySelfTest extends GridCommonAbstractTest
{
 
             DimStore v = new DimStore(id, "Store" + id);
 
-            dimCache.put(id, v);
+            dimCache.getAndPut(id, v);
 
             dimStores.add(v);
         }
@@ -315,7 +315,7 @@ public class GridCacheCrossCacheQuerySelfTest extends GridCommonAbstractTest
{
 
             DimProduct v = new DimProduct(id, "Product" + id);
 
-            dimCache.put(id, v);
+            dimCache.getAndPut(id, v);
 
             dimProds.add(v);
         }
@@ -340,7 +340,7 @@ public class GridCacheCrossCacheQuerySelfTest extends GridCommonAbstractTest
{
             DimStore store = dimStores.get(i % dimStores.size());
             DimProduct prod = dimProds.get(i % dimProds.size());
 
-            factCache.put(id, new FactPurchase(id, prod.getId(), store.getId(), i + 5));
+            factCache.getAndPut(id, new FactPurchase(id, prod.getId(), store.getId(), i +
5));
         }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b026f2cc/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReduceQueryMultithreadedSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReduceQueryMultithreadedSelfTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReduceQueryMultithreadedSelfTest.java
index 2dfa542..d2a626a 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReduceQueryMultithreadedSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReduceQueryMultithreadedSelfTest.java
@@ -88,7 +88,7 @@ public class GridCacheReduceQueryMultithreadedSelfTest extends GridCacheAbstract
         IgniteInternalFuture<?> fut1 = multithreadedAsync(new Callable() {
             @Override public Object call() throws Exception {
                 for (int i = 1; i < keyCnt; i++) {
-                    c.put(String.valueOf(i), i);
+                    c.getAndPut(String.valueOf(i), i);
 
                     startLatch.countDown();
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b026f2cc/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridIndexingWithNoopSwapSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridIndexingWithNoopSwapSelfTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridIndexingWithNoopSwapSelfTest.java
index b9bd6df..a24ef68 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridIndexingWithNoopSwapSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridIndexingWithNoopSwapSelfTest.java
@@ -96,7 +96,7 @@ public class GridIndexingWithNoopSwapSelfTest extends GridCommonAbstractTest
{
         int cnt = 10;
 
         for (int i = 0; i < cnt; i++)
-            cache.put(i, new ObjectValue("test" + i, i));
+            cache.getAndPut(i, new ObjectValue("test" + i, i));
 
         for (int i = 0; i < cnt; i++) {
             assertNotNull(localPeek(cache, i));


Mime
View raw message