> On Feb. 1, 2016, 10:46 p.m., Jie Yu wrote: > > src/slave/containerizer/mesos/isolators/cgroups/net_cls.hpp, lines 137-139 > > <https://reviews.apache.org/r/42587/diff/4/?file=1227354#file1227354line137> > > > > Hum, having two data fields here looks a little confusing to me. How > > about just merging them: > > > > ``` > > // A map for used handles: primary -> bitset for secondary. > > hashmap<uint16_t, bitset<0xffff>> used; > > ```
Used a typedef for bitset<0xffff+1> to improve readability. > On Feb. 1, 2016, 10:46 p.m., Jie Yu wrote: > > src/slave/containerizer/mesos/isolators/cgroups/net_cls.cpp, lines 73-78 > > <https://reviews.apache.org/r/42587/diff/4/?file=1227355#file1227355line73> > > > > I got confused here. minor is a uint16 value. Why this check is > > necessary? Removed this validation. Always set the first element of the bitmask when initializing it, so no longer need the check on the secondary handles. > On Feb. 1, 2016, 10:46 p.m., Jie Yu wrote: > > src/slave/containerizer/mesos/isolators/cgroups/net_cls.cpp, lines 82-96 > > <https://reviews.apache.org/r/42587/diff/4/?file=1227355#file1227355line82> > > > > For testin, I would probably just expose a 'isUsed' method: > > ``` > > bool isUsed(const NetClsHandle& handle); > > ``` Removed usage(). Will introduce isUsed with the unit-test patch. - Avinash ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/42587/#review117230 ----------------------------------------------------------- On Feb. 2, 2016, 6:16 p.m., Avinash sridharan wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/42587/ > ----------------------------------------------------------- > > (Updated Feb. 2, 2016, 6:16 p.m.) > > > Review request for mesos and Jie Yu. > > > Bugs: MESOS-4345 > https://issues.apache.org/jira/browse/MESOS-4345 > > > Repository: mesos > > > Description > ------- > > Implemented the `NetClsHandleMgr` class. > > > Diffs > ----- > > src/slave/containerizer/mesos/isolators/cgroups/net_cls.hpp > b4bc52114389d1c1efce2830f4292bd89bb0de7c > src/slave/containerizer/mesos/isolators/cgroups/net_cls.cpp > ddc1bf0939e5e8995e6f34fe7b8509b51704f63e > > Diff: https://reviews.apache.org/r/42587/diff/ > > > Testing > ------- > > make > > > Thanks, > > Avinash sridharan > >
