Mihhai commented on PR #10353:
URL: https://github.com/apache/nifi/pull/10353#issuecomment-3365952181

   > > I believe it's currently not compatible with the API implemented by 
MiNiFi C++, but we're open to an API change if we can agree that the new API is 
an improvement, and if we can provide a transition period. I find it difficult 
to understand what protocol API this code maps to. In MiNiFi C++, I believe we 
have this:
   > > ```
   > > * Operation: START/STOP
   > >   valid "name": C2 | FlowController | <component UUID> | <component name>
   > >   content / arguments: (empty, not used)
   > > ```
   > > 
   > > 
   > >     
   > >       
   > >     
   > > 
   > >       
   > >     
   > > 
   > >     
   > >   
   > > From what I understand after talking to @pkedvessy, this pull request 
adds a new "name" called "processor, where we would put the processor UUID in 
the (currently unused) arguments, as a JSON Object with the key "processorId".
   > 
   > Just to have a clear example currently in MiNiFi C++ the format of the 
start/stop request looks like the following where the operand is a processor id:
   > 
   > ```
   > {
   >     "operation": "heartbeat",
   >     "requested_operations": [
   >         {
   >             "operationid": 41,
   >             "operation": "stop",
   >             "operand": "2438e3c8-015a-1000-79ca-83af40ec1991"
   >         }
   >     ]
   > }
   > ```
   > 
   > What is the equivalent json in this case?
   
   Currently the json for a stop flow opearation which is already integrated in 
the java solution would be :
   ```
   {
       "requested_operations": [
           {
               "identifier": <some-id>,
               "operation": "STOP",
               "operand": "FLOW"
           }
       ]
   }
   ```
   I believe this stops everything inside the root process group, and if 
anything other than FLOW is sent as operand the command fails
   
   The json for the stop processor command i proposed would look like this:
   ```
   {
       "requested_operations": [
           {
               "identifier": <some-id>,
               "operation": "STOP",
               "operand": "PROCESSOR",
               "args": {
                       "processorId": "processor_id"
               }
           }
       ]
   }
   ```
   This is the implementation i naturally gravitated towards given the 
selection machanism of handlers that the java implementation has. It selects 
the proper handler based on a combination of operation/operand.
   
   I believe there are already some differences between the interfaces of the 2 
implementations.So in order to be compatible with the cpp variant and have 
start/stop per processor we would need some sort of detection logic for the 
value received in the operand field.


-- 
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]

Reply via email to