1 8 9 package com.sleepycat.je; 10 11 import java.io.Serializable ; 12 import java.util.Date ; 13 14 18 public class TransactionStats implements Serializable { 19 20 25 private long lastCheckpointTime; 26 27 30 private long lastTxnId; 31 32 35 private int nActive; 36 37 40 private int nBegins; 41 42 45 private int nAborts; 46 47 50 private int nCommits; 51 52 55 private int nXAAborts; 56 57 60 private int nXAPrepares; 61 62 65 private int nXACommits; 66 67 71 private Active activeTxns[]; 72 73 76 public TransactionStats() { 77 } 78 79 82 public static class Active implements Serializable { 83 86 private long txnId; 87 88 91 private long parentId; 92 93 96 private String name; 97 98 102 public long getId() { 103 return txnId; 104 } 105 106 110 public long getParentId() { 111 return parentId; 112 } 113 114 118 public String getName() { 119 return name; 120 } 121 122 125 public Active(String name, long txnId, long parentId) { 126 this.name = name; 127 this.txnId = txnId; 128 this.parentId = parentId; 129 } 130 131 public String toString() { 132 return "txnId = " + txnId + " txnName = " + name; 133 } 134 } 135 136 140 public Active[] getActiveTxns() { 141 return activeTxns; 142 } 143 144 148 public long getLastCheckpointTime() { 149 return lastCheckpointTime; 150 } 151 152 156 public long getLastTxnId() { 157 return lastTxnId; 158 } 159 160 164 public int getNAborts() { 165 return nAborts; 166 } 167 168 172 public int getNXAAborts() { 173 return nXAAborts; 174 } 175 176 180 public int getNXAPrepares() { 181 return nXAPrepares; 182 } 183 184 188 public int getNActive() { 189 return nActive; 190 } 191 192 196 public int getNBegins() { 197 return nBegins; 198 } 199 200 204 public int getNCommits() { 205 return nCommits; 206 } 207 208 212 public int getNXACommits() { 213 return nXACommits; 214 } 215 216 219 public void setActiveTxns(Active[] actives) { 220 activeTxns = actives; 221 } 222 223 226 public void setLastCheckpointTime(long l) { 227 lastCheckpointTime = l; 228 } 229 230 233 public void setLastTxnId(long val) { 234 lastTxnId = val; 235 } 236 237 240 public void setNAborts(int val) { 241 nAborts = val; 242 } 243 244 247 public void setNXAAborts(int val) { 248 nXAAborts = val; 249 } 250 251 254 public void setNActive(int val) { 255 nActive = val; 256 } 257 258 261 public void setNBegins(int val) { 262 nBegins = val; 263 } 264 265 268 public void setNCommits(int val) { 269 nCommits = val; 270 } 271 272 275 public void setNXACommits(int val) { 276 nXACommits = val; 277 } 278 279 282 public void setNXAPrepares(int val) { 283 nXAPrepares = val; 284 } 285 286 290 public String toString() { 291 StringBuffer sb = new StringBuffer (); 292 sb.append("nBegins=").append(nBegins).append('\n'); 293 sb.append("nAborts=").append(nAborts).append('\n'); 294 sb.append("nCommits=").append(nCommits).append('\n'); 295 sb.append("nXAPrepares=").append(nXAPrepares).append('\n'); 296 sb.append("nXAAborts=").append(nXAAborts).append('\n'); 297 sb.append("nXACommits=").append(nXACommits).append('\n'); 298 sb.append("nActive=").append(nActive).append('\n'); 299 sb.append("activeTxns=["); 300 if (activeTxns != null) { 301 for (int i = 0; i < activeTxns.length; i += 1) { 302 sb.append(" ").append(activeTxns[i]).append('\n'); 303 } 304 } 305 sb.append("]\n"); 306 sb.append("lastTxnId=").append(lastTxnId).append('\n'); 307 sb.append("lastCheckpointTime="). 308 append(new Date (lastCheckpointTime)).append('\n'); 309 return sb.toString(); 310 } 311 } 312 | Popular Tags |