nifi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (MINIFI-231) FlowFile Persistent
Date Sun, 05 Mar 2017 18:42:32 GMT

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

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

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

    https://github.com/apache/nifi-minifi-cpp/pull/62#discussion_r104320252
  
    --- Diff: libminifi/src/Repository.cpp ---
    @@ -0,0 +1,140 @@
    +/**
    + * @file Repository.cpp
    + * Repository implemenatation 
    + *
    + * 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.
    + */
    +#include <cstdint>
    +#include <vector>
    +#include <arpa/inet.h>
    +#include "io/DataStream.h"
    +#include "io/Serializable.h"
    +#include "Relationship.h"
    +#include "Logger.h"
    +#include "FlowController.h"
    +#include "Repository.h"
    +#include "Provenance.h"
    +#include "FlowFileRepository.h"
    +
    +const char *Repository::RepositoryTypeStr[MAX_REPO_TYPE] = {"Provenace Repository", "FlowFile
Repository"};
    +uint64_t Repository::_repoSize[MAX_REPO_TYPE] = {0, 0}; 
    +
    +void Repository::start() {
    +	if (!_enable)
    +		return;
    +	if (this->_purgePeriod <= 0)
    +		return;
    +	if (_running)
    +		return;
    +	_running = true;
    +	logger_->log_info("%s Repository Monitor Thread Start", RepositoryTypeStr[_type]);
    +	_thread = new std::thread(run, this);
    +	_thread->detach();
    +}
    +
    +void Repository::stop() {
    +	if (!_running)
    +		return;
    +	_running = false;
    +	logger_->log_info("%s Repository Monitor Thread Stop", RepositoryTypeStr[_type]);
    +}
    +
    +void Repository::run(Repository *repo) {
    +	// threshold for purge
    --- End diff --
    
    uint64_t purgeThreshold = repo->_maxPartitionBytes * 3 / 4;
    
    # Provenance Repository #
    nifi.provenance.repository.directory.default=./provenance_repository
    nifi.provenance.repository.max.storage.time=1 MIN
    nifi.provenance.repository.max.storage.size=1 MB
    So once the repo size exceed 75%, we start to purge the record if the record was stay
in the repo exceed the max storage time.
    If repo size is full, we mark the repo full and we will stop to put the record in repo.


> FlowFile Persistent 
> --------------------
>
>                 Key: MINIFI-231
>                 URL: https://issues.apache.org/jira/browse/MINIFI-231
>             Project: Apache NiFi MiNiFi
>          Issue Type: Bug
>          Components: Core Framework, Data Format
>    Affects Versions: cpp-1.0.0
>            Reporter: bqiu
>            Assignee: bqiu
>             Fix For: cpp-1.0.0
>
>
> Add FlowFile persistent support



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message