Review Request 46960: Remove un-necessary copying of `slave->tasks` in master.

2016-05-03 Thread Anand Mazumdar

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

Review request for mesos and Ben Mahler.


Repository: mesos


Description
---

It seems that we removed an else block in 0.26 that removed the
`removeTask` call from the `foreachvalue` loop but we still kept
on copying `slave->tasks` though it is not needed anymore.


Diffs
-

  src/master/master.cpp 6d3e0f7c634690a35eec1ce827b705e04c3af87e 

Diff: https://reviews.apache.org/r/46960/diff/


Testing
---

make check


Thanks,

Anand Mazumdar



Re: Review Request 46960: Remove un-necessary copying of `slave->tasks` in master.

2016-05-03 Thread Mesos ReviewBot

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



Patch looks great!

Reviews applied: [46960]

Passed command: export OS='ubuntu:14.04' CONFIGURATION='--verbose' 
COMPILER='gcc' ENVIRONMENT='GLOG_v=1 MESOS_VERBOSE=1'; ./support/docker_build.sh

- Mesos ReviewBot


On May 4, 2016, 5:14 a.m., Anand Mazumdar wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/46960/
> ---
> 
> (Updated May 4, 2016, 5:14 a.m.)
> 
> 
> Review request for mesos and Ben Mahler.
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> It seems that we removed an else block in 0.26 that removed the
> `removeTask` call from the `foreachvalue` loop but we still kept
> on copying `slave->tasks` though it is not needed anymore.
> 
> 
> Diffs
> -
> 
>   src/master/master.cpp 6d3e0f7c634690a35eec1ce827b705e04c3af87e 
> 
> Diff: https://reviews.apache.org/r/46960/diff/
> 
> 
> Testing
> ---
> 
> make check
> 
> 
> Thanks,
> 
> Anand Mazumdar
> 
>



Re: Review Request 46960: Remove un-necessary copying of `slave->tasks` in master.

2016-05-05 Thread Ben Mahler

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


Fix it, then Ship it!





src/master/master.cpp (lines 5973 - 5976)


Can we just copy the keys here instead of the entire maps?

```
  foreach (const FrameworkID& frameworkId, slave->executors.keys()) {
foreach (const ExecutorID& executorId, 
slave->executors[frameworkId].keys()) {
```


- Ben Mahler


On May 4, 2016, 5:14 a.m., Anand Mazumdar wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/46960/
> ---
> 
> (Updated May 4, 2016, 5:14 a.m.)
> 
> 
> Review request for mesos and Ben Mahler.
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> It seems that we removed an else block in 0.26 that removed the
> `removeTask` call from the `foreachvalue` loop but we still kept
> on copying `slave->tasks` though it is not needed anymore.
> 
> 
> Diffs
> -
> 
>   src/master/master.cpp 6d3e0f7c634690a35eec1ce827b705e04c3af87e 
> 
> Diff: https://reviews.apache.org/r/46960/diff/
> 
> 
> Testing
> ---
> 
> make check
> 
> 
> Thanks,
> 
> Anand Mazumdar
> 
>



Re: Review Request 46960: Remove un-necessary copying of `slave->tasks` in master.

2016-05-05 Thread Anand Mazumdar


> On May 5, 2016, 11:57 p.m., Ben Mahler wrote:
> > src/master/master.cpp, lines 5974-5977
> > 
> >
> > Can we just copy the keys here instead of the entire maps?
> > 
> > ```
> >   foreach (const FrameworkID& frameworkId, slave->executors.keys()) {
> > foreach (const ExecutorID& executorId, 
> > slave->executors[frameworkId].keys()) {
> > ```

There are other places that can benefit from this too e.g.: 
https://github.com/apache/mesos/blob/master/src/master/master.cpp#L6546

Would it be fine if I did a sweep in a followup patch?


- Anand


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


On May 4, 2016, 5:14 a.m., Anand Mazumdar wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/46960/
> ---
> 
> (Updated May 4, 2016, 5:14 a.m.)
> 
> 
> Review request for mesos and Ben Mahler.
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> It seems that we removed an else block in 0.26 that removed the
> `removeTask` call from the `foreachvalue` loop but we still kept
> on copying `slave->tasks` though it is not needed anymore.
> 
> 
> Diffs
> -
> 
>   src/master/master.cpp 6d3e0f7c634690a35eec1ce827b705e04c3af87e 
> 
> Diff: https://reviews.apache.org/r/46960/diff/
> 
> 
> Testing
> ---
> 
> make check
> 
> 
> Thanks,
> 
> Anand Mazumdar
> 
>