> On June 1, 2015, 11:32 p.m., Marco Massenzio wrote: > > src/examples/java/TestPersistentVolumeFramework.java, line 239 > > <https://reviews.apache.org/r/33339/diff/10/?file=941652#file941652line239> > > > > unless I'm mistaken and this is a unit test (is it?) can we please > > rename this class in a more meaningful way? > > > > TestXxxx should be reserved for test classes.
Hmm, name it to TestPersistentVolumeScheduler is follow other exist examples. Like `TestScheduler` in `TestFramework.java` > On June 1, 2015, 11:32 p.m., Marco Massenzio wrote: > > src/examples/java/TestPersistentVolumeFramework.java, lines 301-304 > > <https://reviews.apache.org/r/33339/diff/10/?file=941652#file941652line301> > > > > you see? here, you would have: > > ``` > > Status status = applyResource(...); > > if (!status.ok()) { > > log.error("This went so horribly wrong: ", status.errMsg()); > > return; > > } > > ``` > > or something to that effect Use `System.out.println` here is also follow other exist Java examples. > On June 1, 2015, 11:32 p.m., Marco Massenzio wrote: > > src/examples/java/TestPersistentVolumeFramework.java, line 310 > > <https://reviews.apache.org/r/33339/diff/10/?file=941652#file941652line310> > > > > shouldn't you `.build()` here? > > > > also, a better pattern is to use `.toString()` (as opposed to force a > > conversion via `+`) - if that's what you are doing (is it? sorry if I got > > this one wrong!) Hmm, we don't need build here because Java protobuf api could pass a builder. `+ ""` should change to `toString` here. > On June 1, 2015, 11:32 p.m., Marco Massenzio wrote: > > src/examples/java/TestPersistentVolumeFramework.java, lines 344-352 > > <https://reviews.apache.org/r/33339/diff/10/?file=941652#file941652line344> > > > > this is almost identical code to L307-315: how about factoring out to a > > common `buildTaskInfo(String command)`? Sure, but it would not match the code ```cpp TaskInfo task; task.set_name(shard.name); task.mutable_task_id()->set_value(UUID::random().toString()); task.mutable_slave_id()->CopyFrom(offer.slave_id()); task.mutable_resources()->CopyFrom(shard.resources); task.mutable_command()->set_value("test -f volume/persisted"); ``` in persistent_volume_framework.cpp > On June 1, 2015, 11:32 p.m., Marco Massenzio wrote: > > src/examples/java/TestPersistentVolumeFramework.java, lines 443-444 > > <https://reviews.apache.org/r/33339/diff/10/?file=941652#file941652line443> > > > > instead of concatenating string, either use a StringBuilder or, even > > better: > > ``` > > String.format("Received framework message from executor '%s' on slave > > %s: '%s'", executorId, slaveId, data); > > ``` Sure, but would not match ``` LOG(INFO) << "Received framework message from executor '" << executorId << "' on slave " << slaveId << ": '" << data << "'"; ``` in persistent_volume_framework.cpp > On June 1, 2015, 11:32 p.m., Marco Massenzio wrote: > > src/examples/java/TestPersistentVolumeFramework.java, lines 529-542 > > <https://reviews.apache.org/r/33339/diff/10/?file=941652#file941652line529> > > > > Please consider using Apache Commons CLI instead: > > https://commons.apache.org/proper/commons-cli/ Yes, but it would add a new dependence to Maven. Is it acceptable? Other exist java examples also simple handle the args. - haosdent ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/33339/#review86113 ----------------------------------------------------------- On May 18, 2015, 4:42 p.m., haosdent huang wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/33339/ > ----------------------------------------------------------- > > (Updated May 18, 2015, 4:42 p.m.) > > > Review request for mesos, Jie Yu and Vinod Kone. > > > Bugs: MESOS-2610 > https://issues.apache.org/jira/browse/MESOS-2610 > > > Repository: mesos > > > Description > ------- > > Add a Java example framework to test persistent volumes. > > > Diffs > ----- > > configure.ac 7f9e52916b9d78f2bbff9d6ed9871444a0fda629 > src/Makefile.am 93c7c8a807a33ab639be6289535bbd32022aa85b > src/examples/java/TestPersistentVolumeFramework.java PRE-CREATION > src/examples/java/test-persistent-volume-framework.in PRE-CREATION > src/tests/examples_tests.cpp f85b81562158c5499e9804d8d7b6811bb0a3ef16 > src/tests/java_persistent_volume_framework_test.sh PRE-CREATION > > Diff: https://reviews.apache.org/r/33339/diff/ > > > Testing > ------- > > make check > > > Thanks, > > haosdent huang > >
