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

ASF GitHub Bot commented on NIFI-826:
-------------------------------------

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

    https://github.com/apache/nifi/pull/671#discussion_r71214452
  
    --- Diff: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/util/SnippetUtils.java
 ---
    @@ -565,13 +567,15 @@ private void updateControllerServiceIdentifiers(final 
ProcessorConfigDTO configD
         /**
          * Generates a new id for the current id that is specified. If no seed 
is found, a new random id will be created.
          */
    -    private String generateId(final String currentId, final String seed) {
    +    private String generateId(final String currentId, final String seed, 
boolean isCopy) {
             long msb = UUID.fromString(currentId).getMostSignificantBits();
    -        long lsb = StringUtils.isBlank(seed)
    +        int lsb = StringUtils.isBlank(seed)
                     ? Math.abs(new Random().nextInt())
    -                : 
Math.abs(ByteBuffer.wrap(seed.getBytes(StandardCharsets.UTF_8)).getInt());
    +                : Math.abs(seed.hashCode());
     
    -        return new UUID(msb, lsb).toString();
    +        return isCopy ? TypeOneUUIDGenerator.generateId(msb, 
lsb).toString() : new UUID(msb, lsb).toString();
    +        // return TypeOneUUIDGenerator.generateId(msb, lsb).toString();
    --- End diff --
    
    Should be able to remove this now


> Export templates in a deterministic way
> ---------------------------------------
>
>                 Key: NIFI-826
>                 URL: https://issues.apache.org/jira/browse/NIFI-826
>             Project: Apache NiFi
>          Issue Type: Improvement
>          Components: Core Framework
>            Reporter: Matt Gilman
>            Assignee: Oleg Zhurakousky
>             Fix For: 1.0.0
>
>
> Templates should be exported in a deterministic way so that they can be 
> compared or diff'ed with another. Items to consider...
> - The ordering of components
> - The id's used to identify the components
> - Consider excluding irrelevant items. When components are imported some 
> settings are ignored (run state).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to