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

ASF GitHub Bot commented on MINIFI-324:
---------------------------------------

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

    https://github.com/apache/nifi-minifi-cpp/pull/115#discussion_r123745136
  
    --- Diff: libminifi/include/utils/Id.h ---
    @@ -0,0 +1,77 @@
    +/**
    + * 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.
    + */
    +#ifndef LIBMINIFI_INCLUDE_UTILS_ID_H_
    +#define LIBMINIFI_INCLUDE_UTILS_ID_H_
    +
    +#include <atomic>
    +#include <memory>
    +#include <string>
    +#include <uuid/uuid.h>
    +
    +#include "core/logging/Logger.h"
    +#include "properties/Properties.h"
    +
    +#define UNSIGNED_CHAR_MAX 255
    +#define UUID_TIME_IMPL 0
    +#define UUID_RANDOM_IMPL 1
    +#define UUID_DEFAULT_IMPL 2
    +#define MINIFI_UID_IMPL 3
    +
    +namespace org {
    +namespace apache {
    +namespace nifi {
    +namespace minifi {
    +namespace utils {
    +
    +class IdGenerator {
    + public:
    +  void generate(uuid_t output);
    +  void initialize(const std::shared_ptr<Properties> & properties);
    +  
    +  static std::shared_ptr<IdGenerator> getIdGenerator() {
    +    static std::shared_ptr<IdGenerator> generator = 
std::shared_ptr<IdGenerator>(new IdGenerator());
    --- End diff --
    
    I wanted to make the constructor private that seems to require manual 
invocation of new
    
    ```
    error: ‘org::apache::nifi::minifi::utils::IdGenerator::IdGenerator()’ is 
private
       IdGenerator();
       ^
    In file included from 
/usr/include/x86_64-linux-gnu/c++/5/bits/c++allocator.h:33:0,
                     from /usr/include/c++/5/bits/allocator.h:46,
                     from /usr/include/c++/5/bits/stl_tree.h:64,
                     from /usr/include/c++/5/map:60,
                     from 
/home/bryan/Github/nifi-minifi-cpp/libminifi/include/core/logging/LoggerConfiguration.h:24,
                     from 
/home/bryan/Github/nifi-minifi-cpp/libminifi/src/core/logging/LoggerConfiguration.cpp:21:
    /usr/include/c++/5/ext/new_allocator.h:120:4: error: within this context
      { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
    ```


> Explore alternative ways to supply identifiers
> ----------------------------------------------
>
>                 Key: MINIFI-324
>                 URL: https://issues.apache.org/jira/browse/MINIFI-324
>             Project: Apache NiFi MiNiFi
>          Issue Type: Improvement
>            Reporter: marco polo
>            Assignee: Bryan Rosander
>            Priority: Minor
>
> As [[email protected]] mentioned, we could either increment a value in 
> place of generating unique identifiers for any non NiFi related comms ( i.e. 
> internal objects, claims, etc )
> Generating unique identifiers is costly and this may not be a cost all 
> consumers wish to incur. 



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to