private List<Entry> buildTree(Map<Long, Entry> procMap) { List<Entry> rootEntries = new ArrayList<>(); procMap.values().forEach(entry -> { if (!entry.proc.hasParentId()) { rootEntries.add(entry); } else { Entry parentEntry = procMap.get(entry.proc.getParentId()); // For a valid procedure this should not be null. We will log the error later if it is null, // as it will not be referenced by any root procedures. if (parentEntry != null) { parentEntry.subProcs.add(entry); } } }); return rootEntries; }
@Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("Procedure(pid="); sb.append(proc.getProcId()); sb.append(", ppid="); sb.append(proc.hasParentId() ? proc.getParentId() : Procedure.NO_PROC_ID); sb.append(", class="); sb.append(proc.getClassName()); sb.append(")"); return sb.toString(); } }
onChanged(); if (other.hasParentId()) { setParentId(other.getParentId());
.equals(other.getClassName()); result = result && (hasParentId() == other.hasParentId()); if (hasParentId()) { result = result && (getParentId() == other.getParentId());
onChanged(); if (other.hasParentId()) { setParentId(other.getParentId());
hash = (53 * hash) + getClassName().hashCode(); if (hasParentId()) { hash = (37 * hash) + PARENT_ID_FIELD_NUMBER; hash = (53 * hash) + org.apache.hbase.thirdparty.com.google.protobuf.Internal.hashLong(
proc.setLastUpdate(proto.getLastUpdate()); if (proto.hasParentId()) { proc.setParentProcId(proto.getParentId());
proc.setLastUpdate(proto.getLastUpdate()); if (proto.hasParentId()) { proc.setParentProcId(proto.getParentId());
public void add(ProcedureProtos.Procedure procProto) { trackProcIds(procProto.getProcId()); Entry entry = addToMap(procProto.getProcId(), procProto.hasParentId()); boolean newEntry = entry.proto == null; // We have seen procedure WALs where the entries are out of order; see HBASE-18152. // To compensate, only replace the Entry procedure if for sure this new procedure // is indeed an entry that came later. TODO: Fix the writing of procedure info so // it does not violate basic expectation, that WALs contain procedure changes going // from start to finish in sequence. if (newEntry || isIncreasing(entry.proto, procProto)) { entry.proto = procProto; } addToReplayList(entry); if(newEntry) { if (procProto.hasParentId()) { childUnlinkedHead = addToLinkList(entry, childUnlinkedHead); } else { rootHead = addToLinkList(entry, rootHead); } } }
private List<Entry> buildTree(Map<Long, Entry> procMap) { List<Entry> rootEntries = new ArrayList<>(); procMap.values().forEach(entry -> { if (!entry.proc.hasParentId()) { rootEntries.add(entry); } else { Entry parentEntry = procMap.get(entry.proc.getParentId()); // For a valid procedure this should not be null. We will log the error later if it is null, // as it will not be referenced by any root procedures. if (parentEntry != null) { parentEntry.subProcs.add(entry); } } }); return rootEntries; }
public boolean hasParent() { return proto.hasParentId(); }
private static boolean isFinished(ProcedureProtos.Procedure proc) { if (!proc.hasParentId()) { switch (proc.getState()) { case ROLLEDBACK: case SUCCESS: return true; default: break; } } return false; }
@Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("Procedure(pid="); sb.append(proc.getProcId()); sb.append(", ppid="); sb.append(proc.hasParentId() ? proc.getParentId() : Procedure.NO_PROC_ID); sb.append(", class="); sb.append(proc.getClassName()); sb.append(")"); return sb.toString(); } }
.equals(other.getClassName()); result = result && (hasParentId() == other.hasParentId()); if (hasParentId()) { result = result && (getParentId() == other.getParentId());
hash = (53 * hash) + getClassName().hashCode(); if (hasParentId()) { hash = (37 * hash) + PARENT_ID_FIELD_NUMBER; hash = (53 * hash) + org.apache.hbase.thirdparty.com.google.protobuf.Internal.hashLong(
proc.setLastUpdate(proto.getLastUpdate()); if (proto.hasParentId()) { proc.setParentProcId(proto.getParentId());
private static boolean isFinished(ProcedureProtos.Procedure proc) { if (!proc.hasParentId()) { switch (proc.getState()) { case ROLLEDBACK: case SUCCESS: return true; default: break; } } return false; }