Source Code Cross Referenced for RealSortStatistics.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.RealSortStatistics
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.io.StoredFormatIds;
025:
026:        import org.apache.derby.iapi.services.i18n.MessageService;
027:        import org.apache.derby.iapi.reference.SQLState;
028:
029:        import org.apache.derby.iapi.services.io.FormatableHashtable;
030:        import org.apache.derby.iapi.services.io.FormatableProperties;
031:        import org.apache.derby.iapi.util.PropertyUtil;
032:
033:        import java.io.ObjectOutput;
034:        import java.io.ObjectInput;
035:        import java.io.IOException;
036:
037:        import java.util.Enumeration;
038:        import java.util.Properties;
039:
040:        /**
041:         ResultSetStatistics implemenation for SortResultSet.
042:
043:         @author jerry
044:
045:         */
046:        public class RealSortStatistics extends RealNoPutResultSetStatistics {
047:
048:            /* Leave these fields public for object inspectors */
049:            public int rowsInput;
050:            public int rowsReturned;
051:            public boolean eliminateDuplicates;
052:            public boolean inSortedOrder;
053:            public ResultSetStatistics childResultSetStatistics;
054:            public FormatableProperties sortProperties;
055:
056:            // CONSTRUCTORS
057:
058:            /**
059:             * 
060:             *
061:             */
062:            public RealSortStatistics(int numOpens, int rowsSeen,
063:                    int rowsFiltered, long constructorTime, long openTime,
064:                    long nextTime, long closeTime, int resultSetNumber,
065:                    int rowsInput, int rowsReturned,
066:                    boolean eliminateDuplicates, boolean inSortedOrder,
067:                    Properties sortProperties,
068:                    double optimizerEstimatedRowCount,
069:                    double optimizerEstimatedCost,
070:                    ResultSetStatistics childResultSetStatistics) {
071:                super (numOpens, rowsSeen, rowsFiltered, constructorTime,
072:                        openTime, nextTime, closeTime, resultSetNumber,
073:                        optimizerEstimatedRowCount, optimizerEstimatedCost);
074:                this .rowsInput = rowsInput;
075:                this .rowsReturned = rowsReturned;
076:                this .eliminateDuplicates = eliminateDuplicates;
077:                this .inSortedOrder = inSortedOrder;
078:                this .childResultSetStatistics = childResultSetStatistics;
079:                this .sortProperties = new FormatableProperties();
080:                for (Enumeration e = sortProperties.keys(); e.hasMoreElements();) {
081:                    String key = (String) e.nextElement();
082:                    this .sortProperties.put(key, sortProperties.get(key));
083:                }
084:            }
085:
086:            // ResultSetStatistics methods
087:
088:            /**
089:             * Return the statement execution plan as a String.
090:             *
091:             * @param depth	Indentation level.
092:             *
093:             * @return String	The statement execution plan as a String.
094:             */
095:            public String getStatementExecutionPlanText(int depth) {
096:                initFormatInfo(depth);
097:
098:                String sortInfo = (inSortedOrder) ? "" : indent
099:                        + MessageService.getTextMessage(SQLState.RTS_SORT_INFO)
100:                        + ": \n"
101:                        + PropertyUtil
102:                                .sortProperties(sortProperties, subIndent);
103:
104:                return indent
105:                        + MessageService.getTextMessage(SQLState.RTS_SORT_RS)
106:                        + ":\n"
107:                        + indent
108:                        + MessageService.getTextMessage(SQLState.RTS_NUM_OPENS)
109:                        + " = "
110:                        + numOpens
111:                        + "\n"
112:                        + indent
113:                        + MessageService
114:                                .getTextMessage(SQLState.RTS_ROWS_INPUT)
115:                        + " = "
116:                        + rowsInput
117:                        + "\n"
118:                        + indent
119:                        + MessageService
120:                                .getTextMessage(SQLState.RTS_ROWS_RETURNED)
121:                        + " = "
122:                        + rowsReturned
123:                        + "\n"
124:                        + indent
125:                        + MessageService
126:                                .getTextMessage(SQLState.RTS_ELIMINATE_DUPS)
127:                        + " = "
128:                        + eliminateDuplicates
129:                        + "\n"
130:                        + indent
131:                        + MessageService
132:                                .getTextMessage(SQLState.RTS_IN_SORTED_ORDER)
133:                        + " = "
134:                        + inSortedOrder
135:                        + "\n"
136:                        + sortInfo
137:                        + dumpTimeStats(indent, subIndent)
138:                        + "\n"
139:                        + dumpEstimatedCosts(subIndent)
140:                        + "\n"
141:                        + indent
142:                        + MessageService.getTextMessage(SQLState.RTS_SOURCE_RS)
143:                        + ":\n"
144:                        + childResultSetStatistics
145:                                .getStatementExecutionPlanText(sourceDepth)
146:                        + "\n";
147:            }
148:
149:            /**
150:             * Return information on the scan nodes from the statement execution 
151:             * plan as a String.
152:             *
153:             * @param depth	Indentation level.
154:             * @param tableName if not NULL then print information for this table only
155:             *
156:             * @return String	The information on the scan nodes from the 
157:             *					statement execution plan as a String.
158:             */
159:            public String getScanStatisticsText(String tableName, int depth) {
160:                return childResultSetStatistics.getScanStatisticsText(
161:                        tableName, depth);
162:            }
163:
164:            // Class implementation
165:
166:            public String toString() {
167:                return getStatementExecutionPlanText(0);
168:            }
169:
170:            public java.util.Vector getChildren() {
171:                java.util.Vector children = new java.util.Vector();
172:                children.addElement(childResultSetStatistics);
173:                return children;
174:            }
175:
176:            /**
177:             * Format for display, a name for this node.
178:             *
179:             */
180:            public String getNodeName() {
181:                return MessageService.getTextMessage(SQLState.RTS_SORT);
182:            }
183:        }
w_w_w_.___j___a___v__a2___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.