Commit e0d53834 authored by Marshall Pierce's avatar Marshall Pierce
Browse files

Merge pull request #9 from Seagate/features/unique_ptr_output

Features/unique ptr output
parents 6b622339 60d15183
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ else(USE_LOCAL_KINETIC_CLIENT)
        kinetic_cpp_client
        PREFIX "vendor"
        GIT_REPOSITORY "git@github.com:Seagate/Kinetic-C-Client.git"
        GIT_TAG "ed256779886d08671551d3441a31a467b094f9dc"
        GIT_TAG "d91b9075f4d7f0460413940ddf5dfa0045aed6f4"
        BUILD_IN_SOURCE 1
        INSTALL_COMMAND ""
    )
+2 −7
Original line number Diff line number Diff line
@@ -9,17 +9,13 @@
#include "value_factory.h"
#include "socket_wrapper.h"

using com::seagate::kinetic::HmacProvider;
using com::seagate::kinetic::proto::Message;
using com::seagate::kinetic::proto::Message_MessageType_GET;
using com::seagate::kinetic::proto::Message_Algorithm_SHA1;
using com::seagate::kinetic::ValueFactory;
using kinetic::KineticConnectionFactory;
using kinetic::KineticRecord;
using kinetic::NonblockingError;
using kinetic::SimpleCallbackInterface;
using kinetic::Status;
using palominolabs::protobufutil::MessageStreamFactory;


int main(int argc, char* argv[]) {
    google::InitGoogleLogging(argv[0]);
@@ -46,14 +42,13 @@ int main(int argc, char* argv[]) {
        return 1;
    }

    KineticRecord* record;
    std::unique_ptr<KineticRecord> record;
    if(!connection->blocking().Get(kinetic_key, &record).ok()) {
        printf("Unable to get metadata\n");
        return 1;
    }

    long long file_size = std::stoll(record->value());
    delete record;
    printf("Deleting file of size %llu\n", file_size);

    char key_buffer[100];
+1 −8
Original line number Diff line number Diff line
@@ -9,17 +9,11 @@
#include "value_factory.h"
#include "socket_wrapper.h"

using com::seagate::kinetic::HmacProvider;
using com::seagate::kinetic::proto::Message;
using com::seagate::kinetic::proto::Message_MessageType_GET;
using com::seagate::kinetic::proto::Message_Algorithm_SHA1;
using com::seagate::kinetic::ValueFactory;
using kinetic::KineticConnectionFactory;
using kinetic::KineticRecord;
using kinetic::NonblockingError;
using kinetic::SimpleCallbackInterface;
using kinetic::Status;
using palominolabs::protobufutil::MessageStreamFactory;

class DeleteCallback : public SimpleCallbackInterface {
public:
@@ -64,14 +58,13 @@ int main(int argc, char* argv[]) {
        return 1;
    }

    KineticRecord* record;
    std::unique_ptr<KineticRecord> record;
    if(!connection->blocking().Get(kinetic_key, &record).ok()) {
        printf("Unable to get metadata\n");
        return 1;
    }

    long long file_size = std::stoll(record->value());
    delete record;
    printf("Deleting file of size %llu\n", file_size);

    char key_buffer[100];
+0 −6
Original line number Diff line number Diff line
@@ -9,15 +9,9 @@
#include "kinetic/kinetic_connection_factory.h"
#include "value_factory.h"

using com::seagate::kinetic::HmacProvider;
using com::seagate::kinetic::proto::Message;
using com::seagate::kinetic::proto::Message_MessageType_GET;
using com::seagate::kinetic::proto::Message_Algorithm_SHA1;
using com::seagate::kinetic::ValueFactory;
using kinetic::KineticConnectionFactory;
using kinetic::Status;
using kinetic::KineticRecord;
using palominolabs::protobufutil::MessageStreamFactory;

int main(int argc, char* argv[]) {

+0 −6
Original line number Diff line number Diff line
@@ -8,15 +8,9 @@
#include "kinetic/kinetic_connection_factory.h"
#include "value_factory.h"

using com::seagate::kinetic::HmacProvider;
using com::seagate::kinetic::proto::Message;
using com::seagate::kinetic::proto::Message_MessageType_GET;
using com::seagate::kinetic::proto::Message_Algorithm_SHA1;
using com::seagate::kinetic::ValueFactory;
using kinetic::KineticConnectionFactory;
using kinetic::Status;
using kinetic::KineticRecord;
using palominolabs::protobufutil::MessageStreamFactory;

int main(int argc, char* argv[]) {
    if (argc != 3 && argc != 4) {
Loading