Class VirtualClusterScope
java.lang.Object
com.cockroachlabs.crdb.vcluster.VirtualClusterScope
A context-scoped executor for a Cockroach vCluster. Binds the vCluster (and
optional workload priority) into
CrdbContext for the duration of the
work, so any Crdb.tx(DataSource, ConnectionCallback) run inside tags
the session (SET application_name + workload QoS) at transaction start.
Scope (v1): this performs workload tagging and QoS assignment. Routing a workload to a different vCluster endpoint is platform-dependent and is intentionally not faked here — that is future work.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> TRunbodywith this vCluster context bound.name()The vCluster name.priority()The workload priority, if set.voidRunbodywith this vCluster context bound.<T> Ttx(DataSource ds, ConnectionCallback<T> work) Run a SERIALIZABLE, auto-retrying transaction with this vCluster context bound; the transaction is tagged withapplication_nameand the mapped workload QoS at start.workload(Workload.Priority priority) Return a scope that also tags the workload priority/QoS.
-
Constructor Details
-
VirtualClusterScope
-
-
Method Details
-
workload
Return a scope that also tags the workload priority/QoS. -
name
The vCluster name. -
priority
The workload priority, if set. -
call
Runbodywith this vCluster context bound. -
run
Runbodywith this vCluster context bound. -
tx
Run a SERIALIZABLE, auto-retrying transaction with this vCluster context bound; the transaction is tagged withapplication_nameand the mapped workload QoS at start.
-