vrajat commented on code in PR #15720:
URL: https://github.com/apache/pinot/pull/15720#discussion_r2080070650
##########
pinot-controller/src/test/java/org/apache/pinot/controller/api/resources/PinotLogicalTableResourceTest.java:
##########
@@ -128,91 +132,183 @@ public void testCreateUpdateDeleteLogicalTables(String
logicalTableName, List<St
verifyLogicalTableDoesNotExists(getLogicalTableUrl);
}
- @Test
- public void testLogicalTableValidationTests()
+ @Test(expectedExceptions = IOException.class,
+ expectedExceptionsMessageRegExp = ".*Reason: 'quota.storage' should not
be set for logical table.*")
+ public void testLogicalTableQuotaConfigValidation()
throws IOException {
- String addLogicalTableUrl =
_controllerRequestURLBuilder.forLogicalTableCreate();
+ List<String> physicalTableNamesWithType =
createHybridTables(List.of("test_table_1"));
+ LogicalTableConfig logicalTableConfig =
+ getDummyLogicalTableConfig(LOGICAL_TABLE_NAME,
physicalTableNamesWithType, BROKER_TENANT);
+ logicalTableConfig.setQuotaConfig(new QuotaConfig("10G", "999"));
+ ControllerTest.sendPostRequest(_addLogicalTableUrl,
logicalTableConfig.toSingleLineJsonString(), getHeaders());
+ fail("Logical Table POST request should have failed");
Review Comment:
nit. You dont need this. Testng framework will take care of a successful
call.
##########
pinot-common/src/main/java/org/apache/pinot/common/config/provider/TableCache.java:
##########
@@ -363,14 +366,13 @@ private void putTableConfig(ZNRecord znRecord)
private void putLogicalTableConfig(ZNRecord znRecord)
throws IOException {
- LogicalTableConfig logicalTableConfig =
LogicalTableUtils.fromZNRecord(znRecord);
+ LogicalTableConfig logicalTableConfig =
LogicalTableConfigUtils.fromZNRecord(znRecord);
String logicalTableName = logicalTableConfig.getTableName();
+ _logicalTableConfigInfoMap.put(logicalTableName, new
LogicalTableConfigInfo(logicalTableConfig));
Review Comment:
What is the significance of this change ? I assumed that standardizing on
lowercase as a key would be better.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]