ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [13/50] incubator-ignite git commit: #ignite-683: Remove unused class GridCacheMapAdapter.
Date Mon, 13 Apr 2015 17:40:01 GMT
#ignite-683: Remove unused class GridCacheMapAdapter.


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

Branch: refs/heads/ignite-sprint-4
Commit: 12642c68034d985dad54a40eb4f747bd52823510
Parents: 6923b4f
Author: ivasilinets <ivasilinets@gridgain.com>
Authored: Thu Apr 9 18:40:07 2015 +0300
Committer: ivasilinets <ivasilinets@gridgain.com>
Committed: Thu Apr 9 18:40:07 2015 +0300

----------------------------------------------------------------------
 .../processors/cache/CacheProjection.java       |   9 -
 .../processors/cache/GridCacheAdapter.java      |   5 -
 .../processors/cache/GridCacheMapAdapter.java   | 238 -------------------
 .../cache/GridCacheProjectionImpl.java          |   5 -
 .../processors/cache/GridCacheProxyImpl.java    |  12 -
 5 files changed, 269 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/12642c68/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheProjection.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheProjection.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheProjection.java
index 0a60eab..b18a650 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheProjection.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheProjection.java
@@ -286,15 +286,6 @@ public interface CacheProjection<K, V> extends Iterable<Cache.Entry<K,
V>> {
     public IgniteInternalFuture<Boolean> containsKeysAsync(Collection<? extends
K> keys);
 
     /**
-     * Returns {@code true} if this cache contains given value.
-     *
-     * @param val Value to check.
-     * @return {@code True} if given value is present in cache.
-     * @throws NullPointerException if the value is {@code null}.
-     */
-    public boolean containsValue(V val);
-
-    /**
      * Reloads a single key from persistent storage. This method
      * delegates to <code>CacheStore#load(Transaction, Object)</code>
      * method.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/12642c68/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 1b8ef16..a18f160 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
@@ -535,11 +535,6 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
     }
 
     /** {@inheritDoc} */
-    @Override public boolean containsValue(V val) {
-        return false;
-    }
-
-    /** {@inheritDoc} */
     @Override public boolean containsKey(K key) {
         try {
             return containsKeyAsync(key).get();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/12642c68/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapAdapter.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapAdapter.java
deleted file mode 100644
index 3d47852..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapAdapter.java
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.processors.cache;
-
-import org.apache.ignite.*;
-import org.apache.ignite.internal.util.typedef.internal.*;
-import org.jetbrains.annotations.*;
-
-import javax.cache.*;
-import java.util.*;
-import java.util.concurrent.*;
-
-/**
- * Wrapper to represent cache as {@link ConcurrentMap}.
- */
-public class GridCacheMapAdapter<K, V> implements ConcurrentMap<K, V> {
-    /** */
-    private CacheProjection<K, V> prj;
-
-    /**
-     * Constructor.
-     *
-     * @param prj Cache to wrap.
-     */
-    public GridCacheMapAdapter(CacheProjection<K, V> prj) {
-        this.prj = prj;
-    }
-
-    /** {@inheritDoc} */
-    @Override public int size() {
-        return prj.size();
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean isEmpty() {
-        return prj.isEmpty();
-    }
-
-    /** {@inheritDoc} */
-    @SuppressWarnings("unchecked")
-    @Override public boolean containsKey(Object key) {
-        return prj.containsKey((K)key);
-    }
-
-    /** {@inheritDoc} */
-    @SuppressWarnings("unchecked")
-    @Override public boolean containsValue(Object value) {
-        return prj.containsValue((V)value);
-    }
-
-    /** {@inheritDoc} */
-    @SuppressWarnings("unchecked")
-    @Nullable
-    @Override public V get(Object key) {
-        try {
-            return prj.get((K)key);
-        }
-        catch (IgniteCheckedException e) {
-            throw new IgniteException(e);
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Nullable
-    @Override public V put(K key, V value) {
-        try {
-            return prj.put(key, value);
-        }
-        catch (IgniteCheckedException e) {
-            throw new IgniteException(e);
-        }
-    }
-
-    /** {@inheritDoc} */
-    @SuppressWarnings("unchecked")
-    @Nullable
-    @Override public V remove(Object key) {
-        try {
-            return prj.remove((K)key);
-        }
-        catch (IgniteCheckedException e) {
-            throw new IgniteException(e);
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override public void putAll(Map<? extends K, ? extends V> map) {
-        try {
-            prj.putAll(map);
-        }
-        catch (IgniteCheckedException e) {
-            throw new IgniteException(e);
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Nullable
-    @Override public V putIfAbsent(K key, V val) {
-        try {
-            return prj.putIfAbsent(key, val);
-        }
-        catch (IgniteCheckedException e) {
-            throw new IgniteException(e);
-        }
-    }
-
-    /** {@inheritDoc} */
-    @SuppressWarnings({"unchecked"})
-    @Override public boolean remove(Object key, Object val) {
-        try {
-            return prj.remove((K)key, (V)val);
-        }
-        catch (IgniteCheckedException e) {
-            throw new IgniteException(e);
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean replace(K key, V oldVal, V newVal) {
-        try {
-            return prj.replace(key, oldVal, newVal);
-        }
-        catch (IgniteCheckedException e) {
-            throw new IgniteException(e);
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Nullable
-    @Override public V replace(K key, V val) {
-        try {
-            return prj.replace(key, val);
-        }
-        catch (IgniteCheckedException e) {
-            throw new IgniteException(e);
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override public void clear() {
-        prj.clearLocally();
-    }
-
-    /** {@inheritDoc} */
-    @Override public Set<K> keySet() {
-        return prj.keySet();
-    }
-
-    /** {@inheritDoc} */
-    @Override public Collection<V> values() {
-        return prj.values();
-    }
-
-    /** {@inheritDoc} */
-    @SuppressWarnings({"unchecked", "RedundantCast"})
-    @Override public Set<Map.Entry<K, V>> entrySet() {
-        return new CacheMapEntrySet();
-    }
-
-    /**
-     *
-     */
-    private class CacheMapEntrySet extends AbstractSet<Map.Entry<K, V>> {
-        /** */
-        private final Set<Cache.Entry<K, V>> entrySet = prj.entrySet();
-
-        /** {@inheritDoc} */
-        @NotNull @Override public Iterator<Map.Entry<K, V>> iterator() {
-            return new Iterator<Map.Entry<K, V>>() {
-                Iterator<Cache.Entry<K, V>> it = entrySet.iterator();
-
-                @Override public boolean hasNext() {
-                    return it.hasNext();
-                }
-
-                @Override public Map.Entry<K, V> next() {
-                    final Cache.Entry<K, V> e = it.next();
-
-                    return new Map.Entry<K, V>() {
-                        V val0;
-
-                        @Override public K getKey() {
-                            return e.getKey();
-                        }
-
-                        @Override public V getValue() {
-                            return val0 == null ? e.getValue() : val0;
-                        }
-
-                        @Override public V setValue(V val) {
-                            A.notNull(val, "val");
-
-                            try {
-                                prj.put(e.getKey(), val);
-
-                                val0 = val;
-
-                                return e.getValue();
-                            }
-                            catch (IgniteCheckedException e1) {
-                                throw new IgniteException("Failed to set entry value.", e1);
-                            }
-                        }
-                    };
-                }
-
-                @Override public void remove() {
-                    it.remove();
-                }
-            };
-        }
-
-        /** {@inheritDoc} */
-        @Override public int size() {
-            return entrySet.size();
-        }
-
-        /** {@inheritDoc} */
-        @Override public String toString() {
-            return S.toString(CacheMapEntrySet.class, this);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/12642c68/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProjectionImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProjectionImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProjectionImpl.java
index ce46066..9f3ae1b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProjectionImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProjectionImpl.java
@@ -262,11 +262,6 @@ public class GridCacheProjectionImpl<K, V> implements GridCacheProjectionEx<K,
V
     }
 
     /** {@inheritDoc} */
-    @Override public boolean containsValue(V val) {
-        return cache.containsValue(val);
-    }
-
-    /** {@inheritDoc} */
     @Override public V reload(K key) throws IgniteCheckedException {
         return cache.reload(key);
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/12642c68/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
index 8746268..d83266c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
@@ -355,18 +355,6 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K,
V>, Externali
     }
 
     /** {@inheritDoc} */
-    @Override public boolean containsValue(V val) {
-        GridCacheProjectionImpl<K, V> prev = gate.enter(prj);
-
-        try {
-            return delegate.containsValue(val);
-        }
-        finally {
-            gate.leave(prev);
-        }
-    }
-
-    /** {@inheritDoc} */
     @Nullable @Override public V reload(K key)
         throws IgniteCheckedException {
         GridCacheProjectionImpl<K, V> prev = gate.enter(prj);


Mime
View raw message