📄 ramtransaction.java
字号:
format_id, global_id, branch_id); return this; } /** Bulk load into the conglomerate. Rows being loaded into the conglomerate are not logged. @param conglomId The conglomerate Id. @param createConglom If true, the conglomerate is being created in the same operation as the loadConglomerate. The enables further optimization as recovery does not require page allocation to be logged. @param rowSource Where the rows come from. @return true The number of rows loaded. @exception StandardException Standard Cloudscape Error Policy */ public long loadConglomerate( long conglomId, boolean createConglom, RowLocationRetRowSource rowSource) throws StandardException { // Find the conglomerate. Conglomerate conglom = findExistingConglomerate(conglomId); // Load up the conglomerate with rows from the rowSource. // Don't need to keep track of the conglomerate controller because load // automatically closes it when it finished. return(conglom.load(this, createConglom, rowSource)); } /** Use this for incremental load in the future. @param conglomId the conglomerate Id @param rowSource where the rows to be loaded comes from @exception StandardException Standard Cloudscape Error Policy */ public void loadConglomerate( long conglomId, RowLocationRetRowSource rowSource) throws StandardException { loadConglomerate( conglomId, false, // conglomerate is not being created rowSource); } /** * Log an operation and then action it in the context of this transaction. * <p> * This simply passes the operation to the RawStore which logs and does it. * <p> * * @param operation the operation that is to be applied * * @exception StandardException Standard exception policy. **/ public void logAndDo(Loggable operation) throws StandardException { rawtran.logAndDo(operation); } public ConglomerateController openCompiledConglomerate( boolean hold, int open_mode, int lock_level, int isolation_level, StaticCompiledOpenConglomInfo static_info, DynamicCompiledOpenConglomInfo dynamic_info) throws StandardException { if (SanityManager.DEBUG) { SanityManager.ASSERT(static_info != null); SanityManager.ASSERT(dynamic_info != null); } // in the current implementation, only Conglomerate's are passed around // as StaticCompiledOpenConglomInfo. return( openConglomerate( (Conglomerate) static_info.getConglom(), hold, open_mode, lock_level, isolation_level, static_info, dynamic_info)); } public ConglomerateController openConglomerate( long conglomId, boolean hold, int open_mode, int lock_level, int isolation_level) throws StandardException { return( openConglomerate( findExistingConglomerate(conglomId), hold, open_mode, lock_level, isolation_level, (StaticCompiledOpenConglomInfo) null, (DynamicCompiledOpenConglomInfo) null)); } public long findConglomid(long container_id) throws StandardException { return(container_id); } public long findContainerid(long conglom_id) throws StandardException { return(conglom_id); } /** * Create a BackingStoreHashtable which contains all rows that qualify for * the described scan. **/ public BackingStoreHashtable createBackingStoreHashtableFromScan( long conglomId, int open_mode, int lock_level, int isolation_level, FormatableBitSet scanColumnList, DataValueDescriptor[] startKeyValue, int startSearchOperator, Qualifier qualifier[][], DataValueDescriptor[] stopKeyValue, int stopSearchOperator, long max_rowcnt, int[] key_column_numbers, boolean remove_duplicates, long estimated_rowcnt, long max_inmemory_rowcnt, int initialCapacity, float loadFactor, boolean collect_runtimestats, boolean skipNullKeyColumns) throws StandardException { return ( new BackingStoreHashTableFromScan( this, conglomId, open_mode, lock_level, isolation_level, scanColumnList, startKeyValue, startSearchOperator, qualifier, stopKeyValue, stopSearchOperator, max_rowcnt, key_column_numbers, remove_duplicates, estimated_rowcnt, max_inmemory_rowcnt, initialCapacity, loadFactor, collect_runtimestats, skipNullKeyColumns)); } public GroupFetchScanController openGroupFetchScan( long conglomId, boolean hold, int open_mode, int lock_level, int isolation_level, FormatableBitSet scanColumnList, DataValueDescriptor[] startKeyValue, int startSearchOperator, Qualifier qualifier[][], DataValueDescriptor[] stopKeyValue, int stopSearchOperator) throws StandardException { if (SanityManager.DEBUG) { if ((open_mode & ~(TransactionController.OPENMODE_FORUPDATE | TransactionController.OPENMODE_FOR_LOCK_ONLY | TransactionController.OPENMODE_SECONDARY_LOCKED)) != 0) SanityManager.THROWASSERT( "Bad open mode to openScan:" + Integer.toHexString(open_mode)); if (!(lock_level == MODE_RECORD | lock_level == MODE_TABLE)) SanityManager.THROWASSERT( "Bad lock level to openScan:" + lock_level); } // Find the conglomerate. Conglomerate conglom = findExistingConglomerate(conglomId); // Get a scan controller. ScanManager sm = conglom.openScan( this, rawtran, hold, open_mode, determine_lock_level(lock_level), determine_locking_policy(lock_level, isolation_level), isolation_level, scanColumnList, startKeyValue, startSearchOperator, qualifier, stopKeyValue, stopSearchOperator, (StaticCompiledOpenConglomInfo) null, (DynamicCompiledOpenConglomInfo) null); // Keep track of it so we can release on close. scanControllers.addElement(sm); return(sm); } /** * Purge all committed deleted rows from the conglomerate. * <p> * This call will purge committed deleted rows from the conglomerate, * that space will be available for future inserts into the conglomerate. * <p> * * @param conglomId Id of the conglomerate to purge. * * @exception StandardException Standard exception policy. **/ public void purgeConglomerate( long conglomId) throws StandardException { findExistingConglomerate(conglomId).purgeConglomerate( this, rawtran); return; } /** * Return free space from the conglomerate back to the OS. * <p> * Returns free space from the conglomerate back to the OS. Currently * only the sequential free pages at the "end" of the conglomerate can * be returned to the OS. * <p> * * @param conglomId Id of the conglomerate to purge. * * @exception StandardException Standard exception policy. **/ public void compressConglomerate( long conglomId) throws StandardException { findExistingConglomerate(conglomId).compressConglomerate( this, rawtran); return; } /** * Compress table in place. * <p> * Returns a GroupFetchScanController which can be used to move rows * around in a table, creating a block of free pages at the end of the * table. The process will move rows from the end of the table toward * the beginning. The GroupFetchScanController will return the * old row location, the new row location, and the actual data of any * row moved. Note that this scan only returns moved rows, not an * entire set of rows, the scan is designed specifically to be * used by either explicit user call of the SYSCS_ONLINE_COMPRESS_TABLE() * procedure, or internal background calls to compress the table. * * The old and new row locations are returned so that the caller can * update any indexes necessary. * * This scan always returns all collumns of the row. * * All inputs work exactly as in openScan(). The return is * a GroupFetchScanController, which only allows fetches of groups * of rows from the conglomerate. * <p> * * @return The GroupFetchScanController to be used to fetch the rows. * * @param conglomId see openScan() * @param hold see openScan() * @param open_mode see openScan() * @param lock_level see openScan() * @param isolation_level see openScan() * * @exception StandardException Standard exception policy. * * @see ScanController * @see GroupFetchScanController **/ public GroupFetchScanController defragmentConglomerate( long conglomId, boolean online, boolean hold, int open_mode, int lock_level, int isolation_level) throws StandardException { if (SanityManager.DEBUG) { if ((open_mode & ~(TransactionController.OPENMODE_FORUPDATE | TransactionController.OPENMODE_FOR_LOCK_ONLY | TransactionController.OPENMODE_SECONDARY_LOCKED)) != 0) SanityManager.THROWASSERT( "Bad open mode to openScan:" + Integer.toHexString(open_mode)); if (!(lock_level == MODE_RECORD | lock_level == MODE_TABLE)) SanityManager.THROWASSERT( "Bad lock level to openScan:" + lock_level); } // Find the conglomerate. Conglomerate conglom = findExistingConglomerate(conglomId); // Get a scan controller. ScanManager sm = conglom.defragmentConglomerate( this, rawtran, hold, open_mode, determine_lock_level(lock_level), determine_locking_policy(lock_level, isolation_level), isolation_level); // Keep track of it so we can release on close. scanControllers.addElement(sm); return(sm); } public ScanController openScan( long conglomId, boolean hold, int open_mode, int lock_level, int isolation_level, FormatableBitSet scanColumnList, DataValueDescriptor[] startKeyValue, int startSearchOperator, Qualifier qualifier[][], DataValueDescriptor[] stopKeyValue, int stopSearchOperator) throws StandardException { return( openScan( findExistingConglomerate(conglomId), hold, open_mode, lock_level, isolation_level, scanColumnList, startKeyValue, startSearchOperator, qualifier, stopKeyValue, stopSearchOperator, (StaticCompiledOpenConglomInfo) null, (DynamicCompiledOpenConglomInfo) null)); } public ScanController openCompiledScan( boolean hold, int open_mode, int lock_level, int isolation_level, FormatableBitSet scanColumnList, DataValueDescriptor[] startKeyValue, int startSearchOperator, Qualifier qualifier[][], DataValueDescriptor[] stopKeyValue, int stopSearchOperator, StaticCompiledOpenConglomInfo static_info, DynamicCompiledOpenConglomInfo dynamic_info) throws StandardException
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -