Documentation of 'org.apache.derby.iapi.store.raw.data.DataFactory' Java class
DataFactory
org.apache.derby.iapi.store.raw.data

Interface DataFactory

    • Field Detail

      • TEMP_SEGMENT_NAME

        static final java.lang.String TEMP_SEGMENT_NAME
        The temporary segment is called "tmp"
        See Also:
        Constant Field Values
      • DB_LOCKFILE_NAME

        static final java.lang.String DB_LOCKFILE_NAME
        The database lock
        See Also:
        Constant Field Values
      • DB_EX_LOCKFILE_NAME

        static final java.lang.String DB_EX_LOCKFILE_NAME
        file name that is used to acquire exclusive lock on DB.
        See Also:
        Constant Field Values
    • Method Detail

      • isReadOnly

        boolean isReadOnly()
        Is the store read-only.
      • openContainer

        ContainerHandle openContainer(RawTransaction t,
                                      ContainerKey containerId,
                                      LockingPolicy locking,
                                      int mode)
                               throws StandardException
        Open a container that is not droped.
        Parameters:
        t - the raw transaction that is opening the container
        containerId - the container's identity
        locking - the locking policy
        mode - see the different mode in @see ContainerHandle then will return a null handle if the container is dropped.
        Returns:
        the handle to the opened container
        Throws:
        StandardException - Standard Derby error policy
      • addContainer

        long addContainer(RawTransaction t,
                          long segmentId,
                          long containerid,
                          int mode,
                          java.util.Properties tableProperties,
                          int temporaryFlag)
                   throws StandardException
        Add a container.
        Parameters:
        t - the transaction that is creating the container
        segmentId - the segment where the container is to go
        mode - whether or not to LOGGED or not. The effect of this mode is only for this addContainer call, not persisently stored throughout the lifetime of the container
        tableProperties - properties of the container that is persistently stored throughout the lifetime of the container
        Returns:
        the containerId of the newly created container
        Throws:
        StandardException - Standard Derby Error policy
      • addAndLoadStreamContainer

        long addAndLoadStreamContainer(RawTransaction t,
                                       long segmentId,
                                       java.util.Properties tableProperties,
                                       RowSource rowSource)
                                throws StandardException
        Create and load a stream container.
        Parameters:
        t - the transaction that is creating the container
        segmentId - the segment where the container is to go
        tableProperties - properties of the container that is persistently stored throughout the lifetime of the container
        rowSource - the data to load the container with
        Returns:
        the containerId of the newly created stream container
        Throws:
        StandardException - Standard Derby Error policy
      • reCreateContainerForRedoRecovery

        void reCreateContainerForRedoRecovery(RawTransaction t,
                                              long segmentId,
                                              long containerId,
                                              ByteArray containerInfo)
                                       throws StandardException
        re-Create a container during redo recovery. Used if container is found to not exist during redo recovery of log records creating the container.
        Throws:
        StandardException - Standard Derby Error policy
      • getIdentifier

        UUID getIdentifier()
        Return the identifier that uniquely identifies this raw store at runtime. This identifier is to be used as part of the lokcing key for objects locked in the raw store by value (e.g. Containers).
      • setRawStoreFactory

        void setRawStoreFactory(RawStoreFactory rsf,
                                boolean create,
                                java.util.Properties properties)
                         throws StandardException
        make data factory aware of which raw store factory it belongs to Also need to boot the LogFactory
        Throws:
        StandardException - cannot boot the log factory
      • getFileHandler

        FileResource getFileHandler()
        Get an object to handle non-transactional files.
      • removeStubsOK

        void removeStubsOK()
        Tell the data factory it is OK to remove committed deleted containers when the data factory shuts down.
      • setupCacheCleaner

        void setupCacheCleaner(DaemonService daemon)
        Set up the data factory's caches to use the specified daemon service for background cleaning.
        Parameters:
        daemon - daemon service to use for background cleaning
      • decryptAllContainers

        void decryptAllContainers(RawTransaction t)
                           throws StandardException
        Decrypts all the containers in the data segment.
        Parameters:
        t - the transaction that is decrypting the container
        Throws:
        StandardException - Standard Derby Error Policy
      • encryptAllContainers

        void encryptAllContainers(RawTransaction t)
                           throws StandardException
        Encrypt all the containers in the data segment.
        Parameters:
        t - the transaction that is encrypting the containers.
        Throws:
        StandardException - Standard Derby Error Policy
      • removeOldVersionOfContainers

        void removeOldVersionOfContainers()
                                   throws StandardException
        Removes old versions of the containers after a cryptographic operation on the database.
        Throws:
        StandardException
      • setDatabaseEncrypted

        void setDatabaseEncrypted(boolean isEncrypted)
        Sets whether the database is encrypted.
        Parameters:
        isEncrypted - true if the database is encrypted, false otherwise
      • getEncryptionBlockSize

        int getEncryptionBlockSize()
        Return the encryption block size used by the algorithm at time of encrypted database creation
      • freezePersistentStore

        void freezePersistentStore()
                            throws StandardException
        Backup restore - stop writing dirty pages or container to disk
        Throws:
        StandardException - Standard Derby error policy
      • unfreezePersistentStore

        void unfreezePersistentStore()
        Backup restore - start writing dirty pages or container to disk
      • writeInProgress

        void writeInProgress()
                      throws StandardException
        Backup restore - don't allow the persistent store to be frozen - or if it is already frozen, block. A write is about to commence.
        Throws:
        StandardException - Standard Derby error policy
      • writeFinished

        void writeFinished()
        Backup restore - write finished, if this is the last writer, allow the persistent store to proceed.
      • getMaxContainerId

        long getMaxContainerId()
                        throws StandardException
        Return an id which can be used to create a container.

        Return an id number with is greater than any existing container in the current database. Caller will use this to allocate future container numbers - most likely caching the value and then incrementing it as it is used.

        Returns:
        The an id which can be used to create a container.
        Throws:
        StandardException - Standard exception policy.
      • removeDroppedContainerFileStubs

        void removeDroppedContainerFileStubs(LogInstant redoLWM)
                                      throws StandardException
        This function is called after a checkpoint to remove the stub files thar are not required during recovery. Crash recovery uses these files to identify the dropped containers. Stub files(d*.dat) gets creates when a table/index(containers) dropped.
        Throws:
        StandardException - Standard Derby error policy
      • getStorageFactory

        StorageFactory getStorageFactory()
        Returns:
        The StorageFactory used by this dataFactory
      • stop

        void stop()
      • databaseEncrypted

        boolean databaseEncrypted()
        Returns if data base is in encrypted mode.
        Returns:
        true if database encrypted false otherwise

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.