GrantPSpencer commented on code in PR #2724:
URL: https://github.com/apache/helix/pull/2724#discussion_r1446707676
##########
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:
Yes we did have deletePerPartitition. This lineis just modified due to
changing the naming of a constant. I added a new resource name constant, so the
original RESOURCE_NAME --> RESOURCE_NAME1 and my new resource name ==
RESOURCE_NAME2
This would remove 1 partition from the customizedState map for that
resource. In order to do a full reset, they'd have to delete every single
partition from that map. The new API's just allow them to operate a higher
level (on the resource or customizedState level, rather than on a per partition
level)
--
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]