@Override public String toString() { final StringBuilder sb = new StringBuilder(); sb.append("Entry("); sb.append(getProcId()); sb.append(", parentId="); sb.append(getParentId()); sb.append(", class="); sb.append(proto.getClassName()); sb.append(")"); return sb.toString(); } }
public void mergeTail(WalProcedureMap other) { for (Entry p = other.replayOrderHead; p != null; p = p.replayNext) { int slotIndex = getMapSlot(p.getProcId()); p.hashNext = procedureMap[slotIndex]; procedureMap[slotIndex] = p;
public void mergeTail(WalProcedureMap other) { for (Entry p = other.replayOrderHead; p != null; p = p.replayNext) { int slotIndex = getMapSlot(p.getProcId()); p.hashNext = procedureMap[slotIndex]; procedureMap[slotIndex] = p;
public EntryIterator fetchReady() { buildGraph(); Entry readyHead = null; Entry readyTail = null; Entry p = replayOrderHead; while (p != null) { Entry next = p.replayNext; if (p.isReady()) { unlinkFromReplayList(p); if (readyTail != null) { readyTail.replayNext = p; p.replayPrev = readyTail; } else { p.replayPrev = null; readyHead = p; } readyTail = p; p.replayNext = null; } p = next; } // we need the hash-table lookups for parents, so this must be done // out of the loop where we check isReadyToRun() for (p = readyHead; p != null; p = p.replayNext) { removeFromMap(p.getProcId()); unlinkFromLinkList(p); } return readyHead != null ? new EntryIterator(readyHead) : null; }
public EntryIterator fetchReady() { buildGraph(); Entry readyHead = null; Entry readyTail = null; Entry p = replayOrderHead; while (p != null) { Entry next = p.replayNext; if (p.isReady()) { unlinkFromReplayList(p); if (readyTail != null) { readyTail.replayNext = p; p.replayPrev = readyTail; } else { p.replayPrev = null; readyHead = p; } readyTail = p; p.replayNext = null; } p = next; } // we need the hash-table lookups for parents, so this must be done // out of the loop where we check isReadyToRun() for (p = readyHead; p != null; p = p.replayNext) { removeFromMap(p.getProcId()); unlinkFromLinkList(p); } return readyHead != null ? new EntryIterator(readyHead) : null; }
private Entry removeFromMap(final long procId) { int slotIndex = getMapSlot(procId); Entry prev = null; Entry entry = procedureMap[slotIndex]; while (entry != null) { if (procId == entry.getProcId()) { if (prev != null) { prev.hashNext = entry.hashNext; } else { procedureMap[slotIndex] = entry.hashNext; } entry.hashNext = null; return entry; } prev = entry; entry = entry.hashNext; } return null; }
private Entry removeFromMap(final long procId) { int slotIndex = getMapSlot(procId); Entry prev = null; Entry entry = procedureMap[slotIndex]; while (entry != null) { if (procId == entry.getProcId()) { if (prev != null) { prev.hashNext = entry.hashNext; } else { procedureMap[slotIndex] = entry.hashNext; } entry.hashNext = null; return entry; } prev = entry; entry = entry.hashNext; } return null; }
public EntryIterator fetchAll() { Entry head = replayOrderHead; for (Entry p = head; p != null; p = p.replayNext) { removeFromMap(p.getProcId()); } for (int i = 0; i < procedureMap.length; ++i) { assert procedureMap[i] == null : "map not empty i=" + i; } replayOrderHead = null; replayOrderTail = null; childUnlinkedHead = null; rootHead = null; return head != null ? new EntryIterator(head) : null; }
public EntryIterator fetchAll() { Entry head = replayOrderHead; for (Entry p = head; p != null; p = p.replayNext) { removeFromMap(p.getProcId()); } for (int i = 0; i < procedureMap.length; ++i) { assert procedureMap[i] == null : "map not empty i=" + i; } replayOrderHead = null; replayOrderTail = null; childUnlinkedHead = null; rootHead = null; return head != null ? new EntryIterator(head) : null; }
@Override public String toString() { return "Entry(" + getProcId() + ", parentId=" + getParentId() + ")"; } }
private Entry getProcedure(final int slotIndex, final long procId) { Entry entry = procedureMap[slotIndex]; while (entry != null) { if (procId == entry.getProcId()) { return entry; } entry = entry.hashNext; } return null; }
private Entry getProcedure(final int slotIndex, final long procId) { Entry entry = procedureMap[slotIndex]; while (entry != null) { if (procId == entry.getProcId()) { return entry; } entry = entry.hashNext; } return null; }