Source Code Cross Referenced for GenericController.java in  » Database-DBMS » db-derby-10.2 » org » apache » derby » impl » store » access » conglomerate » 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.access.conglomerate 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:
003:           Derby - Class org.apache.derby.impl.store.access.conglomerate.GenericController
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.access.conglomerate;
023:
024:        import org.apache.derby.iapi.reference.SQLState;
025:
026:        import org.apache.derby.iapi.services.sanity.SanityManager;
027:
028:        import org.apache.derby.iapi.error.StandardException;
029:
030:        import org.apache.derby.iapi.store.access.conglomerate.Conglomerate;
031:        import org.apache.derby.iapi.store.access.conglomerate.LogicalUndo;
032:        import org.apache.derby.iapi.store.access.conglomerate.TransactionManager;
033:
034:        import org.apache.derby.iapi.store.access.ConglomerateController;
035:        import org.apache.derby.iapi.store.access.DynamicCompiledOpenConglomInfo;
036:        import org.apache.derby.iapi.store.access.RowUtil;
037:        import org.apache.derby.iapi.store.access.SpaceInfo;
038:
039:        import org.apache.derby.iapi.store.raw.ContainerHandle;
040:        import org.apache.derby.iapi.store.raw.Page;
041:        import org.apache.derby.iapi.store.raw.RecordHandle;
042:        import org.apache.derby.iapi.store.raw.Transaction;
043:
044:        import org.apache.derby.iapi.types.RowLocation;
045:
046:        import org.apache.derby.iapi.services.io.FormatableBitSet;
047:
048:        import java.util.Properties;
049:
050:        /**
051:         **/
052:
053:        abstract class GenericController {
054:            /**************************************************************************
055:             * Fields of the class
056:             **************************************************************************
057:             */
058:            protected OpenConglomerate open_conglom;
059:
060:            /**************************************************************************
061:             * Constructors for This class:
062:             **************************************************************************
063:             */
064:
065:            /**************************************************************************
066:             * Private/Protected methods of This class:
067:             **************************************************************************
068:             */
069:            protected void getRowPositionFromRowLocation(RowLocation row_loc,
070:                    RowPosition pos) throws StandardException {
071:                // Not implemented in default conglomerate, needs to be overridden.
072:                throw StandardException
073:                        .newException(SQLState.HEAP_UNIMPLEMENTED_FEATURE);
074:
075:            }
076:
077:            protected void queueDeletePostCommitWork(RowPosition pos)
078:                    throws StandardException {
079:                // Not implemented in default conglomerate, needs to be overridden.
080:                throw StandardException
081:                        .newException(SQLState.HEAP_UNIMPLEMENTED_FEATURE);
082:            }
083:
084:            /**************************************************************************
085:             * Public Methods of This class:
086:             **************************************************************************
087:             */
088:            public void init(OpenConglomerate open_conglom)
089:                    throws StandardException {
090:                if (SanityManager.DEBUG)
091:                    SanityManager.ASSERT(open_conglom != null);
092:
093:                this .open_conglom = open_conglom;
094:            }
095:
096:            public OpenConglomerate getOpenConglom() {
097:                return (open_conglom);
098:            }
099:
100:            /**************************************************************************
101:             * Public Methods implementing ConglomerateController which just 
102:             *     delegate to OpenConglomerate:
103:             **************************************************************************
104:             */
105:
106:            public void checkConsistency() throws StandardException {
107:                open_conglom.checkConsistency();
108:            }
109:
110:            public void debugConglomerate() throws StandardException {
111:                open_conglom.debugConglomerate();
112:            }
113:
114:            public void getTableProperties(Properties prop)
115:                    throws StandardException {
116:                open_conglom.getTableProperties(prop);
117:            }
118:
119:            public Properties getInternalTablePropertySet(Properties prop)
120:                    throws StandardException {
121:                return (open_conglom.getInternalTablePropertySet(prop));
122:            }
123:
124:            public SpaceInfo getSpaceInfo() throws StandardException {
125:                return (open_conglom.getSpaceInfo());
126:            }
127:
128:            public void close() throws StandardException {
129:                if (open_conglom != null)
130:                    open_conglom.close();
131:            }
132:
133:            public boolean isKeyed() {
134:                return (open_conglom.isKeyed());
135:            }
136:
137:            public RowLocation newRowLocationTemplate()
138:                    throws StandardException {
139:                if (open_conglom.isClosed())
140:                    open_conglom.reopen();
141:
142:                return (open_conglom.newRowLocationTemplate());
143:            }
144:
145:            /**
146:             * is the open btree table locked?
147:             **/
148:            public boolean isTableLocked() {
149:                return (open_conglom.isTableLocked());
150:            }
151:
152:            /**
153:             * Get the total estimated number of rows in the container.
154:             * <p>
155:             * The number is a rough estimate and may be grossly off.  In general
156:             * the server will cache the row count and then occasionally write
157:             * the count unlogged to a backing store.  If the system happens to 
158:             * shutdown before the store gets a chance to update the row count it
159:             * may wander from reality.
160:             * <p>
161:             * This call is currently only supported on Heap conglomerates, it
162:             * will throw an exception if called on btree conglomerates.
163:             *
164:             * @return The total estimated number of rows in the conglomerate.
165:             *
166:             * @exception  StandardException  Standard exception policy.
167:             **/
168:            public long getEstimatedRowCount() throws StandardException {
169:                if (open_conglom.isClosed())
170:                    open_conglom.reopen();
171:
172:                // Don't return 0 rows (return 1 instead), as this often leads the 
173:                // optimizer to produce plans which don't use indexes because of the 0 
174:                // row edge case.
175:                //
176:                // Eventually the plan is recompiled when rows are added, but we
177:                // have seen multiple customer cases of deadlocks and timeouts 
178:                // because of these 0 row based plans.  
179:                long row_count = open_conglom.getContainer()
180:                        .getEstimatedRowCount(0);
181:
182:                return ((row_count == 0) ? 1 : row_count);
183:            }
184:
185:            /**
186:             * Set the total estimated number of rows in the container.
187:             * <p>
188:             * Often, after a scan, the client of RawStore has a much better estimate
189:             * of the number of rows in the container than what store has.  For 
190:             * instance if we implement some sort of update statistics command, or
191:             * just after a create index a complete scan will have been done of the
192:             * table.  In this case this interface allows the client to set the
193:             * estimated row count for the container, and store will use that number
194:             * for all future references.
195:             * <p>
196:             * This call is currently only supported on Heap conglomerates, it
197:             * will throw an exception if called on btree conglomerates.
198:             *
199:             * @param count the estimated number of rows in the container.
200:             *
201:             * @exception  StandardException  Standard exception policy.
202:             **/
203:            public void setEstimatedRowCount(long count)
204:                    throws StandardException {
205:                ContainerHandle container = open_conglom.getContainer();
206:
207:                if (container == null)
208:                    open_conglom.reopen();
209:
210:                open_conglom.getContainer().setEstimatedRowCount(count, /* unused flag */
211:                        0);
212:            }
213:
214:            /**************************************************************************
215:             * Public Methods implementing ConglomerateController:
216:             **************************************************************************
217:             */
218:
219:        }
w___ww._j__av__a_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.