Source Code Cross Referenced for LoggableAllocActions.java in  » Database-DBMS » db-derby-10.2 » org » apache » derby » impl » store » raw » data » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database DBMS » db derby 10.2 » org.apache.derby.impl.store.raw.data 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:
003:           Derby - Class org.apache.derby.impl.store.raw.data.LoggableAllocActions
004:
005:           Licensed to the Apache Software Foundation (ASF) under one or more
006:           contributor license agreements.  See the NOTICE file distributed with
007:           this work for additional information regarding copyright ownership.
008:           The ASF licenses this file to you under the Apache License, Version 2.0
009:           (the "License"); you may not use this file except in compliance with
010:           the License.  You may obtain a copy of the License at
011:
012:              http://www.apache.org/licenses/LICENSE-2.0
013:
014:           Unless required by applicable law or agreed to in writing, software
015:           distributed under the License is distributed on an "AS IS" BASIS,
016:           WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017:           See the License for the specific language governing permissions and
018:           limitations under the License.
019:
020:         */
021:
022:        package org.apache.derby.impl.store.raw.data;
023:
024:        import org.apache.derby.impl.store.raw.data.AllocationActions;
025:        import org.apache.derby.impl.store.raw.data.BasePage;
026:
027:        import org.apache.derby.iapi.services.sanity.SanityManager;
028:        import org.apache.derby.iapi.services.io.FormatIdUtil;
029:
030:        import org.apache.derby.iapi.store.raw.Loggable;
031:        import org.apache.derby.iapi.store.raw.xact.RawTransaction;
032:        import org.apache.derby.iapi.store.raw.log.LogInstant;
033:
034:        import org.apache.derby.iapi.error.StandardException;
035:
036:        public class LoggableAllocActions implements  AllocationActions {
037:
038:            /**
039:            	Set the allocation status of pageNumber to doStatus.  To undo this
040:            	operation, set the allocation status of pageNumber to undoStatus
041:            	
042:            	@param t				The transaction
043:            	@param allocPage		the allocation page
044:            	@param pageNumber		the page to allocation or deallocation
045:            	@param doStatus			set the allocation status of the page this value
046:            	@param undoStatus		on undo, set the allocation status of the page
047:            							this value 
048:
049:            	@exception StandardException	Standard Cloudscape error policy
050:             */
051:            public void actionAllocatePage(RawTransaction t,
052:                    BasePage allocPage, long pageNumber, int doStatus,
053:                    int undoStatus) throws StandardException {
054:                Loggable lop = new AllocPageOperation((AllocPage) allocPage,
055:                        pageNumber, doStatus, undoStatus);
056:
057:                // mark the page as pre-dirtied so that if a checkpoint happens after
058:                // the log record is sent to the log stream, the cache cleaning will
059:                // wait for this change.
060:                allocPage.preDirty();
061:
062:                t.logAndDo(lop);
063:            }
064:
065:            /**
066:            	Chain one allocation page to the next.
067:
068:            	@param t				The transaction
069:            	@param allocPage		the allocation page whose next page chain needs
070:            							to be changed
071:            	@param pageNumber		the next allocation page's number 
072:            	@param pageOffset		the next allocation page's page offset
073:
074:            	@exception StandardException	Standard Cloudscape error policy
075:             */
076:            public void actionChainAllocPage(RawTransaction t,
077:                    BasePage allocPage, long pageNumber, long pageOffset)
078:                    throws StandardException {
079:                Loggable lop = new ChainAllocPageOperation(
080:                        (AllocPage) allocPage, pageNumber, pageOffset);
081:
082:                // mark the page as pre-dirtied so that if a checkpoint happens after
083:                // the log record is sent to the log stream, the cache cleaning will
084:                // wait for this change.
085:                allocPage.preDirty();
086:
087:                t.logAndDo(lop);
088:            }
089:
090:            /**
091:             * Compress free pages.
092:             * <p>
093:             * Compress the free pages at the end of the range maintained by
094:             * this allocation page.  All pages being compressed should be FREE.
095:             * Only pages in the last allocation page can be compressed.
096:             * <p>
097:             *
098:             * @param t				        The transaction
099:             * @param allocPage		        the allocation page to do compress on.
100:             * @param new_highest_page      The new highest page on this allocation 
101:             *                              page.  The number is the offset of the page
102:             *                              in the array of pages maintained by this 
103:             *                              allocation page, for instance a value of 0 
104:             *                              indicates all page except the first one are
105:             *                              to be truncated.  If all pages are 
106:             *                              truncated then the offset is set to -1.
107:             * @param num_pages_truncated   The number of allocated pages in this 
108:             *                              allocation page prior to the truncate.  
109:             *                              Note that all pages from NewHighestPage+1 
110:             *                              through newHighestPage+num_pages_truncated 
111:             *                              should be FREE.
112:             *
113:             * @exception  StandardException  Standard exception policy.
114:             **/
115:            public void actionCompressSpaceOperation(RawTransaction t,
116:                    BasePage allocPage, int new_highest_page,
117:                    int num_pages_truncated) throws StandardException {
118:                Loggable lop = new CompressSpacePageOperation(
119:                        (AllocPage) allocPage, new_highest_page,
120:                        num_pages_truncated);
121:                allocPage.preDirty();
122:
123:                t.logAndDo(lop);
124:            }
125:        }
w_w___w__._j___a__va___2___s.__c___o__m_ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.