Loading include/kinetic_client.h +2 −3 Original line number Diff line number Diff line Loading @@ -26,8 +26,7 @@ /** * Initializes the Kinetic API and configures logging destination. * * @param log_file (path to log file, 'stdout' to log to STDOUT, NULL to disable logging) * @param log_level Logging level (-1:none, 0:error, 1:info, 2:verbose, 3:full) * @param config A configuration struct. * * @return Returns a pointer to a `KineticClient`. You need to pass * this pointer to KineticClient_CreateConnection() to create Loading @@ -36,7 +35,7 @@ * are no active connections. The pointer should be release * with KineticClient_Shutdown() */ KineticClient * KineticClient_Init(const char* log_file, int log_level); KineticClient * KineticClient_Init(KineticClientConfig *config); /** * @brief Performs shutdown/cleanup of the kinetic-c client lib Loading include/kinetic_types.h +27 −0 Original line number Diff line number Diff line Loading @@ -362,6 +362,33 @@ struct _KineticP2P_Operation { KineticP2P_OperationData* operations; // pointer must remain valid until operations complete }; /* Default values for the KineticClientConfig struct, which will be used * if the corresponding field in the struct is 0. */ #define KINETIC_CLIENT_DEFAULT_LOG_LEVEL 0 #define KINETIC_CLIENT_DEFAULT_WRITER_THREADS 4 #define KINETIC_CLIENT_DEFAULT_READER_THREADS 4 #define KINETIC_CLIENT_DEFAULT_MAX_THREADPOOL_THREADS 8 /** * @brief Configuration values for the KineticClient connection. * * Configuration for the KineticClient connection. If fields are zeroed out, default * values will be used. * * @var logFile (path to log file, 'stdout' to log to STDOUT, NULL to disable logging) * @var logLevel Logging level (-1:none, 0:error, 1:info, 2:verbose, 3:full) * @var writerThreads Number of threads used for handling outgoing requests * @var readerThreads Number of threads used for handling incoming responses and status messages * @var maxThreadpoolThreads Max number of threads to use for the threadpool that handles response callbacks. */ typedef struct { const char *logFile; int logLevel; uint8_t writerThreads; uint8_t readerThreads; uint8_t maxThreadpoolThreads; } KineticClientConfig; const char* KineticMessageType_GetName(KineticMessageType type); #define KINETIC_DEVICE_INFO_SCRATCH_BUF_LEN (1024 * 1024 * 4) // Will get reallocated to actual/used size post-copy Loading src/examples/blocking_getkeyrange.c +5 −1 Original line number Diff line number Diff line Loading @@ -124,7 +124,11 @@ int main(int argc, char** argv) } }; KineticClient * client = KineticClient_Init("stdout", 1); KineticClientConfig client_config = { .logFile = "stdout", .logLevel = 1, }; KineticClient * client = KineticClient_Init(&client_config); if (client == NULL) { return 1; } status = KineticClient_CreateConnection(&session, client); if (status != KINETIC_STATUS_SUCCESS) { Loading src/examples/blocking_noop.c +5 −1 Original line number Diff line number Diff line Loading @@ -57,7 +57,11 @@ int main(int argc, char** argv) } }; KineticClient * client = KineticClient_Init("stdout", 1); KineticClientConfig client_config = { .logFile = "stdout", .logLevel = 1, }; KineticClient * client = KineticClient_Init(&client_config); if (client == NULL) { return 1; } status = KineticClient_CreateConnection(&session, client); if (status != KINETIC_STATUS_SUCCESS) { Loading src/examples/blocking_put_get.c +5 −1 Original line number Diff line number Diff line Loading @@ -111,7 +111,11 @@ int main(int argc, char** argv) } }; KineticClient * client = KineticClient_Init("stdout", 1); KineticClientConfig client_config = { .logFile = "stdout", .logLevel = 1, }; KineticClient * client = KineticClient_Init(&client_config); if (client == NULL) { return 1; } status = KineticClient_CreateConnection(&session, client); if (status != KINETIC_STATUS_SUCCESS) { Loading Loading
include/kinetic_client.h +2 −3 Original line number Diff line number Diff line Loading @@ -26,8 +26,7 @@ /** * Initializes the Kinetic API and configures logging destination. * * @param log_file (path to log file, 'stdout' to log to STDOUT, NULL to disable logging) * @param log_level Logging level (-1:none, 0:error, 1:info, 2:verbose, 3:full) * @param config A configuration struct. * * @return Returns a pointer to a `KineticClient`. You need to pass * this pointer to KineticClient_CreateConnection() to create Loading @@ -36,7 +35,7 @@ * are no active connections. The pointer should be release * with KineticClient_Shutdown() */ KineticClient * KineticClient_Init(const char* log_file, int log_level); KineticClient * KineticClient_Init(KineticClientConfig *config); /** * @brief Performs shutdown/cleanup of the kinetic-c client lib Loading
include/kinetic_types.h +27 −0 Original line number Diff line number Diff line Loading @@ -362,6 +362,33 @@ struct _KineticP2P_Operation { KineticP2P_OperationData* operations; // pointer must remain valid until operations complete }; /* Default values for the KineticClientConfig struct, which will be used * if the corresponding field in the struct is 0. */ #define KINETIC_CLIENT_DEFAULT_LOG_LEVEL 0 #define KINETIC_CLIENT_DEFAULT_WRITER_THREADS 4 #define KINETIC_CLIENT_DEFAULT_READER_THREADS 4 #define KINETIC_CLIENT_DEFAULT_MAX_THREADPOOL_THREADS 8 /** * @brief Configuration values for the KineticClient connection. * * Configuration for the KineticClient connection. If fields are zeroed out, default * values will be used. * * @var logFile (path to log file, 'stdout' to log to STDOUT, NULL to disable logging) * @var logLevel Logging level (-1:none, 0:error, 1:info, 2:verbose, 3:full) * @var writerThreads Number of threads used for handling outgoing requests * @var readerThreads Number of threads used for handling incoming responses and status messages * @var maxThreadpoolThreads Max number of threads to use for the threadpool that handles response callbacks. */ typedef struct { const char *logFile; int logLevel; uint8_t writerThreads; uint8_t readerThreads; uint8_t maxThreadpoolThreads; } KineticClientConfig; const char* KineticMessageType_GetName(KineticMessageType type); #define KINETIC_DEVICE_INFO_SCRATCH_BUF_LEN (1024 * 1024 * 4) // Will get reallocated to actual/used size post-copy Loading
src/examples/blocking_getkeyrange.c +5 −1 Original line number Diff line number Diff line Loading @@ -124,7 +124,11 @@ int main(int argc, char** argv) } }; KineticClient * client = KineticClient_Init("stdout", 1); KineticClientConfig client_config = { .logFile = "stdout", .logLevel = 1, }; KineticClient * client = KineticClient_Init(&client_config); if (client == NULL) { return 1; } status = KineticClient_CreateConnection(&session, client); if (status != KINETIC_STATUS_SUCCESS) { Loading
src/examples/blocking_noop.c +5 −1 Original line number Diff line number Diff line Loading @@ -57,7 +57,11 @@ int main(int argc, char** argv) } }; KineticClient * client = KineticClient_Init("stdout", 1); KineticClientConfig client_config = { .logFile = "stdout", .logLevel = 1, }; KineticClient * client = KineticClient_Init(&client_config); if (client == NULL) { return 1; } status = KineticClient_CreateConnection(&session, client); if (status != KINETIC_STATUS_SUCCESS) { Loading
src/examples/blocking_put_get.c +5 −1 Original line number Diff line number Diff line Loading @@ -111,7 +111,11 @@ int main(int argc, char** argv) } }; KineticClient * client = KineticClient_Init("stdout", 1); KineticClientConfig client_config = { .logFile = "stdout", .logLevel = 1, }; KineticClient * client = KineticClient_Init(&client_config); if (client == NULL) { return 1; } status = KineticClient_CreateConnection(&session, client); if (status != KINETIC_STATUS_SUCCESS) { Loading