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

(Updated Feb. 28, 2016, 10:27 a.m.)


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


Changes
-------

Addressed comments of Adam.


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


Repository: mesos


Description
-------

Introduce HTTP endpoint /weights for updating weight.


Diffs (updated)
-----

  include/mesos/authorizer/authorizer.hpp 
5ee3c7afadd131802c93febbb6b4dbad069c2d81 
  include/mesos/authorizer/authorizer.proto 
84d2cb3fbff3fbc7c3854d6eec5a3a55ad5760f8 
  src/CMakeLists.txt 49a5645ef7242dbaee31e7b26dbbcb1f4f1f910e 
  src/Makefile.am 2a26261b513bb7c03437ed8e850c3b36b93d82f5 
  src/authorizer/local/authorizer.hpp c7321c276d566eca6a91f45c546468bea1b0da15 
  src/authorizer/local/authorizer.cpp a1486bd042e1d59e5ac99c2619fb3228c37b9788 
  src/master/http.cpp f3ce1aa22f5f753fcb254e9ecaa8ba571e3d2829 
  src/master/master.hpp 13c6ff153e77c527822309e787942eb463d59e7d 
  src/master/master.cpp 7c62f2a882a1c89d73f328b2ae665422fd84d7a1 
  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\":3.4,\"role\":\"role3\"}]"
 -X PUT http://127.0.0.1:5050/weights
$ 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
        }
    ]
}

Test recovuery:
$ ps -ef | grep mesos-master
501 56292     1   0  6:18PM ttys001    0:00.31 
/Users/yqwyq/Desktop/mesos/build/src/.libs/mesos-master --ip=127.0.0.1 
--work_dir=/tmp/mesos-master --weights=role1=4.2,role2=3.1 --authenticate_http 
--credentials=/opt/credentials.json
$ kill -9 56292

$ (./mesos-master.sh --ip=127.0.0.1 --work_dir=/tmp/mesos-master  
--weights="role1=4.2,role2=3.1,role6=9.0" --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.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

Reply via email to