You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2019/05/08 16:12:53 UTC

[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #3552: Draft: TO/TR Consistent Hash with Query Parameters

ocket8888 commented on a change in pull request #3552: Draft: TO/TR Consistent Hash with Query Parameters
URL: https://github.com/apache/trafficcontrol/pull/3552#discussion_r282140128
 
 

 ##########
 File path: traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/ds/DeliveryService.java
 ##########
 @@ -125,6 +128,21 @@ public DeliveryService(final String id, final JsonNode dsJo) throws JsonUtilsExc
 		this.soa = dsJo.get("soa");
 		this.shouldAppendQueryString = JsonUtils.optBoolean(dsJo, "appendQueryString", true);
 
+		this.consistentHashQueryParams = new TreeSet<String>();
+		if (dsJo.has("consistentHashQueryParams")) {
+			final JsonNode cqpNode = dsJo.get("consistentHashQueryParams");
+			if (!cqpNode.isArray()) {
+				LOGGER.error("Delivery Service '" + id + "' has malformed consistentHashQueryParams. Disregarding.");
+			} else {
+				for (int i=0; i<cqpNode.size(); ++i) {
 
 Review comment:
   Probably. I just didn't know they were iterable like that - the fact that they return `null` for indices greater than the array size rather than throwing an exception spooked me.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services