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

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

GitHub user ijokarumawak opened a pull request:

    https://github.com/apache/nifi/pull/614

    NIFI-2145: Auto flow.xml archive

    Hello,
    
    I've added auto flow.xml archive support. Since the existing 'Back-up flow' 
link overlaps and can be replaced with this, removed the link and corresponding 
API as well.
    Please review it, look forward to see any feedback, thanks!
    
    - Added following properties:
      - nifi.flow.configuration.archive.enabled
      - nifi.flow.configuration.archive.max.time
      - nifi.flow.configuration.archive.max.storage
    - Removed manual archive operation:
      - Removed 'Back-up flow' link from UI since it's not needed any longer
      - Removed corresponding REST API controller/archive and its
        implementations
    - Added FlowConfigurationArchiveManager to enclose archive related code
    - Updated related docs

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/ijokarumawak/nifi nifi-2145

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/nifi/pull/614.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #614
    
----
commit 90c9cc7fc4e4bb2c2f114b5398d0dbc803146740
Author: Koji Kawamura <[email protected]>
Date:   2016-07-07T05:32:48Z

    NIFI-2145: Auto flow.xml archive
    
    - Added following properties:
      - nifi.flow.configuration.archive.enabled
      - nifi.flow.configuration.archive.max.time
      - nifi.flow.configuration.archive.max.storage
    - Removed manual archive operation:
      - Removed 'Back-up flow' link from UI since it's not needed any longer
      - Removed corresponding REST API controller/archive and its
        implementations
    - Added FlowConfigurationArchiveManager to enclose archive related code
    - Updated related docs

----


> When saving flow, NiFi should allow the flow to automatically be backed up
> --------------------------------------------------------------------------
>
>                 Key: NIFI-2145
>                 URL: https://issues.apache.org/jira/browse/NIFI-2145
>             Project: Apache NiFi
>          Issue Type: Improvement
>          Components: Configuration, Core Framework
>            Reporter: Mark Payne
>            Assignee: Koji Kawamura
>             Fix For: 1.0.0
>
>
> Each time that a user updates the NiFi flow, the new flow is written to the 
> flow.xml.gz on each node. When this occurs, we should provide the option of 
> also writing the flow.xml.gz to an 'archive' folder, using a filename based 
> on the current time. We should also ensure that we keep old flows for X 
> (configurable) amount of time and only use a max of some configurable amount 
> of disk space.
> StandardXMLFlowConfigurationDAO (in nifi-framework-core) already has a method 
> for `save(FlowController controller, boolean archive)` but 'false' is always 
> passed as the 'archive' field. We should instead pass in `true` if configured 
> to archive. Additionally, we should change the archive filename so that it is 
> based on a user-readable date/time, such as 
> flow-2016-06-29-11-10-50am.xml.gz, for instance, for a flow that was saved at 
> 11:10:50 AM on June 29, 2016. This allows an admin to easily revert a flow 
> back to how it was at some point in history.
> Changes required to implement this include:
> 1. Update nifi.properties to include new properties (with the suggested 
> defaults that may need to be adjusted):
> - nifi.flow.configuration.archive.enabled=true
> - nifi.flow.configuration.archive.max.time=30 days
> - nifi.flow.configuration.archive.max.storage=500 MB
> There already is a property named `nifi.flow.configuration.archive.dir` that 
> should be used to specify where to save the archived flow. This is used 
> currently only when the user clicks the 'archive' button in the UI.
> 2. Update StandardFlowService.saveFlowChanges(TimeUnit delayUnit, long delay) 
> so that it passes a value of `true` for the 'archive' flag when calling the 
> overridden saveFlowChanges method in the case that the 
> `nifi.flow.configuration.archive.enabled` property is set to true (default).
> 3. Update StandardXMLFlowConfigurationDAO.createArchiveFile() to use a more 
> user-friendly filename, as described above.
> 4. Update StandardXMLFlowConfigurationDAO.save() so that the `if (archive) {` 
> branch first cleans up old/expired flows so that the `archive` directory is 
> smaller than the configured max storage space and so that any archived flow 
> that is older than the configured `nifi.flow.configuration.archive.max.time` 
> property is removed.



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

Reply via email to