HDFS-5595: refactor a lot of common logic behind TransformationState.
HDFS-5595: remove isAccessMask method.