Class CassandraContext
- java.lang.Object
-
- org.apache.cassandra.spark.bulkwriter.CassandraContext
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,StartupValidatable
public class CassandraContext extends java.lang.Object implements StartupValidatable, java.io.Closeable
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Set<o.a.c.sidecar.client.shaded.client.SidecarInstance>clusterConfig
-
Constructor Summary
Constructors Modifier Constructor Description protectedCassandraContext(BulkSparkConf conf, java.lang.String clusterId)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()protected java.lang.StringclusterId()protected BulkSparkConfconf()static CassandraContextcreate(BulkSparkConf conf, java.lang.String clusterId)protected java.util.Set<o.a.c.sidecar.client.shaded.client.SidecarInstance>createClusterConfig()java.util.Set<o.a.c.sidecar.client.shaded.client.SidecarInstance>getCluster()o.a.c.sidecar.client.shaded.client.SidecarClientgetSidecarClient()protected o.a.c.sidecar.client.shaded.client.SidecarClientinitializeSidecarClient(BulkSparkConf conf)voidrefreshClusterConfig()intsidecarPort()voidstartupValidate()Performs startup validation usingStartupValidatorwith currently registeredStartupValidations, throws aRuntimeExceptionif any violations are found, needs to be invoked once per execution before any actual work is started
-
-
-
Constructor Detail
-
CassandraContext
protected CassandraContext(BulkSparkConf conf, @Nullable java.lang.String clusterId)
-
-
Method Detail
-
create
public static CassandraContext create(BulkSparkConf conf, @Nullable java.lang.String clusterId)
-
getCluster
public java.util.Set<o.a.c.sidecar.client.shaded.client.SidecarInstance> getCluster()
-
refreshClusterConfig
public void refreshClusterConfig()
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable
-
initializeSidecarClient
protected o.a.c.sidecar.client.shaded.client.SidecarClient initializeSidecarClient(BulkSparkConf conf)
-
createClusterConfig
protected java.util.Set<o.a.c.sidecar.client.shaded.client.SidecarInstance> createClusterConfig()
-
getSidecarClient
public o.a.c.sidecar.client.shaded.client.SidecarClient getSidecarClient()
-
sidecarPort
public int sidecarPort()
-
conf
protected BulkSparkConf conf()
-
clusterId
protected java.lang.String clusterId()
-
startupValidate
public void startupValidate()
Description copied from interface:StartupValidatablePerforms startup validation usingStartupValidatorwith currently registeredStartupValidations, throws aRuntimeExceptionif any violations are found, needs to be invoked once per execution before any actual work is started- Specified by:
startupValidatein interfaceStartupValidatable
-
-