As far as I can see I can use built-in purge task....
# general
g
As far as I can see I can use built-in purge task. The only thing I need to do is to setRecordPurgeFactory in MinionContext. Can’t figure out how
f
Hi. This have to be done in the minonBaseStarter.
Copy code
SegmentPurger.RecordPurgerFactory s = new SegmentPurger.RecordPurgerFactory() {
  @Override
  public SegmentPurger.RecordPurger getRecordPurger(String rawTableName) {
    _listToPurge = getMapFromCSV(System.getenv("PURGE_LIST_FILE"));
    SegmentPurger.RecordPurger r = row -> {
      String contextTable = rawTableName.replace("_OFFLINE", "");
      for (List<String> a : _listToPurge) {
        if (a.get(0).equals(contextTable)) {
            if (a.get(1).equals(row.getValue("meta.customer"))
                    && (((a.get(2).equals("*"))
                    || (a.get(2).equals(row.getValue("id")))))) {
                return true;
            }
        }
      }
      return false;
    };
    return r;
  }
};
 minionContext.setRecordPurgerFactory(s);
What I’ve implemented in my side 😉 Many way to do it in a différent ways for sure
g
Thank you! I read through the thread. I hoped minion tasks could be setup through configs. I’m ok providing a jar with the right classes. I’m not looking to modify actual pinot code base and deploy a custom version.
I thought that all the pieces are already in place. Just need to provide my custom RecordPurgerFactory.
f
This should work. What is you pinot version ? Latest master ?
Yes PurgeTAskGenerator is in place was’nt the case when I’ve looked on the project so with the help of the community I’ve pushed it to the master branch to make it avalaible 😉
g
Well. I have Ops who install and configure clusters, etc. Don’t want to customize source code. Plug-ins is a fair game.
I can see task generator in 0.11 code tree
Still there is no way to set the factory in the minion context. Or is there one?
There is no task generator in 0.10 . I can add a custom one, if minion will pick it up from the jar
The company runs 0.10
f
You will have to dev something already tested and dev in other version. Not sure the plugin thing will work @Mayank any point of view to share on this ?
You will have to do two main things : 1 implement purgeTaskGenerator class which extends
BaseTaskGenerator
2 set the
recordPurgerFactory
in the minion context
g
I understood that