GrantPSpencer commented on code in PR #2724:
URL: https://github.com/apache/helix/pull/2724#discussion_r1454274638
##########
helix-core/src/test/java/org/apache/helix/integration/paticipant/TestCustomizedStateUpdate.java:
##########
@@ -130,52 +131,142 @@ public void testUpdateCustomizedState() {
stateMap2.put("PREVIOUS_STATE", "STARTED");
stateMap2.put("CURRENT_STATE", "END_OF_PUSH_RECEIVED");
_mockProvider
- .updateCustomizedState(CUSTOMIZE_STATE_NAME, RESOURCE_NAME,
PARTITION_NAME2, stateMap2);
+ .updateCustomizedState(CUSTOMIZE_STATE_NAME, RESOURCE_NAME1,
PARTITION_NAME2, stateMap2);
- customizedState = _mockProvider.getCustomizedState(CUSTOMIZE_STATE_NAME,
RESOURCE_NAME);
+ customizedState = _mockProvider.getCustomizedState(CUSTOMIZE_STATE_NAME,
RESOURCE_NAME1);
Assert.assertNotNull(customizedState);
- Assert.assertEquals(customizedState.getId(), RESOURCE_NAME);
+ Assert.assertEquals(customizedState.getId(), RESOURCE_NAME1);
mapView = customizedState.getRecord().getMapFields();
Assert.assertEquals(mapView.keySet().size(), 2);
Assert.assertEqualsNoOrder(mapView.keySet().toArray(),
new String[] { PARTITION_NAME1, PARTITION_NAME2 });
Map<String, String> partitionMap1 = _mockProvider
- .getPerPartitionCustomizedState(CUSTOMIZE_STATE_NAME, RESOURCE_NAME,
PARTITION_NAME1);
+ .getPerPartitionCustomizedState(CUSTOMIZE_STATE_NAME, RESOURCE_NAME1,
PARTITION_NAME1);
Assert.assertEquals(partitionMap1.keySet().size(), 3);
Assert.assertEquals(partitionMap1.get("PREVIOUS_STATE"),
"END_OF_PUSH_RECEIVED");
Assert.assertEquals(partitionMap1.get("CURRENT_STATE"), "COMPLETED");
Map<String, String> partitionMap2 = _mockProvider
- .getPerPartitionCustomizedState(CUSTOMIZE_STATE_NAME, RESOURCE_NAME,
PARTITION_NAME2);
+ .getPerPartitionCustomizedState(CUSTOMIZE_STATE_NAME, RESOURCE_NAME1,
PARTITION_NAME2);
Assert.assertEquals(partitionMap2.keySet().size(), 3);
Assert.assertEquals(partitionMap2.get("PREVIOUS_STATE"), "STARTED");
Assert.assertEquals(partitionMap2.get("CURRENT_STATE"),
"END_OF_PUSH_RECEIVED");
// test delete customized state for a partition
_mockProvider
- .deletePerPartitionCustomizedState(CUSTOMIZE_STATE_NAME,
RESOURCE_NAME, PARTITION_NAME1);
- customizedState = _mockProvider.getCustomizedState(CUSTOMIZE_STATE_NAME,
RESOURCE_NAME);
+ .deletePerPartitionCustomizedState(CUSTOMIZE_STATE_NAME,
RESOURCE_NAME1, PARTITION_NAME1);
Review Comment:
It is possible to use the deletePerPartitionCustomizedState but would
require significantly more writes to be. They'd have to modify each entry in
the mapFields one by one, rather than operate at the level of the znode as a
whole.
--
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]