1 21 22 package org.apache.derby.impl.sql.execute.rts; 23 24 import org.apache.derby.iapi.services.io.StoredFormatIds; 25 26 import org.apache.derby.iapi.services.i18n.MessageService; 27 import org.apache.derby.iapi.reference.SQLState; 28 29 import org.apache.derby.iapi.services.io.FormatableHashtable; 30 31 import java.io.ObjectOutput ; 32 import java.io.ObjectInput ; 33 import java.io.IOException ; 34 35 41 public class RealUpdateResultSetStatistics 42 extends RealNoRowsResultSetStatistics 43 { 44 45 46 47 public int rowCount; 48 public boolean deferred; 49 public boolean tableLock; 50 public int indexesUpdated; 51 52 54 58 public RealUpdateResultSetStatistics( 59 int rowCount, 60 boolean deferred, 61 int indexesUpdated, 62 boolean tableLock, 63 long executeTime, 64 ResultSetStatistics sourceResultSetStatistics 65 ) 66 { 67 super(executeTime, sourceResultSetStatistics); 68 this.rowCount = rowCount; 69 this.deferred = deferred; 70 this.indexesUpdated = indexesUpdated; 71 this.tableLock = tableLock; 72 this.sourceResultSetStatistics = sourceResultSetStatistics; 73 } 74 75 76 78 85 public String getStatementExecutionPlanText(int depth) 86 { 87 initFormatInfo(depth); 88 89 90 91 return 92 indent + MessageService.getTextMessage( 93 SQLState.RTS_UPDATE_RS_USING, 94 MessageService.getTextMessage( 95 tableLock ? 96 SQLState.LANG_TABLE : 97 SQLState.LANG_ROW) 98 ) + 99 ":\n" + 100 indent + MessageService.getTextMessage(SQLState.RTS_DEFERRED) + 101 ": " + deferred + "\n" + 102 indent + MessageService.getTextMessage( 103 SQLState.RTS_ROWS_UPDATED) + 104 " = " + rowCount + "\n" + 105 indent + MessageService.getTextMessage( 106 SQLState.RTS_INDEXES_UPDATED) + 107 " = " + indexesUpdated + "\n" + 108 dumpTimeStats(indent) + ((sourceResultSetStatistics == null) ? "" : 109 sourceResultSetStatistics.getStatementExecutionPlanText(1)); 110 } 111 112 122 public String getScanStatisticsText(String tableName, int depth) 123 { 124 if (sourceResultSetStatistics == null) 125 return ""; 126 127 return sourceResultSetStatistics.getScanStatisticsText(tableName, depth); 128 } 129 130 132 133 135 public String toString() 136 { 137 return getStatementExecutionPlanText(0); 138 } 139 143 public String getNodeName(){ 144 return MessageService.getTextMessage(SQLState.RTS_UPDATE); 145 } 146 } 147 | Popular Tags |