private long getAvailableBytes ( BlockWorkerInfo workerInfo ) { long mCapacityBytes = workerInfo . getCapacityBytes ( ) ; long mUsedBytes = workerInfo . getUsedBytes ( ) ; return mCapacityBytes - mUsedBytes - mBlockCapacityReserved ; }
The information of BlockWorkerInfo is update after a file complete write . To avoid evict user should configure alluxio . user . file . write . avoid . eviction . policy . reserved . size . bytes to reserve some space to store the block .