public String toString() { StringBuilder sb = new StringBuilder(); PrintProperties pp = new PrintProperties(); print(sb, "", pp, false); return sb.toString(); } public String toHtml() {
public String getHtmlDifference(ClusterState other) { return getDiff(other).toHtml(); }
public String getTextualDifference(ClusterState other) { return getDiff(other).toString(); } public String getHtmlDifference(ClusterState other) {
public Diff getDiff(NodeState other) { Diff diff = new Diff(); if (!state.equals(other.state)) { diff.add(new Diff.Entry("", state, other.state).bold()); diff.add(new Diff.Entry("capacity", capacity, other.capacity)); diff.add(new Diff.Entry("reliability", reliability, other.reliability)); diff.add(new Diff.Entry("minUsedBits", minUsedBits, other.minUsedBits)); diff.add(new Diff.Entry("initProgress", initProgress, other.initProgress)); diff.add(new Diff.Entry("startTimestamp", startTimestamp, other.startTimestamp)); diff.add(new Diff.Entry("disks", diskStates.size(), other.diskStates.size())); } else { Diff diskDiff = new Diff(); for (int i=0; i<diskStates.size(); ++i) { if (!diskStates.get(i).equals(other.diskStates.get(i))) { diskDiff.add(new Diff.Entry(i, diskStates.get(i), other.diskStates.get(i))); if (diskDiff.differs()) { diff.add(new Diff.Entry("disks", diskDiff)); diff.add(new Diff.Entry("description", description, other.description));
public Diff getDiff(ClusterState other) { Diff diff = new Diff(); if (version != other.version) { diff.add(new Diff.Entry("version", version, other.version)); } if (!state.equals(other.state)) { diff.add(new Diff.Entry("cluster", state, other.state)); } if (distributionBits != other.distributionBits) { diff.add(new Diff.Entry("bits", distributionBits, other.distributionBits)); } if (official != other.official) { diff.add(new Diff.Entry("official", official, other.official)); } for (NodeType type : NodeType.getTypes()) { Diff typeDiff = new Diff(); int maxCount = Math.max(getNodeCount(type), other.getNodeCount(type)); for (int i = 0; i < maxCount; i++) { Node n = new Node(type, i); Diff d = getNodeState(n).getDiff(other.getNodeState(n)); if (d.differs()) { typeDiff.add(new Diff.Entry(i, d)); } } if (typeDiff.differs()) { diff.add(new Diff.Entry(type, typeDiff).splitLine()); } } return diff; }
public String toHtml() { StringBuilder sb = new StringBuilder(); PrintProperties pp = new PrintProperties(); pp.lineBreak = "<br>\n"; pp.indent = " "; pp.keyValueSeparator = " => "; pp.insertLineBreaks = true; pp.boldStart = "<b>"; pp.boldStop = "</b>"; print(sb, "", pp, false); return sb.toString(); }
public String getTextualDifference(NodeState other) { return getDiff(other).toString(); }
sb.append(pp.lineBreak).append(indent + pp.indent); e.subDiff.print(sb, indent + pp.indent, pp, e.splitLine); if (e.splitLine && pp.insertLineBreaks) { sb.append(pp.lineBreak).append(indent);