[
https://issues.apache.org/jira/browse/PHOENIX-6561?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17440867#comment-17440867
]
ASF GitHub Bot commented on PHOENIX-6561:
-----------------------------------------
jpisaac commented on a change in pull request #1322:
URL: https://github.com/apache/phoenix/pull/1322#discussion_r745248202
##########
File path:
phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/WriteWorkload.java
##########
@@ -97,20 +89,26 @@ public WriteWorkload(PhoenixUtil phoenixUtil,
XMLConfigParser parser, Scenario s
* TODO extract notion of the scenario list and have 1 write workload per
scenario
*
* @param phoenixUtil {@link org.apache.phoenix.pherf.util.PhoenixUtil}
Query helper
- * @param properties {@link java.util.Properties} default properties to
use
* @param parser {@link
org.apache.phoenix.pherf.configuration.XMLConfigParser}
+ * @param properties {@link java.util.Properties} default properties to
use
* @param scenario {@link
org.apache.phoenix.pherf.configuration.Scenario} If null is passed
* it will run against all scenarios in the parsers
list.
* @throws Exception
*/
- public WriteWorkload(PhoenixUtil phoenixUtil, Properties properties,
XMLConfigParser parser,
- Scenario scenario, GeneratePhoenixStats generateStatistics) throws
Exception {
+ public WriteWorkload(PhoenixUtil phoenixUtil, XMLConfigParser parser,
+ Properties properties, Scenario scenario,
+ GeneratePhoenixStats generateStatistics) throws
Exception {
this.pUtil = phoenixUtil;
this.parser = parser;
this.rulesApplier = new RulesApplier(parser);
this.resultUtil = new ResultUtil();
this.generateStatistics = generateStatistics;
- int size =
Integer.parseInt(properties.getProperty("pherf.default.dataloader.threadpool"));
+ if (properties != null) {
Review comment:
Can we ensure that the "properties" field is never null in this
context? It should be handled in the Pherf code/constructor.
I think the previous contract was this field would never be null, we should
try and maintain that.
##########
File path: phoenix-pherf/src/main/java/org/apache/phoenix/pherf/Pherf.java
##########
@@ -127,10 +127,17 @@
private final CompareType compareType;
private final boolean thinDriver;
private final String queryServerUrl;
+ private Properties properties = new Properties();
@VisibleForTesting
WorkloadExecutor workloadExecutor;
+ public Pherf(String[] args, Properties connProperties) throws Exception {
+ this(args);
+ //merging global and connection properties into properties.
+ this.properties.putAll(connProperties);
Review comment:
Good place for null checks against connProperties?
##########
File path:
phoenix-pherf/src/main/java/org/apache/phoenix/pherf/util/PhoenixUtil.java
##########
@@ -157,6 +166,17 @@ public Connection getConnection(String tenantId, boolean
testEnabled, Map<String
}
}
+ private Map<String, String> getPropertyHashMap(Properties props) {
+ if (props == null) {
Review comment:
Same here regarding null checks
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
> Allow pherf to intake phoenix Connection properties as argument.
> ----------------------------------------------------------------
>
> Key: PHOENIX-6561
> URL: https://issues.apache.org/jira/browse/PHOENIX-6561
> Project: Phoenix
> Issue Type: Improvement
> Reporter: Lokesh Khurana
> Assignee: Lokesh Khurana
> Priority: Minor
>
> Currently pherf doesn't allow connection properties to be passed as
> arguments, it allows for some cases through scenario files, but for dynamic
> properties selection that might not work, also for WriteWorkload no property
> is being allowed to pass during connection creation.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)