You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by dp...@apache.org on 2019/01/22 18:14:20 UTC

[ignite] branch ignite-11030-test created (now 3af7bec)

This is an automated email from the ASF dual-hosted git repository.

dpavlov pushed a change to branch ignite-11030-test
in repository https://gitbox.apache.org/repos/asf/ignite.git.


      at 3af7bec  IGNITE-11030 Sandbox test for reading DB

This branch includes the following new commits:

     new 3af7bec  IGNITE-11030 Sandbox test for reading DB

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[ignite] 01/01: IGNITE-11030 Sandbox test for reading DB

Posted by dp...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

dpavlov pushed a commit to branch ignite-11030-test
in repository https://gitbox.apache.org/repos/asf/ignite.git

commit 3af7bec3bad5712575866d463eb7fce6105141f4
Author: Dmitriy Pavlov <dp...@apache.org>
AuthorDate: Tue Jan 22 21:14:09 2019 +0300

    IGNITE-11030 Sandbox test for reading DB
---
 .../persistence/db/IgniteTcBotSandboxTest.java     | 82 ++++++++++++++++++++++
 1 file changed, 82 insertions(+)

diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgniteTcBotSandboxTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgniteTcBotSandboxTest.java
new file mode 100644
index 0000000..58969d0
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgniteTcBotSandboxTest.java
@@ -0,0 +1,82 @@
+/*
+* 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.persistence.db;
+
+import com.google.common.base.Preconditions;
+import org.apache.ignite.IgniteBinary;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.binary.BinaryObject;
+import org.apache.ignite.binary.BinaryObjectBuilder;
+import org.apache.ignite.configuration.DataRegionConfiguration;
+import org.apache.ignite.configuration.DataStorageConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.configuration.WALMode;
+import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.junit.Test;
+
+public class IgniteTcBotSandboxTest extends GridCommonAbstractTest {
+
+    public static final String TEST_HIST_CACHE_NAME = "teamcityTestRunHist";
+
+    @Test
+    public void readTcBotDb() throws Exception {
+        //IgniteConfiguration cfg = new IgniteConfiguration();
+       // Ignite start = Ignition.start(cfg);
+        IgniteEx ignite = startGrid(0);
+        ignite.cluster().active(true);
+
+        IgniteCache<Object, Object> cache = ignite.cache(TEST_HIST_CACHE_NAME);
+        Preconditions.checkNotNull(cache, "Cache should be present, present caches ["  + ignite.cacheNames() + "]");
+        IgniteCache<BinaryObject, BinaryObject> entries = cache.withKeepBinary();
+        IgniteBinary binary = ignite.binary();
+        BinaryObjectBuilder builder = binary.builder("org.apache.ignite.ci.teamcity.ignited.runhist.RunHistKey");
+
+        builder.setField("srvId", 1411517106);
+        builder.setField("testOrSuiteName", 11924);
+        builder.setField("branch", 281);
+
+        //idHash=1028871081, hash=1241170874, srvId=1411517106, testOrSuiteName=11924, branch=281
+
+        BinaryObject key = builder.build();
+        BinaryObject val = entries.get(key);
+
+        System.out.println(val);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
+        IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
+
+        cfg.setWorkDirectory("C:\\projects\\corrupt\\work"); // todo set correct path
+
+        cfg.setConsistentId("TcHelper");
+
+        DataRegionConfiguration regCfg = new DataRegionConfiguration()
+            .setMaxSize(2L * 1024 * 1024 * 1027)
+            .setPersistenceEnabled(true);
+
+        DataStorageConfiguration dsCfg = new DataStorageConfiguration()
+            .setWalMode(WALMode.LOG_ONLY)
+            .setDefaultDataRegionConfiguration(regCfg);
+
+        cfg.setDataStorageConfiguration(dsCfg);
+
+        return cfg;
+    }
+}