static SortedSet<Upgradeable> getDistributedUpgrades(int versionFrom, FSConstants.NodeType type) throws IOException { assert FSConstants.LAYOUT_VERSION <= versionFrom : "Incorrect version " + versionFrom + ". Expected to be <= " + FSConstants.LAYOUT_VERSION; SortedSet<Upgradeable> upgradeObjects = new TreeSet<Upgradeable>(); for (UOSignature sig : upgradeTable) { if (sig.getVersion() < FSConstants.LAYOUT_VERSION) continue; if (sig.getVersion() > versionFrom) break; if (sig.getType() != type) continue; upgradeObjects.add(sig.instantiate()); } if (upgradeObjects.size() == 0) return null; return upgradeObjects; }
public int compareTo(UOSignature o) { if (this.version != o.version) return (version < o.version ? -1 : 1); int res = this.getType().toString().compareTo(o.getType().toString()); if (res != 0) return res; return className.compareTo(o.className); }