You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have provided ET CacheExt so we can cache table in MLSQL. But there are some disadvantages:
People need to uncache the table manually otherwize the system will have memory leak.
Some misuse will also cause memory leak, check the following code:
select*from b as table1;
!cache table1;
select a from table1 as table1;
!uncache table1;
This means it's hard to use and sometimes a little dangerous with table cache. We should provie a mechanism which guarantee that the cache memory should be released automatically. And the system also should warn user that when they change the reference of a table that have been cached.
In order to deal with this, a potential solution is assign lifttime to cache. There are three kinds of lifttime:
script
session
application
Script lifetime, this means onch the script is finished the cache will be released.
Session lifetime, once the session is logout or timeout, then all cache created in this session will be released.
Application liftime, the user should release the cache mannually.
In this proposal, we will focus on how to implements script liftime.
Script Lifetime should bind to the job life cycle, this means we should provide a MLSQL job listener and the developer can implements the listener to hook the clean action.
Notice that when we runs stream job, there is no need to clean the cache.
First we should provide a JobListener, it should like this:
MPIP: MLSQL Table Cache Cleaner
We have provided ET CacheExt so we can cache table in MLSQL. But there are some disadvantages:
This means it's hard to use and sometimes a little dangerous with table cache. We should provie a mechanism which guarantee that the cache memory should be released automatically. And the system also should warn user that when they change the reference of a table that have been cached.
In order to deal with this, a potential solution is assign lifttime to cache. There are three kinds of lifttime:
Script lifetime, this means onch the script is finished the cache will be released.
Session lifetime, once the session is logout or timeout, then all cache created in this session will be released.
Application liftime, the user should release the cache mannually.
In this proposal, we will focus on how to implements script liftime.
Script Lifetime should bind to the job life cycle, this means we should provide a MLSQL job listener and the developer can implements the listener to hook the clean action.
Notice that when we runs stream job, there is no need to clean the cache.
First we should provide a JobListener, it should like this:
Then, we need to collect the tables are cached and provide function to clean them.
Hook addCache into class SQLCacheExt:
Job manager should add listener callback:
Finally, Implements JobListener.
The text was updated successfully, but these errors were encountered: