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

    https://github.com/apache/nifi-minifi/pull/51#discussion_r87254681
  
    --- Diff: 
minifi-bootstrap/src/main/java/org/apache/nifi/minifi/bootstrap/RunMiNiFi.java 
---
    @@ -143,11 +145,18 @@
         private volatile Set<Future<?>> loggingFutures = new HashSet<>(2);
         private volatile int gracefulShutdownSeconds;
     
    -    private Set<ConfigurationChangeNotifier> changeNotifiers;
         private Set<PeriodicStatusReporter> periodicStatusReporters;
     
    +    private ConfigurationChangeCoordinator changeCoordinator;
         private MiNiFiConfigurationChangeListener changeListener;
     
    +    private volatile ByteBuffer currentConfigFile;
    +
    +    @Override
    +    public ByteBuffer getConfigFile() {
    +        return currentConfigFile;
    --- End diff --
    
    Here is the docs for ByteBuffer's "asReadyOnlyBuffer". The position is 
independent for each but share the same content (and prevent modification to 
the content). 
    
    One thing to note, the "currentConfigFile" won't ever be updated by writing 
to it (reference is updated when a new config is transformed). So we can make 
the underlying "currentConfigFile" read only too (effectively making it 
immutable).
    
    
https://docs.oracle.com/javase/8/docs/api/java/nio/ByteBuffer.html#asReadOnlyBuffer--


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