Interface LedgerManagerFactory

    • Method Detail

      • getCurrentVersion

        int getCurrentVersion()
        Return current factory version.
        Returns:
        current version used by factory.
      • initialize

        LedgerManagerFactory initialize​(AbstractConfiguration conf,
                                        LayoutManager layoutManager,
                                        int factoryVersion)
                                 throws java.io.IOException
        Initialize a factory.
        Parameters:
        conf - Configuration object used to initialize factory
        layoutManager - Layout manager used for initialize ledger manager factory
        factoryVersion - What version used to initialize factory.
        Returns:
        ledger manager factory instance
        Throws:
        java.io.IOException - when fail to initialize the factory.
      • close

        void close()
            throws java.io.IOException
        Uninitialize the factory.
        Specified by:
        close in interface java.lang.AutoCloseable
        Throws:
        java.io.IOException - when fail to uninitialize the factory.
      • newLedgerIdGenerator

        LedgerIdGenerator newLedgerIdGenerator()
        Return the ledger id generator, which is used for global unique ledger id generation.
        Returns:
        ledger id generator.
      • newLedgerManager

        LedgerManager newLedgerManager()
        return ledger manager for client-side to manage ledger metadata.
        Returns:
        ledger manager
        See Also:
        LedgerManager
      • newLedgerAuditorManager

        LedgerAuditorManager newLedgerAuditorManager()
                                              throws java.io.IOException,
                                                     java.lang.InterruptedException
        Return a ledger auditor manager, which is used to coordinate the auto-recovery process.
        Returns:
        ledger auditor manager
        Throws:
        java.io.IOException
        java.lang.InterruptedException
        See Also:
        LedgerAuditorManager
      • format

        void format​(AbstractConfiguration<?> conf,
                    LayoutManager lm)
             throws java.lang.InterruptedException,
                    org.apache.zookeeper.KeeperException,
                    java.io.IOException
        Format the ledger metadata for LedgerManager.
        Parameters:
        conf - Configuration instance
        lm - Layout manager
        Throws:
        java.lang.InterruptedException
        org.apache.zookeeper.KeeperException
        java.io.IOException
      • validateAndNukeExistingCluster

        boolean validateAndNukeExistingCluster​(AbstractConfiguration<?> conf,
                                               LayoutManager lm)
                                        throws java.lang.InterruptedException,
                                               org.apache.zookeeper.KeeperException,
                                               java.io.IOException
        This method makes sure there are no unexpected znodes under ledgersRootPath and then it proceeds with ledger metadata formatting and nuking the cluster ZK state info.
        Parameters:
        conf - Configuration instance
        lm - Layout manager
        Throws:
        java.io.IOException
        org.apache.zookeeper.KeeperException
        java.lang.InterruptedException