question: public void pinConnection ( String host , Integer port ) { connectionLock . lock ( ) ; try { String hostAndPort = ConnectionManager . generateConnectionCacheKey ( host , port ) ; if ( _connections . containsKey ( hostAndPort ) ) { Integer count = pinnedConnections . get ( hostAndPort ) ; if ( count == null ) { count = 1 ; } else { count ++ ; } pinnedConnections . put ( hostAndPort , count ) ; } s_logger . info ( "CimConnection {} is pinned, count = {}" , hostAndPort , pinnedConnections . get ( hostAndPort ) ) ; } finally { connectionLock . unlock ( ) ; } }
target:  This will place the connection for the host+port into the pinned list. This will be used as a way to prevent the connection from getting reaped while it is in use for a long period of time. We're keeping count of the times that pinConnection is being called for the connection. This is because you can have multiple arrays behind a single provider IP. If discovery is run against the provider, then the same client will be used for all of its arrays. We would need to keep count, so only when the last array's discovery is complete, we can safely remove the connection from the pinned list.