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


001:        /*
002:
003:           Derby - Class org.apache.derby.impl.sql.execute.rts.RealSetOpResultSetStatistics
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.sql.execute.rts;
023:
024:        import org.apache.derby.iapi.services.i18n.MessageService;
025:        import org.apache.derby.iapi.reference.SQLState;
026:
027:        import org.apache.derby.impl.sql.compile.IntersectOrExceptNode;
028:
029:        /**
030:         ResultSetStatistics implementation for SetOpResultSet.
031:
032:         @author yip
033:
034:         */
035:        public class RealSetOpResultSetStatistics extends
036:                RealNoPutResultSetStatistics {
037:
038:            /* Leave these fields public for object inspectors */
039:            public int opType;
040:            public int rowsSeenLeft;
041:            public int rowsSeenRight;
042:            public int rowsReturned;
043:            public ResultSetStatistics leftResultSetStatistics;
044:            public ResultSetStatistics rightResultSetStatistics;
045:
046:            // CONSTRUCTORS
047:
048:            /**
049:             *  Constructs a new <code>RealSetOpResultSetStatistics</code> object 
050:             *  to represent the runtime statistics for <code>SetOpResultSet</code>.  
051:             * 
052:             *  @param   opType                       set operation type 
053:             *  @param   numOpens                     number of open
054:             *  @param   rowsSeen                     rows seen
055:             *  @param   rowsFiltered                 rows filtered
056:             *  @param   constructorTime              the time for construction
057:             *  @param   openTime                     the time for open operation
058:             *  @param   nextTime                     the time for next operation
059:             *  @param   closeTime                    the time for close operation
060:             *  @param   resultSetNumber              the result set number
061:             *  @param   rowsSeenLeft                 rows seen by left source input
062:             *  @param   rowsSeenRight                rows seen by right source input
063:             *  @param   rowsReturned                 rows returned
064:             *  @param   optimizerEstimatedRowCount   optimizer estimated row count
065:             *  @param   optimizerEstimatedCost       optimizer estimated cost
066:             *  @param   leftResultSetStatistics      left source runtime statistics
067:             *  @param   rightResultSetStatistics     right source runtime statistics
068:             *  
069:             *  @see     org.apache.derby.impl.sql.execute.SetOpResultSet  
070:             */
071:            public RealSetOpResultSetStatistics(int opType, int numOpens,
072:                    int rowsSeen, int rowsFiltered, long constructorTime,
073:                    long openTime, long nextTime, long closeTime,
074:                    int resultSetNumber, int rowsSeenLeft, int rowsSeenRight,
075:                    int rowsReturned, double optimizerEstimatedRowCount,
076:                    double optimizerEstimatedCost,
077:                    ResultSetStatistics leftResultSetStatistics,
078:                    ResultSetStatistics rightResultSetStatistics) {
079:                super (numOpens, rowsSeen, rowsFiltered, constructorTime,
080:                        openTime, nextTime, closeTime, resultSetNumber,
081:                        optimizerEstimatedRowCount, optimizerEstimatedCost);
082:
083:                this .opType = opType;
084:                this .rowsSeenLeft = rowsSeenLeft;
085:                this .rowsSeenRight = rowsSeenRight;
086:                this .rowsReturned = rowsReturned;
087:                this .leftResultSetStatistics = leftResultSetStatistics;
088:                this .rightResultSetStatistics = rightResultSetStatistics;
089:            }
090:
091:            // ResultSetStatistics methods
092:
093:            /**
094:             * Return the statement execution plan as a <code>String</code>.
095:             *
096:             * @param depth	Indentation level.
097:             *
098:             * @return the statement execution plan as a <code>String</code>.
099:             */
100:            public String getStatementExecutionPlanText(int depth) {
101:                initFormatInfo(depth);
102:
103:                String rs = (opType == IntersectOrExceptNode.INTERSECT_OP) ? (SQLState.RTS_INTERSECT_RS)
104:                        : (SQLState.RTS_EXCEPT_RS);
105:
106:                return indent
107:                        + MessageService.getTextMessage(rs)
108:                        + ":\n"
109:                        + indent
110:                        + MessageService.getTextMessage(SQLState.RTS_NUM_OPENS)
111:                        + " = "
112:                        + numOpens
113:                        + "\n"
114:                        + indent
115:                        + MessageService
116:                                .getTextMessage(SQLState.RTS_ROWS_SEEN_LEFT)
117:                        + " = "
118:                        + rowsSeenLeft
119:                        + "\n"
120:                        + indent
121:                        + MessageService
122:                                .getTextMessage(SQLState.RTS_ROWS_SEEN_RIGHT)
123:                        + " = "
124:                        + rowsSeenRight
125:                        + "\n"
126:                        + indent
127:                        + MessageService
128:                                .getTextMessage(SQLState.RTS_ROWS_RETURNED)
129:                        + " = "
130:                        + rowsReturned
131:                        + "\n"
132:                        + dumpTimeStats(indent, subIndent)
133:                        + "\n"
134:                        + dumpEstimatedCosts(subIndent)
135:                        + "\n"
136:                        + indent
137:                        + MessageService.getTextMessage(SQLState.RTS_LEFT_RS)
138:                        + ":\n"
139:                        + leftResultSetStatistics
140:                                .getStatementExecutionPlanText(sourceDepth)
141:                        + "\n"
142:                        + indent
143:                        + MessageService.getTextMessage(SQLState.RTS_RIGHT_RS)
144:                        + ":\n"
145:                        + rightResultSetStatistics
146:                                .getStatementExecutionPlanText(sourceDepth)
147:                        + "\n";
148:            }
149:
150:            /**
151:             * Return information on the scan nodes from the statement execution 
152:             * plan as a <code>String</code>.
153:             *
154:             * @param depth	Indentation level.
155:             * @param tableName if not NULL then print information for this table only
156:             *
157:             * @return String	The information on the scan nodes from the 
158:             *					statement execution plan as a <code>String</code>.
159:             */
160:            public String getScanStatisticsText(String tableName, int depth) {
161:                return leftResultSetStatistics.getScanStatisticsText(tableName,
162:                        depth)
163:                        + rightResultSetStatistics.getScanStatisticsText(
164:                                tableName, depth);
165:            }
166:
167:            // Class implementation
168:
169:            /**
170:             * Return the runtime statistics of this object in textual representation
171:             *
172:             * @return the runtime statistics of this object in textual representation 
173:             *         as a <code>String</code>.
174:             */
175:            public String toString() {
176:                return getStatementExecutionPlanText(0);
177:            }
178:
179:            /**
180:             * Retrieves the children runtime statistics of this <code>
181:             * RealSetOpResultSetStatistics</code> object 
182:             *
183:             * @return the children runtime statistics of this <code>
184:             *         RealSetOpResultSetStatistics</code> object stored in a <code>
185:             *         Vector</code>. 
186:             *         
187:             */
188:            public java.util.Vector getChildren() {
189:                java.util.Vector children = new java.util.Vector();
190:                children.addElement(leftResultSetStatistics);
191:                children.addElement(rightResultSetStatistics);
192:                return children;
193:            }
194:
195:            /**
196:             * Format for display, a name for this node.
197:             *
198:             * @return the name of the node as a <code>String</code>.
199:             */
200:            public String getNodeName() {
201:                String nodeName = (opType == IntersectOrExceptNode.INTERSECT_OP) ? (SQLState.RTS_INTERSECT)
202:                        : (SQLState.RTS_EXCEPT);
203:
204:                return MessageService.getTextMessage(nodeName);
205:            }
206:        }
w_ww__._j__a_v___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.