Class SSTablesBundler

  • All Implemented Interfaces:
    java.util.Iterator<Bundle>

    public class SSTablesBundler
    extends java.lang.Object
    implements java.util.Iterator<Bundle>
    SSTablesBundler bundles SSTables in the output directory provided by SSTableWriter. With output from SSTableLister, we get sorted list of SSTableCollector.SSTableFilesAndRange. According to sorted order, we move all component files related to a SSTable into bundle folder. When a bundle's size exceeds configured, a new bundle is created and SSTable components are moved into new bundle folder.
    When a bundle is being closed, Bundle generated for that bundle gets written to manifest.json file and added to bundle folder. The entire folder is then zipped and added to zipped_bundles folder
    Under output directory of SSTableWriter, sample folders created look like bundle0, bundle1, bundle2, zipped_bundles
    • Constructor Detail

      • SSTablesBundler

        public SSTablesBundler​(java.nio.file.Path bundleStagingDir,
                               SSTableCollector collector,
                               BundleNameGenerator bundleNameGenerator,
                               long maxSizePerBundleInBytes)
    • Method Detail

      • hasNext

        public boolean hasNext()
        Specified by:
        hasNext in interface java.util.Iterator<Bundle>
      • next

        public Bundle next()
        Specified by:
        next in interface java.util.Iterator<Bundle>
      • includeDirectory

        public void includeDirectory​(java.nio.file.Path dir)
      • includeSSTable

        public void includeSSTable​(java.util.List<java.nio.file.Path> sstableComponents)
      • includeFileDigests

        public void includeFileDigests​(java.util.Map<java.nio.file.Path,​Digest> fileDigests)
      • finish

        public void finish()
      • cleanupBundle

        public void cleanupBundle​(java.lang.String sessionID)