Commit 7ba0ae83 authored by Marshall Pierce's avatar Marshall Pierce
Browse files

Merge branch 'master' into features/command-line-arguments

parents 34457e8c ef23d0dd
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 "ff3a91392e387670675913780cabaa3435e7d597"
        GIT_TAG "896c99790ddd81ad9ca1dd73670818ccd575793e"
        BUILD_IN_SOURCE 1
        INSTALL_COMMAND ""
    )
+14 −2
Original line number Diff line number Diff line
@@ -11,10 +11,10 @@ using kinetic::KineticRecord;

using std::unique_ptr;

DEFINE_uint64(new_cluster_version, 0, "New cluster version");
DEFINE_int64(new_cluster_version, 1, "New cluster version");

int example_main(unique_ptr<kinetic::ConnectionHandle> connection, int argc, char* argv[]) {
    printf("Setting cluster version of to %" PRIu64 "\n", FLAGS_new_cluster_version);
    printf("Setting cluster version to %" PRId64 "\n", FLAGS_new_cluster_version);

    if (!(connection->blocking().SetClusterVersion(FLAGS_new_cluster_version).ok())) {
        printf("Unable to set cluster version\n");
@@ -23,5 +23,17 @@ int example_main(unique_ptr<kinetic::ConnectionHandle> connection, int argc, cha

    printf("Finished setting cluster version\n");

    // this is not the right cluster version, so the get should fail
    connection->blocking().SetClientClusterVersion(FLAGS_new_cluster_version + 1);

    unique_ptr<KineticRecord> result = unique_ptr<KineticRecord>();
    kinetic::StatusCode code = connection->blocking().Get("foo", result).statusCode();
    if (code != kinetic::StatusCode::REMOTE_CLUSTER_VERSION_MISMATCH) {
        printf("Unexpectedly got %d\n", static_cast<int>(code));
        return 1;
    } else {
        printf("Correctly rejected a GET with incorrect cluster version\n");
    }

    return 0;
}