introduce getAttributesFromFilesV2
introduce getAttributesFromFilesV2

Summary:
In the new readdir endoint, we return FileAttributeOrErrorV2 instead of
FileAttributeOrError. The reason for this is that FileAttributeOrErrorV2 allows
us to return errors on a per attribute basis.

There may be errors fetching a particular attribute that don't prevent us
from fetching other attributes. For example, there might be a local store
or even network fetching error for fetching sha1 or size. But this does not
prevent returning the type of an entry.

Additionally, we have a few cases where we don't support certain attributes ( no
sha1 or sizes for symlinks or directories.

We would like to be able to indicate to clients why attributes we errored while
fetching are not provided instead of returning a null value. FileAttributeOrError
was not expressive enough for this, and so we introduced FileAttributeOrErrorV2.

I am introducing a new version of getAttributesForFiles that can also return
FileAttributeOrErrorV2 instead of FileAttributeOrError to allow this method to
be more expressive as well. getAttributesForFilesV2 should always be preferred
to getAttributesForFiles do to the improved error handling, so I am marking
getAttributesForFilesV2 as deprecated as future users should not use it.

I will follow up the change by encouraging Buck2 to switch over to this method.

Reviewed By: xavierd

Differential Revision: D38090796

fbshipit-source-id: f190bb1eab0e13a0440ac046e2b4fcc4dbfff2fc

facebook/watchman,facebook/watchman,facebook/watchman,facebook/watchman,facebook/watchman,facebook/watchman,facebook/watchman,facebook/watchman,facebook/watchman