mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vinod Kone <vinodk...@gmail.com>
Subject Re: Review Request 48046: Implement v1::master::Call::GET_TASKS.
Date Mon, 30 May 2016 18:58:16 GMT


> On May 30, 2016, 6:44 p.m., Vinod Kone wrote:
> > src/master/http.cpp, lines 2420-2423
> > <https://reviews.apache.org/r/48046/diff/1/?file=1401245#file1401245line2420>
> >
> >     this will have a performance regression for /tasks.
> >     
> >     I would say for now don't touch tasks(). Just implement getTasks() from scratch,
i.e., don't bother getting JSON::Object from `_tasks()` and evolving it.
> >     
> >     Also v1::master::Response::GetTasks can just be
> >     
> >     ```
> >     message GetTasks {
> >       repeated Task tasks;
> >     }
> >     
> >     ```
> >     
> >     because v1::Task is public now.

Another option suggested by @mcypark is

```
if we have a vector<const Task*> getTasksHelper(...);

Future<Response> tasks(...) {
  vector<const Task *> tasks = getTasksHelper(...);

  auto tasksWriter = [&tasks, ](...) { ... };

  return OK(jsonify(tasksWriter), ...);
}

and have `getTasks` call `getTasksHelper` as well, except have it go directly from `mesos::Task`s
to `GetTasks::tasks`

even the offset logic could go into getTasksHelper()

```


- Vinod


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/48046/#review135531
-----------------------------------------------------------


On May 30, 2016, 4:23 p.m., Jay Guo wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/48046/
> -----------------------------------------------------------
> 
> (Updated May 30, 2016, 4:23 p.m.)
> 
> 
> Review request for mesos and Vinod Kone.
> 
> 
> Bugs: MESOS-5493
>     https://issues.apache.org/jira/browse/MESOS-5493
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Implement v1::master::Call::GET_TASKS.
> 
> 
> Diffs
> -----
> 
>   src/internal/evolve.hpp 0fdda31bb2bdda46d23663379116fb7cc567055a 
>   src/internal/evolve.cpp 4f25f1a892b4834fc4d79b6fd1bd0edd458b7a58 
>   src/master/http.cpp c8d2f46d9e0ad8a99a6ebffc6a3d5d852cee0616 
>   src/master/master.hpp eeeccdfdfd296c2a484764e887564f2e065cfd14 
>   src/tests/api_tests.cpp 0b6bfadae3a969b3cd1a48e5095e64c953193543 
> 
> Diff: https://reviews.apache.org/r/48046/diff/
> 
> 
> Testing
> -------
> 
> make check
> 
> Incomplete yet. A draft patch to show general idea how to refactor existing endpoints
that uses `jsonify` in OK().
> 
> 
> Thanks,
> 
> Jay Guo
> 
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message