You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@phoenix.apache.org by GitBox <gi...@apache.org> on 2021/03/26 23:34:30 UTC
[GitHub] [phoenix] jpisaac opened a new pull request #1185: PHOENIX-6429 Add support for global connections and sequential data generators
jpisaac opened a new pull request #1185:
URL: https://github.com/apache/phoenix/pull/1185
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [phoenix] yanxinyi commented on a change in pull request #1185: PHOENIX-6429 Add support for global connections and sequential data generators
Posted by GitBox <gi...@apache.org>.
yanxinyi commented on a change in pull request #1185:
URL: https://github.com/apache/phoenix/pull/1185#discussion_r602637762
##########
File path: phoenix-pherf/src/main/java/org/apache/phoenix/pherf/rules/SequentialListDataGenerator.java
##########
@@ -0,0 +1,66 @@
+/*
+ * 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.phoenix.pherf.rules;
+
+import com.google.common.base.Preconditions;
+import org.apache.phoenix.pherf.configuration.Column;
+import org.apache.phoenix.pherf.configuration.DataSequence;
+import org.apache.phoenix.pherf.configuration.DataTypeMapping;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.concurrent.atomic.AtomicLong;
+
+public class SequentialListDataGenerator implements RuleBasedDataGenerator {
+ private static final Logger LOGGER = LoggerFactory.getLogger(SequentialListDataGenerator.class);
Review comment:
nit: do we use this LOGGER anywhere?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [phoenix] ChinmaySKulkarni commented on a change in pull request #1185: PHOENIX-6429 Add support for global connections and sequential data generators
Posted by GitBox <gi...@apache.org>.
ChinmaySKulkarni commented on a change in pull request #1185:
URL: https://github.com/apache/phoenix/pull/1185#discussion_r602636895
##########
File path: phoenix-pherf/src/main/java/org/apache/phoenix/pherf/rules/SequentialDateDataGenerator.java
##########
@@ -0,0 +1,64 @@
+/*
+ * 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.phoenix.pherf.rules;
+
+import com.google.common.base.Preconditions;
+import org.apache.phoenix.pherf.configuration.Column;
+import org.apache.phoenix.pherf.configuration.DataSequence;
+import org.apache.phoenix.pherf.configuration.DataTypeMapping;
+
+import org.joda.time.LocalDateTime;
+import org.joda.time.format.DateTimeFormat;
+import org.joda.time.format.DateTimeFormatter;
+import java.util.concurrent.atomic.AtomicInteger;
+
+public class SequentialDateDataGenerator implements RuleBasedDataGenerator {
+ private static DateTimeFormatter FMT = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss.SSS");
+ private final Column columnRule;
+ private final AtomicInteger counter;
+ private final LocalDateTime startDateTime = new LocalDateTime();
+
+ public SequentialDateDataGenerator(Column columnRule) {
+ Preconditions.checkArgument(columnRule.getDataSequence() == DataSequence.SEQUENTIAL);
+ Preconditions.checkArgument(isDateType(columnRule.getType()));
+ this.columnRule = columnRule;
+ counter = new AtomicInteger(0);
+ }
+
+ /**
+ * Note that this method rolls over for attempts to get larger than maxValue
+ * @return new DataValue
+ */
+ @Override
+ public DataValue getDataValue() {
+ LocalDateTime newDateTime = startDateTime.plusSeconds(counter.getAndIncrement());
Review comment:
since we are using an AtomicInteger for counter, looks like we will be accessing this concurrently. In that case, we should probably also ensure atomic updates to `startDateTime` right?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [phoenix] stoty commented on pull request #1185: PHOENIX-6429 Add support for global connections and sequential data generators
Posted by GitBox <gi...@apache.org>.
stoty commented on pull request #1185:
URL: https://github.com/apache/phoenix/pull/1185#issuecomment-808949304
:broken_heart: **-1 overall**
| Vote | Subsystem | Runtime | Comment |
|:----:|----------:|--------:|:--------|
| +0 :ok: | reexec | 0m 34s | Docker mode activated. |
||| _ Prechecks _ |
| +1 :green_heart: | dupname | 0m 0s | No case conflicting files found. |
| +1 :green_heart: | hbaseanti | 0m 0s | Patch does not have any anti-patterns. |
| +1 :green_heart: | @author | 0m 0s | The patch does not contain any @author tags. |
| +1 :green_heart: | test4tests | 0m 0s | The patch appears to include 10 new or modified test files. |
||| _ 4.x Compile Tests _ |
| +0 :ok: | mvndep | 5m 29s | Maven dependency ordering for branch |
| +1 :green_heart: | mvninstall | 9m 32s | 4.x passed |
| +1 :green_heart: | compile | 1m 38s | 4.x passed |
| +1 :green_heart: | checkstyle | 0m 51s | 4.x passed |
| +1 :green_heart: | javadoc | 1m 1s | 4.x passed |
| +0 :ok: | spotbugs | 3m 1s | phoenix-core in 4.x has 941 extant spotbugs warnings. |
| +0 :ok: | spotbugs | 0m 54s | phoenix-pherf in 4.x has 50 extant spotbugs warnings. |
||| _ Patch Compile Tests _ |
| +0 :ok: | mvndep | 0m 13s | Maven dependency ordering for patch |
| +1 :green_heart: | mvninstall | 5m 49s | the patch passed |
| +1 :green_heart: | compile | 1m 38s | the patch passed |
| +1 :green_heart: | javac | 1m 38s | the patch passed |
| -1 :x: | checkstyle | 0m 26s | phoenix-pherf: The patch generated 107 new + 501 unchanged - 37 fixed = 608 total (was 538) |
| -1 :x: | whitespace | 0m 0s | The patch 8 line(s) with tabs. |
| +1 :green_heart: | xml | 0m 4s | The patch has no ill-formed XML file. |
| +1 :green_heart: | javadoc | 0m 59s | the patch passed |
| -1 :x: | spotbugs | 1m 9s | phoenix-pherf generated 1 new + 50 unchanged - 0 fixed = 51 total (was 50) |
||| _ Other Tests _ |
| +1 :green_heart: | unit | 132m 23s | phoenix-core in the patch passed. |
| +1 :green_heart: | unit | 8m 54s | phoenix-pherf in the patch passed. |
| +1 :green_heart: | asflicense | 0m 19s | The patch does not generate ASF License warnings. |
| | | 179m 47s | |
| Reason | Tests |
|-------:|:------|
| FindBugs | module:phoenix-pherf |
| | A prepared statement is generated from a nonconstant String in org.apache.phoenix.pherf.workload.mt.tenantoperation.PreScenarioOperationSupplier$1.apply(TenantOperationInfo) At PreScenarioOperationSupplier.java:from a nonconstant String in org.apache.phoenix.pherf.workload.mt.tenantoperation.PreScenarioOperationSupplier$1.apply(TenantOperationInfo) At PreScenarioOperationSupplier.java:[line 76] |
| Subsystem | Report/Notes |
|----------:|:-------------|
| Docker | ClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1185/2/artifact/yetus-general-check/output/Dockerfile |
| GITHUB PR | https://github.com/apache/phoenix/pull/1185 |
| Optional Tests | dupname asflicense javac javadoc unit spotbugs hbaseanti checkstyle compile xml |
| uname | Linux c056d5298868 4.15.0-112-generic #113-Ubuntu SMP Thu Jul 9 23:41:39 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux |
| Build tool | maven |
| Personality | dev/phoenix-personality.sh |
| git revision | 4.x / 3535708 |
| Default Java | Private Build-1.8.0_242-8u242-b08-0ubuntu3~16.04-b08 |
| checkstyle | https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1185/2/artifact/yetus-general-check/output/diff-checkstyle-phoenix-pherf.txt |
| whitespace | https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1185/2/artifact/yetus-general-check/output/whitespace-tabs.txt |
| spotbugs | https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1185/2/artifact/yetus-general-check/output/new-spotbugs-phoenix-pherf.html |
| Test Results | https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1185/2/testReport/ |
| Max. process+thread count | 6019 (vs. ulimit of 30000) |
| modules | C: phoenix-core phoenix-pherf U: . |
| Console output | https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1185/2/console |
| versions | git=2.7.4 maven=3.3.9 spotbugs=4.1.3 |
| Powered by | Apache Yetus 0.12.0 https://yetus.apache.org |
This message was automatically generated.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [phoenix] jpisaac commented on a change in pull request #1185: PHOENIX-6429 Add support for global connections and sequential data generators
Posted by GitBox <gi...@apache.org>.
jpisaac commented on a change in pull request #1185:
URL: https://github.com/apache/phoenix/pull/1185#discussion_r605165727
##########
File path: phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/mt/tenantoperation/PreScenarioOperationSupplier.java
##########
@@ -55,24 +56,27 @@ public OperationStats apply(final TenantOperationInfo input) {
final String opGroup = input.getOperationGroupId();
final String tableName = input.getTableName();
final String scenarioName = input.getScenarioName();
+ final boolean isTenantGroupGlobal = (tenantGroup.compareTo(TenantGroup.DEFAULT_GLOBAL_ID) == 0);
long startTime = EnvironmentEdgeManager.currentTimeMillis();
int status = 0;
if (!operation.getPreScenarioDdls().isEmpty()) {
for (Ddl ddl : operation.getPreScenarioDdls()) {
- final String tenantId = ddl.isUseGlobalConnection() ? null : input.getTenantId();
+ // TODO:
+ // Ideally the fact that the op needs to executed using global connection
+ // needs to be built into the framework and injected during event generation.
+ // For now a special tenant whose id = "TGLOBAL00000001" will be logged.
+ final String tenantId = isTenantGroupGlobal || ddl.isUseGlobalConnection() ? null : input.getTenantId();
final String opName = String.format("%s:%s:%s:%s:%s",
scenarioName, tableName, opGroup, tenantGroup, input.getTenantId());
try (Connection conn = phoenixUtil.getConnection(tenantId)) {
LOGGER.info("\nExecuting DDL:" + ddl + ", OPERATION:" + opName);
- phoenixUtil.executeStatement(ddl.toString(), conn);
+ String sql = ddl.toString();
+ phoenixUtil.executeStatement(sql, conn);
if (ddl.getStatement().toUpperCase().contains(phoenixUtil.ASYNC_KEYWORD)) {
phoenixUtil.waitForAsyncIndexToFinish(ddl.getTableName());
}
- } catch (SQLException sqle) {
- LOGGER.error("Operation " + opName + " failed with exception ", sqle);
- status = -1;
Review comment:
@ChinmaySKulkarni
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [phoenix] ChinmaySKulkarni commented on a change in pull request #1185: PHOENIX-6429 Add support for global connections and sequential data generators
Posted by GitBox <gi...@apache.org>.
ChinmaySKulkarni commented on a change in pull request #1185:
URL: https://github.com/apache/phoenix/pull/1185#discussion_r602635060
##########
File path: phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/mt/tenantoperation/PreScenarioOperationSupplier.java
##########
@@ -48,32 +49,34 @@ public PreScenarioOperationSupplier(PhoenixUtil phoenixUtil, DataModel model, Sc
@Override
public OperationStats apply(final TenantOperationInfo input) {
+ Preconditions.checkNotNull(input);
final PreScenarioOperation operation = (PreScenarioOperation) input.getOperation();
- final String tenantId = input.getTenantId();
final String tenantGroup = input.getTenantGroupId();
final String opGroup = input.getOperationGroupId();
final String tableName = input.getTableName();
final String scenarioName = input.getScenarioName();
- final String opName = String.format("%s:%s:%s:%s:%s",
- scenarioName, tableName, opGroup, tenantGroup, tenantId);
long startTime = EnvironmentEdgeManager.currentTimeMillis();
int status = 0;
if (!operation.getPreScenarioDdls().isEmpty()) {
- try (Connection conn = phoenixUtil.getConnection(tenantId)) {
- for (Ddl ddl : operation.getPreScenarioDdls()) {
- LOGGER.info("\nExecuting DDL:" + ddl + " on tenantId:" + tenantId);
+ for (Ddl ddl : operation.getPreScenarioDdls()) {
+ final String tenantId = ddl.isUseGlobalConnection() ? null : input.getTenantId();
+ final String opName = String.format("%s:%s:%s:%s:%s",
Review comment:
Like discussed offline, can you add a comment saying that `input.getTenantId()` is only used for logging purposes in the case of global connections?
##########
File path: phoenix-pherf/src/main/java/org/apache/phoenix/pherf/rules/SequentialDateDataGenerator.java
##########
@@ -0,0 +1,64 @@
+/*
+ * 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.phoenix.pherf.rules;
+
+import com.google.common.base.Preconditions;
+import org.apache.phoenix.pherf.configuration.Column;
+import org.apache.phoenix.pherf.configuration.DataSequence;
+import org.apache.phoenix.pherf.configuration.DataTypeMapping;
+
+import org.joda.time.LocalDateTime;
+import org.joda.time.format.DateTimeFormat;
+import org.joda.time.format.DateTimeFormatter;
+import java.util.concurrent.atomic.AtomicInteger;
+
+public class SequentialDateDataGenerator implements RuleBasedDataGenerator {
+ private static DateTimeFormatter FMT = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss.SSS");
+ private final Column columnRule;
+ private final AtomicInteger counter;
+ private final LocalDateTime startDateTime = new LocalDateTime();
+
+ public SequentialDateDataGenerator(Column columnRule) {
+ Preconditions.checkArgument(columnRule.getDataSequence() == DataSequence.SEQUENTIAL);
+ Preconditions.checkArgument(isDateType(columnRule.getType()));
+ this.columnRule = columnRule;
+ counter = new AtomicInteger(0);
+ }
+
+ /**
+ * Note that this method rolls over for attempts to get larger than maxValue
+ * @return new DataValue
+ */
+ @Override
+ public DataValue getDataValue() {
+ LocalDateTime newDateTime = startDateTime.plusSeconds(counter.getAndIncrement());
Review comment:
since we are using an AtomicInteger for counter, looks like we will be accessing this concurrently. In that case, we should probably also ensure atomic updates to `startDateTime` right?
##########
File path: phoenix-pherf/src/test/java/org/apache/phoenix/pherf/rules/SequentialDateDataGeneratorTest.java
##########
@@ -0,0 +1,78 @@
+/*
+ * 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.phoenix.pherf.rules;
+
+import org.apache.phoenix.pherf.configuration.Column;
+import org.apache.phoenix.pherf.configuration.DataSequence;
+import org.joda.time.LocalDateTime;
+import org.joda.time.format.DateTimeFormat;
+import org.joda.time.format.DateTimeFormatter;
+import org.junit.Test;
+
+import static org.apache.phoenix.pherf.configuration.DataTypeMapping.DATE;
+import static org.apache.phoenix.pherf.configuration.DataTypeMapping.VARCHAR;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+public class SequentialDateDataGeneratorTest {
+ SequentialDateDataGenerator generator;
+
+ @Test(expected = IllegalArgumentException.class)
+ public void testRejectsNonSequential() {
+ Column columnA = new Column();
+ columnA.setType(DATE);
+ columnA.setDataSequence(DataSequence.RANDOM);
+
+ //should reject this Column
+ generator = new SequentialDateDataGenerator(columnA);
+ }
+
+ @Test(expected = IllegalArgumentException.class)
+ public void testRejectsNonDate() {
+ Column columnA = new Column();
+ columnA.setType(VARCHAR);
+ columnA.setDataSequence(DataSequence.SEQUENTIAL);
+
+ //should reject this Column
+ generator = new SequentialDateDataGenerator(columnA);
+ }
+
+ @Test
+ public void testGetDataValue() {
+ DateTimeFormatter FMT = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss.SSS");
+ Column columnA = new Column();
+ columnA.setType(DATE);
+ columnA.setDataSequence(DataSequence.SEQUENTIAL);
+ LocalDateTime startDateTime = new LocalDateTime();
+
+ // The increments are the of 1 sec units
+ generator = new SequentialDateDataGenerator(columnA);
+ DataValue result1 = generator.getDataValue();
+ LocalDateTime result1LocalTime = FMT.parseDateTime(result1.getValue()).toLocalDateTime();
+ assertTrue(!result1LocalTime.isBefore(startDateTime));
Review comment:
nit: use assertFalse instead
##########
File path: phoenix-pherf/src/main/java/org/apache/phoenix/pherf/rules/SequentialVarcharDataGenerator.java
##########
@@ -0,0 +1,77 @@
+/*
+ * 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.phoenix.pherf.rules;
+
+import com.google.common.base.Preconditions;
+import org.apache.commons.lang.StringUtils;
+import org.apache.phoenix.pherf.configuration.Column;
+import org.apache.phoenix.pherf.configuration.DataSequence;
+import org.apache.phoenix.pherf.configuration.DataTypeMapping;
+import org.joda.time.LocalDateTime;
+import org.joda.time.format.DateTimeFormat;
+import org.joda.time.format.DateTimeFormatter;
+
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.AtomicLong;
+
+public class SequentialVarcharDataGenerator implements RuleBasedDataGenerator {
Review comment:
nit: add class-level comment about usage?
##########
File path: phoenix-pherf/src/main/java/org/apache/phoenix/pherf/rules/SequentialListDataGenerator.java
##########
@@ -0,0 +1,66 @@
+/*
+ * 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.phoenix.pherf.rules;
+
+import com.google.common.base.Preconditions;
+import org.apache.phoenix.pherf.configuration.Column;
+import org.apache.phoenix.pherf.configuration.DataSequence;
+import org.apache.phoenix.pherf.configuration.DataTypeMapping;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.concurrent.atomic.AtomicLong;
+
+public class SequentialListDataGenerator implements RuleBasedDataGenerator {
Review comment:
nit: add class-level comment about usage?
##########
File path: phoenix-pherf/src/main/java/org/apache/phoenix/pherf/rules/SequentialDateDataGenerator.java
##########
@@ -0,0 +1,64 @@
+/*
+ * 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.phoenix.pherf.rules;
+
+import com.google.common.base.Preconditions;
+import org.apache.phoenix.pherf.configuration.Column;
+import org.apache.phoenix.pherf.configuration.DataSequence;
+import org.apache.phoenix.pherf.configuration.DataTypeMapping;
+
+import org.joda.time.LocalDateTime;
+import org.joda.time.format.DateTimeFormat;
+import org.joda.time.format.DateTimeFormatter;
+import java.util.concurrent.atomic.AtomicInteger;
+
+public class SequentialDateDataGenerator implements RuleBasedDataGenerator {
Review comment:
nit: Add class-level comment?
##########
File path: phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/mt/tenantoperation/PreScenarioOperationSupplier.java
##########
@@ -48,32 +49,34 @@ public PreScenarioOperationSupplier(PhoenixUtil phoenixUtil, DataModel model, Sc
@Override
public OperationStats apply(final TenantOperationInfo input) {
+ Preconditions.checkNotNull(input);
final PreScenarioOperation operation = (PreScenarioOperation) input.getOperation();
- final String tenantId = input.getTenantId();
final String tenantGroup = input.getTenantGroupId();
final String opGroup = input.getOperationGroupId();
final String tableName = input.getTableName();
final String scenarioName = input.getScenarioName();
- final String opName = String.format("%s:%s:%s:%s:%s",
- scenarioName, tableName, opGroup, tenantGroup, tenantId);
long startTime = EnvironmentEdgeManager.currentTimeMillis();
int status = 0;
if (!operation.getPreScenarioDdls().isEmpty()) {
- try (Connection conn = phoenixUtil.getConnection(tenantId)) {
- for (Ddl ddl : operation.getPreScenarioDdls()) {
- LOGGER.info("\nExecuting DDL:" + ddl + " on tenantId:" + tenantId);
+ for (Ddl ddl : operation.getPreScenarioDdls()) {
+ final String tenantId = ddl.isUseGlobalConnection() ? null : input.getTenantId();
+ final String opName = String.format("%s:%s:%s:%s:%s",
+ scenarioName, tableName, opGroup, tenantGroup, input.getTenantId());
+
+ try (Connection conn = phoenixUtil.getConnection(tenantId)) {
+ LOGGER.info("\nExecuting DDL:" + ddl + ", OPERATION:" + opName);
phoenixUtil.executeStatement(ddl.toString(), conn);
if (ddl.getStatement().toUpperCase().contains(phoenixUtil.ASYNC_KEYWORD)) {
phoenixUtil.waitForAsyncIndexToFinish(ddl.getTableName());
}
+ } catch (SQLException sqle) {
Review comment:
Looks like you don't need this catch block since the one below does the same thing and covers it
##########
File path: phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/LoadProfile.java
##########
@@ -37,7 +37,7 @@
* TenantId format should typically have 2 parts -
* 1. string fmt - that hold the tenant group id.
* 2. int fmt - that holds a random number between 1 and max tenants
- * for e.g DEFAULT_TENANT_ID_FMT = "00D%s%07d";
+ * for e.g DEFAULT_TENANT_ID_FMT = "T%s%07d";
Review comment:
Maybe add the comment for global connections here?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [phoenix] jpisaac commented on a change in pull request #1185: PHOENIX-6429 Add support for global connections and sequential data generators
Posted by GitBox <gi...@apache.org>.
jpisaac commented on a change in pull request #1185:
URL: https://github.com/apache/phoenix/pull/1185#discussion_r605165518
##########
File path: phoenix-pherf/src/test/java/org/apache/phoenix/pherf/rules/SequentialDateDataGeneratorTest.java
##########
@@ -64,7 +64,7 @@ public void testGetDataValue() {
generator = new SequentialDateDataGenerator(columnA);
DataValue result1 = generator.getDataValue();
LocalDateTime result1LocalTime = FMT.parseDateTime(result1.getValue()).toLocalDateTime();
- assertTrue(!result1LocalTime.isBefore(startDateTime));
+ assertFalse(result1LocalTime.isBefore(startDateTime));
Review comment:
@ChinmaySKulkarni
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [phoenix] yanxinyi merged pull request #1185: PHOENIX-6429 Add support for global connections and sequential data generators
Posted by GitBox <gi...@apache.org>.
yanxinyi merged pull request #1185:
URL: https://github.com/apache/phoenix/pull/1185
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [phoenix] stoty commented on pull request #1185: PHOENIX-6429 Add support for global connections and sequential data generators
Posted by GitBox <gi...@apache.org>.
stoty commented on pull request #1185:
URL: https://github.com/apache/phoenix/pull/1185#issuecomment-811615576
:broken_heart: **-1 overall**
| Vote | Subsystem | Runtime | Comment |
|:----:|----------:|--------:|:--------|
| +0 :ok: | reexec | 5m 44s | Docker mode activated. |
||| _ Prechecks _ |
| +1 :green_heart: | dupname | 0m 0s | No case conflicting files found. |
| +1 :green_heart: | hbaseanti | 0m 0s | Patch does not have any anti-patterns. |
| +1 :green_heart: | @author | 0m 1s | The patch does not contain any @author tags. |
| +1 :green_heart: | test4tests | 0m 0s | The patch appears to include 10 new or modified test files. |
||| _ 4.x Compile Tests _ |
| +0 :ok: | mvndep | 5m 11s | Maven dependency ordering for branch |
| +1 :green_heart: | mvninstall | 9m 12s | 4.x passed |
| +1 :green_heart: | compile | 1m 37s | 4.x passed |
| +1 :green_heart: | checkstyle | 0m 49s | 4.x passed |
| +1 :green_heart: | javadoc | 1m 1s | 4.x passed |
| +0 :ok: | spotbugs | 3m 2s | phoenix-core in 4.x has 941 extant spotbugs warnings. |
| +0 :ok: | spotbugs | 0m 52s | phoenix-pherf in 4.x has 50 extant spotbugs warnings. |
||| _ Patch Compile Tests _ |
| +0 :ok: | mvndep | 0m 13s | Maven dependency ordering for patch |
| +1 :green_heart: | mvninstall | 5m 40s | the patch passed |
| +1 :green_heart: | compile | 1m 35s | the patch passed |
| +1 :green_heart: | javac | 1m 35s | the patch passed |
| -1 :x: | checkstyle | 0m 27s | phoenix-pherf: The patch generated 104 new + 504 unchanged - 34 fixed = 608 total (was 538) |
| -1 :x: | whitespace | 0m 0s | The patch 8 line(s) with tabs. |
| +1 :green_heart: | xml | 0m 4s | The patch has no ill-formed XML file. |
| +1 :green_heart: | javadoc | 0m 59s | the patch passed |
| -1 :x: | spotbugs | 1m 7s | phoenix-pherf generated 1 new + 50 unchanged - 0 fixed = 51 total (was 50) |
||| _ Other Tests _ |
| +1 :green_heart: | unit | 175m 10s | phoenix-core in the patch passed. |
| +1 :green_heart: | unit | 8m 33s | phoenix-pherf in the patch passed. |
| +1 :green_heart: | asflicense | 0m 18s | The patch does not generate ASF License warnings. |
| | | 226m 30s | |
| Reason | Tests |
|-------:|:------|
| FindBugs | module:phoenix-pherf |
| | A prepared statement is generated from a nonconstant String in org.apache.phoenix.pherf.workload.mt.tenantoperation.PreScenarioOperationSupplier$1.apply(TenantOperationInfo) At PreScenarioOperationSupplier.java:from a nonconstant String in org.apache.phoenix.pherf.workload.mt.tenantoperation.PreScenarioOperationSupplier$1.apply(TenantOperationInfo) At PreScenarioOperationSupplier.java:[line 76] |
| Subsystem | Report/Notes |
|----------:|:-------------|
| Docker | ClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1185/3/artifact/yetus-general-check/output/Dockerfile |
| GITHUB PR | https://github.com/apache/phoenix/pull/1185 |
| Optional Tests | dupname asflicense javac javadoc unit spotbugs hbaseanti checkstyle compile xml |
| uname | Linux 5a1aa1daf60a 4.15.0-112-generic #113-Ubuntu SMP Thu Jul 9 23:41:39 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux |
| Build tool | maven |
| Personality | dev/phoenix-personality.sh |
| git revision | 4.x / 3535708 |
| Default Java | Private Build-1.8.0_242-8u242-b08-0ubuntu3~16.04-b08 |
| checkstyle | https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1185/3/artifact/yetus-general-check/output/diff-checkstyle-phoenix-pherf.txt |
| whitespace | https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1185/3/artifact/yetus-general-check/output/whitespace-tabs.txt |
| spotbugs | https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1185/3/artifact/yetus-general-check/output/new-spotbugs-phoenix-pherf.html |
| Test Results | https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1185/3/testReport/ |
| Max. process+thread count | 5949 (vs. ulimit of 30000) |
| modules | C: phoenix-core phoenix-pherf U: . |
| Console output | https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1185/3/console |
| versions | git=2.7.4 maven=3.3.9 spotbugs=4.1.3 |
| Powered by | Apache Yetus 0.12.0 https://yetus.apache.org |
This message was automatically generated.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [phoenix] yanxinyi commented on a change in pull request #1185: PHOENIX-6429 Add support for global connections and sequential data generators
Posted by GitBox <gi...@apache.org>.
yanxinyi commented on a change in pull request #1185:
URL: https://github.com/apache/phoenix/pull/1185#discussion_r602638143
##########
File path: phoenix-pherf/src/main/java/org/apache/phoenix/pherf/rules/SequentialListDataGenerator.java
##########
@@ -0,0 +1,66 @@
+/*
+ * 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.phoenix.pherf.rules;
+
+import com.google.common.base.Preconditions;
Review comment:
import org.apache.phoenix.thirdparty.com.google.common.base.Preconditions;
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [phoenix] stoty commented on pull request #1185: PHOENIX-6429 Add support for global connections and sequential data generators
Posted by GitBox <gi...@apache.org>.
stoty commented on pull request #1185:
URL: https://github.com/apache/phoenix/pull/1185#issuecomment-808599154
:broken_heart: **-1 overall**
| Vote | Subsystem | Runtime | Comment |
|:----:|----------:|--------:|:--------|
| +0 :ok: | reexec | 0m 32s | Docker mode activated. |
||| _ Prechecks _ |
| +1 :green_heart: | dupname | 0m 0s | No case conflicting files found. |
| +1 :green_heart: | hbaseanti | 0m 0s | Patch does not have any anti-patterns. |
| +1 :green_heart: | @author | 0m 0s | The patch does not contain any @author tags. |
| +1 :green_heart: | test4tests | 0m 0s | The patch appears to include 5 new or modified test files. |
||| _ 4.x Compile Tests _ |
| +1 :green_heart: | mvninstall | 14m 22s | 4.x passed |
| +1 :green_heart: | compile | 0m 35s | 4.x passed |
| +1 :green_heart: | checkstyle | 0m 24s | 4.x passed |
| +1 :green_heart: | javadoc | 0m 18s | 4.x passed |
| +0 :ok: | spotbugs | 0m 57s | phoenix-pherf in 4.x has 50 extant spotbugs warnings. |
||| _ Patch Compile Tests _ |
| +1 :green_heart: | mvninstall | 5m 46s | the patch passed |
| +1 :green_heart: | compile | 0m 37s | the patch passed |
| +1 :green_heart: | javac | 0m 37s | the patch passed |
| -1 :x: | checkstyle | 0m 26s | phoenix-pherf: The patch generated 96 new + 507 unchanged - 31 fixed = 603 total (was 538) |
| -1 :x: | whitespace | 0m 0s | The patch 8 line(s) with tabs. |
| +1 :green_heart: | xml | 0m 1s | The patch has no ill-formed XML file. |
| +1 :green_heart: | javadoc | 0m 15s | the patch passed |
| -1 :x: | spotbugs | 1m 17s | phoenix-pherf generated 2 new + 50 unchanged - 0 fixed = 52 total (was 50) |
||| _ Other Tests _ |
| +1 :green_heart: | unit | 9m 35s | phoenix-pherf in the patch passed. |
| +1 :green_heart: | asflicense | 0m 9s | The patch does not generate ASF License warnings. |
| | | 36m 11s | |
| Reason | Tests |
|-------:|:------|
| FindBugs | module:phoenix-pherf |
| | Switch statement found in org.apache.phoenix.pherf.rules.RulesApplier.getRuleBasedDataGeneratorForColumn(Column) where default case is missing At RulesApplier.java:where default case is missing At RulesApplier.java:[lines 555-573] |
| | A prepared statement is generated from a nonconstant String in org.apache.phoenix.pherf.workload.mt.tenantoperation.PreScenarioOperationSupplier$1.apply(TenantOperationInfo) At PreScenarioOperationSupplier.java:from a nonconstant String in org.apache.phoenix.pherf.workload.mt.tenantoperation.PreScenarioOperationSupplier$1.apply(TenantOperationInfo) At PreScenarioOperationSupplier.java:[line 69] |
| Subsystem | Report/Notes |
|----------:|:-------------|
| Docker | ClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1185/1/artifact/yetus-general-check/output/Dockerfile |
| GITHUB PR | https://github.com/apache/phoenix/pull/1185 |
| Optional Tests | dupname asflicense javac javadoc unit spotbugs hbaseanti checkstyle compile xml |
| uname | Linux d97d90b96f85 4.15.0-112-generic #113-Ubuntu SMP Thu Jul 9 23:41:39 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux |
| Build tool | maven |
| Personality | dev/phoenix-personality.sh |
| git revision | 4.x / 3535708 |
| Default Java | Private Build-1.8.0_242-8u242-b08-0ubuntu3~16.04-b08 |
| checkstyle | https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1185/1/artifact/yetus-general-check/output/diff-checkstyle-phoenix-pherf.txt |
| whitespace | https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1185/1/artifact/yetus-general-check/output/whitespace-tabs.txt |
| spotbugs | https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1185/1/artifact/yetus-general-check/output/new-spotbugs-phoenix-pherf.html |
| Test Results | https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1185/1/testReport/ |
| Max. process+thread count | 1842 (vs. ulimit of 30000) |
| modules | C: phoenix-pherf U: phoenix-pherf |
| Console output | https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1185/1/console |
| versions | git=2.7.4 maven=3.3.9 spotbugs=4.1.3 |
| Powered by | Apache Yetus 0.12.0 https://yetus.apache.org |
This message was automatically generated.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [phoenix] yanxinyi commented on a change in pull request #1185: PHOENIX-6429 Add support for global connections and sequential data generators
Posted by GitBox <gi...@apache.org>.
yanxinyi commented on a change in pull request #1185:
URL: https://github.com/apache/phoenix/pull/1185#discussion_r602637325
##########
File path: phoenix-pherf/src/test/java/org/apache/phoenix/pherf/rules/SequentialDateDataGeneratorTest.java
##########
@@ -0,0 +1,78 @@
+/*
+ * 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.phoenix.pherf.rules;
+
+import org.apache.phoenix.pherf.configuration.Column;
+import org.apache.phoenix.pherf.configuration.DataSequence;
+import org.joda.time.LocalDateTime;
+import org.joda.time.format.DateTimeFormat;
+import org.joda.time.format.DateTimeFormatter;
+import org.junit.Test;
+
+import static org.apache.phoenix.pherf.configuration.DataTypeMapping.DATE;
+import static org.apache.phoenix.pherf.configuration.DataTypeMapping.VARCHAR;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+public class SequentialDateDataGeneratorTest {
+ SequentialDateDataGenerator generator;
+
+ @Test(expected = IllegalArgumentException.class)
+ public void testRejectsNonSequential() {
+ Column columnA = new Column();
+ columnA.setType(DATE);
+ columnA.setDataSequence(DataSequence.RANDOM);
+
+ //should reject this Column
+ generator = new SequentialDateDataGenerator(columnA);
+ }
+
+ @Test(expected = IllegalArgumentException.class)
+ public void testRejectsNonDate() {
+ Column columnA = new Column();
+ columnA.setType(VARCHAR);
+ columnA.setDataSequence(DataSequence.SEQUENTIAL);
+
+ //should reject this Column
+ generator = new SequentialDateDataGenerator(columnA);
+ }
+
+ @Test
+ public void testGetDataValue() {
+ DateTimeFormatter FMT = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss.SSS");
+ Column columnA = new Column();
+ columnA.setType(DATE);
+ columnA.setDataSequence(DataSequence.SEQUENTIAL);
+ LocalDateTime startDateTime = new LocalDateTime();
+
+ // The increments are the of 1 sec units
+ generator = new SequentialDateDataGenerator(columnA);
+ DataValue result1 = generator.getDataValue();
+ LocalDateTime result1LocalTime = FMT.parseDateTime(result1.getValue()).toLocalDateTime();
+ assertTrue(!result1LocalTime.isBefore(startDateTime));
Review comment:
nit:
assertFalse(result1LocalTime.isBefore(startDateTime));
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [phoenix] ChinmaySKulkarni commented on a change in pull request #1185: PHOENIX-6429 Add support for global connections and sequential data generators
Posted by GitBox <gi...@apache.org>.
ChinmaySKulkarni commented on a change in pull request #1185:
URL: https://github.com/apache/phoenix/pull/1185#discussion_r605094883
##########
File path: phoenix-pherf/src/test/java/org/apache/phoenix/pherf/rules/SequentialDateDataGeneratorTest.java
##########
@@ -0,0 +1,78 @@
+/*
+ * 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.phoenix.pherf.rules;
+
+import org.apache.phoenix.pherf.configuration.Column;
+import org.apache.phoenix.pherf.configuration.DataSequence;
+import org.joda.time.LocalDateTime;
+import org.joda.time.format.DateTimeFormat;
+import org.joda.time.format.DateTimeFormatter;
+import org.junit.Test;
+
+import static org.apache.phoenix.pherf.configuration.DataTypeMapping.DATE;
+import static org.apache.phoenix.pherf.configuration.DataTypeMapping.VARCHAR;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+public class SequentialDateDataGeneratorTest {
+ SequentialDateDataGenerator generator;
+
+ @Test(expected = IllegalArgumentException.class)
+ public void testRejectsNonSequential() {
+ Column columnA = new Column();
+ columnA.setType(DATE);
+ columnA.setDataSequence(DataSequence.RANDOM);
+
+ //should reject this Column
+ generator = new SequentialDateDataGenerator(columnA);
+ }
+
+ @Test(expected = IllegalArgumentException.class)
+ public void testRejectsNonDate() {
+ Column columnA = new Column();
+ columnA.setType(VARCHAR);
+ columnA.setDataSequence(DataSequence.SEQUENTIAL);
+
+ //should reject this Column
+ generator = new SequentialDateDataGenerator(columnA);
+ }
+
+ @Test
+ public void testGetDataValue() {
+ DateTimeFormatter FMT = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss.SSS");
+ Column columnA = new Column();
+ columnA.setType(DATE);
+ columnA.setDataSequence(DataSequence.SEQUENTIAL);
+ LocalDateTime startDateTime = new LocalDateTime();
+
+ // The increments are the of 1 sec units
+ generator = new SequentialDateDataGenerator(columnA);
+ DataValue result1 = generator.getDataValue();
+ LocalDateTime result1LocalTime = FMT.parseDateTime(result1.getValue()).toLocalDateTime();
+ assertTrue(!result1LocalTime.isBefore(startDateTime));
Review comment:
@jpisaac this nit is unaddressed
##########
File path: phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/mt/tenantoperation/PreScenarioOperationSupplier.java
##########
@@ -48,32 +49,34 @@ public PreScenarioOperationSupplier(PhoenixUtil phoenixUtil, DataModel model, Sc
@Override
public OperationStats apply(final TenantOperationInfo input) {
+ Preconditions.checkNotNull(input);
final PreScenarioOperation operation = (PreScenarioOperation) input.getOperation();
- final String tenantId = input.getTenantId();
final String tenantGroup = input.getTenantGroupId();
final String opGroup = input.getOperationGroupId();
final String tableName = input.getTableName();
final String scenarioName = input.getScenarioName();
- final String opName = String.format("%s:%s:%s:%s:%s",
- scenarioName, tableName, opGroup, tenantGroup, tenantId);
long startTime = EnvironmentEdgeManager.currentTimeMillis();
int status = 0;
if (!operation.getPreScenarioDdls().isEmpty()) {
- try (Connection conn = phoenixUtil.getConnection(tenantId)) {
- for (Ddl ddl : operation.getPreScenarioDdls()) {
- LOGGER.info("\nExecuting DDL:" + ddl + " on tenantId:" + tenantId);
+ for (Ddl ddl : operation.getPreScenarioDdls()) {
+ final String tenantId = ddl.isUseGlobalConnection() ? null : input.getTenantId();
+ final String opName = String.format("%s:%s:%s:%s:%s",
+ scenarioName, tableName, opGroup, tenantGroup, input.getTenantId());
+
+ try (Connection conn = phoenixUtil.getConnection(tenantId)) {
+ LOGGER.info("\nExecuting DDL:" + ddl + ", OPERATION:" + opName);
phoenixUtil.executeStatement(ddl.toString(), conn);
if (ddl.getStatement().toUpperCase().contains(phoenixUtil.ASYNC_KEYWORD)) {
phoenixUtil.waitForAsyncIndexToFinish(ddl.getTableName());
}
+ } catch (SQLException sqle) {
Review comment:
@jpisaac ping
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [phoenix] yanxinyi commented on a change in pull request #1185: PHOENIX-6429 Add support for global connections and sequential data generators
Posted by GitBox <gi...@apache.org>.
yanxinyi commented on a change in pull request #1185:
URL: https://github.com/apache/phoenix/pull/1185#discussion_r602638162
##########
File path: phoenix-pherf/src/main/java/org/apache/phoenix/pherf/rules/SequentialVarcharDataGenerator.java
##########
@@ -0,0 +1,77 @@
+/*
+ * 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.phoenix.pherf.rules;
+
+import com.google.common.base.Preconditions;
Review comment:
import org.apache.phoenix.thirdparty.com.google.common.base.Preconditions;
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [phoenix] yanxinyi commented on a change in pull request #1185: PHOENIX-6429 Add support for global connections and sequential data generators
Posted by GitBox <gi...@apache.org>.
yanxinyi commented on a change in pull request #1185:
URL: https://github.com/apache/phoenix/pull/1185#discussion_r602638054
##########
File path: phoenix-pherf/src/main/java/org/apache/phoenix/pherf/rules/SequentialDateDataGenerator.java
##########
@@ -0,0 +1,64 @@
+/*
+ * 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.phoenix.pherf.rules;
+
+import com.google.common.base.Preconditions;
Review comment:
should we import from the thirdparty?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org