Amazon.ElastiCacheCluster/ConfigurationPoller.cs
/// <summary>
/// Used by the poller's timer to update the cluster configuration if a new version is available
/// </summary>
Used by the poller's timer to update the cluster configuration if a new version is available
Used by the poller ' s timer to update the cluster configuration if a new version is available
internal void pollOnTimedEvent(Object source, ElapsedEventArgs evnt)
        {
            log.Debug("Polling...");
            try
            {
                var oldVersion = config.DiscoveryNode.ClusterVersion;
                var endPoints = config.DiscoveryNode.GetEndPointList();
                if (oldVersion != config.DiscoveryNode.ClusterVersion || 
                    (this.config.Pool.nodeLocator != null && endPoints.Count != this.config.Pool.nodeLocator.GetWorkingNodes().Count()))
                {
                    log.DebugFormat("Updating endpoints to have {0} nodes", endPoints.Count);
                    this.config.Pool.UpdateLocator(endPoints);
                }
            }
            catch(Exception e)
            {
                try
                {
                    log.Debug("Error updating endpoints, going to attempt to reresolve configuration endpoint.", e);
                    config.DiscoveryNode.ResolveEndPoint();
                    var oldVersion = config.DiscoveryNode.ClusterVersion;
                    var endPoints = config.DiscoveryNode.GetEndPointList();
                    if (oldVersion != config.DiscoveryNode.ClusterVersion ||
                        (this.config.Pool.nodeLocator != null && endPoints.Count != this.config.Pool.nodeLocator.GetWorkingNodes().Count()))
                    {
                        log.DebugFormat("Updating endpoints to have {0} nodes", endPoints.Count);
                        this.config.Pool.UpdateLocator(endPoints);
                    }
                }
                catch (Exception ex)
                {
                    log.Debug("Error updating endpoints. Setting endpoints to empty collection of nodes.", ex);
                    this.config.Pool.UpdateLocator(new List<System.Net.IPEndPoint>());
                }
            }
        }
internal void pollOnTimedEvent ( Object source , ElapsedEventArgs evnt ) { log . Debug ( " " ) ; try { var oldVersion = config . DiscoveryNode . ClusterVersion ; var endPoints = config . DiscoveryNode . GetEndPointList ( ) ; if ( oldVersion != config . DiscoveryNode . ClusterVersion || ( this . config . Pool . nodeLocator != null && endPoints . Count != this . config . Pool . nodeLocator . GetWorkingNodes ( ) . Count ( ) ) ) { log . DebugFormat ( " " , endPoints . Count ) ; this . config . Pool . UpdateLocator ( endPoints ) ; } } catch ( Exception e ) { try { log . Debug ( " " , e ) ; config . DiscoveryNode . ResolveEndPoint ( ) ; var oldVersion = config . DiscoveryNode . ClusterVersion ; var endPoints = config . DiscoveryNode . GetEndPointList ( ) ; if ( oldVersion != config . DiscoveryNode . ClusterVersion || ( this . config . Pool . nodeLocator != null && endPoints . Count != this . config . Pool . nodeLocator . GetWorkingNodes ( ) . Count ( ) ) ) { log . DebugFormat ( " " , endPoints . Count ) ; this . config . Pool . UpdateLocator ( endPoints ) ; } } catch ( Exception ex ) { log . Debug ( " " , ex ) ; this . config . Pool . UpdateLocator ( new List < System . Net . IPEndPoint > ( ) ) ; } } }
Used by the poller's timer to update the cluster configuration if a new version is available
Used by the poller ' s timer to update the cluster configuration if a new version is available
/* 
                     * We were not able to retrieve the current node configuration. This is most likely because the application
                     * is running in development outside of EC2. ElastiCache clusters are only accessible from an EC2 instance
                     * with the right security permissions.
                     */
source
Object
evnt
ElapsedEventArgs