arpadboda commented on a change in pull request #955:
URL: https://github.com/apache/nifi-minifi-cpp/pull/955#discussion_r561787147
##########
File path: libminifi/include/utils/ValueParser.h
##########
@@ -126,6 +126,10 @@ class ValueParser {
}
}
+ std::string rest() const noexcept {
+ return {str.c_str() + offset};
Review comment:
I think substring is a bit easier to read:
```
return str.substr(offset);
```
##########
File path: libminifi/include/utils/Literals.h
##########
@@ -0,0 +1,59 @@
+/**
+ *
+ * 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
+
+constexpr unsigned long long operator "" _KiB(unsigned long long n) { //
NOLINT
Review comment:
What would be reported by linter here?
##########
File path: libminifi/include/utils/StagingQueue.h
##########
@@ -0,0 +1,168 @@
+/**
+ * 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 <mutex>
+#include <atomic>
+#include <utility>
+#include "MinifiConcurrentQueue.h"
+
+namespace org {
+namespace apache {
+namespace nifi {
+namespace minifi {
+namespace utils {
+
+namespace internal {
+template<typename T>
+struct default_allocator {
+ T operator()(size_t max_size) const {
+ return T::allocate(max_size);
+ }
+};
+} // namespace internal
+
+template<typename ActiveItem, typename Allocator =
internal::default_allocator<ActiveItem>>
+class StagingQueue {
Review comment:
Please add a comment that tells the purpose of this class!
##########
File path: libminifi/src/io/ZlibStream.cpp
##########
@@ -127,7 +143,12 @@
ZlibDecompressStream::ZlibDecompressStream(gsl::not_null<OutputStream*> output,
ZlibDecompressStream::~ZlibDecompressStream() {
if (state_ != ZlibStreamState::UNINITIALIZED) {
- inflateEnd(&strm_);
+ int result = inflateEnd(&strm_);
+ if (result == Z_STREAM_ERROR) {
+ logger_->log_debug("Stream state was inconsistent");
+ } else if (result != Z_OK) {
+ logger_->log_debug("Unknown error while finishing decompression %d",
result);
Review comment:
Is it only a debug level information? Seems like a quite bad state for
me.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]