Class SSTable

    • Field Detail

      • TOMBSTONE_HISTOGRAM_BIN_SIZE

        public static final int TOMBSTONE_HISTOGRAM_BIN_SIZE
        See Also:
        Constant Field Values
      • TOMBSTONE_HISTOGRAM_SPOOL_SIZE

        public static final int TOMBSTONE_HISTOGRAM_SPOOL_SIZE
        See Also:
        Constant Field Values
      • TOMBSTONE_HISTOGRAM_TTL_ROUND_SECONDS

        public static final int TOMBSTONE_HISTOGRAM_TTL_ROUND_SECONDS
      • components

        protected final java.util.Set<Component> components
      • compression

        public final boolean compression
      • ioOptions

        public final IOOptions ioOptions
    • Method Detail

      • getComponents

        public java.util.Set<Component> getComponents()
      • getStreamingComponents

        public java.util.Set<Component> getStreamingComponents()
        Returns all SSTable components that should be streamed.
      • decorateKey

        public DecoratedKey decorateKey​(java.nio.ByteBuffer key)
      • getFilename

        public java.lang.String getFilename()
      • getColumnFamilyName

        public java.lang.String getColumnFamilyName()
      • getKeyspaceName

        public java.lang.String getKeyspaceName()
      • getAllFilePaths

        public java.util.List<java.lang.String> getAllFilePaths()
      • unbuildTo

        protected final <B extends SSTable.Builder<?,​B>> B unbuildTo​(B builder,
                                                                           boolean sharedCopy)
        The method sets fields for this sstable representation on the provided SSTable.Builder. The method is intended to be called from the overloaded unbuildTo method in subclasses.
        Parameters:
        builder - the builder on which the fields should be set
        sharedCopy - whether the SharedCloseable resources should be passed as shared copies or directly; note that the method will overwrite the fields representing SharedCloseable only if they are not set in the builder yet (the relevant fields in the builder are null). Although SSTable does not keep any references to resources, the parameters is added for the possible future fields and for consistency with the overloaded implementations in subclasses
        Returns:
        the same instance of builder as provided
      • tryComponentFromFilename

        public static Pair<Descriptor,​Component> tryComponentFromFilename​(File file)
        Parse a sstable filename into both a Descriptor and Component object.
        Parameters:
        file - the filename to parse.
        Returns:
        a pair of the Descriptor and Component corresponding to file if it corresponds to a valid and supported sstable filename, null otherwise. Note that components of an unknown type will be returned as CUSTOM ones.
      • tryComponentFromFilename

        public static Pair<Descriptor,​Component> tryComponentFromFilename​(File file,
                                                                                java.lang.String keyspace,
                                                                                java.lang.String table)
        Parse a sstable filename into both a Descriptor and Component object.
        Parameters:
        file - the filename to parse.
        keyspace - The keyspace name of the file.
        table - The table name of the file.
        Returns:
        a pair of the Descriptor and Component corresponding to file if it corresponds to a valid and supported sstable filename, null otherwise. Note that components of an unknown type will be returned as CUSTOM ones.
      • tryDescriptorFromFile

        public static Descriptor tryDescriptorFromFile​(File file)
        Parse a sstable filename into a Descriptor object.

        Note that this method ignores the component part of the filename; if this is not what you want, use tryComponentFromFilename(org.apache.cassandra.io.util.File) instead.

        Parameters:
        file - the filename to parse.
        Returns:
        the Descriptor corresponding to file if it corresponds to a valid and supported sstable filename, null otherwise.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • validateRepairedMetadata

        public static void validateRepairedMetadata​(long repairedAt,
                                                    TimeUUID pendingRepair,
                                                    boolean isTransient)
      • addComponents

        public void addComponents​(java.util.Collection<Component> newComponents)
        Registers new custom components. Used by custom compaction strategies. Adding a component for the second time is a no-op. Don't remove this - this method is a part of the public API, intended for use by custom compaction strategies.
        Parameters:
        newComponents - collection of components to be added
      • registerComponents

        public void registerComponents​(java.util.Collection<Component> newComponents,
                                       Tracker tracker)
        Registers new custom components into sstable and update size tracking
        Parameters:
        newComponents - collection of components to be added
        tracker - used to update on-disk size metrics
      • unregisterComponents

        public void unregisterComponents​(java.util.Collection<Component> removeComponents,
                                         Tracker tracker)
        Unregisters custom components from sstable and update size tracking
        Parameters:
        removeComponents - collection of components to be remove
        tracker - used to update on-disk size metrics