private void dump(Printer printer, boolean verbose) { synchronized (mLock) { if (mConnectionPoolLocked != null) { printer.println(""); mConnectionPoolLocked.dump(printer, verbose); } } }
public void dump(Printer printer) { printer.println(" Prepared statement cache:"); Map<String, PreparedStatement> cache = snapshot(); if (!cache.isEmpty()) { int i = 0; for (Map.Entry<String, PreparedStatement> entry : cache.entrySet()) { PreparedStatement statement = entry.getValue(); if (statement.mInCache) { // might be false due to a race with entryRemoved String sql = entry.getKey(); printer.println(" " + i + ": statementPtr=0x" + Long.toHexString(statement.mStatementPtr) + ", numParameters=" + statement.mNumParameters + ", type=" + statement.mType + ", readOnly=" + statement.mReadOnly + ", sql=\"" + trimSqlForDisplay(sql) + "\""); } i += 1; } } else { printer.println(" <none>"); } } }
/** * Dumps debugging information about this connection, in the case where the * caller might not actually own the connection. * * This function is written so that it may be called by a thread that does not * own the connection. We need to be very careful because the connection state is * not synchronized. * * At worst, the method may return stale or slightly wrong data, however * it should not crash. This is ok as it is only used for diagnostic purposes. * * @param printer The printer to receive the dump, not null. * @param verbose True to dump more verbose information. */ void dumpUnsafe(Printer printer, boolean verbose) { printer.println("Connection #" + mConnectionId + ":"); if (verbose) { printer.println(" connectionPtr: 0x" + Long.toHexString(mConnectionPtr)); } printer.println(" isPrimaryConnection: " + mIsPrimaryConnection); printer.println(" onlyAllowReadOnlyOperations: " + mOnlyAllowReadOnlyOperations); mRecentOperations.dump(printer, verbose); if (verbose) { mPreparedStatementCache.dump(printer); } }
public void dump(Printer printer, boolean verbose) { synchronized (mOperations) { printer.println(" Most recently executed operations:"); int index = mIndex; Operation operation = mOperations[index]; if (operation != null) { int n = 0; do { StringBuilder msg = new StringBuilder(); msg.append(" ").append(n).append(": ["); msg.append(operation.getFormattedStartTime()); msg.append("] "); operation.describe(msg, verbose); printer.println(msg.toString()); if (index > 0) { index -= 1; } else { index = MAX_RECENT_OPERATIONS - 1; } n += 1; operation = mOperations[index]; } while (operation != null && n < MAX_RECENT_OPERATIONS); } else { printer.println(" <none>"); } } } }
@Override protected void dump(FileDescriptor fd, PrintWriter fout, String[] args) { super.dump(fd, fout, args); final Printer p = new PrintWriterPrinter(fout); p.println("LatinIME state :"); p.println(" Keyboard mode = " + mKeyboardSwitcher.getKeyboardMode()); p.println(" mCapsLock=" + mCapsLock); p.println(" mComposing=" + mComposing.toString()); p.println(" mPredictionOn=" + mPredictionOn); p.println(" mCorrectionMode=" + mCorrectionMode); p.println(" mPredicting=" + mPredicting); p.println(" mAutoCorrectOn=" + mAutoCorrectOn); p.println(" mAutoSpace=" + mAutoSpace); p.println(" mCompletionOn=" + mCompletionOn); p.println(" TextEntryState.state=" + TextEntryState.getState()); p.println(" mSoundOn=" + mSoundOn); p.println(" mVibrateOn=" + mVibrateOn); p.println(" mPopupOn=" + mPopupOn); }
private void dump(Printer printer, boolean verbose) { synchronized (mLock) { if (mConnectionPoolLocked != null) { printer.println(""); mConnectionPoolLocked.dump(printer, verbose); } } }
private void dump(Printer printer, boolean verbose) { synchronized (mLock) { if (mConnectionPoolLocked != null) { printer.println(""); mConnectionPoolLocked.dump(printer, verbose); } } }
/** * Dumps debugging information about this connection, in the case where the * caller might not actually own the connection. * * This function is written so that it may be called by a thread that does not * own the connection. We need to be very careful because the connection state is * not synchronized. * * At worst, the method may return stale or slightly wrong data, however * it should not crash. This is ok as it is only used for diagnostic purposes. * * @param printer The printer to receive the dump, not null. * @param verbose True to dump more verbose information. */ void dumpUnsafe(Printer printer, boolean verbose) { printer.println("Connection #" + mConnectionId + ":"); if (verbose) { printer.println(" connectionPtr: 0x" + Long.toHexString(mConnectionPtr)); } printer.println(" isPrimaryConnection: " + mIsPrimaryConnection); printer.println(" onlyAllowReadOnlyOperations: " + mOnlyAllowReadOnlyOperations); mRecentOperations.dump(printer, verbose); if (verbose) { mPreparedStatementCache.dump(printer); } }
public void dump(Printer printer) { printer.println(" Prepared statement cache:"); Map<String, PreparedStatement> cache = snapshot(); if (!cache.isEmpty()) { int i = 0; for (Map.Entry<String, PreparedStatement> entry : cache.entrySet()) { PreparedStatement statement = entry.getValue(); if (statement.mInCache) { // might be false due to a race with entryRemoved String sql = entry.getKey(); printer.println(" " + i + ": statementPtr=0x" + Long.toHexString(statement.mStatementPtr) + ", numParameters=" + statement.mNumParameters + ", type=" + statement.mType + ", readOnly=" + statement.mReadOnly + ", sql=\"" + trimSqlForDisplay(sql) + "\""); } i += 1; } } else { printer.println(" <none>"); } } }
/** * Dumps debugging information about this connection, in the case where the * caller might not actually own the connection. * * This function is written so that it may be called by a thread that does not * own the connection. We need to be very careful because the connection state is * not synchronized. * * At worst, the method may return stale or slightly wrong data, however * it should not crash. This is ok as it is only used for diagnostic purposes. * * @param printer The printer to receive the dump, not null. * @param verbose True to dump more verbose information. */ void dumpUnsafe(Printer printer, boolean verbose) { printer.println("Connection #" + mConnectionId + ":"); if (verbose) { printer.println(" connectionPtr: 0x" + Long.toHexString(mConnectionPtr)); } printer.println(" isPrimaryConnection: " + mIsPrimaryConnection); printer.println(" onlyAllowReadOnlyOperations: " + mOnlyAllowReadOnlyOperations); mRecentOperations.dump(printer, verbose); if (verbose) { mPreparedStatementCache.dump(printer); } }
public void dump(Printer printer) { printer.println(" Prepared statement cache:"); Map<String, PreparedStatement> cache = snapshot(); if (!cache.isEmpty()) { int i = 0; for (Map.Entry<String, PreparedStatement> entry : cache.entrySet()) { PreparedStatement statement = entry.getValue(); if (statement.mInCache) { // might be false due to a race with entryRemoved String sql = entry.getKey(); printer.println(" " + i + ": statementPtr=0x" + Long.toHexString(statement.mStatementPtr) + ", numParameters=" + statement.mNumParameters + ", type=" + statement.mType + ", readOnly=" + statement.mReadOnly + ", sql=\"" + trimSqlForDisplay(sql) + "\""); } i += 1; } } else { printer.println(" <none>"); } } }
@Override protected void dump(final FileDescriptor fd, final PrintWriter fout, final String[] args) { super.dump(fd, fout, args); final Printer p = new PrintWriterPrinter(fout); p.println("LatinIME state :"); p.println(" VersionCode = " + ApplicationUtils.getVersionCode(this)); p.println(" VersionName = " + ApplicationUtils.getVersionName(this)); final Keyboard keyboard = mKeyboardSwitcher.getKeyboard(); final int keyboardMode = keyboard != null ? keyboard.mId.mMode : -1; p.println(" Keyboard mode = " + keyboardMode); }
public void dump(Printer printer, boolean verbose) { synchronized (mOperations) { printer.println(" Most recently executed operations:"); int index = mIndex; Operation operation = mOperations[index]; if (operation != null) { int n = 0; do { StringBuilder msg = new StringBuilder(); msg.append(" ").append(n).append(": ["); msg.append(operation.getFormattedStartTime()); msg.append("] "); operation.describe(msg, verbose); printer.println(msg.toString()); if (index > 0) { index -= 1; } else { index = MAX_RECENT_OPERATIONS - 1; } n += 1; operation = mOperations[index]; } while (operation != null && n < MAX_RECENT_OPERATIONS); } else { printer.println(" <none>"); } } } }
public void dump(Printer printer, boolean verbose) { synchronized (mOperations) { printer.println(" Most recently executed operations:"); int index = mIndex; Operation operation = mOperations[index]; if (operation != null) { int n = 0; do { StringBuilder msg = new StringBuilder(); msg.append(" ").append(n).append(": ["); msg.append(operation.getFormattedStartTime()); msg.append("] "); operation.describe(msg, verbose); printer.println(msg.toString()); if (index > 0) { index -= 1; } else { index = MAX_RECENT_OPERATIONS - 1; } n += 1; operation = mOperations[index]; } while (operation != null && n < MAX_RECENT_OPERATIONS); } else { printer.println(" <none>"); } } } }
printer.println("Connection pool for " + mConfiguration.path + ":"); printer.println(" Open: " + mIsOpen); printer.println(" Max connections: " + mMaxConnectionPoolSize); printer.println(" Available primary connection:"); if (mAvailablePrimaryConnection != null) { mAvailablePrimaryConnection.dump(printer, verbose); } else { printer.println("<none>"); printer.println(" Available non-primary connections:"); if (!mAvailableNonPrimaryConnections.isEmpty()) { for (SQLiteConnection connection : mAvailableNonPrimaryConnections) { printer.println("<none>"); printer.println(" Acquired connections:"); if (!mAcquiredConnections.isEmpty()) { for (Map.Entry<SQLiteConnection, AcquiredConnectionStatus> entry : final SQLiteConnection connection = entry.getKey(); connection.dumpUnsafe(printer, verbose); printer.println(" Status: " + entry.getValue()); printer.println("<none>"); printer.println(" Connection waiters:"); if (mConnectionWaiterQueue != null) { int i = 0;
Printer indentedPrinter = printer; synchronized (mLock) { printer.println("Connection pool for " + mConfiguration.path + ":"); printer.println(" Open: " + mIsOpen); printer.println(" Max connections: " + mMaxConnectionPoolSize); printer.println(" Available primary connection:"); if (mAvailablePrimaryConnection != null) { mAvailablePrimaryConnection.dump(indentedPrinter, verbose); } else { indentedPrinter.println("<none>"); printer.println(" Available non-primary connections:"); if (!mAvailableNonPrimaryConnections.isEmpty()) { final int count = mAvailableNonPrimaryConnections.size(); indentedPrinter.println("<none>"); printer.println(" Acquired connections:"); if (!mAcquiredConnections.isEmpty()) { for (Map.Entry<SQLiteConnection, AcquiredConnectionStatus> entry : final SQLiteConnection connection = entry.getKey(); connection.dumpUnsafe(indentedPrinter, verbose); indentedPrinter.println(" Status: " + entry.getValue()); indentedPrinter.println("<none>"); printer.println(" Connection waiters:");