Class VirtualClusterManager
java.lang.Object
com.cockroachlabs.data.continuum.cloud.VirtualClusterManager
Manages the lifecycle of Cockroach virtual clusters over a SQL connection to a
Continuum host cluster, using the
CREATE / SHOW / DROP VIRTUAL CLUSTER
statements. These require a Continuum-enabled cluster.
Virtual-cluster names are interpolated into DDL (identifiers cannot be bind
parameters), so create(java.lang.String) / drop(java.lang.String) validate the name against a
strict identifier pattern to prevent SQL injection.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidRunsCREATE VIRTUAL CLUSTER <name>.voidRunsDROP VIRTUAL CLUSTER <name>.list()RunsSHOW VIRTUAL CLUSTERSand returns the rows.static StringroutingConnString(String base, String vclusterName) Rewrites a connection string to route connections to the named virtual cluster.
-
Constructor Details
-
VirtualClusterManager
public VirtualClusterManager(org.springframework.jdbc.core.JdbcTemplate jdbc)
-
-
Method Details
-
create
RunsCREATE VIRTUAL CLUSTER <name>. -
drop
RunsDROP VIRTUAL CLUSTER <name>. -
list
RunsSHOW VIRTUAL CLUSTERSand returns the rows. -
routingConnString
Rewrites a connection string to route connections to the named virtual cluster. CockroachDB routes via the connection option-ccluster=<name>; this appends anoptionsparameter carrying it. Assumes the base string does not already setoptions.
-