[autotest] Speed up jobs table on View Host tab on AFE.

AFE was using hostname as key to fetch host and related jobs, which is slow
since afe_host_queue_entries and afe_special_tasks tables are using host_id
instead of hostname as foreign key.

I changed to use host id instead, which largely reduced the latency.
Host table's click listeners on View Job and Host List tabs are also changed
to fetch host by id. The arguments of rpc interfaces
get_host_queue_entries_and_special_tasks and
get_num_host_queue_entries_and_special_tasks are also changed to accept host_id
instead of hostname.

BUG=chromium:383589
DEPLOY=afe,apache
TEST=ran afe, ran View Job and Host List tab and cliked host, ran View Host tab

Change-Id: I7e7d1dd195fec211b6eb867976397d1e643b91ce
Reviewed-on: https://chromium-review.googlesource.com/203843
Tested-by: Jiaxi Luo <jiaxiluo@chromium.org>
Reviewed-by: Simran Basi <sbasi@chromium.org>
Commit-Queue: Jiaxi Luo <jiaxiluo@chromium.org>
7 files changed