[GitHub] [celix] PengZheng commented on a diff in pull request #437: Add v2 of shared memory remote service admin

2022-09-07 Thread GitBox


PengZheng commented on code in PR #437:
URL: https://github.com/apache/celix/pull/437#discussion_r965440477


##
bundles/remote_services/remote_service_admin_shm_v2/shm_pool/src/shm_cache.c:
##
@@ -240,7 +240,7 @@ static void * shmCache_WatcherThread(void *data) {
 for (int i = 0; i < size; ++i) {
 shm_cache_block_t *shmBlock = celix_arrayList_get(evictedBlocks, 
i);
 celix_longHashMap_remove(shmCache->shmCacheBlocks, 
shmBlock->shmId);
-fprintf(stdout, "Shm cache: Shm(%d) has been closed, colse its 
cache.\n", shmBlock->shmId);
+fprintf(stdout, "Shm cache: Shm(%d) has been closed, close its 
cache.\n", shmBlock->shmId);

Review Comment:
   New code should not use raw printf. 
   Without access to bundle/framework context, we can still use logging macro, 
which defaults to no output. Or shall we use syslog instead of printf? I 
suggest a discussion with @pnoltes



-- 
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]



[GitHub] [celix] PengZheng commented on a diff in pull request #437: Add v2 of shared memory remote service admin

2022-09-07 Thread GitBox


PengZheng commented on code in PR #437:
URL: https://github.com/apache/celix/pull/437#discussion_r964563011


##
bundles/remote_services/rsa_spi/CMakeLists.txt:
##
@@ -15,15 +15,18 @@
 # specific language governing permissions and limitations
 # under the License.
 
-add_library(deprecated_rsa_spi INTERFACE)
-target_include_directories(deprecated_rsa_spi INTERFACE
+add_library(c_rsa_spi INTERFACE)
+target_include_directories(c_rsa_spi INTERFACE
 $
-)
-target_link_libraries(deprecated_rsa_spi INTERFACE Celix::remote_services_api)
+)
+target_link_libraries(c_rsa_spi INTERFACE Celix::framework)
 
-install(TARGETS deprecated_rsa_spi EXPORT celix DESTINATION 
${CMAKE_INSTALL_LIBDIR} COMPONENT rsa
+install(TARGETS c_rsa_spi EXPORT celix DESTINATION ${CMAKE_INSTALL_LIBDIR} 
COMPONENT rsa
 INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/celix/rsa)
 install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/celix/rsa 
COMPONENT rsa)
 
 #Setup target aliases to match external usage
-add_library(Celix::deprecated_rsa_spi ALIAS deprecated_rsa_spi)
+add_library(Celix::c_rsa_spi ALIAS c_rsa_spi)
+
+#In order to compatible with existing code, keep the name 
'Celix::deprecated_rsa_spi'

Review Comment:
   nitpick: to be compatible



##
bundles/remote_services/CMakeLists.txt:
##
@@ -18,16 +18,20 @@
 celix_subproject(REMOTE_SERVICE_ADMIN "Option to enable building the Remote 
Service Admin Service bundles" ON)
 if (REMOTE_SERVICE_ADMIN)
 
+add_subdirectory(thpool)
 add_subdirectory(remote_services_api)
-add_subdirectory(deprecated_rsa_spi)
+add_subdirectory(rsa_spi)
 add_subdirectory(rsa_common)
+add_subdirectory(rsa_dfi_utils)
 add_subdirectory(civetweb)
 add_subdirectory(discovery_common)
 add_subdirectory(discovery_configured)
 add_subdirectory(discovery_etcd)
 add_subdirectory(examples)
 add_subdirectory(topology_manager)
 add_subdirectory(remote_service_admin_dfi)
+add_subdirectory(rsa_rpc_json)
+add_subdirectory(remote_service_admin_shm_v2)
 
 celix_subproject(RSA_SHM "Option to enable building the Discovery (SHM) 
bundle" OFF)
 if (RSA_SHM)

Review Comment:
   We should remove the old implementation and add working example for the 
current version. WDYT @pnoltes @xuzhenbao 



##
bundles/remote_services/thpool/CMakeLists.txt:
##
@@ -0,0 +1,24 @@
+# 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.
+
+add_library(thpool STATIC
+src/thpool.c

Review Comment:
   Should it be part of the utils?



##
conanfile.py:
##
@@ -65,6 +65,8 @@ class CelixConan(ConanFile):
 "build_rsa_remote_service_admin_dfi": [True, False],
 "build_rsa_discovery_configured": [True, False],
 "build_rsa_discovery_etcd": [True, False],
+"build_rsa_remote_service_admin_shm_v2": [True, False],

Review Comment:
   Please add corresponding test_package in `example/conan_test_package` to 
make sure all artifacts are installed properly.



-- 
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]