Re: Review Request 36900: Publish MasterInfo to ZK in JSON format

2015-07-29 Thread Marco Massenzio

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

(Updated July 29, 2015, 9:07 p.m.)


Review request for mesos, Anand Mazumdar, Isabel Jimenez, and Vinod Kone.


Changes
---

rebased


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


Repository: mesos


Description
---

As part of the support for non-libmesos linked client to
interact with the HTTP API, we also provide the Master information
stored in ZooKeeper in a way that is deserializable also for
clients that do not necessarily know how to decode a MasterInfo
protocol buffer.

This patch publishes the data in JSON format and has been tested,
summarily, with 2 masters running this patch alongside a 0.23 Master and
one each of 0.24 and 0.23 Agent nodes.

Please note this patch does not require specific unit testing, as the 
functionality
is already widely tested in existing `ZooKeeper*` tests, as well as 
`MasterDetector*` ones.


Diffs (updated)
-

  src/master/contender.cpp 2af70c7d1acf274db40cae1641cd305249a471ec 

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


Testing
---

make check
also ran: 3x Masters (2x 0.24 + 1x 0.23) / 2x Slaves (1x 0.23 + 1x 0.24)
the 0.24's were running this patch.

Also verified in ZK that the data was correct JSON:
```
{
  address:{
hostname:10.0.77.243,
ip:10.0.77.243,
port:5050
  },
  hostname:10.0.77.243,
  id:20150728-165830-4081909770-5050-64014,
  ip:4081909770,
  pid:master@10.0.77.243:5050,
  port:5050,
  version:0.24.0
}
```

Not sure why Reviewbot failed, but the tests all passed:
```
[--] Global test environment tear-down
[==] 684 tests from 97 test cases ran. (274274 ms total)
[  PASSED  ] 684 tests.

  YOU HAVE 12 DISABLED TESTS
```
the error seems to be with files left in `src/credentials` and 
`src/master/replicated_log`:
```
ERROR: files left in build directory after distclean:
./src/credentials
./src/master/replicated_log/CURRENT
./src/master/replicated_log/LOG
./src/master/replicated_log/MANIFEST-06
./src/master/replicated_log/11.sst
./src/master/replicated_log/LOCK
./src/master/replicated_log/09.log
./src/master/replicated_log/LOG.old
make[1]: *** [distcleancheck] Error 1
```
Am I missing something here?


Thanks,

Marco Massenzio



Re: Review Request 36900: Publish MasterInfo to ZK in JSON format

2015-07-29 Thread Vinod Kone

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



src/master/contender.cpp (line 239)
https://reviews.apache.org/r/36900/#comment147893

s/jsonInfo/json/



src/master/contender.cpp (line 240)
https://reviews.apache.org/r/36900/#comment147894

kill this.



src/master/contender.cpp (line 241)
https://reviews.apache.org/r/36900/#comment147744

kill this line.



src/master/contender.cpp (line 245)
https://reviews.apache.org/r/36900/#comment147895

s/data/stringify(json)/


- Vinod Kone


On July 29, 2015, 5:27 a.m., Marco Massenzio wrote:
 
 ---
 This is an automatically generated e-mail. To reply, visit:
 https://reviews.apache.org/r/36900/
 ---
 
 (Updated July 29, 2015, 5:27 a.m.)
 
 
 Review request for mesos, Anand Mazumdar, Isabel Jimenez, and Vinod Kone.
 
 
 Bugs: MESOS-3135
 https://issues.apache.org/jira/browse/MESOS-3135
 
 
 Repository: mesos
 
 
 Description
 ---
 
 As part of the support for non-libmesos linked client to
 interact with the HTTP API, we also provide the Master information
 stored in ZooKeeper in a way that is deserializable also for
 clients that do not necessarily know how to decode a MasterInfo
 protocol buffer.
 
 This patch publishes the data in JSON format and has been tested,
 summarily, with 2 masters running this patch alongside a 0.23 Master and
 one each of 0.24 and 0.23 Agent nodes.
 
 Please note this patch does not require specific unit testing, as the 
 functionality
 is already widely tested in existing `ZooKeeper*` tests, as well as 
 `MasterDetector*` ones.
 
 
 Diffs
 -
 
   src/master/contender.cpp 2af70c7d1acf274db40cae1641cd305249a471ec 
 
 Diff: https://reviews.apache.org/r/36900/diff/
 
 
 Testing
 ---
 
 make check
 also ran: 3x Masters (2x 0.24 + 1x 0.23) / 2x Slaves (1x 0.23 + 1x 0.24)
 the 0.24's were running this patch.
 
 Also verified in ZK that the data was correct JSON:
 ```
 {
   address:{
 hostname:10.0.77.243,
 ip:10.0.77.243,
 port:5050
   },
   hostname:10.0.77.243,
   id:20150728-165830-4081909770-5050-64014,
   ip:4081909770,
   pid:master@10.0.77.243:5050,
   port:5050,
   version:0.24.0
 }
 ```
 
 Not sure why Reviewbot failed, but the tests all passed:
 ```
 [--] Global test environment tear-down
 [==] 684 tests from 97 test cases ran. (274274 ms total)
 [  PASSED  ] 684 tests.
 
   YOU HAVE 12 DISABLED TESTS
 ```
 the error seems to be with files left in `src/credentials` and 
 `src/master/replicated_log`:
 ```
 ERROR: files left in build directory after distclean:
 ./src/credentials
 ./src/master/replicated_log/CURRENT
 ./src/master/replicated_log/LOG
 ./src/master/replicated_log/MANIFEST-06
 ./src/master/replicated_log/11.sst
 ./src/master/replicated_log/LOCK
 ./src/master/replicated_log/09.log
 ./src/master/replicated_log/LOG.old
 make[1]: *** [distcleancheck] Error 1
 ```
 Am I missing something here?
 
 
 Thanks,
 
 Marco Massenzio
 




Re: Review Request 36900: Publish MasterInfo to ZK in JSON format

2015-07-29 Thread Marco Massenzio


 On July 29, 2015, 7:44 p.m., Vinod Kone wrote:
 

Thanks, I have the impression you were looking at an earlier revision, but no 
matter - the one I'll be uploading in a second will reflect your comments.


- Marco


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


On July 29, 2015, 5:27 a.m., Marco Massenzio wrote:
 
 ---
 This is an automatically generated e-mail. To reply, visit:
 https://reviews.apache.org/r/36900/
 ---
 
 (Updated July 29, 2015, 5:27 a.m.)
 
 
 Review request for mesos, Anand Mazumdar, Isabel Jimenez, and Vinod Kone.
 
 
 Bugs: MESOS-3135
 https://issues.apache.org/jira/browse/MESOS-3135
 
 
 Repository: mesos
 
 
 Description
 ---
 
 As part of the support for non-libmesos linked client to
 interact with the HTTP API, we also provide the Master information
 stored in ZooKeeper in a way that is deserializable also for
 clients that do not necessarily know how to decode a MasterInfo
 protocol buffer.
 
 This patch publishes the data in JSON format and has been tested,
 summarily, with 2 masters running this patch alongside a 0.23 Master and
 one each of 0.24 and 0.23 Agent nodes.
 
 Please note this patch does not require specific unit testing, as the 
 functionality
 is already widely tested in existing `ZooKeeper*` tests, as well as 
 `MasterDetector*` ones.
 
 
 Diffs
 -
 
   src/master/contender.cpp 2af70c7d1acf274db40cae1641cd305249a471ec 
 
 Diff: https://reviews.apache.org/r/36900/diff/
 
 
 Testing
 ---
 
 make check
 also ran: 3x Masters (2x 0.24 + 1x 0.23) / 2x Slaves (1x 0.23 + 1x 0.24)
 the 0.24's were running this patch.
 
 Also verified in ZK that the data was correct JSON:
 ```
 {
   address:{
 hostname:10.0.77.243,
 ip:10.0.77.243,
 port:5050
   },
   hostname:10.0.77.243,
   id:20150728-165830-4081909770-5050-64014,
   ip:4081909770,
   pid:master@10.0.77.243:5050,
   port:5050,
   version:0.24.0
 }
 ```
 
 Not sure why Reviewbot failed, but the tests all passed:
 ```
 [--] Global test environment tear-down
 [==] 684 tests from 97 test cases ran. (274274 ms total)
 [  PASSED  ] 684 tests.
 
   YOU HAVE 12 DISABLED TESTS
 ```
 the error seems to be with files left in `src/credentials` and 
 `src/master/replicated_log`:
 ```
 ERROR: files left in build directory after distclean:
 ./src/credentials
 ./src/master/replicated_log/CURRENT
 ./src/master/replicated_log/LOG
 ./src/master/replicated_log/MANIFEST-06
 ./src/master/replicated_log/11.sst
 ./src/master/replicated_log/LOCK
 ./src/master/replicated_log/09.log
 ./src/master/replicated_log/LOG.old
 make[1]: *** [distcleancheck] Error 1
 ```
 Am I missing something here?
 
 
 Thanks,
 
 Marco Massenzio
 




Re: Review Request 36900: Publish MasterInfo to ZK in JSON format

2015-07-29 Thread Mesos ReviewBot

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


Patch looks great!

Reviews applied: [36900]

All tests passed.

- Mesos ReviewBot


On July 29, 2015, 9:07 p.m., Marco Massenzio wrote:
 
 ---
 This is an automatically generated e-mail. To reply, visit:
 https://reviews.apache.org/r/36900/
 ---
 
 (Updated July 29, 2015, 9:07 p.m.)
 
 
 Review request for mesos, Anand Mazumdar, Isabel Jimenez, and Vinod Kone.
 
 
 Bugs: MESOS-3135
 https://issues.apache.org/jira/browse/MESOS-3135
 
 
 Repository: mesos
 
 
 Description
 ---
 
 As part of the support for non-libmesos linked client to
 interact with the HTTP API, we also provide the Master information
 stored in ZooKeeper in a way that is deserializable also for
 clients that do not necessarily know how to decode a MasterInfo
 protocol buffer.
 
 This patch publishes the data in JSON format and has been tested,
 summarily, with 2 masters running this patch alongside a 0.23 Master and
 one each of 0.24 and 0.23 Agent nodes.
 
 Please note this patch does not require specific unit testing, as the 
 functionality
 is already widely tested in existing `ZooKeeper*` tests, as well as 
 `MasterDetector*` ones.
 
 
 Diffs
 -
 
   src/master/contender.cpp 2af70c7d1acf274db40cae1641cd305249a471ec 
 
 Diff: https://reviews.apache.org/r/36900/diff/
 
 
 Testing
 ---
 
 make check
 also ran: 3x Masters (2x 0.24 + 1x 0.23) / 2x Slaves (1x 0.23 + 1x 0.24)
 the 0.24's were running this patch.
 
 Also verified in ZK that the data was correct JSON:
 ```
 {
   address:{
 hostname:10.0.77.243,
 ip:10.0.77.243,
 port:5050
   },
   hostname:10.0.77.243,
   id:20150728-165830-4081909770-5050-64014,
   ip:4081909770,
   pid:master@10.0.77.243:5050,
   port:5050,
   version:0.24.0
 }
 ```
 
 Not sure why Reviewbot failed, but the tests all passed:
 ```
 [--] Global test environment tear-down
 [==] 684 tests from 97 test cases ran. (274274 ms total)
 [  PASSED  ] 684 tests.
 
   YOU HAVE 12 DISABLED TESTS
 ```
 the error seems to be with files left in `src/credentials` and 
 `src/master/replicated_log`:
 ```
 ERROR: files left in build directory after distclean:
 ./src/credentials
 ./src/master/replicated_log/CURRENT
 ./src/master/replicated_log/LOG
 ./src/master/replicated_log/MANIFEST-06
 ./src/master/replicated_log/11.sst
 ./src/master/replicated_log/LOCK
 ./src/master/replicated_log/09.log
 ./src/master/replicated_log/LOG.old
 make[1]: *** [distcleancheck] Error 1
 ```
 Am I missing something here?
 
 
 Thanks,
 
 Marco Massenzio
 




Re: Review Request 36900: Publish MasterInfo to ZK in JSON format

2015-07-28 Thread Marco Massenzio

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

(Updated July 29, 2015, 1:58 a.m.)


Review request for mesos, Anand Mazumdar, Isabel Jimenez, and Vinod Kone.


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


Repository: mesos


Description
---

As part of the support for non-libmesos linked client to
interact with the HTTP API, we also provide the Master information
stored in ZooKeeper in a way that is deserializable also for
clients that do not necessarily know how to decode a MasterInfo
protocol buffer.

This patch publishes the data in JSON format and has been tested,
summarily, with 2 masters running this patch alongside a 0.23 Master and
one each of 0.24 and 0.23 Agent nodes.

Please note this patch does not require specific unit testing, as the 
functionality
is already widely tested in existing `ZooKeeper*` tests, as well as 
`MasterDetector*` ones.


Diffs
-

  src/master/contender.cpp 2af70c7d1acf274db40cae1641cd305249a471ec 

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


Testing (updated)
---

make check
also ran: 3x Masters (2x 0.24 + 1x 0.23) / 2x Slaves (1x 0.23 + 1x 0.24)
the 0.24's were running this patch.

Also verified in ZK that the data was correct JSON:
```
{
  address:{
hostname:10.0.77.243,
ip:10.0.77.243,
port:5050
  },
  hostname:10.0.77.243,
  id:20150728-165830-4081909770-5050-64014,
  ip:4081909770,
  pid:master@10.0.77.243:5050,
  port:5050,
  version:0.24.0
}
```

Not sure why Reviewbot failed, but the tests all passed:
```
[--] Global test environment tear-down
[==] 684 tests from 97 test cases ran. (274274 ms total)
[  PASSED  ] 684 tests.

  YOU HAVE 12 DISABLED TESTS
```
the error seems to be with files left in `src/credentials` and 
`src/master/replicated_log`:
```
ERROR: files left in build directory after distclean:
./src/credentials
./src/master/replicated_log/CURRENT
./src/master/replicated_log/LOG
./src/master/replicated_log/MANIFEST-06
./src/master/replicated_log/11.sst
./src/master/replicated_log/LOCK
./src/master/replicated_log/09.log
./src/master/replicated_log/LOG.old
make[1]: *** [distcleancheck] Error 1
```
Am I missing something here?


Thanks,

Marco Massenzio



Review Request 36900: Publish MasterInfo to ZK in JSON format

2015-07-28 Thread Marco Massenzio

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

Review request for mesos, Anand Mazumdar, Isabel Jimenez, and Vinod Kone.


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


Repository: mesos


Description
---

As part of the support for non-libmesos linked client to
interact with the HTTP API, we also provide the Master information
stored in ZooKeeper in a way that is deserializable also for
clients that do not necessarily know how to decode a MasterInfo
protocol buffer.

This patch publishes the data in JSON format and has been tested,
summarily, with 2 masters running this patch alongside a 0.23 Master and
one each of 0.24 and 0.23 Agent nodes.


Diffs
-

  src/master/contender.cpp 2af70c7d1acf274db40cae1641cd305249a471ec 

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


Testing
---

make check
also ran: 3x Masters (2x 0.24 + 1x 0.23) / 2x Slaves (1x 0.23 + 1x 0.24)
the 0.24's were running this patch.

Also verified in ZK that the data was correct JSON:
```
{
  address:{
hostname:10.0.77.243,
ip:10.0.77.243,
port:5050
  },
  hostname:10.0.77.243,
  id:20150728-165830-4081909770-5050-64014,
  ip:4081909770,
  pid:master@10.0.77.243:5050,
  port:5050,
  version:0.24.0
}
```


Thanks,

Marco Massenzio



Re: Review Request 36900: Publish MasterInfo to ZK in JSON format

2015-07-28 Thread Marco Massenzio

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

(Updated July 29, 2015, 12:36 a.m.)


Review request for mesos, Anand Mazumdar, Isabel Jimenez, and Vinod Kone.


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


Repository: mesos


Description (updated)
---

As part of the support for non-libmesos linked client to
interact with the HTTP API, we also provide the Master information
stored in ZooKeeper in a way that is deserializable also for
clients that do not necessarily know how to decode a MasterInfo
protocol buffer.

This patch publishes the data in JSON format and has been tested,
summarily, with 2 masters running this patch alongside a 0.23 Master and
one each of 0.24 and 0.23 Agent nodes.

Please note this patch does not require specific unit testing, as the 
functionality
is already widely tested in existing `ZooKeeper*` tests, as well as 
`MasterDetector*` ones.


Diffs
-

  src/master/contender.cpp 2af70c7d1acf274db40cae1641cd305249a471ec 

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


Testing
---

make check
also ran: 3x Masters (2x 0.24 + 1x 0.23) / 2x Slaves (1x 0.23 + 1x 0.24)
the 0.24's were running this patch.

Also verified in ZK that the data was correct JSON:
```
{
  address:{
hostname:10.0.77.243,
ip:10.0.77.243,
port:5050
  },
  hostname:10.0.77.243,
  id:20150728-165830-4081909770-5050-64014,
  ip:4081909770,
  pid:master@10.0.77.243:5050,
  port:5050,
  version:0.24.0
}
```


Thanks,

Marco Massenzio



Re: Review Request 36900: Publish MasterInfo to ZK in JSON format

2015-07-28 Thread Anand Mazumdar

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

Ship it!


LGTM minus Micro-Nits.


src/master/contender.cpp (line 239)
https://reviews.apache.org/r/36900/#comment147755

I am wondering if we even need this assignment entailing a copy ?

const string data = stringify(JSON::Protobuf(masterInfo.get()));



src/master/contender.cpp (line 240)
https://reviews.apache.org/r/36900/#comment147754

Nit: s/string/const string


- Anand Mazumdar


On July 29, 2015, 1:58 a.m., Marco Massenzio wrote:
 
 ---
 This is an automatically generated e-mail. To reply, visit:
 https://reviews.apache.org/r/36900/
 ---
 
 (Updated July 29, 2015, 1:58 a.m.)
 
 
 Review request for mesos, Anand Mazumdar, Isabel Jimenez, and Vinod Kone.
 
 
 Bugs: MESOS-3135
 https://issues.apache.org/jira/browse/MESOS-3135
 
 
 Repository: mesos
 
 
 Description
 ---
 
 As part of the support for non-libmesos linked client to
 interact with the HTTP API, we also provide the Master information
 stored in ZooKeeper in a way that is deserializable also for
 clients that do not necessarily know how to decode a MasterInfo
 protocol buffer.
 
 This patch publishes the data in JSON format and has been tested,
 summarily, with 2 masters running this patch alongside a 0.23 Master and
 one each of 0.24 and 0.23 Agent nodes.
 
 Please note this patch does not require specific unit testing, as the 
 functionality
 is already widely tested in existing `ZooKeeper*` tests, as well as 
 `MasterDetector*` ones.
 
 
 Diffs
 -
 
   src/master/contender.cpp 2af70c7d1acf274db40cae1641cd305249a471ec 
 
 Diff: https://reviews.apache.org/r/36900/diff/
 
 
 Testing
 ---
 
 make check
 also ran: 3x Masters (2x 0.24 + 1x 0.23) / 2x Slaves (1x 0.23 + 1x 0.24)
 the 0.24's were running this patch.
 
 Also verified in ZK that the data was correct JSON:
 ```
 {
   address:{
 hostname:10.0.77.243,
 ip:10.0.77.243,
 port:5050
   },
   hostname:10.0.77.243,
   id:20150728-165830-4081909770-5050-64014,
   ip:4081909770,
   pid:master@10.0.77.243:5050,
   port:5050,
   version:0.24.0
 }
 ```
 
 Not sure why Reviewbot failed, but the tests all passed:
 ```
 [--] Global test environment tear-down
 [==] 684 tests from 97 test cases ran. (274274 ms total)
 [  PASSED  ] 684 tests.
 
   YOU HAVE 12 DISABLED TESTS
 ```
 the error seems to be with files left in `src/credentials` and 
 `src/master/replicated_log`:
 ```
 ERROR: files left in build directory after distclean:
 ./src/credentials
 ./src/master/replicated_log/CURRENT
 ./src/master/replicated_log/LOG
 ./src/master/replicated_log/MANIFEST-06
 ./src/master/replicated_log/11.sst
 ./src/master/replicated_log/LOCK
 ./src/master/replicated_log/09.log
 ./src/master/replicated_log/LOG.old
 make[1]: *** [distcleancheck] Error 1
 ```
 Am I missing something here?
 
 
 Thanks,
 
 Marco Massenzio
 




Re: Review Request 36900: Publish MasterInfo to ZK in JSON format

2015-07-28 Thread Marco Massenzio

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

(Updated July 29, 2015, 5:27 a.m.)


Review request for mesos, Anand Mazumdar, Isabel Jimenez, and Vinod Kone.


Changes
---

Anand's comments


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


Repository: mesos


Description
---

As part of the support for non-libmesos linked client to
interact with the HTTP API, we also provide the Master information
stored in ZooKeeper in a way that is deserializable also for
clients that do not necessarily know how to decode a MasterInfo
protocol buffer.

This patch publishes the data in JSON format and has been tested,
summarily, with 2 masters running this patch alongside a 0.23 Master and
one each of 0.24 and 0.23 Agent nodes.

Please note this patch does not require specific unit testing, as the 
functionality
is already widely tested in existing `ZooKeeper*` tests, as well as 
`MasterDetector*` ones.


Diffs (updated)
-

  src/master/contender.cpp 2af70c7d1acf274db40cae1641cd305249a471ec 

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


Testing
---

make check
also ran: 3x Masters (2x 0.24 + 1x 0.23) / 2x Slaves (1x 0.23 + 1x 0.24)
the 0.24's were running this patch.

Also verified in ZK that the data was correct JSON:
```
{
  address:{
hostname:10.0.77.243,
ip:10.0.77.243,
port:5050
  },
  hostname:10.0.77.243,
  id:20150728-165830-4081909770-5050-64014,
  ip:4081909770,
  pid:master@10.0.77.243:5050,
  port:5050,
  version:0.24.0
}
```

Not sure why Reviewbot failed, but the tests all passed:
```
[--] Global test environment tear-down
[==] 684 tests from 97 test cases ran. (274274 ms total)
[  PASSED  ] 684 tests.

  YOU HAVE 12 DISABLED TESTS
```
the error seems to be with files left in `src/credentials` and 
`src/master/replicated_log`:
```
ERROR: files left in build directory after distclean:
./src/credentials
./src/master/replicated_log/CURRENT
./src/master/replicated_log/LOG
./src/master/replicated_log/MANIFEST-06
./src/master/replicated_log/11.sst
./src/master/replicated_log/LOCK
./src/master/replicated_log/09.log
./src/master/replicated_log/LOG.old
make[1]: *** [distcleancheck] Error 1
```
Am I missing something here?


Thanks,

Marco Massenzio