27 #include <sys/param.h>
32 #include <openssl/sha.h>
35 for (
int i = 0; i < 5; i++) {
40 uint8_t value[] =
"valueX";
52 .value = put_value_buf,
71 const size_t max_key_count = 5;
72 const size_t max_key_length = 64;
73 uint8_t first_key[max_key_length];
74 uint8_t last_key[max_key_length];
79 .startKeyInclusive =
true,
80 .endKeyInclusive =
true,
81 .maxReturned = max_key_count,
84 uint8_t key_mem[max_key_count][max_key_length];
85 memset(key_mem, 0,
sizeof(key_mem));
88 for (
size_t i = 0; i < max_key_count; i++) {
93 .count = max_key_count,
101 for (
size_t i = 0; i < max_key_count; i++) {
102 printf(
"%zd: %s\n", i, key_buffers[i].array.data);
109 int main(
int argc,
char** argv)
115 KineticSession* session;
121 if (client == NULL) {
return 1; }
122 const char HmacKeyString[] =
"asdfasdf";
132 fprintf(stderr,
"Failed connecting to the Kinetic device w/status: %s\n",
ByteBuffer * ByteBuffer_Append(ByteBuffer *buffer, const void *data, size_t len)
Structure for an embedded ByteArray as a buffer.
This request is made persistent before returning.
ByteBuffer ByteBuffer_Malloc(size_t size)
KineticStatus KineticClient_CreateSession(KineticSessionConfig *const config, KineticClient *const client, KineticSession **session)
Creates a session with the Kinetic Device per specified configuration.
Structure used to specify the configuration for a session.
KineticStatus KineticClient_DestroySession(KineticSession *const session)
Closes the connection to a host.
ByteArray array
ByteArray holding allocated array w/length = allocated size.
char host[256]
Host name/IP address of Kinetic Device.
int main(int argc, char **argv)
const char * Kinetic_GetStatusDescription(KineticStatus status)
Provides a string representation for a KineticStatus code.
ByteBuffer ByteBuffer_Create(void *data, size_t max_len, size_t used)
Kinetic Key Range request structure.
KineticStatus KineticClient_GetKeyRange(KineticSession *const session, KineticKeyRange *range, ByteBufferArray *keys, KineticCompletionClosure *closure)
Executes a GETKEYRANGE operation to retrieve a set of keys in the range specified range from the Kine...
#define KINETIC_PORT
Default kinetic port.
ByteBuffer startKey
Required bytes, the beginning of the requested range.
static void do_put_and_getkeyrange(KineticSession *const session)
const char * logFile
Path to log file. Specify 'stdout' to log to STDOUT or NULL to disable logging.
ByteBuffer key
Key associated with the object stored on disk.
uint8_t * data
Pointer to an allocated array of data bytes.
KineticStatus
Kinetic status codes.
KineticStatus KineticClient_Put(KineticSession *const session, KineticEntry *const entry, KineticCompletionClosure *closure)
Executes a PUT operation to store/update an entry on the Kinetic Device.
ByteBuffer ByteBuffer_MallocAndAppend(const void *data, size_t len)
Configuration values for the KineticClient connection.
void KineticClient_Shutdown(KineticClient *const client)
Performs shutdown/cleanup of the kinetic-c client library.
KineticClient * KineticClient_Init(KineticClientConfig *config)
Initializes the Kinetic API and configures logging.
size_t bytesUsed
Reflects the number of bytes used from the array
void ByteBuffer_Free(ByteBuffer buffer)
ByteArray ByteArray_CreateWithCString(const char *str)
ByteBuffer ByteBuffer_CreateAndAppendCString(void *data, size_t max_len, const char *value)