/** * Check if the debug trace level is enabled. * * @return true if it is */ protected boolean isDebugEnabled() { return trace.isDebugEnabled(); }
/** * Write the operation to the trace system if debug trace is enabled. * * @param operation the operation performed * @param id the id of the operation */ public void traceOperation(String operation, int id) { if (trace.isDebugEnabled()) { trace.debug("{0} {1}", operation, id); } }
@Override public void close(Session session) { if (trace.isDebugEnabled()) { trace.debug("{0} close", this); } if (delta != null) { delta.clear(); } rowCountDiff = 0; if (sessionRowCount != null) { sessionRowCount.clear(); } // can not close the index because it might get used afterwards, // for example after running recovery writeRowCount(); }
/** * Write trace information in the form objectName.text. * * @param text the trace text */ protected void debugCode(String text) { if (trace.isDebugEnabled()) { trace.debugCode(getTraceObjectName() + "." + text); } }
/** * Write trace information as a method call in the form * objectName.methodName(). * * @param methodName the method name */ protected void debugCodeCall(String methodName) { if (trace.isDebugEnabled()) { trace.debugCode(getTraceObjectName() + "." + methodName + "();"); } }
private void storePage() { if (trace.isDebugEnabled()) { trace.debug("pageOut.storePage " + data); } data.write(); }
/** * Write trace information as a method call in the form * objectName.methodName(param) where the parameter is formatted as a long * value. * * @param methodName the method name * @param param one single long parameter */ protected void debugCodeCall(String methodName, long param) { if (trace.isDebugEnabled()) { trace.debugCode(getTraceObjectName() + "." + methodName + "(" + param + ");"); } }
/** * Write trace information as an assignment in the form * className prefixId = objectName.value. * * @param className the class name of the result * @param newType the prefix type * @param newId the trace object id of the created object * @param value the value to assign this new object to */ protected void debugCodeAssign(String className, int newType, int newId, String value) { if (trace.isDebugEnabled()) { trace.debugCode(className + " " + PREFIX[newType] + newId + " = " + getTraceObjectName() + "." + value + ";"); } }
@Override public synchronized void writeBack(CacheObject obj) { Page record = (Page) obj; if (trace.isDebugEnabled()) { trace.debug("writeBack " + record); } record.write(); record.setChanged(false); }
@Override public void close(Session session) { if (trace.isDebugEnabled()) { trace.debug("close"); } // can not close the index because it might get used afterwards, // for example after running recovery try { writeRowCount(); } finally { store.incrementChangeCount(); } }
private void traceLock(Session session, boolean exclusive, String s) { if (traceLock.isDebugEnabled()) { traceLock.debug("{0} {1} {2} {3}", session.getId(), exclusive ? "exclusive write lock" : "shared read lock", s, getName()); } }
/** * Write trace information as a method call in the form * objectName.methodName(param) where the parameter is formatted as a Java * string. * * @param methodName the method name * @param param one single string parameter */ protected void debugCodeCall(String methodName, String param) { if (trace.isDebugEnabled()) { trace.debugCode(getTraceObjectName() + "." + methodName + "(" + quote(param) + ");"); } }
@Override public void remove(Session session) { if (trace.isDebugEnabled()) { trace.debug("remove"); } removeAllRows(); store.free(rootPageId); store.removeMeta(this, session); }
private void traceLock(Session session, boolean exclusive, TraceLockEvent eventEnum, String extraInfo) { if (traceLock.isDebugEnabled()) { traceLock.debug("{0} {1} {2} {3} {4}", session.getId(), exclusive ? "exclusive write lock" : "shared read lock", eventEnum.getEventText(), getName(), extraInfo); } }
@Override public void remove(Session session) { if (trace.isDebugEnabled()) { trace.debug("{0} remove", this); } removeAllRows(); store.free(rootPageId); store.removeMeta(this, session); }
/** * Add a page to the free list. The page is not used, therefore doesn't need * to be overwritten. * * @param pageId the page id */ void freeUnused(int pageId) { if (trace.isDebugEnabled()) { trace.debug("freeUnused " + pageId); } cache.remove(pageId); freePage(pageId); freed.set(pageId); }
@Override public void add(Session session, Row row) { if (trace.isDebugEnabled()) { trace.debug("{0} add {1}", getName(), row); } // safe memory SearchRow newRow = getSearchRow(row); try { addRow(newRow); } finally { store.incrementChangeCount(); } }
@Override public void truncate(Session session) { if (trace.isDebugEnabled()) { trace.debug("truncate"); } removeAllRows(); if (tableData.getContainsLargeObject()) { database.getLobStorage().removeAllForTable(table.getId()); } tableData.setRowCount(0); }
/** * Fill the data page with zeros and write it. * This is required for a checkpoint. */ void fillPage() { if (trace.isDebugEnabled()) { trace.debug("pageOut.storePage fill " + data.getPos()); } reserve(data.getRemaining() + 1); reserved -= data.getRemaining(); data.write(); initNextData(); }
private void freeLogPages(IntArray pages) { if (trace.isDebugEnabled()) { trace.debug("log frees " + pages.get(0) + ".." + pages.get(pages.size() - 1)); } Data buffer = getBuffer(); buffer.writeByte((byte) FREE_LOG); int size = pages.size(); buffer.writeVarInt(size); for (int i = 0; i < size; i++) { buffer.writeVarInt(pages.get(i)); } write(buffer); }