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 2018/11/24 15:06:37 UTC
[ignite-teamcity-bot] branch ignite-9542-new-run-stripe updated:
IGNITE-9542: New Run stripe implementation: skeleton for new entities
This is an automated email from the ASF dual-hosted git repository.
dpavlov pushed a commit to branch ignite-9542-new-run-stripe
in repository https://gitbox.apache.org/repos/asf/ignite-teamcity-bot.git
The following commit(s) were added to refs/heads/ignite-9542-new-run-stripe by this push:
new 3c02557 IGNITE-9542: New Run stripe implementation: skeleton for new entities
3c02557 is described below
commit 3c025577572eb044f5e180ab90a26e6777d1616d
Author: Dmitriy Pavlov <dp...@apache.org>
AuthorDate: Sat Nov 24 18:06:33 2018 +0300
IGNITE-9542: New Run stripe implementation: skeleton for new entities
---
.../buildcondition/BuildConditionCompacted.java | 1 -
.../ignited/buildstat/RunHistCompacted.java | 57 ++++++++++++++++++++
.../ignited/buildstat/RunHistCompactedDao.java | 61 ++++++++++++++++++++++
.../ci/teamcity/ignited/buildstat/RunHistKey.java | 24 +++++++++
4 files changed, 142 insertions(+), 1 deletion(-)
diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/buildcondition/BuildConditionCompacted.java b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/buildcondition/BuildConditionCompacted.java
index 93074cd..b4e5713 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/buildcondition/BuildConditionCompacted.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/buildcondition/BuildConditionCompacted.java
@@ -20,7 +20,6 @@ package org.apache.ignite.ci.teamcity.ignited.buildcondition;
import java.util.Date;
import org.apache.ignite.ci.teamcity.ignited.IStringCompactor;
-//todo move to ignited package, change cache to 8 partitions
public class BuildConditionCompacted {
/** Build id. */
int buildId = -1;
diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/buildstat/RunHistCompacted.java b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/buildstat/RunHistCompacted.java
new file mode 100644
index 0000000..7723c09
--- /dev/null
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/buildstat/RunHistCompacted.java
@@ -0,0 +1,57 @@
+/*
+ * 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.ci.teamcity.ignited.buildstat;
+
+import org.apache.ignite.cache.query.annotations.QuerySqlField;
+import org.apache.ignite.ci.analysis.IVersionedEntity;
+
+public class RunHistCompacted implements IVersionedEntity {
+ /** Latest version. */
+ private static final int LATEST_VERSION = 1;
+
+ /** Entity fields version. */
+ @SuppressWarnings("FieldCanBeLocal")
+ private short _ver = LATEST_VERSION;
+
+ @QuerySqlField(orderedGroups = {@QuerySqlField.Group(name = "tstAndSrv", order = 0)})
+ private int testNameOrSuite;
+
+ @QuerySqlField(orderedGroups = {@QuerySqlField.Group(name = "tstAndSrv", order = 1)})
+ private int srvId;
+
+ /**
+ * Runs registered all the times.
+ */
+ private int runs;
+
+ /**
+ * Failures registered all the times.
+ */
+ private int failures;
+
+
+ /** {@inheritDoc} */
+ @Override public int version() {
+ return _ver;
+ }
+
+ /** {@inheritDoc} */
+ @Override public int latestVersion() {
+ return LATEST_VERSION;
+ }
+}
diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/buildstat/RunHistCompactedDao.java b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/buildstat/RunHistCompactedDao.java
new file mode 100644
index 0000000..c0c1184
--- /dev/null
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/buildstat/RunHistCompactedDao.java
@@ -0,0 +1,61 @@
+/*
+ * 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.ci.teamcity.ignited.buildstat;
+
+import org.apache.ignite.Ignite;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.cache.QueryEntity;
+import org.apache.ignite.ci.db.TcHelperDb;
+import org.apache.ignite.ci.teamcity.ignited.IStringCompactor;
+import org.apache.ignite.ci.teamcity.ignited.IgniteStringCompactor;
+import org.apache.ignite.configuration.CacheConfiguration;
+
+import javax.inject.Inject;
+import javax.inject.Provider;
+import java.util.Collections;
+
+public class RunHistCompactedDao {
+ /** Cache name*/
+ public static final String TEST_HIST_CACHE_NAME = "testRunHist";
+
+ /** Ignite provider. */
+ @Inject
+ private Provider<Ignite> igniteProvider;
+
+ /** Test history cache. */
+ private IgniteCache<RunHistKey, RunHistCompacted> testHistCache;
+
+ /** Build start time. */
+ private IgniteCache<Integer, Long> buildStartTime;
+
+ /** Compactor. */
+ @Inject private IStringCompactor compactor;
+
+ /**
+ * Initialize
+ */
+ public void init () {
+ Ignite ignite = igniteProvider.get();
+
+ final CacheConfiguration<RunHistKey, RunHistCompacted> cfg = TcHelperDb.getCacheV2Config(TEST_HIST_CACHE_NAME);
+
+ cfg.setQueryEntities(Collections.singletonList(new QueryEntity(RunHistKey.class, RunHistCompacted.class)));
+
+ testHistCache = ignite.getOrCreateCache(cfg);
+ }
+}
diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/buildstat/RunHistKey.java b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/buildstat/RunHistKey.java
new file mode 100644
index 0000000..c95e49d
--- /dev/null
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/buildstat/RunHistKey.java
@@ -0,0 +1,24 @@
+/*
+ * 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.ci.teamcity.ignited.buildstat;
+
+public class RunHistKey {
+ private int srvId;
+ private int testNameOrSuite;
+ private int branch;
+}