HUE-8587 [jb] Make impala api cache url specific

Review Request #13559 - Created Dec. 13, 2018 and submitted

Jean-Francois Desjeans Gauthier
hue
master
HUE-8587
hue
jgauthier

commit 8e7f99ae1e387405561d5697665f4a1b23dc8f85
Author: jdesjean <jgauthier@cloudera.com>
Date: Thu Dec 13 10:06:47 2018 -0800

HUE-8587 \[jb\] Make impala api cache url specific.

:100644 100644 fdd631c3ef... e2e441f9ee... M apps/impala/src/impala/server.py



  • 0
  • 0
  • 3
  • 0
  • 3
Description From Last Updated
  1. Why would we need this? (we just need a pool of REST connections, there is no thrift session issue with REST)

    1. The url is different for each user. Are you suggesting we keep one client and change the url?

  2. 
      
  1. Nice, one last comment!

  2. apps/impala/src/impala/server.py (Diff revision 4)
     
     

    Was wondering if it would make sense:
    we only do the lock acquire when the url is not in the cache yet?
    (and initialyze the API_CACHE to {})
    That way we actually get in the lock only for creating? (we call this API a tun, so might be better to only get the lock when really needed)

  3. 
      
  1. 
      
  2. apps/impala/src/impala/server.py (Diff revision 5)
     
     

    API_CACHE = {}

    Works?

    1. My current understanding is that it's not thread safe.

  3. apps/impala/src/impala/server.py (Diff revision 5)
     
     

    not API_CACHE.get(url)

    ?

    Wouldn't it fail if url is not in the dictionary?

  4. 
      
  1. 
      
  2. apps/impala/src/impala/server.py (Diff revision 6)
     
     

    Same, API_CACHE.get(url) to avoid potential KeyError?

  3. 
      
Review request changed

Status: Closed (submitted)

Loading...