Package org.apache.cassandra.spark.data
Class SidecarTableSizeProvider
- java.lang.Object
-
- org.apache.cassandra.spark.data.SidecarTableSizeProvider
-
- All Implemented Interfaces:
org.apache.cassandra.spark.data.TableSizeProvider
public class SidecarTableSizeProvider extends java.lang.Object implements org.apache.cassandra.spark.data.TableSizeProviderImplementation ofTableSizeProviderthat uses Sidecar's client to calculate the table size
-
-
Constructor Summary
Constructors Constructor Description SidecarTableSizeProvider(o.a.c.sidecar.client.shaded.client.SidecarClient sidecarClient, int sidecarPort, java.util.concurrent.CompletableFuture<o.a.c.sidecar.client.shaded.common.response.RingResponse> ringFuture)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longtableSizeInBytes(java.lang.String keyspace, java.lang.String table, java.lang.String datacenter)Returns the total used space fortableacross the datacenter.
-
-
-
Method Detail
-
tableSizeInBytes
public long tableSizeInBytes(java.lang.String keyspace, java.lang.String table, java.lang.String datacenter)Returns the total used space fortableacross the datacenter. If only a subset of instances succeeds gathering the table size, the method will normalize the table size to the number of instances. If all the instances fail to retrieve the table size, this method will throw an exception.- Specified by:
tableSizeInBytesin interfaceorg.apache.cassandra.spark.data.TableSizeProvider- Parameters:
keyspace- the keyspace where the table livestable- the table to get the size fromdatacenter- the datacenter- Returns:
- the total used space for the table across the datacenter
- Throws:
java.lang.RuntimeException- when all the instances fail to retrieve the table size
-
-