Skip to content
Draft
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions cmake/FetchSQLite.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# 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(FetchContent)

FetchContent_Declare(
sqlite3
URL "https://www.sqlite.org/2026/sqlite-amalgamation-3530200.zip"
URL_HASH "SHA256=8a310d0a16c7a90cacd4c884e70faa51c902afed2a89f63aaa0126ab83558a32"
)

FetchContent_MakeAvailable(sqlite3)

add_library(sqlite3 STATIC ${sqlite3_SOURCE_DIR}/sqlite3.c)
target_include_directories(sqlite3 PUBLIC ${sqlite3_SOURCE_DIR})
12 changes: 12 additions & 0 deletions core-framework/common/src/utils/Id.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,18 @@ bool Identifier::isNil() const {
return *this == Identifier{};
}

Identifier& Identifier::operator++() {
for (int byte_idx = 15; byte_idx >= 0 && ++data_[byte_idx] == 0; --byte_idx) {}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit too dense and clever for my liking, I'd separate the iteration from the rest of the increment + carry logic.

Suggested change
for (int byte_idx = 15; byte_idx >= 0 && ++data_[byte_idx] == 0; --byte_idx) {}
// increment with carry
for (int byte_idx = 15; byte_idx >= 0; --byte_idx) {
++data_[byte_idx];
if (data_[byte_idx] != 0) {
break;
}
}

return *this;
}

Identifier Identifier::operator++(int) {
auto result = *this;
++*this;
return result;
}


bool Identifier::operator!=(const Identifier& other) const {
return !(*this == other);
}
Expand Down
6 changes: 0 additions & 6 deletions core-framework/include/core/Repository.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,6 @@ class RepositoryImpl : public core::CoreComponentImpl, public core::RepositoryMe
return false;
}

bool getElements(std::vector<std::shared_ptr<core::SerializableComponent>>& /*store*/, size_t& /*max_size*/) override {
return true;
}

bool storeElement(const std::shared_ptr<core::SerializableComponent>& element) override;

void loadComponent(const std::shared_ptr<core::ContentRepository>& /*content_repo*/) override {
}

Expand Down
16 changes: 0 additions & 16 deletions core-framework/src/core/Repository.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,4 @@ bool RepositoryImpl::Delete(std::vector<std::shared_ptr<core::SerializableCompon
return found;
}

bool RepositoryImpl::storeElement(const std::shared_ptr<core::SerializableComponent>& element) {
if (!element) {
return false;
}

org::apache::nifi::minifi::io::BufferStream stream;

element->serialize(stream);

if (!Put(element->getUUIDStr(), reinterpret_cast<const uint8_t*>(stream.getBuffer().data()), stream.size())) {
logger_->log_error("NiFi Provenance Store event {} size {} fail", element->getUUIDStr(), stream.size());
return false;
}
return true;
}

} // namespace org::apache::nifi::minifi::core
2 changes: 1 addition & 1 deletion extensions/grafana-loki/PushGrafanaLokiGrpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ std::expected<void, std::string> PushGrafanaLokiGrpc::submitRequest(const std::v

for (const auto& flow_file : batched_flow_files) {
logproto::EntryAdapter *entry = stream->add_entries();
auto timestamp_str = std::to_string(flow_file->getlineageStartDate().time_since_epoch() / std::chrono::nanoseconds(1));
auto timestamp_str = std::to_string(flow_file->getLineageStartDate().time_since_epoch() / std::chrono::nanoseconds(1));
auto timestamp_nanos = std::stoll(timestamp_str);
*entry->mutable_timestamp() = google::protobuf::util::TimeUtil::NanosecondsToTimestamp(timestamp_nanos);

Expand Down
2 changes: 1 addition & 1 deletion extensions/grafana-loki/PushGrafanaLokiREST.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ std::string PushGrafanaLokiREST::createLokiJson(const std::vector<std::shared_pt
for (const auto& flow_file : batched_flow_files) {
rapidjson::Value log_line(rapidjson::kArrayType);

auto timestamp_str = std::to_string(flow_file->getlineageStartDate().time_since_epoch() / std::chrono::nanoseconds(1));
auto timestamp_str = std::to_string(flow_file->getLineageStartDate().time_since_epoch() / std::chrono::nanoseconds(1));
rapidjson::Value timestamp;
timestamp.SetString(timestamp_str.c_str(), gsl::narrow<rapidjson::SizeType>(timestamp_str.length()), allocator);
rapidjson::Value log_line_value;
Expand Down
106 changes: 0 additions & 106 deletions extensions/rocksdb-repos/ProvenanceRepository.cpp

This file was deleted.

Loading
Loading