@ Nonnull private DruidConnection getDruidConnection ( final String connectionId ) { final DruidConnection connection = connections . get ( connectionId ) ; if ( connection == null ) { throw new NoSuchConnectionException ( connectionId ) ; } return connection . sync ( exec . schedule ( ( ) -> { log . debug ( "Connection[%s] timed out." , connectionId ) ; closeConnection ( new ConnectionHandle ( connectionId ) ) ; } , new Interval ( DateTimes . nowUtc ( ) , config . getConnectionIdleTimeout ( ) ) . toDurationMillis ( ) , TimeUnit . MILLISECONDS ) ) ; }
Get a connection or throw an exception if it doesn t exist . Also refreshes the timeout timer .