> On Dec. 12, 2014, 11 p.m., Dominic Hamon wrote: > > src/slave/containerizer/isolators/network/port_mapping.cpp, line 712 > > <https://reviews.apache.org/r/28966/diff/2/?file=790814#file790814line712> > > > > how expensive is this going to be? Can we determine the number of > > filters without constructing the port ranges, or cache the number of > > filters we've added?
Pretty cheap. Number of infos is the number of containers, which is small. ::getPortRanges is just doing some simple math to break up an interval into port ranges. > On Dec. 12, 2014, 11 p.m., Dominic Hamon wrote: > > src/slave/containerizer/isolators/network/port_mapping.cpp, line 633 > > <https://reviews.apache.org/r/28966/diff/2/?file=790814#file790814line633> > > > > instead of this, you can pass in the PID<PortMappingIsolatorProcess> > > directly to the contstructor and initialize the Metrics object with > > (self()). > > > > Just check that order of construction is correct and 'self()' will > > return the right thing ;) Tried, but hit the same template deduction issue. self() return PID<T> in Process<T>, so again, even though PortMappingIsolatorProcess is a subclass of IsolatorProcess, GCC thinks T is IsolatorProcess, because IsolatorProcess is a Process<IsolatorProcess>. And the PID doesn't allow downcast from IsolatorProcess to PortMappingIsolatorProcess. - Chi ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/28966/#review64986 ----------------------------------------------------------- On Dec. 16, 2014, 1:54 a.m., Chi Zhang wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/28966/ > ----------------------------------------------------------- > > (Updated Dec. 16, 2014, 1:54 a.m.) > > > Review request for mesos, Dominic Hamon, Ian Downes, and Jie Yu. > > > Repository: mesos-git > > > Description > ------- > > also added a test. > > > Diffs > ----- > > src/slave/containerizer/isolators/network/port_mapping.hpp f1e2352 > src/slave/containerizer/isolators/network/port_mapping.cpp 2d81336 > src/tests/port_mapping_tests.cpp eb82993 > > Diff: https://reviews.apache.org/r/28966/diff/ > > > Testing > ------- > > make check > > > Thanks, > > Chi Zhang > >
