⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 openconglomerate.java

📁 derby database source code.good for you.
💻 JAVA
📖 第 1 页 / 共 3 页
字号:
        getTableProperties(ret_properties);        return(ret_properties);    }    /**     * Request the system properties associated with a table.      * <p>     * Request the value of properties that are associated with a table.  The     * following properties can be requested:     *     derby.storage.pageSize      *     derby.storage.pageReservedSpace     *     derby.storage.minimumRecordSize     *     derby.storage.initialPages     * <p>     * To get the value of a particular property add it to the property list,     * and on return the value of the property will be set to it's current      * value.  For example:     *     * get_prop(ConglomerateController cc)     * {     *     Properties prop = new Properties();     *     prop.put("derby.storage.pageSize", "");     *     cc.getTableProperties(prop);     *     *     System.out.println(     *         "table's page size = " +      *         prop.getProperty("derby.storage.pageSize");     * }     *     * @param prop   Property list to fill in.     *	 * @exception  StandardException  Standard exception policy.     **/    public void getTableProperties(Properties prop)		throws StandardException    {        container.getContainerProperties(prop);        return;    }    /**************************************************************************     * Public Accessors of This class:     **************************************************************************     */    public final TransactionManager getXactMgr()    {        return(init_xact_manager);    }    public final Transaction getRawTran()    {        return(init_rawtran);    }    public final ContainerHandle getContainer()    {        return(container);    }    public final int getOpenMode()    {        return(init_openmode);    }        public final Conglomerate getConglomerate()    {        return(init_conglomerate);    }    public final boolean getHold()    {        return(init_hold);    }    public final boolean isForUpdate()    {        return(forUpdate);    }    public final boolean isClosed()    {        return(container == null);    }    public final boolean isUseUpdateLocks()    {        return(useUpdateLocks);    }    public final OpenConglomerateScratchSpace getRuntimeMem()    {        return(runtime_mem);    }    /**************************************************************************     * Public Methods implementing some ConglomerateController Interfaces:      **************************************************************************     */    /**     * Check consistency of a conglomerate.     * <p>     * Checks the consistency of the data within a given conglomerate, does not     * check consistency external to the conglomerate (ie. does not check that      * base table row pointed at by a secondary index actually exists).     * <p>     * There is no checking in the default implementation, you must override     * to get conglomerate specific consistency checking.     *	 * @exception  StandardException  Standard exception policy.     **/    public void checkConsistency()		throws StandardException    {        return;    }    public void debugConglomerate()		throws StandardException    {        if (SanityManager.DEBUG)        {            SanityManager.DEBUG_PRINT(                "p_heap", "\nHEAP DUMP:containerId " + container.getId());            // get a template.            DataValueDescriptor[] row = runtime_mem.get_row_for_export();            // Print pages of the heap.            Page page = container.getFirstPage();            while (page != null)            {                SanityManager.DEBUG_PRINT(                    "p_heap", ConglomerateUtil.debugPage(page, 0, false, row));                long pageid = page.getPageNumber();                page.unlatch();                page = container.getNextPage(pageid);            }        }        return;    }    /**    Get information about space used by the conglomerate.    **/    public SpaceInfo getSpaceInfo()        throws StandardException    {        return container.getSpaceInfo();    }	protected boolean isKeyed()	{		return false;	}    /**     * is the open btree table locked?     **/    protected boolean isTableLocked()    {        return(init_lock_level == TransactionController.MODE_TABLE);    }    /**************************************************************************     * Public Methods of this class:     **************************************************************************     */    /**     * Open the container.     * <p>     * Open the container, obtaining necessary locks.  Most work is actually     * done by RawStore.openContainer().       *	 * @exception  StandardException  Standard exception policy.     **/    public ContainerHandle init(    ContainerHandle                 open_container,    Conglomerate                    conglomerate,    int[]                           format_ids,    TransactionManager              xact_manager,    Transaction                     rawtran,    boolean                         hold,    int                             openmode,    int                             lock_level,    LockingPolicy                   locking_policy,    DynamicCompiledOpenConglomInfo  dynamic_info)        throws StandardException    {        // save state of all inputs.        init_conglomerate       = conglomerate;        init_xact_manager       = xact_manager;        init_rawtran            = rawtran;        init_openmode           = openmode;        init_lock_level         = lock_level;        init_dynamic_info       = dynamic_info;        init_hold               = hold;        init_locking_policy     = locking_policy;        // either use passed in "compiled" runtime scratch space, or create        // new space.        this.runtime_mem    =             (dynamic_info != null ?              ((OpenConglomerateScratchSpace) dynamic_info) :              new OpenConglomerateScratchSpace(format_ids));        // Is this an open for update or read?  This will		// be passed down to the raw store fetch methods, which allows		// it to do the appropriate locking.		this.forUpdate =             ((openmode & ContainerHandle.MODE_FORUPDATE) != 0);         // keep track of whether this open conglomerate should use update locks.		this.useUpdateLocks =             ((openmode & ContainerHandle.MODE_USE_UPDATE_LOCKS) != 0);        // If this flag is set, then the client has already locked the row        // by accessing it through the secondary index and has already locked        // the row, so the base conglomerate need not re-lock the row.        this.getBaseTableLocks =            ((openmode & ContainerHandle.MODE_SECONDARY_LOCKED) == 0);		// if the conglomerate is temporary, open with IS_KEPT set.		// RESOLVE(mikem): track 1825		// don't want to open temp cantainer with IS_KEPT always.        if (conglomerate.isTemporary())        {			init_openmode |= ContainerHandle.MODE_TEMP_IS_KEPT;        }        if (!getBaseTableLocks)            init_locking_policy = null;		// Open the container.         this.container =             (open_container != null ?                   open_container :                  rawtran.openContainer(                    conglomerate.getId(), init_locking_policy, init_openmode));        return(this.container);    }    /**     * Open the container.     * <p>     * Open the container, obtaining necessary locks.  Most work is actually     * done by RawStore.openContainer().  Will only reopen() if the container     * is not already open.     *	 * @exception  StandardException  Standard exception policy.     **/    public ContainerHandle reopen()        throws StandardException    {        // reget transaction from context manager, in the case of XA        // transaction this may have changed.        //        /* TODO - XA transactions my change the current transaction on the          * context stack.  Will want to something like:         *         * init_rawtran = context_manager.getcurrenttransaction()         */             if (this.container == null)        {            this.container =                  init_rawtran.openContainer(                    init_conglomerate.getId(),                     init_locking_policy,                     init_openmode);        }        return(this.container);    }    /**     * Close the container.     * <p>     * Handles being closed more than once.     *	 * @exception  StandardException  Standard exception policy.     **/    public void close()        throws StandardException	{		if (container != null)        {			container.close();            container = null;        }	}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -