Github user mcgilman commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/1306#discussion_r112474822
  
    --- Diff: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/dao/impl/StandardRemoteProcessGroupDAO.java
 ---
    @@ -318,13 +329,35 @@ public RemoteGroupPort 
updateRemoteProcessGroupOutputPort(String remoteProcessGr
             verifyUpdatePort(port, remoteProcessGroupPortDto);
     
             // perform the update
    +        updatePort(port, remoteProcessGroupPortDto, remoteProcessGroup);
    +
    +        return port;
    +    }
    +
    +    /**
    +     *
    +     * @param port Port instance to be updated.
    +     * @param remoteProcessGroupPortDto DTO containing updated remote 
process group port settings.
    +     * @param remoteProcessGroup If remoteProcessGroupPortDto has updated 
isTransmitting input,
    +     *                           this method will start or stop the port 
in this remoteProcessGroup as necessary.
    +     */
    +    private void updatePort(RemoteGroupPort port, 
RemoteProcessGroupPortDTO remoteProcessGroupPortDto, RemoteProcessGroup 
remoteProcessGroup) {
             if 
(isNotNull(remoteProcessGroupPortDto.getConcurrentlySchedulableTaskCount())) {
                 
port.setMaxConcurrentTasks(remoteProcessGroupPortDto.getConcurrentlySchedulableTaskCount());
             }
             if (isNotNull(remoteProcessGroupPortDto.getUseCompression())) {
                 
port.setUseCompression(remoteProcessGroupPortDto.getUseCompression());
             }
     
    +        final Integer batchCount = 
remoteProcessGroupPortDto.getBatchCount();
    +        final String batchSize = remoteProcessGroupPortDto.getBatchSize();
    +        final String batchDuration = 
remoteProcessGroupPortDto.getBatchDuration();
    +        if (isAnyNotNull(batchCount, batchSize, batchDuration)) {
    --- End diff --
    
    Is there a reason we are setting all three batch settings when any one of 
them have been specified. In our other endpoints, we support partial updating. 
For instance, if a field is not specified in the incoming request it's 
underlying value will not be changed. With this approach, if the incoming 
request only contains a batchCount, it will result in setting the batchSize and 
batchDuration to null effectively clearing their current value. I think we want 
separate if statements for each field to remain consistent.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to