@Override public boolean equals(Object o) { if (!(o instanceof Node)) return false; Node n = (Node) o; return (type.equals(n.type) && index == n.index); }
private int getOrdering() { return (type.equals(NodeType.STORAGE) ? 65536 : 0) + index; }
public void verifyValidInSystemState(NodeType type) { if (!state.validCurrentNodeState(type)) { throw new IllegalArgumentException("State " + state + " cannot fit in system state for node of type: " + type); } if (type.equals(NodeType.DISTRIBUTOR) && Math.abs(capacity - 1.0) > 0.000000001) { throw new IllegalArgumentException("Capacity should not be set for a distributor node"); } if (type.equals(NodeType.DISTRIBUTOR) && Math.abs(reliability - 1.0) > 0.000000001) { throw new IllegalArgumentException("Reliability should not be set for a distributor node"); } if (type.equals(NodeType.DISTRIBUTOR) && !diskStates.isEmpty()) { throw new IllegalArgumentException("Disk states should not be set for a distributor node"); } }
&& type.equals(NodeType.STORAGE) && (initProgress < getListingBucketsInitProgressLimit() ^ other.initProgress < getListingBucketsInitProgressLimit()))
if (type.equals(NodeType.STORAGE)) { if (initProgress < getListingBucketsInitProgressLimit()) { sb.append(compact ? " (ls)" : " (listing files)");
case 'c': if (key.length() > 1) break; if (type != null && !type.equals(NodeType.STORAGE)) break; try{ newState.setCapacity(Double.valueOf(value)); case 'r': if (key.length() > 1) break; if (type != null && !type.equals(NodeType.STORAGE)) break; try{ newState.setReliability(Integer.valueOf(value)); continue; case 'd': if (type != null && !type.equals(NodeType.STORAGE)) break; if (key.length() == 1) { int size;
sb.append(" distributor:").append(distributorNodeCount); for (Map.Entry<Node, NodeState> entry : nodeStates.entrySet()) { if (entry.getKey().getType().equals(NodeType.DISTRIBUTOR) && entry.getKey().getIndex() < distributorNodeCount) { String nodeState = entry.getValue().serialize(entry.getKey().getIndex(), verbose); if (!nodeState.isEmpty()) { sb.append(" storage:").append(storageNodeCount); for (Map.Entry<Node, NodeState> entry : nodeStates.entrySet()) { if (entry.getKey().getType().equals(NodeType.STORAGE) && entry.getKey().getIndex() < storageNodeCount) { String nodeState = entry.getValue().serialize(entry.getKey().getIndex(), verbose); if (!nodeState.isEmpty()) {