Track allocated resources via metrics

Change-Id: Ib0e303038717a8614ac571e5735ba7f80aa312dd
Reviewed-on: http://gerrit.ent.cloudera.com:8080/2556
Reviewed-by: Henry Robinson <henry@cloudera.com>
Tested-by: jenkins
(cherry picked from commit 04292f41a08d4ac6d9dc2488e4074a5cd006cf8f)
Reviewed-on: http://gerrit.ent.cloudera.com:8080/2879
Add flags to allow custom LDAP bind names

Some LDAP server configurations don't allow us to bind directly using
the short name, but instead need a more structured user name. It's not
sufficient to require the client to provide the name, because the
username is also handed to Sentry, which would get confused by all the
"DN=foo,CN=bar..." LDAP weirdness.

Hive provides two simple options to specify either the domain or the
base DN. This patch implements both, but also adds the more general
--ldap_bind_pattern which is provided directly to LDAP with the string
sufficient to implement the other two, I include all so that simple use
cases don't require understanding the string manipulations that Impala
must perform.

Change-Id: I2c1594295a39056a9b95a6a76756c5df22a34ee5
Reviewed-on: http://gerrit.ent.cloudera.com:8080/2872
Reviewed-by: Alex Behm <alex.behm@cloudera.com>
Tested-by: jenkins