Re: Review Request 51493: Add the query parameter in createRequest.

2016-09-11 Thread Yongqiao Wang


> On 九月 11, 2016, 5:26 p.m., haosdent huang wrote:
> > 3rdparty/libprocess/include/process/http.hpp, line 845
> > <https://reviews.apache.org/r/51493/diff/1/?file=1487972#file1487972line845>
> >
> > I think use `hashmap` as type here would be better?

Thank haosdent for your comments, to keep the interface consistence with 
`http:get(const UPID& upid,const Option& path, const Option& 
query,const Option& headers)`, I also use `Option&` in 
`createRequest` function, then all the caller will have the small changes to 
call `createRequest`. I quite agree with you to change this to `hashmap` to 
avoid the input error in format, and we can submit another patch after clean 
all http:get function.


- Yongqiao


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


On 八月 29, 2016, 10:47 p.m., Yongqiao Wang wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/51493/
> ---
> 
> (Updated 八月 29, 2016, 10:47 p.m.)
> 
> 
> Review request for mesos.
> 
> 
> Bugs: MESOS-4440
> https://issues.apache.org/jira/browse/MESOS-4440
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Add the new 'query' parameter in createRequest method, which will be used by 
> Http GET method later.
> 
> 
> Diffs
> -
> 
>   3rdparty/libprocess/include/process/http.hpp 
> 404196bb198c1ff958b55d72fb29c5fe92dba429 
>   3rdparty/libprocess/src/http.cpp 298bd460afdeccd18e201d8a505b961fd4cf3d3e 
> 
> Diff: https://reviews.apache.org/r/51493/diff/
> 
> 
> Testing
> ---
> 
> make & make check successfully.
> 
> 
> Thanks,
> 
> Yongqiao Wang
> 
>



Review Request 51520: Update contributors.yaml for gradywang

2016-08-30 Thread Yongqiao Wang

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

Review request for mesos.


Repository: mesos


Description
---

Update contributors.yaml for gradywang


Diffs
-

  docs/contributors.yaml 0f2a81f8462d30f9546c6084ee315be760a799a1 

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


Testing
---


Thanks,

Yongqiao Wang



Re: Review Request 51505: Replace http::get with http::request in mesos project.

2016-08-29 Thread Yongqiao Wang

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

(Updated Aug. 30, 2016, 5:36 a.m.)


Review request for mesos.


Changes
---

Code refactor.


Bugs: MESOS-4440
https://issues.apache.org/jira/browse/MESOS-4440


Repository: mesos


Description
---

Replace http::get with http::request in mesos project.


Diffs (updated)
-

  src/tests/containerizer/docker_containerizer_tests.cpp 
28cd3fa66886dbdbae3fdeca77707147faafcb7a 
  src/tests/executor_http_api_tests.cpp 
fd322ee267b2f0d4bf250db15027d61f1fc74a57 
  src/tests/fault_tolerance_tests.cpp 5a9944cf459ab688907d95bbda09f464b37efd1e 
  src/tests/files_tests.cpp 78719da5938ff0de722f8411174817f708fd41f2 
  src/tests/gc_tests.cpp f3aec4a95ff231bed1283ef1408101c012cadea1 
  src/tests/health_check_tests.cpp 50a252b5267cbc3b21ddc75e1da86c4975f6faf1 
  src/tests/logging_tests.cpp 886dcd0d6d6ccf509c98578e8b86b1c6ecd5775f 
  src/tests/master_authorization_tests.cpp 
a6399f1b958705b87418b40d3771b25a37d49682 
  src/tests/master_maintenance_tests.cpp 
0820e637b0da69ebcfc8776c223c3bc8a4f1bc94 
  src/tests/master_quota_tests.cpp 48be7406181646c8cc1d169b82a4a4ca71cdf03b 
  src/tests/master_tests.cpp 6cde15fcd6ca8ec40438c75aed980e83f8de9b86 
  src/tests/metrics_tests.cpp 27fc35f3bc47fc2905f4ce400b1051307dcacb2e 
  src/tests/persistent_volume_endpoints_tests.cpp 
266c2a0ff4a99baa96a7c4980f076755603256a9 
  src/tests/registrar_tests.cpp b04fc92c66449f1094212a534899e16d5f6f01bd 
  src/tests/role_tests.cpp 162c9414a70723a212cfd39ac5c0b8325c3f3b5d 
  src/tests/scheduler_driver_tests.cpp faf2e6c8ad17e07964b4340d0b340654b03f9086 
  src/tests/scheduler_http_api_tests.cpp 
80a2ef0af9a4c67deaef40e1f36343868ee4428f 
  src/tests/slave_authorization_tests.cpp 
6f120b6ab5d86c3737e979cdcdb5b6cca008d1ff 
  src/tests/slave_tests.cpp 701fab20091f9f7df020290b9f0a9db1dec92647 
  src/tests/status_update_manager_tests.cpp 
38d8913a5b33aa5325d0bc632c0a1d80480eddf8 
  src/tests/utils.cpp cc5259a720bb6451714a100b0451b473395e3650 

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


Testing
---

make & make check successfully!


Thanks,

Yongqiao Wang



Re: Review Request 51505: Replace http::get with http::request in mesos project.

2016-08-29 Thread Yongqiao Wang

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

(Updated Aug. 30, 2016, 5:28 a.m.)


Review request for mesos.


Summary (updated)
-

Replace http::get with http::request in mesos project.


Bugs: MESOS-4440
https://issues.apache.org/jira/browse/MESOS-4440


Repository: mesos


Description (updated)
---

Replace http::get with http::request in mesos project.


Diffs (updated)
-

  src/tests/containerizer/docker_containerizer_tests.cpp 
28cd3fa66886dbdbae3fdeca77707147faafcb7a 
  src/tests/executor_http_api_tests.cpp 
fd322ee267b2f0d4bf250db15027d61f1fc74a57 
  src/tests/fault_tolerance_tests.cpp 5a9944cf459ab688907d95bbda09f464b37efd1e 
  src/tests/files_tests.cpp 78719da5938ff0de722f8411174817f708fd41f2 
  src/tests/gc_tests.cpp f3aec4a95ff231bed1283ef1408101c012cadea1 
  src/tests/health_check_tests.cpp 50a252b5267cbc3b21ddc75e1da86c4975f6faf1 
  src/tests/logging_tests.cpp 886dcd0d6d6ccf509c98578e8b86b1c6ecd5775f 
  src/tests/master_authorization_tests.cpp 
a6399f1b958705b87418b40d3771b25a37d49682 
  src/tests/master_maintenance_tests.cpp 
0820e637b0da69ebcfc8776c223c3bc8a4f1bc94 
  src/tests/master_quota_tests.cpp 48be7406181646c8cc1d169b82a4a4ca71cdf03b 
  src/tests/master_tests.cpp 6cde15fcd6ca8ec40438c75aed980e83f8de9b86 
  src/tests/metrics_tests.cpp 27fc35f3bc47fc2905f4ce400b1051307dcacb2e 
  src/tests/persistent_volume_endpoints_tests.cpp 
266c2a0ff4a99baa96a7c4980f076755603256a9 
  src/tests/registrar_tests.cpp b04fc92c66449f1094212a534899e16d5f6f01bd 
  src/tests/role_tests.cpp 162c9414a70723a212cfd39ac5c0b8325c3f3b5d 
  src/tests/scheduler_driver_tests.cpp faf2e6c8ad17e07964b4340d0b340654b03f9086 
  src/tests/scheduler_http_api_tests.cpp 
80a2ef0af9a4c67deaef40e1f36343868ee4428f 
  src/tests/slave_authorization_tests.cpp 
6f120b6ab5d86c3737e979cdcdb5b6cca008d1ff 
  src/tests/slave_tests.cpp 701fab20091f9f7df020290b9f0a9db1dec92647 
  src/tests/status_update_manager_tests.cpp 
38d8913a5b33aa5325d0bc632c0a1d80480eddf8 
  src/tests/utils.cpp cc5259a720bb6451714a100b0451b473395e3650 

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


Testing
---

make & make check successfully!


Thanks,

Yongqiao Wang



Re: Review Request 51495: Replace http::get with http::request in libprocess project.

2016-08-29 Thread Yongqiao Wang

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

(Updated Aug. 30, 2016, 5:27 a.m.)


Review request for mesos.


Summary (updated)
-

Replace http::get with http::request in libprocess project.


Bugs: MESOS-4440
https://issues.apache.org/jira/browse/MESOS-4440


Repository: mesos


Description (updated)
---

Replace http::get with http::request in libprocess project.


Diffs (updated)
-

  3rdparty/libprocess/src/tests/benchmarks.cpp 
945007c38f96a66212f5ebdd700a117a4902a736 
  3rdparty/libprocess/src/tests/http_tests.cpp 
24b266df5f17e28e0c95326f5d1ea451952500e8 
  3rdparty/libprocess/src/tests/metrics_tests.cpp 
88526e67a20b7b58a6e14034215faa3ae9879fd0 
  3rdparty/libprocess/src/tests/process_tests.cpp 
b9feec7e34cffe19e49035f8865b150f79258f54 
  3rdparty/libprocess/src/tests/profiler_tests.cpp 
995bd02f6ecce484cd9b2aca355c2707d73d40b2 
  3rdparty/libprocess/src/tests/system_tests.cpp 
0f4d0424689522337806ba2227ec4330c700e17e 

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


Testing
---

make & make check successfully!


Thanks,

Yongqiao Wang



Review Request 51508: Remove the useless http::get method.

2016-08-29 Thread Yongqiao Wang

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

Review request for mesos.


Bugs: MESOS-4440
https://issues.apache.org/jira/browse/MESOS-4440


Repository: mesos


Description
---

Remove the useless http::get method.


Diffs
-

  3rdparty/libprocess/include/process/http.hpp 
404196bb198c1ff958b55d72fb29c5fe92dba429 
  3rdparty/libprocess/src/http.cpp 298bd460afdeccd18e201d8a505b961fd4cf3d3e 

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


Testing
---


Thanks,

Yongqiao Wang



Re: Review Request 51508: Remove the useless http::get method.

2016-08-29 Thread Yongqiao Wang

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

(Updated Aug. 29, 2016, 11:41 p.m.)


Review request for mesos.


Bugs: MESOS-4440
https://issues.apache.org/jira/browse/MESOS-4440


Repository: mesos


Description
---

Remove the useless http::get method.


Diffs
-

  3rdparty/libprocess/include/process/http.hpp 
404196bb198c1ff958b55d72fb29c5fe92dba429 
  3rdparty/libprocess/src/http.cpp 298bd460afdeccd18e201d8a505b961fd4cf3d3e 

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


Testing (updated)
---

make & make check successfully!


Thanks,

Yongqiao Wang



Re: Review Request 51505: [2]Replace http::get with http::request.

2016-08-29 Thread Yongqiao Wang

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

(Updated Aug. 29, 2016, 11:39 p.m.)


Review request for mesos.


Summary (updated)
-

[2]Replace http::get with http::request.


Bugs: MESOS-4440
https://issues.apache.org/jira/browse/MESOS-4440


Repository: mesos


Description
---

Replace http::get with http::request.


Diffs
-

  src/tests/containerizer/docker_containerizer_tests.cpp 
28cd3fa66886dbdbae3fdeca77707147faafcb7a 
  src/tests/executor_http_api_tests.cpp 
fd322ee267b2f0d4bf250db15027d61f1fc74a57 
  src/tests/fault_tolerance_tests.cpp 5a9944cf459ab688907d95bbda09f464b37efd1e 
  src/tests/files_tests.cpp 78719da5938ff0de722f8411174817f708fd41f2 
  src/tests/gc_tests.cpp f3aec4a95ff231bed1283ef1408101c012cadea1 
  src/tests/health_check_tests.cpp 50a252b5267cbc3b21ddc75e1da86c4975f6faf1 
  src/tests/logging_tests.cpp 886dcd0d6d6ccf509c98578e8b86b1c6ecd5775f 
  src/tests/master_authorization_tests.cpp 
a6399f1b958705b87418b40d3771b25a37d49682 
  src/tests/master_maintenance_tests.cpp 
0820e637b0da69ebcfc8776c223c3bc8a4f1bc94 
  src/tests/master_quota_tests.cpp 48be7406181646c8cc1d169b82a4a4ca71cdf03b 
  src/tests/master_tests.cpp 6cde15fcd6ca8ec40438c75aed980e83f8de9b86 
  src/tests/metrics_tests.cpp 27fc35f3bc47fc2905f4ce400b1051307dcacb2e 
  src/tests/persistent_volume_endpoints_tests.cpp 
266c2a0ff4a99baa96a7c4980f076755603256a9 
  src/tests/registrar_tests.cpp b04fc92c66449f1094212a534899e16d5f6f01bd 
  src/tests/role_tests.cpp 162c9414a70723a212cfd39ac5c0b8325c3f3b5d 
  src/tests/scheduler_driver_tests.cpp faf2e6c8ad17e07964b4340d0b340654b03f9086 
  src/tests/scheduler_http_api_tests.cpp 
80a2ef0af9a4c67deaef40e1f36343868ee4428f 
  src/tests/slave_authorization_tests.cpp 
6f120b6ab5d86c3737e979cdcdb5b6cca008d1ff 
  src/tests/slave_tests.cpp 701fab20091f9f7df020290b9f0a9db1dec92647 
  src/tests/status_update_manager_tests.cpp 
38d8913a5b33aa5325d0bc632c0a1d80480eddf8 
  src/tests/utils.cpp cc5259a720bb6451714a100b0451b473395e3650 

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


Testing
---

make & make check successfully!


Thanks,

Yongqiao Wang



Re: Review Request 51495: [1]Replace http::get with http::request.

2016-08-29 Thread Yongqiao Wang

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

(Updated Aug. 29, 2016, 11:39 p.m.)


Review request for mesos.


Summary (updated)
-

[1]Replace http::get with http::request.


Bugs: MESOS-4440
https://issues.apache.org/jira/browse/MESOS-4440


Repository: mesos


Description
---

Replace http::get with http::request.


Diffs
-

  3rdparty/libprocess/src/tests/benchmarks.cpp 
945007c38f96a66212f5ebdd700a117a4902a736 
  3rdparty/libprocess/src/tests/http_tests.cpp 
24b266df5f17e28e0c95326f5d1ea451952500e8 
  3rdparty/libprocess/src/tests/metrics_tests.cpp 
88526e67a20b7b58a6e14034215faa3ae9879fd0 
  3rdparty/libprocess/src/tests/process_tests.cpp 
b9feec7e34cffe19e49035f8865b150f79258f54 
  3rdparty/libprocess/src/tests/profiler_tests.cpp 
995bd02f6ecce484cd9b2aca355c2707d73d40b2 
  3rdparty/libprocess/src/tests/system_tests.cpp 
0f4d0424689522337806ba2227ec4330c700e17e 

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


Testing
---

make & make check successfully!


Thanks,

Yongqiao Wang



Review Request 51505: Replace http::get with http::request.

2016-08-29 Thread Yongqiao Wang

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

Review request for mesos.


Bugs: MESOS-4440
https://issues.apache.org/jira/browse/MESOS-4440


Repository: mesos


Description
---

Replace http::get with http::request.


Diffs
-

  src/tests/containerizer/docker_containerizer_tests.cpp 
28cd3fa66886dbdbae3fdeca77707147faafcb7a 
  src/tests/executor_http_api_tests.cpp 
fd322ee267b2f0d4bf250db15027d61f1fc74a57 
  src/tests/fault_tolerance_tests.cpp 5a9944cf459ab688907d95bbda09f464b37efd1e 
  src/tests/files_tests.cpp 78719da5938ff0de722f8411174817f708fd41f2 
  src/tests/gc_tests.cpp f3aec4a95ff231bed1283ef1408101c012cadea1 
  src/tests/health_check_tests.cpp 50a252b5267cbc3b21ddc75e1da86c4975f6faf1 
  src/tests/logging_tests.cpp 886dcd0d6d6ccf509c98578e8b86b1c6ecd5775f 
  src/tests/master_authorization_tests.cpp 
a6399f1b958705b87418b40d3771b25a37d49682 
  src/tests/master_maintenance_tests.cpp 
0820e637b0da69ebcfc8776c223c3bc8a4f1bc94 
  src/tests/master_quota_tests.cpp 48be7406181646c8cc1d169b82a4a4ca71cdf03b 
  src/tests/master_tests.cpp 6cde15fcd6ca8ec40438c75aed980e83f8de9b86 
  src/tests/metrics_tests.cpp 27fc35f3bc47fc2905f4ce400b1051307dcacb2e 
  src/tests/persistent_volume_endpoints_tests.cpp 
266c2a0ff4a99baa96a7c4980f076755603256a9 
  src/tests/registrar_tests.cpp b04fc92c66449f1094212a534899e16d5f6f01bd 
  src/tests/role_tests.cpp 162c9414a70723a212cfd39ac5c0b8325c3f3b5d 
  src/tests/scheduler_driver_tests.cpp faf2e6c8ad17e07964b4340d0b340654b03f9086 
  src/tests/scheduler_http_api_tests.cpp 
80a2ef0af9a4c67deaef40e1f36343868ee4428f 
  src/tests/slave_authorization_tests.cpp 
6f120b6ab5d86c3737e979cdcdb5b6cca008d1ff 
  src/tests/slave_tests.cpp 701fab20091f9f7df020290b9f0a9db1dec92647 
  src/tests/status_update_manager_tests.cpp 
38d8913a5b33aa5325d0bc632c0a1d80480eddf8 
  src/tests/utils.cpp cc5259a720bb6451714a100b0451b473395e3650 

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


Testing
---

make & make check successfully!


Thanks,

Yongqiao Wang



Review Request 51495: Replace http::get with http::request.

2016-08-29 Thread Yongqiao Wang

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

Review request for mesos.


Bugs: MESOS-4440
https://issues.apache.org/jira/browse/MESOS-4440


Repository: mesos


Description
---

Replace http::get with http::request.


Diffs
-

  3rdparty/libprocess/src/tests/benchmarks.cpp 
945007c38f96a66212f5ebdd700a117a4902a736 
  3rdparty/libprocess/src/tests/http_tests.cpp 
24b266df5f17e28e0c95326f5d1ea451952500e8 
  3rdparty/libprocess/src/tests/metrics_tests.cpp 
88526e67a20b7b58a6e14034215faa3ae9879fd0 
  3rdparty/libprocess/src/tests/process_tests.cpp 
b9feec7e34cffe19e49035f8865b150f79258f54 
  3rdparty/libprocess/src/tests/profiler_tests.cpp 
995bd02f6ecce484cd9b2aca355c2707d73d40b2 
  3rdparty/libprocess/src/tests/system_tests.cpp 
0f4d0424689522337806ba2227ec4330c700e17e 

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


Testing
---

make & make check successfully!


Thanks,

Yongqiao Wang



Review Request 51493: Add the query parameter in createRequest.

2016-08-29 Thread Yongqiao Wang

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

Review request for mesos.


Bugs: MESOS-4440
https://issues.apache.org/jira/browse/MESOS-4440


Repository: mesos


Description
---

Add the new 'query' parameter in createRequest method, which will be used by 
Http GET method later.


Diffs
-

  3rdparty/libprocess/include/process/http.hpp 
404196bb198c1ff958b55d72fb29c5fe92dba429 
  3rdparty/libprocess/src/http.cpp 298bd460afdeccd18e201d8a505b961fd4cf3d3e 

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


Testing
---

make & make check successfully.


Thanks,

Yongqiao Wang



Re: Review Request 46135: Fix the bug in MasterAllocatorTest/1.RebalancedForUpdatedWeights test.

2016-04-20 Thread Yongqiao Wang

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

(Updated April 20, 2016, 8 a.m.)


Review request for mesos, Adam B and Alexander Rukletsov.


Changes
---

Addressed the comments of Adam,alexr.


Bugs: MESOS-5146
https://issues.apache.org/jira/browse/MESOS-5146


Repository: mesos


Description (updated)
---

Fix the bug in MasterAllocatorTest/1.RebalancedForUpdatedWeights test.


Diffs (updated)
-

  src/tests/master_allocator_tests.cpp bb96b256d99254f2334a93d2f031ccefbed71845 

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


Testing
---

Make && Make check.

```
Yongs-MacBook-Pro:build yqwyq$ ./src/mesos-tests 
--gtest_filter=MasterAllocatorTest/0.RebalancedForUpdatedWeights
[==] Running 1 test from 1 test case.
[--] Global test environment set-up.
[--] 1 test from MasterAllocatorTest/0, where TypeParam = 
mesos::internal::master::allocator::MesosAllocator<mesos::internal::master::allocator::HierarchicalAllocatorProcess<mesos::internal::master::allocator::DRFSorter,
 mesos::internal::master::allocator::DRFSorter, 
mesos::internal::master::allocator::DRFSorter> >
[ RUN  ] MasterAllocatorTest/0.RebalancedForUpdatedWeights
[   OK ] MasterAllocatorTest/0.RebalancedForUpdatedWeights (385 ms)
[--] 1 test from MasterAllocatorTest/0 (386 ms total)

[--] Global test environment tear-down
[==] 1 test from 1 test case ran. (396 ms total)
[  PASSED  ] 1 test.

```


Thanks,

Yongqiao Wang



Re: Review Request 46135: Fix the bug in MasterAllocatorTest/1.RebalancedForUpdatedWeights test.

2016-04-20 Thread Yongqiao Wang


> On April 14, 2016, 10:45 a.m., Adam B wrote:
> > src/tests/master_allocator_tests.cpp, line 1604
> > <https://reviews.apache.org/r/46135/diff/1/?file=1342280#file1342280line1604>
> >
> > +1 to using Future with FutureSatisfy since you're not 
> > validating the contents of the Resources.

Add the logic to check the recovered resources, because we have checked the 
received resources after triggering a batch allocation below.


- Yongqiao


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


On April 13, 2016, 3:21 a.m., Yongqiao Wang wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/46135/
> ---
> 
> (Updated April 13, 2016, 3:21 a.m.)
> 
> 
> Review request for mesos, Adam B and Alexander Rukletsov.
> 
> 
> Bugs: MESOS-5146
> https://issues.apache.org/jira/browse/MESOS-5146
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Pause the clock and make sure all resources from rescinded
> offers are recovered before doing a batch allocation.
> 
> 
> Diffs
> -
> 
>   src/tests/master_allocator_tests.cpp 
> 404ff098baf89bf2a1c6e32424d591a6ea1a093c 
> 
> Diff: https://reviews.apache.org/r/46135/diff/
> 
> 
> Testing
> ---
> 
> Make && Make check.
> 
> ```
> Yongs-MacBook-Pro:build yqwyq$ ./src/mesos-tests 
> --gtest_filter=MasterAllocatorTest/0.RebalancedForUpdatedWeights
> [==] Running 1 test from 1 test case.
> [--] Global test environment set-up.
> [--] 1 test from MasterAllocatorTest/0, where TypeParam = 
> mesos::internal::master::allocator::MesosAllocator<mesos::internal::master::allocator::HierarchicalAllocatorProcess<mesos::internal::master::allocator::DRFSorter,
>  mesos::internal::master::allocator::DRFSorter, 
> mesos::internal::master::allocator::DRFSorter> >
> [ RUN  ] MasterAllocatorTest/0.RebalancedForUpdatedWeights
> [   OK ] MasterAllocatorTest/0.RebalancedForUpdatedWeights (385 ms)
> [--] 1 test from MasterAllocatorTest/0 (386 ms total)
> 
> [--] Global test environment tear-down
> [==] 1 test from 1 test case ran. (396 ms total)
> [  PASSED  ] 1 test.
> 
> ```
> 
> 
> Thanks,
> 
> Yongqiao Wang
> 
>



Re: Review Request 46135: Fix the bug in MasterAllocatorTest/1.RebalancedForUpdatedWeights test.

2016-04-20 Thread Yongqiao Wang


> On April 13, 2016, 9:27 a.m., Alexander Rukletsov wrote:
> > src/tests/master_allocator_tests.cpp, line 1604
> > <https://reviews.apache.org/r/46135/diff/1/?file=1342280#file1342280line1604>
> >
> > If you're not doing any checks with resources, you can use 
> > `Future` instead.
> 
> Yongqiao Wang wrote:
> They are different variable type, 'const mesos::Resources' can not 
> convert to 'const Nothing'.
> 
> Alexander Rukletsov wrote:
> You use `Future` together with `FutureSatisfy`. The difference 
> between `FutureArg` and `FutureSatisfy` is that the latter sets the future 
> when the method is invoked, while the former _additionally_ saves the actual 
> value of some argument. If you don't use this value later on, you don't have 
> to use `FutureArg`.

Add the logic to check the recovered resources, because we have checked the 
received resources after triggering a batch allocation below.


- Yongqiao


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


On April 13, 2016, 3:21 a.m., Yongqiao Wang wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/46135/
> ---
> 
> (Updated April 13, 2016, 3:21 a.m.)
> 
> 
> Review request for mesos, Adam B and Alexander Rukletsov.
> 
> 
> Bugs: MESOS-5146
> https://issues.apache.org/jira/browse/MESOS-5146
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Pause the clock and make sure all resources from rescinded
> offers are recovered before doing a batch allocation.
> 
> 
> Diffs
> -
> 
>   src/tests/master_allocator_tests.cpp 
> 404ff098baf89bf2a1c6e32424d591a6ea1a093c 
> 
> Diff: https://reviews.apache.org/r/46135/diff/
> 
> 
> Testing
> ---
> 
> Make && Make check.
> 
> ```
> Yongs-MacBook-Pro:build yqwyq$ ./src/mesos-tests 
> --gtest_filter=MasterAllocatorTest/0.RebalancedForUpdatedWeights
> [==] Running 1 test from 1 test case.
> [--] Global test environment set-up.
> [--] 1 test from MasterAllocatorTest/0, where TypeParam = 
> mesos::internal::master::allocator::MesosAllocator<mesos::internal::master::allocator::HierarchicalAllocatorProcess<mesos::internal::master::allocator::DRFSorter,
>  mesos::internal::master::allocator::DRFSorter, 
> mesos::internal::master::allocator::DRFSorter> >
> [ RUN  ] MasterAllocatorTest/0.RebalancedForUpdatedWeights
> [   OK ] MasterAllocatorTest/0.RebalancedForUpdatedWeights (385 ms)
> [--] 1 test from MasterAllocatorTest/0 (386 ms total)
> 
> [--] Global test environment tear-down
> [==] 1 test from 1 test case ran. (396 ms total)
> [  PASSED  ] 1 test.
> 
> ```
> 
> 
> Thanks,
> 
> Yongqiao Wang
> 
>



Re: Review Request 46139: Add positive tests for /weights endpoint.

2016-04-19 Thread Yongqiao Wang


> On April 14, 2016, 11:09 a.m., Adam B wrote:
> > src/tests/dynamic_weights_tests.cpp, lines 168-179
> > <https://reviews.apache.org/r/46139/diff/1/?file=1342372#file1342372line168>
> >
> > Why are role2 and role1 in reverse order? Is this always the case? Why 
> > wouldn't it be forward-alphabetical order?

It cannot ensure the order, because weights are stored in a hashmap. I have 
changed the check logic.


- Yongqiao


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


On April 13, 2016, 6:10 a.m., Yongqiao Wang wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/46139/
> ---
> 
> (Updated April 13, 2016, 6:10 a.m.)
> 
> 
> Review request for mesos and Adam B.
> 
> 
> Bugs: MESOS-4316
> https://issues.apache.org/jira/browse/MESOS-4316
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Add positive tests for /weights endpoint.
> 
> 
> Diffs
> -
> 
>   src/tests/dynamic_weights_tests.cpp 
> f89b89dd2553220161e28ec4784eb0bbdfdb65fe 
> 
> Diff: https://reviews.apache.org/r/46139/diff/
> 
> 
> Testing
> ---
> 
> make && make check.
> 
> Yongs-MacBook-Pro:build yqwyq$ ./src/mesos-tests 
> --gtest_filter=DynamicWeightsTest.*
> [==] Running 13 tests from 1 test case.
> [--] Global test environment set-up.
> [--] 13 tests from DynamicWeightsTest
> [ RUN  ] DynamicWeightsTest.PutInvalidRequest
> [   OK ] DynamicWeightsTest.PutInvalidRequest (89 ms)
> [ RUN  ] DynamicWeightsTest.ZeroWeight
> [   OK ] DynamicWeightsTest.ZeroWeight (39 ms)
> [ RUN  ] DynamicWeightsTest.NegativeWeight
> [   OK ] DynamicWeightsTest.NegativeWeight (46 ms)
> [ RUN  ] DynamicWeightsTest.NonNumericWeight
> [   OK ] DynamicWeightsTest.NonNumericWeight (39 ms)
> [ RUN  ] DynamicWeightsTest.MissingRole
> [   OK ] DynamicWeightsTest.MissingRole (37 ms)
> [ RUN  ] DynamicWeightsTest.UnknownRole
> [   OK ] DynamicWeightsTest.UnknownRole (32 ms)
> [ RUN  ] DynamicWeightsTest.UpdateWeightsWithExplictRoles
> [   OK ] DynamicWeightsTest.UpdateWeightsWithExplictRoles (44 ms)
> [ RUN  ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest
> [   OK ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest (40 ms)
> [ RUN  ] DynamicWeightsTest.UnauthenticatedQueryWeightRequest
> [   OK ] DynamicWeightsTest.UnauthenticatedQueryWeightRequest (35 ms)
> [ RUN  ] DynamicWeightsTest.AuthorizedWeightUpdateRequest
> [   OK ] DynamicWeightsTest.AuthorizedWeightUpdateRequest (42 ms)
> [ RUN  ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal
> [   OK ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal 
> (41 ms)
> [ RUN  ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest
> [   OK ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest (40 ms)
> [ RUN  ] DynamicWeightsTest.RecoveredWeightsFromRegistry
> [   OK ] DynamicWeightsTest.RecoveredWeightsFromRegistry (135 ms)
> [--] 13 tests from DynamicWeightsTest (659 ms total)
> 
> [--] Global test environment tear-down
> [==] 13 tests from 1 test case ran. (669 ms total)
> [  PASSED  ] 13 tests.
> 
> 
> Thanks,
> 
> Yongqiao Wang
> 
>



Re: Review Request 46135: Fix the bug in MasterAllocatorTest/1.RebalancedForUpdatedWeights test.

2016-04-13 Thread Yongqiao Wang


> On April 13, 2016, 9:27 a.m., Alexander Rukletsov wrote:
> > src/tests/master_allocator_tests.cpp, line 1637
> > <https://reviews.apache.org/r/46135/diff/1/?file=1342280#file1342280line1637>
> >
> > You don't need this `settle()`.

According to my understanding, call Clock::settle() after Clock::advance(), 
then it can ensure allocate() is executed before do the following check. So I 
think it is needed.


> On April 13, 2016, 9:27 a.m., Alexander Rukletsov wrote:
> > src/tests/master_allocator_tests.cpp, line 1604
> > <https://reviews.apache.org/r/46135/diff/1/?file=1342280#file1342280line1604>
> >
> > If you're not doing any checks with resources, you can use 
> > `Future` instead.

They are different variable type, 'const mesos::Resources' can not convert to 
'const Nothing'.


- Yongqiao


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


On April 13, 2016, 3:21 a.m., Yongqiao Wang wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/46135/
> ---
> 
> (Updated April 13, 2016, 3:21 a.m.)
> 
> 
> Review request for mesos, Adam B and Alexander Rukletsov.
> 
> 
> Bugs: MESOS-5146
> https://issues.apache.org/jira/browse/MESOS-5146
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Pause the clock and make sure all resources from rescinded
> offers are recovered before doing a batch allocation.
> 
> 
> Diffs
> -
> 
>   src/tests/master_allocator_tests.cpp 
> 404ff098baf89bf2a1c6e32424d591a6ea1a093c 
> 
> Diff: https://reviews.apache.org/r/46135/diff/
> 
> 
> Testing
> ---
> 
> Make && Make check.
> 
> ```
> Yongs-MacBook-Pro:build yqwyq$ ./src/mesos-tests 
> --gtest_filter=MasterAllocatorTest/0.RebalancedForUpdatedWeights
> [==] Running 1 test from 1 test case.
> [--] Global test environment set-up.
> [--] 1 test from MasterAllocatorTest/0, where TypeParam = 
> mesos::internal::master::allocator::MesosAllocator<mesos::internal::master::allocator::HierarchicalAllocatorProcess<mesos::internal::master::allocator::DRFSorter,
>  mesos::internal::master::allocator::DRFSorter, 
> mesos::internal::master::allocator::DRFSorter> >
> [ RUN  ] MasterAllocatorTest/0.RebalancedForUpdatedWeights
> [   OK ] MasterAllocatorTest/0.RebalancedForUpdatedWeights (385 ms)
> [--] 1 test from MasterAllocatorTest/0 (386 ms total)
> 
> [--] Global test environment tear-down
> [==] 1 test from 1 test case ran. (396 ms total)
> [  PASSED  ] 1 test.
> 
> ```
> 
> 
> Thanks,
> 
> Yongqiao Wang
> 
>



Review Request 46139: Add positive tests for /weights endpoint.

2016-04-13 Thread Yongqiao Wang

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

Review request for mesos and Adam B.


Bugs: MESOS-4316
https://issues.apache.org/jira/browse/MESOS-4316


Repository: mesos


Description
---

Add positive tests for /weights endpoint.


Diffs
-

  src/tests/dynamic_weights_tests.cpp f89b89dd2553220161e28ec4784eb0bbdfdb65fe 

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


Testing
---

make && make check.

Yongs-MacBook-Pro:build yqwyq$ ./src/mesos-tests 
--gtest_filter=DynamicWeightsTest.*
[==] Running 13 tests from 1 test case.
[--] Global test environment set-up.
[--] 13 tests from DynamicWeightsTest
[ RUN  ] DynamicWeightsTest.PutInvalidRequest
[   OK ] DynamicWeightsTest.PutInvalidRequest (89 ms)
[ RUN  ] DynamicWeightsTest.ZeroWeight
[   OK ] DynamicWeightsTest.ZeroWeight (39 ms)
[ RUN  ] DynamicWeightsTest.NegativeWeight
[   OK ] DynamicWeightsTest.NegativeWeight (46 ms)
[ RUN  ] DynamicWeightsTest.NonNumericWeight
[   OK ] DynamicWeightsTest.NonNumericWeight (39 ms)
[ RUN  ] DynamicWeightsTest.MissingRole
[   OK ] DynamicWeightsTest.MissingRole (37 ms)
[ RUN  ] DynamicWeightsTest.UnknownRole
[   OK ] DynamicWeightsTest.UnknownRole (32 ms)
[ RUN  ] DynamicWeightsTest.UpdateWeightsWithExplictRoles
[   OK ] DynamicWeightsTest.UpdateWeightsWithExplictRoles (44 ms)
[ RUN  ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest
[   OK ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest (40 ms)
[ RUN  ] DynamicWeightsTest.UnauthenticatedQueryWeightRequest
[   OK ] DynamicWeightsTest.UnauthenticatedQueryWeightRequest (35 ms)
[ RUN  ] DynamicWeightsTest.AuthorizedWeightUpdateRequest
[   OK ] DynamicWeightsTest.AuthorizedWeightUpdateRequest (42 ms)
[ RUN  ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal
[   OK ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal 
(41 ms)
[ RUN  ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest
[   OK ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest (40 ms)
[ RUN  ] DynamicWeightsTest.RecoveredWeightsFromRegistry
[   OK ] DynamicWeightsTest.RecoveredWeightsFromRegistry (135 ms)
[--] 13 tests from DynamicWeightsTest (659 ms total)

[--] Global test environment tear-down
[==] 13 tests from 1 test case ran. (669 ms total)
[  PASSED  ] 13 tests.


Thanks,

Yongqiao Wang



Review Request 46135: Fix the bug in MasterAllocatorTest/1.RebalancedForUpdatedWeights test.

2016-04-12 Thread Yongqiao Wang

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

Review request for mesos, Adam B and Alexander Rukletsov.


Bugs: MESOS-5146
https://issues.apache.org/jira/browse/MESOS-5146


Repository: mesos


Description
---

Pause the clock and make sure all resources from rescinded
offers are recovered before doing a batch allocation.


Diffs
-

  src/tests/master_allocator_tests.cpp 404ff098baf89bf2a1c6e32424d591a6ea1a093c 

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


Testing
---

Make && Make check.

```
Yongs-MacBook-Pro:build yqwyq$ ./src/mesos-tests 
--gtest_filter=MasterAllocatorTest/0.RebalancedForUpdatedWeights
[==] Running 1 test from 1 test case.
[--] Global test environment set-up.
[--] 1 test from MasterAllocatorTest/0, where TypeParam = 
mesos::internal::master::allocator::MesosAllocator<mesos::internal::master::allocator::HierarchicalAllocatorProcess<mesos::internal::master::allocator::DRFSorter,
 mesos::internal::master::allocator::DRFSorter, 
mesos::internal::master::allocator::DRFSorter> >
[ RUN  ] MasterAllocatorTest/0.RebalancedForUpdatedWeights
[   OK ] MasterAllocatorTest/0.RebalancedForUpdatedWeights (385 ms)
[--] 1 test from MasterAllocatorTest/0 (386 ms total)

[--] Global test environment tear-down
[==] 1 test from 1 test case ran. (396 ms total)
[  PASSED  ] 1 test.

```


Thanks,

Yongqiao Wang



Re: Review Request 45863: Updated error messages in weights handler.

2016-04-10 Thread Yongqiao Wang

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


Fix it, then Ship it!





src/master/weights_handler.cpp (line 104)
<https://reviews.apache.org/r/45863/#comment191446>

Mesos operator can update weight for mutilple roles at one time, so it is 
better to show which role's weight is not positive to make this error message 
more clearly.


- Yongqiao Wang


On April 7, 2016, 10:50 a.m., Alexander Rukletsov wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/45863/
> ---
> 
> (Updated April 7, 2016, 10:50 a.m.)
> 
> 
> Review request for mesos, Yongqiao Wang and Joerg Schad.
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> While writing log or error messages we adhere the following style:
>   * No period at the end (there are exceptions though, e.g., one is
> when constructing request responses.
>   * When splitting a string over multiple lines, put a space at the
> beginning of the following line in contrast to the end of the
> previous line.
> 
> 
> Diffs
> -
> 
>   src/master/weights_handler.cpp e88bf2ab67ccadf35879b92f3280298a43d7cd0e 
> 
> Diff: https://reviews.apache.org/r/45863/diff/
> 
> 
> Testing
> ---
> 
> On Mac OS 10.10.4: 
> `make check`
> 
> 
> Thanks,
> 
> Alexander Rukletsov
> 
>



Re: Review Request 45202: Add test for rescinding offer trriggered by updating weights.

2016-03-31 Thread Yongqiao Wang

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

(Updated March 31, 2016, 7:15 a.m.)


Review request for mesos and Adam B.


Changes
---

Addressed comments of adam.


Bugs: MESOS-4881
https://issues.apache.org/jira/browse/MESOS-4881


Repository: mesos


Description
---

Add test for rescinding offer trriggered by updating weights.


Diffs (updated)
-

  src/tests/dynamic_weights_tests.cpp 6357cf42ec59c1388e95d6d808978918d5cd4a78 
  src/tests/master_allocator_tests.cpp b41ba2bda4d680f6fc42f525719973d56c11fe31 
  src/tests/mesos.hpp a35371d7c1fcb9dbbe8a18c80522deb6bf789ad8 

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


Testing
---

make && make check.

$ ./src/mesos-tests 
--gtest_filter=MasterAllocatorTest/0.RebalancedForUpdatedWeights
[==] Running 1 test from 1 test case.
[--] Global test environment set-up.
[--] 1 test from MasterAllocatorTest/0, where TypeParam = 
mesos::internal::master::allocator::MesosAllocator<mesos::internal::master::allocator::HierarchicalAllocatorProcess<mesos::internal::master::allocator::DRFSorter,
 mesos::internal::master::allocator::DRFSorter> >
[ RUN  ] MasterAllocatorTest/0.RebalancedForUpdatedWeights
[   OK ] MasterAllocatorTest/0.RebalancedForUpdatedWeights (1059 ms)
[--] 1 test from MasterAllocatorTest/0 (1059 ms total)

[--] Global test environment tear-down
[==] 1 test from 1 test case ran. (1070 ms total)
[  PASSED  ] 1 test.


Thanks,

Yongqiao Wang



Re: Review Request 45202: Add test for rescinding offer trriggered by updating weights.

2016-03-31 Thread Yongqiao Wang


> On March 30, 2016, 11:58 a.m., Adam B wrote:
> > src/tests/master_allocator_tests.cpp, line 1519
> > <https://reviews.apache.org/r/45202/diff/2/?file=1314587#file1314587line1519>
> >
> > Don't you at least know that one of these parameters is the master's 
> > pid?

Do you mean the parameters of addSlave function in allocator interface? if yes, 
then master's pid is not one of them. Cloud you help to make this comment 
clearly? Thanks.


- Yongqiao


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


On March 25, 2016, 9:13 a.m., Yongqiao Wang wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/45202/
> ---
> 
> (Updated March 25, 2016, 9:13 a.m.)
> 
> 
> Review request for mesos and Adam B.
> 
> 
> Bugs: MESOS-4881
> https://issues.apache.org/jira/browse/MESOS-4881
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Add test for rescinding offer trriggered by updating weights.
> 
> 
> Diffs
> -
> 
>   src/tests/dynamic_weights_tests.cpp 
> 6357cf42ec59c1388e95d6d808978918d5cd4a78 
>   src/tests/master_allocator_tests.cpp 
> b41ba2bda4d680f6fc42f525719973d56c11fe31 
>   src/tests/mesos.hpp aaef158e5784ce077ef60996ebbeb77b356b7c57 
> 
> Diff: https://reviews.apache.org/r/45202/diff/
> 
> 
> Testing
> ---
> 
> make && make check.
> 
> $ ./src/mesos-tests 
> --gtest_filter=MasterAllocatorTest/0.RebalancedForUpdatedWeights
> [==] Running 1 test from 1 test case.
> [--] Global test environment set-up.
> [--] 1 test from MasterAllocatorTest/0, where TypeParam = 
> mesos::internal::master::allocator::MesosAllocator<mesos::internal::master::allocator::HierarchicalAllocatorProcess<mesos::internal::master::allocator::DRFSorter,
>  mesos::internal::master::allocator::DRFSorter> >
> [ RUN  ] MasterAllocatorTest/0.RebalancedForUpdatedWeights
> [   OK ] MasterAllocatorTest/0.RebalancedForUpdatedWeights (1059 ms)
> [------] 1 test from MasterAllocatorTest/0 (1059 ms total)
> 
> [--] Global test environment tear-down
> [==] 1 test from 1 test case ran. (1070 ms total)
> [  PASSED  ] 1 test.
> 
> 
> Thanks,
> 
> Yongqiao Wang
> 
>



Re: Review Request 45202: Add test for rescinding offer trriggered by updating weights.

2016-03-25 Thread Yongqiao Wang

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

(Updated March 25, 2016, 9:13 a.m.)


Review request for mesos and Adam B.


Changes
---

Addressed the comments of adam.


Bugs: MESOS-4881
https://issues.apache.org/jira/browse/MESOS-4881


Repository: mesos


Description
---

Add test for rescinding offer trriggered by updating weights.


Diffs (updated)
-

  src/tests/dynamic_weights_tests.cpp 6357cf42ec59c1388e95d6d808978918d5cd4a78 
  src/tests/master_allocator_tests.cpp b41ba2bda4d680f6fc42f525719973d56c11fe31 
  src/tests/mesos.hpp aaef158e5784ce077ef60996ebbeb77b356b7c57 

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


Testing
---

make && make check.

$ ./src/mesos-tests 
--gtest_filter=MasterAllocatorTest/0.RebalancedForUpdatedWeights
[==] Running 1 test from 1 test case.
[--] Global test environment set-up.
[--] 1 test from MasterAllocatorTest/0, where TypeParam = 
mesos::internal::master::allocator::MesosAllocator<mesos::internal::master::allocator::HierarchicalAllocatorProcess<mesos::internal::master::allocator::DRFSorter,
 mesos::internal::master::allocator::DRFSorter> >
[ RUN  ] MasterAllocatorTest/0.RebalancedForUpdatedWeights
[   OK ] MasterAllocatorTest/0.RebalancedForUpdatedWeights (1059 ms)
[--] 1 test from MasterAllocatorTest/0 (1059 ms total)

[--] Global test environment tear-down
[==] 1 test from 1 test case ran. (1070 ms total)
[  PASSED  ] 1 test.


Thanks,

Yongqiao Wang



Re: Review Request 44450: Rescind all outstanding offers to satisfy weights update.

2016-03-25 Thread Yongqiao Wang

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

(Updated March 25, 2016, 8:20 a.m.)


Review request for mesos, Adam B and Alexander Rukletsov.


Changes
---

Addressed comments of Adam.


Bugs: MESOS-4881
https://issues.apache.org/jira/browse/MESOS-4881


Repository: mesos


Description
---

Rescind all outstanding offers to satisfy weights update.


Diffs (updated)
-

  src/master/master.hpp 124d43931a5c8a00ee0aaa604feb1761795209f2 
  src/master/weights_handler.cpp c9a1b0d9adbeb1e165999cdbb4f295b24f10b18f 

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


Testing (updated)
---

Make && Make check.

Manual test steps:

- Start Mesos master:
$ ./bin/mesos-master.sh --ip=127.0.0.1 --work_dir=/tmp/mesos-master

- Start Mesos slave:
$ ./bin/mesos-slave.sh --master=127.0.0.1:5050

- Register a framwork with `curl`
$ curl -v http://127.0.0.1:5050/api/v1/scheduler -H "Content-type: 
application/json" -X POST -d @subscribe.json
$  cat subscribe.json
{
   "type": "SUBSCRIBE",

   "subscribe" : {
  "framework_info": {
  "user" :  "root",
  "name" :  "comsumer c1 HTTP Framework",
  "role" :  "mesos",
  "principal":"wyq"
  },

  "force" : true
  }
}

And this framework will receive an offer:
{"subscribed":{"framework_id":{"value":"7de42f40-2ddd-44a1-a4ff-4af932d25e02-"}},"type":"SUBSCRIBED"}20
{"type":"HEARTBEAT"}680
{"offers":{"offers":[{"agent_id":{"value":"7de42f40-2ddd-44a1-a4ff-4af932d25e02-S0"},"framework_id":{"value":"7de42f40-2ddd-44a1-a4ff-4af932d25e02-"},"hostname":"192.168.1.5","id":{"value":"7de42f40-2ddd-44a1-a4ff-4af932d25e02-O0"},"resources":[{"name":"cpus","role":"*","scalar":{"value":8.0},"type":"SCALAR"},{"name":"mem","role":"*","scalar":{"value":15360.0},"type":"SCALAR"},{"name":"disk","role":"*","scalar":{"value":470832.0},"type":"SCALAR"},{"name":"ports","ranges":{"range":[{"begin":31000,"end":32000}]},"role":"*","type":"RANGES"}],"url":{"address":{"hostname":"192.168.1.5","ip":"192.168.1.5","port":5051},"path":"\/slave(1)","scheme":"http"}}]},"type":"OFFERS"}20
{"type":"HEARTBEAT"}20

- Update the weight of role `mesos`
$ curl --data "[{\"weight\":1.8,\"role\":\"mesos\"}]" -X PUT 
http://127.0.0.1:5050/weights

Receive an rescind offer, and a new offer received:
{"rescind":{"offer_id":{"value":"7de42f40-2ddd-44a1-a4ff-4af932d25e02-O0"}},"type":"RESCIND"}680
{"offers":{"offers":[{"agent_id":{"value":"7de42f40-2ddd-44a1-a4ff-4af932d25e02-S0"},"framework_id":{"value":"7de42f40-2ddd-44a1-a4ff-4af932d25e02-"},"hostname":"192.168.1.5","id":{"value":"7de42f40-2ddd-44a1-a4ff-4af932d25e02-O1"},"resources":[{"name":"cpus","role":"*","scalar":{"value":8.0},"type":"SCALAR"},{"name":"mem","role":"*","scalar":{"value":15360.0},"type":"SCALAR"},{"name":"disk","role":"*","scalar":{"value":470832.0},"type":"SCALAR"},{"name":"ports","ranges":{"range":[{"begin":31000,"end":32000}]},"role":"*","type":"RANGES"}],"url":{"address":{"hostname":"192.168.1.5","ip":"192.168.1.5","port":5051},"path":"\/slave(1)","scheme":"http"}}]},"type":"OFFERS"}20
{"type":"HEARTBEAT"}20

- Update the weight of role `mesos1`
$ curl --data "[{\"weight\":2.8,\"role\":\"mesos1\"}]" -X PUT 
http://127.0.0.1:5050/weights

- The outstanding offer will not be rescinded.


Thanks,

Yongqiao Wang



Re: Review Request 44511: Add registry tests for /weights endpoint.

2016-03-24 Thread Yongqiao Wang

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

(Updated March 24, 2016, 8:35 a.m.)


Review request for mesos and Adam B.


Changes
---

Adressed comments of Adam.


Bugs: MESOS-4797
https://issues.apache.org/jira/browse/MESOS-4797


Repository: mesos


Description
---

Add registry tests for /weights endpoint.


Diffs (updated)
-

  src/tests/dynamic_weights_tests.cpp ee0c4b1cc20e76a35a8e4e445f6827a1fc33e6c6 
  src/tests/registrar_tests.cpp c330af2a190282e159d9ab477cdc36a7881842cd 

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


Testing
---

Add three sub tests for /weights endpoint registry in this patch:

1. Tests whether the weights replicated log is initialized with the `--weights` 
flag when bootstrapping the cluster.
2. Tests whether the weights replicated log can be updated with `/weights` 
endpoint.
3. Tests whether the `--weights` flag is ignored and use the registry value 
instead when Mesos master subsequently starts with `--weights` flag still 
specified.

./src/mesos-tests --gtest_filter=Strict/RegistrarTest.UpdateWeights/*
[==] Running 2 tests from 1 test case.
[--] Global test environment set-up.
[--] 2 tests from Strict/RegistrarTest
[ RUN  ] Strict/RegistrarTest.UpdateWeights/0
[   OK ] Strict/RegistrarTest.UpdateWeights/0 (103 ms)
[ RUN  ] Strict/RegistrarTest.UpdateWeights/1
[   OK ] Strict/RegistrarTest.UpdateWeights/1 (67 ms)
[--] 2 tests from Strict/RegistrarTest (171 ms total)

[--] Global test environment tear-down
[==] 2 tests from 1 test case ran. (178 ms total)
[  PASSED  ] 2 tests.


make && make check.


Thanks,

Yongqiao Wang



Re: Review Request 44512: Support to get weights info by /weights.

2016-03-23 Thread Yongqiao Wang


> On March 21, 2016, 9:03 a.m., Adam B wrote:
> > Good start, but you're missing a few things. Are these coming in subsequent 
> > patches?
> > - Authentication for GET requests
> > - Tests for GETs
> > - Documentation updates
> 
> Yongqiao Wang wrote:
> I will add a separated patch for GET requet test.

I have posted a separated patch for authentication test of /weight GET request: 
https://reviews.apache.org/r/45203/


- Yongqiao


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


On March 22, 2016, 10:02 a.m., Yongqiao Wang wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/44512/
> ---
> 
> (Updated March 22, 2016, 10:02 a.m.)
> 
> 
> Review request for mesos and Adam B.
> 
> 
> Bugs: MESOS-4316
> https://issues.apache.org/jira/browse/MESOS-4316
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Support to get weights info by /weights.
> 
> 
> Diffs
> -
> 
>   docs/weights.md a94251340d5193c9474b2e5e85328d62fe4edd8f 
>   src/master/http.cpp bfea8fa811c24d37b2d7a8109728e1f40217e02f 
>   src/master/master.hpp 124d43931a5c8a00ee0aaa604feb1761795209f2 
>   src/master/weights_handler.cpp c9a1b0d9adbeb1e165999cdbb4f295b24f10b18f 
> 
> Diff: https://reviews.apache.org/r/44512/diff/
> 
> 
> Testing
> ---
> 
> make && make check.
> 
> $ (./mesos-master.sh --ip=127.0.0.1 --work_dir=/tmp/mesos-master  
> --authenticate_http --credentials=/opt/credentials.json  >> 
> /tmp/mesos-master.log 2>&1 &)
> 
> $ curl --user framework1:secret_string1 http://localhost:5050/weights | 
> python -mjson.tool
> []
> 
> $ curl --user framework1:secret_string1 --data 
> "[{\"weight\":1.8,\"role\":\"role1\"},{\"weight\":1.0,\"role\":\"role2\"},{\"weight\":3.4,\"role\":\"role3\"}]"
>  -X PUT http://127.0.0.1:5050/weights
> 
> $ curl --user framework1:secret_string1 http://localhost:5050/weights | 
> python -mjson.tool
> [
> {
> "role": "role3",
> "weight": 3.4
> },
> {
> "role": "role2",
> "weight": 1.0
> },
> {
> "role": "role1",
> "weight": 1.8
> }
> ]
> 
> 
> Thanks,
> 
> Yongqiao Wang
> 
>



Review Request 45203: Add authentication test for /weights GET request.

2016-03-23 Thread Yongqiao Wang

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

Review request for mesos and Adam B.


Bugs: MESOS-4316
https://issues.apache.org/jira/browse/MESOS-4316


Repository: mesos


Description
---

Add authentication  test for /weights GET request.


Diffs
-

  src/tests/dynamic_weights_tests.cpp ee0c4b1cc20e76a35a8e4e445f6827a1fc33e6c6 

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


Testing
---

make && make check.

$ ./src/mesos-tests 
--gtest_filter=DynamicWeightsTest.UnauthenticatedQueryWeightRequest
[==] Running 1 test from 1 test case.
[--] Global test environment set-up.
[--] 1 test from DynamicWeightsTest
[ RUN  ] DynamicWeightsTest.UnauthenticatedQueryWeightRequest
[   OK ] DynamicWeightsTest.UnauthenticatedQueryWeightRequest (81 ms)
[--] 1 test from DynamicWeightsTest (81 ms total)

[--] Global test environment tear-down
[==] 1 test from 1 test case ran. (91 ms total)
[  PASSED  ] 1 test.


Thanks,

Yongqiao Wang



Re: Review Request 44450: Rescind all outstanding offers to satisfy weights update.

2016-03-23 Thread Yongqiao Wang


> On March 21, 2016, 8 a.m., Adam B wrote:
> > Could you write a test where one framework hoards its share of the 
> > resources (doesn't accept/decline them), then weights are updated to 
> > increase another framework's share, and the other framework actually gets 
> > offers to cover its share?

A new patch is submitted for this test: https://reviews.apache.org/r/45202/


- Yongqiao


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


On March 23, 2016, 1:59 a.m., Yongqiao Wang wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/44450/
> ---
> 
> (Updated March 23, 2016, 1:59 a.m.)
> 
> 
> Review request for mesos, Adam B and Alexander Rukletsov.
> 
> 
> Bugs: MESOS-4881
> https://issues.apache.org/jira/browse/MESOS-4881
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Rescind all outstanding offers to satisfy weights update.
> 
> 
> Diffs
> -
> 
>   src/master/master.hpp 124d43931a5c8a00ee0aaa604feb1761795209f2 
>   src/master/weights_handler.cpp c9a1b0d9adbeb1e165999cdbb4f295b24f10b18f 
> 
> Diff: https://reviews.apache.org/r/44450/diff/
> 
> 
> Testing
> ---
> 
> Make && Make check.
> 
> Manual test steps:
> 
> - Start Mesos master:
> $ ./bin/mesos-master.sh --ip=127.0.0.1 --work_dir=/tmp/mesos-master
> 
> - Start Mesos slave:
> $ ./bin/mesos-slave.sh --master=127.0.0.1:5050
> 
> - Register a framwork with `curl`
> $ curl -v http://127.0.0.1:5050/api/v1/scheduler -H "Content-type: 
> application/json" -X POST -d @subscribe.json
> $  cat subscribe.json
> {
>"type": "SUBSCRIBE",
> 
>"subscribe" : {
>   "framework_info": {
>   "user" :  "root",
>   "name" :  "comsumer c1 HTTP Framework",
> "role" :  "mesos",
> "principal":"wyq"
>   },
> 
>   "force" : true
>   }
> }
> 
> And this framework will receive an offer:
> {"subscribed":{"framework_id":{"value":"7de42f40-2ddd-44a1-a4ff-4af932d25e02-"}},"type":"SUBSCRIBED"}20
> {"type":"HEARTBEAT"}680
> {"offers":{"offers":[{"agent_id":{"value":"7de42f40-2ddd-44a1-a4ff-4af932d25e02-S0"},"framework_id":{"value":"7de42f40-2ddd-44a1-a4ff-4af932d25e02-"},"hostname":"192.168.1.5","id":{"value":"7de42f40-2ddd-44a1-a4ff-4af932d25e02-O0"},"resources":[{"name":"cpus","role":"*","scalar":{"value":8.0},"type":"SCALAR"},{"name":"mem","role":"*","scalar":{"value":15360.0},"type":"SCALAR"},{"name":"disk","role":"*","scalar":{"value":470832.0},"type":"SCALAR"},{"name":"ports","ranges":{"range":[{"begin":31000,"end":32000}]},"role":"*","type":"RANGES"}],"url":{"address":{"hostname":"192.168.1.5","ip":"192.168.1.5","port":5051},"path":"\/slave(1)","scheme":"http"}}]},"type":"OFFERS"}20
> {"type":"HEARTBEAT"}20
> 
> - Update the weight of role `mesos`
> $ curl --data "[{\"weight\":1.8,\"role\":\"mesos\"}]" -X PUT 
> http://127.0.0.1:5050/weights
> 
> Receive an rescind offer, and a new offer received:
> {"rescind":{"offer_id":{"value":"7de42f40-2ddd-44a1-a4ff-4af932d25e02-O0"}},"type":"RESCIND"}680
> {"offers":{"offers":[{"agent_id":{"value":"7de42f40-2ddd-44a1-a4ff-4af932d25e02-S0"},"framework_id":{"value":"7de42f40-2ddd-44a1-a4ff-4af932d25e02-"},"hostname":"192.168.1.5","id":{"value":"7de42f40-2ddd-44a1-a4ff-4af932d25e02-O1"},"resources":[{"name":"cpus","role":"*","scalar":{"value":8.0},"type":"SCALAR"},{"name":"mem","role":"*","scalar":{"value":15360.0},"type":"SCALAR"},{"name":"disk","role":"*","scalar":{"value":470832.0},"type":"SCALAR"},{"name":"ports","ranges":{"range":[{"begin":31000,"end":32000}]},"role":"*","type":"RANGES"}],"url":{"address":{"hostname":"192.168.1.5","ip":"192.168.1.5","port":5051},"path":"\/slave(1)","scheme":"http"}}]},"type":"OFFERS"}20
> {"type":"HEARTBEAT"}20
> 
> - Update the weight of role `mesos1`
> $ curl --data "[{\"weight\":2.8,\"role\":\"mesos1\"}]" -X PUT 
> http://127.0.0.1:5050/weights
> 
> - The outstanding offer will not be rescinded.
> 
> 
> (TODO) I will add couple of tests for this patch in another JIRA.
> 
> 
> Thanks,
> 
> Yongqiao Wang
> 
>



Review Request 45202: Add test for rescinding offer trriggered by updating weights.

2016-03-23 Thread Yongqiao Wang

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

Review request for mesos and Adam B.


Bugs: MESOS-4881
https://issues.apache.org/jira/browse/MESOS-4881


Repository: mesos


Description
---

Add test for rescinding offer trriggered by updating weights.


Diffs
-

  src/tests/dynamic_weights_tests.cpp ee0c4b1cc20e76a35a8e4e445f6827a1fc33e6c6 
  src/tests/master_allocator_tests.cpp b41ba2bda4d680f6fc42f525719973d56c11fe31 
  src/tests/mesos.hpp aaef158e5784ce077ef60996ebbeb77b356b7c57 

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


Testing
---

make && make check.

$ ./src/mesos-tests 
--gtest_filter=MasterAllocatorTest/0.RebalancedForUpdatedWeights
[==] Running 1 test from 1 test case.
[--] Global test environment set-up.
[--] 1 test from MasterAllocatorTest/0, where TypeParam = 
mesos::internal::master::allocator::MesosAllocator<mesos::internal::master::allocator::HierarchicalAllocatorProcess<mesos::internal::master::allocator::DRFSorter,
 mesos::internal::master::allocator::DRFSorter> >
[ RUN  ] MasterAllocatorTest/0.RebalancedForUpdatedWeights
[   OK ] MasterAllocatorTest/0.RebalancedForUpdatedWeights (1059 ms)
[--] 1 test from MasterAllocatorTest/0 (1059 ms total)

[--] Global test environment tear-down
[==] 1 test from 1 test case ran. (1070 ms total)
[  PASSED  ] 1 test.


Thanks,

Yongqiao Wang



Re: Review Request 44450: Rescind all outstanding offers to satisfy weights update.

2016-03-22 Thread Yongqiao Wang

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

(Updated March 23, 2016, 1:59 a.m.)


Review request for mesos, Adam B and Alexander Rukletsov.


Bugs: MESOS-4881
https://issues.apache.org/jira/browse/MESOS-4881


Repository: mesos


Description
---

Rescind all outstanding offers to satisfy weights update.


Diffs
-

  src/master/master.hpp 124d43931a5c8a00ee0aaa604feb1761795209f2 
  src/master/weights_handler.cpp c9a1b0d9adbeb1e165999cdbb4f295b24f10b18f 

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


Testing
---

Make && Make check.

Manual test steps:

- Start Mesos master:
$ ./bin/mesos-master.sh --ip=127.0.0.1 --work_dir=/tmp/mesos-master

- Start Mesos slave:
$ ./bin/mesos-slave.sh --master=127.0.0.1:5050

- Register a framwork with `curl`
$ curl -v http://127.0.0.1:5050/api/v1/scheduler -H "Content-type: 
application/json" -X POST -d @subscribe.json
$  cat subscribe.json
{
   "type": "SUBSCRIBE",

   "subscribe" : {
  "framework_info": {
  "user" :  "root",
  "name" :  "comsumer c1 HTTP Framework",
  "role" :  "mesos",
  "principal":"wyq"
  },

  "force" : true
  }
}

And this framework will receive an offer:
{"subscribed":{"framework_id":{"value":"7de42f40-2ddd-44a1-a4ff-4af932d25e02-"}},"type":"SUBSCRIBED"}20
{"type":"HEARTBEAT"}680
{"offers":{"offers":[{"agent_id":{"value":"7de42f40-2ddd-44a1-a4ff-4af932d25e02-S0"},"framework_id":{"value":"7de42f40-2ddd-44a1-a4ff-4af932d25e02-"},"hostname":"192.168.1.5","id":{"value":"7de42f40-2ddd-44a1-a4ff-4af932d25e02-O0"},"resources":[{"name":"cpus","role":"*","scalar":{"value":8.0},"type":"SCALAR"},{"name":"mem","role":"*","scalar":{"value":15360.0},"type":"SCALAR"},{"name":"disk","role":"*","scalar":{"value":470832.0},"type":"SCALAR"},{"name":"ports","ranges":{"range":[{"begin":31000,"end":32000}]},"role":"*","type":"RANGES"}],"url":{"address":{"hostname":"192.168.1.5","ip":"192.168.1.5","port":5051},"path":"\/slave(1)","scheme":"http"}}]},"type":"OFFERS"}20
{"type":"HEARTBEAT"}20

- Update the weight of role `mesos`
$ curl --data "[{\"weight\":1.8,\"role\":\"mesos\"}]" -X PUT 
http://127.0.0.1:5050/weights

Receive an rescind offer, and a new offer received:
{"rescind":{"offer_id":{"value":"7de42f40-2ddd-44a1-a4ff-4af932d25e02-O0"}},"type":"RESCIND"}680
{"offers":{"offers":[{"agent_id":{"value":"7de42f40-2ddd-44a1-a4ff-4af932d25e02-S0"},"framework_id":{"value":"7de42f40-2ddd-44a1-a4ff-4af932d25e02-"},"hostname":"192.168.1.5","id":{"value":"7de42f40-2ddd-44a1-a4ff-4af932d25e02-O1"},"resources":[{"name":"cpus","role":"*","scalar":{"value":8.0},"type":"SCALAR"},{"name":"mem","role":"*","scalar":{"value":15360.0},"type":"SCALAR"},{"name":"disk","role":"*","scalar":{"value":470832.0},"type":"SCALAR"},{"name":"ports","ranges":{"range":[{"begin":31000,"end":32000}]},"role":"*","type":"RANGES"}],"url":{"address":{"hostname":"192.168.1.5","ip":"192.168.1.5","port":5051},"path":"\/slave(1)","scheme":"http"}}]},"type":"OFFERS"}20
{"type":"HEARTBEAT"}20

- Update the weight of role `mesos1`
$ curl --data "[{\"weight\":2.8,\"role\":\"mesos1\"}]" -X PUT 
http://127.0.0.1:5050/weights

- The outstanding offer will not be rescinded.


(TODO) I will add couple of tests for this patch in another JIRA.


Thanks,

Yongqiao Wang



Re: Review Request 44512: Support to get weights info by /weights.

2016-03-22 Thread Yongqiao Wang


> On March 21, 2016, 9:03 a.m., Adam B wrote:
> > Good start, but you're missing a few things. Are these coming in subsequent 
> > patches?
> > - Authentication for GET requests
> > - Tests for GETs
> > - Documentation updates

I will add a separated patch for GET requet test.


> On March 21, 2016, 9:03 a.m., Adam B wrote:
> > src/master/http.cpp, line 1178
> > <https://reviews.apache.org/r/44512/diff/1/?file=1291686#file1291686line1178>
> >
> > Will you be adding authentication to GETs in a separate patch?

Currently, the GET request has supported the authentication:

```
$ curl -v -X GET http://localhost:5050/weights | python -mjson.tool
* Hostname was NOT found in DNS cache
  % Total% Received % Xferd  Average Speed   TimeTime Time  Current
 Dload  Upload   Total   SpentLeft  Speed
  0 00 00 0  0  0 --:--:-- --:--:-- --:--:-- 0* 
  Trying ::1...
* connect to ::1 port 5050 failed: Connection refused
*   Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 5050 (#0)
> GET /weights HTTP/1.1
> User-Agent: curl/7.37.1
> Host: localhost:5050
> Accept: */*
>
< HTTP/1.1 401 Unauthorized
< Date: Tue, 22 Mar 2016 08:53:09 GMT
< WWW-Authenticate: Basic realm="mesos"
< Content-Length: 0
<
  0 00 00 0  0  0 --:--:-- --:--:-- --:--:-- 0
* Connection #0 to host localhost left intact
No JSON object could be decoded
```


- Yongqiao


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


On March 9, 2016, 6:36 a.m., Yongqiao Wang wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/44512/
> ---
> 
> (Updated March 9, 2016, 6:36 a.m.)
> 
> 
> Review request for mesos and Adam B.
> 
> 
> Bugs: MESOS-4316
> https://issues.apache.org/jira/browse/MESOS-4316
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Support to get weights info by /weights.
> 
> 
> Diffs
> -
> 
>   include/mesos/mesos.proto 3d22ec32655dca741169e1f0e382303e061c38b7 
>   src/master/http.cpp a3ad57a1c3f8a01aa609b28c12825670bb243387 
>   src/master/master.hpp ea26670e6c6c67314406fded510e8fdd46053dc8 
>   src/master/weights_handler.cpp PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/44512/diff/
> 
> 
> Testing
> ---
> 
> make && make check.
> 
> $ (./mesos-master.sh --ip=127.0.0.1 --work_dir=/tmp/mesos-master  
> --authenticate_http --credentials=/opt/credentials.json  >> 
> /tmp/mesos-master.log 2>&1 &)
> 
> $ curl --user framework1:secret_string1 http://localhost:5050/weights | 
> python -mjson.tool
> {}
> 
> $ curl --user framework1:secret_string1 --data 
> "[{\"weight\":1.8,\"role\":\"role1\"},{\"weight\":1.0,\"role\":\"role2\"},{\"weight\":3.4,\"role\":\"role3\"}]"
>  -X PUT http://127.0.0.1:5050/weights
> 
> $ curl --user framework1:secret_string1 http://localhost:5050/weights | 
> python -mjson.tool
> {
> "infos": [
> {
> "role": "role3",
> "weight": 3.4
> },
> {
> "role": "role2",
> "weight": 1.0
> },
> {
> "role": "role1",
> "weight": 1.8
> }
> ]
> }
> 
> Has updated all tests of /weights endpoint to check the update results with 
> /weights GET request.
> 
> 
> Thanks,
> 
> Yongqiao Wang
> 
>



Re: Review Request 44512: Support to get weights info by /weights.

2016-03-22 Thread Yongqiao Wang

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

(Updated March 22, 2016, 10:02 a.m.)


Review request for mesos and Adam B.


Changes
---

Addressed comments of adam.


Bugs: MESOS-4316
https://issues.apache.org/jira/browse/MESOS-4316


Repository: mesos


Description
---

Support to get weights info by /weights.


Diffs (updated)
-

  docs/weights.md a94251340d5193c9474b2e5e85328d62fe4edd8f 
  src/master/http.cpp bfea8fa811c24d37b2d7a8109728e1f40217e02f 
  src/master/master.hpp 124d43931a5c8a00ee0aaa604feb1761795209f2 
  src/master/weights_handler.cpp c9a1b0d9adbeb1e165999cdbb4f295b24f10b18f 

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


Testing (updated)
---

make && make check.

$ (./mesos-master.sh --ip=127.0.0.1 --work_dir=/tmp/mesos-master  
--authenticate_http --credentials=/opt/credentials.json  >> 
/tmp/mesos-master.log 2>&1 &)

$ curl --user framework1:secret_string1 http://localhost:5050/weights | python 
-mjson.tool
[]

$ curl --user framework1:secret_string1 --data 
"[{\"weight\":1.8,\"role\":\"role1\"},{\"weight\":1.0,\"role\":\"role2\"},{\"weight\":3.4,\"role\":\"role3\"}]"
 -X PUT http://127.0.0.1:5050/weights

$ curl --user framework1:secret_string1 http://localhost:5050/weights | python 
-mjson.tool
[
{
"role": "role3",
"weight": 3.4
},
{
    "role": "role2",
"weight": 1.0
},
{
"role": "role1",
"weight": 1.8
}
]


Thanks,

Yongqiao Wang



Re: Review Request 44511: Add registry tests for /weights endpoint.

2016-03-22 Thread Yongqiao Wang

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

(Updated March 22, 2016, 7:22 a.m.)


Review request for mesos and Adam B.


Changes
---

Address comments of Adam.


Bugs: MESOS-4797
https://issues.apache.org/jira/browse/MESOS-4797


Repository: mesos


Description
---

Add registry tests for /weights endpoint.


Diffs (updated)
-

  src/tests/dynamic_weights_tests.cpp ee0c4b1cc20e76a35a8e4e445f6827a1fc33e6c6 
  src/tests/registrar_tests.cpp c330af2a190282e159d9ab477cdc36a7881842cd 

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


Testing
---

Add three sub tests for /weights endpoint registry in this patch:

1. Tests whether the weights replicated log is initialized with the `--weights` 
flag when bootstrapping the cluster.
2. Tests whether the weights replicated log can be updated with `/weights` 
endpoint.
3. Tests whether the `--weights` flag is ignored and use the registry value 
instead when Mesos master subsequently starts with `--weights` flag still 
specified.

./src/mesos-tests --gtest_filter=Strict/RegistrarTest.UpdateWeights/*
[==] Running 2 tests from 1 test case.
[--] Global test environment set-up.
[--] 2 tests from Strict/RegistrarTest
[ RUN  ] Strict/RegistrarTest.UpdateWeights/0
[   OK ] Strict/RegistrarTest.UpdateWeights/0 (103 ms)
[ RUN  ] Strict/RegistrarTest.UpdateWeights/1
[   OK ] Strict/RegistrarTest.UpdateWeights/1 (67 ms)
[--] 2 tests from Strict/RegistrarTest (171 ms total)

[--] Global test environment tear-down
[==] 2 tests from 1 test case ran. (178 ms total)
[  PASSED  ] 2 tests.


make && make check.


Thanks,

Yongqiao Wang



Re: Review Request 44450: Rescind all outstanding offers to satisfy weights update.

2016-03-21 Thread Yongqiao Wang

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

(Updated March 22, 2016, 5:50 a.m.)


Review request for mesos, Adam B and Alexander Rukletsov.


Changes
---

Addressed comments of Adam.


Bugs: MESOS-4881
https://issues.apache.org/jira/browse/MESOS-4881


Repository: mesos


Description
---

Rescind all outstanding offers to satisfy weights update.


Diffs (updated)
-

  src/master/master.hpp 124d43931a5c8a00ee0aaa604feb1761795209f2 
  src/master/weights_handler.cpp c9a1b0d9adbeb1e165999cdbb4f295b24f10b18f 

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


Testing
---

Make && Make check.

Manual test steps:

- Start Mesos master:
$ ./bin/mesos-master.sh --ip=127.0.0.1 --work_dir=/tmp/mesos-master

- Start Mesos slave:
$ ./bin/mesos-slave.sh --master=127.0.0.1:5050

- Register a framwork with `curl`
$ curl -v http://127.0.0.1:5050/api/v1/scheduler -H "Content-type: 
application/json" -X POST -d @subscribe.json
$  cat subscribe.json
{
   "type": "SUBSCRIBE",

   "subscribe" : {
  "framework_info": {
  "user" :  "root",
  "name" :  "comsumer c1 HTTP Framework",
  "role" :  "mesos",
  "principal":"wyq"
  },

  "force" : true
  }
}

And this framework will receive an offer:
{"subscribed":{"framework_id":{"value":"7de42f40-2ddd-44a1-a4ff-4af932d25e02-"}},"type":"SUBSCRIBED"}20
{"type":"HEARTBEAT"}680
{"offers":{"offers":[{"agent_id":{"value":"7de42f40-2ddd-44a1-a4ff-4af932d25e02-S0"},"framework_id":{"value":"7de42f40-2ddd-44a1-a4ff-4af932d25e02-"},"hostname":"192.168.1.5","id":{"value":"7de42f40-2ddd-44a1-a4ff-4af932d25e02-O0"},"resources":[{"name":"cpus","role":"*","scalar":{"value":8.0},"type":"SCALAR"},{"name":"mem","role":"*","scalar":{"value":15360.0},"type":"SCALAR"},{"name":"disk","role":"*","scalar":{"value":470832.0},"type":"SCALAR"},{"name":"ports","ranges":{"range":[{"begin":31000,"end":32000}]},"role":"*","type":"RANGES"}],"url":{"address":{"hostname":"192.168.1.5","ip":"192.168.1.5","port":5051},"path":"\/slave(1)","scheme":"http"}}]},"type":"OFFERS"}20
{"type":"HEARTBEAT"}20

- Update the weight of role `mesos`
$ curl --data "[{\"weight\":1.8,\"role\":\"mesos\"}]" -X PUT 
http://127.0.0.1:5050/weights

Receive an rescind offer, and a new offer received:
{"rescind":{"offer_id":{"value":"7de42f40-2ddd-44a1-a4ff-4af932d25e02-O0"}},"type":"RESCIND"}680
{"offers":{"offers":[{"agent_id":{"value":"7de42f40-2ddd-44a1-a4ff-4af932d25e02-S0"},"framework_id":{"value":"7de42f40-2ddd-44a1-a4ff-4af932d25e02-"},"hostname":"192.168.1.5","id":{"value":"7de42f40-2ddd-44a1-a4ff-4af932d25e02-O1"},"resources":[{"name":"cpus","role":"*","scalar":{"value":8.0},"type":"SCALAR"},{"name":"mem","role":"*","scalar":{"value":15360.0},"type":"SCALAR"},{"name":"disk","role":"*","scalar":{"value":470832.0},"type":"SCALAR"},{"name":"ports","ranges":{"range":[{"begin":31000,"end":32000}]},"role":"*","type":"RANGES"}],"url":{"address":{"hostname":"192.168.1.5","ip":"192.168.1.5","port":5051},"path":"\/slave(1)","scheme":"http"}}]},"type":"OFFERS"}20
{"type":"HEARTBEAT"}20

- Update the weight of role `mesos1`
$ curl --data "[{\"weight\":2.8,\"role\":\"mesos1\"}]" -X PUT 
http://127.0.0.1:5050/weights

- The outstanding offer will not be rescinded.


(TODO) I will add couple of tests for this patch in another JIRA.


Thanks,

Yongqiao Wang



Re: Review Request 44888: Fix the typo.

2016-03-16 Thread Yongqiao Wang

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

(Updated March 16, 2016, 10:05 a.m.)


Review request for mesos and Adam B.


Bugs: MESOS-4957
https://issues.apache.org/jira/browse/MESOS-4957


Repository: mesos


Description
---

Fix the typo.


Diffs
-

  src/webui/master/static/offers.html 25e487193ae5244dde40d1de1d96ce892a7c67b9 

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


Testing
---


Thanks,

Yongqiao Wang



Review Request 44888: Fix the typo.

2016-03-16 Thread Yongqiao Wang

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

Review request for mesos and Adam B.


Repository: mesos


Description
---

Fix the typo.


Diffs
-

  src/webui/master/static/offers.html 25e487193ae5244dde40d1de1d96ce892a7c67b9 

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


Testing
---


Thanks,

Yongqiao Wang



Re: Review Request 44450: Rescind all outstanding offers to satisfy weights update.

2016-03-14 Thread Yongqiao Wang

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

(Updated March 14, 2016, 2:07 p.m.)


Review request for mesos, Adam B and Alexander Rukletsov.


Changes
---

Addressed comments of Adam.


Bugs: MESOS-4881
https://issues.apache.org/jira/browse/MESOS-4881


Repository: mesos


Description
---

Rescind all outstanding offers to satisfy weights update.


Diffs (updated)
-

  src/master/master.hpp 124d43931a5c8a00ee0aaa604feb1761795209f2 
  src/master/weights_handler.cpp c9a1b0d9adbeb1e165999cdbb4f295b24f10b18f 

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


Testing
---

Make && Make check.

Manual test steps:

- Start Mesos master:
$ ./bin/mesos-master.sh --ip=127.0.0.1 --work_dir=/tmp/mesos-master

- Start Mesos slave:
$ ./bin/mesos-slave.sh --master=127.0.0.1:5050

- Register a framwork with `curl`
$ curl -v http://127.0.0.1:5050/api/v1/scheduler -H "Content-type: 
application/json" -X POST -d @subscribe.json
$  cat subscribe.json
{
   "type": "SUBSCRIBE",

   "subscribe" : {
  "framework_info": {
  "user" :  "root",
  "name" :  "comsumer c1 HTTP Framework",
  "role" :  "mesos",
  "principal":"wyq"
  },

  "force" : true
  }
}

And this framework will receive an offer:
{"subscribed":{"framework_id":{"value":"7de42f40-2ddd-44a1-a4ff-4af932d25e02-"}},"type":"SUBSCRIBED"}20
{"type":"HEARTBEAT"}680
{"offers":{"offers":[{"agent_id":{"value":"7de42f40-2ddd-44a1-a4ff-4af932d25e02-S0"},"framework_id":{"value":"7de42f40-2ddd-44a1-a4ff-4af932d25e02-"},"hostname":"192.168.1.5","id":{"value":"7de42f40-2ddd-44a1-a4ff-4af932d25e02-O0"},"resources":[{"name":"cpus","role":"*","scalar":{"value":8.0},"type":"SCALAR"},{"name":"mem","role":"*","scalar":{"value":15360.0},"type":"SCALAR"},{"name":"disk","role":"*","scalar":{"value":470832.0},"type":"SCALAR"},{"name":"ports","ranges":{"range":[{"begin":31000,"end":32000}]},"role":"*","type":"RANGES"}],"url":{"address":{"hostname":"192.168.1.5","ip":"192.168.1.5","port":5051},"path":"\/slave(1)","scheme":"http"}}]},"type":"OFFERS"}20
{"type":"HEARTBEAT"}20

- Update the weight of role `mesos`
$ curl --data "[{\"weight\":1.8,\"role\":\"mesos\"}]" -X PUT 
http://127.0.0.1:5050/weights

Receive an rescind offer, and a new offer received:
{"rescind":{"offer_id":{"value":"7de42f40-2ddd-44a1-a4ff-4af932d25e02-O0"}},"type":"RESCIND"}680
{"offers":{"offers":[{"agent_id":{"value":"7de42f40-2ddd-44a1-a4ff-4af932d25e02-S0"},"framework_id":{"value":"7de42f40-2ddd-44a1-a4ff-4af932d25e02-"},"hostname":"192.168.1.5","id":{"value":"7de42f40-2ddd-44a1-a4ff-4af932d25e02-O1"},"resources":[{"name":"cpus","role":"*","scalar":{"value":8.0},"type":"SCALAR"},{"name":"mem","role":"*","scalar":{"value":15360.0},"type":"SCALAR"},{"name":"disk","role":"*","scalar":{"value":470832.0},"type":"SCALAR"},{"name":"ports","ranges":{"range":[{"begin":31000,"end":32000}]},"role":"*","type":"RANGES"}],"url":{"address":{"hostname":"192.168.1.5","ip":"192.168.1.5","port":5051},"path":"\/slave(1)","scheme":"http"}}]},"type":"OFFERS"}20
{"type":"HEARTBEAT"}20

- Update the weight of role `mesos1`
$ curl --data "[{\"weight\":2.8,\"role\":\"mesos1\"}]" -X PUT 
http://127.0.0.1:5050/weights

- The outstanding offer will not be rescinded.


(TODO) I will add couple of tests for this patch in another JIRA.


Thanks,

Yongqiao Wang



Re: Review Request 44511: Add registry tests for /weights endpoint.

2016-03-14 Thread Yongqiao Wang

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

(Updated March 14, 2016, 1:51 p.m.)


Review request for mesos and Adam B.


Changes
---

Addressed comments of Adam.


Bugs: MESOS-4797
https://issues.apache.org/jira/browse/MESOS-4797


Repository: mesos


Description
---

Add registry tests for /weights endpoint.


Diffs (updated)
-

  src/tests/dynamic_weights_tests.cpp a95663f633f376954d4201b6cfbe693429be9c39 
  src/tests/registrar_tests.cpp c330af2a190282e159d9ab477cdc36a7881842cd 

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


Testing
---

Add three sub tests for /weights endpoint registry in this patch:

1. Tests whether the weights replicated log is initialized with the `--weights` 
flag when bootstrapping the cluster.
2. Tests whether the weights replicated log can be updated with `/weights` 
endpoint.
3. Tests whether the `--weights` flag is ignored and use the registry value 
instead when Mesos master subsequently starts with `--weights` flag still 
specified.


make && make check.


Thanks,

Yongqiao Wang



Re: Review Request 44511: Add registry tests for /weights endpoint.

2016-03-14 Thread Yongqiao Wang

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

(Updated March 14, 2016, 1:52 p.m.)


Review request for mesos and Adam B.


Bugs: MESOS-4797
https://issues.apache.org/jira/browse/MESOS-4797


Repository: mesos


Description
---

Add registry tests for /weights endpoint.


Diffs
-

  src/tests/dynamic_weights_tests.cpp a95663f633f376954d4201b6cfbe693429be9c39 
  src/tests/registrar_tests.cpp c330af2a190282e159d9ab477cdc36a7881842cd 

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


Testing (updated)
---

Add three sub tests for /weights endpoint registry in this patch:

1. Tests whether the weights replicated log is initialized with the `--weights` 
flag when bootstrapping the cluster.
2. Tests whether the weights replicated log can be updated with `/weights` 
endpoint.
3. Tests whether the `--weights` flag is ignored and use the registry value 
instead when Mesos master subsequently starts with `--weights` flag still 
specified.

./src/mesos-tests --gtest_filter=Strict/RegistrarTest.UpdateWeights/*
[==] Running 2 tests from 1 test case.
[--] Global test environment set-up.
[--] 2 tests from Strict/RegistrarTest
[ RUN  ] Strict/RegistrarTest.UpdateWeights/0
[   OK ] Strict/RegistrarTest.UpdateWeights/0 (103 ms)
[ RUN  ] Strict/RegistrarTest.UpdateWeights/1
[   OK ] Strict/RegistrarTest.UpdateWeights/1 (67 ms)
[--] 2 tests from Strict/RegistrarTest (171 ms total)

[--] Global test environment tear-down
[==] 2 tests from 1 test case ran. (178 ms total)
[  PASSED  ] 2 tests.


make && make check.


Thanks,

Yongqiao Wang



Re: Review Request 41790: Add tests for /weights endpoint.

2016-03-14 Thread Yongqiao Wang

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

(Updated March 14, 2016, 10:04 a.m.)


Review request for mesos, Adam B, Neil Conway, and Qian Zhang.


Changes
---

Addressed comments of Adam.


Bugs: MESOS-4200
https://issues.apache.org/jira/browse/MESOS-4200


Repository: mesos


Description
---

Add tests for /weights endpoint.


Diffs (updated)
-

  src/Makefile.am f2a592dba3e963c99c48c4b9045b4a04d173cb22 
  src/tests/dynamic_weights_tests.cpp PRE-CREATION 

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


Testing
---

Make and Make check successfully!

$ ./src/mesos-tests --gtest_filter=DynamicWeightsTest.*
[==] Running 11 tests from 1 test case.
[--] Global test environment set-up.
[--] 11 tests from DynamicWeightsTest
[ RUN  ] DynamicWeightsTest.PutInvalidRequest
[   OK ] DynamicWeightsTest.PutInvalidRequest (87 ms)
[ RUN  ] DynamicWeightsTest.ZeroWeight
[   OK ] DynamicWeightsTest.ZeroWeight (44 ms)
[ RUN  ] DynamicWeightsTest.NegativeWeight
[   OK ] DynamicWeightsTest.NegativeWeight (42 ms)
[ RUN  ] DynamicWeightsTest.NonNumericWeight
[   OK ] DynamicWeightsTest.NonNumericWeight (37 ms)
[ RUN  ] DynamicWeightsTest.MissingRole
[   OK ] DynamicWeightsTest.MissingRole (42 ms)
[ RUN  ] DynamicWeightsTest.UnknownRole
[   OK ] DynamicWeightsTest.UnknownRole (38 ms)
[ RUN  ] DynamicWeightsTest.UpdateWeightsWithExplictRoles
[   OK ] DynamicWeightsTest.UpdateWeightsWithExplictRoles (38 ms)
[ RUN  ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest
[   OK ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest (35 ms)
[ RUN  ] DynamicWeightsTest.AuthorizedWeightUpdateRequest
[   OK ] DynamicWeightsTest.AuthorizedWeightUpdateRequest (45 ms)
[ RUN  ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal
[   OK ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal 
(38 ms)
[ RUN  ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest
[   OK ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest (35 ms)
[--] 11 tests from DynamicWeightsTest (482 ms total)

[--] Global test environment tear-down
[==] 11 tests from 1 test case ran. (490 ms total)
[  PASSED  ] 11 tests.


Thanks,

Yongqiao Wang



Re: Review Request 44584: Improved docs for dynamic weights.

2016-03-09 Thread Yongqiao Wang

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




docs/weights.md (lines 39 - 44)
<https://reviews.apache.org/r/44584/#comment184993>

Why adjust this order? `role` is an optional item in `/weights` `PUT` 
request, and `/weights` is focus on changing the weight, so I put `weight` item 
firstly.


- Yongqiao Wang


On March 10, 2016, 7:28 a.m., Neil Conway wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/44584/
> ---
> 
> (Updated March 10, 2016, 7:28 a.m.)
> 
> 
> Review request for mesos, Adam B and Yongqiao Wang.
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Improved docs for dynamic weights.
> 
> 
> Diffs
> -
> 
>   docs/configuration.md f6e84023b90e560594429826ed7163310d62b265 
>   docs/roles.md 65d6ddf46ac394389c70a3faf5cc85c5cf892478 
>   docs/weights.md dec2ddd6516d2d3a9926f6410f8309eb2de40c3c 
>   src/master/flags.cpp c1dd127109f1ba96a8f9b95f3eb99dfeb43f7d28 
> 
> Diff: https://reviews.apache.org/r/44584/diff/
> 
> 
> Testing
> ---
> 
> Previewed via site-docker.
> 
> 
> Thanks,
> 
> Neil Conway
> 
>



Re: Review Request 44511: Add registry tests for /weights endpoint.

2016-03-09 Thread Yongqiao Wang

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

(Updated March 9, 2016, 10:03 a.m.)


Review request for mesos and Adam B.


Changes
---

Addressed comments of Adam.


Bugs: MESOS-4797
https://issues.apache.org/jira/browse/MESOS-4797


Repository: mesos


Description
---

Add registry tests for /weights endpoint.


Diffs (updated)
-

  src/tests/dynamic_weights_tests.cpp PRE-CREATION 

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


Testing (updated)
---

Add three sub tests for /weights endpoint registry in this patch:

1. Tests whether the weights replicated log is initialized with the `--weights` 
flag when bootstrapping the cluster.
2. Tests whether the weights replicated log can be updated with `/weights` 
endpoint.
3. Tests whether the `--weights` flag is ignored and use the registry value 
instead when Mesos master subsequently starts with `--weights` flag still 
specified.


make && make check.


Thanks,

Yongqiao Wang



Re: Review Request 41790: Add tests for /weights endpoint.

2016-03-09 Thread Yongqiao Wang

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

(Updated March 9, 2016, 9:47 a.m.)


Review request for mesos, Adam B, Neil Conway, and Qian Zhang.


Changes
---

Addressed comments of Adam.


Bugs: MESOS-4200
https://issues.apache.org/jira/browse/MESOS-4200


Repository: mesos


Description
---

Add tests for /weights endpoint.


Diffs (updated)
-

  src/Makefile.am b24f0f58fa188c16770fe6a3c23ec06262cb0955 
  src/tests/dynamic_weights_tests.cpp PRE-CREATION 

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


Testing
---

Make and Make check successfully!

$ ./src/mesos-tests --gtest_filter=DynamicWeightsTest.*
[==] Running 11 tests from 1 test case.
[--] Global test environment set-up.
[--] 11 tests from DynamicWeightsTest
[ RUN  ] DynamicWeightsTest.PutInvalidRequest
[   OK ] DynamicWeightsTest.PutInvalidRequest (87 ms)
[ RUN  ] DynamicWeightsTest.ZeroWeight
[   OK ] DynamicWeightsTest.ZeroWeight (44 ms)
[ RUN  ] DynamicWeightsTest.NegativeWeight
[   OK ] DynamicWeightsTest.NegativeWeight (42 ms)
[ RUN  ] DynamicWeightsTest.NonNumericWeight
[   OK ] DynamicWeightsTest.NonNumericWeight (37 ms)
[ RUN  ] DynamicWeightsTest.MissingRole
[   OK ] DynamicWeightsTest.MissingRole (42 ms)
[ RUN  ] DynamicWeightsTest.UnknownRole
[   OK ] DynamicWeightsTest.UnknownRole (38 ms)
[ RUN  ] DynamicWeightsTest.UpdateWeightsWithExplictRoles
[   OK ] DynamicWeightsTest.UpdateWeightsWithExplictRoles (38 ms)
[ RUN  ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest
[   OK ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest (35 ms)
[ RUN  ] DynamicWeightsTest.AuthorizedWeightUpdateRequest
[   OK ] DynamicWeightsTest.AuthorizedWeightUpdateRequest (45 ms)
[ RUN  ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal
[   OK ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal 
(38 ms)
[ RUN  ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest
[   OK ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest (35 ms)
[--] 11 tests from DynamicWeightsTest (482 ms total)

[--] Global test environment tear-down
[==] 11 tests from 1 test case ran. (490 ms total)
[  PASSED  ] 11 tests.


Thanks,

Yongqiao Wang



Re: Review Request 41790: Add tests for /weights endpoint.

2016-03-09 Thread Yongqiao Wang


> On March 9, 2016, 8:26 a.m., Adam B wrote:
> > src/tests/dynamic_weights_tests.cpp, line 89
> > <https://reviews.apache.org/r/41790/diff/14/?file=1273013#file1273013line89>
> >
> > We don't (yet) use `CHECK_GE/LE/GT/LT` anywhere, I think because we 
> > want tests themselves to try to be exact. This might be more appropriate as 
> > `ASSERT_GE(tokens.size(), 1u)`.
> > Is it really even all that bad if `weightsFlag` was an empty string 
> > with no tokens? You'd just return an empty `infos`.

OK, it just only needs to remove `CHECK_GE(tokens.size(), 1u);`, if 
`weightsFlag` was an empty string, then return an empty infos.


- Yongqiao


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


On March 9, 2016, 5:52 a.m., Yongqiao Wang wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41790/
> ---
> 
> (Updated March 9, 2016, 5:52 a.m.)
> 
> 
> Review request for mesos, Adam B, Neil Conway, and Qian Zhang.
> 
> 
> Bugs: MESOS-4200
> https://issues.apache.org/jira/browse/MESOS-4200
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Add tests for /weights endpoint.
> 
> 
> Diffs
> -
> 
>   src/Makefile.am a41e95ddeb838fdebf4ced953c4a29181916e261 
>   src/tests/dynamic_weights_tests.cpp PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/41790/diff/
> 
> 
> Testing
> ---
> 
> Make and Make check successfully!
> 
> $ ./src/mesos-tests --gtest_filter=DynamicWeightsTest.*
> [==] Running 11 tests from 1 test case.
> [--] Global test environment set-up.
> [--] 11 tests from DynamicWeightsTest
> [ RUN  ] DynamicWeightsTest.PutInvalidRequest
> [   OK ] DynamicWeightsTest.PutInvalidRequest (87 ms)
> [ RUN  ] DynamicWeightsTest.ZeroWeight
> [   OK ] DynamicWeightsTest.ZeroWeight (44 ms)
> [ RUN  ] DynamicWeightsTest.NegativeWeight
> [   OK ] DynamicWeightsTest.NegativeWeight (42 ms)
> [ RUN  ] DynamicWeightsTest.NonNumericWeight
> [   OK ] DynamicWeightsTest.NonNumericWeight (37 ms)
> [ RUN  ] DynamicWeightsTest.MissingRole
> [   OK ] DynamicWeightsTest.MissingRole (42 ms)
> [ RUN  ] DynamicWeightsTest.UnknownRole
> [   OK ] DynamicWeightsTest.UnknownRole (38 ms)
> [ RUN  ] DynamicWeightsTest.UpdateWeightsWithExplictRoles
> [   OK ] DynamicWeightsTest.UpdateWeightsWithExplictRoles (38 ms)
> [ RUN  ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest
> [   OK ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest (35 ms)
> [ RUN  ] DynamicWeightsTest.AuthorizedWeightUpdateRequest
> [   OK ] DynamicWeightsTest.AuthorizedWeightUpdateRequest (45 ms)
> [ RUN  ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal
> [   OK ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal 
> (38 ms)
> [ RUN  ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest
> [   OK ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest (35 ms)
> [--] 11 tests from DynamicWeightsTest (482 ms total)
> 
> [--] Global test environment tear-down
> [==] 11 tests from 1 test case ran. (490 ms total)
> [  PASSED  ] 11 tests.
> 
> 
> Thanks,
> 
> Yongqiao Wang
> 
>



Re: Review Request 44512: Support to get weights info by /weights.

2016-03-08 Thread Yongqiao Wang

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

(Updated March 9, 2016, 6:36 a.m.)


Review request for mesos and Adam B.


Bugs: MESOS-4316
https://issues.apache.org/jira/browse/MESOS-4316


Repository: mesos


Description
---

Support to get weights info by /weights.


Diffs
-

  include/mesos/mesos.proto 3d22ec32655dca741169e1f0e382303e061c38b7 
  src/master/http.cpp a3ad57a1c3f8a01aa609b28c12825670bb243387 
  src/master/master.hpp ea26670e6c6c67314406fded510e8fdd46053dc8 
  src/master/weights_handler.cpp PRE-CREATION 

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


Testing (updated)
---

make && make check.

$ (./mesos-master.sh --ip=127.0.0.1 --work_dir=/tmp/mesos-master  
--authenticate_http --credentials=/opt/credentials.json  >> 
/tmp/mesos-master.log 2>&1 &)

$ curl --user framework1:secret_string1 http://localhost:5050/weights | python 
-mjson.tool
{}

$ curl --user framework1:secret_string1 --data 
"[{\"weight\":1.8,\"role\":\"role1\"},{\"weight\":1.0,\"role\":\"role2\"},{\"weight\":3.4,\"role\":\"role3\"}]"
 -X PUT http://127.0.0.1:5050/weights

$ curl --user framework1:secret_string1 http://localhost:5050/weights | python 
-mjson.tool
{
"infos": [
{
"role": "role3",
"weight": 3.4
},
{
"role": "role2",
"weight": 1.0
},
    {
    "role": "role1",
"weight": 1.8
}
]
}

Has updated all tests of /weights endpoint to check the update results with 
/weights GET request.


Thanks,

Yongqiao Wang



Re: Review Request 44511: Add registry tests for /weights endpoint.

2016-03-08 Thread Yongqiao Wang

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

(Updated March 9, 2016, 6:34 a.m.)


Review request for mesos and Adam B.


Changes
---

Check with the /weights GET method.


Bugs: MESOS-4797
https://issues.apache.org/jira/browse/MESOS-4797


Repository: mesos


Description
---

Add registry tests for /weights endpoint.


Diffs (updated)
-

  src/tests/dynamic_weights_tests.cpp PRE-CREATION 

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


Testing
---

make && make check.


Thanks,

Yongqiao Wang



Re: Review Request 41790: Add tests for /weights endpoint.

2016-03-08 Thread Yongqiao Wang

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

(Updated March 9, 2016, 5:52 a.m.)


Review request for mesos, Adam B, Neil Conway, and Qian Zhang.


Changes
---

Check the updated results wiht /weights endpoint.


Bugs: MESOS-4200
https://issues.apache.org/jira/browse/MESOS-4200


Repository: mesos


Description
---

Add tests for /weights endpoint.


Diffs (updated)
-

  src/Makefile.am a41e95ddeb838fdebf4ced953c4a29181916e261 
  src/tests/dynamic_weights_tests.cpp PRE-CREATION 

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


Testing (updated)
---

Make and Make check successfully!

$ ./src/mesos-tests --gtest_filter=DynamicWeightsTest.*
[==] Running 11 tests from 1 test case.
[--] Global test environment set-up.
[--] 11 tests from DynamicWeightsTest
[ RUN  ] DynamicWeightsTest.PutInvalidRequest
[   OK ] DynamicWeightsTest.PutInvalidRequest (87 ms)
[ RUN  ] DynamicWeightsTest.ZeroWeight
[   OK ] DynamicWeightsTest.ZeroWeight (44 ms)
[ RUN  ] DynamicWeightsTest.NegativeWeight
[   OK ] DynamicWeightsTest.NegativeWeight (42 ms)
[ RUN  ] DynamicWeightsTest.NonNumericWeight
[   OK ] DynamicWeightsTest.NonNumericWeight (37 ms)
[ RUN  ] DynamicWeightsTest.MissingRole
[   OK ] DynamicWeightsTest.MissingRole (42 ms)
[ RUN  ] DynamicWeightsTest.UnknownRole
[   OK ] DynamicWeightsTest.UnknownRole (38 ms)
[ RUN  ] DynamicWeightsTest.UpdateWeightsWithExplictRoles
[   OK ] DynamicWeightsTest.UpdateWeightsWithExplictRoles (38 ms)
[ RUN  ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest
[   OK ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest (35 ms)
[ RUN  ] DynamicWeightsTest.AuthorizedWeightUpdateRequest
[   OK ] DynamicWeightsTest.AuthorizedWeightUpdateRequest (45 ms)
[ RUN  ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal
[   OK ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal 
(38 ms)
[ RUN  ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest
[   OK ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest (35 ms)
[--] 11 tests from DynamicWeightsTest (482 ms total)

[--] Global test environment tear-down
[==] 11 tests from 1 test case ran. (490 ms total)
[  PASSED  ] 11 tests.


Thanks,

Yongqiao Wang



Re: Review Request 44450: Rescind all outstanding offers to satisfy weights update.

2016-03-08 Thread Yongqiao Wang

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

(Updated March 9, 2016, 5:19 a.m.)


Review request for mesos and Adam B.


Changes
---

Rebase.


Bugs: MESOS-4881
https://issues.apache.org/jira/browse/MESOS-4881


Repository: mesos


Description
---

Rescind all outstanding offers to satisfy weights update.


Diffs (updated)
-

  src/master/master.hpp ea26670e6c6c67314406fded510e8fdd46053dc8 
  src/master/weights_handler.cpp PRE-CREATION 

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


Testing
---

Make && Make check.

Manual test steps:

- Start Mesos master:
$ ./bin/mesos-master.sh --ip=127.0.0.1 --work_dir=/tmp/mesos-master

- Start Mesos slave:
$ ./bin/mesos-slave.sh --master=127.0.0.1:5050

- Register a framwork with `curl`
$ curl -v http://127.0.0.1:5050/api/v1/scheduler -H "Content-type: 
application/json" -X POST -d @subscribe.json
$  cat subscribe.json
{
   "type": "SUBSCRIBE",

   "subscribe" : {
  "framework_info": {
  "user" :  "root",
  "name" :  "comsumer c1 HTTP Framework",
  "role" :  "mesos",
  "principal":"wyq"
  },

  "force" : true
  }
}

And this framework will receive an offer:
{"subscribed":{"framework_id":{"value":"7de42f40-2ddd-44a1-a4ff-4af932d25e02-"}},"type":"SUBSCRIBED"}20
{"type":"HEARTBEAT"}680
{"offers":{"offers":[{"agent_id":{"value":"7de42f40-2ddd-44a1-a4ff-4af932d25e02-S0"},"framework_id":{"value":"7de42f40-2ddd-44a1-a4ff-4af932d25e02-"},"hostname":"192.168.1.5","id":{"value":"7de42f40-2ddd-44a1-a4ff-4af932d25e02-O0"},"resources":[{"name":"cpus","role":"*","scalar":{"value":8.0},"type":"SCALAR"},{"name":"mem","role":"*","scalar":{"value":15360.0},"type":"SCALAR"},{"name":"disk","role":"*","scalar":{"value":470832.0},"type":"SCALAR"},{"name":"ports","ranges":{"range":[{"begin":31000,"end":32000}]},"role":"*","type":"RANGES"}],"url":{"address":{"hostname":"192.168.1.5","ip":"192.168.1.5","port":5051},"path":"\/slave(1)","scheme":"http"}}]},"type":"OFFERS"}20
{"type":"HEARTBEAT"}20

- Update the weight of role `mesos`
$ curl --data "[{\"weight\":1.8,\"role\":\"mesos\"}]" -X PUT 
http://127.0.0.1:5050/weights

Receive an rescind offer, and a new offer received:
{"rescind":{"offer_id":{"value":"7de42f40-2ddd-44a1-a4ff-4af932d25e02-O0"}},"type":"RESCIND"}680
{"offers":{"offers":[{"agent_id":{"value":"7de42f40-2ddd-44a1-a4ff-4af932d25e02-S0"},"framework_id":{"value":"7de42f40-2ddd-44a1-a4ff-4af932d25e02-"},"hostname":"192.168.1.5","id":{"value":"7de42f40-2ddd-44a1-a4ff-4af932d25e02-O1"},"resources":[{"name":"cpus","role":"*","scalar":{"value":8.0},"type":"SCALAR"},{"name":"mem","role":"*","scalar":{"value":15360.0},"type":"SCALAR"},{"name":"disk","role":"*","scalar":{"value":470832.0},"type":"SCALAR"},{"name":"ports","ranges":{"range":[{"begin":31000,"end":32000}]},"role":"*","type":"RANGES"}],"url":{"address":{"hostname":"192.168.1.5","ip":"192.168.1.5","port":5051},"path":"\/slave(1)","scheme":"http"}}]},"type":"OFFERS"}20
{"type":"HEARTBEAT"}20

- Update the weight of role `mesos1`
$ curl --data "[{\"weight\":2.8,\"role\":\"mesos1\"}]" -X PUT 
http://127.0.0.1:5050/weights

- The outstanding offer will not be rescinded.


(TODO) I will add couple of tests for this patch in another JIRA.


Thanks,

Yongqiao Wang



Re: Review Request 42705: Update docs for --weights flag and authorization.

2016-03-08 Thread Yongqiao Wang

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

(Updated March 9, 2016, 4:09 a.m.)


Review request for mesos and Adam B.


Changes
---

Addressed comments of Adam.


Bugs: MESOS-3945
https://issues.apache.org/jira/browse/MESOS-3945


Repository: mesos


Description
---

Update docs for --weights flag and authorization.


Diffs (updated)
-

  docs/authorization.md c4449d5da4e2ea3ebfaaf4ed5b682e8f7bf56ac3 
  docs/configuration.md 305ba2c801c2060db6dcb4ef83c1043aaa7d520c 
  src/master/flags.cpp be981ed6155edce18bdb55188c78d73182159418 

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


Testing
---


Thanks,

Yongqiao Wang



Re: Review Request 43824: Addressed comments of 41672.

2016-03-08 Thread Yongqiao Wang

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

(Updated March 9, 2016, 3:17 a.m.)


Review request for mesos, Adam B and Alexander Rukletsov.


Changes
---

Addressed the comments of Adam.


Bugs: MESOS-4200
https://issues.apache.org/jira/browse/MESOS-4200


Repository: mesos


Description
---

Addressed comments of 41672.


Diffs (updated)
-

  src/tests/hierarchical_allocator_tests.cpp 
3e4ad31925e1b815a74d67fa3962d23fa5bc89d1 

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


Testing
---

make && make check successfully.


Thanks,

Yongqiao Wang



Re: Review Request 43824: Addressed comments of 41672.

2016-03-08 Thread Yongqiao Wang


> On March 8, 2016, 11:20 p.m., Adam B wrote:
> > src/tests/hierarchical_allocator_tests.cpp, line 233
> > <https://reviews.apache.org/r/43824/diff/6-7/?file=1282878#file1282878line233>
> >
> > `getAllocations` is too general a name for what this function actually 
> > does. More like `handleTwoAllocationsAndRecoverResources`. Any method that 
> > starts with `get` should return something, preferably whatever comes after 
> > `get` (i.e. `Allocations`).
> > If you parameterize the number of iterations of the loop, add a 
> > boolean/enum for whether to recover the resources, and return 
> > `frameworkAllocations`, then you could call it `getAllocations`, and use it 
> > for the 3-iteration loop at the end of the test.
> > That said, only two reuses may not be worth pulling it out (although 3 
> > may be).
> > I give you 3 options (your choice):
> > 1. Rename the method appropriately (may require code changes so it's 
> > not as ugly as `handleTwoAllocationsAndRecoverResources`).
> > 2. Inline the method back into the test in both places.
> > 3. Generalize the method and reuse it for the 3rd instance.

Thanks very much for your detailed description.


- Yongqiao


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


On March 8, 2016, 12:10 p.m., Yongqiao Wang wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/43824/
> ---
> 
> (Updated March 8, 2016, 12:10 p.m.)
> 
> 
> Review request for mesos, Adam B and Alexander Rukletsov.
> 
> 
> Bugs: MESOS-4200
> https://issues.apache.org/jira/browse/MESOS-4200
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Addressed comments of 41672.
> 
> 
> Diffs
> -
> 
>   src/tests/hierarchical_allocator_tests.cpp 
> 3e4ad31925e1b815a74d67fa3962d23fa5bc89d1 
> 
> Diff: https://reviews.apache.org/r/43824/diff/
> 
> 
> Testing
> ---
> 
> make && make check successfully.
> 
> 
> Thanks,
> 
> Yongqiao Wang
> 
>



Review Request 44512: Support to get weights info by /weights.

2016-03-08 Thread Yongqiao Wang

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

Review request for mesos and Adam B.


Bugs: MESOS-4316
https://issues.apache.org/jira/browse/MESOS-4316


Repository: mesos


Description
---

Support to get weights info by /weights.


Diffs
-

  include/mesos/mesos.proto 3d22ec32655dca741169e1f0e382303e061c38b7 
  src/master/http.cpp a3ad57a1c3f8a01aa609b28c12825670bb243387 
  src/master/master.hpp ea26670e6c6c67314406fded510e8fdd46053dc8 
  src/master/weights_handler.cpp PRE-CREATION 

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


Testing
---

make && make check.

$ (./mesos-master.sh --ip=127.0.0.1 --work_dir=/tmp/mesos-master  
--authenticate_http --credentials=/opt/credentials.json  >> 
/tmp/mesos-master.log 2>&1 &)

$ curl --user framework1:secret_string1 http://localhost:5050/weights | python 
-mjson.tool
{}

$ curl --user framework1:secret_string1 --data 
"[{\"weight\":1.8,\"role\":\"role1\"},{\"weight\":1.0,\"role\":\"role2\"},{\"weight\":3.4,\"role\":\"role3\"}]"
 -X PUT http://127.0.0.1:5050/weights

$ curl --user framework1:secret_string1 http://localhost:5050/weights | python 
-mjson.tool
{
"infos": [
{
"role": "role3",
"weight": 3.4
},
{
"role": "role2",
    "weight": 1.0
},
{
"role": "role1",
"weight": 1.8
}
]
}

(TODO) Add couple of tests in another patch.


Thanks,

Yongqiao Wang



Review Request 44511: Add registry tests for /weights endpoint.

2016-03-08 Thread Yongqiao Wang

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

Review request for mesos and Adam B.


Bugs: MESOS-4797
https://issues.apache.org/jira/browse/MESOS-4797


Repository: mesos


Description
---

Add registry tests for /weights endpoint.


Diffs
-

  src/tests/dynamic_weights_tests.cpp PRE-CREATION 

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


Testing
---

make && make check.


Thanks,

Yongqiao Wang



Re: Review Request 42719: Add doc for weights.

2016-03-08 Thread Yongqiao Wang


> On March 8, 2016, 9:19 a.m., Adam B wrote:
> > docs/weights.md, lines 22-23
> > <https://reviews.apache.org/r/42719/diff/5/?file=1282836#file1282836line22>
> >
> > This will have to be updated when we add GET

I will update this doc for GET request after addressing #MESOS-4316.


- Yongqiao


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


On March 8, 2016, 11:27 a.m., Yongqiao Wang wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/42719/
> ---
> 
> (Updated March 8, 2016, 11:27 a.m.)
> 
> 
> Review request for mesos and Adam B.
> 
> 
> Bugs: MESOS-3945
> https://issues.apache.org/jira/browse/MESOS-3945
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Add doc for weights.
> 
> 
> Diffs
> -
> 
>   docs/home.md 4327d461f3bd4cced85ceb505414b3e1afefff17 
>   docs/weights.md PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/42719/diff/
> 
> 
> Testing
> ---
> 
> 
> Thanks,
> 
> Yongqiao Wang
> 
>



Re: Review Request 43863: Move the implementation of updateWeights out of header.

2016-03-08 Thread Yongqiao Wang

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

(Updated March 8, 2016, 1:05 p.m.)


Review request for mesos, Adam B and Alexander Rukletsov.


Changes
---

Addressed comments of Adam.


Bugs: MESOS-4214
https://issues.apache.org/jira/browse/MESOS-4214


Repository: mesos


Description
---

Move the implementation of updateWeights out of header.


Diffs (updated)
-

  src/CMakeLists.txt 8f57a5701073bf1eaaa223383e928cf5db8f8ae4 
  src/Makefile.am a41e95ddeb838fdebf4ced953c4a29181916e261 
  src/master/master.hpp ea26670e6c6c67314406fded510e8fdd46053dc8 
  src/master/master.cpp 57ff4a39039f573b8586bc03f873f97826b97f6f 
  src/master/weights.hpp PRE-CREATION 
  src/master/weights.cpp PRE-CREATION 
  src/master/weights_handler.cpp PRE-CREATION 

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


Testing
---

make && make check successfully!


Thanks,

Yongqiao Wang



Re: Review Request 41681: Introduce HTTP endpoint /weights for updating weight.

2016-03-08 Thread Yongqiao Wang
$ curl http://localhost:5050/roles | python -mjson.tool
{
"roles": [
{
"frameworks": [],
"name": "*",
"resources": {
"cpus": 0,
    "disk": 0,
"mem": 0
},
"weight": 1.0
},
{
"frameworks": [],
"name": "role1",
"resources": {
"cpus": 0,
"disk": 0,
"mem": 0
},
"weight": 1.8
},
{
"frameworks": [],
"name": "role2",
"resources": {
"cpus": 0,
"disk": 0,
"mem": 0
},
"weight": 1.0
},
{
"frameworks": [],
"name": "role3",
"resources": {
"cpus": 0,
"disk": 0,
"mem": 0
},
"weight": 3.4
}
]
}


Thanks,

Yongqiao Wang



Re: Review Request 41681: Introduce HTTP endpoint /weights for updating weight.

2016-03-08 Thread Yongqiao Wang


> On March 8, 2016, 8:07 a.m., Adam B wrote:
> > src/master/master.hpp, lines 1040-1042
> > <https://reviews.apache.org/r/41681/diff/34/?file=1282844#file1282844line1040>
> >
> > So if I try to update N roles in one request, but I am not authorized 
> > to update 1, then I would get back a simple boolean "Forbidden" response, 
> > rather than a pointer to which role was unauthorized? I guess the best 
> > thing the client/user can do then is just try to update each role 
> > individually until one is rejected.
> > Is there some way we could give back a more helpful error message with 
> > the Forbidden response?

Current we do a batch authorization, the called functions `allows` and 
`matches` only return a `bool` value, so we can not get the detailed Forbidden 
response. Maybe two solutions can improve it:
1. Enhance `allows` and `matches` to return the Forbidden response.
2. Do authorization one by one, but it will have a worse performance than the 
corrent implementation.

Can us enhance this in another JIRA later?


- Yongqiao


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


On March 7, 2016, 12:19 p.m., Yongqiao Wang wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41681/
> ---
> 
> (Updated March 7, 2016, 12:19 p.m.)
> 
> 
> Review request for mesos, Adam B, Neil Conway, and Qian Zhang.
> 
> 
> Bugs: MESOS-4214
> https://issues.apache.org/jira/browse/MESOS-4214
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Introduce HTTP endpoint /weights for updating weight.
> 
> 
> Diffs
> -
> 
>   include/mesos/authorizer/authorizer.hpp 
> 5ee3c7afadd131802c93febbb6b4dbad069c2d81 
>   include/mesos/authorizer/authorizer.proto 
> 84d2cb3fbff3fbc7c3854d6eec5a3a55ad5760f8 
>   src/CMakeLists.txt 8f57a5701073bf1eaaa223383e928cf5db8f8ae4 
>   src/Makefile.am a41e95ddeb838fdebf4ced953c4a29181916e261 
>   src/authorizer/local/authorizer.hpp 
> c7321c276d566eca6a91f45c546468bea1b0da15 
>   src/authorizer/local/authorizer.cpp 
> a1486bd042e1d59e5ac99c2619fb3228c37b9788 
>   src/master/http.cpp 8276baa538eb4d2aaf54cc1aa516bffaadacc4dd 
>   src/master/master.hpp ea26670e6c6c67314406fded510e8fdd46053dc8 
>   src/master/master.cpp 57ff4a39039f573b8586bc03f873f97826b97f6f 
>   src/master/registry.proto 9958f9c2bdb785390fca2f292b65d5a9310434d5 
>   src/master/weights_handler.cpp PRE-CREATION 
>   src/tests/mesos.hpp d36840f6e23e5823332de53061bf6852330bdf0b 
>   src/tests/mesos.cpp e0f641c6828833de13a0a233e39ff6dc3f343d5c 
> 
> Diff: https://reviews.apache.org/r/41681/diff/
> 
> 
> Testing
> ---
> 
> Make & Make check successfully!
> 
> $ (./mesos-master.sh --ip=127.0.0.1 --work_dir=/tmp/mesos-master  
> --weights="role1=4.2,role2=3.1" --authenticate_http 
> --credentials=/opt/credentials.json  >> /tmp/mesos-master.log 2>&1 &)
> $ curl http://localhost:5050/roles | python -mjson.tool
> {
> "roles": [
> {
> "frameworks": [ ], 
> "name": "*", 
> "resources": {
> "cpus": 0, 
> "disk": 0, 
> "mem": 0
> }, 
> "weight": 1
> }, 
> {
> "frameworks": [ ], 
> "name": "role1", 
> "resources": {
> "cpus": 0, 
> "disk": 0, 
> "mem": 0
> }, 
> "weight": 4.2
> }, 
> {
> "frameworks": [ ], 
> "name": "role2", 
> "resources": {
> "cpus": 0, 
> "disk": 0, 
> "mem": 0
> }, 
> "weight": 3.1
> }
> ]
> }
> 
> Test update:
> $ curl --user framework1:secret_string1 --data 
> "[{\"weight\":1.8,\"role\":\"role1\"},{\"weight\":1.0,\"role\":\"role2\"},{\"weight\":3.4,\"role\":\"role3\"}]"
>  -X PUT http://127.0.0.1:5050/weights
> $

Re: Review Request 43824: Addressed comments of 41672.

2016-03-08 Thread Yongqiao Wang

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

(Updated March 8, 2016, 12:10 p.m.)


Review request for mesos, Adam B and Alexander Rukletsov.


Changes
---

Addressed comments of Adam.


Bugs: MESOS-4200
https://issues.apache.org/jira/browse/MESOS-4200


Repository: mesos


Description
---

Addressed comments of 41672.


Diffs (updated)
-

  src/tests/hierarchical_allocator_tests.cpp 
3e4ad31925e1b815a74d67fa3962d23fa5bc89d1 

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


Testing
---

make && make check successfully.


Thanks,

Yongqiao Wang



Re: Review Request 42719: Add doc for weights.

2016-03-08 Thread Yongqiao Wang

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

(Updated March 8, 2016, 11:27 a.m.)


Review request for mesos and Adam B.


Changes
---

Addressed comments of Adam.


Bugs: MESOS-3945
https://issues.apache.org/jira/browse/MESOS-3945


Repository: mesos


Description
---

Add doc for weights.


Diffs (updated)
-

  docs/home.md 4327d461f3bd4cced85ceb505414b3e1afefff17 
  docs/weights.md PRE-CREATION 

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


Testing
---


Thanks,

Yongqiao Wang



Re: Review Request 43824: Addressed comments of 41672.

2016-03-07 Thread Yongqiao Wang

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

(Updated March 7, 2016, 1:55 p.m.)


Review request for mesos, Adam B and Alexander Rukletsov.


Changes
---

Addressed comments of Alex.


Bugs: MESOS-4200
https://issues.apache.org/jira/browse/MESOS-4200


Repository: mesos


Description
---

Addressed comments of 41672.


Diffs (updated)
-

  src/tests/hierarchical_allocator_tests.cpp 
3e4ad31925e1b815a74d67fa3962d23fa5bc89d1 

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


Testing
---

make && make check successfully.


Thanks,

Yongqiao Wang



Review Request 44450: Rescind all outstanding offers to satisfy weights update.

2016-03-07 Thread Yongqiao Wang

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

Review request for mesos and Adam B.


Bugs: MESOS-4881
https://issues.apache.org/jira/browse/MESOS-4881


Repository: mesos


Description
---

Rescind all outstanding offers to satisfy weights update.


Diffs
-

  src/master/master.hpp ea26670e6c6c67314406fded510e8fdd46053dc8 
  src/master/weights_handler.cpp PRE-CREATION 

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


Testing
---

Make && Make check.

Manual test steps:

- Start Mesos master:
$ ./bin/mesos-master.sh --ip=127.0.0.1 --work_dir=/tmp/mesos-master

- Start Mesos slave:
$ ./bin/mesos-slave.sh --master=127.0.0.1:5050

- Register a framwork with `curl`
$ curl -v http://127.0.0.1:5050/api/v1/scheduler -H "Content-type: 
application/json" -X POST -d @subscribe.json
$  cat subscribe.json
{
   "type": "SUBSCRIBE",

   "subscribe" : {
  "framework_info": {
  "user" :  "root",
  "name" :  "comsumer c1 HTTP Framework",
  "role" :  "mesos",
  "principal":"wyq"
  },

  "force" : true
  }
}

And this framework will receive an offer:
{"subscribed":{"framework_id":{"value":"7de42f40-2ddd-44a1-a4ff-4af932d25e02-"}},"type":"SUBSCRIBED"}20
{"type":"HEARTBEAT"}680
{"offers":{"offers":[{"agent_id":{"value":"7de42f40-2ddd-44a1-a4ff-4af932d25e02-S0"},"framework_id":{"value":"7de42f40-2ddd-44a1-a4ff-4af932d25e02-"},"hostname":"192.168.1.5","id":{"value":"7de42f40-2ddd-44a1-a4ff-4af932d25e02-O0"},"resources":[{"name":"cpus","role":"*","scalar":{"value":8.0},"type":"SCALAR"},{"name":"mem","role":"*","scalar":{"value":15360.0},"type":"SCALAR"},{"name":"disk","role":"*","scalar":{"value":470832.0},"type":"SCALAR"},{"name":"ports","ranges":{"range":[{"begin":31000,"end":32000}]},"role":"*","type":"RANGES"}],"url":{"address":{"hostname":"192.168.1.5","ip":"192.168.1.5","port":5051},"path":"\/slave(1)","scheme":"http"}}]},"type":"OFFERS"}20
{"type":"HEARTBEAT"}20

- Update the weight of role `mesos`
$ curl --data "[{\"weight\":1.8,\"role\":\"mesos\"}]" -X PUT 
http://127.0.0.1:5050/weights

Receive an rescind offer, and a new offer received:
{"rescind":{"offer_id":{"value":"7de42f40-2ddd-44a1-a4ff-4af932d25e02-O0"}},"type":"RESCIND"}680
{"offers":{"offers":[{"agent_id":{"value":"7de42f40-2ddd-44a1-a4ff-4af932d25e02-S0"},"framework_id":{"value":"7de42f40-2ddd-44a1-a4ff-4af932d25e02-"},"hostname":"192.168.1.5","id":{"value":"7de42f40-2ddd-44a1-a4ff-4af932d25e02-O1"},"resources":[{"name":"cpus","role":"*","scalar":{"value":8.0},"type":"SCALAR"},{"name":"mem","role":"*","scalar":{"value":15360.0},"type":"SCALAR"},{"name":"disk","role":"*","scalar":{"value":470832.0},"type":"SCALAR"},{"name":"ports","ranges":{"range":[{"begin":31000,"end":32000}]},"role":"*","type":"RANGES"}],"url":{"address":{"hostname":"192.168.1.5","ip":"192.168.1.5","port":5051},"path":"\/slave(1)","scheme":"http"}}]},"type":"OFFERS"}20
{"type":"HEARTBEAT"}20

- Update the weight of role `mesos1`
$ curl --data "[{\"weight\":2.8,\"role\":\"mesos1\"}]" -X PUT 
http://127.0.0.1:5050/weights

- The outstanding offer will not be rescinded.


(TODO) I will add couple of tests for this patch in another JIRA.


Thanks,

Yongqiao Wang



Re: Review Request 41681: Introduce HTTP endpoint /weights for updating weight.

2016-03-07 Thread Yongqiao Wang
mjson.tool
{
"roles": [
{
"frameworks": [],
"name": "*",
"resources": {
"cpus": 0,
    "disk": 0,
"mem": 0
},
"weight": 1.0
},
{
"frameworks": [],
"name": "role1",
"resources": {
"cpus": 0,
"disk": 0,
"mem": 0
},
"weight": 1.8
},
{
"frameworks": [],
"name": "role2",
"resources": {
"cpus": 0,
"disk": 0,
"mem": 0
},
"weight": 1.0
},
{
"frameworks": [],
"name": "role3",
"resources": {
"cpus": 0,
"disk": 0,
"mem": 0
},
"weight": 3.4
}
]
}


Thanks,

Yongqiao Wang



Re: Review Request 42719: Add doc for weights.

2016-03-07 Thread Yongqiao Wang

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

(Updated March 7, 2016, 11:35 a.m.)


Review request for mesos and Adam B.


Changes
---

Updated the released version of dynamic weights to 0.29.


Bugs: MESOS-3945
https://issues.apache.org/jira/browse/MESOS-3945


Repository: mesos


Description
---

Add doc for weights.


Diffs (updated)
-

  docs/home.md 821026a12f422385e347e0037d6527efa9ffa2e1 
  docs/weights.md PRE-CREATION 

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


Testing
---


Thanks,

Yongqiao Wang



Re: Review Request 43824: Addressed comments of 41672.

2016-03-07 Thread Yongqiao Wang

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

(Updated March 7, 2016, 11:31 a.m.)


Review request for mesos, Adam B and Alexander Rukletsov.


Changes
---

Addressed comments of Alex.


Bugs: MESOS-4200
https://issues.apache.org/jira/browse/MESOS-4200


Repository: mesos


Description
---

Addressed comments of 41672.


Diffs (updated)
-

  src/tests/hierarchical_allocator_tests.cpp 
3e4ad31925e1b815a74d67fa3962d23fa5bc89d1 

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


Testing
---

make && make check successfully.


Thanks,

Yongqiao Wang



Re: Review Request 43824: Addressed comments of 41672.

2016-03-03 Thread Yongqiao Wang

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

(Updated March 3, 2016, 2:05 p.m.)


Review request for mesos, Adam B and Alexander Rukletsov.


Changes
---

Addressed comments of Alex.


Bugs: MESOS-4200
https://issues.apache.org/jira/browse/MESOS-4200


Repository: mesos


Description
---

Addressed comments of 41672.


Diffs (updated)
-

  src/tests/hierarchical_allocator_tests.cpp 
3e4ad31925e1b815a74d67fa3962d23fa5bc89d1 

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


Testing
---

make && make check successfully.


Thanks,

Yongqiao Wang



Re: Review Request 43806: Add comments for rebalance.

2016-03-03 Thread Yongqiao Wang


> On March 2, 2016, 2:07 p.m., Alexander Rukletsov wrote:
> > src/master/allocator/mesos/hierarchical.cpp, lines 1066-1069
> > <https://reviews.apache.org/r/43806/diff/2/?file=1272996#file1272996line1066>
> >
> > For posterity, we backtick types and variables names.
> 
> Yongqiao Wang wrote:
> Do you mean we should update the comment to :
> 
> // The allocator only needs to 'rebalance' if there is a framework
> // registered with this role. The 'roleSorter' contains only roles
> // for registered frameworks, but 'quotaRoleSorter' contains any role
> // with quota set, regardless of whether any frameworks are registered
> // with that role.
> 
> Alexander Rukletsov wrote:
> First, I didn't mean to include "rebalance" because it is a proper 
> English word in this context. Second, I meant backticks ` and not single 
> quotes '. Third, I don't think we should start another review to fix it, but 
> let's avoid it in the future.

OK, I see. Thanks!


- Yongqiao


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


On Feb. 27, 2016, 12:26 p.m., Yongqiao Wang wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/43806/
> ---
> 
> (Updated Feb. 27, 2016, 12:26 p.m.)
> 
> 
> Review request for mesos, Adam B and Alexander Rukletsov.
> 
> 
> Bugs: MESOS-3943
> https://issues.apache.org/jira/browse/MESOS-3943
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Add comments for rebalance.
> 
> 
> Diffs
> -
> 
>   src/master/allocator/mesos/hierarchical.cpp 
> 1b69fa801cd3f08cfcdce71ee3a3ca266b2fde57 
> 
> Diff: https://reviews.apache.org/r/43806/diff/
> 
> 
> Testing
> ---
> 
> 
> Thanks,
> 
> Yongqiao Wang
> 
>



Re: Review Request 43806: Add comments for rebalance.

2016-03-03 Thread Yongqiao Wang


> On March 2, 2016, 2:07 p.m., Alexander Rukletsov wrote:
> > src/master/allocator/mesos/hierarchical.cpp, lines 1066-1069
> > <https://reviews.apache.org/r/43806/diff/2/?file=1272996#file1272996line1066>
> >
> > For posterity, we backtick types and variables names.

Do you mean we should update the comment to :

// The allocator only needs to 'rebalance' if there is a framework
// registered with this role. The 'roleSorter' contains only roles
// for registered frameworks, but 'quotaRoleSorter' contains any role
// with quota set, regardless of whether any frameworks are registered
// with that role.


- Yongqiao


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


On Feb. 27, 2016, 12:26 p.m., Yongqiao Wang wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/43806/
> ---
> 
> (Updated Feb. 27, 2016, 12:26 p.m.)
> 
> 
> Review request for mesos, Adam B and Alexander Rukletsov.
> 
> 
> Bugs: MESOS-3943
> https://issues.apache.org/jira/browse/MESOS-3943
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Add comments for rebalance.
> 
> 
> Diffs
> -
> 
>   src/master/allocator/mesos/hierarchical.cpp 
> 1b69fa801cd3f08cfcdce71ee3a3ca266b2fde57 
> 
> Diff: https://reviews.apache.org/r/43806/diff/
> 
> 
> Testing
> ---
> 
> 
> Thanks,
> 
> Yongqiao Wang
> 
>



Re: Review Request 43824: Addressed comments of 41672.

2016-03-03 Thread Yongqiao Wang

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

(Updated March 3, 2016, 1:28 p.m.)


Review request for mesos, Adam B and Alexander Rukletsov.


Changes
---

Addressed comments of Alex.


Bugs: MESOS-4200
https://issues.apache.org/jira/browse/MESOS-4200


Repository: mesos


Description
---

Addressed comments of 41672.


Diffs (updated)
-

  src/tests/hierarchical_allocator_tests.cpp 
3e4ad31925e1b815a74d67fa3962d23fa5bc89d1 

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


Testing
---

make && make check successfully.


Thanks,

Yongqiao Wang



Re: Review Request 43824: Addressed comments of 41672.

2016-03-03 Thread Yongqiao Wang


> On March 3, 2016, 9:03 a.m., Alexander Rukletsov wrote:
> > src/tests/hierarchical_allocator_tests.cpp, lines 2607-2609
> > <https://reviews.apache.org/r/43824/diff/2/?file=1275001#file1275001line2607>
> >
> > I'm an ESL, but having both "per weight" and "by weight" sounds a bit 
> > strange. Maybe Adam can help wiht finding the right preposition.

Thanks Alex. @Adam, I am also an ESL. What is your suggestion for this?


> On March 3, 2016, 9:03 a.m., Alexander Rukletsov wrote:
> > src/tests/hierarchical_allocator_tests.cpp, lines 2635-2640
> > <https://reviews.apache.org/r/43824/diff/2/?file=1275001#file1275001line2635>
> >
> > Does it fit one line? I know we are a bit inconsistent about it, but 
> > let's prefer oneliners where it doesn't impact the readability.

Put those parameters into one line will exceed 80 chars, then `git commit` will 
failed due to the default check. I agree with your suggestion, but I think we 
should have a discussion in community to enhance the related check rules.


> On March 3, 2016, 9:03 a.m., Alexander Rukletsov wrote:
> > src/tests/hierarchical_allocator_tests.cpp, lines 2652-2654
> > <https://reviews.apache.org/r/43824/diff/2/?file=1275001#file1275001line2652>
> >
> > How about
> > 
> > // Framework2 registers with 'role2' which also uses the default 
> > weight. It
> > // will not get any offers because all resources are offered to 
> > `framework1`.

I remember I wrote this comment like you before. The current comment is changed 
with Adam's comments. @Adam, any further comments for this?


> On March 3, 2016, 9:03 a.m., Alexander Rukletsov wrote:
> > src/tests/hierarchical_allocator_tests.cpp, line 2850
> > <https://reviews.apache.org/r/43824/diff/2/?file=1275001#file1275001line2850>
> >
> > Why do we need to `resume` here?

It does not needed, I have removed this line.


> On March 3, 2016, 9:03 a.m., Alexander Rukletsov wrote:
> > src/tests/hierarchical_allocator_tests.cpp, lines 2736-2738
> > <https://reviews.apache.org/r/43824/diff/2/?file=1275001#file1275001line2736>
> >
> > I think these lines are good candidate to go under the `{}` together 
> > with the checks. This way you can avoid numeral suffixes and have a 1:1 
> > relation between `{}`-blocks and test cases.
> > 
> > Does it make sense?

Update weights should be a completely different logic with the above check, so 
it would not be proper to put them together.


> On March 3, 2016, 9:03 a.m., Alexander Rukletsov wrote:
> > src/tests/hierarchical_allocator_tests.cpp, lines 2790-2792
> > <https://reviews.apache.org/r/43824/diff/2/?file=1275001#file1275001line2790>
> >
> > See my comment above about how to avoid numeral suffixes.

Same comments as above.


- Yongqiao


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


On March 1, 2016, 6:42 a.m., Yongqiao Wang wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/43824/
> ---
> 
> (Updated March 1, 2016, 6:42 a.m.)
> 
> 
> Review request for mesos, Adam B and Alexander Rukletsov.
> 
> 
> Bugs: MESOS-4200
> https://issues.apache.org/jira/browse/MESOS-4200
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Addressed comments of 41672.
> 
> 
> Diffs
> -
> 
>   src/tests/hierarchical_allocator_tests.cpp 
> 5f771f02db9bd098f3cd36730cd84bf2f5e87a33 
> 
> Diff: https://reviews.apache.org/r/43824/diff/
> 
> 
> Testing
> ---
> 
> make && make check successfully.
> 
> 
> Thanks,
> 
> Yongqiao Wang
> 
>



Re: Review Request 42719: Add doc for weights.

2016-02-29 Thread Yongqiao Wang

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

(Updated March 1, 2016, 7:53 a.m.)


Review request for mesos and Adam B.


Changes
---

Addressed comments of Adam.


Bugs: MESOS-3945
https://issues.apache.org/jira/browse/MESOS-3945


Repository: mesos


Description
---

Add doc for weights.


Diffs (updated)
-

  docs/home.md 821026a12f422385e347e0037d6527efa9ffa2e1 
  docs/weights.md PRE-CREATION 

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


Testing
---


Thanks,

Yongqiao Wang



Re: Review Request 42719: Add doc for weights.

2016-02-29 Thread Yongqiao Wang


> On Feb. 28, 2016, 8:21 a.m., Adam B wrote:
> > Thanks! Couple of tweaks as I review it again.
> > - How did you test that this renders correctly? Did you try 
> > `support/site-docker` to see if the markdown translates properly to html? 
> > Just because it looks good in github doesn't mean our Rakefile will make it 
> > look as good.

Yes, I have tried `support/site-docker`. This new doc looks good.


> On Feb. 28, 2016, 8:21 a.m., Adam B wrote:
> > docs/weights.md, line 16
> > <https://reviews.apache.org/r/42719/diff/3/?file=1259048#file1259048line16>
> >
> > Are we officially deprecating --weights in this release? If so, we'll 
> > need to update upgrades.md and the CHANGELOG to mention this.
> > 
> > Could you also document what happens when a master restarts with a 
> > --weights flag that differs from what's in the registry? (We warn and use 
> > the registry value, correct?)

`--weights` does not deprecate in this release (0.28), for backwark 
compitibility, it will be deprecated in a future release (Maybe six months 
later).


- Yongqiao


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


On Feb. 19, 2016, 7:56 a.m., Yongqiao Wang wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/42719/
> ---
> 
> (Updated Feb. 19, 2016, 7:56 a.m.)
> 
> 
> Review request for mesos and Adam B.
> 
> 
> Bugs: MESOS-3945
> https://issues.apache.org/jira/browse/MESOS-3945
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Add doc for weights.
> 
> 
> Diffs
> -
> 
>   docs/home.md 07214b927c112d7a180507ae03245892455fd757 
>   docs/weights.md PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/42719/diff/
> 
> 
> Testing
> ---
> 
> 
> Thanks,
> 
> Yongqiao Wang
> 
>



Re: Review Request 43824: Addressed comments of 41672.

2016-02-29 Thread Yongqiao Wang

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

(Updated March 1, 2016, 6:42 a.m.)


Review request for mesos, Adam B and Alexander Rukletsov.


Changes
---

Addressed comments of Adam.


Bugs: MESOS-4200
https://issues.apache.org/jira/browse/MESOS-4200


Repository: mesos


Description
---

Addressed comments of 41672.


Diffs (updated)
-

  src/tests/hierarchical_allocator_tests.cpp 
5f771f02db9bd098f3cd36730cd84bf2f5e87a33 

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


Testing
---

make && make check successfully.


Thanks,

Yongqiao Wang



Re: Review Request 41672: Test case(s) for weights + allocation behaviour.

2016-02-29 Thread Yongqiao Wang


> On Feb. 19, 2016, 9:31 a.m., Alexander Rukletsov wrote:
> > src/tests/hierarchical_allocator_tests.cpp, line 2373
> > <https://reviews.apache.org/r/41672/diff/12/?file=1203046#file1203046line2373>
> >
> > You can put framework id's into a `std::set` instead. Given there are 
> > two allocations, there is a guarantee, that there will be no attempts to 
> > put the same framework into the set twice.
> 
> Yongqiao Wang wrote:
> In the current implementation, we only need to check the allocation size 
> for each framework, it does not care the size of whole contianer (currentt is 
> hashmap), so I think use hashmap can meet the current requirement.
> 
> Adam B wrote:
> I think he's saying you can use a `std::set 
> allocatedFrameworks;` and inside your loop do: 
> `allocatedFrameworks.insert(allocation.get().frameworkId);`
> and verify the allocations afterwards with: 
> `EXPECT_EQ(expectedFrameworksSet, allocatedFrameworks);`

Have changed `hashmap` to `std::set`


- Yongqiao


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


On Jan. 20, 2016, 8:36 a.m., Yongqiao Wang wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41672/
> ---
> 
> (Updated Jan. 20, 2016, 8:36 a.m.)
> 
> 
> Review request for mesos, Adam B, Neil Conway, and Qian Zhang.
> 
> 
> Bugs: MESOS-4200
> https://issues.apache.org/jira/browse/MESOS-4200
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Test case(s) for weights + allocation behaviour.
> 
> 
> Diffs
> -
> 
>   src/tests/hierarchical_allocator_tests.cpp 
> 953712149bd951789beb29c72779c4ac65aa48dc 
> 
> Diff: https://reviews.apache.org/r/41672/diff/
> 
> 
> Testing
> ---
> 
> Make check done:
> $ ./src/mesos-tests --gtest_filter=HierarchicalAllocatorTest.UpdateWeight
> Source directory: /Users/yqwyq/Desktop/mesos
> Build directory: /Users/yqwyq/Desktop/mesos/build
> [==] Running 1 test from 1 test case.
> [--] Global test environment set-up.
> [--] 1 test from HierarchicalAllocatorTest
> [ RUN  ] HierarchicalAllocatorTest.UpdateWeight
> [   OK ] HierarchicalAllocatorTest.UpdateWeight (87 ms)
> [--] 1 test from HierarchicalAllocatorTest (87 ms total)
> 
> [--] Global test environment tear-down
> [==] 1 test from 1 test case ran. (176 ms total)
> [  PASSED  ] 1 test.
> 
> 
> Thanks,
> 
> Yongqiao Wang
> 
>



Re: Review Request 43824: Addressed comments of 41672.

2016-02-29 Thread Yongqiao Wang


> On Feb. 28, 2016, 9:39 a.m., Adam B wrote:
> > src/tests/hierarchical_allocator_tests.cpp, lines 2658-2661
> > <https://reviews.apache.org/r/43824/diff/1/?file=1264015#file1264015line2658>
> >
> > Can you say 100% and 0% instead of 1 and 0? And how is framework1's 
> > "share" '6'? Is that the number of agents/offers, rather than the 
> > framework's "share"?

I refer to the styles in above tests in this file? for example: 
https://github.com/apache/mesos/blob/master/src/tests/hierarchical_allocator_tests.cpp?262#L262
 so I used 1 rather than 100%. I think we should keep consistent, especially in 
a same file. For framework's "share", I have updated them to a ratio.


- Yongqiao


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


On Feb. 22, 2016, 7:23 a.m., Yongqiao Wang wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/43824/
> ---
> 
> (Updated Feb. 22, 2016, 7:23 a.m.)
> 
> 
> Review request for mesos, Adam B and Alexander Rukletsov.
> 
> 
> Bugs: MESOS-4200
> https://issues.apache.org/jira/browse/MESOS-4200
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Addressed comments of 41672.
> 
> 
> Diffs
> -
> 
>   src/tests/hierarchical_allocator_tests.cpp 
> 5f771f02db9bd098f3cd36730cd84bf2f5e87a33 
> 
> Diff: https://reviews.apache.org/r/43824/diff/
> 
> 
> Testing
> ---
> 
> make && make check successfully.
> 
> 
> Thanks,
> 
> Yongqiao Wang
> 
>



Re: Review Request 41681: Introduce HTTP endpoint /weights for updating weight.

2016-02-28 Thread Yongqiao Wang
$ curl http://localhost:5050/roles | python -mjson.tool
{
"roles": [
{
"frameworks": [],
"name": "*",
"resources": {
"cpus": 0,
    "disk": 0,
"mem": 0
},
"weight": 1.0
},
{
"frameworks": [],
"name": "role1",
"resources": {
"cpus": 0,
"disk": 0,
"mem": 0
},
"weight": 1.8
},
{
"frameworks": [],
"name": "role2",
"resources": {
"cpus": 0,
"disk": 0,
"mem": 0
},
"weight": 1.0
},
{
"frameworks": [],
"name": "role3",
"resources": {
"cpus": 0,
"disk": 0,
"mem": 0
},
"weight": 3.4
}
]
}


Thanks,

Yongqiao Wang



Re: Review Request 41790: Add tests for /weights endpoint.

2016-02-28 Thread Yongqiao Wang


> On Feb. 27, 2016, 12:21 p.m., Adam B wrote:
> > Sorry this took me forever to get to. Looks pretty good except for some 
> > indentation and some unnecessary lines.
> > I'd also like to see a couple of registrar tests, like AlexR suggested.
> 
> Yongqiao Wang wrote:
> Thanks Adam. I will add a couple of registrar tests later in another 
> patches, is it OK?
> 
> Adam B wrote:
> Sure, it can go in a later patch, but let's make sure not to forget it.

I have logged a separated JIRA ticket #MESOS-4797 to trace this task.


- Yongqiao


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


On Feb. 27, 2016, 1:55 p.m., Yongqiao Wang wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41790/
> ---
> 
> (Updated Feb. 27, 2016, 1:55 p.m.)
> 
> 
> Review request for mesos, Adam B, Neil Conway, and Qian Zhang.
> 
> 
> Bugs: MESOS-4200
> https://issues.apache.org/jira/browse/MESOS-4200
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Add tests for /weights endpoint.
> 
> 
> Diffs
> -
> 
>   src/Makefile.am 2a26261b513bb7c03437ed8e850c3b36b93d82f5 
>   src/tests/dynamic_weights_tests.cpp PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/41790/diff/
> 
> 
> Testing
> ---
> 
> Make and Make check successfully!
> 
> ./src/mesos-tests --gtest_filter=DynamicWeightsTest.*
> [==] Running 11 tests from 1 test case.
> [--] Global test environment set-up.
> [--] 11 tests from DynamicWeightsTest
> [ RUN  ] DynamicWeightsTest.PutInvalidRequest
> [   OK ] DynamicWeightsTest.PutInvalidRequest (85 ms)
> [ RUN  ] DynamicWeightsTest.ZeroWeight
> [   OK ] DynamicWeightsTest.ZeroWeight (46 ms)
> [ RUN  ] DynamicWeightsTest.NegativeWeight
> [   OK ] DynamicWeightsTest.NegativeWeight (49 ms)
> [ RUN  ] DynamicWeightsTest.NonNumericWeight
> [   OK ] DynamicWeightsTest.NonNumericWeight (49 ms)
> [ RUN  ] DynamicWeightsTest.MissingRole
> [   OK ] DynamicWeightsTest.MissingRole (50 ms)
> [ RUN  ] DynamicWeightsTest.UnknownRole
> [   OK ] DynamicWeightsTest.UnknownRole (49 ms)
> [ RUN  ] DynamicWeightsTest.UpdateWeightsWithExplictRoles
> [   OK ] DynamicWeightsTest.UpdateWeightsWithExplictRoles (45 ms)
> [ RUN  ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest
> [   OK ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest (45 ms)
> [ RUN  ] DynamicWeightsTest.AuthorizedWeightUpdateRequest
> [   OK ] DynamicWeightsTest.AuthorizedWeightUpdateRequest (37 ms)
> [ RUN  ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal
> [   OK ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal 
> (36 ms)
> [ RUN  ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest
> [   OK ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest (35 ms)
> [--] 11 tests from DynamicWeightsTest (527 ms total)
> 
> [--] Global test environment tear-down
> [==] 11 tests from 1 test case ran. (536 ms total)
> [  PASSED  ] 11 tests.
> 
> 
> Thanks,
> 
> Yongqiao Wang
> 
>



Re: Review Request 41790: Add tests for /weights endpoint.

2016-02-27 Thread Yongqiao Wang

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

(Updated Feb. 27, 2016, 1:55 p.m.)


Review request for mesos, Adam B, Neil Conway, and Qian Zhang.


Changes
---

Addressed comments of Adam.


Bugs: MESOS-4200
https://issues.apache.org/jira/browse/MESOS-4200


Repository: mesos


Description
---

Add tests for /weights endpoint.


Diffs (updated)
-

  src/Makefile.am 2a26261b513bb7c03437ed8e850c3b36b93d82f5 
  src/tests/dynamic_weights_tests.cpp PRE-CREATION 

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


Testing (updated)
---

Make and Make check successfully!

./src/mesos-tests --gtest_filter=DynamicWeightsTest.*
[==] Running 11 tests from 1 test case.
[--] Global test environment set-up.
[--] 11 tests from DynamicWeightsTest
[ RUN  ] DynamicWeightsTest.PutInvalidRequest
[   OK ] DynamicWeightsTest.PutInvalidRequest (85 ms)
[ RUN  ] DynamicWeightsTest.ZeroWeight
[   OK ] DynamicWeightsTest.ZeroWeight (46 ms)
[ RUN  ] DynamicWeightsTest.NegativeWeight
[   OK ] DynamicWeightsTest.NegativeWeight (49 ms)
[ RUN  ] DynamicWeightsTest.NonNumericWeight
[   OK ] DynamicWeightsTest.NonNumericWeight (49 ms)
[ RUN  ] DynamicWeightsTest.MissingRole
[   OK ] DynamicWeightsTest.MissingRole (50 ms)
[ RUN  ] DynamicWeightsTest.UnknownRole
[   OK ] DynamicWeightsTest.UnknownRole (49 ms)
[ RUN  ] DynamicWeightsTest.UpdateWeightsWithExplictRoles
[   OK ] DynamicWeightsTest.UpdateWeightsWithExplictRoles (45 ms)
[ RUN  ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest
[   OK ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest (45 ms)
[ RUN  ] DynamicWeightsTest.AuthorizedWeightUpdateRequest
[   OK ] DynamicWeightsTest.AuthorizedWeightUpdateRequest (37 ms)
[ RUN  ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal
[   OK ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal 
(36 ms)
[ RUN  ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest
[   OK ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest (35 ms)
[--] 11 tests from DynamicWeightsTest (527 ms total)

[--] Global test environment tear-down
[==] 11 tests from 1 test case ran. (536 ms total)
[  PASSED  ] 11 tests.


Thanks,

Yongqiao Wang



Re: Review Request 41790: Add tests for /weights endpoint.

2016-02-27 Thread Yongqiao Wang


> On Feb. 27, 2016, 12:21 p.m., Adam B wrote:
> > Sorry this took me forever to get to. Looks pretty good except for some 
> > indentation and some unnecessary lines.
> > I'd also like to see a couple of registrar tests, like AlexR suggested.

Thanks Adam. I will add a couple of registrar tests later in another patches, 
is it OK?


- Yongqiao


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


On Jan. 25, 2016, 3:47 p.m., Yongqiao Wang wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41790/
> ---
> 
> (Updated Jan. 25, 2016, 3:47 p.m.)
> 
> 
> Review request for mesos, Adam B, Neil Conway, and Qian Zhang.
> 
> 
> Bugs: MESOS-4200
> https://issues.apache.org/jira/browse/MESOS-4200
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Add tests for /weights endpoint.
> 
> 
> Diffs
> -
> 
>   src/Makefile.am 8657a869f931aa7482fbb09f2c6df95b6a8c50c6 
>   src/tests/dynamic_weights_tests.cpp PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/41790/diff/
> 
> 
> Testing
> ---
> 
> Make and Make check successfully!
> 
> ./src/mesos-tests --gtest_filter=DynamicWeightsTest.*
> [==] Running 11 tests from 1 test case.
> [--] Global test environment set-up.
> [--] 11 tests from DynamicWeightsTest
> [ RUN  ] DynamicWeightsTest.PutInvalidRequest
> [   OK ] DynamicWeightsTest.PutInvalidRequest (102 ms)
> [ RUN  ] DynamicWeightsTest.ZeroWeight
> [   OK ] DynamicWeightsTest.ZeroWeight (38 ms)
> [ RUN  ] DynamicWeightsTest.NegativeWeight
> [   OK ] DynamicWeightsTest.NegativeWeight (38 ms)
> [ RUN  ] DynamicWeightsTest.MissingRole
> [   OK ] DynamicWeightsTest.MissingRole (43 ms)
> [ RUN  ] DynamicWeightsTest.UnknownRole
> [   OK ] DynamicWeightsTest.UnknownRole (36 ms)
> [ RUN  ] DynamicWeightsTest.UpdateWeightsWithExplictRoles
> [   OK ] DynamicWeightsTest.UpdateWeightsWithExplictRoles (44 ms)
> [ RUN  ] DynamicWeightsTest.UpdateWeightsWithImplicitRoles
> [   OK ] DynamicWeightsTest.UpdateWeightsWithImplicitRoles (52 ms)
> [ RUN  ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest
> [   OK ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest (40 ms)
> [ RUN  ] DynamicWeightsTest.AuthorizedWeightUpdateRequest
> [   OK ] DynamicWeightsTest.AuthorizedWeightUpdateRequest (32 ms)
> [ RUN  ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal
> [   OK ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal 
> (37 ms)
> [ RUN  ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest
> [   OK ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest (30 ms)
> [--] 11 tests from DynamicWeightsTest (492 ms total)
> 
> [--] Global test environment tear-down
> [==] 11 tests from 1 test case ran. (503 ms total)
> [  PASSED  ] 11 tests.
> 
> 
> Thanks,
> 
> Yongqiao Wang
> 
>



Re: Review Request 43863: Move the implementation of updateWeights out of header.

2016-02-27 Thread Yongqiao Wang

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

(Updated Feb. 27, 2016, 12:43 p.m.)


Review request for mesos, Adam B and Alexander Rukletsov.


Changes
---

Addressed the comments of Adam.


Bugs: MESOS-4214
https://issues.apache.org/jira/browse/MESOS-4214


Repository: mesos


Description
---

Move the implementation of updateWeights out of header.


Diffs (updated)
-

  src/CMakeLists.txt 49a5645ef7242dbaee31e7b26dbbcb1f4f1f910e 
  src/Makefile.am 2a26261b513bb7c03437ed8e850c3b36b93d82f5 
  src/master/master.hpp 13c6ff153e77c527822309e787942eb463d59e7d 
  src/master/master.cpp 7c62f2a882a1c89d73f328b2ae665422fd84d7a1 
  src/master/weights.hpp PRE-CREATION 
  src/master/weights.cpp PRE-CREATION 
  src/master/weights_handler.cpp PRE-CREATION 

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


Testing
---

make && make check successfully!


Thanks,

Yongqiao Wang



Re: Review Request 43863: Move the implementation of updateWeights out of header.

2016-02-27 Thread Yongqiao Wang

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

(Updated Feb. 27, 2016, 12:40 p.m.)


Review request for mesos, Adam B and Alexander Rukletsov.


Changes
---

Addressed the comments of Adam.


Bugs: MESOS-4214
https://issues.apache.org/jira/browse/MESOS-4214


Repository: mesos


Description
---

Move the implementation of updateWeights out of header.


Diffs (updated)
-

  src/CMakeLists.txt 49a5645ef7242dbaee31e7b26dbbcb1f4f1f910e 
  src/Makefile.am 2a26261b513bb7c03437ed8e850c3b36b93d82f5 
  src/master/master.hpp 13c6ff153e77c527822309e787942eb463d59e7d 
  src/master/master.cpp 7c62f2a882a1c89d73f328b2ae665422fd84d7a1 
  src/master/weights.hpp PRE-CREATION 
  src/master/weights.cpp PRE-CREATION 
  src/master/weights_handler.cpp PRE-CREATION 

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


Testing
---

make && make check successfully!


Thanks,

Yongqiao Wang



Re: Review Request 43863: Move the implementation of updateWeights out of header.

2016-02-27 Thread Yongqiao Wang


> On Feb. 27, 2016, 11:17 a.m., Adam B wrote:
> > Looks good to me. I'm assuming you didn't change anything substantial in 
> > the implementation when you moved it. It looks the same to me.

Yes, I didn't change anything substantial in the implementation.


> On Feb. 27, 2016, 11:17 a.m., Adam B wrote:
> > src/Makefile.am, lines 630-631
> > <https://reviews.apache.org/r/43863/diff/1/?file=1264901#file1264901line630>
> >
> > Do these need to be in separate files?

Yes, I think weights_handler.cpp only contains the logic to handle the http 
request, like quota and maintenance features, they all use the separated files. 
Maybe my mainly reason is better to keep consistent.


- Yongqiao


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


On Feb. 23, 2016, 2:18 a.m., Yongqiao Wang wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/43863/
> ---
> 
> (Updated Feb. 23, 2016, 2:18 a.m.)
> 
> 
> Review request for mesos, Adam B and Alexander Rukletsov.
> 
> 
> Bugs: MESOS-4214
> https://issues.apache.org/jira/browse/MESOS-4214
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Move the implementation of updateWeights out of header.
> 
> 
> Diffs
> -
> 
>   src/CMakeLists.txt 5cf0ec8c475839ad8717192a37f01546cbcccd7a 
>   src/Makefile.am 73e7ff06ba064c9b04f191009522d7808a7ab58e 
>   src/master/master.hpp 13c6ff153e77c527822309e787942eb463d59e7d 
>   src/master/master.cpp b453bc7fca05c192df616b7d80132985b3248547 
>   src/master/weights.hpp PRE-CREATION 
>   src/master/weights.cpp PRE-CREATION 
>   src/master/weights_handler.cpp PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/43863/diff/
> 
> 
> Testing
> ---
> 
> make && make check successfully!
> 
> 
> Thanks,
> 
> Yongqiao Wang
> 
>



Re: Review Request 43806: Add comments for rebalance.

2016-02-27 Thread Yongqiao Wang

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

(Updated Feb. 27, 2016, 12:26 p.m.)


Review request for mesos, Adam B and Alexander Rukletsov.


Changes
---

Update the comment for rebalance by Adam's comment.


Bugs: MESOS-3943
https://issues.apache.org/jira/browse/MESOS-3943


Repository: mesos


Description
---

Add comments for rebalance.


Diffs (updated)
-

  src/master/allocator/mesos/hierarchical.cpp 
1b69fa801cd3f08cfcdce71ee3a3ca266b2fde57 

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


Testing
---


Thanks,

Yongqiao Wang



Re: Review Request 41681: Introduce HTTP endpoint /weights for updating weight.

2016-02-22 Thread Yongqiao Wang


> On Feb. 19, 2016, 10:24 a.m., Alexander Rukletsov wrote:
> > src/master/master.hpp, lines 1530-1531
> > <https://reviews.apache.org/r/41681/diff/32/?file=1241338#file1241338line1530>
> >
> > Let's pull at least the implementation out of the header. You may look 
> > at maintenance and quota for inspiration : ).
> > 
> > Going further, how about extracting registry part into a separate 
> > patch? It will make reviewing easier. Also, it would be great to see some 
> > registry tests as well.
> 
> Yongqiao Wang wrote:
> Thanks Alex. Personally, I find it more difficult to review a chain of 
> commits than a single, a single patch can give a whole picture of a feature 
> at a time. In addition, the main reason is Adam has completed to review this 
> patch, if I split it into some small patches, then maybe Adam needs to review 
> them again before commiting them. Can we keep this patch except make the 
> smaller chagnes for addressing comments? can you just review the changes to 
> each file one at a time in the this commit? Based on your comments, I will 
> post another patch for registery test later.
> 
> For moving the implementation out of the header, I will update this 
> patches later.
> 
> Adam B wrote:
> I agree with Yongqioa. While patches with <100 lines are quicker/easier 
> to review, this patch is only about 300 new/changed lines, and I like to 
> think I've reviewed it pretty thoroughly already. Please review the patch as 
> is, and let us know if there's anything for which we should block the commit.
> We can pull the implementation out of the header in a separate, follow-up 
> patch.
> We can also add additional registry tests and/or authz tests in a 
> follow-up patch, if they aren't already covered in 
> https://reviews.apache.org/r/41790/
> In the future, we can encourage Yongqiao to break up larger patches 
> earlier in the review process.

I have posted another patch https://reviews.apache.org/r/43863/ to move the 
implementation of updateWeights operation out of the header.


- Yongqiao


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


On Feb. 14, 2016, 12:02 p.m., Yongqiao Wang wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41681/
> ---
> 
> (Updated Feb. 14, 2016, 12:02 p.m.)
> 
> 
> Review request for mesos, Adam B, Neil Conway, and Qian Zhang.
> 
> 
> Bugs: MESOS-4214
> https://issues.apache.org/jira/browse/MESOS-4214
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Introduce HTTP endpoint /weights for updating weight.
> 
> 
> Diffs
> -
> 
>   include/mesos/authorizer/authorizer.hpp 
> 5ee3c7afadd131802c93febbb6b4dbad069c2d81 
>   include/mesos/authorizer/authorizer.proto 
> 226441f8cbd6d0828bf1636cc08c21ffcc75e6a7 
>   src/CMakeLists.txt 9ab84c0898b3adce6063cc50b04ee74cf1471609 
>   src/Makefile.am 5813ab2c33a7de6b612064e894e5f15b5a474e2b 
>   src/authorizer/local/authorizer.hpp 
> c7321c276d566eca6a91f45c546468bea1b0da15 
>   src/authorizer/local/authorizer.cpp 
> 9557bbdf68ff182c4538bbf70cee576d717abc05 
>   src/master/http.cpp f92212bf69f9db51d729347fb553e74e28e105fd 
>   src/master/master.hpp 2f2ad2ada508e1923bf995ab124367a3b082b572 
>   src/master/master.cpp e1ca81dab85a7ab1391eca0d6bd995548bf79c22 
>   src/master/registry.proto 9958f9c2bdb785390fca2f292b65d5a9310434d5 
>   src/master/weights_handler.cpp PRE-CREATION 
>   src/tests/mesos.hpp 242a11658c0a9ba4caced9b2b2bdbcb921f7fdd0 
>   src/tests/mesos.cpp e0f641c6828833de13a0a233e39ff6dc3f343d5c 
> 
> Diff: https://reviews.apache.org/r/41681/diff/
> 
> 
> Testing
> ---
> 
> Make & Make check successfully!
> 
> $ (./mesos-master.sh --ip=127.0.0.1 --work_dir=/tmp/mesos-master  
> --weights="role1=4.2,role2=3.1" --authenticate_http 
> --credentials=/opt/credentials.json  >> /tmp/mesos-master.log 2>&1 &)
> $ curl http://localhost:5050/roles | python -mjson.tool
> {
> "roles": [
> {
> "frameworks": [ ], 
> "name": "*", 
> "resources": {
> "cpus": 0, 
> "disk": 0, 
> "mem": 0
> }, 
> "weight": 1
> }, 
> {
>

Review Request 43863: Move the implementation of updateWeights out of header.

2016-02-22 Thread Yongqiao Wang

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

Review request for mesos, Adam B and Alexander Rukletsov.


Bugs: MESOS-4214
https://issues.apache.org/jira/browse/MESOS-4214


Repository: mesos


Description
---

Move the implementation of updateWeights out of header.


Diffs
-

  src/CMakeLists.txt 5cf0ec8c475839ad8717192a37f01546cbcccd7a 
  src/Makefile.am 73e7ff06ba064c9b04f191009522d7808a7ab58e 
  src/master/master.hpp 13c6ff153e77c527822309e787942eb463d59e7d 
  src/master/master.cpp b453bc7fca05c192df616b7d80132985b3248547 
  src/master/weights.hpp PRE-CREATION 
  src/master/weights.cpp PRE-CREATION 
  src/master/weights_handler.cpp PRE-CREATION 

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


Testing
---

make && make check successfully!


Thanks,

Yongqiao Wang



Review Request 43824: Addressed comments of 41672.

2016-02-21 Thread Yongqiao Wang

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

Review request for mesos, Adam B and Alexander Rukletsov.


Bugs: MESOS-4200
https://issues.apache.org/jira/browse/MESOS-4200


Repository: mesos


Description
---

Addressed comments of 41672.


Diffs
-

  src/tests/hierarchical_allocator_tests.cpp 
5f771f02db9bd098f3cd36730cd84bf2f5e87a33 

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


Testing
---

make && make check successfully.


Thanks,

Yongqiao Wang



Re: Review Request 41672: Test case(s) for weights + allocation behaviour.

2016-02-21 Thread Yongqiao Wang


> On Feb. 19, 2016, 9:31 a.m., Alexander Rukletsov wrote:
> >
> 
> Adam B wrote:
> Yongqiao, since Alex didn't get his review in before I committed the 
> patch, could you create a new patch addressing his feedback and link to it 
> from the comments here? Thanks.

Thanks Adam and Alex, I have posted patch https://reviews.apache.org/r/43824/ 
to address the comments as below.


> On Feb. 19, 2016, 9:31 a.m., Alexander Rukletsov wrote:
> > src/tests/hierarchical_allocator_tests.cpp, line 2338
> > <https://reviews.apache.org/r/41672/diff/12/?file=1203046#file1203046line2338>
> >
> > Backticks instead of single quotes, please! Here and everywhere.

I find single quote?apostrophe and backticks are all used in our comments, You 
can check this file and others like `master_quota_tests.cpp` 
`master_maintenance_tests.cpp`, etc. Cloud you tell me what is the rule for 
using them in comments, I will follow up later. Thanks.


> On Feb. 19, 2016, 9:31 a.m., Alexander Rukletsov wrote:
> > src/tests/hierarchical_allocator_tests.cpp, lines 2423-2433
> > <https://reviews.apache.org/r/41672/diff/12/?file=1203046#file1203046line2423>
> >
> > Will it be cleaner to put resources from the allocation into a hashmap 
> > by framework id? I think this way you can even get rid of the loop.
> > 
> > Same suggestions for the section below.

Personallly, the current implementation is cleaner, if we using a loop for 
this, we also need to check the framework Id in the loop due to there 
allocation size and resources are different.


> On Feb. 19, 2016, 9:31 a.m., Alexander Rukletsov wrote:
> > src/tests/hierarchical_allocator_tests.cpp, line 2373
> > <https://reviews.apache.org/r/41672/diff/12/?file=1203046#file1203046line2373>
> >
> > You can put framework id's into a `std::set` instead. Given there are 
> > two allocations, there is a guarantee, that there will be no attempts to 
> > put the same framework into the set twice.

In the current implementation, we only need to check the allocation size for 
each framework, it does not care the size of whole contianer (currentt is 
hashmap), so I think use hashmap can meet the current requirement.


> On Feb. 19, 2016, 9:31 a.m., Alexander Rukletsov wrote:
> > src/tests/hierarchical_allocator_tests.cpp, lines 2402-2403
> > <https://reviews.apache.org/r/41672/diff/12/?file=1203046#file1203046line2402>
> >
> > If you use `set` as proposed above, you can check  set against set here.

Sorry to do not understand your suggestion here, current using hashmap and use 
frameworkid as it's key, here to check value for allocation number for each 
framework.


- Yongqiao


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


On Jan. 20, 2016, 8:36 a.m., Yongqiao Wang wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41672/
> ---
> 
> (Updated Jan. 20, 2016, 8:36 a.m.)
> 
> 
> Review request for mesos, Adam B, Neil Conway, and Qian Zhang.
> 
> 
> Bugs: MESOS-4200
> https://issues.apache.org/jira/browse/MESOS-4200
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Test case(s) for weights + allocation behaviour.
> 
> 
> Diffs
> -
> 
>   src/tests/hierarchical_allocator_tests.cpp 
> 953712149bd951789beb29c72779c4ac65aa48dc 
> 
> Diff: https://reviews.apache.org/r/41672/diff/
> 
> 
> Testing
> ---
> 
> Make check done:
> $ ./src/mesos-tests --gtest_filter=HierarchicalAllocatorTest.UpdateWeight
> Source directory: /Users/yqwyq/Desktop/mesos
> Build directory: /Users/yqwyq/Desktop/mesos/build
> [==] Running 1 test from 1 test case.
> [--] Global test environment set-up.
> [--] 1 test from HierarchicalAllocatorTest
> [ RUN  ] HierarchicalAllocatorTest.UpdateWeight
> [   OK ] HierarchicalAllocatorTest.UpdateWeight (87 ms)
> [--] 1 test from HierarchicalAllocatorTest (87 ms total)
> 
> [--] Global test environment tear-down
> [==] 1 test from 1 test case ran. (176 ms total)
> [  PASSED  ] 1 test.
> 
> 
> Thanks,
> 
> Yongqiao Wang
> 
>



Re: Review Request 41681: Introduce HTTP endpoint /weights for updating weight.

2016-02-21 Thread Yongqiao Wang


> On Feb. 19, 2016, 10:24 a.m., Alexander Rukletsov wrote:
> > src/master/master.hpp, lines 1530-1531
> > <https://reviews.apache.org/r/41681/diff/32/?file=1241338#file1241338line1530>
> >
> > Let's pull at least the implementation out of the header. You may look 
> > at maintenance and quota for inspiration : ).
> > 
> > Going further, how about extracting registry part into a separate 
> > patch? It will make reviewing easier. Also, it would be great to see some 
> > registry tests as well.

Thanks Alex. Personally, I find it more difficult to review a chain of commits 
than a single, a single patch can give a whole picture of a feature at a time. 
In addition, the main reason is Adam has completed to review this patch, if I 
split it into some small patches, then maybe Adam needs to review them again 
before commiting them. Can we keep this patch except make the smaller chagnes 
for addressing comments? can you just review the changes to each file one at a 
time in the this commit? Based on your comments, I will post another patch for 
registery test later.

For moving the implementation out of the header, I will update this patches 
later.


- Yongqiao


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


On Feb. 14, 2016, 12:02 p.m., Yongqiao Wang wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41681/
> ---
> 
> (Updated Feb. 14, 2016, 12:02 p.m.)
> 
> 
> Review request for mesos, Adam B, Neil Conway, and Qian Zhang.
> 
> 
> Bugs: MESOS-4214
> https://issues.apache.org/jira/browse/MESOS-4214
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Introduce HTTP endpoint /weights for updating weight.
> 
> 
> Diffs
> -
> 
>   include/mesos/authorizer/authorizer.hpp 
> 5ee3c7afadd131802c93febbb6b4dbad069c2d81 
>   include/mesos/authorizer/authorizer.proto 
> 226441f8cbd6d0828bf1636cc08c21ffcc75e6a7 
>   src/CMakeLists.txt 9ab84c0898b3adce6063cc50b04ee74cf1471609 
>   src/Makefile.am 5813ab2c33a7de6b612064e894e5f15b5a474e2b 
>   src/authorizer/local/authorizer.hpp 
> c7321c276d566eca6a91f45c546468bea1b0da15 
>   src/authorizer/local/authorizer.cpp 
> 9557bbdf68ff182c4538bbf70cee576d717abc05 
>   src/master/http.cpp f92212bf69f9db51d729347fb553e74e28e105fd 
>   src/master/master.hpp 2f2ad2ada508e1923bf995ab124367a3b082b572 
>   src/master/master.cpp e1ca81dab85a7ab1391eca0d6bd995548bf79c22 
>   src/master/registry.proto 9958f9c2bdb785390fca2f292b65d5a9310434d5 
>   src/master/weights_handler.cpp PRE-CREATION 
>   src/tests/mesos.hpp 242a11658c0a9ba4caced9b2b2bdbcb921f7fdd0 
>   src/tests/mesos.cpp e0f641c6828833de13a0a233e39ff6dc3f343d5c 
> 
> Diff: https://reviews.apache.org/r/41681/diff/
> 
> 
> Testing
> ---
> 
> Make & Make check successfully!
> 
> $ (./mesos-master.sh --ip=127.0.0.1 --work_dir=/tmp/mesos-master  
> --weights="role1=4.2,role2=3.1" --authenticate_http 
> --credentials=/opt/credentials.json  >> /tmp/mesos-master.log 2>&1 &)
> $ curl http://localhost:5050/roles | python -mjson.tool
> {
> "roles": [
> {
> "frameworks": [ ], 
> "name": "*", 
> "resources": {
> "cpus": 0, 
> "disk": 0, 
> "mem": 0
> }, 
> "weight": 1
> }, 
> {
> "frameworks": [ ], 
> "name": "role1", 
> "resources": {
> "cpus": 0, 
> "disk": 0, 
> "mem": 0
> }, 
> "weight": 4.2
> }, 
> {
> "frameworks": [ ], 
> "name": "role2", 
> "resources": {
> "cpus": 0, 
> "disk": 0, 
> "mem": 0
> }, 
> "weight": 3.1
> }
> ]
> }
> 
> Test update:
> $ curl --user framework1:secret_string1 --data 
> "[{\"weight\":1.8,\"role\":\"role1\"},{\"weight\":1.0,\"role\":\"role2\"},{\"weight\":

Re: Review Request 41597: Extending allocator interface to support dynamic weights.

2016-02-20 Thread Yongqiao Wang


> On Feb. 19, 2016, 9:36 a.m., Alexander Rukletsov wrote:
> > src/master/allocator/mesos/hierarchical.cpp, lines 1068-1070
> > <https://reviews.apache.org/r/41597/diff/54/?file=1241326#file1241326line1068>
> >
> > Why don't we need to set `rebalance` here?
> 
> Yongqiao Wang wrote:
> According to my understanding, A role appears in `quotaRoleSorter` if it 
> has a quota but it does not means it has one or more registered frameworks, 
> so if there is no framework register to this role, it does not need to 
> trigger the allocation immediately after changing it's weight.
> 
> Alexander Rukletsov wrote:
> This is correct, there may be no frameworks in a quota'd role. However, 
> there may also be some. Currently they are also added to `roleSorter`, but it 
> may change in the future. Can we at least add a comment explaining why we are 
> not rebalancing for the quota sorter?

OK, I have posted a new patch for adding this comments:  
https://reviews.apache.org/r/43806/


- Yongqiao


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


On Feb. 14, 2016, 11:37 a.m., Yongqiao Wang wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41597/
> ---
> 
> (Updated Feb. 14, 2016, 11:37 a.m.)
> 
> 
> Review request for mesos, Adam B, Neil Conway, and Qian Zhang.
> 
> 
> Bugs: MESOS-3943
> https://issues.apache.org/jira/browse/MESOS-3943
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Extending allocator interface to support dynamic weights.
> 
> 
> Diffs
> -
> 
>   include/mesos/master/allocator.hpp e163669c9c4e4c98572968f18987704b60722a79 
>   include/mesos/mesos.proto 0bd5abadb5abe052161963ca995c396f1ed832f2 
>   include/mesos/v1/mesos.proto 38e04cb19e303d1c71d2afad6ea73137aaa7403a 
>   src/master/allocator/mesos/allocator.hpp 
> 581eaad376e7b2febe0b6359014617b935a677a3 
>   src/master/allocator/mesos/hierarchical.hpp 
> 20d7ceb1a75ea5cb9efb1fc7fb085265b32864fe 
>   src/master/allocator/mesos/hierarchical.cpp 
> a9d2c23162892e0f97d89a076d2311091d91 
>   src/master/allocator/sorter/drf/sorter.hpp 
> 4669149b81de39b4bb921ef7cd6787aa583f6e40 
>   src/master/allocator/sorter/drf/sorter.cpp 
> 18797e42a9c2bd20392020237cfae600a5ffe12c 
>   src/master/allocator/sorter/sorter.hpp 
> a0a779b81f6d048271f15256b38ff907ae144b83 
>   src/tests/allocator.hpp 206e9ac3a83038a691f7929bdd627042b0f363b0 
> 
> Diff: https://reviews.apache.org/r/41597/diff/
> 
> 
> Testing
> ---
> 
> Make & Make check successfully!
> 
> Test case: https://reviews.apache.org/r/41672/
> 
> 
> Thanks,
> 
> Yongqiao Wang
> 
>



Review Request 43806: Add comments for rebalance.

2016-02-20 Thread Yongqiao Wang

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

Review request for mesos, Adam B and Alexander Rukletsov.


Bugs: MESOS-3943
https://issues.apache.org/jira/browse/MESOS-3943


Repository: mesos


Description
---

Add comments for rebalance.


Diffs
-

  src/master/allocator/mesos/hierarchical.cpp 
5ef29f26ec8071f79c2f4f78dbe2bb0a613cc92d 

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


Testing
---


Thanks,

Yongqiao Wang



Re: Review Request 41597: Extending allocator interface to support dynamic weights.

2016-02-19 Thread Yongqiao Wang


> On Feb. 19, 2016, 9:36 a.m., Alexander Rukletsov wrote:
> > src/master/allocator/mesos/hierarchical.cpp, lines 1068-1070
> > <https://reviews.apache.org/r/41597/diff/54/?file=1241326#file1241326line1068>
> >
> > Why don't we need to set `rebalance` here?

According to my understanding, A role appears in `quotaRoleSorter` if it has a 
quota but it does not means it has one or more registered frameworks, so if 
there is no framework register to this role, it does not need to trigger the 
allocation immediately after changing it's weight.


- Yongqiao


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


On Feb. 14, 2016, 11:37 a.m., Yongqiao Wang wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41597/
> ---
> 
> (Updated Feb. 14, 2016, 11:37 a.m.)
> 
> 
> Review request for mesos, Adam B, Neil Conway, and Qian Zhang.
> 
> 
> Bugs: MESOS-3943
> https://issues.apache.org/jira/browse/MESOS-3943
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Extending allocator interface to support dynamic weights.
> 
> 
> Diffs
> -
> 
>   include/mesos/master/allocator.hpp e163669c9c4e4c98572968f18987704b60722a79 
>   include/mesos/mesos.proto 0bd5abadb5abe052161963ca995c396f1ed832f2 
>   include/mesos/v1/mesos.proto 38e04cb19e303d1c71d2afad6ea73137aaa7403a 
>   src/master/allocator/mesos/allocator.hpp 
> 581eaad376e7b2febe0b6359014617b935a677a3 
>   src/master/allocator/mesos/hierarchical.hpp 
> 20d7ceb1a75ea5cb9efb1fc7fb085265b32864fe 
>   src/master/allocator/mesos/hierarchical.cpp 
> a9d2c23162892e0f97d89a076d2311091d91 
>   src/master/allocator/sorter/drf/sorter.hpp 
> 4669149b81de39b4bb921ef7cd6787aa583f6e40 
>   src/master/allocator/sorter/drf/sorter.cpp 
> 18797e42a9c2bd20392020237cfae600a5ffe12c 
>   src/master/allocator/sorter/sorter.hpp 
> a0a779b81f6d048271f15256b38ff907ae144b83 
>   src/tests/allocator.hpp 206e9ac3a83038a691f7929bdd627042b0f363b0 
> 
> Diff: https://reviews.apache.org/r/41597/diff/
> 
> 
> Testing
> ---
> 
> Make & Make check successfully!
> 
> Test case: https://reviews.apache.org/r/41672/
> 
> 
> Thanks,
> 
> Yongqiao Wang
> 
>



Re: Review Request 42719: Add doc for weights.

2016-02-18 Thread Yongqiao Wang

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

(Updated Feb. 19, 2016, 7:56 a.m.)


Review request for mesos and Adam B.


Changes
---

Addressed comments of Adam.


Bugs: MESOS-3945
https://issues.apache.org/jira/browse/MESOS-3945


Repository: mesos


Description
---

Add doc for weights.


Diffs (updated)
-

  docs/home.md 07214b927c112d7a180507ae03245892455fd757 
  docs/weights.md PRE-CREATION 

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


Testing
---


Thanks,

Yongqiao Wang



Re: Review Request 43593: Add test for spliting revocable resources in separate offer.

2016-02-16 Thread Yongqiao Wang

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

(Updated Feb. 17, 2016, 3:01 a.m.)


Review request for mesos, Guangya Liu, Klaus Ma, Niklas Nielsen, Qian Zhang, 
Jian Qiu, and Vinod Kone.


Changes
---

Remove the duplicate check.


Bugs: MESOS-2646
https://issues.apache.org/jira/browse/MESOS-2646


Repository: mesos


Description
---

Add test for spliting revocable resources in separate offer.


Diffs (updated)
-

  src/tests/oversubscription_tests.cpp d4ae81972fd218c58a413d1968a4e9acbee52fd3 

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


Testing
---

Make && Make check.


Thanks,

Yongqiao Wang



Re: Review Request 43041: Update Master to send revocable resources in separate offers.

2016-02-16 Thread Yongqiao Wang

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

(Updated Feb. 17, 2016, 3 a.m.)


Review request for mesos, Guangya Liu, Klaus Ma, Niklas Nielsen, Qian Zhang, 
Jian Qiu, and Vinod Kone.


Changes
---

Rebase.


Bugs: MESOS-2646
https://issues.apache.org/jira/browse/MESOS-2646


Repository: mesos


Description
---

Update Master to send revocable resources in separate offers.


Diffs (updated)
-

  src/master/master.hpp 2f2ad2ada508e1923bf995ab124367a3b082b572 
  src/master/master.cpp e1ca81dab85a7ab1391eca0d6bd995548bf79c22 
  src/tests/oversubscription_tests.cpp d4ae81972fd218c58a413d1968a4e9acbee52fd3 

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


Testing
---

Make && Make check
 
Test: https://reviews.apache.org/r/43593/


Thanks,

Yongqiao Wang



Re: Review Request 43593: Add test for spliting revocable resources in separate offer.

2016-02-16 Thread Yongqiao Wang

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

(Updated Feb. 16, 2016, 12:02 p.m.)


Review request for mesos, Guangya Liu, Klaus Ma, Niklas Nielsen, Qian Zhang, 
Jian Qiu, and Vinod Kone.


Changes
---

Rebase.


Bugs: MESOS-2646
https://issues.apache.org/jira/browse/MESOS-2646


Repository: mesos


Description
---

Add test for spliting revocable resources in separate offer.


Diffs (updated)
-

  src/tests/oversubscription_tests.cpp d4ae81972fd218c58a413d1968a4e9acbee52fd3 

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


Testing
---

Make && Make check.


Thanks,

Yongqiao Wang



Re: Review Request 43041: Update Master to send revocable resources in separate offers.

2016-02-16 Thread Yongqiao Wang

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

(Updated Feb. 16, 2016, 11:57 a.m.)


Review request for mesos, Guangya Liu, Klaus Ma, Niklas Nielsen, Qian Zhang, 
Jian Qiu, and Vinod Kone.


Changes
---

Addressed DA's comments.


Bugs: MESOS-2646
https://issues.apache.org/jira/browse/MESOS-2646


Repository: mesos


Description
---

Update Master to send revocable resources in separate offers.


Diffs (updated)
-

  src/master/master.hpp 2f2ad2ada508e1923bf995ab124367a3b082b572 
  src/master/master.cpp e1ca81dab85a7ab1391eca0d6bd995548bf79c22 
  src/tests/oversubscription_tests.cpp d4ae81972fd218c58a413d1968a4e9acbee52fd3 

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


Testing
---

Make && Make check
 
Test: https://reviews.apache.org/r/43593/


Thanks,

Yongqiao Wang



Re: Review Request 43041: Update Master to send revocable resources in separate offers.

2016-02-16 Thread Yongqiao Wang


> On Feb. 16, 2016, 10:08 a.m., Klaus Ma wrote:
> > src/master/master.cpp, line 5285
> > <https://reviews.apache.org/r/43041/diff/4/?file=1241830#file1241830line5285>
> >
> > Use `Resources::nonRevocable()`
> > 
> > Maybe use `Try createOffer(...)` is better; so we can check the 
> > parameters in `createOffer()`.

Use 'Try' except some error happened in createOffer function, in this 
patch use 'Offer' is enough due to no any error happened.


- Yongqiao


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


On Feb. 16, 2016, 8:52 a.m., Yongqiao Wang wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/43041/
> ---
> 
> (Updated Feb. 16, 2016, 8:52 a.m.)
> 
> 
> Review request for mesos, Guangya Liu, Klaus Ma, Niklas Nielsen, Qian Zhang, 
> Jian Qiu, and Vinod Kone.
> 
> 
> Bugs: MESOS-2646
> https://issues.apache.org/jira/browse/MESOS-2646
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Update Master to send revocable resources in separate offers.
> 
> 
> Diffs
> -
> 
>   src/master/master.hpp 2f2ad2ada508e1923bf995ab124367a3b082b572 
>   src/master/master.cpp e1ca81dab85a7ab1391eca0d6bd995548bf79c22 
>   src/tests/oversubscription_tests.cpp 
> d4ae81972fd218c58a413d1968a4e9acbee52fd3 
> 
> Diff: https://reviews.apache.org/r/43041/diff/
> 
> 
> Testing
> ---
> 
> Make && Make check
>  
> Test: https://reviews.apache.org/r/43593/
> 
> 
> Thanks,
> 
> Yongqiao Wang
> 
>



Re: Review Request 43041: Update Master to send revocable resources in separate offers.

2016-02-16 Thread Yongqiao Wang

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

(Updated Feb. 16, 2016, 8:52 a.m.)


Review request for mesos, Guangya Liu, Klaus Ma, Niklas Nielsen, Qian Zhang, 
Jian Qiu, and Vinod Kone.


Bugs: MESOS-2646
https://issues.apache.org/jira/browse/MESOS-2646


Repository: mesos


Description
---

Update Master to send revocable resources in separate offers.


Diffs (updated)
-

  src/master/master.hpp 2f2ad2ada508e1923bf995ab124367a3b082b572 
  src/master/master.cpp e1ca81dab85a7ab1391eca0d6bd995548bf79c22 
  src/tests/oversubscription_tests.cpp d4ae81972fd218c58a413d1968a4e9acbee52fd3 

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


Testing
---

Make && Make check
 
Test: https://reviews.apache.org/r/43593/


Thanks,

Yongqiao Wang



Re: Review Request 43041: Update Master to send revocable resources in separate offers.

2016-02-16 Thread Yongqiao Wang

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

(Updated Feb. 16, 2016, 8:45 a.m.)


Review request for mesos, Guangya Liu, Klaus Ma, Niklas Nielsen, Qian Zhang, 
Jian Qiu, and Vinod Kone.


Changes
---

Addressed comments of Jian.


Bugs: MESOS-2646
https://issues.apache.org/jira/browse/MESOS-2646


Repository: mesos


Description
---

Update Master to send revocable resources in separate offers.


Diffs (updated)
-

  src/master/master.hpp 2f2ad2ada508e1923bf995ab124367a3b082b572 
  src/master/master.cpp e1ca81dab85a7ab1391eca0d6bd995548bf79c22 
  src/tests/oversubscription_tests.cpp d4ae81972fd218c58a413d1968a4e9acbee52fd3 

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


Testing
---

Make && Make check
 
Test: https://reviews.apache.org/r/43593/


Thanks,

Yongqiao Wang



Re: Review Request 43041: Update Master to send revocable resources in separate offers.

2016-02-16 Thread Yongqiao Wang

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

(Updated Feb. 16, 2016, 8:21 a.m.)


Review request for mesos, Guangya Liu, Klaus Ma, Niklas Nielsen, Qian Zhang, 
Jian Qiu, and Vinod Kone.


Changes
---

Update the offer seqence.


Bugs: MESOS-2646
https://issues.apache.org/jira/browse/MESOS-2646


Repository: mesos


Description (updated)
---

Update Master to send revocable resources in separate offers.


Diffs (updated)
-

  src/master/master.hpp 2f2ad2ada508e1923bf995ab124367a3b082b572 
  src/master/master.cpp e1ca81dab85a7ab1391eca0d6bd995548bf79c22 
  src/tests/oversubscription_tests.cpp d4ae81972fd218c58a413d1968a4e9acbee52fd3 

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


Testing
---

Make && Make check
 
Test: https://reviews.apache.org/r/43593/


Thanks,

Yongqiao Wang



Re: Review Request 43041: Update Master to send revocable resources in separate offers.

2016-02-16 Thread Yongqiao Wang

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

(Updated Feb. 16, 2016, 8:09 a.m.)


Review request for mesos, Guangya Liu, Klaus Ma, Niklas Nielsen, Qian Zhang, 
Jian Qiu, and Vinod Kone.


Changes
---

Add test.


Bugs: MESOS-2646
https://issues.apache.org/jira/browse/MESOS-2646


Repository: mesos


Description
---

Split regular and revocable resources into separate offers,
so that rescinding offers with revocable resources does not
affect offers with regular resources.


Diffs
-

  src/master/master.hpp 3a7e18232323a1c051bcc97915484b1195fffe58 
  src/master/master.cpp 98441a543611d4083b2495ee103f0ab5e2187e83 
  src/tests/oversubscription_tests.cpp 6f43103e81303015fb614653e3bfece55009d1bf 

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


Testing (updated)
---

Make && Make check
 
Test: https://reviews.apache.org/r/43593/


Thanks,

Yongqiao Wang



  1   2   3   >