Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/sprint-2' into sprint-2
Browse files Browse the repository at this point in the history
  • Loading branch information
Yakov Zhdanov committed Feb 17, 2015
2 parents 04b0880 + e3a6c22 commit fd06847
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ private GridClientConnectionManager createConnectionManager(UUID clientId, SSLCo
Class<?> cls = Class.forName(ENT_CONN_MGR_CLS);

Constructor<?> cons = cls.getConstructor(UUID.class, SSLContext.class, GridClientConfiguration.class,
Collection.class, GridClientTopology.class, Byte.class);
Collection.class, GridClientTopology.class, Byte.class, boolean.class);

mgr = (GridClientConnectionManager)cons.newInstance(clientId, sslCtx, cfg, routers, top, marshId,
routerClient);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6185,6 +6185,8 @@ private LoadCacheClosure(String cacheName, IgniteBiPredicate<K, V> p, Object[] a
out.writeObject(p);

out.writeObject(args);

U.writeString(out, cacheName);
}

/** {@inheritDoc} */
Expand All @@ -6193,6 +6195,8 @@ private LoadCacheClosure(String cacheName, IgniteBiPredicate<K, V> p, Object[] a
p = (IgniteBiPredicate<K, V>)in.readObject();

args = (Object[])in.readObject();

cacheName = U.readString(in);
}

/** {@inheritDoc} */
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/*
* 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.near;

import org.apache.ignite.*;
import org.apache.ignite.cache.*;
import org.apache.ignite.internal.processors.cache.*;
import org.apache.ignite.transactions.*;

import static org.apache.ignite.cache.CacheMode.*;
import static org.apache.ignite.transactions.TransactionConcurrency.*;
import static org.apache.ignite.transactions.TransactionIsolation.*;

/**
*
*/
public class IgniteCacheNearReadCommittedTest extends GridCacheAbstractSelfTest {
/** {@inheritDoc} */
@Override protected int gridCount() {
return 2;
}

/** {@inheritDoc} */
@Override protected CacheDistributionMode distributionMode() {
return CacheDistributionMode.NEAR_PARTITIONED;
}

/** {@inheritDoc} */
@Override protected CacheMode cacheMode() {
return PARTITIONED;
}

/**
* @throws Exception If failed.
*/
public void testReadCommittedCacheCleanup() throws Exception {
IgniteCache<Integer, Integer> cache = ignite(0).jcache(null);

Integer key = backupKey(cache);

cache.put(key, key);

try (Transaction tx = ignite(0).transactions().txStart(PESSIMISTIC, READ_COMMITTED)) {
assertEquals(key, cache.get(key));

tx.commit();
}

ignite(1).jcache(null).remove(key); // Remove from primary node.

assertEquals(0, cache.localSize());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,9 @@ public static TestSuite suite() throws Exception {
// suite.addTestSuite(IgniteCacheInvokeReadThroughTest.class);
// suite.addTestSuite(GridCacheVersionMultinodeTest.class);

// TODO IGNITE-285.
// suite.addTestSuite(IgniteCacheNearReadCommittedTest.class);

return suite;
}
}

0 comments on commit fd06847

Please sign in to comment.