Skip to content

Cassandra driver 3.8.0 required priming #201

@nfisher

Description

@nfisher

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions