Skip to content

Commit

Permalink
refroot
Browse files Browse the repository at this point in the history
Signed-off-by: Akshat Sikarwar <[email protected]>
  • Loading branch information
akshatsikarwar committed Feb 24, 2025
1 parent 80ba42e commit 5ae399f
Show file tree
Hide file tree
Showing 89 changed files with 105 additions and 721 deletions.
10 changes: 5 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,14 @@ if(${CMAKE_SYSTEM_NAME} STREQUAL Darwin)
endif()
endif()

list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)

if(COMDB2_BBCMAKE)
include(${COMDB2_BBCMAKE})
add_definitions(-DCOMDB2_BBCMAKE)
else()
configure_file(bbinc/plhash.in bbinc/plhash.h COPYONLY)
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake ${PROJECT_SOURCE_DIR}/cmake)
configure_file(bbinc/plhash.in bbinc/plhash.h COPYONLY)
endif()

find_package(LZ4 REQUIRED)
find_package(OpenSSL REQUIRED)
set(PROTOBUF_C_MIN_VERSION 1.1.0)
Expand All @@ -83,8 +85,6 @@ if(WITH_QKAFKA)
add_definitions(-DWITH_QKAFKA)
endif()

endif(COMDB2_BBCMAKE)

option(COMDB2_LEGACY_DEFAULTS "Legacy defaults without lrl override" OFF)

if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
Expand Down
1 change: 1 addition & 0 deletions bbinc/plhash_glue.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#ifndef INCLUDED_PLHASH_GLUE_H
#define INCLUDED_PLHASH_GLUE_H
#include <plhash.h>

/* Following are not available in sysutil */
hash_t *hash_init_ptr(void); /* hash of pointers (addresses) */
hash_t *hash_init_strcase(int keyoff); /* string starts at keyoff (case-insensitive) */
Expand Down
2 changes: 1 addition & 1 deletion bbinc/tunables.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#ifndef _TUNABLES_H
#define _TUNABLES_H

#include "plhash.h"
#include <plhash_glue.h>

typedef enum {
/*
Expand Down
3 changes: 1 addition & 2 deletions bdb/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ include_directories(
${PROTOBUF-C_INCLUDE_DIR}
)
if (COMDB2_BBCMAKE)
target_link_libraries(bdb PUBLIC db lz4)
configure_bb_target(bdb V2 NO_BUILDID NO_PLINKSTRINGS HEADER_DIRS)
comdb2_lib_target(bdb)
endif()
add_dependencies(bdb db mem proto)
2 changes: 1 addition & 1 deletion bdb/bdb_int.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

#include <object_pool.h>
#include <list.h>
#include <plhash.h>
#include <plhash_glue.h>
#include <thread_util.h>

#include "bdb_cursor.h"
Expand Down
2 changes: 1 addition & 1 deletion bdb/cursor.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ as long as there was a successful move in the past
#include "bdb_osqltrn.h"
#include <dlfcn.h>
#include <list.h>
#include <plhash.h>
#include <plhash_glue.h>
#include "logmsg.h"
#include "util.h"
#include "tohex.h"
Expand Down
2 changes: 1 addition & 1 deletion bdb/genid.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
#include <build/db.h>
#include <epochlib.h>
#include <ctrace.h>
#include <plhash.h>
#include <plhash_glue.h>
#include <list.h>

#include <net.h>
Expand Down
2 changes: 1 addition & 1 deletion bdb/rowlocks.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#include <segstr.h>
#include <list.h>
#include <plhash.h>
#include <plhash_glue.h>
#include <fsnapf.h>

#include <net.h>
Expand Down
2 changes: 1 addition & 1 deletion bdb/temptable.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include <sbuf2.h>
#include "bdb_int.h"
#include <list.h>
#include <plhash.h>
#include <plhash_glue.h>
#include <sys/time.h>

#ifdef _LINUX_SOURCE
Expand Down
3 changes: 1 addition & 2 deletions berkdb/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,7 @@ elseif(${CMAKE_C_COMPILER_ID} STREQUAL Clang OR ${CMAKE_C_COMPILER_ID} STREQUAL
endif()

if (COMDB2_BBCMAKE)
target_link_libraries(db PUBLIC lz4 openssl)
comdb2_bb_target(db)
comdb2_lib_target(db)
endif()

option(PAGELIST_DEBUG "Enable debug logic for pagelist dumping and loading" OFF)
Expand Down
2 changes: 1 addition & 1 deletion berkdb/build/db.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include <list.h>
#include <pool.h>
#include <plhash.h>
#include <plhash_glue.h>
#include <dlmalloc.h>
#include <thdpool.h>
#include <mem_berkdb.h>
Expand Down
2 changes: 1 addition & 1 deletion berkdb/db/db_dispatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ static const char revid[] = "$Id: db_dispatch.c,v 11.145 2003/09/10 20:31:18 ube
#include <stdio.h>
#endif

#include <plhash.h>
#include <plhash_glue.h>
#include "db_int.h"
#include "dbinc/db_page.h"
#include "dbinc/db_shash.h"
Expand Down
2 changes: 1 addition & 1 deletion berkdb/db/trigger_subscription.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <stdlib.h>
#include <string.h>
#include <plhash.h>
#include <plhash_glue.h>
#include "dbinc/trigger_subscription.h"
#include <sys_wrap.h>

Expand Down
2 changes: 1 addition & 1 deletion berkdb/dbinc/db_dispatch.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#ifndef _DB_DISPATCH_H_
#define _DB_DISPATCH_H_

#include <plhash.h>
#include <plhash_glue.h>
/*
* Declarations and typedefs for the list of transaction IDs used during
* recovery. This is a generic list used to pass along whatever information
Expand Down
2 changes: 1 addition & 1 deletion berkdb/env/env_open.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ static const char revid[] = "$Id: env_open.c,v 11.144 2003/09/13 18:39:34 bostic
#include <unistd.h>
#include <limits.h>

#include <plhash.h>
#include <plhash_glue.h>
#include "db_int.h"
#include "dbinc/crypto.h"
#include "dbinc/db_page.h"
Expand Down
2 changes: 1 addition & 1 deletion berkdb/log/log.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ static const char revid[] = "$Id: log.c,v 11.133 2003/09/13 19:20:37 bostic Exp
#include "dbinc/txn.h"
#include <logmsg.h>

#include <plhash.h>
#include <plhash_glue.h>

static int __log_init __P((DB_ENV *, DB_LOG *));
static int __log_recover __P((DB_LOG *));
Expand Down
2 changes: 1 addition & 1 deletion berkdb/rep/rep_record.c
Original file line number Diff line number Diff line change
Expand Up @@ -4209,7 +4209,7 @@ logical_record_file_affinity(int rectype)

int gbl_processor_thd_poll;

#include <plhash.h>
#include <plhash_glue.h>

struct fuid_integer {
u_int8_t fuid[DB_FILE_ID_LEN];
Expand Down
15 changes: 5 additions & 10 deletions cdb2api/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,24 @@ set_source_files_properties(
)

include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
${PROJECT_SOURCE_DIR}/bbinc
${PROJECT_SOURCE_DIR}/util
${PROJECT_BINARY_DIR}/protobuf
${PROTOBUF-C_INCLUDE_DIR}
${OPENSSL_INCLUDE_DIR}
)

if (EXTRA_PLUGINS)
include(${EXTRA_PLUGINS}/cdb2api/CMakeLists.txt)
endif()

# common obj files for .so/.dylib and .a
add_definitions(-DDISABLE_HOSTADDR_CACHE)
add_definitions(-DSBUF2_SERVER=0)

if (COMDB2_BBCMAKE)
include(${EXTRA_PLUGINS}/cdb2api/cdb2api.cmake)
add_library(opencdb2api STATIC ${src})
add_dependencies(opencdb2api proto)
target_link_libraries(opencdb2api PUBLIC protobuf-c)
if(${CMAKE_SYSTEM_NAME} STREQUAL Linux)
target_link_libraries(opencdb2api PUBLIC libunwind)
endif()
comdb2_bb_target(opencdb2api)
add_dependencies(opencdb2api proto)
target_link_libraries(opencdb2api PUBLIC cdb2api)
comdb2_lib_target(opencdb2api)
else()

add_library(cdb2api STATIC ${src})
Expand Down
2 changes: 1 addition & 1 deletion datetime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ include_directories(
)
add_dependencies(tz mem)
if (COMDB2_BBCMAKE)
comdb2_bb_target(tz)
comdb2_lib_target(tz)
endif()
2 changes: 1 addition & 1 deletion datetime/localtimedb.c
Original file line number Diff line number Diff line change
Expand Up @@ -2172,7 +2172,7 @@ static void db_settzname(void)
}
}

#include <plhash.h>
#include <plhash_glue.h>

#define NAME_KEY_MAX 40

Expand Down
15 changes: 7 additions & 8 deletions db/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -224,24 +224,23 @@ add_definitions(
add_executable(comdb2 ${src})
add_dependencies(comdb2 mem proto sqlite db bdb)
target_link_libraries(comdb2 PRIVATE
${PLUGIN_LIBRARIES}
schemachange
bdb
util
crc32c
comdb2rle
crc32c
csc2
cson
db
dfpal
dlmalloc
lua
mem
dlmalloc
net
schemachange
sockpool
sqlite
util
tz
util
${PLUGIN_LIBRARIES}
${LibArchive_LIBRARIES}
${LZ4_LIBRARY}
${RDKAFKA_LIBRARY}
Expand All @@ -254,8 +253,8 @@ target_link_libraries(comdb2 PRIVATE
)

if (COMDB2_BBCMAKE)
target_link_libraries(comdb2 PRIVATE opencdb2api uuid event_core_static event_pthreads_static)
comdb2_bb_target(comdb2)
target_link_libraries(comdb2 PRIVATE opencdb2api)
comdb2_bin_target(comdb2)
else()
target_link_libraries(comdb2 PRIVATE cdb2api m ${CMAKE_DL_LIBS})
endif()
Expand Down
2 changes: 1 addition & 1 deletion db/api_history.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include <assert.h>
#include <ctype.h>
#include <sys_wrap.h>
#include <plhash.h>
#include <plhash_glue.h>
#include <pthread.h>
#include <string.h>

Expand Down
2 changes: 1 addition & 1 deletion db/appsock_handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include "comdb2.h"
#include "comdb2_plugin.h"
#include "comdb2_appsock.h"
#include "plhash.h"
#include <plhash_glue.h>
#include "comdb2_atomic.h"
#include "perf.h"

Expand Down
2 changes: 1 addition & 1 deletion db/comdb2.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ void berk_memp_sync_alarm_ms(int);
#include "tag.h"
#include "types.h"
#include "timer.h"
#include <plhash.h>
#include <plhash_glue.h>
#include "verify.h"
#include "ssl_bend.h"
#include "switches.h"
Expand Down
2 changes: 1 addition & 1 deletion db/disttxn.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include <sqlquery.pb-c.h>
#include <pthread.h>
#include <epochlib.h>
#include <plhash.h>
#include <plhash_glue.h>
#include <stdlib.h>
#include <string.h>
#include <locks.h>
Expand Down
2 changes: 1 addition & 1 deletion db/eventlog.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include "eventlog.h"
#include "util.h"
#include "tohex.h"
#include "plhash.h"
#include <plhash_glue.h>
#include "logmsg.h"
#include "thread_stats.h"
#include "dbinc/locker_info.h"
Expand Down
2 changes: 1 addition & 1 deletion db/fdb_access.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*
*/

#include "plhash.h"
#include <plhash_glue.h>
#include "list.h"

#include "comdb2.h"
Expand Down
2 changes: 1 addition & 1 deletion db/fdb_bend.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
#include <alloca.h>
#include <poll.h>

#include <plhash.h>
#include <plhash_glue.h>
#include "debug_switches.h"

#include "util.h"
Expand Down
2 changes: 1 addition & 1 deletion db/lrucache.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <stdint.h>

#include "list.h"
#include "plhash.h"
#include <plhash_glue.h>

#include "lrucache.h"
#include <mem_uncategorized.h>
Expand Down
2 changes: 1 addition & 1 deletion db/lrucache.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#ifndef INCLUDED_LRUCACHE_H
#define INCLUDED_LRUCACHE_H

#include "plhash.h"
#include <plhash_glue.h>
#include "list.h"

struct lrucache {
Expand Down
2 changes: 1 addition & 1 deletion db/machcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

#include <pthread.h>
#include <plhash.h>
#include <plhash_glue.h>
#include <string.h>
#include <sys_wrap.h>
#include <cdb2api.h>
Expand Down
2 changes: 1 addition & 1 deletion db/memdebug.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include <alloca.h>
#include <strings.h>

#include <plhash.h>
#include <plhash_glue.h>
#include <list.h>
#include <walkback.h>
#include <lockmacros.h>
Expand Down
2 changes: 1 addition & 1 deletion db/osqlblkseq.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#include <stdio.h>
#include <pthread.h>
#include <plhash.h>
#include <plhash_glue.h>
#include <poll.h>
#include "comdb2.h"
#include "osqlblkseq.h"
Expand Down
2 changes: 1 addition & 1 deletion db/osqlblockproc.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include <poll.h>
#include <str0.h>
#include <epochlib.h>
#include <plhash.h>
#include <plhash_glue.h>
#include <assert.h>
#include <unistd.h>
#include <uuid/uuid.h>
Expand Down
2 changes: 1 addition & 1 deletion db/osqlcheckboard.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include <fcntl.h>
#include <unistd.h>
#include <poll.h>
#include <plhash.h>
#include <plhash_glue.h>
#include <ctrace.h>
#include "comdb2.h"
#include "osqlcheckboard.h"
Expand Down
2 changes: 1 addition & 1 deletion db/osqlshadtbl.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include "bdb_osqlcur.h"
#include <assert.h>
#include <list.h>
#include <plhash.h>
#include <plhash_glue.h>
#include <bpfunc.h>
#include <compile_time_assert.h>

Expand Down
Loading

0 comments on commit 5ae399f

Please sign in to comment.