You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@reef.apache.org by "Markus Weimer (JIRA)" <ji...@apache.org> on 2016/05/03 21:39:12 UTC

[jira] [Created] (REEF-1379) Add a fluid interface to EvaluatorRequestor

Markus Weimer created REEF-1379:
-----------------------------------

             Summary: Add a fluid interface to EvaluatorRequestor
                 Key: REEF-1379
                 URL: https://issues.apache.org/jira/browse/REEF-1379
             Project: REEF
          Issue Type: Improvement
            Reporter: Markus Weimer
            Priority: Minor


{{EvaluatorRequestor}} and {{EvaluatorRequest.newBuilder()}} are almost always used together in a pattern that looks like this:

{code}
requestor.submit(EvaluatorRequest.newBuilder()
  .setNumber(1)
  .setMemory(64)
  .setNumberOfCores(1)
  .build());
{code}

It would be good to have a nicer, more fluid API here:
{code}
requestor.newRequest()
  .setNumber(1)
  .setMemory(64)
  .setNumberOfCores(1)
  .submit();
{code}

This could be done by creating a subclass of {{EvaluatorRequest.Builder}} which has a reference to the {{EvaluatorRequestor}} instance and implements {{.submit()}} as:

{code}
void submit(){
  this.requestor.submit(this.build());
}
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)