Package io.stargate.sdk.rest
Class KeyspaceClient
java.lang.Object
io.stargate.sdk.rest.KeyspaceClient
Client for API resource /v2/namespaces.
- Author:
- Cedrick LUNVEN (@clunven)
-
Field Summary
FieldsModifier and TypeFieldDescription/v2/keyspaces/{keyspace}/v2/schemas/keyspaces/{keyspace}static final StringURL parts.static final StringURL parts.static final StringURL parts./v2/keyspaces/{keyspace}/tables/v2/schemas/keyspaces/{keyspace}/tables/v2/keyspaces/{keyspace}/types/v2/schemas/keyspaces/{keyspace}/types -
Constructor Summary
ConstructorsConstructorDescriptionKeyspaceClient(StargateRestApiClient apiData, String keyspace) Full constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidcreate(DataCenter... datacenters) Create a keyspace providing the replications per Datacenter.voidcreateSimple(int replicas) Create a keyspace.voidcreateTable(String tableName, CreateTable ct) Syntax sugar more easier to understand in a fluent API.voiddelete()Delete a keyspace.booleanexist()Check it the keyspace exist.find()Find a namespace and its metadata based on its id.Getter accessor for attribute 'keyspace'.Move to the Table clientMap to list only table names.tables()List tablenames in keyspace.Sample collector as MAP of stream.Move to the Type clientMap to list only types names.types()List types in the keyspace.
-
Field Details
-
PATH_KEYSPACES
URL parts.- See Also:
-
PATH_TABLES
URL parts.- See Also:
-
PATH_TYPES
URL parts.- See Also:
-
keyspaceResource
/v2/keyspaces/{keyspace} -
keyspaceSchemaResource
/v2/schemas/keyspaces/{keyspace} -
tablesResource
/v2/keyspaces/{keyspace}/tables -
tablesSchemaResource
/v2/schemas/keyspaces/{keyspace}/tables -
typesResource
/v2/keyspaces/{keyspace}/types -
typesSchemaResource
/v2/schemas/keyspaces/{keyspace}/types
-
-
Constructor Details
-
KeyspaceClient
Full constructor.- Parameters:
apiData- apiDatakeyspace- String
-
-
Method Details
-
find
Find a namespace and its metadata based on its id.- Returns:
- Keyspace
- See Also:
-
exist
public boolean exist()Check it the keyspace exist.- Returns:
- boolean
-
create
Create a keyspace providing the replications per Datacenter.- Parameters:
datacenters- DataCenter- See Also:
-
createSimple
public void createSimple(int replicas) Create a keyspace.- Parameters:
replicas- int- See Also:
-
delete
public void delete()Delete a keyspace.- See Also:
-
tables
List tablenames in keyspace.- Returns:
- TableDefinition
- See Also:
-
tablesAsMap
Sample collector as MAP of stream.- Returns:
- map
-
types
List types in the keyspace.- Returns:
- list of types.
- See Also:
-
tableNames
Map to list only table names.- Returns:
- Stream
-
typeNames
Map to list only types names.- Returns:
- Stream
-
table
Move to the Table client- Parameters:
tableName- String- Returns:
- TableClient
-
type
Move to the Type client- Parameters:
typeName- String- Returns:
- TypeClient
-
createTable
Syntax sugar more easier to understand in a fluent API.- Parameters:
tableName- tableNamect- CreateTable- See Also:
-
getKeyspace
Getter accessor for attribute 'keyspace'.- Returns:
- current value of 'keyspace'
-