ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [11/12] incubator-ignite git commit: # Merge remote-tracking branch 'remotes/origin/ignite-1' into ignite-53
Date Wed, 14 Jan 2015 11:43:41 GMT
# Merge remote-tracking branch 'remotes/origin/ignite-1' into ignite-53


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

Branch: refs/heads/ignite-53
Commit: f5039e3166b60e89c745c05607e9f83beb123a95
Parents: 84597ce 0f8d9ea
Author: sboikov <sboikov@gridgain.com>
Authored: Wed Jan 14 14:30:39 2015 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Wed Jan 14 14:30:39 2015 +0300

----------------------------------------------------------------------
 .../services/javax.cache.spi.CachingProvider    |   1 +
 .../java/org/apache/ignite/IgniteCache.java     |  39 +-
 .../org/apache/ignite/IgniteCacheMXBean.java    |  72 ++++
 .../org/apache/ignite/IgniteCacheManager.java   | 372 +++++++++++++++++++
 .../apache/ignite/IgniteCachingProvider.java    | 189 ++++++++++
 .../processors/cache/IgniteCacheProxy.java      | 183 ++++++++-
 .../grid/cache/GridCacheConfiguration.java      |  11 +-
 .../org/gridgain/grid/cache/GridCacheEntry.java |   3 +-
 .../org/gridgain/grid/kernal/GridGainEx.java    |   2 +-
 .../processors/cache/CacheInvokeEntry.java      |   3 +
 .../processors/cache/GridCacheEntryImpl.java    |   8 +
 .../cache/GridCacheEvictionEntry.java           |   8 +
 .../cache/GridCacheFilterEvaluationEntry.java   |   8 +
 .../processors/cache/GridCacheMapEntry.java     |   2 +-
 .../processors/cache/dr/GridCacheDrManager.java |   2 +-
 .../cache/dr/os/GridOsCacheDrManager.java       |   2 +-
 .../cache/query/GridCacheQueryManager.java      |   8 +
 .../GridCacheContinuousQueryEntry.java          |   8 +
 .../grid/kernal/tck/TCKMBeanServerBuilder.java  | 118 ++++++
 .../cache/IgniteCachingProviderSelfTest.java    | 131 +++++++
 .../GridCacheLoadOnlyStoreAdapterSelfTest.java  |   5 +-
 .../cache/GridCacheAbstractFullApiSelfTest.java |   2 +-
 .../cache/GridCacheAbstractSelfTest.java        |   4 +-
 .../dht/GridCacheAtomicNearCacheSelfTest.java   |   1 +
 .../dht/GridCacheGlobalLoadTest.java            | 163 ++++++++
 .../GridCachePartitionedLoadCacheSelfTest.java  |  20 +-
 .../cache/eviction/GridCacheMockEntry.java      |   8 +
 .../junits/common/GridCommonAbstractTest.java   |   7 +
 .../bamboo/GridDataGridTestSuite.java           |   1 +
 .../hadoop/jobtracker/GridHadoopJobTracker.java |   7 +-
 30 files changed, 1331 insertions(+), 57 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5039e31/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
index c6b4aba,f432c39..307bb05
--- 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
@@@ -12,10 -12,10 +12,12 @@@ package org.apache.ignite.internal.proc
  import org.apache.ignite.*;
  import org.apache.ignite.cache.*;
  import org.apache.ignite.cache.query.*;
+ import org.apache.ignite.cluster.*;
  import org.apache.ignite.lang.*;
+ import org.apache.ignite.resources.*;
  import org.gridgain.grid.cache.*;
 +import org.gridgain.grid.cache.query.GridCacheQuery;
 +import org.gridgain.grid.cache.query.GridCacheQueryFuture;
  import org.gridgain.grid.kernal.*;
  import org.gridgain.grid.kernal.processors.cache.*;
  import org.gridgain.grid.util.tostring.*;
@@@ -926,59 -997,72 +999,129 @@@ public class IgniteCacheProxy<K, V> ext
      }
  
      /**
+      *
+      */
+     private static class LoadCacheClosure<K, V> implements Callable<Void>, Externalizable
{
+         /** */
+         private static final long serialVersionUID = 0L;
+ 
+         /** */
+         private String cacheName;
+ 
+         /** */
+         private IgniteBiPredicate<K, V> p;
+ 
+         /** */
+         private Object[] args;
+ 
+         /** */
+         @IgniteInstanceResource
+         private Ignite ignite;
+ 
+         /**
+          * Required by {@link Externalizable}.
+          */
+         public LoadCacheClosure() {
+             // No-op.
+         }
+ 
+         /**
+          * @param cacheName Cache name.
+          * @param p Predicate.
+          * @param args Arguments.
+          */
+         private LoadCacheClosure(String cacheName, IgniteBiPredicate<K, V> p, Object[]
args) {
+             this.cacheName = cacheName;
+             this.p = p;
+             this.args = args;
+         }
+ 
+         /** {@inheritDoc} */
+         @Override public Void call() throws Exception {
+             IgniteCache<K, V> cache = ignite.jcache(cacheName);
+ 
+             assert cache != null : cacheName;
+ 
+             cache.localLoadCache(p, args);
+ 
+             return null;
+         }
+ 
+         /** {@inheritDoc} */
+         @Override public void writeExternal(ObjectOutput out) throws IOException {
+             out.writeObject(p);
+ 
+             out.writeObject(args);
+         }
+ 
+         /** {@inheritDoc} */
+         @SuppressWarnings("unchecked")
+         @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
{
+             p = (IgniteBiPredicate<K, V>)in.readObject();
+ 
+             args = (Object[])in.readObject();
+         }
+ 
+         /** {@inheritDoc} */
+         @Override public String toString() {
+             return S.toString(LoadCacheClosure.class, this);
+         }
+     }
++
++    /**
 +     * Iterator over the IgniteCacheProxy
 +     */
 +    private class IgniteCacheIterator implements Iterator<Cache.Entry<K, V>>
{
 +
 +        /** Cache query future for all entries in distributed ignite cache. */
 +        private final GridCacheQueryFuture<Map.Entry<K, V>> fut;
 +
 +        /** Current element from all entries in distributed ignite cache. */
 +        private Map.Entry<K, V> curIter;
 +
 +        public IgniteCacheIterator() {
 +            fut = delegate.queries().createScanQuery(null).execute();
 +        }
 +
 +        /** {@inheritDoc} */
 +        @Override public boolean hasNext() {
 +            try {
 +                curIter = fut.next();
 +                return curIter != null;
 +            }
 +            catch (IgniteCheckedException e) {
 +                throw cacheException(e);
 +            }
 +        }
 +
 +        /** {@inheritDoc} */
 +        @Override public Entry<K, V> next() {
 +            return new Cache.Entry<K, V>() {
 +                /** {@inheritDoc} */
 +                @Override public K getKey() {
 +                    return curIter.getKey();
 +                }
 +
 +                /** {@inheritDoc} */
 +                @Override public V getValue() {
 +                    return curIter.getValue();
 +                }
 +
 +                /** {@inheritDoc} */
 +                @Override public <T> T unwrap(Class<T> clazz) {
 +                    throw new IllegalArgumentException();
 +                }
 +            };
 +        }
 +
 +        /** {@inheritDoc} */
 +        @Override public void remove() {
 +            try {
 +                delegate.remove(curIter.getKey(), curIter.getValue());
 +            }
 +            catch (IgniteCheckedException e) {
 +                throw cacheException(e);
 +            }
 +        }
 +    }
  }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5039e31/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheAbstractFullApiSelfTest.java
----------------------------------------------------------------------


Mime
View raw message