Class SidecarTableSizeProvider

  • All Implemented Interfaces:
    org.apache.cassandra.spark.data.TableSizeProvider

    public class SidecarTableSizeProvider
    extends java.lang.Object
    implements org.apache.cassandra.spark.data.TableSizeProvider
    Implementation of TableSizeProvider that 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
      long tableSizeInBytes​(java.lang.String keyspace, java.lang.String table, java.lang.String datacenter)
      Returns the total used space for table across the datacenter.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SidecarTableSizeProvider

        public 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 Detail

      • tableSizeInBytes

        public long tableSizeInBytes​(java.lang.String keyspace,
                                     java.lang.String table,
                                     java.lang.String datacenter)
        Returns the total used space for table across 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:
        tableSizeInBytes in interface org.apache.cassandra.spark.data.TableSizeProvider
        Parameters:
        keyspace - the keyspace where the table lives
        table - the table to get the size from
        datacenter - 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