szaszm commented on a change in pull request #1071:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1071#discussion_r655280393
##########
File path: CONFIGURE.md
##########
@@ -166,6 +166,25 @@ folder. You may specify your own path in place of these
defaults.
nifi.flowfile.repository.directory.default=${MINIFI_HOME}/flowfile_repository
nifi.database.content.repository.directory.default=${MINIFI_HOME}/content_repository
+It is also possible to use a single database to store multiple repositories
with the `minifidb://` scheme.
+This could help with migration and centralize agent state persistence.
+
+ in minifi.properties
+
nifi.flowfile.repository.directory.default=minifidb://${MINIFI_HOME}/agent_state/flowfile
+
nifi.database.content.repository.directory.default=minifidb://${MINIFI_HOME}/agent_state/content
+
nifi.state.manangement.provider.local.path=minifidb://${MINIFI_HOME}/agent_state/processor_states
Review comment:
What does the `minifidb://` scheme exactly mean? Does it interpret the
last path segment as a column family and the segments before as a path to the
database?
##########
File path: CONFIGURE.md
##########
@@ -166,6 +166,25 @@ folder. You may specify your own path in place of these
defaults.
nifi.flowfile.repository.directory.default=${MINIFI_HOME}/flowfile_repository
nifi.database.content.repository.directory.default=${MINIFI_HOME}/content_repository
+It is also possible to use a single database to store multiple repositories
with the `minifidb://` scheme.
+This could help with migration and centralize agent state persistence.
+
+ in minifi.properties
+
nifi.flowfile.repository.directory.default=minifidb://${MINIFI_HOME}/agent_state/flowfile
+
nifi.database.content.repository.directory.default=minifidb://${MINIFI_HOME}/agent_state/content
+
nifi.state.manangement.provider.local.path=minifidb://${MINIFI_HOME}/agent_state/processor_states
Review comment:
What does the `minifidb://` scheme exactly mean? Does it interpret the
last path segment as a column family and the segments before as a path to the
database? It should be explained here.
##########
File path: libminifi/include/utils/GeneralUtils.h
##########
@@ -62,6 +62,15 @@ struct identity {
};
#endif /* < C++20 */
+#if __cplusplus > 201703L
+using std::type_identity;
+#else
+template<typename T>
+struct type_identity {
+ using type = T;
+};
+#endif /* < C++20 */
Review comment:
There is a [feature test
macro](https://en.cppreference.com/w/cpp/feature_test) for this:
`__cpp_lib_type_identity`
```suggestion
#if __cpp_lib_type_identity >= 201806L
using std::type_identity;
#else
template<typename T>
struct type_identity {
using type = T;
};
#endif /* has std::type_identity */
```
It's not used elsewhere because I believe feature test macros were
standardized in C++20, so I see no point in checking for features that were
introduced earlier. And I don't know the macro for std::identity above. (Maybe
ranges?)
##########
File path: extensions/rocksdb-repos/database/RocksDbInstance.h
##########
@@ -0,0 +1,71 @@
+/**
+ *
+ * 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 "utils/OptionalUtils.h"
+#include "RocksDbUtils.h"
+#include "rocksdb/db.h"
+#include "logging/Logger.h"
+
+namespace org {
+namespace apache {
+namespace nifi {
+namespace minifi {
+namespace internal {
Review comment:
Did you consider putting the extension, or the new classes, under a
different namespace? e.g. `org::apache::nifi::minifi::rocksdbrepos`
##########
File path: extensions/rocksdb-repos/database/RocksDbInstance.h
##########
@@ -0,0 +1,71 @@
+/**
+ *
+ * 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 "utils/OptionalUtils.h"
+#include "RocksDbUtils.h"
+#include "rocksdb/db.h"
+#include "logging/Logger.h"
+
+namespace org {
+namespace apache {
+namespace nifi {
+namespace minifi {
+namespace internal {
Review comment:
I'm fine with either that, `extensions::rocksdbrepos`,
`extensions::rocksdb` or anything similar.
##########
File path: extensions/rocksdb-repos/database/RocksDbInstance.h
##########
@@ -0,0 +1,71 @@
+/**
+ *
+ * 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 "utils/OptionalUtils.h"
+#include "RocksDbUtils.h"
+#include "rocksdb/db.h"
+#include "logging/Logger.h"
+
+namespace org {
+namespace apache {
+namespace nifi {
+namespace minifi {
+namespace internal {
Review comment:
I'm fine with either that, `extensions::rocksdbrepos`,
`extensions::rocksdb` or anything similar. I'm also fine with leaving it as is.
##########
File path: extensions/rocksdb-repos/database/RocksDbInstance.h
##########
@@ -0,0 +1,71 @@
+/**
+ *
+ * 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 "utils/OptionalUtils.h"
+#include "RocksDbUtils.h"
+#include "rocksdb/db.h"
+#include "logging/Logger.h"
+
+namespace org {
+namespace apache {
+namespace nifi {
+namespace minifi {
+namespace internal {
Review comment:
ok, that's fine
--
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]