http://git-wip-us.apache.org/repos/asf/ignite/blob/0da8c70a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java ---------------------------------------------------------------------- diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java index 87b0d00..8296945 100644 --- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java +++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java @@ -722,53 +722,6 @@ public class IgniteH2Indexing implements GridQueryIndexing { } } - /** {@inheritDoc} */ - @Override public void onSwap(@Nullable String spaceName, KeyCacheObject key, - int partId) throws IgniteCheckedException { - Schema schema = schemas.get(schema(spaceName)); - - if (schema == null) - return; - - Class<?> keyCls = getClass(objectContext(spaceName), key); - - for (TableDescriptor tbl : schema.tbls.values()) { - if (tbl.type().keyClass().isAssignableFrom(keyCls)) { - try { - if (tbl.tbl.onSwap(key, partId)) - return; - } - catch (IgniteCheckedException e) { - throw new IgniteCheckedException(e); - } - } - } - } - - /** {@inheritDoc} */ - @Override public void onUnswap(@Nullable String spaceName, KeyCacheObject key, int partId, CacheObject val) - throws IgniteCheckedException { - assert val != null; - - CacheObjectContext coctx = objectContext(spaceName); - - Class<?> keyCls = getClass(coctx, key); - Class<?> valCls = getClass(coctx, val); - - for (TableDescriptor tbl : tables(schema(spaceName))) { - if (tbl.type().keyClass().isAssignableFrom(keyCls) - && tbl.type().valueClass().isAssignableFrom(valCls)) { - try { - if (tbl.tbl.onUnswap(key, partId, val)) - return; - } - catch (IgniteCheckedException e) { - throw new IgniteCheckedException(e); - } - } - } - } - /** * Drops table form h2 database and clear all related indexes (h2 text, lucene). * @@ -3532,9 +3485,6 @@ public class IgniteH2Indexing implements GridQueryIndexing { private final GridUnsafeGuard guard; /** */ - private final boolean preferSwapVal; - - /** */ private final boolean snapshotableIdx; /** */ @@ -3579,10 +3529,6 @@ public class IgniteH2Indexing implements GridQueryIndexing { props[i] = p; } - // TODO GG-10884. -// preferSwapVal = schema.ccfg.getMemoryMode() == CacheMemoryMode.OFFHEAP_TIERED; - preferSwapVal = true; - // Index is not snapshotable in db-x. snapshotableIdx = false; } @@ -3733,14 +3679,6 @@ public class IgniteH2Indexing implements GridQueryIndexing { } /** {@inheritDoc} */ - @SuppressWarnings("unchecked") - @Override public Object readFromSwap(Object key) throws IgniteCheckedException { - assert false : "'readFromSwap' to be removed"; - - return null; - } - - /** {@inheritDoc} */ @Override public int valueType() { return valType; } @@ -3799,11 +3737,6 @@ public class IgniteH2Indexing implements GridQueryIndexing { } /** {@inheritDoc} */ - @Override public boolean preferSwapValue() { - return preferSwapVal; - } - - /** {@inheritDoc} */ @Override public boolean snapshotableIndex() { return snapshotableIdx; }
http://git-wip-us.apache.org/repos/asf/ignite/blob/0da8c70a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2AbstractKeyValueRow.java ---------------------------------------------------------------------- diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2AbstractKeyValueRow.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2AbstractKeyValueRow.java index e9970af..28dd891 100644 --- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2AbstractKeyValueRow.java +++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2AbstractKeyValueRow.java @@ -111,33 +111,6 @@ public abstract class GridH2AbstractKeyValueRow extends GridH2Row { } /** - * Should be called to remove reference on value. - * - * @throws IgniteCheckedException If failed. - */ - public synchronized void onSwap() throws IgniteCheckedException { - setValue(VAL_COL, null); - } - - /** - * Should be called when entry getting unswapped. - * - * @param val Value. - * @param beforeRmv If this is unswap before remove. - * @throws IgniteCheckedException If failed. - */ - public synchronized void onUnswap(Object val, boolean beforeRmv) throws IgniteCheckedException { - Value val0 = peekValue(VAL_COL); - - if (val0 != null && !(val0 instanceof WeakValue)) - return; - - setValue(VAL_COL, desc.wrap(val, desc.valueType())); - - notifyAll(); - } - - /** * Atomically updates weak value. * * @param valObj New value. @@ -209,68 +182,8 @@ public abstract class GridH2AbstractKeyValueRow extends GridH2Row { if (col < DEFAULT_COLUMNS_COUNT) { Value v; - if (col == VAL_COL) { + if (col == VAL_COL) v = peekValue(VAL_COL); - - long start = 0; - int attempt = 0; - - while ((v = WeakValue.unwrap(v)) == null) { - if (!desc.preferSwapValue()) { - v = getOffheapValue(VAL_COL); - - if (v != null) { - setValue(VAL_COL, v); - - if (peekValue(KEY_COL) == null) - cache(); - - return v; - } - } - - Object k = getValue(KEY_COL).getObject(); - - try { - Object valObj = desc.readFromSwap(k); - - if (valObj != null) { - // Even if we've found valObj in swap, it is may be some new value, - // while the needed value was already unswapped, so we have to recheck it. - if ((v = getOffheapValue(VAL_COL)) == null) - return updateWeakValue(valObj); - } - else { - // If nothing found in swap then we should be already unswapped. - if (desc.preferSwapValue()) { - v = getOffheapValue(VAL_COL); - - if (v != null) { - setValue(VAL_COL, v); - - if (peekValue(KEY_COL) == null) - cache(); - - return v; - } - } - - v = syncValue(attempt); - } - } - catch (IgniteCheckedException e) { - throw new IgniteException(e); - } - - attempt++; - - if (start == 0) - start = U.currentTimeMillis(); - else if (U.currentTimeMillis() - start > 60_000) // Loop for at most 60 seconds. - throw new IgniteException("Failed to get value for key: " + k + - ". This can happen due to a long GC pause."); - } - } else { assert col == KEY_COL : col; http://git-wip-us.apache.org/repos/asf/ignite/blob/0da8c70a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2KeyValueRowOffheap.java ---------------------------------------------------------------------- diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2KeyValueRowOffheap.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2KeyValueRowOffheap.java index 78ba2e2..fd310ce 100644 --- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2KeyValueRowOffheap.java +++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2KeyValueRowOffheap.java @@ -187,34 +187,6 @@ public class GridH2KeyValueRowOffheap extends GridH2AbstractKeyValueRow { } /** {@inheritDoc} */ - @Override public synchronized void onSwap() throws IgniteCheckedException { - Lock l = lock(ptr); - - try { - final long p = ptr + OFFSET_VALUE_REF; - - final GridUnsafeMemory mem = desc.memory(); - - final long valPtr = mem.readLongVolatile(p); - - if (valPtr <= 0) - throw new IllegalStateException("Already swapped: " + ptr); - - if (!mem.casLong(p, valPtr, 0)) - throw new IllegalStateException("Concurrent unswap: " + ptr); - - desc.guard().finalizeLater(new Runnable() { - @Override public void run() { - mem.release(valPtr, mem.readInt(valPtr) + OFFSET_VALUE); - } - }); - } - finally { - l.unlock(); - } - } - - /** {@inheritDoc} */ @SuppressWarnings("NonSynchronizedMethodOverridesSynchronizedMethod") @Override protected synchronized Value updateWeakValue(Object valObj) throws IgniteCheckedException { Value val = peekValue(VAL_COL); @@ -232,48 +204,6 @@ public class GridH2KeyValueRowOffheap extends GridH2AbstractKeyValueRow { } /** {@inheritDoc} */ - @Override public synchronized void onUnswap(Object val, boolean beforeRmv) throws IgniteCheckedException { - assert val != null; - - final long p = ptr; - - Lock l = lock(p); - - try { - GridUnsafeMemory mem = desc.memory(); - - if (mem.readLongVolatile(p + OFFSET_VALUE_REF) != 0) - return; // The offheap value is in its place, nothing to do here. - - Value v = peekValue(VAL_COL); - - if (v == null) { - setValue(VAL_COL, desc.wrap(val, desc.valueType())); - - v = peekValue(VAL_COL); - } - - byte[] bytes = new byte[SIZE_CALCULATOR.getValueLen(v)]; - - Data data = Data.create(null, bytes); - - data.writeValue(v); - - long valPtr = mem.allocate(bytes.length + OFFSET_VALUE); - - mem.writeInt(valPtr, bytes.length); - mem.writeBytes(valPtr + OFFSET_VALUE, bytes); - - mem.writeLongVolatile(p + OFFSET_VALUE_REF, valPtr); - } - finally { - l.unlock(); - } - - notifyAll(); - } - - /** {@inheritDoc} */ @Override protected Value syncValue(long waitTime) { Value v = super.syncValue(waitTime); http://git-wip-us.apache.org/repos/asf/ignite/blob/0da8c70a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2RowDescriptor.java ---------------------------------------------------------------------- diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2RowDescriptor.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2RowDescriptor.java index f645921..61de362 100644 --- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2RowDescriptor.java +++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2RowDescriptor.java @@ -80,12 +80,6 @@ public interface GridH2RowDescriptor extends GridOffHeapSmartPointerFactory<Grid */ public GridH2Row cachedRow(long link); - /** - * @param key Cache key. - * @return Value. - * @throws IgniteCheckedException If failed. - */ - public Object readFromSwap(Object key) throws IgniteCheckedException; /** * @return Value type. @@ -164,11 +158,6 @@ public interface GridH2RowDescriptor extends GridOffHeapSmartPointerFactory<Grid public Value wrap(Object o, int type) throws IgniteCheckedException; /** - * @return {@code True} if should check swap value before offheap. - */ - public boolean preferSwapValue(); - - /** * @return {@code True} if index should support snapshots. */ public boolean snapshotableIndex(); http://git-wip-us.apache.org/repos/asf/ignite/blob/0da8c70a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Table.java ---------------------------------------------------------------------- diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Table.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Table.java index a9c1a20..c07dce4 100644 --- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Table.java +++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Table.java @@ -187,79 +187,6 @@ public class GridH2Table extends TableBase { } /** - * Should be called when entry is swapped. - * - * @param key Entry key. - * @return {@code true} If row was found. - * @throws IgniteCheckedException If failed. - */ - public boolean onSwap(KeyCacheObject key, int partId) throws IgniteCheckedException { - return onSwapUnswap(key, partId, null); - } - - /** - * Should be called when entry is unswapped. - * - * @param key Key. - * @param val Value. - * @return {@code true} If row was found. - * @throws IgniteCheckedException If failed. - */ - public boolean onUnswap(KeyCacheObject key, int partId, CacheObject val) throws IgniteCheckedException { - assert val != null : "Key=" + key; - - return onSwapUnswap(key, partId, val); - } - - /** - * Swaps or unswaps row. - * - * @param key Key. - * @param val Value for promote or {@code null} if we have to swap. - * @return {@code true} if row was found and swapped/unswapped. - * @throws IgniteCheckedException If failed. - */ - @SuppressWarnings("LockAcquiredButNotSafelyReleased") - private boolean onSwapUnswap(KeyCacheObject key, int partId, @Nullable CacheObject val) throws IgniteCheckedException { - assert key != null; - - GridH2IndexBase pk = pk(); - - assert desc != null; - - GridH2Row searchRow = desc.createRow(key, partId, null, null, 0); - - GridUnsafeMemory mem = desc.memory(); - - lock(false); - - if (mem != null) - desc.guard().begin(); - - try { - ensureNotDestroyed(); - - GridH2AbstractKeyValueRow row = (GridH2AbstractKeyValueRow)pk.findOne(searchRow); - - if (row == null) - return false; - - if (val == null) - row.onSwap(); - else - row.onUnswap(val, false); - - return true; - } - finally { - unlock(false); - - if (mem != null) - desc.guard().end(); - } - } - - /** * @return Space name. */ @Nullable public String spaceName() { @@ -621,12 +548,7 @@ public class GridH2Table extends TableBase { GridH2Row old = pk.put(row); // Put to PK. - if (old instanceof GridH2AbstractKeyValueRow) { // Unswap value on replace. - GridH2AbstractKeyValueRow kvOld = (GridH2AbstractKeyValueRow)old; - - kvOld.onUnswap(kvOld.getValue(VAL_COL), true); - } - else if (old == null) + if (old == null) size.increment(); int len = idxs.size(); @@ -648,13 +570,6 @@ public class GridH2Table extends TableBase { // index(1) is PK, get full row from there (search row here contains only key but no other columns). GridH2Row old = pk.remove(row); - if (row.getColumnCount() != 1 && old instanceof GridH2AbstractKeyValueRow) { // Unswap value. - Value v = row.getValue(VAL_COL); - - if (v != null) - ((GridH2AbstractKeyValueRow)old).onUnswap(v.getObject(), true); - } - if (old != null) { // Remove row from all indexes. // Start from 3 because 0 - Scan (don't need to update), 1 - PK hash (already updated), 2 - PK (already updated). http://git-wip-us.apache.org/repos/asf/ignite/blob/0da8c70a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridBinaryDuplicateIndexObjectsAbstractSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridBinaryDuplicateIndexObjectsAbstractSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridBinaryDuplicateIndexObjectsAbstractSelfTest.java deleted file mode 100644 index e257378..0000000 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridBinaryDuplicateIndexObjectsAbstractSelfTest.java +++ /dev/null @@ -1,159 +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 java.util.Arrays; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import org.apache.ignite.IgniteCache; -import org.apache.ignite.cache.CacheAtomicityMode; -import org.apache.ignite.cache.CacheMode; -import org.apache.ignite.cache.QueryEntity; -import org.apache.ignite.cache.QueryIndex; -import org.apache.ignite.cache.query.SqlFieldsQuery; -import org.apache.ignite.configuration.BinaryConfiguration; -import org.apache.ignite.configuration.CacheConfiguration; -import org.apache.ignite.configuration.IgniteConfiguration; -import org.apache.ignite.internal.util.typedef.F; -import org.apache.ignite.internal.binary.BinaryMarshaller; -import org.apache.ignite.binary.BinaryObject; - -/** - * Tests that binary object is the same in cache entry and in index. - */ -public abstract class GridBinaryDuplicateIndexObjectsAbstractSelfTest extends GridCacheAbstractSelfTest { - /** {@inheritDoc} */ - @Override protected int gridCount() { - return 1; - } - - /** {@inheritDoc} */ - @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { - IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); - - BinaryConfiguration bCfg = new BinaryConfiguration(); - - bCfg.setClassNames(Collections.singletonList(TestBinary.class.getName())); - - cfg.setBinaryConfiguration(bCfg); - - cfg.setMarshaller(new BinaryMarshaller()); - - return cfg; - } - - /** {@inheritDoc} */ - @Override protected CacheConfiguration cacheConfiguration(String igniteInstanceName) throws Exception { - CacheConfiguration ccfg = super.cacheConfiguration(igniteInstanceName); - - ccfg.setCopyOnRead(false); - - QueryEntity queryEntity = new QueryEntity(Integer.class.getName(), TestBinary.class.getName()); - - queryEntity.addQueryField("fieldOne", String.class.getName(), null); - queryEntity.addQueryField("fieldTwo", Integer.class.getName(), null); - - queryEntity.setIndexes(Arrays.asList( - new QueryIndex("fieldOne", true), - new QueryIndex("fieldTwo", true))); - - ccfg.setQueryEntities(Collections.singletonList(queryEntity)); - - return ccfg; - } - - /** {@inheritDoc} */ - @Override public abstract CacheAtomicityMode atomicityMode(); - - /** {@inheritDoc} */ - @Override public abstract CacheMode cacheMode(); - - /** - * @throws Exception If failed. - */ - public void testIndexReferences() throws Exception { - IgniteCache<Integer, TestBinary> cache = grid(0).cache(null); - - String fieldOneVal = "123"; - int fieldTwoVal = 123; - int key = 0; - - cache.put(key, new TestBinary(fieldOneVal, fieldTwoVal)); - - IgniteCache<Integer, BinaryObject> prj = grid(0).cache(null).withKeepBinary(); - - BinaryObject cacheVal = prj.get(key); - - assertEquals(fieldOneVal, cacheVal.field("fieldOne")); - assertEquals(new Integer(fieldTwoVal), cacheVal.field("fieldTwo")); - - List<?> row = F.first(prj.query(new SqlFieldsQuery("select _val from " + - "TestBinary where _key = ?").setArgs(key)).getAll()); - - assertEquals(1, row.size()); - - BinaryObject qryVal = (BinaryObject)row.get(0); - - assertEquals(fieldOneVal, qryVal.field("fieldOne")); - assertEquals(new Integer(fieldTwoVal), qryVal.field("fieldTwo")); - assertSame(cacheVal, qryVal); - } - - /** - * Test binary object. - */ - private static class TestBinary { - /** */ - private String fieldOne; - - /** */ - private int fieldTwo; - - /** - * - */ - private TestBinary() { - // No-op. - } - - /** - * @param fieldOne Field one. - * @param fieldTwo Field two. - */ - private TestBinary(String fieldOne, int fieldTwo) { - this.fieldOne = fieldOne; - this.fieldTwo = fieldTwo; - } - - /** - * @return Field one. - */ - public String fieldOne() { - return fieldOne; - } - - /** - * @return Field two. - */ - public int fieldTwo() { - return fieldTwo; - } - } -} http://git-wip-us.apache.org/repos/asf/ignite/blob/0da8c70a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapSelfTest.java index 148ce74..8d91a57 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapSelfTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapSelfTest.java @@ -17,60 +17,36 @@ package org.apache.ignite.internal.processors.cache; -import java.util.Collection; import java.util.Collections; import java.util.HashMap; -import java.util.HashSet; import java.util.Map; -import java.util.Set; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.atomic.AtomicInteger; import javax.cache.Cache; -import org.apache.ignite.Ignite; import org.apache.ignite.IgniteCache; import org.apache.ignite.cache.CachePeekMode; -import org.apache.ignite.cache.query.SqlQuery; import org.apache.ignite.cache.query.annotations.QuerySqlField; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; -import org.apache.ignite.events.Event; import org.apache.ignite.internal.util.typedef.internal.CU; import org.apache.ignite.internal.util.typedef.internal.S; -import org.apache.ignite.lang.IgnitePredicate; import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi; import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder; import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; -import static java.util.concurrent.TimeUnit.MILLISECONDS; import static org.apache.ignite.cache.CacheMode.REPLICATED; import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC; import static org.apache.ignite.configuration.DeploymentMode.SHARED; -import static org.apache.ignite.events.EventType.EVT_CACHE_OBJECT_FROM_OFFHEAP; -import static org.apache.ignite.events.EventType.EVT_CACHE_OBJECT_TO_OFFHEAP; /** * Test for cache swap. */ public class GridCacheOffHeapSelfTest extends GridCommonAbstractTest { - /** Entry count. */ - private static final int ENTRY_CNT = 1000; - - /** Swap count. */ - private final AtomicInteger swapCnt = new AtomicInteger(); - - /** Unswap count. */ - private final AtomicInteger unswapCnt = new AtomicInteger(); - /** Saved versions. */ private final Map<Integer, Object> versions = new HashMap<>(); /** */ private final TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true); - /** PeerClassLoadingLocalClassPathExclude enable. */ - private boolean excluded; - /** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); @@ -93,10 +69,6 @@ public class GridCacheOffHeapSelfTest extends GridCommonAbstractTest { cfg.setDeploymentMode(SHARED); - if (excluded) - cfg.setPeerClassLoadingLocalClassPathExclude(GridCacheOffHeapSelfTest.class.getName(), - CacheValue.class.getName()); - return cfg; } @@ -110,156 +82,6 @@ public class GridCacheOffHeapSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ - @SuppressWarnings("BusyWait") - public void testOffHeapDeployment() throws Exception { - try { - Ignite ignite1 = startGrid(1); - - excluded = true; - - Ignite ignite2 = startGrid(2); - - IgniteCache<Integer, Object> cache1 = ignite1.cache(null); - IgniteCache<Integer, Object> cache2 = ignite2.cache(null); - - Object v1 = new CacheValue(1); - - cache1.put(1, v1); - - info("Stored value in cache1 [v=" + v1 + ", ldr=" + v1.getClass().getClassLoader() + ']'); - - Object v2 = cache2.get(1); - - assert v2 != null; - - info("Read value from cache2 [v=" + v2 + ", ldr=" + v2.getClass().getClassLoader() + ']'); - - assert !v2.getClass().getClassLoader().equals(getClass().getClassLoader()); - assert v2.getClass().getClassLoader().getClass().getName().contains("GridDeploymentClassLoader"); - - SwapListener lsnr = new SwapListener(); - - ignite2.events().localListen(lsnr, EVT_CACHE_OBJECT_TO_OFFHEAP, EVT_CACHE_OBJECT_FROM_OFFHEAP); - - cache2.localEvict(keySet(cache2)); - - assert lsnr.awaitSwap(); - - assert cache2.get(1) != null; - - assert lsnr.awaitUnswap(); - - ignite2.events().stopLocalListen(lsnr); - - lsnr = new SwapListener(); - - ignite2.events().localListen(lsnr, EVT_CACHE_OBJECT_TO_OFFHEAP, EVT_CACHE_OBJECT_FROM_OFFHEAP); - - cache2.localEvict(keySet(cache2)); - - assert lsnr.awaitSwap(); - - stopGrid(1); - - boolean success = false; - - for (int i = 0; i < 6; i++) { - success = cache2.get(1) == null; - - if (success) - break; - else if (i < 2) { - info("Sleeping to wait for cache clear."); - - Thread.sleep(500); - } - } - - assert success; - } - finally { - stopAllGrids(); - } - } - - /** - * @throws Exception If failed. - */ - public void testOffHeap() throws Exception { - try { - startGrids(1); - - grid(0).events().localListen(new IgnitePredicate<Event>() { - @Override public boolean apply(Event evt) { - assert evt != null; - - switch (evt.type()) { - case EVT_CACHE_OBJECT_TO_OFFHEAP: - swapCnt.incrementAndGet(); - - break; - case EVT_CACHE_OBJECT_FROM_OFFHEAP: - unswapCnt.incrementAndGet(); - - break; - } - - return true; - } - }, EVT_CACHE_OBJECT_TO_OFFHEAP, EVT_CACHE_OBJECT_FROM_OFFHEAP); - - IgniteCache<Integer, CacheValue> cache = grid(0).cache(null); - - populate(cache); - evictAll(cache); - - int cnt = 0; - - for (Cache.Entry<Integer, CacheValue> e : cache.localEntries(CachePeekMode.OFFHEAP)) { - assertEquals(e.getKey().intValue(), e.getValue().value()); - - cnt++; - } - - assertEquals(ENTRY_CNT, cnt); - - query(cache, 0, 200); // Query swapped entries. - unswap(cache, 200, 400); // Check 'promote' method. - unswapAll(cache, 400, 600); // Check 'promoteAll' method. - get(cache, 600, 800); // Check 'get' method. - peek(cache, 800, ENTRY_CNT); // Check 'peek' method in 'SWAP' mode. - - // Check that all entries were unswapped. - for (int i = 0; i < ENTRY_CNT; i++) { - CacheValue val = cache.localPeek(i); - - assert val != null; - assert val.value() == i; - } - - // Query unswapped entries. - Collection<Cache.Entry<Integer, CacheValue>> res = cache.query( - new SqlQuery<Integer, CacheValue>(CacheValue.class, "val >= ? and val < ?"). - setArgs(0, ENTRY_CNT)). - getAll(); - - assert res.size() == ENTRY_CNT; - - for (Cache.Entry<Integer, CacheValue> entry : res) { - assert entry != null; - assert entry.getKey() != null; - assert entry.getValue() != null; - assert entry.getKey() == entry.getValue().value(); - } - } - finally { - stopAllGrids(); - } - } - - /** - * @throws Exception If failed. - */ public void testOffHeapIterator() throws Exception { try { startGrids(1); @@ -272,8 +94,6 @@ public class GridCacheOffHeapSelfTest extends GridCommonAbstractTest { info("Putting: " + i); cache.put(i, i); - - cache.localEvict(Collections.singleton(i)); } int i = 0; @@ -300,255 +120,6 @@ public class GridCacheOffHeapSelfTest extends GridCommonAbstractTest { } /** - * Populates cache. - * - * @param cache Cache. - * @throws Exception In case of error. - */ - private void populate(IgniteCache<Integer, CacheValue> cache) throws Exception { - resetCounters(); - - for (int i = 0; i < ENTRY_CNT; i++) { - cache.put(i, new CacheValue(i)); - - CacheValue val = cache.localPeek(i); - - assert val != null; - assert val.value() == i; - - GridCacheEntryEx entry = dht(cache).peekEx(i); - - assert entry != null; - - versions.put(i, entry.version()); - } - - assert swapCnt.get() == 0; - assert unswapCnt.get() == 0; - } - - /** - * Evicts all entries in cache. - * - * @param cache Cache. - * @throws Exception In case of error. - */ - private void evictAll(IgniteCache<Integer, CacheValue> cache) throws Exception { - resetCounters(); - - assertEquals(ENTRY_CNT, cache.size()); - assertEquals(0, cache.localSize(CachePeekMode.OFFHEAP)); - - for (int i = 0; i < ENTRY_CNT; i++) { - cache.localEvict(Collections.singleton(i)); - - assertEquals(ENTRY_CNT - i - 1, cache.localSize(CachePeekMode.ONHEAP)); - assertEquals(i + 1, cache.localSize(CachePeekMode.OFFHEAP)); - } - // cache.evictAll(); - - assertEquals(0, cache.localSize(CachePeekMode.ONHEAP)); - assertEquals(ENTRY_CNT, cache.localSize(CachePeekMode.OFFHEAP)); - - for (int i = 0; i < ENTRY_CNT; i++) - assertNull(cache.localPeek(i, CachePeekMode.ONHEAP)); - - assertEquals(ENTRY_CNT, swapCnt.get()); - assertEquals(0, unswapCnt.get()); - } - - /** - * Runs SQL query and checks result. - * - * @param cache Cache. - * @param lowerBound Lower key bound. - * @param upperBound Upper key bound. - * @throws Exception In case of error. - */ - private void query(IgniteCache<Integer, CacheValue> cache, int lowerBound, int upperBound) throws Exception { - resetCounters(); - - Collection<Cache.Entry<Integer, CacheValue>> res = cache.query(new SqlQuery<Integer, CacheValue>(CacheValue.class, "val >= ? and val < ?"). - setArgs(lowerBound, upperBound)). - getAll(); - - assertEquals(res.size(), upperBound - lowerBound); - - for (Cache.Entry<Integer, CacheValue> entry : res) { - assert entry != null; - assert entry.getKey() != null; - assert entry.getValue() != null; - assert entry.getKey() == entry.getValue().value(); - } - - assertEquals(0, swapCnt.get()); - assertEquals(0, unswapCnt.get()); - - checkEntries(cache, lowerBound, upperBound); - - assertEquals(0, swapCnt.get()); - assertEquals(unswapCnt.get(), upperBound - lowerBound); - } - - /** - * Unswaps entries and checks result. - * - * @param cache Cache. - * @param lowerBound Lower key bound. - * @param upperBound Upper key bound. - * @throws Exception In case of error. - */ - private void unswap(IgniteCache<Integer, CacheValue> cache, int lowerBound, int upperBound) throws Exception { - resetCounters(); - - assertEquals(0, swapCnt.get()); - assertEquals(0, unswapCnt.get()); - - for (int i = lowerBound; i < upperBound; i++) { - assert cache.localPeek(i, CachePeekMode.ONHEAP) == null; - - cache.localPromote(Collections.singleton(i)); - CacheValue val = cache.localPeek(i); - - assertNotNull(val); - assertEquals(i, val.value()); - - assertEquals(i - lowerBound + 1, unswapCnt.get()); - } - - assertEquals(0, swapCnt.get()); - assertEquals(unswapCnt.get(), upperBound - lowerBound); - - checkEntries(cache, lowerBound, upperBound); - - assertEquals(0, swapCnt.get()); - assertEquals(unswapCnt.get(), upperBound - lowerBound); - } - - /** - * Unswaps entries and checks result. - * - * @param cache Cache. - * @param lowerBound Lower key bound. - * @param upperBound Upper key bound. - * @throws Exception In case of error. - */ - private void unswapAll(IgniteCache<Integer, CacheValue> cache, int lowerBound, int upperBound) throws Exception { - resetCounters(); - - Set<Integer> keys = new HashSet<>(); - - for (int i = lowerBound; i < upperBound; i++) { - assert cache.localPeek(i, CachePeekMode.ONHEAP) == null; - - keys.add(i); - } - - cache.localPromote(keys); - - assert swapCnt.get() == 0; - assert unswapCnt.get() == upperBound - lowerBound; - - checkEntries(cache, lowerBound, upperBound); - - assert swapCnt.get() == 0; - assert unswapCnt.get() == upperBound - lowerBound; - } - - /** - * Unswaps entries via {@code get} method and checks result. - * - * @param cache Cache. - * @param lowerBound Lower key bound. - * @param upperBound Upper key bound. - * @throws Exception In case of error. - */ - private void get(IgniteCache<Integer, CacheValue> cache, int lowerBound, int upperBound) throws Exception { - resetCounters(); - - for (int i = lowerBound; i < upperBound; i++) { - assert cache.localPeek(i, CachePeekMode.ONHEAP) == null; - - CacheValue val = cache.get(i); - - assert val != null; - assert val.value() == i; - } - - assert swapCnt.get() == 0; - assert unswapCnt.get() == upperBound - lowerBound; - - checkEntries(cache, lowerBound, upperBound); - - assert swapCnt.get() == 0; - assert unswapCnt.get() == upperBound - lowerBound; - } - - /** - * Peeks entries in {@code SWAP} mode and checks result. - * - * @param cache Cache. - * @param lowerBound Lower key bound. - * @param upperBound Upper key bound. - * @throws Exception In case of error. - */ - private void peek(IgniteCache<Integer, CacheValue> cache, int lowerBound, int upperBound) throws Exception { - resetCounters(); - - for (int i = lowerBound; i < upperBound; i++) { - assert cache.localPeek(i, CachePeekMode.ONHEAP) == null; - - CacheValue val = cache.localPeek(i, CachePeekMode.OFFHEAP); - - assert val != null; - assert val.value() == i; - } - - assert swapCnt.get() == 0; - assert unswapCnt.get() == 0; - - checkEntries(cache, lowerBound, upperBound); - - assert swapCnt.get() == 0; - assert unswapCnt.get() == upperBound - lowerBound; - } - - /** - * Resets event counters. - */ - private void resetCounters() { - swapCnt.set(0); - unswapCnt.set(0); - } - - /** - * Checks that entries in cache are correct after being unswapped. - * If entry is still swapped, it will be unswapped in this method. - * - * @param cache Cache. - * @param lowerBound Lower key bound. - * @param upperBound Upper key bound. - * @throws Exception In case of error. - */ - private void checkEntries(IgniteCache<Integer, CacheValue> cache, int lowerBound, int upperBound) throws Exception { - for (int i = lowerBound; i < upperBound; i++) { - cache.localPromote(Collections.singleton(i)); - - GridCacheEntryEx entry = dht(cache).entryEx(i); - - assert entry != null; - assert entry.key() != null; - - CacheValue val = CU.value(entry.rawGet(), entry.context(), false); - - assertNotNull("Value null for key: " + i, val); - assertEquals(entry.key().value(entry.context().cacheObjectContext(), false), (Integer)val.value()); - - assertEquals(entry.version(), versions.get(i)); - } - } - - /** * */ private static class CacheValue { @@ -575,51 +146,4 @@ public class GridCacheOffHeapSelfTest extends GridCommonAbstractTest { return S.toString(CacheValue.class, this); } } - - /** - * - */ - private class SwapListener implements IgnitePredicate<Event> { - /** */ - private final CountDownLatch swapLatch = new CountDownLatch(1); - - /** */ - private final CountDownLatch unswapLatch = new CountDownLatch(1); - - /** {@inheritDoc} */ - @Override public boolean apply(Event evt) { - assert evt != null; - - info("Received event: " + evt); - - switch (evt.type()) { - case EVT_CACHE_OBJECT_TO_OFFHEAP: - swapLatch.countDown(); - - break; - case EVT_CACHE_OBJECT_FROM_OFFHEAP: - unswapLatch.countDown(); - - break; - } - - return true; - } - - /** - * @return {@code True} if await succeeded. - * @throws InterruptedException If interrupted. - */ - boolean awaitSwap() throws InterruptedException { - return swapLatch.await(5000, MILLISECONDS); - } - - /** - * @return {@code True} if await succeeded. - * @throws InterruptedException If interrupted. - */ - boolean awaitUnswap() throws InterruptedException { - return unswapLatch.await(5000, MILLISECONDS); - } - } } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/0da8c70a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryMultiThreadedSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryMultiThreadedSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryMultiThreadedSelfTest.java index 1f2ec99..e0024fb 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryMultiThreadedSelfTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryMultiThreadedSelfTest.java @@ -96,8 +96,6 @@ public class IgniteCacheQueryMultiThreadedSelfTest extends GridCommonAbstractTes cfg.setCacheConfiguration(cacheConfiguration()); - GridQueryProcessor.idxCls = FakeIndexing.class; - return cfg; } @@ -140,24 +138,6 @@ public class IgniteCacheQueryMultiThreadedSelfTest extends GridCommonAbstractTes return DURATION + 60_000; } - /** - * - */ - private static class FakeIndexing extends IgniteH2Indexing { - @Override public void onSwap(@Nullable String spaceName, KeyCacheObject key, int partId) throws IgniteCheckedException { - super.onSwap(spaceName, key, partId); - - idxSwapCnt.incrementAndGet(); - } - - @Override public void onUnswap(@Nullable String spaceName, KeyCacheObject key, int partId, CacheObject val) - throws IgniteCheckedException { - super.onUnswap(spaceName, key, partId, val); - - idxUnswapCnt.incrementAndGet(); - } - } - /** @return {@code true} If evictions enabled. */ protected boolean evictsEnabled() { return false; @@ -185,11 +165,6 @@ public class IgniteCacheQueryMultiThreadedSelfTest extends GridCommonAbstractTes /** {@inheritDoc} */ @Override protected void afterTestsStopped() throws Exception { stopAllGrids(); - - if (evictsEnabled()) { - assertTrue(idxSwapCnt.get() > 0); - assertTrue(idxUnswapCnt.get() > 0); - } } /** {@inheritDoc} */ http://git-wip-us.apache.org/repos/asf/ignite/blob/0da8c70a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheBinaryDuplicateIndexObjectPartitionedAtomicSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheBinaryDuplicateIndexObjectPartitionedAtomicSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheBinaryDuplicateIndexObjectPartitionedAtomicSelfTest.java deleted file mode 100644 index d36b794..0000000 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheBinaryDuplicateIndexObjectPartitionedAtomicSelfTest.java +++ /dev/null @@ -1,38 +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.distributed; - -import org.apache.ignite.cache.CacheAtomicityMode; -import org.apache.ignite.cache.CacheMode; -import org.apache.ignite.internal.processors.cache.GridBinaryDuplicateIndexObjectsAbstractSelfTest; - -/** - * Test PARTITIONED ATOMIC. - */ -public class GridCacheBinaryDuplicateIndexObjectPartitionedAtomicSelfTest extends - GridBinaryDuplicateIndexObjectsAbstractSelfTest { - /** {@inheritDoc} */ - @Override public CacheAtomicityMode atomicityMode() { - return CacheAtomicityMode.ATOMIC; - } - - /** {@inheritDoc} */ - @Override public CacheMode cacheMode() { - return CacheMode.PARTITIONED; - } -} http://git-wip-us.apache.org/repos/asf/ignite/blob/0da8c70a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheBinaryDuplicateIndexObjectPartitionedTransactionalSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheBinaryDuplicateIndexObjectPartitionedTransactionalSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheBinaryDuplicateIndexObjectPartitionedTransactionalSelfTest.java deleted file mode 100644 index 529b556..0000000 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheBinaryDuplicateIndexObjectPartitionedTransactionalSelfTest.java +++ /dev/null @@ -1,41 +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.distributed; - -import org.apache.ignite.cache.CacheAtomicityMode; -import org.apache.ignite.cache.CacheMode; -import org.apache.ignite.internal.processors.cache.GridBinaryDuplicateIndexObjectsAbstractSelfTest; - -import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL; -import static org.apache.ignite.cache.CacheMode.PARTITIONED; - -/** - * Test PARTITIONED and TRANSACTIONAL. - */ -public class GridCacheBinaryDuplicateIndexObjectPartitionedTransactionalSelfTest extends - GridBinaryDuplicateIndexObjectsAbstractSelfTest { - /** {@inheritDoc} */ - @Override public CacheAtomicityMode atomicityMode() { - return TRANSACTIONAL; - } - - /** {@inheritDoc} */ - @Override public CacheMode cacheMode() { - return PARTITIONED; - } -} http://git-wip-us.apache.org/repos/asf/ignite/blob/0da8c70a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteQueryDedicatedPoolTest.java ---------------------------------------------------------------------- diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteQueryDedicatedPoolTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteQueryDedicatedPoolTest.java index fe966f9..f3404fd 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteQueryDedicatedPoolTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteQueryDedicatedPoolTest.java @@ -208,15 +208,5 @@ public class IgniteQueryDedicatedPoolTest extends GridCommonAbstractTest { @Override public void remove(@Nullable String spaceName, Object key) { // No-op. } - - /** {@inheritDoc} */ - @Override public void onSwap(@Nullable String spaceName, Object key) { - // No-op. - } - - /** {@inheritDoc} */ - @Override public void onUnswap(@Nullable String spaceName, Object key, Object val) { - // No-op. - } } } http://git-wip-us.apache.org/repos/asf/ignite/blob/0da8c70a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheQueryTestSuite.java ---------------------------------------------------------------------- diff --git a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheQueryTestSuite.java b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheQueryTestSuite.java index e957f0f..5826b72 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheQueryTestSuite.java +++ b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheQueryTestSuite.java @@ -22,8 +22,6 @@ import org.apache.ignite.internal.binary.BinaryMarshaller; import org.apache.ignite.internal.processors.cache.BinarySerializationQuerySelfTest; import org.apache.ignite.internal.processors.cache.BinarySerializationQueryWithReflectiveSerializerSelfTest; import org.apache.ignite.internal.processors.cache.IgniteCacheBinaryObjectsScanSelfTest; -import org.apache.ignite.internal.processors.cache.distributed.GridCacheBinaryDuplicateIndexObjectPartitionedAtomicSelfTest; -import org.apache.ignite.internal.processors.cache.distributed.GridCacheBinaryDuplicateIndexObjectPartitionedTransactionalSelfTest; import org.apache.ignite.testframework.config.GridTestProperties; /** @@ -47,9 +45,6 @@ public class IgniteBinaryCacheQueryTestSuite extends TestSuite { //Should be adjusted. Not ready to be used with BinaryMarshaller. //suite.addTestSuite(GridCacheBinarySwapScanQuerySelfTest.class); - suite.addTestSuite(GridCacheBinaryDuplicateIndexObjectPartitionedAtomicSelfTest.class); - suite.addTestSuite(GridCacheBinaryDuplicateIndexObjectPartitionedTransactionalSelfTest.class); - //TODO: the following tests= was never tested with binary. Exclude or pass? // suite.addTestSuite(IgniteSqlSchemaIndexingTest.class); http://git-wip-us.apache.org/repos/asf/ignite/blob/0da8c70a/modules/kafka/src/main/java/org/apache/ignite/stream/kafka/connect/IgniteSourceTask.java ---------------------------------------------------------------------- diff --git a/modules/kafka/src/main/java/org/apache/ignite/stream/kafka/connect/IgniteSourceTask.java b/modules/kafka/src/main/java/org/apache/ignite/stream/kafka/connect/IgniteSourceTask.java index 2f6a728..d5f2286 100644 --- a/modules/kafka/src/main/java/org/apache/ignite/stream/kafka/connect/IgniteSourceTask.java +++ b/modules/kafka/src/main/java/org/apache/ignite/stream/kafka/connect/IgniteSourceTask.java @@ -333,10 +333,6 @@ public class IgniteSourceTask extends SourceTask { /** */ UNLOCKED(EventType.EVT_CACHE_OBJECT_UNLOCKED), /** */ - SWAPPED(EventType.EVT_CACHE_OBJECT_SWAPPED), - /** */ - UNSWAPPED(EventType.EVT_CACHE_OBJECT_UNSWAPPED), - /** */ EXPIRED(EventType.EVT_CACHE_OBJECT_EXPIRED); /** Internal Ignite event id. */ http://git-wip-us.apache.org/repos/asf/ignite/blob/0da8c70a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheAbstractTest.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheAbstractTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheAbstractTest.cs index d629331..351c25c 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheAbstractTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheAbstractTest.cs @@ -1313,64 +1313,6 @@ namespace Apache.Ignite.Core.Tests.Cache } [Test] - [Ignore("IGNITE-4535")] - public void TestPromote() - { - var cache = Cache(); - - int key = GetPrimaryKeyForCache(cache); - - cache.Put(key, 1); - - Assert.AreEqual(1, PeekInt(cache, key)); - - cache.LocalEvict(new[] {key}); - - Assert.AreEqual(0, cache.GetLocalSize(CachePeekMode.Onheap)); - - Assert.AreEqual(0, PeekInt(cache, key)); - - cache.LocalPromote(new[] { key }); - - Assert.AreEqual(1, cache.GetLocalSize(CachePeekMode.Onheap)); - - Assert.AreEqual(1, PeekInt(cache, key)); - } - - [Test] - [Ignore("IGNITE-4535")] - public void TestPromoteAll() - { - var cache = Cache(); - - List<int> keys = GetPrimaryKeysForCache(cache, 3); - - cache.Put(keys[0], 1); - cache.Put(keys[1], 2); - cache.Put(keys[2], 3); - - Assert.AreEqual(1, PeekInt(cache, keys[0])); - Assert.AreEqual(2, PeekInt(cache, keys[1])); - Assert.AreEqual(3, PeekInt(cache, keys[2])); - - cache.LocalEvict(new List<int> { -1, keys[0], keys[1] }); - - Assert.AreEqual(1, cache.GetLocalSize(CachePeekMode.Onheap)); - - Assert.AreEqual(0, PeekInt(cache, keys[0])); - Assert.AreEqual(0, PeekInt(cache, keys[1])); - Assert.AreEqual(3, PeekInt(cache, keys[2])); - - cache.LocalPromote(new[] {keys[0], keys[1]}); - - Assert.AreEqual(3, cache.GetLocalSize(CachePeekMode.Onheap)); - - Assert.AreEqual(1, PeekInt(cache, keys[0])); - Assert.AreEqual(2, PeekInt(cache, keys[1])); - Assert.AreEqual(3, PeekInt(cache, keys[2])); - } - - [Test] public void TestPutGetBinary() { var cache = Cache<int, BinarizablePerson>(); http://git-wip-us.apache.org/repos/asf/ignite/blob/0da8c70a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheTestAsyncWrapper.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheTestAsyncWrapper.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheTestAsyncWrapper.cs index c44a17b..6c8f0d6 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheTestAsyncWrapper.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheTestAsyncWrapper.cs @@ -439,12 +439,6 @@ namespace Apache.Ignite.Core.Tests.Cache } /** <inheritDoc /> */ - public void LocalPromote(IEnumerable<TK> keys) - { - _cache.LocalPromote(keys); - } - - /** <inheritDoc /> */ public IQueryCursor<ICacheEntry<TK, TV>> Query(QueryBase qry) { return _cache.Query(qry); http://git-wip-us.apache.org/repos/asf/ignite/blob/0da8c70a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/ICache.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/ICache.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/ICache.cs index 5a4cdcf..b7cb0d5 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/ICache.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/ICache.cs @@ -693,12 +693,6 @@ namespace Apache.Ignite.Core.Cache Task<int> GetSizeAsync(params CachePeekMode[] modes); /// <summary> - /// This method unswaps cache entries by given keys, if any, from swap storage into memory. - /// </summary> - /// <param name="keys">Keys to promote entries for.</param> - void LocalPromote(IEnumerable<TK> keys); - - /// <summary> /// Queries cache. /// </summary> /// <param name="qry">Query.</param> http://git-wip-us.apache.org/repos/asf/ignite/blob/0da8c70a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheImpl.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheImpl.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheImpl.cs index 516f91c..6009659 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheImpl.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheImpl.cs @@ -818,14 +818,6 @@ namespace Apache.Ignite.Core.Impl.Cache return (int) DoOutInOp((int) op, modes0); } - /** <inheritDoc /> */ - public void LocalPromote(IEnumerable<TK> keys) - { - IgniteArgumentCheck.NotNull(keys, "keys"); - - DoOutOp(CacheOp.LocPromote, writer => WriteEnumerable(writer, keys)); - } - /** <inheritdoc /> */ public TRes Invoke<TArg, TRes>(TK key, ICacheEntryProcessor<TK, TV, TArg, TRes> processor, TArg arg) { http://git-wip-us.apache.org/repos/asf/ignite/blob/0da8c70a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheOp.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheOp.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheOp.cs index dc4f9aa..51fef40 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheOp.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheOp.cs @@ -40,7 +40,6 @@ namespace Apache.Ignite.Core.Impl.Cache LoadCache = 15, LocEvict = 16, LocLoadCache = 17, - LocPromote = 18, LocalClear = 20, LocalClearAll = 21, Lock = 22,
