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

    https://github.com/apache/nifi/pull/1825#discussion_r117351574
  
    --- Diff: 
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PartitionRecord.java
 ---
    @@ -0,0 +1,412 @@
    +/*
    + * 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.
    + */
    +
    +package org.apache.nifi.processors.standard;
    +
    +import java.io.BufferedInputStream;
    +import java.io.IOException;
    +import java.io.InputStream;
    +import java.io.OutputStream;
    +import java.util.ArrayList;
    +import java.util.Arrays;
    +import java.util.Collection;
    +import java.util.Collections;
    +import java.util.HashMap;
    +import java.util.HashSet;
    +import java.util.List;
    +import java.util.Map;
    +import java.util.Set;
    +import java.util.stream.Collectors;
    +import java.util.stream.Stream;
    +
    +import org.apache.nifi.annotation.behavior.DynamicProperty;
    +import org.apache.nifi.annotation.behavior.EventDriven;
    +import org.apache.nifi.annotation.behavior.InputRequirement;
    +import org.apache.nifi.annotation.behavior.InputRequirement.Requirement;
    +import org.apache.nifi.annotation.behavior.SupportsBatching;
    +import org.apache.nifi.annotation.behavior.WritesAttribute;
    +import org.apache.nifi.annotation.behavior.WritesAttributes;
    +import org.apache.nifi.annotation.documentation.CapabilityDescription;
    +import org.apache.nifi.annotation.documentation.SeeAlso;
    +import org.apache.nifi.annotation.documentation.Tags;
    +import org.apache.nifi.components.PropertyDescriptor;
    +import org.apache.nifi.components.ValidationContext;
    +import org.apache.nifi.components.ValidationResult;
    +import org.apache.nifi.flowfile.FlowFile;
    +import org.apache.nifi.flowfile.attributes.CoreAttributes;
    +import org.apache.nifi.processor.AbstractProcessor;
    +import org.apache.nifi.processor.ProcessContext;
    +import org.apache.nifi.processor.ProcessSession;
    +import org.apache.nifi.processor.Relationship;
    +import org.apache.nifi.processor.exception.ProcessException;
    +import org.apache.nifi.record.path.FieldValue;
    +import org.apache.nifi.record.path.RecordPath;
    +import org.apache.nifi.record.path.util.RecordPathCache;
    +import org.apache.nifi.record.path.validation.RecordPathValidator;
    +import org.apache.nifi.serialization.RecordReader;
    +import org.apache.nifi.serialization.RecordReaderFactory;
    +import org.apache.nifi.serialization.RecordSetWriter;
    +import org.apache.nifi.serialization.RecordSetWriterFactory;
    +import org.apache.nifi.serialization.WriteResult;
    +import org.apache.nifi.serialization.record.Record;
    +import org.apache.nifi.serialization.record.RecordSchema;
    +import org.apache.nifi.serialization.record.util.DataTypeUtils;
    +
    +@EventDriven
    +@SupportsBatching
    +@InputRequirement(Requirement.INPUT_REQUIRED)
    +@CapabilityDescription("Receives Record-oriented data (i.e., data that can 
be read by the configured Record Reader) and evaluates one or more RecordPaths 
against the "
    +    + "each record in the incoming FlowFile. Each record is then grouped 
with other \"like records\" and a FlowFile is created for each group of \"like 
records.\" What it means for "
    +    + "two records to be \"like records\" is determined by user-defined 
properties. The user is required to enter at least one user-defined property 
whose value is a RecordPath. Two "
    +    + "records are considered alike if they have the same value for all 
configured RecordPaths. Because we know that all records in a given output 
FlowFile have the same value for the "
    +    + "fields that are specified by the RecordPath, an attribute is added 
for each field. See Additional Details on the Usage page for more information 
and examples.")
    +@DynamicProperty(name="The name given to the dynamic property is the name 
of the attribute that will be used to denote the value of the associted 
RecordPath.",
    +    value="A RecordPath that points to a field in the Record.",
    +    description="Each dynamic property represents a RecordPath that will 
be evaluated against each record in an incoming FlowFile. When the value of the 
RecordPath is determined "
    +        + "for a Record, an attribute is added to the outgoing FlowFile. 
The name of the attribute is the same as the name of this property. The value 
of the attribute is the same as "
    +        + "the value of the field in the Record that the RecordPath points 
to. Note that no attribute will be added if the value returned for the 
RecordPath is null or is not a scalar "
    +        + "value (i.e., the value is an Array, Map, or Record).",
    +    supportsExpressionLanguage=true)
    +@WritesAttributes({
    +    @WritesAttribute(attribute="record.count", description="The number of 
records in an outgoing FlowFile"),
    +    @WritesAttribute(attribute="mime.type", description="The MIME Type 
that the configured Record Writer indicates is appropriate"),
    +    @WritesAttribute(attribute="<dynamic property name>",
    +        description="For each dynamnic property that is added, an 
attribute may be added to the FlowFile. See the description for Dynamic 
Properties for more information.")
    --- End diff --
    
    Thanks. Addressed.


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