Improve the pack read of small reads in local file packet.

Description

Currently LocalFileBlockReader.read used by LocalFilePacketReader employs FileChannel.map for every packet read. This would be inefficient if the read size is small. In fact, from the Javadocs:
_For most operating systems, mapping a file into memory is more expensive than reading or writing a few tens of kilobytes of data via the usual read and write methods.
From the standpoint of performance it is generally only worth mapping relatively large files into memory._

Though it has been Alluxio's assumption that the compute frameworks (e.g. Spark, MapReduce) usually read large chunks of data, so this part has not been optimized. But certain workloads like SQL may read small size of data.

It would be better to check the read size and determine which Java methods to use.

Environment

None

Status

Assignee

Sean

Reporter

Yupeng Fu

Labels

Components

Affects versions

1.6.1

Priority

Minor
Configure