Commit 013d1949 authored by Job Vranish's avatar Job Vranish
Browse files

fixed initialization issue with p2p ops

parent c88a7ee6
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -81,7 +81,7 @@ KineticStatus KineticClient_NoOp(KineticSessionHandle handle);
 *                      specify the data to be stored.
 * @param closure       Optional closure. If specified, operation will be
 *                      executed in asynchronous mode, and closure callback
 *                      will be called upon completion.
 *                      will be called upon completion in another thread.
 * 
 * @return              Returns the resulting KineticStatus.
 */
@@ -95,7 +95,7 @@ KineticStatus KineticClient_Put(KineticSessionHandle handle,
 * @param handle        KineticSessionHandle for a connected session.
 * @param closure       Optional closure. If specified, operation will be
 *                      executed in asynchronous mode, and closure callback
 *                      will be called upon completion.
 *                      will be called upon completion in another thread.
 *                      
 * @return              Returns the resulting KineticStatus.
 */
@@ -110,7 +110,7 @@ KineticStatus KineticClient_Flush(KineticSessionHandle handle,
 *                      be populated unless 'metadataOnly' is set to 'true'.
 * @param closure       Optional closure. If specified, operation will be
 *                      executed in asynchronous mode, and closure callback
 *                      will be called upon completion.
 *                      will be called upon completion in another thread.
 *
 * @return              Returns the resulting KineticStatus.
 */
@@ -130,7 +130,7 @@ KineticStatus KineticClient_Get(KineticSessionHandle handle,
 *                      
 * @param closure       Optional closure. If specified, operation will be
 *                      executed in asynchronous mode, and closure callback
 *                      will be called upon completion.
 *                      will be called upon completion in another thread.
 *
 * @return              Returns the resulting KineticStatus.
 */
@@ -150,7 +150,7 @@ KineticStatus KineticClient_GetPrevious(KineticSessionHandle handle,
 *                      
 * @param closure       Optional closure. If specified, operation will be
 *                      executed in asynchronous mode, and closure callback
 *                      will be called upon completion.
 *                      will be called upon completion in another thread.
 *
 * @return              Returns the resulting KineticStatus.
 */
@@ -166,7 +166,7 @@ KineticStatus KineticClient_GetNext(KineticSessionHandle handle,
 *                      not used for this operation.
 * @param closure       Optional closure. If specified, operation will be
 *                      executed in asynchronous mode, and closure callback
 *                      will be called upon completion.
 *                      will be called upon completion in another thread.
 *
 * @return              Returns the resulting KineticStatus.
 */
@@ -183,7 +183,7 @@ KineticStatus KineticClient_Delete(KineticSessionHandle handle,
 * @param keys          ByteBufferArray to store the retrieved keys
 * @param closure       Optional closure. If specified, operation will be
 *                      executed in asynchronous mode, and closure callback
 *                      will be called upon completion.
 *                      will be called upon completion in another thread.
 *
 *
 * @return              Returns 0 upon success, -1 or the Kinetic status code
@@ -204,7 +204,7 @@ KineticStatus KineticClient_GetKeyRange(KineticSessionHandle handle,
 *                      the requested data, if successful.
 * @param closure       Optional closure. If specified, operation will be
 *                      executed in asynchronous mode, and closure callback
 *                      will be called upon completion.
 *                      will be called upon completion in another thread.
 *
 * @return              Returns 0 upon success, -1 or the Kinetic status code
 *                      upon failure
@@ -224,7 +224,7 @@ KineticStatus KineticClient_GetLog(KineticSessionHandle handle,
 *                      this structure.
 * @param closure       Optional closure. If specified, operation will be
 *                      executed in asynchronous mode, and closure callback
 *                      will be called upon completion.
 *                      will be called upon completion in another thread.
 *
 * @return              Returns 0 upon success, -1 or the Kinetic status code
 *                      upon failure. Note that P2P operations can be nested. This
+22 −21
Original line number Diff line number Diff line
@@ -551,27 +551,28 @@ void KineticOperation_BuildP2POperation(KineticOperation* const operation,
        KineticProto_Command_P2POperation_Operation * p2p_op_op = calloc(1, sizeof(KineticProto_Command_P2POperation_Operation));
        assert(p2p_op_op != NULL);

        (*p2p_op_op) = (KineticProto_Command_P2POperation_Operation){
            .has_key = true,
            .key.data = p2pOp->operations[i].key.array.data,
            .key.len = p2pOp->operations[i].key.bytesUsed,
        KineticProto_command_p2_poperation_operation__init(p2p_op_op);

            .has_newKey = !ByteBuffer_IsNull(p2pOp->operations[i].newKey),
            .newKey.data = p2pOp->operations[i].newKey.array.data,
            .newKey.len = p2pOp->operations[i].newKey.bytesUsed,
        p2p_op_op->has_key = true;
        p2p_op_op->key.data = p2pOp->operations[i].key.array.data;
        p2p_op_op->key.len = p2pOp->operations[i].key.bytesUsed;

            .has_version = !ByteBuffer_IsNull(p2pOp->operations[i].version),
            .version.data = p2pOp->operations[i].version.array.data,
            .version.len = p2pOp->operations[i].version.bytesUsed,
        p2p_op_op->has_newKey = !ByteBuffer_IsNull(p2pOp->operations[i].newKey);
        p2p_op_op->newKey.data = p2pOp->operations[i].newKey.array.data;
        p2p_op_op->newKey.len = p2pOp->operations[i].newKey.bytesUsed;

        p2p_op_op->has_version = !ByteBuffer_IsNull(p2pOp->operations[i].version);
        p2p_op_op->version.data = p2pOp->operations[i].version.array.data;
        p2p_op_op->version.len = p2pOp->operations[i].version.bytesUsed;

        // force if no version was specified
            .has_force = ByteBuffer_IsNull(p2pOp->operations[i].version),
            .force = ByteBuffer_IsNull(p2pOp->operations[i].version),
        p2p_op_op->has_force = ByteBuffer_IsNull(p2pOp->operations[i].version);
        p2p_op_op->force = ByteBuffer_IsNull(p2pOp->operations[i].version);

        // no nesting for now
            .p2pop = NULL,
            .status = NULL,
        };
        p2p_op_op->p2pop = NULL;
        p2p_op_op->status = NULL;

        operation->request->command->body->p2pOperation->operation[i] = p2p_op_op;
    }

+2 −0
Original line number Diff line number Diff line
@@ -49,6 +49,8 @@
#endif


#define NUM_ELEMENTS(ARRAY) (sizeof(ARRAY)/sizeof((ARRAY)[0]))

typedef struct _KineticPDU KineticPDU;
typedef struct _KineticOperation KineticOperation;
typedef struct _KineticConnection KineticConnection;