exacaster / lighter

REST API for Apache Spark on K8S or YARN
MIT License
91 stars 21 forks source link

Programmatically create permanent session #748

Closed jmilkiewicz closed 11 months ago

jmilkiewicz commented 11 months ago

My draft implementation in which we can potentially support creating permanent session via REST API and YAML file. In case of conflict what we have in DB wins.

jmilkiewicz commented 11 months ago

adding soft delete

jmilkiewicz commented 11 months ago

@pdambrauskas I removed controller and added an extra param to SubmitParams. SubmitParams is used BOTH for

I am not really happy with this appraoch. I am not really familiar with micronaut but maybe to solve this there is sth like https://projectlombok.org/features/experimental/Delegate . It would allow us to do sth like:

class RESTSubmitParams(){
   @Delegate
   private final SubmitParams submitParams;

   private final Boolean permanent;

}

So from property binding all properties of SubmitParams would be "added" to RESTSubmitParams. Other option maybe would be to simply use inheritance:

class RESTSubmitParams extends SubmitParams(){
 private final Boolean permanent;
....
}

WDYT ?

The approach with adding custom param to SubmitParams is here https://github.com/exacaster/lighter/pull/748/commits/ca3778dd49d85fe8a8096ac0ad84dcd7d6556dca

EDIT I went for inheritance which seems to look/work beter

jmilkiewicz commented 11 months ago

I consider it is mostly done. @pdambrauskas @Minutis have a look

pdambrauskas commented 11 months ago

I've left some minor comments, other than that - nice job!

jmilkiewicz commented 11 months ago

I've left some minor comments, other than that - nice job!

fixed comments