[ 
https://issues.apache.org/jira/browse/HIVE-17629?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16197632#comment-16197632
 ] 

Sergey Shelukhin commented on HIVE-17629:
-----------------------------------------

The cache is not usable before prewarm by design, currently. Ditto for locks... 
[~thejas] may have more context. Both indeed are out of the scope of the JIRA.

As for the return, this is a pattern used for the methods that edit stuff. Note 
that all of them call rawStore first (because in the normal case they'd call 
both rawStore AND cache). Then, if the cache is null (which means the 
initialization was never triggered) they'd return.
E.g.
{noformat}
     rawStore.createDatabase(db);
+    SharedCache sharedCache = sharedCacheWrapper.get();
+    if (sharedCache == null) return;
{noformat}

> CachedStore - wait for prewarm at use time, not init time
> ---------------------------------------------------------
>
>                 Key: HIVE-17629
>                 URL: https://issues.apache.org/jira/browse/HIVE-17629
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Sergey Shelukhin
>            Assignee: Sergey Shelukhin
>         Attachments: HIVE-17629.patch
>
>
> Most of the changes are trivial, due to static changing to non-static. The 
> patch basically adds lifecycle management for shared cache, and uses it to 
> move prewarm to background thread, waiting for prewarm to happen at use time 
> not setConf, and to make init optional (if not called, CachedStore would 
> proxy the methods to rawStore, like it currently does in the ones not 
> implemented).



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to