lordgamez commented on code in PR #1941: URL: https://github.com/apache/nifi-minifi-cpp/pull/1941#discussion_r2285038837
########## libminifi/include/c2/FlowStatusRequest.h: ########## @@ -0,0 +1,48 @@ +/** + * 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. + */ +#pragma once + +#include <string> +#include <unordered_set> + +namespace org::apache::nifi::minifi::c2 { + +enum class FlowStatusQueryType { + processor, + connection, + instance, + systemdiagnostics +}; + +enum class FlowStatusQueryOption { + health, + stats, + bulletins, + processorstats, + flowfilerepositoryusage, + contentrepositoryusage +}; + +struct FlowStatusRequest { + FlowStatusQueryType query_type; + std::string identifier; + std::unordered_set<FlowStatusQueryOption> options; + + explicit FlowStatusRequest(const std::string& query_string); Review Comment: Added in https://github.com/apache/nifi-minifi-cpp/pull/1941/commits/f50560c454cd00d67e4fd5df37780ae2e824a62a ########## controller/Controller.cpp: ########## @@ -267,4 +267,24 @@ nonstd::expected<void, std::string> getDebugBundle(const utils::net::SocketData& return {}; } +bool getFlowStatus(const utils::net::SocketData& socket_data, const std::string& status_query, std::ostream &out) { + std::unique_ptr<io::BaseStream> connection_stream = std::make_unique<utils::net::AsioSocketConnection>(socket_data); Review Comment: Due to the virtual inheritance hierarchy the compiler was not able the find this specific overload from the AsioSockerConnection class, I added a using directive there to be able to find the read and write overloads with the std::span parameter and updated the return value to auto in https://github.com/apache/nifi-minifi-cpp/pull/1941/commits/f50560c454cd00d67e4fd5df37780ae2e824a62a ########## libminifi/src/core/BulletinStore.cpp: ########## @@ -68,6 +68,17 @@ std::deque<Bulletin> BulletinStore::getBulletins(std::optional<std::chrono::syst return {}; } +std::vector<Bulletin> BulletinStore::getBulletinsForProcessor(const std::string& processor_uuid) const { + std::lock_guard<std::mutex> lock(mutex_); + std::vector<Bulletin> bulletins; + for (const auto& bulletin : bulletins_) { + if (bulletin.source_id == processor_uuid) { + bulletins.push_back(bulletin); + } + } + return bulletins; Review Comment: Updated in https://github.com/apache/nifi-minifi-cpp/pull/1941/commits/f50560c454cd00d67e4fd5df37780ae2e824a62a -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
