@Test public void getFreeBytesOnTiers() { assertEquals(ImmutableMap.of("MEM", Constants.KB * 2L, "SSD", Constants.KB * 2L), mInfo.getFreeBytesOnTiers()); }
public Map<String, Long> getFreeBytesOnTiers() { Map<String, Long> freeCapacityBytes = new HashMap<>(); for (Map.Entry<String, Long> entry : mTotalBytesOnTiers.entrySet()) { freeCapacityBytes.put(entry.getKey(), entry.getValue() - mUsedBytesOnTiers.get(entry.getKey())); } return freeCapacityBytes; }
MasterWorkerInfo { public Map<String, Long> getFreeBytesOnTiers() { Map<String, Long> freeCapacityBytes = new HashMap<>(); for (Map.Entry<String, Long> entry : mTotalBytesOnTiers.entrySet()) { freeCapacityBytes.put(entry.getKey(), entry.getValue() - mUsedBytesOnTiers.get(entry.getKey())); } return freeCapacityBytes; } }
MasterWorkerInfo { public Map<String, Long> getFreeBytesOnTiers() { Map<String, Long> freeCapacityBytes = new HashMap<>(); for (Map.Entry<String, Long> entry : mTotalBytesOnTiers.entrySet()) { freeCapacityBytes.put(entry.getKey(), entry.getValue() - mUsedBytesOnTiers.get(entry.getKey())); } return freeCapacityBytes; } MasterWorkerInfo(long id, WorkerNetAddress address); }
MasterWorkerInfo { public Map<String, Long> getFreeBytesOnTiers() { Map<String, Long> freeCapacityBytes = new HashMap<>(); for (Map.Entry<String, Long> entry : mTotalBytesOnTiers.entrySet()) { freeCapacityBytes.put(entry.getKey(), entry.getValue() - mUsedBytesOnTiers.get(entry.getKey())); } return freeCapacityBytes; } MasterWorkerInfo(long id, WorkerNetAddress address); Set<Long> register(final StorageTierAssoc globalStorageTierAssoc,
      final List<String> storageTierAliases, final Map<String, Long> totalBytesOnTiers,
      final Map<String, Long> usedBytesOnTiers, final Set<Long> blocks); void addBlock(long blockId); void removeBlock(long blockId); void addLostStorage(String tierAlias, String dirPath); void addLostStorage(Map<String, StorageList> lostStorage); WorkerInfo generateWorkerInfo(Set<WorkerInfoField> fieldRange, boolean isLiveWorker); WorkerNetAddress getWorkerAddress(); long getAvailableBytes(); Set<Long> getBlocks(); long getCapacityBytes(); long getId(); long getLastUpdatedTimeMs(); List<Long> getToRemoveBlocks(); long getUsedBytes(); StorageTierAssoc getStorageTierAssoc(); Map<String, Long> getTotalBytesOnTiers(); Map<String, Long> getUsedBytesOnTiers(); long getStartTime(); boolean isRegistered(); Map<String, Long> getFreeBytesOnTiers(); Map<String, List<String>> getLostStorage(); boolean hasLostStorage(); @Override String toString(); void updateLastUpdatedTimeMs(); void updateToRemovedBlock(boolean add, long blockId); void updateCapacityBytes(Map<String, Long> capacityBytesOnTiers); void updateUsedBytes(Map<String, Long> usedBytesOnTiers); void updateUsedBytes(String tierAlias, long usedBytesOnTier); }
MasterWorkerInfo { public Map<String, Long> getFreeBytesOnTiers() { Map<String, Long> freeCapacityBytes = new HashMap<>(); for (Map.Entry<String, Long> entry : mTotalBytesOnTiers.entrySet()) { freeCapacityBytes.put(entry.getKey(), entry.getValue() - mUsedBytesOnTiers.get(entry.getKey())); } return freeCapacityBytes; } MasterWorkerInfo(long id, WorkerNetAddress address); Set<Long> register(final StorageTierAssoc globalStorageTierAssoc,
      final List<String> storageTierAliases, final Map<String, Long> totalBytesOnTiers,
      final Map<String, Long> usedBytesOnTiers, final Set<Long> blocks); void addBlock(long blockId); void removeBlock(long blockId); void addLostStorage(String tierAlias, String dirPath); void addLostStorage(Map<String, StorageList> lostStorage); WorkerInfo generateWorkerInfo(Set<WorkerInfoField> fieldRange, boolean isLiveWorker); WorkerNetAddress getWorkerAddress(); long getAvailableBytes(); Set<Long> getBlocks(); long getCapacityBytes(); long getId(); long getLastUpdatedTimeMs(); List<Long> getToRemoveBlocks(); long getUsedBytes(); StorageTierAssoc getStorageTierAssoc(); Map<String, Long> getTotalBytesOnTiers(); Map<String, Long> getUsedBytesOnTiers(); long getStartTime(); boolean isRegistered(); Map<String, Long> getFreeBytesOnTiers(); Map<String, List<String>> getLostStorage(); boolean hasLostStorage(); @Override String toString(); void updateLastUpdatedTimeMs(); void updateToRemovedBlock(boolean add, long blockId); void updateCapacityBytes(Map<String, Long> capacityBytesOnTiers); void updateUsedBytes(Map<String, Long> usedBytesOnTiers); void updateUsedBytes(String tierAlias, long usedBytesOnTier);  }