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

    https://github.com/apache/nifi-minifi-cpp/pull/74#discussion_r110004494
  
    --- Diff: libminifi/src/provenance/ProvenanceTaskReport.cpp ---
    @@ -0,0 +1,221 @@
    +/**
    + * @file ProvenanceTaskReport.cpp
    + * ProvenanceTaskReport class implementation
    + *
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +#include <vector>
    +#include <queue>
    +#include <map>
    +#include <set>
    +#include <sys/time.h>
    +#include <time.h>
    +#include <sstream>
    +#include <string.h>
    +#include <iostream>
    +
    +#include "provenance/ProvenanceTaskReport.h"
    +#include "../include/io/StreamFactory.h"
    +#include "io/ClientSocket.h"
    +#include "utils/TimeUtil.h"
    +#include "core/ProcessContext.h"
    +#include "core/ProcessSession.h"
    +#include "provenance/Provenance.h"
    +#include "FlowController.h"
    +
    +#include "json/json.h"
    +#include "json/writer.h"
    +
    +namespace org {
    +namespace apache {
    +namespace nifi {
    +namespace minifi {
    +namespace provenance{
    +
    +const std::string 
ProvenanceTaskReport::ProcessorName("ProvenanceTaskReport");
    +core::Property ProvenanceTaskReport::hostName("Host Name", "Remote Host 
Name.", "localhost");
    +core::Property ProvenanceTaskReport::port("Port", "Remote Port", "9999");
    +core::Property ProvenanceTaskReport::batchSize("Batch Size", "Specifies 
how many records to send in a single batch, at most.", "100");
    +core::Relationship ProvenanceTaskReport::relation;
    +
    +void ProvenanceTaskReport::initialize()
    +{
    +   //! Set the supported properties
    +   std::set<core::Property> properties;
    +   properties.insert(hostName);
    +   properties.insert(port);
    +   properties.insert(batchSize);
    +   setSupportedProperties(properties);
    +   //! Set the supported relationships
    +   std::set<core::Relationship> relationships;
    +   relationships.insert(relation);
    +   setSupportedRelationships(relationships);
    +}
    +
    --- End diff --
    
    what i mean is that they are different processor and it make sense to make 
the code path differently. Certainly we can extract that returnProtocol and 
getNextProtocol to a parent class that both ProvenanceTaskReport and 
RemoteProcessGroup can inherit from if it is what you mean by duplicate code.



---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to