From bc8c4c65d294845083f16f0faf2e9b8eb856cd13 Mon Sep 17 00:00:00 2001 From: Chengyuan Zhang Date: Fri, 15 Nov 2019 13:45:38 -0800 Subject: [PATCH] Changed flag name from invalidData to dataInvalid --- xds/src/main/java/io/grpc/xds/XdsClientImpl.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/xds/src/main/java/io/grpc/xds/XdsClientImpl.java b/xds/src/main/java/io/grpc/xds/XdsClientImpl.java index 09e338b59cb3..7d99515835f0 100644 --- a/xds/src/main/java/io/grpc/xds/XdsClientImpl.java +++ b/xds/src/main/java/io/grpc/xds/XdsClientImpl.java @@ -563,7 +563,7 @@ private void handleCdsResponse(DiscoveryResponse cdsResponse) { return; } - boolean invalidData = false; + boolean dataInvalid = false; // Full cluster information update received in this CDS response to be cached. Map clusterUpdates = new HashMap<>(); // ClusterUpdate data to be pushed to each watcher. @@ -574,14 +574,14 @@ private void handleCdsResponse(DiscoveryResponse cdsResponse) { updateBuilder.setClusterName(clusterName); // The type field must be set to EDS. if (!cluster.getType().equals(DiscoveryType.EDS)) { - invalidData = true; + dataInvalid = true; break; } // In the eds_cluster_config field, the eds_config field must be set to indicate to // use EDS (must be set to use ADS). EdsClusterConfig edsClusterConfig = cluster.getEdsClusterConfig(); if (!edsClusterConfig.hasEdsConfig() || !edsClusterConfig.getEdsConfig().hasAds()) { - invalidData = true; + dataInvalid = true; break; } // If the service_name field is set, that value will be used for the EDS request @@ -591,7 +591,7 @@ private void handleCdsResponse(DiscoveryResponse cdsResponse) { } // The lb_policy field must be set to ROUND_ROBIN. if (!cluster.getLbPolicy().equals(LbPolicy.ROUND_ROBIN)) { - invalidData = true; + dataInvalid = true; break; } updateBuilder.setLbPolicy("round_robin"); @@ -600,7 +600,7 @@ private void handleCdsResponse(DiscoveryResponse cdsResponse) { // LRS load reporting will be disabled. if (cluster.hasLrsServer()) { if (!cluster.getLrsServer().hasSelf()) { - invalidData = true; + dataInvalid = true; break; } updateBuilder.setEnableLrs(true); @@ -614,7 +614,7 @@ private void handleCdsResponse(DiscoveryResponse cdsResponse) { desiredClusterUpdates.put(clusterName, update); } } - if (invalidData) { + if (dataInvalid) { adsStream.sendNackRequest(ADS_TYPE_URL_CDS, adsStream.cdsResourceNames, cdsResponse.getNonce(), "Cluster message contains invalid information for gRPC's usage");