Exemple #1
0
  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;
  }
Exemple #2
0
  @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;
  }
Exemple #3
0
 public boolean isServingSegment(DataSegment segment) {
   return (server.getSegment(segment.getIdentifier()) != null);
 }
Exemple #4
0
 public Long getCurrServerSize() {
   return server.getCurrSize();
 }
Exemple #5
0
 public Long getMaxSize() {
   return server.getMaxSize();
 }
Exemple #6
0
 @Override
 public int hashCode() {
   int result = server != null ? server.hashCode() : 0;
   result = 31 * result + (peon != null ? peon.hashCode() : 0);
   return result;
 }