Creating alternator keyspace using JAVA driver

Right now, I am using Python’s boto3 library to create my alternator space:

dynamodb = boto3.resource('dynamodb', endpoint_url=f'http://{alt_host}:8000',
                          region_name='None', aws_access_key_id='None', aws_secret_access_key='None')

According to documentation Using DynamoDB API in Scylla it should support several other languages:

In this example, we will use the Python language to interact with ScyllaDB
with the Boto 3 SDK for Python. It’s also possible to use the CLI or other 
languages such as Java, C#, Python, Perl, PHP, Ruby, Erlang, Javascript.

I was not able to find any examples of this being done in other languages. Anyone can share some code samples, specifically in JAVA (as I am writing my main application in JAVA, I would like to keep it to one language)

DynamoDB doesn’t have a notion of keyspaces, so it’s not possible to create one. Instead just create table, here are some samples from aws sdk (alternator is compatible with dynamodb):

Additionally some example from our alternator load balancing library should demonstrate where to put unused placeholders as alternator doesn’t use AWS region configuration and endpoints:

I ended up coming up with this code:

    private static void createAlternatorKeyspaces() {
        AmazonDynamoDB client = AmazonDynamoDBClientBuilder
                        new AwsClientBuilder
                                .EndpointConfiguration("http://" + alternatorHost + ":8000", Constants.NONE))

        ArrayList<KeySchemaElement> keySchema = new ArrayList<>();
        keySchema.add(new KeySchemaElement().withAttributeName("serial_number").withKeyType(KeyType.HASH));
        keySchema.add(new KeySchemaElement().withAttributeName("issuer_cn").withKeyType(KeyType.RANGE));

        ArrayList<AttributeDefinition> attributeDefinitions = new ArrayList<>();
        attributeDefinitions.add(new AttributeDefinition().withAttributeName("serial_number").withAttributeType("S"));
        attributeDefinitions.add(new AttributeDefinition().withAttributeName("issuer_cn").withAttributeType("S"));

        CreateTableRequest request = new CreateTableRequest()
                        new ProvisionedThroughput().withReadCapacityUnits(10L).withWriteCapacityUnits(10L));
        DynamoDB dynamoDB = new DynamoDB(client);
        Table table = dynamoDB.createTable(request);
        System.out.println("Waiting for blocked_items to be created...this may take a while...");
        try {
        } catch (InterruptedException e) {
            System.err.println("CreateTable request failed for blocked_items");
        System.out.println("CreateTable request succeeded for blocked_items");