You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2015/04/03 12:47:27 UTC
[21/50] [abbrv] incubator-ignite git commit: # ignite-sprint-3 added
test
# ignite-sprint-3 added test
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/71f201cb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/71f201cb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/71f201cb
Branch: refs/heads/gg-9998
Commit: 71f201cb203f68a497a404731091c254072fd10e
Parents: 505a7bf
Author: sboikov <sb...@gridgain.com>
Authored: Thu Apr 2 12:08:36 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Thu Apr 2 12:08:36 2015 +0300
----------------------------------------------------------------------
.../transactions/IgniteTxLocalAdapter.java | 4 +-
.../processors/igfs/IgsfStartCacheTest.java | 115 +++++++++++++++++++
2 files changed, 117 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/71f201cb/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
index 9d7f332..f2407ce 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
@@ -3080,8 +3080,8 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
"(cache configurations are not compatible) [" +
"activeCaches=[" + cacheNames + "]" +
", cacheName=" + cacheCtx.name() +
- ", txSystem=" + system() +
- ", cacheSystem=" + cacheCtx.system() + ']');
+ ", cacheSystem=" + cacheCtx.system() +
+ ", txSystem=" + system() + ']');
}
else
activeCacheIds.add(cacheId);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/71f201cb/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgsfStartCacheTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgsfStartCacheTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgsfStartCacheTest.java
new file mode 100644
index 0000000..e2eedbe
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgsfStartCacheTest.java
@@ -0,0 +1,115 @@
+/*
+ * 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.igfs;
+
+import org.apache.ignite.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.igfs.*;
+import org.apache.ignite.internal.util.typedef.*;
+import org.apache.ignite.spi.discovery.tcp.*;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
+
+import java.io.*;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.*;
+import static org.apache.ignite.cache.CacheMode.*;
+import static org.apache.ignite.cache.CacheWriteSynchronizationMode.*;
+import static org.apache.ignite.igfs.IgfsMode.*;
+
+/**
+ *
+ */
+public class IgsfStartCacheTest extends IgfsCommonAbstractTest {
+ /** IP finder. */
+ private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
+
+ /**
+ * @param igfs If {@code true} created IGFS configuration.
+ * @param idx Node index.
+ * @return Configuration
+ */
+ private IgniteConfiguration config(boolean igfs, int idx) {
+ IgniteConfiguration cfg = new IgniteConfiguration();
+
+ TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
+
+ discoSpi.setIpFinder(IP_FINDER);
+
+ cfg.setDiscoverySpi(discoSpi);
+
+ if (igfs) {
+ FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
+
+ igfsCfg.setDataCacheName("dataCache");
+ igfsCfg.setMetaCacheName("metaCache");
+ igfsCfg.setName("igfs");
+ igfsCfg.setDefaultMode(PRIMARY);
+ igfsCfg.setFragmentizerEnabled(false);
+
+ CacheConfiguration dataCacheCfg = new CacheConfiguration();
+
+ dataCacheCfg.setName("dataCache");
+ dataCacheCfg.setCacheMode(PARTITIONED);
+ dataCacheCfg.setAtomicityMode(TRANSACTIONAL);
+ dataCacheCfg.setWriteSynchronizationMode(FULL_SYNC);
+ dataCacheCfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(1));
+
+ CacheConfiguration metaCacheCfg = new CacheConfiguration();
+
+ metaCacheCfg.setName("metaCache");
+ metaCacheCfg.setCacheMode(REPLICATED);
+ metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
+ dataCacheCfg.setWriteSynchronizationMode(FULL_SYNC);
+
+ cfg.setCacheConfiguration(dataCacheCfg, metaCacheCfg);
+ cfg.setFileSystemConfiguration(igfsCfg);
+ }
+
+ cfg.setGridName("node-" + idx);
+
+ return cfg;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void afterTest() throws Exception {
+ super.afterTest();
+
+ stopAllGrids();
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testCacheStart() throws Exception {
+ Ignite g0 = G.start(config(true, 0));
+
+ G.start(config(false, 1));
+
+ IgniteFileSystem igfs = g0.fileSystem("igfs");
+
+ igfs.mkdirs(new IgfsPath("/test"));
+
+ try (BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(igfs.create(
+ new IgfsPath("/test/test.file"), true)))) {
+
+ for (int i = 0; i < 1000; i++)
+ bw.write("test-" + i);
+ }
+ }
+}