public Long getAvailableSize() { long maxSize = getMaxSize(); long sizeUsed = getSizeUsed(); long availableSize = maxSize - sizeUsed; log.debug( "Server[%s], MaxSize[%,d], CurrSize[%,d], QueueSize[%,d], SizeUsed[%,d], AvailableSize[%,d]", server.getName(), maxSize, getCurrServerSize(), getLoadQueueSize(), sizeUsed, availableSize); return availableSize; }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } ServerHolder that = (ServerHolder) o; if (peon != null ? !peon.equals(that.peon) : that.peon != null) { return false; } if (server != null ? !server.equals(that.server) : that.server != null) { return false; } return true; }
public boolean isServingSegment(DataSegment segment) { return (server.getSegment(segment.getIdentifier()) != null); }
public Long getCurrServerSize() { return server.getCurrSize(); }
public Long getMaxSize() { return server.getMaxSize(); }
@Override public int hashCode() { int result = server != null ? server.hashCode() : 0; result = 31 * result + (peon != null ? peon.hashCode() : 0); return result; }