Brock, 

The Default factories reuse objects which were already created if a new 
configuration has sources/sinks/channels with the same name. So during reconfig 
it avoids creating new instances. It does not matter if this code is removed 
from the source and the sink factories. But you need to track this in the 
channel code, especially for the MemoryChannel. If we forget about the old 
instance, and simply create a new instance, we lose the data that is still in 
the channel. Since the only way we can really track events in memory is by the 
name of the channel - caching channel objects is sort of necessary for 
correctness.


Thanks
Hari

-- 
Hari Shreedharan


On Tuesday, October 9, 2012 at 12:30 PM, Brock Noland wrote:

> Hi,
> 
> I am working on FLUME-1502 and I noticed that the
> Default{Sink,Source,Channel}Factory classes all track the
> sink,source,channels they have created. Additionally, there is a
> getRegistryClone class which is only used in tests.
> 
> 1) Is there a reason they track the instances they have created?
> 2) Any objection to removing this code since it's not being used?
> 
> Brock 

Reply via email to