[GitHub] [pulsar] jerrypeng commented on a change in pull request #3770: Allow users to update everything in inputspecs except for isregexpattern

2019-03-06 Thread GitBox
jerrypeng commented on a change in pull request #3770: Allow users to update 
everything in inputspecs except for isregexpattern
URL: https://github.com/apache/pulsar/pull/3770#discussion_r263113441
 
 

 ##
 File path: 
pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/FunctionConfigUtilsTest.java
 ##
 @@ -157,6 +157,15 @@ public void testMergeDifferentInputs() {
 FunctionConfigUtils.validateUpdate(functionConfig, newFunctionConfig);
 }
 
+@Test(expectedExceptions = IllegalArgumentException.class, 
expectedExceptionsMessageRegExp = "Input Specs mismatch")
 
 Review comment:
   Can we also add a test case that tests that other configs e.g. 
receiverQueueSize can be passed/updated without error


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [pulsar] jerrypeng commented on a change in pull request #3770: Allow users to update everything in inputspecs except for isregexpattern

2019-03-06 Thread GitBox
jerrypeng commented on a change in pull request #3770: Allow users to update 
everything in inputspecs except for isregexpattern
URL: https://github.com/apache/pulsar/pull/3770#discussion_r263112143
 
 

 ##
 File path: 
pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/SinkConfigUtils.java
 ##
 @@ -416,7 +416,7 @@ public static SinkConfig validateUpdate(SinkConfig 
existingConfig, SinkConfig ne
 if (!existingConfig.getInputSpecs().containsKey(topicName)) {
 throw new IllegalArgumentException("Input Topics cannot be 
altered");
 }
-if 
(!consumerConfig.equals(existingConfig.getInputSpecs().get(topicName))) {
+if (consumerConfig.isRegexPattern() != 
existingConfig.getInputSpecs().get(topicName).isRegexPattern()) {
 throw new IllegalArgumentException("Input Specs mismatch");
 
 Review comment:
   Can we modify the message of the exception to be more specific?  That would 
help a lot in debugging


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services