@Override
public synchronized FetchedInput allocate(long actualSize, long compressedSize,
InputAttemptIdentifier inputAttemptIdentifier) throws IOException {
if (actualSize > maxSingleShuffleLimit
|| this.usedMemory + actualSize > this.memoryLimit) {
return new DiskFetchedInput(actualSize, compressedSize,
inputAttemptIdentifier, this, conf, localDirAllocator,
fileNameAllocator);
} else {
this.usedMemory += actualSize;
LOG.info("Used memory after allocating " + actualSize + " : " + usedMemory);