Uh oh!
There was an error while loading. Please reload this page.
PHOENIX-6118: Multi Tenant Workloads using PHERF - #878
Conversation
jpisaac
commented
Sep 11, 2020
- Added configuration classes and interfaces for multi-tenant workloads
jpisaac
commented
Sep 11, 2020
@ChinmaySKulkarni@yanxinyi@gokceni I am breaking this PR into multiple commits so that it is easy to review. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
ChinmaySKulkarni
left a comment
There was a problem hiding this comment.
Had a quick glance and looks good overall. Is it helpful to add interfaces for some of the configuration classes instead of directly adding solid implementations?
Uh oh!
There was an error while loading. Please reload this page.
| import javax.xml.bind.annotation.XmlType; | ||
| @XmlType | ||
| public class Noop { |
There was a problem hiding this comment.
Why do we need this NoOp class for?
There was a problem hiding this comment.
I think this is for no operation that simulates the idle time.
There was a problem hiding this comment.
@ChinmaySKulkarni This holds the idle time to be used for waiting. Modeled it as an operation, thus follows the same pattern as other operations.
There was a problem hiding this comment.
Can we rename it so it reflects an operation aimed at injecting "idle/wait time"?
There was a problem hiding this comment.
Ping @jpisaac I think we should still consider renaming the class so it is clear that it is introduced for the sole purpose of adding wait time. Maybe call it IdleOp
| import java.util.List; | ||
| @XmlType | ||
| public class LoadProfile { |
There was a problem hiding this comment.
Can you add header comments for all newly introduced classes?
There was a problem hiding this comment.
@ChinmaySKulkarni added the headers, since you commented let me know if I missed anything.
There was a problem hiding this comment.
I meant class-level comments for all the new classes
| .getType() == DataTypeMapping.VARCHAR) ? "'" : ""; | ||
| ret = ret.replace("[" + dynamicField + "]", | ||
| needQuotes + ruleApplier.getDataValue(dynamicColumn).getValue() + needQuotes); | ||
| } |
| @@ -0,0 +1,362 @@ | |||
| <?xml version="1.0" encoding="UTF-8" standalone="yes"?> | |||
There was a problem hiding this comment.
I prefer to put this scenario file under /phoenix-pherf/src/main/resources/scenario/ dir since this is an example of how to run instead of a test case.
There was a problem hiding this comment.
@yanxinyi This file is used in testWorkloadWithLoadProfile in ConfigurationParserTest. So I think it makes sense to keep it in the test/resources folder.
jpisaac
commented
Sep 17, 2020
@ChinmaySKulkarni All configuration classes are mapped to XML files (configs/definitions) so making them interfaces may not help and not add much value. Since they typically will have only getters and setters and there will be only one concrete implementation which matches the underlying XML structure. |
stoty
commented
Sep 28, 2020
💔 -1 overall
This message was automatically generated. |
stoty
commented
Nov 19, 2020
💔 -1 overall
This message was automatically generated. |
stoty
commented
Dec 3, 2020
💔 -1 overall
This message was automatically generated. |
| public final ExpectedSystemExit exit = ExpectedSystemExit.none(); | ||
| @Test | ||
| @Ignore |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| // Assume the first rule map | ||
| Map<DataTypeMapping, List> ruleMap = modelList.get(0); | ||
| List<Column> ruleList = ruleMap.get(phxMetaColumn.getType()); | ||
| //LOGGER.info(String.format("Did not found a correct override column rule, %s, %s", phxMetaColumn.getName(), phxMetaColumn.getType())); |
| statement.setNull(count, Types.DATE); | ||
| } else { | ||
| Date | ||
| date = |
There was a problem hiding this comment.
can you address this in the next PR
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
1086c20 to
ede0f62Comparestoty
commented
Dec 11, 2020
💔 -1 overall
This message was automatically generated. |
Uh oh!
There was an error while loading. Please reload this page.
| ( | ||
| GID | ||
| ) | ||
| ) AS SELECT * FROM PHERF.TEST_MULTI_TENANT_TABLE WHERE IDENTIFIER = 'EV1' |
There was a problem hiding this comment.
I didn't find the DDL for PHERF.TEST_MULTI_TENANT_TABLE
ChinmaySKulkarni
left a comment
There was a problem hiding this comment.
Added some comments @jpisaac
| public final ExpectedSystemExit exit = ExpectedSystemExit.none(); | ||
| @Test | ||
| @Ignore |
| for (Scenario scenario : model.getScenarios()) { | ||
| LOGGER.debug(String.format("Testing %s", scenario.getName())); | ||
| LoadProfile loadProfile = scenario.getLoadProfile(); | ||
| assertTrue("tenant group size is not as expected: ", |
There was a problem hiding this comment.
nit: Use assertEquals() instead
There was a problem hiding this comment.
Same for other such instances
| while (ops-- > 0) { | ||
| TenantOperationInfo info = evtGen.next(); | ||
| TenantOperationImpl op = opFactory.getOperation(info); | ||
| int row = TestOperationGroup.valueOf(info.getOperationGroupId()).ordinal(); |
There was a problem hiding this comment.
can't we just use the enum value instead of referring to its ordinal here?
| public class MultiTenantOperationBaseIT extends ParallelStatsDisabledIT { | ||
| static enum TestOperationGroup { | ||
| op1, op2, op3, op4, op5 |
There was a problem hiding this comment.
There seems to be some inherent assumption what each operation group does i.e. upsert vs NoOp, etc. as per my understanding. Can you rename the enum values and/or add some comments to clarify this?
| LOGGER.info(pUtil.getGSON().toJson(stats)); | ||
| if (info.getOperation().getType() == Operation.OperationType.PRE_RUN) continue; | ||
| switch (row) { | ||
| case 0: |
There was a problem hiding this comment.
Why not use switch on the enum values themselves rather than the ordinal?
| /** | ||
| * Holds metrics + contextual info on the operation run. | ||
| */ | ||
| public class OperationStats { |
There was a problem hiding this comment.
Shouldn't operationStats really be different per Operation? Operation is an interface whereas this is a concrete class. Each operation type might have their own stats, no? Maybe make this an abstract class instead and have each operation type implement their own stats which extend this?
| long duration = EnvironmentEdgeManager.currentTimeMillis() - startTime; | ||
| return new OperationStats(input, startTime, 0, 0, duration); | ||
| } catch (InterruptedException e) { | ||
| e.printStackTrace(); |
| Scenario testScenarioWithLoadProfile = scenarioList.get(0); | ||
| LoadProfile loadProfile = testScenarioWithLoadProfile.getLoadProfile(); | ||
| assertTrue("batch size not as expected: ", |
There was a problem hiding this comment.
Nit: Use assertEquals() everywhere
| // If we don't parse the DTD, the variable 'name' won't be defined in the XML | ||
| LOGGER.warn("Caught expected exception", e); | ||
| } | ||
| return null; |
There was a problem hiding this comment.
Are we handling this null value in the caller?
| for (Scenario scenario : model.getScenarios()) { | ||
| LOGGER.debug(String.format("Testing %s", scenario.getName())); | ||
| LoadProfile loadProfile = scenario.getLoadProfile(); | ||
| assertTrue("tenant group size is not as expected: ", |
There was a problem hiding this comment.
nit: assertEquals throughout
stoty
commented
Jan 6, 2021
💔 -1 overall
This message was automatically generated. |
stoty
commented
Jan 9, 2021
💔 -1 overall
This message was automatically generated. |
yanxinyi
commented
Jan 27, 2021
@jpisaac can you handle the above comments and solve the conflicts? |
715efd9 to
5b4be38Comparejpisaac
commented
Feb 26, 2021
@ChinmaySKulkarni@yanxinyi Rebased it to 4.x tip |
stoty
commented
Feb 26, 2021
💔 -1 overall
This message was automatically generated. |
stoty
commented
Mar 24, 2021
💔 -1 overall
This message was automatically generated. |
jpisaac
commented
Mar 24, 2021
@yanxinyi@ChinmaySKulkarni for 4.x |
stoty
commented
Mar 24, 2021
💔 -1 overall
This message was automatically generated. |
| import org.apache.phoenix.pherf.result.ResultValue; | ||
| import org.apache.phoenix.pherf.result.file.ResultFileDetails; | ||
| import org.apache.phoenix.pherf.result.impl.CSVFileResultHandler; | ||
| import org.junit.Ignore; |
There was a problem hiding this comment.
nit: can you remove this unused import from the next PR. Don't need to fix it now