#gg-9757: Removed "GridInteropAware".
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/61a70d9f Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/61a70d9f Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/61a70d9f Branch: refs/heads/ignite-sql Commit: 61a70d9fdbed60103d19a955b37eb6345d78daa5 Parents: 88514f7 Author: vozerov-gridgain <voze...@gridgain.com> Authored: Mon Feb 2 13:18:25 2015 +0300 Committer: vozerov-gridgain <voze...@gridgain.com> Committed: Mon Feb 2 13:18:25 2015 +0300 ---------------------------------------------------------------------- .../processors/cache/GridCacheStoreManager.java | 25 ++++++++-- .../cache/GridCacheWriteBehindStore.java | 19 +------- .../processors/interop/GridInteropAware.java | 49 -------------------- 3 files changed, 21 insertions(+), 72 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/61a70d9f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheStoreManager.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheStoreManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheStoreManager.java index d89a670..f83c476 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheStoreManager.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheStoreManager.java @@ -27,7 +27,6 @@ import org.apache.ignite.internal.util.tostring.*; import org.apache.ignite.lang.*; import org.apache.ignite.lifecycle.*; import org.apache.ignite.transactions.*; -import org.apache.ignite.internal.processors.interop.*; import org.apache.ignite.internal.util.lang.*; import org.apache.ignite.internal.util.typedef.*; import org.apache.ignite.internal.util.typedef.internal.*; @@ -180,16 +179,27 @@ public class GridCacheStoreManager<K, V> extends GridCacheManagerAdapter<K, V> { boolean convertPortable = !cctx.config().isKeepPortableInStore(); if (cctx.config().isPortableEnabled()) { - if (store instanceof GridInteropAware) - ((GridInteropAware)store).configure(cctx.cache().name(), convertPortable); - else - this.convertPortable = convertPortable; + this.convertPortable = convertPortable; } else if (convertPortable) U.warn(log, "GridCacheConfiguration.isKeepPortableInStore() configuration property will " + "be ignored because portable mode is not enabled for cache: " + cctx.namex()); } + /** + * @return Convert-portable flag. + */ + public boolean convertPortable() { + return convertPortable; + } + + /** + * @param convertPortable Convert-portable flag. + */ + public void convertPortable(boolean convertPortable) { + this.convertPortable = convertPortable; + } + /** {@inheritDoc} */ @Override protected void stop0(boolean cancel) { if (store instanceof LifecycleAware) { @@ -246,6 +256,7 @@ public class GridCacheStoreManager<K, V> extends GridCacheManagerAdapter<K, V> { * @return Loaded value, possibly <tt>null</tt>. * @throws IgniteCheckedException If data loading failed. */ + @SuppressWarnings("unchecked") @Nullable private Object loadFromStore(@Nullable IgniteTx tx, K key, boolean convert) @@ -300,6 +311,7 @@ public class GridCacheStoreManager<K, V> extends GridCacheManagerAdapter<K, V> { * @param val Internal value. * @return User value. */ + @SuppressWarnings("unchecked") private V convert(Object val) { if (val == null) return null; @@ -406,6 +418,7 @@ public class GridCacheStoreManager<K, V> extends GridCacheManagerAdapter<K, V> { try { CI2<K, Object> c = new CI2<K, Object>() { + @SuppressWarnings("ConstantConditions") @Override public void apply(K k, Object val) { if (convert) { V v = convert(val); @@ -518,6 +531,7 @@ public class GridCacheStoreManager<K, V> extends GridCacheManagerAdapter<K, V> { * @return {@code true} If there is a persistent storage. * @throws IgniteCheckedException If storage failed. */ + @SuppressWarnings("unchecked") public boolean putToStore(@Nullable IgniteTx tx, K key, V val, GridCacheVersion ver) throws IgniteCheckedException { if (store != null) { @@ -628,6 +642,7 @@ public class GridCacheStoreManager<K, V> extends GridCacheManagerAdapter<K, V> { * @return {@code True} if there is a persistent storage. * @throws IgniteCheckedException If storage failed. */ + @SuppressWarnings("unchecked") public boolean removeFromStore(@Nullable IgniteTx tx, K key) throws IgniteCheckedException { if (store != null) { // Never remove internal key from store as it is never persisted. http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/61a70d9f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheWriteBehindStore.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheWriteBehindStore.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheWriteBehindStore.java index a31d3b5..39d7439 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheWriteBehindStore.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheWriteBehindStore.java @@ -56,7 +56,7 @@ import static javax.cache.Cache.Entry; * Since write operations to the cache store are deferred, transaction support is lost; no * transaction objects are passed to the underlying store. */ -public class GridCacheWriteBehindStore<K, V> extends CacheStore<K, V> implements LifecycleAware, GridInteropAware { +public class GridCacheWriteBehindStore<K, V> extends CacheStore<K, V> implements LifecycleAware { /** Default write cache initial capacity. */ public static final int DFLT_INITIAL_CAPACITY = 1024; @@ -289,23 +289,6 @@ public class GridCacheWriteBehindStore<K, V> extends CacheStore<K, V> implements } } - /** {@inheritDoc} */ - @Override public void configure(Object... params) { - // No-op. - } - - /** {@inheritDoc} */ - @Override public void initialize(GridKernalContext ctx) throws IgniteCheckedException { - if (store instanceof GridInteropAware) - ((GridInteropAware)store).initialize(ctx); - } - - /** {@inheritDoc} */ - @Override public void destroy(GridKernalContext ctx) throws IgniteCheckedException { - if (store instanceof GridInteropAware) - ((GridInteropAware)store).destroy(ctx); - } - /** * Gets count of write buffer overflow events since initialization. Each overflow event causes * the ongoing flush operation to be performed synchronously. http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/61a70d9f/modules/core/src/main/java/org/apache/ignite/internal/processors/interop/GridInteropAware.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/interop/GridInteropAware.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/interop/GridInteropAware.java deleted file mode 100644 index 81035d8..0000000 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/interop/GridInteropAware.java +++ /dev/null @@ -1,49 +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.interop; - -import org.apache.ignite.*; -import org.apache.ignite.internal.*; - -/** - * Interface for interop-aware components. - */ -public interface GridInteropAware { - /** - * Sets configuration parameters. - * - * @param params Configuration parameters. - */ - public void configure(Object... params); - - /** - * Initializes interop-aware component. - * - * @param ctx Context. - * @throws IgniteCheckedException In case of error. - */ - public void initialize(GridKernalContext ctx) throws IgniteCheckedException; - - /** - * Destroys interop-aware component. - * - * @param ctx Context. - * @throws IgniteCheckedException In case of error. - */ - public void destroy(GridKernalContext ctx) throws IgniteCheckedException; -}