[ 
https://issues.apache.org/jira/browse/MINIFICPP-682?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16710220#comment-16710220
 ] 

ASF GitHub Bot commented on MINIFICPP-682:
------------------------------------------

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

    https://github.com/apache/nifi-minifi-cpp/pull/448#discussion_r239108187
  
    --- Diff: nanofi/include/api/nanofi.h ---
    @@ -135,16 +274,62 @@ flow_file_record* create_ff_object(const char *file, 
const size_t len, const uin
     
     flow_file_record* create_ff_object_na(const char *file, const size_t len, 
const uint64_t size);
     
    -void free_flowfile(flow_file_record*);
    +/**
    + * Get incoming flow file. To be used in processor logic callbacks.
    + * @param session current processor session
    + * @param context current processor context
    + * @return a flow file record or nullptr in case there is none in the 
session
    + **/
    +flow_file_record* get_flowfile(processor_session* session, 
processor_context* context);
    +
    +
    +/**
    + * Free flow file
    + * @param ff flow file
    + **/
    +void free_flowfile(flow_file_record* ff);
     
    +/**
    + * Adds an attribute, fails in case there is already an attribute with the 
given key.
    + * @param ff flow file
    + * @param key name of attribute
    + * @param value location of value
    + * @size size size of the data pointed by "value"
    + * @return 0 in case of success, -1 otherwise (already existed)
    + **/
     uint8_t add_attribute(flow_file_record*, const char *key, void *value, 
size_t size);
     
    -void update_attribute(flow_file_record*, const char *key, void *value, 
size_t size);
    +/**
    + * Updates an attribute (adds if it hasn't existed before)
    + * @param ff flow file
    + * @param key name of attribute
    + * @param value location of value
    + * @size size size of the data pointed by "value"
    + **/
    +void update_attribute(flow_file_record* ff, const char *key, void *value, 
size_t size);
     
    -uint8_t get_attribute(flow_file_record *ff, attribute *caller_attribute);
    +/**
    + * Get the value of an attribute. Value and value size are written to 
parameter "caller_attribute"
    + * @param ff flow file
    + * @param caller_attribute attribute structure to provide name and get 
value, size
    + * @return 0 in case of success, -1 otherwise (no such attribute)
    + **/
    +uint8_t get_attribute(const flow_file_record *ff, attribute 
*caller_attribute);
     
    +/**
    + * Get the quantity of attributes
    + * @param ff flow file
    + * @return the number of attributes
    + **/
     int get_attribute_qty(const flow_file_record* ff);
    --- End diff --
    
    I thought there was a ticket for this ( can't find it so maybe it was never 
made ?? ) but we shouldn't be using qty or similar within an API. This should 
be count or quantity.


> C API: provide functions to create custom processors
> ----------------------------------------------------
>
>                 Key: MINIFICPP-682
>                 URL: https://issues.apache.org/jira/browse/MINIFICPP-682
>             Project: NiFi MiNiFi C++
>          Issue Type: Improvement
>            Reporter: Arpad Boda
>            Assignee: Arpad Boda
>            Priority: Major
>              Labels: CAPI, nanofi
>             Fix For: 0.6.0
>
>
> Extend C API to:
> -Provide functions that can be used used to implement custom processor.
> -Custom processor should be able to read/update both the content and the 
> attributes of flowfile, route to "failure" and "success" relationships. 
> -API should support adding these custom processors to flows and invoke them 
> as standalones, too. 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to