Github user phrocker commented on a diff in the pull request:
https://github.com/apache/nifi-minifi-cpp/pull/62#discussion_r103957227
--- Diff: libminifi/include/FlowFileRepository.h ---
@@ -0,0 +1,208 @@
+/**
+ * @file FlowFileRepository
+ * Flow file repository class declaration
+ *
+ * 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 __FLOWFILE_REPOSITORY_H__
+#define __FLOWFILE_REPOSITORY_H__
+
+#include <ftw.h>
+#include <uuid/uuid.h>
+#include <atomic>
+#include <cstdint>
+#include <cstring>
+#include <iostream>
+#include <map>
+#include <set>
+#include <string>
+#include <thread>
+#include <vector>
+
+#include "Configure.h"
+#include "Connection.h"
+#include "FlowFileRecord.h"
+#include "Logger.h"
+#include "Property.h"
+#include "ResourceClaim.h"
+#include "io/Serializable.h"
+#include "utils/TimeUtil.h"
+#include "Repository.h"
+
+class FlowFileRepository;
+
+//! FlowFile Event Record
+class FlowFileEventRecord : protected Serializable
+{
+public:
+ friend class ProcessSession;
+public:
+ //! Constructor
+ /*!
+ * Create a new provenance event record
+ */
+ FlowFileEventRecord()
+ : _entryDate(0), _lineageStartDate(0), _size(0), _offset(0)
+ {
+ _eventTime = getTimeMillis();
+ logger_ = Logger::getLogger();
+ }
+
+ //! Destructor
+ virtual ~FlowFileEventRecord() {
+ }
+ //! Get Attributes
+ std::map<std::string, std::string> getAttributes() {
+ return _attributes;
+ }
+ //! Get Size
+ uint64_t getFileSize() {
+ return _size;
+ }
+ // ! Get Offset
+ uint64_t getFileOffset() {
+ return _offset;
+ }
+ // ! Get Entry Date
+ uint64_t getFlowFileEntryDate() {
+ return _entryDate;
+ }
+ // ! Get Lineage Start Date
+ uint64_t getlineageStartDate() {
+ return _lineageStartDate;
+ }
+ // ! Get Event Time
+ uint64_t getEventTime() {
+ return _eventTime;
+ }
+ //! Get FlowFileUuid
+ std::string getFlowFileUuid()
+ {
+ return _uuid;
+ }
+ //! Get ConnectionUuid
+ std::string getConnectionUuid()
+ {
+ return _uuidConnection;
+ }
+ //! Get content full path
+ std::string getContentFullPath()
+ {
+ return _contentFullPath;
+ }
+ //! Get LineageIdentifiers
+ std::set<std::string> getLineageIdentifiers()
+ {
+ return _lineageIdentifiers;
+ }
+ //! fromFlowFile
+ void fromFlowFile(FlowFileRecord *flow, std::string uuidConnection)
+ {
+ _entryDate = flow->getEntryDate();
+ _lineageStartDate = flow->getlineageStartDate();
+ _lineageIdentifiers = flow->getlineageIdentifiers();
+ _uuid = flow->getUUIDStr();
+ _attributes = flow->getAttributes();
+ _size = flow->getSize();
+ _offset = flow->getOffset();
+ _uuidConnection = uuidConnection;
+ if (flow->getResourceClaim())
+ {
+ _contentFullPath =
flow->getResourceClaim()->getContentFullPath();
+ }
+ }
+ //! Serialize and Persistent to the repository
+ bool Serialize(FlowFileRepository *repo);
+ //! DeSerialize
+ bool DeSerialize(const uint8_t *buffer, const int bufferSize);
+ //! DeSerialize
+ bool DeSerialize(DataStream &stream)
+ {
+ return DeSerialize(stream.getBuffer(),stream.getSize());
+ }
+ //! DeSerialize
+ bool DeSerialize(FlowFileRepository *repo, std::string key);
+
+protected:
+
+ //! Date at which the event was created
--- End diff --
variables should be event_time_ per google's code style.
---
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.
---