Github user sohami commented on a diff in the pull request:

    https://github.com/apache/drill/pull/578#discussion_r99247679
  
    --- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/rpc/control/ConnectionManagerRegistry.java
 ---
    @@ -32,24 +29,19 @@
     
       private final ConcurrentMap<DrillbitEndpoint, ControlConnectionManager> 
registry = Maps.newConcurrentMap();
     
    -  private final ControlMessageHandler handler;
    -  private final BootStrapContext context;
    -  private volatile DrillbitEndpoint localEndpoint;
    -  private final BufferAllocator allocator;
    +  private final BitConnectionConfigImpl config;
     
    -  public ConnectionManagerRegistry(BufferAllocator allocator, 
ControlMessageHandler handler, BootStrapContext context) {
    -    super();
    -    this.handler = handler;
    -    this.context = context;
    -    this.allocator = allocator;
    +  public ConnectionManagerRegistry(BitConnectionConfigImpl config) {
    +    this.config = config;
       }
     
    -  public ControlConnectionManager getConnectionManager(DrillbitEndpoint 
endpoint) {
    -    assert localEndpoint != null : "DrillbitEndpoint must be set before a 
connection manager can be retrieved";
    -    ControlConnectionManager m = registry.get(endpoint);
    +  public ControlConnectionManager getConnectionManager(DrillbitEndpoint 
remoteEndpoint) {
    +    assert config.getLocalEndpoint() != null :
    +        "DrillbitEndpoint must be set before a connection manager can be 
retrieved";
    +    ControlConnectionManager m = registry.get(remoteEndpoint);
         if (m == null) {
    -      m = new ControlConnectionManager(allocator, endpoint, localEndpoint, 
handler, context);
    -      ControlConnectionManager m2 = registry.putIfAbsent(endpoint, m);
    +      m = new ControlConnectionManager(config, remoteEndpoint);
    +      ControlConnectionManager m2 = registry.putIfAbsent(remoteEndpoint, 
m);
    --- End diff --
    
    can be final.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to