Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cassandra driver 3.8.0 required priming #201

Open
nfisher opened this issue Apr 14, 2020 · 1 comment
Open

Cassandra driver 3.8.0 required priming #201

nfisher opened this issue Apr 14, 2020 · 1 comment

Comments

@nfisher
Copy link

nfisher commented Apr 14, 2020

I'm using the 3.8.0 java-driver. In order for it to work correctly it required the following priming:

    Map<String, Object> row = ImmutableMap.<String, Object>builder()
        .put("cluster_name", CUSTOM_CLUSTER_NAME)
        .put("data_center","dc1")
        .put("host_id", UUID.fromString("59ad61d0-c540-11e2-881e-b9e6057626c4"))
        .put("partitioner","org.apache.cassandra.dht.Murmur3Partitioner")
        .put("schema_version", UUID.fromString("59ad61d0-c540-11e2-881e-b9e6057626c4"))
        .put("release_version", "3.0.20")
        .put("tokens", Sets.newHashSet("1743244960790844724"))
        .put("rack","rc1")
        .build();

    ThenBuilder thenCluster = then()
        .withColumnTypes(
            column("schema_version", PrimitiveType.UUID),
            column("tokens", set(PrimitiveType.TEXT)),
            column("host_id", PrimitiveType.UUID))
        .withRows(row);;

    PrimingRequest clusterPrime = PrimingRequest
        .queryBuilder()
        .withQuery("SELECT * FROM system.local WHERE key='local'")
        .withThen(thenCluster)
        .build();
    primingClient.prime(clusterPrime);
    PrimingRequest clusterNamePrime = PrimingRequest
        .queryBuilder()
        .withQuery("select cluster_name from system.local where key = 'local'")
        .withThen(then().withRows(ImmutableMap.of("cluster_name", CUSTOM_CLUSTER_NAME)))
        .build();
    primingClient.prime(clusterNamePrime);

If I have time I'll try to update the Markdown files.

@KraTos5589
Copy link

You are a godsend. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants