[incubator-trafficcontrol] branch master updated: added fields tr_response_headers and tr_request_headers to create DS function

2018-01-24 Thread elsloo
This is an automated email from the ASF dual-hosted git repository.

elsloo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-trafficcontrol.git


The following commit(s) were added to refs/heads/master by this push:
 new 4743b04  added fields tr_response_headers and tr_request_headers to 
create DS function
4743b04 is described below

commit 4743b04d3fb4e8f9e8ed16d83885229d2deffd78
Author: Jesse Rivas 
AuthorDate: Wed Jan 24 15:26:36 2018 -0700

added fields tr_response_headers and tr_request_headers to create DS 
function
---
 traffic_ops/app/lib/UI/DeliveryService.pm | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/traffic_ops/app/lib/UI/DeliveryService.pm 
b/traffic_ops/app/lib/UI/DeliveryService.pm
index f1c47d9..d9752a7 100644
--- a/traffic_ops/app/lib/UI/DeliveryService.pm
+++ b/traffic_ops/app/lib/UI/DeliveryService.pm
@@ -1068,6 +1068,8 @@ sub create {
range_request_handling  => 
$self->paramAsScalar('ds.range_request_handling'),
edge_header_rewrite => 
$self->paramAsScalar('ds.edge_header_rewrite'),
mid_header_rewrite  => 
$self->paramAsScalar( 'ds.mid_header_rewrite', undef ),
+   tr_response_headers => 
$self->paramAsScalar('ds.tr_response_headers'),
+   tr_request_headers  => 
$self->paramAsScalar('ds.tr_request_headers'),
regex_remap=> $self->paramAsScalar( 
'ds.regex_remap',undef ),
origin_shield  => $self->paramAsScalar( 
'ds.origin_shield',  undef ),
cacheurl   => $self->paramAsScalar( 
'ds.cacheurl',   undef ),

-- 
To stop receiving notification emails like this one, please contact
els...@apache.org.


[incubator-trafficcontrol] 01/02: changed maxLength of zip code to be longer.

2018-01-24 Thread friede
This is an automated email from the ASF dual-hosted git repository.

friede pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-trafficcontrol.git

commit b1a116f87d8c7dae54de0b53f19d60b4114f5926
Author: David Neuman 
AuthorDate: Wed Jan 24 14:45:47 2018 -0700

changed maxLength of zip code to be longer.
---
 traffic_ops/app/lib/UI/PhysLocation.pm  | 2 +-
 .../common/modules/form/physLocation/FormPhysLocationController.js  | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/traffic_ops/app/lib/UI/PhysLocation.pm 
b/traffic_ops/app/lib/UI/PhysLocation.pm
index 54a643d..02cee29 100644
--- a/traffic_ops/app/lib/UI/PhysLocation.pm
+++ b/traffic_ops/app/lib/UI/PhysLocation.pm
@@ -345,7 +345,7 @@ sub is_valid {
$self->field('location.address')->is_required->is_like( qr/^[a-zA-Z0-9\ 
\.\-]+/, "Use alphanumeric characters, '.','-', or space." );
$self->field('location.city')->is_required->is_like( qr/^[a-zA-Z0-9\ 
\.\-]+/, "Use alphanumeric characters, '.','-', or space." );
$self->field('location.state')->is_required->is_like( qr/^[A-Z]{2}/, 
"Uppercase 2 char. state abbreviation." );
-   $self->field('location.zip')->is_required->is_like( qr/^[0-9]{5,5}$/, 
"Enter a valid 5 digit zipcode." );
+   $self->field('location.zip')->is_required->is_like( qr/^[0-9]/, "Enter 
a valid zip code." );
$self->field('location.phone')->is_like( 
qr/^$|[0-9]{3}\-[0-9]{3}\-[0-9]{4}/, "Phone number format is: ###-###-" );
$self->field('location.email')->check( sub {
my ( $value, $params ) = @_;
diff --git 
a/traffic_portal/app/src/common/modules/form/physLocation/FormPhysLocationController.js
 
b/traffic_portal/app/src/common/modules/form/physLocation/FormPhysLocationController.js
index d7f78fc..a0ed71e 100644
--- 
a/traffic_portal/app/src/common/modules/form/physLocation/FormPhysLocationController.js
+++ 
b/traffic_portal/app/src/common/modules/form/physLocation/FormPhysLocationController.js
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
+ *
  *   http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -34,7 +34,7 @@ var FormPhysLocationController = function(physLocation, 
$scope, $location, formU
 { name: 'address', type: 'text', required: true, maxLength: 128 },
 { name: 'city', type: 'text', required: true, maxLength: 128 },
 { name: 'state', type: 'text', required: true, maxLength: 2 },
-{ name: 'zip', type: 'text', required: true, maxLength: 5 },
+{ name: 'zip', type: 'text', required: true, maxLength: 11 },
 { name: 'poc', type: 'text', required: false, maxLength: 128 },
 { name: 'phone', type: 'text', required: false, maxLength: 45 },
 { name: 'email', type: 'email', required: false, maxLength: 128 }

-- 
To stop receiving notification emails like this one, please contact
fri...@apache.org.


[incubator-trafficcontrol] branch master updated (04d8665 -> 3c11b3d)

2018-01-24 Thread friede
This is an automated email from the ASF dual-hosted git repository.

friede pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-trafficcontrol.git.


from 04d8665  Move loadDeepCaches() into CacheLocation and add 
synchronization
 new b1a116f  changed maxLength of zip code to be longer.
 new 3c11b3d  remove zip validation

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 traffic_ops/app/lib/UI/PhysLocation.pm  | 1 -
 .../common/modules/form/physLocation/FormPhysLocationController.js  | 6 +++---
 2 files changed, 3 insertions(+), 4 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
fri...@apache.org.


[3/4] incubator-trafficcontrol-website git commit: Update docs from commit 04d86651fb6d846f2ea10a48b9fe4303b28b725c

2018-01-24 Thread git-site-role
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol-website/blob/6d70f966/docs/master/development/traffic_ops_api/v12/deliveryservice.html
--
diff --git a/docs/master/development/traffic_ops_api/v12/deliveryservice.html 
b/docs/master/development/traffic_ops_api/v12/deliveryservice.html
index 9a6fcb7..74125e9 100644
--- a/docs/master/development/traffic_ops_api/v12/deliveryservice.html
+++ b/docs/master/development/traffic_ops_api/v12/deliveryservice.html
@@ -279,45 +279,54 @@
 string
 The path portion of the URL to check this deliveryservice for health.
 
-displayName
+deepCachingType
+string
+When to do Deep Caching for this Delivery Service:
+
+NEVER (default)
+ALWAYS
+
+
+
+displayName
 string
 The display name of the delivery service.
 
-dnsBypassCname
+dnsBypassCname
 string
 
 
-dnsBypassIp
+dnsBypassIp
 string
 The IPv4 IP to use for bypass on a DNS deliveryservice  - bypass starts 
when serving more than the
 globalMaxMbps traffic on this deliveryservice.
 
-dnsBypassIp6
+dnsBypassIp6
 string
 The IPv6 IP to use for bypass on a DNS deliveryservice - bypass starts 
when serving more than the
 globalMaxMbps traffic on this deliveryservice.
 
-dnsBypassTtl
+dnsBypassTtl
 int
 The TTL of the DNS bypass response.
 
-dscp
+dscp
 int
 The Differentiated Services Code Point (DSCP) with which to mark 
downstream (EDGE -  customer) traffic.
 
-edgeHeaderRewrite
+edgeHeaderRewrite
 string
 The EDGE header rewrite actions to perform.
 
-exampleURLs
+exampleURLs
 array
 Entry points into the CDN for this deliveryservice.
 
-geoLimitRedirectUrl
+geoLimitRedirectUrl
 string
 
 
-geoLimit
+geoLimit
 int
 
 0: None - no limitations
@@ -328,76 +337,76 @@ globalMaxMbps traffic on this deliveryservice.
 routing to the content by Traffic Router.
 
 
-geoLimitCountries
+geoLimitCountries
 string
 
 
-geoProvider
+geoProvider
 int
 
 
-globalMaxMbps
+globalMaxMbps
 int
 The maximum global bandwidth allowed on this deliveryservice. If exceeded, 
the traffic routes to the
 dnsByPassIp* for DNS deliveryservices and to the httpBypassFqdn for HTTP 
deliveryservices.
 
-globalMaxTps
+globalMaxTps
 int
 The maximum global transactions per second allowed on this 
deliveryservice. When this is exceeded
 traffic will be sent to the dnsByPassIp* for DNS deliveryservices and to the 
httpBypassFqdn for
 HTTP deliveryservices
 
-httpBypassFqdn
+httpBypassFqdn
 string
 The HTTP destination to use for bypass on an HTTP deliveryservice - bypass 
starts when serving more than the
 globalMaxMbps traffic on this deliveryservice.
 
-id
+id
 int
 The deliveryservice id (database row number).
 
-infoUrl
+infoUrl
 string
 Use this to add a URL that points to more information about that 
deliveryservice.
 
-initialDispersion
+initialDispersion
 int
 
 
-ipv6RoutingEnabled
+ipv6RoutingEnabled
 bool
 false: send IPv4 address of Traffic Router to client on HTTP type del.
 
-lastUpdated
+lastUpdated
 string
 
 
-logsEnabled
+logsEnabled
 bool
 
 
-longDesc
+longDesc
 string
 Description field.
 
-longDesc1
+longDesc1
 string
 Description field 1.
 
-longDesc2
+longDesc2
 string
 Description field 2.
 
-maxDnsAnswers
+maxDnsAnswers
 int
 The maximum number of IPs to put in a A/ response for a DNS 
deliveryservice (0 means all
 available).
 
-midHeaderRewrite
+midHeaderRewrite
 string
 The MID header rewrite actions to perform.
 
-missLat
+missLat
 float
 The latitude as decimal degrees to use when the client 
cannot be found in the CZF or the Geo lookup.
 
@@ -405,7 +414,7 @@ available).
 
 
 
-missLong
+missLong
 float
 The longitude as decimal degrees to use when the client 
cannot be found in the CZF or the Geo lookup.
 
@@ -413,32 +422,32 @@ available).
 
 
 
-multiSiteOrigin
+multiSiteOrigin
 bool
 Is the Multi Site Origin feature enabled for this delivery service 
(0=false, 1=true). See Multi Site Origin
 
-orgServerFqdn
+orgServerFqdn
 string
 The origin server base URL (FQDN when used in this instance, includes the
 protocol (http://;>http:// or https://;>https://) for use in retrieving 
content from the origin server.
 
-originShield
+originShield
 string
 
 
-profileDescription
+profileDescription
 string
 The description of the Traffic Router Profile with which this 
deliveryservice is associated.
 
-profileId
+profileId
 int
 The id of the Traffic Router Profile with which this deliveryservice is 
associated.
 
-profileName
+profileName
 string
 The name of the Traffic Router Profile with which this deliveryservice is 
associated.
 
-protocol
+protocol
 int
 
 0: serve with http://;>http:// at 
EDGE
@@ -447,7 +456,7 @@ protocol (http://;>http:// or qstringIgnore
+qstringIgnore
 int
 
 0: no special query string handling; it is for use in the cache-key and 
pass up to origin.
@@ -456,7 +465,7 @@ protocol (http://;>http:// or rangeRequestHandling
+rangeRequestHandling
 int
 How to treat range requests:
 
@@ -466,23 +475,23 @@ protocol (http://;>http:// or 

[4/4] incubator-trafficcontrol-website git commit: Update docs from commit 04d86651fb6d846f2ea10a48b9fe4303b28b725c

2018-01-24 Thread git-site-role
Update docs from commit 04d86651fb6d846f2ea10a48b9fe4303b28b725c


Project: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol-website/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol-website/commit/6d70f966
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol-website/tree/6d70f966
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol-website/diff/6d70f966

Branch: refs/heads/asf-site
Commit: 6d70f966ef9c78580fbe374009065bd54527343a
Parents: 3d738e4
Author: jenkins 
Authored: Wed Jan 24 17:33:48 2018 +
Committer: jenkins 
Committed: Wed Jan 24 17:33:48 2018 +

--
 .../_sources/admin/traffic_ops/using.rst.txt|  93 ++-
 .../_sources/admin/traffic_router.rst.txt   |  88 +-
 .../traffic_ops_api/v12/deliveryservice.rst.txt |  48 +-
 .../traffic_ops_api/v12/server.rst.txt  |   6 +
 .../traffic_ops_api/v12/user.rst.txt|   6 +
 docs/master/admin/index.html|  11 +-
 docs/master/admin/traffic_ops/using.html| 188 +++--
 docs/master/admin/traffic_router.html   | 102 ++-
 .../traffic_ops_api/v12/deliveryservice.html| 827 ++-
 .../development/traffic_ops_api/v12/server.html | 114 +--
 .../development/traffic_ops_api/v12/user.html   | 114 +--
 docs/master/index.html  |   1 +
 docs/master/objects.inv | Bin 4623 -> 4655 bytes
 docs/master/searchindex.js  |   2 +-
 14 files changed, 1013 insertions(+), 587 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol-website/blob/6d70f966/docs/master/_sources/admin/traffic_ops/using.rst.txt
--
diff --git a/docs/master/_sources/admin/traffic_ops/using.rst.txt 
b/docs/master/_sources/admin/traffic_ops/using.rst.txt
index 7a78bd1..e7e8eb2 100644
--- a/docs/master/_sources/admin/traffic_ops/using.rst.txt
+++ b/docs/master/_sources/admin/traffic_ops/using.rst.txt
@@ -306,6 +306,11 @@ The fields in the Delivery Service view are:
 
+--+-+
 | Content Routing Type | The type of content 
routing this delivery service will use. See :ref:`rl-ds-types`. 

|
 
+--+-+
+| Deep Caching | (for HTTP routed delivery 
services only) When to do deep caching for this delivery service (see 
:ref:`Deep Caching ` for more details):  
|
+|  |   


  |
+|  | - NEVER   


  |
+|  | - ALWAYS  


  |
++--+-+
 | Delivery Service DNS TTL | The Time To Live on the 
DNS record for the Traffic Router A and  records 
(``..``).
   |
 
+--+-+
 | Delivery Servics URLs| (Read Only) An 

[incubator-trafficcontrol] 19/36: Add deep NetworkNode test coverage

2018-01-24 Thread elsloo
This is an automated email from the ASF dual-hosted git repository.

elsloo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-trafficcontrol.git

commit d5ec7447eb7d520d26438076fda8feb5c52b2bc2
Author: Rawlin Peters 
AuthorDate: Fri Nov 3 16:34:55 2017 -0600

Add deep NetworkNode test coverage
---
 .../traffic_router/core/router/TrafficRouter.java  |  2 +-
 .../traffic_router/core/loc/NetworkNodeTest.java   | 44 +++---
 .../core/loc/NetworkNodeUnitTest.java  | 27 +
 3 files changed, 59 insertions(+), 14 deletions(-)

diff --git 
a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/router/TrafficRouter.java
 
b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/router/TrafficRouter.java
index 00fafdb..be0579d 100644
--- 
a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/router/TrafficRouter.java
+++ 
b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/router/TrafficRouter.java
@@ -640,7 +640,7 @@ public class TrafficRouter {
 
@SuppressWarnings({"PMD.CyclomaticComplexity", "PMD.NPathComplexity"})
public CacheLocation getCoverageZoneCacheLocation(final String ip, 
final String deliveryServiceId, final boolean useDeep) {
-   NetworkNode networkNode = useDeep ? getDeepNetworkNode(ip) : 
getNetworkNode(ip);
+   final NetworkNode networkNode = useDeep ? 
getDeepNetworkNode(ip) : getNetworkNode(ip);
 
if (networkNode == null) {
return null;
diff --git 
a/traffic_router/core/src/test/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/NetworkNodeTest.java
 
b/traffic_router/core/src/test/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/NetworkNodeTest.java
index 0a1e7dd..3517751 100644
--- 
a/traffic_router/core/src/test/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/NetworkNodeTest.java
+++ 
b/traffic_router/core/src/test/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/NetworkNodeTest.java
@@ -42,36 +42,45 @@ import org.junit.experimental.categories.Category;
 public class NetworkNodeTest {
private static final Logger LOGGER = 
Logger.getLogger(NetworkNodeTest.class);
private Map netMap = new HashMap();
+   private Map deepNetMap = new HashMap();
private NetworkNode root;
+   private NetworkNode deepRoot;
 
@Before
public void setUp() throws Exception {
-   final File file = new 
File(getClass().getClassLoader().getResource("czmap.json").toURI());
-   root = NetworkNode.generateTree(file, false);
+   root = setUp("czmap.json", false);
+   deepRoot = setUp("dczmap.json", true);
+   }
+
+   private NetworkNode setUp(final String filename, final boolean useDeep) 
throws Exception {
+   final Map testNetMap = useDeep ? 
deepNetMap : netMap;
+   final File file = new 
File(getClass().getClassLoader().getResource(filename).toURI());
+   final NetworkNode nn = NetworkNode.generateTree(file, false, 
useDeep);
final ObjectMapper mapper = new ObjectMapper();
final JsonNode jsonNode = mapper.readTree(file);
final JsonNode coverageZones = jsonNode.get("coverageZones");
 
final Iterator networkIter = coverageZones.fieldNames();
while (networkIter.hasNext()) {
-   final String loc = networkIter.next();
+   final String loc = networkIter.next();
final JsonNode locData = coverageZones.get(loc);
-   for (final JsonNode networkType : locData) {
-   final String network = 
networkType.get(0).asText().split("/")[0];
+   for (String networkType : new String[]{"network", 
"network6"}) {
+   final JsonNode networks = 
locData.get(networkType);
+   final String network = 
networks.get(0).asText().split("/")[0];
InetAddress ip = 
InetAddresses.forString(network);
ip = InetAddresses.increment(ip);
 
-   if (!netMap.containsKey(loc)) {
-   netMap.put(loc, new 
ArrayList());
+   if (!testNetMap.containsKey(loc)) {
+   testNetMap.put(loc, new 
ArrayList());
}
 
-   final List addressList = 
netMap.get(loc);
+   final List addressList = 
testNetMap.get(loc);

[incubator-trafficcontrol] 31/36: Fix broken unit test and error message

2018-01-24 Thread elsloo
This is an automated email from the ASF dual-hosted git repository.

elsloo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-trafficcontrol.git

commit f22d2ec561a6af978403b10217d5d8e1be5ae82d
Author: Rawlin Peters 
AuthorDate: Mon Nov 13 12:49:08 2017 -0700

Fix broken unit test and error message
---
 .../cdn/traffic_control/traffic_router/core/ds/DeliveryService.java | 2 +-
 .../core/router/DeliveryServiceHTTPRoutingMissesTest.java   | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git 
a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/ds/DeliveryService.java
 
b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/ds/DeliveryService.java
index 6305e12..4aadd70 100644
--- 
a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/ds/DeliveryService.java
+++ 
b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/ds/DeliveryService.java
@@ -155,7 +155,7 @@ public class DeliveryService {
try {
dct = DeepCachingType.valueOf(dctString);
} catch (IllegalArgumentException e) {
-   LOGGER.error("DeliveryService '" + id + "' has an 
unrecognized deepCachingType: '" + dct + "'. Defaulting to 'NEVER' instead");
+   LOGGER.error("DeliveryService '" + id + "' has an 
unrecognized deepCachingType: '" + dctString + "'. Defaulting to 'NEVER' 
instead");
} finally {
this.deepCache = dct;
}
diff --git 
a/traffic_router/core/src/test/java/com/comcast/cdn/traffic_control/traffic_router/core/router/DeliveryServiceHTTPRoutingMissesTest.java
 
b/traffic_router/core/src/test/java/com/comcast/cdn/traffic_control/traffic_router/core/router/DeliveryServiceHTTPRoutingMissesTest.java
index 01d9815..1714dc8 100644
--- 
a/traffic_router/core/src/test/java/com/comcast/cdn/traffic_control/traffic_router/core/router/DeliveryServiceHTTPRoutingMissesTest.java
+++ 
b/traffic_router/core/src/test/java/com/comcast/cdn/traffic_control/traffic_router/core/router/DeliveryServiceHTTPRoutingMissesTest.java
@@ -47,6 +47,8 @@ public class DeliveryServiceHTTPRoutingMissesTest {
 
when(unusedByTest.get("routingName")).thenReturn(mapper.readTree("\"edge\""));
 when(unusedByTest.has("coverageZoneOnly")).thenReturn(true);
 
when(unusedByTest.get("coverageZoneOnly")).thenReturn(mapper.readTree("true"));
+when(unusedByTest.has("deepCachingType")).thenReturn(true);
+
when(unusedByTest.get("deepCachingType")).thenReturn(mapper.readTree("\"NEVER\""));
 deliveryService = new DeliveryService("ignoredbytest", unusedByTest);
 httpRequest = mock(HTTPRequest.class);
 track = StatTracker.getTrack();

-- 
To stop receiving notification emails like this one, please contact
els...@apache.org.


[incubator-trafficcontrol] 15/36: Rename goose migration file for deep_caching_type due to rebase

2018-01-24 Thread elsloo
This is an automated email from the ASF dual-hosted git repository.

elsloo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-trafficcontrol.git

commit 0e52c33ec7ac6641405d6efb1829e2d2179ab37f
Author: Rawlin Peters 
AuthorDate: Wed Nov 1 14:33:56 2017 -0600

Rename goose migration file for deep_caching_type due to rebase
---
 ...add_deep_caching_type.sql => 2017110100_add_deep_caching_type.sql} | 0
 1 file changed, 0 insertions(+), 0 deletions(-)

diff --git 
a/traffic_ops/app/db/migrations/2017101200_add_deep_caching_type.sql 
b/traffic_ops/app/db/migrations/2017110100_add_deep_caching_type.sql
similarity index 100%
rename from 
traffic_ops/app/db/migrations/2017101200_add_deep_caching_type.sql
rename to traffic_ops/app/db/migrations/2017110100_add_deep_caching_type.sql

-- 
To stop receiving notification emails like this one, please contact
els...@apache.org.


[incubator-trafficcontrol] 36/36: Move loadDeepCaches() into CacheLocation and add synchronization

2018-01-24 Thread elsloo
This is an automated email from the ASF dual-hosted git repository.

elsloo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-trafficcontrol.git

commit 04d86651fb6d846f2ea10a48b9fe4303b28b725c
Author: Rawlin Peters 
AuthorDate: Tue Jan 23 17:46:43 2018 -0700

Move loadDeepCaches() into CacheLocation and add synchronization
---
 .../traffic_router/core/cache/CacheLocation.java   | 23 +-
 .../traffic_router/core/router/TrafficRouter.java  | 16 ++-
 2 files changed, 24 insertions(+), 15 deletions(-)

diff --git 
a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/cache/CacheLocation.java
 
b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/cache/CacheLocation.java
index 7caf2a3..67159c1 100644
--- 
a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/cache/CacheLocation.java
+++ 
b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/cache/CacheLocation.java
@@ -23,6 +23,7 @@ import java.util.Set;
 
 import org.apache.commons.lang3.builder.EqualsBuilder;
 import org.apache.commons.lang3.builder.HashCodeBuilder;
+import org.apache.log4j.Logger;
 
 import com.comcast.cdn.traffic_control.traffic_router.geolocation.Geolocation;
 
@@ -31,6 +32,8 @@ import 
com.comcast.cdn.traffic_control.traffic_router.geolocation.Geolocation;
  */
 public class CacheLocation {
 
+   public static final Logger LOGGER = 
Logger.getLogger(CacheLocation.class);
+
private final String id;
private final Geolocation geolocation;
 
@@ -57,11 +60,29 @@ public class CacheLocation {
 *the cache to add
 */
public void addCache(final Cache cache) {
+   synchronized (caches) {
caches.put(cache.getId(), cache);
+   }
}
 
public void clearCaches() {
-   caches.clear();
+   synchronized (caches) {
+   caches.clear();
+   }
+   }
+
+   public void loadDeepCaches(final Set deepCacheNames, final 
CacheRegister cacheRegister) {
+   synchronized (caches) {
+   if (caches.isEmpty() && deepCacheNames != null) {
+   for (final String deepCacheName : 
deepCacheNames) {
+   final Cache deepCache = 
cacheRegister.getCacheMap().get(deepCacheName);
+   if (deepCache != null) {
+   LOGGER.debug("DDC: Adding " + 
deepCacheName + " to " + getId());
+   caches.put(deepCache.getId(), 
deepCache);
+   }
+   }
+   }
+   }
}
 
@Override
diff --git 
a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/router/TrafficRouter.java
 
b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/router/TrafficRouter.java
index bb1dbb5..b63e075 100644
--- 
a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/router/TrafficRouter.java
+++ 
b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/router/TrafficRouter.java
@@ -648,9 +648,9 @@ public class TrafficRouter {
final DeliveryService deliveryService = 
cacheRegister.getDeliveryService(deliveryServiceId);
CacheLocation cacheLocation = networkNode.getCacheLocation();
 
-   if (useDeep && cacheLocation != null && 
cacheLocation.getCaches().isEmpty()) {
+   if (useDeep && cacheLocation != null) {
// lazily load deep Caches into the deep CacheLocation
-   loadDeepCaches(networkNode, cacheLocation);
+   
cacheLocation.loadDeepCaches(networkNode.getDeepCacheNames(), cacheRegister);
}
 
if (cacheLocation != null && 
!getSupportingCaches(cacheLocation.getCaches(), deliveryService).isEmpty()) {
@@ -679,18 +679,6 @@ public class TrafficRouter {
return 
getClosestCacheLocation(cacheRegister.filterAvailableLocations(deliveryServiceId),
 networkNode.getGeolocation(), 
cacheRegister.getDeliveryService(deliveryServiceId));
}
 
-   private void loadDeepCaches(final NetworkNode networkNode, final 
CacheLocation cacheLocation) {
-   if (networkNode.getDeepCacheNames() != null) {
-   for (final String deepCacheName : 
networkNode.getDeepCacheNames()) {
-   final Cache deepCache = 
cacheRegister.getCacheMap().get(deepCacheName);
-   if (deepCache != null) {
-   

[incubator-trafficcontrol] 01/36: Add deep_caching_type to DB, API, CRConfig, and UI.

2018-01-24 Thread elsloo
This is an automated email from the ASF dual-hosted git repository.

elsloo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-trafficcontrol.git

commit 16896974085669bebce296c4a116f96b5b047b0f
Author: Jan van Doorn 
AuthorDate: Fri Nov 18 12:40:43 2016 -0700

Add deep_caching_type to DB, API, CRConfig, and UI.

(cherry picked from commit 160a539446c46f9a593e208492bded4781418c6e)
---
 .../2017101200_add_deep_caching_type.sql   | 23 ++
 traffic_ops/app/lib/API/Deliveryservice.pm | 14 +++--
 traffic_ops/app/lib/UI/DeliveryService.pm  |  3 +++
 traffic_ops/app/lib/UI/Topology.pm |  5 +
 .../app/templates/delivery_service/_form.html.ep   | 15 ++
 5 files changed, 58 insertions(+), 2 deletions(-)

diff --git 
a/traffic_ops/app/db/migrations/2017101200_add_deep_caching_type.sql 
b/traffic_ops/app/db/migrations/2017101200_add_deep_caching_type.sql
new file mode 100644
index 000..17c78cc
--- /dev/null
+++ b/traffic_ops/app/db/migrations/2017101200_add_deep_caching_type.sql
@@ -0,0 +1,23 @@
+/*
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+*/
+
+-- +goose Up
+-- SQL in section 'Up' is executed when this migration is applied
+
+alter table deliveryservice add column deep_caching_type smallint default 0;
+
+-- +goose Down
+-- SQL section 'Down' is executed when this migration is rolled back
+
+ alter table deliveryservice drop column deep_caching_type;
diff --git a/traffic_ops/app/lib/API/Deliveryservice.pm 
b/traffic_ops/app/lib/API/Deliveryservice.pm
index 5db2fd2..b78b5a7 100644
--- a/traffic_ops/app/lib/API/Deliveryservice.pm
+++ b/traffic_ops/app/lib/API/Deliveryservice.pm
@@ -106,6 +106,7 @@ sub index {
"cdnId"=> $row->cdn->id,
"cdnName"  => $row->cdn->name,
"checkPath"=> $row->check_path,
+   "deepCachingType"  => 
$row->deep_caching_type,
"displayName"  => $row->display_name,
"dnsBypassCname"   => 
$row->dns_bypass_cname,
"dnsBypassIp"  => $row->dns_bypass_ip,
@@ -226,6 +227,7 @@ sub show {
"cdnId"=> $row->cdn->id,
"cdnName"  => $row->cdn->name,
"checkPath"=> $row->check_path,
+   "deepCachingType"  => 
$row->deep_caching_type,
"displayName"  => $row->display_name,
"dnsBypassCname"   => 
$row->dns_bypass_cname,
"dnsBypassIp"  => $row->dns_bypass_ip,
@@ -332,6 +334,7 @@ sub update {
ccr_dns_ttl=> $params->{ccrDnsTtl},
cdn_id => $params->{cdnId},
check_path => $params->{checkPath},
+   deep_caching_type  => $params->{deepCachingType},
display_name   => $params->{displayName},
dns_bypass_cname   => $params->{dnsBypassCname},
dns_bypass_ip  => $params->{dnsBypassIp},
@@ -429,6 +432,7 @@ sub update {
"cdnId"=> $rs->cdn->id,
"cdnName"  => $rs->cdn->name,
"checkPath"=> $rs->check_path,
+   "deepCachingType"  => 
$rs->deep_caching_type,
"displayName"  => $rs->display_name,
"dnsBypassCname"   => 
$rs->dns_bypass_cname,
"dnsBypassIp"  => 
$rs->dns_bypass_ip,
@@ -560,6 +564,7 @@ sub safe_update {
"cdnId"=> $rs->cdn->id,
"cdnName"  => $rs->cdn->name,
"checkPath"=> $rs->check_path,
+   "deepCachingType"  => 
$rs->deep_caching_type,
"displayName"

[incubator-trafficcontrol] 32/36: Revert "Show Deep Caching field for STEERING Delivery Services"

2018-01-24 Thread elsloo
This is an automated email from the ASF dual-hosted git repository.

elsloo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-trafficcontrol.git

commit 7b5a8193dfb1fd3cc97f5c9f51911c344ddf6f50
Author: Rawlin Peters 
AuthorDate: Mon Nov 13 16:20:11 2017 -0700

Revert "Show Deep Caching field for STEERING Delivery Services"

This reverts commit 704aae655c2a78e39472edeaf5f6fec2e3d31ca1.

My original thought was correct; deepCachingType is not applied to
STEERING DSes, only the target DSes.
---
 traffic_ops/app/templates/delivery_service/add.html.ep  | 2 +-
 traffic_ops/app/templates/delivery_service/edit.html.ep | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/traffic_ops/app/templates/delivery_service/add.html.ep 
b/traffic_ops/app/templates/delivery_service/add.html.ep
index 26ea456..c2f0841 100644
--- a/traffic_ops/app/templates/delivery_service/add.html.ep
+++ b/traffic_ops/app/templates/delivery_service/add.html.ep
@@ -235,7 +235,7 @@
 $('#range_request_handlingi_row').hide(speed);
 $('#dns_bypass_ip_row').hide(speed);
 $('#dns_bypass_ip6_row').hide(speed);
-$('#deep_caching_type').show(speed);
+$('#deep_caching_type').hide(speed);
$('#regional_geo_blocking_row').show(speed);
$('#dns_bypass_cname_row').hide(speed);
 $('#dns_bypass_ttl_row').hide(speed);
diff --git a/traffic_ops/app/templates/delivery_service/edit.html.ep 
b/traffic_ops/app/templates/delivery_service/edit.html.ep
index 223e210..699361a 100644
--- a/traffic_ops/app/templates/delivery_service/edit.html.ep
+++ b/traffic_ops/app/templates/delivery_service/edit.html.ep
@@ -327,7 +327,7 @@ function setup_form(speed) {
 $('#range_request_handlingi_row').hide(speed);
 $('#dns_bypass_ip_row').hide(speed);
 $('#dns_bypass_ip6_row').hide(speed);
-$('#deep_caching_type').show(speed);
+$('#deep_caching_type').hide(speed);
$('#regional_geo_blocking_row').show(speed);
$('#dns_bypass_cname_row').hide(speed);
 $('#dns_bypass_ttl_row').hide(speed);

-- 
To stop receiving notification emails like this one, please contact
els...@apache.org.


[incubator-trafficcontrol] 29/36: Address DDC review comments

2018-01-24 Thread elsloo
This is an automated email from the ASF dual-hosted git repository.

elsloo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-trafficcontrol.git

commit 013909de88439c87e48b6af29642e7670896ec11
Author: Rawlin Peters 
AuthorDate: Fri Nov 10 15:57:43 2017 -0700

Address DDC review comments

Changed DCZF to use 'deepCoverageZones' key instead of 'coverageZones'
for better separation.

Created enum type DeepCachingType to use in DeliveryService struct in
lib/go-tc.
---
 docs/source/admin/traffic_ops/using.rst|  4 +-
 lib/go-tc/deliveryservices.go  |  2 +-
 lib/go-tc/enum.go  | 48 ++
 .../traffic_router/core/ds/DeliveryService.java|  2 +-
 .../traffic_router/core/loc/NetworkNode.java   |  3 +-
 .../traffic_router/core/loc/NetworkUpdater.java|  2 +-
 .../traffic_router/core/loc/NetworkNodeTest.java   |  3 +-
 .../core/loc/NetworkNodeUnitTest.java  |  6 +--
 traffic_router/core/src/test/resources/dczmap.json |  2 +-
 9 files changed, 61 insertions(+), 11 deletions(-)

diff --git a/docs/source/admin/traffic_ops/using.rst 
b/docs/source/admin/traffic_ops/using.rst
index 5ac1a0d..6a6c130 100644
--- a/docs/source/admin/traffic_ops/using.rst
+++ b/docs/source/admin/traffic_ops/using.rst
@@ -895,10 +895,10 @@ The script that generates the CZF file is not part of 
Traffic Control, since it
 
 The Deep Coverage Zone File
 +++
-The Deep Coverage Zone File (DCZF) format is similar to the CZF format but 
adds a ``caches`` list under each ``coverageZone``: ::
+The Deep Coverage Zone File (DCZF) format is similar to the CZF format but 
adds a ``caches`` list under each ``deepCoverageZone``: ::
 
   {
-"coverageZones": {
+"deepCoverageZones": {
   "location-01": {
 "coordinates": {
   "latitude":  5.5,
diff --git a/lib/go-tc/deliveryservices.go b/lib/go-tc/deliveryservices.go
index b27b655..9d621a8 100644
--- a/lib/go-tc/deliveryservices.go
+++ b/lib/go-tc/deliveryservices.go
@@ -56,7 +56,7 @@ type DeliveryService struct {
Active   bool   `json:"active"`
DSCP int`json:"dscp"`
RoutingName  string `json:"routingName"`
-   DeepCachingType  string `json:"deepCachingType"`
+   DeepCachingType  DeepCachingType`json:"deepCachingType"`
Signed   bool   `json:"signed"`
QStringIgnoreint`json:"qstringIgnore"`
GeoLimit int`json:"geoLimit"`
diff --git a/lib/go-tc/enum.go b/lib/go-tc/enum.go
index 46aa9d0..f8f3a66 100644
--- a/lib/go-tc/enum.go
+++ b/lib/go-tc/enum.go
@@ -29,6 +29,8 @@ package tc
  */
 
 import (
+   "errors"
+   "strconv"
"strings"
 )
 
@@ -182,3 +184,49 @@ func CacheStatusFromString(s string) CacheStatus {
return CacheStatusInvalid
}
 }
+
+// DeepCachingType represents a Delivery Service's deep caching type. The 
string values of this type should match the Traffic Ops values.
+type DeepCachingType string
+
+const (
+   DeepCachingTypeAlways  = DeepCachingType("ALWAYS")
+   DeepCachingTypeNever   = DeepCachingType("NEVER")
+   DeepCachingTypeInvalid = DeepCachingType("")
+)
+
+// String returns a string representation of this deep caching type
+func (t DeepCachingType) String() string {
+   switch t {
+   case DeepCachingTypeAlways:
+   return string(t)
+   case DeepCachingTypeNever:
+   return string(t)
+   default:
+   return "INVALID"
+   }
+}
+
+// DeepCachingTypeFromString returns a DeepCachingType from its string 
representation, or DeepCachingTypeInvalid if the string is not a valid type.
+func DeepCachingTypeFromString(s string) DeepCachingType {
+   switch strings.ToLower(s) {
+   case "always":
+   return DeepCachingTypeAlways
+   case "never":
+   return DeepCachingTypeNever
+   default:
+   return DeepCachingTypeInvalid
+   }
+}
+
+// UnmarshalJSON unmarshals a JSON representation of a DeepCachingType (i.e. a 
string) or returns an error if the DeepCachingType is invalid
+func (t *DeepCachingType) UnmarshalJSON(data []byte) error {
+   s, err := strconv.Unquote(string(data))
+   if err != nil {
+   return errors.New(string(data) + " JSON not quoted")
+   }
+   *t = DeepCachingTypeFromString(s)
+   if *t == DeepCachingTypeInvalid {
+   return errors.New(string(data) + " is not a DeepCachingType")
+   }
+   return nil
+}
diff --git 
a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/ds/DeliveryService.java
 

[incubator-trafficcontrol] 14/36: Fix how deep NetworkNodes are loaded with a CacheLocation

2018-01-24 Thread elsloo
This is an automated email from the ASF dual-hosted git repository.

elsloo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-trafficcontrol.git

commit 5a7fd581605370fe344c88d76792d9f84d2c66bb
Author: Rawlin Peters 
AuthorDate: Tue Oct 31 16:12:31 2017 -0600

Fix how deep NetworkNodes are loaded with a CacheLocation

Lazily load Caches into a deep NetworkNode's CacheLocation rather than
setting its CacheLocation and greedily loading Caches into it at the
time of NetworkNode.generateTree(). This allows changes in Cache status
to be reflected in deep CZF lookups (i.e. when a Cache is set to
OFFLINE, stop deep routing to it). Whenever a new CRConfig is processed,
clear out deep Caches from the CacheLocations so that they can be lazily
loaded again (similar to how non-deep CacheLocations are reset to null).
---
 .../traffic_router/core/cache/CacheLocation.java   |   4 +
 .../traffic_router/core/config/ConfigHandler.java  |   2 +-
 .../traffic_router/core/loc/NetworkNode.java   | 108 +++--
 .../traffic_router/core/router/TrafficRouter.java  |  17 
 4 files changed, 77 insertions(+), 54 deletions(-)

diff --git 
a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/cache/CacheLocation.java
 
b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/cache/CacheLocation.java
index e2bf78d..7caf2a3 100644
--- 
a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/cache/CacheLocation.java
+++ 
b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/cache/CacheLocation.java
@@ -60,6 +60,10 @@ public class CacheLocation {
caches.put(cache.getId(), cache);
}
 
+   public void clearCaches() {
+   caches.clear();
+   }
+
@Override
public boolean equals(final Object obj) {
if (this == obj) {
diff --git 
a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/config/ConfigHandler.java
 
b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/config/ConfigHandler.java
index 53f3188..d9531a4 100644
--- 
a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/config/ConfigHandler.java
+++ 
b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/config/ConfigHandler.java
@@ -205,7 +205,6 @@ public class ConfigHandler {
parseCacheConfig(JsonUtils.getJsonNode(jo, 
"contentServers"), cacheRegister);
parseMonitorConfig(JsonUtils.getJsonNode(jo, 
"monitors"));
 
-   NetworkNode.setCacheRegister(cacheRegister);
federationsWatcher.configure(config);
steeringWatcher.configure(config);
steeringWatcher.setCacheRegister(cacheRegister);
@@ -223,6 +222,7 @@ public class ConfigHandler {
 * then clear cache locations, the lazy loading 
should work as designed. See issue TC-401 for details.
 */
NetworkNode.getInstance().clearCacheLocations();
+   
NetworkNode.getDeepInstance().clearCacheLocations(true);
setLastSnapshotTimestamp(sts);
} catch (ParseException e) {
isProcessing.set(false);
diff --git 
a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/NetworkNode.java
 
b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/NetworkNode.java
index 0b89d2e..c852184 100644
--- 
a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/NetworkNode.java
+++ 
b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/NetworkNode.java
@@ -20,11 +20,12 @@ import java.io.IOException;
 import java.net.InetAddress;
 import java.net.UnknownHostException;
 import java.util.Iterator;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
 import java.util.Map;
+import java.util.Set;
 import java.util.TreeMap;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.concurrent.CountDownLatch;
 
 import com.comcast.cdn.traffic_control.traffic_router.core.util.CidrAddress;
 import com.comcast.cdn.traffic_control.traffic_router.core.util.JsonUtils;
@@ -35,9 +36,7 @@ import com.fasterxml.jackson.databind.JsonNode;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import org.apache.log4j.Logger;
 
-import com.comcast.cdn.traffic_control.traffic_router.core.cache.Cache;
 import 

[incubator-trafficcontrol] 18/36: Refactor NetworkUpdater/DeepNetworkUpdater to reduce duplication

2018-01-24 Thread elsloo
This is an automated email from the ASF dual-hosted git repository.

elsloo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-trafficcontrol.git

commit a7177480692f29c8f34c4859c6ded2b9a7ab08ff
Author: Rawlin Peters 
AuthorDate: Thu Nov 2 17:11:42 2017 -0600

Refactor NetworkUpdater/DeepNetworkUpdater to reduce duplication

Move specialized code into a separate method and make DeepNetworkUpdater
extend NetworkUpdater and override the specialized method.
---
 .../core/loc/DeepNetworkUpdater.java   | 22 --
 .../traffic_router/core/loc/NetworkUpdater.java|  8 ++--
 2 files changed, 10 insertions(+), 20 deletions(-)

diff --git 
a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/DeepNetworkUpdater.java
 
b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/DeepNetworkUpdater.java
index b4df7b8..c978b63 100644
--- 
a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/DeepNetworkUpdater.java
+++ 
b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/DeepNetworkUpdater.java
@@ -18,7 +18,8 @@ package 
com.comcast.cdn.traffic_control.traffic_router.core.loc;
 import java.io.File;
 import java.io.IOException;
 
-public class DeepNetworkUpdater extends AbstractServiceUpdater {
+
+public class DeepNetworkUpdater extends NetworkUpdater {
 
public DeepNetworkUpdater() {
sourceCompressed = false;
@@ -27,23 +28,8 @@ public class DeepNetworkUpdater extends 
AbstractServiceUpdater {
}
 
@Override
-   public boolean loadDatabase() throws IOException {
-   final File existingDB = 
databasesDirectory.resolve(databaseName).toFile();
-
-   if (!existingDB.exists() || !existingDB.canRead()) {
-   return false;
-   }
-
-   return NetworkNode.generateTree(existingDB, false, true) != 
null;
-   }
-
-   @Override
-   public boolean verifyDatabase(final File dbFile) throws IOException {
-   if (!dbFile.exists() || !dbFile.canRead()) {
-   return false;
-   }
-
-   return NetworkNode.generateTree(dbFile, true, true) != null;
+   public NetworkNode generateTree(final File dbFile, final boolean 
verifyOnly) throws IOException {
+   return NetworkNode.generateTree(dbFile, verifyOnly, true);
}
 
 }
diff --git 
a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/NetworkUpdater.java
 
b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/NetworkUpdater.java
index 92d9e05..d1dc4c5 100644
--- 
a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/NetworkUpdater.java
+++ 
b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/NetworkUpdater.java
@@ -35,7 +35,7 @@ public class NetworkUpdater extends AbstractServiceUpdater {
return false;
}
 
-   return NetworkNode.generateTree(existingDB, false) != null;
+   return generateTree(existingDB, false) != null;
}
 
@Override
@@ -44,7 +44,11 @@ public class NetworkUpdater extends AbstractServiceUpdater {
return false;
}
 
-   return NetworkNode.generateTree(dbFile, true) != null;
+   return generateTree(dbFile, true) != null;
+   }
+
+   public NetworkNode generateTree(final File dbFile, final boolean 
verifyOnly) throws IOException, JSONException {
+   return NetworkNode.generateTree(dbFile, verifyOnly);
}
 
 }

-- 
To stop receiving notification emails like this one, please contact
els...@apache.org.


[incubator-trafficcontrol] 33/36: Rename goose migration due to rebase making it no longer latest

2018-01-24 Thread elsloo
This is an automated email from the ASF dual-hosted git repository.

elsloo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-trafficcontrol.git

commit 2da3fc87cfeafc1d29c7c7dbb651b634fa8d01ff
Author: Rawlin Peters 
AuthorDate: Mon Dec 18 16:47:19 2017 -0700

Rename goose migration due to rebase making it no longer latest
---
 ...add_deep_caching_type.sql => 2017121800_add_deep_caching_type.sql} | 0
 1 file changed, 0 insertions(+), 0 deletions(-)

diff --git 
a/traffic_ops/app/db/migrations/2017110100_add_deep_caching_type.sql 
b/traffic_ops/app/db/migrations/2017121800_add_deep_caching_type.sql
similarity index 100%
rename from 
traffic_ops/app/db/migrations/2017110100_add_deep_caching_type.sql
rename to traffic_ops/app/db/migrations/2017121800_add_deep_caching_type.sql

-- 
To stop receiving notification emails like this one, please contact
els...@apache.org.


[incubator-trafficcontrol] 23/36: Add Deep Caching docs for overview/how to use

2018-01-24 Thread elsloo
This is an automated email from the ASF dual-hosted git repository.

elsloo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-trafficcontrol.git

commit aa6c53698cc0c6d1dbba94c20dbc6730596e2802
Author: Rawlin Peters 
AuthorDate: Wed Nov 8 15:05:27 2017 -0700

Add Deep Caching docs for overview/how to use
---
 docs/source/admin/traffic_ops/using.rst |  2 +-
 docs/source/admin/traffic_router.rst| 48 +
 2 files changed, 49 insertions(+), 1 deletion(-)

diff --git a/docs/source/admin/traffic_ops/using.rst 
b/docs/source/admin/traffic_ops/using.rst
index e37be4d..334eb58 100644
--- a/docs/source/admin/traffic_ops/using.rst
+++ b/docs/source/admin/traffic_ops/using.rst
@@ -306,7 +306,7 @@ The fields in the Delivery Service view are:
 
+--+-+
 | Content Routing Type | The type of content 
routing this delivery service will use. See :ref:`rl-ds-types`. 

|
 
+--+-+
-| Deep Caching | (for HTTP routed delivery 
services only) When to do deep caching for this delivery service (see 
:ref:`Deep Caching ` for more details):
|
+| Deep Caching | (for HTTP routed delivery 
services only) When to do deep caching for this delivery service (see 
:ref:`Deep Caching ` for more details):  
|
 |  | - NEVER   


  |
 |  | - ALWAYS  


  |
 
+--+-+
diff --git a/docs/source/admin/traffic_router.rst 
b/docs/source/admin/traffic_router.rst
index 0fe1707..7dd60d9 100644
--- a/docs/source/admin/traffic_router.rst
+++ b/docs/source/admin/traffic_router.rst
@@ -144,6 +144,54 @@ Traffic Router currently follows the zone signing key 
pre-publishing operational
 
 .. _section 4.1.1.1 of RFC 6781: 
https://tools.ietf.org/html/rfc6781#section-4.1.1.1
 
+
+.. _rl-deep-cache:
+
+Deep Caching - Deep Coverage Zone Topology
+==
+
+Overview
+
+
+Deep Caching is a feature that enables clients to be routed to the closest
+possible "deep" edge caches on a per Delivery Service basis. The term "deep" is
+used in the networking sense, meaning that the edge caches are located deep in
+the network where the number of network hops to a client is as minimal as
+possible. This deep caching topology is desirable because storing content 
closer
+to the client gives better bandwidth savings, and sometimes the cost of
+bandwidth usage in the network outweighs the cost of adding storage. While it
+may not be feasible to cache an entire copy of the CDN's contents in every deep
+location (for the best possible bandwidth savings), storing just a relatively
+small amount of the CDN's most requested content can lead to very high 
bandwidth
+savings.
+
+Getting started
+---
+
+What you need:
+
+#. Edge caches deployed in "deep" locations and registered in Traffic Ops
+#. A Deep Coverage Zone File (DCZF) mapping these deep cache hostnames to 
specific network prefixes (see :ref:`rl-deep-czf` for details)
+#. Deep caching parameters in the Traffic Router Profile (see 
:ref:`rl-ccr-profile` for details):
+
+   * ``deepcoveragezone.polling.interval``
+   * ``deepcoveragezone.polling.url``
+
+#. Deep Caching enabled on one or more HTTP Delivery Services (i.e. 
``deepCachingType`` = ALWAYS)
+
+How it works
+
+
+Deep Coverage Zone routing is very similar to that of regular Coverage Zone
+routing, except 

[incubator-trafficcontrol] 12/36: Properly fall back to the regular CZF if deep CZF miss

2018-01-24 Thread elsloo
This is an automated email from the ASF dual-hosted git repository.

elsloo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-trafficcontrol.git

commit de838120767bce3484fde6d460b3cee0cbf69f3b
Author: Rawlin Peters 
AuthorDate: Thu Oct 26 16:32:56 2017 -0600

Properly fall back to the regular CZF if deep CZF miss
---
 .../traffic_control/traffic_router/core/router/TrafficRouter.java  | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git 
a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/router/TrafficRouter.java
 
b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/router/TrafficRouter.java
index 76c5627..705ec5b 100644
--- 
a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/router/TrafficRouter.java
+++ 
b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/router/TrafficRouter.java
@@ -256,7 +256,7 @@ public class TrafficRouter {
// Deep caching is enabled. See if there are deep 
caches available
cacheLocation = 
getDeepCoverageZoneCacheLocation(request.getClientIP(), ds);
if (cacheLocation != null && 
cacheLocation.getCaches().size() != 0) {
-   // Found deep caches for this client, and there 
are caches available there.
+   // Found deep caches for this client, and there 
are caches that might be available there.
// Use the deep cacheLocation, and set result 
to DEEP_CZ
result = ResultType.DEEP_CZ;
} else {
@@ -673,6 +673,11 @@ public class TrafficRouter {
return cacheLocation;
}
 
+   if (useDeep) {
+   // no available deep caches in the deep CZF (fall back 
to regular CZF)
+   return null;
+   }
+
// We had a hit in the CZF but the name does not match a known 
cache location.
// Check whether the CZF entry has a geolocation and use it if 
so.
return 
getClosestCacheLocation(cacheRegister.filterAvailableLocations(deliveryServiceId),
 networkNode.getGeolocation(), 
cacheRegister.getDeliveryService(deliveryServiceId));

-- 
To stop receiving notification emails like this one, please contact
els...@apache.org.


[incubator-trafficcontrol] 05/36: Add DeepCachingType field to DS struct in go client

2018-01-24 Thread elsloo
This is an automated email from the ASF dual-hosted git repository.

elsloo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-trafficcontrol.git

commit bfb1b56a2ab709687b213f3895c64ea60d55cfc4
Author: Rawlin Peters 
AuthorDate: Fri Oct 13 16:09:17 2017 -0600

Add DeepCachingType field to DS struct in go client
---
 lib/go-tc/deliveryservices.go | 1 +
 traffic_ops/client_tests/fixtures/delivery_service.go | 1 +
 traffic_ops/client_tests/fixtures/traffic_router_config.go| 8 
 .../client_tests/tests/integration/deliveryservice_test.go| 2 ++
 4 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/lib/go-tc/deliveryservices.go b/lib/go-tc/deliveryservices.go
index 66a65b4..6c1f381 100644
--- a/lib/go-tc/deliveryservices.go
+++ b/lib/go-tc/deliveryservices.go
@@ -56,6 +56,7 @@ type DeliveryService struct {
Active   bool   `json:"active"`
DSCP int`json:"dscp"`
RoutingName  string `json:"routingName"`
+   DeepCachingType  int`json:"deepCachingType"`
Signed   bool   `json:"signed"`
QStringIgnoreint`json:"qstringIgnore"`
GeoLimit int`json:"geoLimit"`
diff --git a/traffic_ops/client_tests/fixtures/delivery_service.go 
b/traffic_ops/client_tests/fixtures/delivery_service.go
index dd869e8..dcc714b 100644
--- a/traffic_ops/client_tests/fixtures/delivery_service.go
+++ b/traffic_ops/client_tests/fixtures/delivery_service.go
@@ -26,6 +26,7 @@ func DeliveryServices() *client.GetDeliveryServiceResponse {
XMLID:"ds-test",
Active:   true,
DSCP: 40,
+   DeepCachingType:  0,
RoutingName:  "edge",
Signed:   false,
QStringIgnore:1,
diff --git a/traffic_ops/client_tests/fixtures/traffic_router_config.go 
b/traffic_ops/client_tests/fixtures/traffic_router_config.go
index 4dca715..b4508b3 100644
--- a/traffic_ops/client_tests/fixtures/traffic_router_config.go
+++ b/traffic_ops/client_tests/fixtures/traffic_router_config.go
@@ -8,9 +8,9 @@ package fixtures
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
+ *
  *   http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -19,7 +19,6 @@ package fixtures
  * under the License.
  */
 
-
 import "github.com/apache/incubator-trafficcontrol/traffic_ops/client"
 
 // TrafficRouterConfig returns a default TRConfigResponse to be used for 
testing.
@@ -114,7 +113,8 @@ func TrafficRouterConfig() *client.TRConfigResponse {
Domains: []string{
"ga.atlanta.kabletown.net",
},
-   RoutingName: "edge",
+   RoutingName: "edge",
+   DeepCachingType: 0,
MissLocation: client.MissLocation{
Latitude:  75,
Longitude: 65,
diff --git a/traffic_ops/client_tests/tests/integration/deliveryservice_test.go 
b/traffic_ops/client_tests/tests/integration/deliveryservice_test.go
index 2aefc4d..14193af 100644
--- a/traffic_ops/client_tests/tests/integration/deliveryservice_test.go
+++ b/traffic_ops/client_tests/tests/integration/deliveryservice_test.go
@@ -62,6 +62,7 @@ func init() {
testDs.CDNID = cdn.ID
testDs.CacheURL = "cacheURL"
testDs.CheckPath = "CheckPath"
+   testDs.DeepCachingType = 0
testDs.DNSBypassCname = "DNSBypassCNAME"
testDs.DNSBypassIP = "10.10.10.10"
testDs.DNSBypassIP6 = "FF01:0:0:0:0:0:0:FB"
@@ -94,6 +95,7 @@ func init() {
testDs.RangeRequestHandling = 0
testDs.RegexRemap = "regexRemap"
testDs.RemapText = "remapText"
+   testDs.RoutingName = "edge"
testDs.Signed = false
testDs.TRResponseHeaders = "TRResponseHeaders"
testDs.Type = dsType.Name

-- 
To stop receiving notification emails like this one, please contact
els...@apache.org.


[incubator-trafficcontrol] 25/36: Show Deep Caching field for STEERING Delivery Services

2018-01-24 Thread elsloo
This is an automated email from the ASF dual-hosted git repository.

elsloo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-trafficcontrol.git

commit 23fa917f9a0e9fd6ee76a25a25ee934e9a707f6e
Author: Rawlin Peters 
AuthorDate: Thu Nov 9 14:16:21 2017 -0700

Show Deep Caching field for STEERING Delivery Services
---
 traffic_ops/app/templates/delivery_service/add.html.ep  | 2 +-
 traffic_ops/app/templates/delivery_service/edit.html.ep | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/traffic_ops/app/templates/delivery_service/add.html.ep 
b/traffic_ops/app/templates/delivery_service/add.html.ep
index c2f0841..26ea456 100644
--- a/traffic_ops/app/templates/delivery_service/add.html.ep
+++ b/traffic_ops/app/templates/delivery_service/add.html.ep
@@ -235,7 +235,7 @@
 $('#range_request_handlingi_row').hide(speed);
 $('#dns_bypass_ip_row').hide(speed);
 $('#dns_bypass_ip6_row').hide(speed);
-$('#deep_caching_type').hide(speed);
+$('#deep_caching_type').show(speed);
$('#regional_geo_blocking_row').show(speed);
$('#dns_bypass_cname_row').hide(speed);
 $('#dns_bypass_ttl_row').hide(speed);
diff --git a/traffic_ops/app/templates/delivery_service/edit.html.ep 
b/traffic_ops/app/templates/delivery_service/edit.html.ep
index 699361a..223e210 100644
--- a/traffic_ops/app/templates/delivery_service/edit.html.ep
+++ b/traffic_ops/app/templates/delivery_service/edit.html.ep
@@ -327,7 +327,7 @@ function setup_form(speed) {
 $('#range_request_handlingi_row').hide(speed);
 $('#dns_bypass_ip_row').hide(speed);
 $('#dns_bypass_ip6_row').hide(speed);
-$('#deep_caching_type').hide(speed);
+$('#deep_caching_type').show(speed);
$('#regional_geo_blocking_row').show(speed);
$('#dns_bypass_cname_row').hide(speed);
 $('#dns_bypass_ttl_row').hide(speed);

-- 
To stop receiving notification emails like this one, please contact
els...@apache.org.


[incubator-trafficcontrol] 06/36: Update TO unit/integration tests for deep_caching_type

2018-01-24 Thread elsloo
This is an automated email from the ASF dual-hosted git repository.

elsloo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-trafficcontrol.git

commit 87cc97c3fa945c7e1fd459bfd510e2605f3e7af3
Author: Rawlin Peters 
AuthorDate: Thu Oct 19 15:05:32 2017 -0600

Update TO unit/integration tests for deep_caching_type
---
 traffic_ops/app/lib/Fixtures/Deliveryservice.pm   | 15 +++
 .../app/lib/Fixtures/Integration/Deliveryservice.pm   |  8 
 traffic_ops/app/t/api/1.2/deliveryservice.t   |  7 +++
 traffic_ops/app/t/api/1.2/deliveryservice_crud.t  | 13 +
 traffic_ops/app/t/deliveryservice.t   |  5 +
 5 files changed, 48 insertions(+)

diff --git a/traffic_ops/app/lib/Fixtures/Deliveryservice.pm 
b/traffic_ops/app/lib/Fixtures/Deliveryservice.pm
index 0ca854c..7cd06dc 100644
--- a/traffic_ops/app/lib/Fixtures/Deliveryservice.pm
+++ b/traffic_ops/app/lib/Fixtures/Deliveryservice.pm
@@ -27,6 +27,7 @@ my %definition_for = (
active=> 1,
tenant_id => undef,
dscp  => 40,
+   deep_caching_type => 0,
routing_name  => 'foo',
qstring_ignore=> 0,
geo_limit => 0,
@@ -66,6 +67,7 @@ my %definition_for = (
active=> 1,
tenant_id => undef,
dscp  => 40,
+   deep_caching_type => 0,
routing_name  => 'foo',
qstring_ignore=> 0,
geo_limit => 0,
@@ -105,6 +107,7 @@ my %definition_for = (
active=> 1,
tenant_id => undef,
dscp  => 40,
+   deep_caching_type => 0,
routing_name  => 'foo',
qstring_ignore=> 0,
geo_limit => 0,
@@ -144,6 +147,7 @@ my %definition_for = (
active=> 1,
tenant_id => undef,
dscp  => 40,
+   deep_caching_type => 0,
routing_name  => 'foo',
qstring_ignore=> 0,
geo_limit => 0,
@@ -183,6 +187,7 @@ my %definition_for = (
active=> 1,
tenant_id => undef,
dscp  => 40,
+   deep_caching_type => 0,
routing_name  => 'foo',
qstring_ignore=> 0,
geo_limit => 0,
@@ -222,6 +227,7 @@ my %definition_for = (
active=> 1,
tenant_id => undef,
dscp  => 40,
+   deep_caching_type => 0,
routing_name  => 'foo',
qstring_ignore=> 0,
geo_limit => 0,
@@ -261,6 +267,7 @@ my %definition_for = (
active=> 1,
tenant_id => undef,
dscp  => 40,
+   deep_caching_type => 0,
routing_name  => 'foo',
qstring_ignore=> 0,
geo_limit => 0,
@@ -298,6 +305,7 @@ my %definition_for = (
active=> 1,
tenant_id => undef,
dscp  => 40,
+   deep_caching_type => 0,
routing_name  => 'foo',
qstring_ignore=> 0,
geo_limit => 0,
@@ -335,6 +343,7 @@ my %definition_for = (
active=> 1,
tenant_id => undef,
dscp  => 40,
+   deep_caching_type => 0,
routing_name  => 'foo',
qstring_ignore=> 0,
geo_limit => 0,
@@ -372,6 +381,7 @@ my %definition_for = (
active=> 1,
tenant_id => undef,
dscp  => 40,
+ 

[incubator-trafficcontrol] 07/36: Add Dynamic Deep Caching

2018-01-24 Thread elsloo
This is an automated email from the ASF dual-hosted git repository.

elsloo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-trafficcontrol.git

commit 0577ddcfbcc6012b463e40539137c323c61404fd
Author: Jan van Doorn 
AuthorDate: Fri Nov 18 21:26:53 2016 +

Add Dynamic Deep Caching

(cherry picked from commit ef5734bbfa77d6088407604cfb5790a53f49691c)
---
 .../traffic_router/core/config/ConfigHandler.java  | 17 +
 .../traffic_router/core/ds/DeliveryService.java| 14 
 .../core/loc/AbstractServiceUpdater.java   | 12 +++-
 .../core/loc/DeepNetworkUpdater.java   | 49 ++
 .../traffic_router/core/loc/NetworkNode.java   | 78 --
 .../traffic_router/core/router/StatTracker.java| 22 +-
 .../traffic_router/core/router/TrafficRouter.java  | 69 +--
 .../src/main/webapp/WEB-INF/applicationContext.xml |  9 +++
 .../core/router/TrafficRouterTest.java |  4 +-
 9 files changed, 259 insertions(+), 15 deletions(-)

diff --git 
a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/config/ConfigHandler.java
 
b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/config/ConfigHandler.java
index a657e23..e6bd2df 100644
--- 
a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/config/ConfigHandler.java
+++ 
b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/config/ConfigHandler.java
@@ -36,6 +36,7 @@ import 
com.comcast.cdn.traffic_control.traffic_router.core.loc.FederationsWatche
 import 
com.comcast.cdn.traffic_control.traffic_router.core.loc.GeolocationDatabaseUpdater;
 import com.comcast.cdn.traffic_control.traffic_router.core.loc.NetworkNode;
 import com.comcast.cdn.traffic_control.traffic_router.core.loc.NetworkUpdater;
+import 
com.comcast.cdn.traffic_control.traffic_router.core.loc.DeepNetworkUpdater;
 import 
com.comcast.cdn.traffic_control.traffic_router.core.loc.RegionalGeoUpdater;
 
 import 
com.comcast.cdn.traffic_control.traffic_router.core.secure.CertificatesPoller;
@@ -76,6 +77,7 @@ public class ConfigHandler {
private TrafficOpsUtils trafficOpsUtils;
 
private NetworkUpdater networkUpdater;
+   private DeepNetworkUpdater deepNetworkUpdater;
private FederationsWatcher federationsWatcher;
private RegionalGeoUpdater regionalGeoUpdater;
private SteeringWatcher steeringWatcher;
@@ -102,6 +104,9 @@ public class ConfigHandler {
public NetworkUpdater getNetworkUpdater () {
return networkUpdater;
}
+   public DeepNetworkUpdater getDeepNetworkUpdater () {
+   return deepNetworkUpdater;
+   }
 
public RegionalGeoUpdater getRegionalGeoUpdater() {
return regionalGeoUpdater;
@@ -141,6 +146,7 @@ public class ConfigHandler {
try {
parseGeolocationConfig(config);
parseCoverageZoneNetworkConfig(config);
+   parseDeepCoverageZoneNetworkConfig(config);
parseRegionalGeoConfig(jo);
 
final CacheRegister cacheRegister = new 
CacheRegister();
@@ -199,6 +205,7 @@ public class ConfigHandler {
parseCacheConfig(JsonUtils.getJsonNode(jo, 
"contentServers"), cacheRegister);
parseMonitorConfig(JsonUtils.getJsonNode(jo, 
"monitors"));
 
+   NetworkNode.setCacheRegister(cacheRegister);
federationsWatcher.configure(config);
steeringWatcher.configure(config);
steeringWatcher.setCacheRegister(cacheRegister);
@@ -251,6 +258,9 @@ public class ConfigHandler {
public void setNetworkUpdater(final NetworkUpdater nu) {
this.networkUpdater = nu;
}
+   public void setDeepNetworkUpdater(final DeepNetworkUpdater dnu) {
+   this.deepNetworkUpdater = dnu;
+   }
 
public void setRegionalGeoUpdater(final RegionalGeoUpdater 
regionalGeoUpdater) {
this.regionalGeoUpdater = regionalGeoUpdater;
@@ -541,6 +551,13 @@ public class ConfigHandler {
);
}
 
+   private void parseDeepCoverageZoneNetworkConfig(final JsonNode config) 
throws JsonUtilsException {
+   getDeepNetworkUpdater().setDataBaseURL(
+   JsonUtils.getString(config, 
"deepcoveragezone.polling.url"),
+   JsonUtils.optLong(config, 
"deepcoveragezone.polling.interval")
+   );
+   }
+
private void parseRegionalGeoConfig(final JsonNode jo) throws 
JsonUtilsException {
final JsonNode config 

[incubator-trafficcontrol] 20/36: Add test deep coverage zone file

2018-01-24 Thread elsloo
This is an automated email from the ASF dual-hosted git repository.

elsloo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-trafficcontrol.git

commit fa13b4c4945680d3bea981528353c8a6d3a4643b
Author: Rawlin Peters 
AuthorDate: Mon Nov 6 16:49:31 2017 -0700

Add test deep coverage zone file
---
 traffic_router/core/src/test/resources/dczmap.json | 25 ++
 1 file changed, 25 insertions(+)

diff --git a/traffic_router/core/src/test/resources/dczmap.json 
b/traffic_router/core/src/test/resources/dczmap.json
new file mode 100644
index 000..39185c1
--- /dev/null
+++ b/traffic_router/core/src/test/resources/dczmap.json
@@ -0,0 +1,25 @@
+{
+   "coverageZones":
+   {
+   "cache-group-01":
+   {
+   "network6":
+   [
+   "1234:5678::/64",
+   "1234:5679::/64"
+   ],
+   "network":
+   [
+   "192.168.8.0/24",
+   "192.168.9.0/24"
+   ],
+   "caches":
+   [
+   "host1",
+   "host2",
+   "host3",
+   "host4"
+   ]
+   }
+   }
+}

-- 
To stop receiving notification emails like this one, please contact
els...@apache.org.


[incubator-trafficcontrol] 09/36: Refactor NetworkNode.generateTree() to reduce duplication

2018-01-24 Thread elsloo
This is an automated email from the ASF dual-hosted git repository.

elsloo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-trafficcontrol.git

commit 714c82a0df934afb317fa3e7baff3a08799215de
Author: Rawlin Peters 
AuthorDate: Tue Oct 24 15:27:56 2017 -0600

Refactor NetworkNode.generateTree() to reduce duplication
---
 .../traffic_router/core/loc/NetworkNode.java   | 69 ++
 1 file changed, 32 insertions(+), 37 deletions(-)

diff --git 
a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/NetworkNode.java
 
b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/NetworkNode.java
index e4e32dd..bab5a2e 100644
--- 
a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/NetworkNode.java
+++ 
b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/NetworkNode.java
@@ -131,7 +131,7 @@ public class NetworkNode implements Comparable 
{
 // ones we already know about.
 final Cache cache = 
cacheRegister.getCacheMap().get(cacheHostname);
 if (cache == null) {
-LOGGER.error("DDC: deep cache entry " + 
cacheHostname + " not found in crconfig server list!");
+LOGGER.warn("DDC: deep cache entry " + 
cacheHostname + " not found in crconfig server list (it might not belong to 
this CDN)");
 } else {
 LOGGER.info("DDC: Adding " + cacheHostname + " 
to " + deepLoc.getId() + ".");
 deepLoc.addCache(cache);
@@ -142,42 +142,8 @@ public class NetworkNode implements 
Comparable {
 }
 }
 
-try {
-for (final JsonNode network6 : 
JsonUtils.getJsonNode(locData, "network6")) {
-final String ip = network6.asText();
-
-try {
-final NetworkNode nn = new NetworkNode(ip, loc, 
geolocation);
-if (useDeep && deepLoc != null) { // for deepLoc, 
we add the location here; normally it gets added by setLocation.
-nn.setCacheLocation(deepLoc);
-}
-root.add6(nn);
-} catch (NetworkNodeException ex) {
-LOGGER.error(ex, ex);
-return null;
-}
-}
-} catch (JsonUtilsException ex) {
-LOGGER.warn("An exception was caught while accessing the 
network6 key of " + loc + " in the incoming coverage zone file: " + 
ex.getMessage());
-}
-
-try {
-for (final JsonNode network : 
JsonUtils.getJsonNode(locData, "network")) {
-final String ip = network.asText();
-
-try {
-final NetworkNode nn = new NetworkNode(ip, loc, 
geolocation);
-if (useDeep && deepLoc != null) {
-nn.setCacheLocation(deepLoc);
-}
-root.add(nn);
-} catch (NetworkNodeException ex) {
-LOGGER.error(ex, ex);
-return null;
-}
-}
-} catch (JsonUtilsException ex) {
-LOGGER.warn("An exception was caught while accessing the 
network key of " + loc + " in the incoming coverage zone file: " + 
ex.getMessage());
+if (!addNetworkNodesToRoot(root, locData, loc, deepLoc, 
geolocation, useDeep)) {
+return null;
 }
 }
 
@@ -199,6 +165,35 @@ public class NetworkNode implements 
Comparable {
 return null;
 }
 
+private static boolean addNetworkNodesToRoot(final SuperNode root, final 
JsonNode locData, final String loc,
+ final CacheLocation deepLoc, 
final Geolocation geolocation, final boolean useDeep) {
+for (final String key : new String[]{"network6", "network"}) {
+try {
+for (final JsonNode network : JsonUtils.getJsonNode(locData, 
key)) {
+final String ip = network.asText();
+
+try {
+final NetworkNode nn = new NetworkNode(ip, loc, 
geolocation);
+if (useDeep && deepLoc != null) { // for deepLoc, we 
add the location here; normally it gets added by setLocation.
+nn.setCacheLocation(deepLoc);
+}
+

[incubator-trafficcontrol] 11/36: Clean up DDC code in TR a bit

2018-01-24 Thread elsloo
This is an automated email from the ASF dual-hosted git repository.

elsloo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-trafficcontrol.git

commit 235f4c75500326854b7d5d76ec3b38b1647c66a9
Author: Rawlin Peters 
AuthorDate: Wed Oct 25 17:02:17 2017 -0600

Clean up DDC code in TR a bit
---
 .../traffic_router/core/ds/DeliveryService.java|  5 +--
 .../traffic_router/core/router/TrafficRouter.java  | 45 ++
 2 files changed, 21 insertions(+), 29 deletions(-)

diff --git 
a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/ds/DeliveryService.java
 
b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/ds/DeliveryService.java
index e124fb4..7adc191 100644
--- 
a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/ds/DeliveryService.java
+++ 
b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/ds/DeliveryService.java
@@ -93,7 +93,7 @@ public class DeliveryService {
private final boolean acceptHttp;
private final boolean acceptHttps;
private final boolean redirectToHttps;
-   private int deepCache; // should this be final or should it be settable?
+   private final int deepCache;
 
// enums are hard in Java.
public static final int DC_NEVER   = 0;
@@ -398,9 +398,6 @@ public class DeliveryService {
public int getDeepCache() {
return deepCache;
}
-   public void setDeepCache(final int deepCache) {
-   this.deepCache = deepCache;
-   }
 
 
public boolean appendQueryString() {
diff --git 
a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/router/TrafficRouter.java
 
b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/router/TrafficRouter.java
index b1b2623..76c5627 100644
--- 
a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/router/TrafficRouter.java
+++ 
b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/router/TrafficRouter.java
@@ -249,33 +249,24 @@ public class TrafficRouter {
// DDC - Dynamic Deep Caching
// cacheLocation has a list of caches that we can hash this 
request to.
// Make this list different for content that should be cached 
deep.
-   //boolean useDeepCZ = false;
-   // first get the cachegroup, because the popularity is by 
cachegroup...
-   // this is expensive, but i see no other option.
-   final CacheLocation cacheGroup = 
getCoverageZoneCacheLocation(request.getClientIP(), ds, false);
-   CacheLocation cacheLocation = null;
+   CacheLocation cacheLocation;
ResultType result = ResultType.CZ;
-   if (cacheGroup != null) {
-   // change true to a function that returns yes if the 
request.getPath is popular
-   //boolean isPop = isPopular(request.getPath(), 
ds.getId(), cacheGroup.getId());
-   if (ds.getDeepCache() == DeliveryService.DC_ALWAYS) {
-   // Deep caching is enabled and wanted for the 
requested URL. See if there are deep caches available
-   cacheLocation = 
getCoverageZoneCacheLocation(request.getClientIP(), ds, true);
-   if (cacheLocation != null && 
cacheLocation.getCaches().size() != 0) {
-   // Found deep caches for this client, 
and there are caches available there.
-   // Use the cacheLocation, and set 
result to DEEP_CZ
-   result = ResultType.DEEP_CZ;
-   } else {
-   // No deep caches for this client, 
would have used them if there were any...
-   // set the cacheLocation to the 
cacheGroup found earlier.
-   result = ResultType.DEEP_CZ_MISS;
-   cacheLocation = cacheGroup;
-   }
+
+   if (ds.getDeepCache() == DeliveryService.DC_ALWAYS) {
+   // Deep caching is enabled. See if there are deep 
caches available
+   cacheLocation = 
getDeepCoverageZoneCacheLocation(request.getClientIP(), ds);
+   if (cacheLocation != null && 
cacheLocation.getCaches().size() != 0) {
+   // Found deep caches for this client, and there 
are caches available there.
+   // Use the deep cacheLocation, and set result 
to DEEP_CZ
+   result = ResultType.DEEP_CZ;
  

[incubator-trafficcontrol] 02/36: Reverse schema for deep_caching_type

2018-01-24 Thread elsloo
This is an automated email from the ASF dual-hosted git repository.

elsloo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-trafficcontrol.git

commit 6584109186031a1929dcffda83b4857fbdf9ed24
Author: Rawlin Peters 
AuthorDate: Thu Oct 12 15:21:45 2017 -0600

Reverse schema for deep_caching_type

There are also a couple other changes from running reverse_schema that
are unrelated to the new deep_caching_type column (forgot to run it the
last time the schema was updated).
---
 .../app/lib/Schema/Result/Deliveryservice.pm   | 22 +++---
 1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/traffic_ops/app/lib/Schema/Result/Deliveryservice.pm 
b/traffic_ops/app/lib/Schema/Result/Deliveryservice.pm
index f40cd87..d2e64f8 100644
--- a/traffic_ops/app/lib/Schema/Result/Deliveryservice.pm
+++ b/traffic_ops/app/lib/Schema/Result/Deliveryservice.pm
@@ -297,9 +297,15 @@ __PACKAGE__->table("deliveryservice");
 =head2 routing_name
 
   data_type: 'text'
-  default_value: 'ds'
+  default_value: 'cdn'
   is_nullable: 0
 
+=head2 deep_caching_type
+
+  data_type: 'smallint'
+  default_value: 0
+  is_nullable: 1
+
 =cut
 
 __PACKAGE__->add_columns(
@@ -418,7 +424,9 @@ __PACKAGE__->add_columns(
   "tenant_id",
   { data_type => "bigint", is_foreign_key => 1, is_nullable => 1 },
   "routing_name",
-  { data_type => "text", default_value => "ds", is_nullable => 0 },
+  { data_type => "text", default_value => "cdn", is_nullable => 0 },
+  "deep_caching_type",
+  { data_type => "smallint", default_value => 0, is_nullable => 1 },
 );
 
 =head1 PRIMARY KEY
@@ -603,7 +611,7 @@ __PACKAGE__->has_many(
   { cascade_copy => 0, cascade_delete => 0 },
 );
 
-=head2 steering_target_deliveryservices_2s
+=head2 steering_target_targets
 
 Type: has_many
 
@@ -612,9 +620,9 @@ Related object: L
 =cut
 
 __PACKAGE__->has_many(
-  "steering_target_deliveryservices_2s",
+  "steering_target_targets",
   "Schema::Result::SteeringTarget",
-  { "foreign.deliveryservice" => "self.id" },
+  { "foreign.target" => "self.id" },
   { cascade_copy => 0, cascade_delete => 0 },
 );
 
@@ -654,8 +662,8 @@ __PACKAGE__->belongs_to(
 );
 
 
-# Created by DBIx::Class::Schema::Loader v0.07042 @ 2017-08-09 15:16:31
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:FXNj6wNNq+jajg/rVqOSBw
+# Created by DBIx::Class::Schema::Loader v0.07042 @ 2017-10-12 15:07:17
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:JOlBU3gXo4iidTQarqMAcA
 
 # You can replace this text with custom code or comments, and it will be 
preserved on regeneration
 #

-- 
To stop receiving notification emails like this one, please contact
els...@apache.org.


[incubator-trafficcontrol] 27/36: Update Traffic Router to use deepCachingType as an enum

2018-01-24 Thread elsloo
This is an automated email from the ASF dual-hosted git repository.

elsloo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-trafficcontrol.git

commit c82985184e5b2995e96d18d09b949eea2dd1428e
Author: Rawlin Peters 
AuthorDate: Thu Nov 9 17:32:25 2017 -0700

Update Traffic Router to use deepCachingType as an enum
---
 .../traffic_router/core/ds/DeliveryService.java | 21 +++--
 .../traffic_router/core/router/TrafficRouter.java   |  2 +-
 2 files changed, 16 insertions(+), 7 deletions(-)

diff --git 
a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/ds/DeliveryService.java
 
b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/ds/DeliveryService.java
index facb1ba..e7d3727 100644
--- 
a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/ds/DeliveryService.java
+++ 
b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/ds/DeliveryService.java
@@ -93,10 +93,12 @@ public class DeliveryService {
private final boolean acceptHttp;
private final boolean acceptHttps;
private final boolean redirectToHttps;
-   private final int deepCache;
+   private final DeepCachingType deepCache;
 
-   public static final int DC_NEVER   = 0;
-   public static final int DC_ALWAYS  = 1;
+   public enum DeepCachingType {
+   NEVER,
+   ALWAYS
+   }
 
public DeliveryService(final String id, final JsonNode dsJo) throws 
JsonUtilsException {
this.id = id;
@@ -148,8 +150,15 @@ public class DeliveryService {
acceptHttp = JsonUtils.optBoolean(protocol, "acceptHttp", true);
acceptHttps = JsonUtils.optBoolean(protocol, "acceptHttps");
redirectToHttps = JsonUtils.optBoolean(protocol, 
"redirectToHttps");
-
-   this.deepCache = JsonUtils.optInt(dsJo, "deepCachingType", 
DC_NEVER);
+   final String dctString = JsonUtils.optString(dsJo, 
"deepCachingType", "NEVER");
+   DeepCachingType dct = DeepCachingType.NEVER;
+   try {
+   dct = DeepCachingType.valueOf(dctString);
+   } catch (IllegalArgumentException e) {
+   LOGGER.error("Unrecognized deepCachingType: '" + dct + 
"'. Defaulting to 'NEVER' instead");
+   } finally {
+   this.deepCache = dct;
+   }
}
 
public String getId() {
@@ -394,7 +403,7 @@ public class DeliveryService {
this.isDns = isDns;
}
 
-   public int getDeepCache() {
+   public DeepCachingType getDeepCache() {
return deepCache;
}
 
diff --git 
a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/router/TrafficRouter.java
 
b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/router/TrafficRouter.java
index be0579d..8037497 100644
--- 
a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/router/TrafficRouter.java
+++ 
b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/router/TrafficRouter.java
@@ -249,7 +249,7 @@ public class TrafficRouter {
CacheLocation cacheLocation;
ResultType result = ResultType.CZ;
 
-   if (ds.getDeepCache() == DeliveryService.DC_ALWAYS) {
+   if (ds.getDeepCache() == 
DeliveryService.DeepCachingType.ALWAYS) {
// Deep caching is enabled. See if there are deep 
caches available
cacheLocation = 
getDeepCoverageZoneCacheLocation(request.getClientIP(), ds);
if (cacheLocation != null && 
cacheLocation.getCaches().size() != 0) {

-- 
To stop receiving notification emails like this one, please contact
els...@apache.org.


[incubator-trafficcontrol] 26/36: Change deep_caching_type from an int to an ENUM

2018-01-24 Thread elsloo
This is an automated email from the ASF dual-hosted git repository.

elsloo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-trafficcontrol.git

commit d8612e76afa587cf8387bc1a142255787d4c2c23
Author: Rawlin Peters 
AuthorDate: Thu Nov 9 16:50:36 2017 -0700

Change deep_caching_type from an int to an ENUM
---
 lib/go-tc/deliveryservices.go  |  2 +-
 .../2017110100_add_deep_caching_type.sql   |  8 --
 traffic_ops/app/lib/API/Deliveryservice.pm |  2 +-
 traffic_ops/app/lib/Fixtures/Deliveryservice.pm| 30 +++---
 .../lib/Fixtures/Integration/Deliveryservice.pm| 16 ++--
 .../app/lib/Schema/Result/Deliveryservice.pm   | 26 +++
 traffic_ops/app/t/api/1.2/deliveryservice.t| 10 
 traffic_ops/app/t/api/1.2/deliveryservice_crud.t   | 26 +--
 traffic_ops/app/t/deliveryservice.t| 10 
 .../app/templates/delivery_service/_form.html.ep   |  9 +++
 .../client_tests/fixtures/delivery_service.go  |  2 +-
 .../client_tests/fixtures/traffic_router_config.go |  2 +-
 .../tests/integration/deliveryservice_test.go  |  2 +-
 .../FormDeliveryServiceController.js   |  4 +--
 14 files changed, 77 insertions(+), 72 deletions(-)

diff --git a/lib/go-tc/deliveryservices.go b/lib/go-tc/deliveryservices.go
index 6c1f381..b27b655 100644
--- a/lib/go-tc/deliveryservices.go
+++ b/lib/go-tc/deliveryservices.go
@@ -56,7 +56,7 @@ type DeliveryService struct {
Active   bool   `json:"active"`
DSCP int`json:"dscp"`
RoutingName  string `json:"routingName"`
-   DeepCachingType  int`json:"deepCachingType"`
+   DeepCachingType  string `json:"deepCachingType"`
Signed   bool   `json:"signed"`
QStringIgnoreint`json:"qstringIgnore"`
GeoLimit int`json:"geoLimit"`
diff --git 
a/traffic_ops/app/db/migrations/2017110100_add_deep_caching_type.sql 
b/traffic_ops/app/db/migrations/2017110100_add_deep_caching_type.sql
index 17c78cc..7c6d94b 100644
--- a/traffic_ops/app/db/migrations/2017110100_add_deep_caching_type.sql
+++ b/traffic_ops/app/db/migrations/2017110100_add_deep_caching_type.sql
@@ -15,9 +15,13 @@
 -- +goose Up
 -- SQL in section 'Up' is executed when this migration is applied
 
-alter table deliveryservice add column deep_caching_type smallint default 0;
+CREATE TYPE deep_caching_type AS ENUM ('NEVER', 'ALWAYS');
+
+ALTER TABLE deliveryservice ADD COLUMN deep_caching_type deep_caching_type 
DEFAULT 'NEVER';
 
 -- +goose Down
 -- SQL section 'Down' is executed when this migration is rolled back
 
- alter table deliveryservice drop column deep_caching_type;
+ALTER TABLE deliveryservice DROP COLUMN IF EXISTS deep_caching_type;
+
+DROP TYPE IF EXISTS deep_caching_type;
diff --git a/traffic_ops/app/lib/API/Deliveryservice.pm 
b/traffic_ops/app/lib/API/Deliveryservice.pm
index b78b5a7..675c1da 100644
--- a/traffic_ops/app/lib/API/Deliveryservice.pm
+++ b/traffic_ops/app/lib/API/Deliveryservice.pm
@@ -1387,7 +1387,7 @@ sub is_deliveryservice_valid {
active  => [ is_required("is 
required") ],
cdnId   => [ is_required("is 
required"), \_valid_int_or_undef ],
ccrDnsTtl   => [ 
\_valid_int_or_undef ],
-   deepCachingType  => [ is_like( qr/^[01]$/, "must be 
0 (never) or 1 (always)" ) ],
+   deepCachingType  => [ is_like( qr/^NEVER|ALWAYS$/, 
"must be NEVER or ALWAYS" ) ],
dnsBypassTtl=> [ 
\_valid_int_or_undef ],
dscp=> [ is_required("is 
required"), \_valid_int_or_undef ],
displayName => [ is_required("is 
required"), is_long_at_most( 48, 'too long' ) ],
diff --git a/traffic_ops/app/lib/Fixtures/Deliveryservice.pm 
b/traffic_ops/app/lib/Fixtures/Deliveryservice.pm
index 7cd06dc..4069ccc 100644
--- a/traffic_ops/app/lib/Fixtures/Deliveryservice.pm
+++ b/traffic_ops/app/lib/Fixtures/Deliveryservice.pm
@@ -27,7 +27,7 @@ my %definition_for = (
active=> 1,
tenant_id => undef,
dscp  => 40,
-   deep_caching_type => 0,
+   deep_caching_type => 'NEVER',
routing_name  => 'foo',
qstring_ignore=> 0,
geo_limit => 0,
@@ -67,7 +67,7 @@ my %definition_for = (
 

[incubator-trafficcontrol] 28/36: Improve error message for invalid deepCachingType when parsing

2018-01-24 Thread elsloo
This is an automated email from the ASF dual-hosted git repository.

elsloo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-trafficcontrol.git

commit 71a07a097cd5792c30745186499308aaa537c213
Author: Rawlin Peters 
AuthorDate: Fri Nov 10 11:47:27 2017 -0700

Improve error message for invalid deepCachingType when parsing
---
 .../cdn/traffic_control/traffic_router/core/ds/DeliveryService.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/ds/DeliveryService.java
 
b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/ds/DeliveryService.java
index e7d3727..3ac4ac9 100644
--- 
a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/ds/DeliveryService.java
+++ 
b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/ds/DeliveryService.java
@@ -155,7 +155,7 @@ public class DeliveryService {
try {
dct = DeepCachingType.valueOf(dctString);
} catch (IllegalArgumentException e) {
-   LOGGER.error("Unrecognized deepCachingType: '" + dct + 
"'. Defaulting to 'NEVER' instead");
+   LOGGER.error("DeliveryService '" + id + "' has an 
unrecognized deepCachingType: '" + dct + "'. Defaulting to 'NEVER' instead");
} finally {
this.deepCache = dct;
}

-- 
To stop receiving notification emails like this one, please contact
els...@apache.org.


[incubator-trafficcontrol] branch master updated (87489f1 -> 04d8665)

2018-01-24 Thread elsloo
This is an automated email from the ASF dual-hosted git repository.

elsloo pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-trafficcontrol.git.


from 87489f1  Fix TO not_a_parent server exclusion
 new 1689697  Add deep_caching_type to DB, API, CRConfig, and UI.
 new 6584109  Reverse schema for deep_caching_type
 new 4f6eaa2  Only show Deep Caching field for HTTP delivery services
 new c41a029  Add Deep Caching field to TP
 new bfb1b56  Add DeepCachingType field to DS struct in go client
 new 87cc97c  Update TO unit/integration tests for deep_caching_type
 new 0577ddc  Add Dynamic Deep Caching
 new ef134c5  Make param 'deepcoveragezone.polling.url' optional
 new 714c82a  Refactor NetworkNode.generateTree() to reduce duplication
 new 6e403ad  Fix failing unit tests due to DDC changes
 new 235f4c7  Clean up DDC code in TR a bit
 new de83812  Properly fall back to the regular CZF if deep CZF miss
 new dfda01a  Remove the need for deepcoveragezone.polling.initialDelay 
parameter
 new 5a7fd58  Fix how deep NetworkNodes are loaded with a CacheLocation
 new 0e52c33  Rename goose migration file for deep_caching_type due to 
rebase
 new d20eae6  Fix Java PMD violations
 new 4f4a915  Code cleanup/clarifying comments
 new a717748  Refactor NetworkUpdater/DeepNetworkUpdater to reduce 
duplication
 new d5ec744  Add deep NetworkNode test coverage
 new fa13b4c  Add test deep coverage zone file
 new 696caf1  WIP Dynamic Deep Caching docs
 new 5b890a0  More DDC documentation
 new aa6c536  Add Deep Caching docs for overview/how to use
 new b9d4b5e  DDC documentation cleanup
 new 23fa917  Show Deep Caching field for STEERING Delivery Services
 new d8612e7  Change deep_caching_type from an int to an ENUM
 new c829851  Update Traffic Router to use deepCachingType as an enum
 new 71a07a0  Improve error message for invalid deepCachingType when parsing
 new 013909d  Address DDC review comments
 new efefb8b  Update API ref to show deepCachingType is now a string
 new f22d2ec  Fix broken unit test and error message
 new 7b5a819  Revert "Show Deep Caching field for STEERING Delivery 
Services"
 new 2da3fc8  Rename goose migration due to rebase making it no longer 
latest
 new b6c84b9  Rename Deep Caching goose migration script again due to rebase
 new a63a07c  Remove DEEP_CZ_MISS rtype from Traffic Router
 new 04d8665  Move loadDeepCaches() into CacheLocation and add 
synchronization

The 36 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 docs/source/admin/traffic_ops/using.rst|  93 +++--
 docs/source/admin/traffic_router.rst   |  88 +---
 .../traffic_ops_api/v12/deliveryservice.rst|  48 ++-
 .../development/traffic_ops_api/v12/server.rst |   6 +
 .../development/traffic_ops_api/v12/user.rst   |   6 +
 lib/go-tc/deliveryservices.go  |   1 +
 lib/go-tc/enum.go  |  48 +++
 .../2018011000_add_deep_caching_type.sql   |  26 ++--
 traffic_ops/app/lib/API/Deliveryservice.pm |  14 +-
 traffic_ops/app/lib/Fixtures/Deliveryservice.pm|  15 ++
 .../lib/Fixtures/Integration/Deliveryservice.pm|   8 ++
 .../app/lib/Schema/Result/Deliveryservice.pm   |  38 +++--
 traffic_ops/app/lib/UI/DeliveryService.pm  |   3 +
 traffic_ops/app/lib/UI/Topology.pm |   5 +
 traffic_ops/app/t/api/1.2/deliveryservice.t|   7 +
 traffic_ops/app/t/api/1.2/deliveryservice_crud.t   |  13 ++
 traffic_ops/app/t/deliveryservice.t|   5 +
 .../app/templates/delivery_service/_form.html.ep   |  12 ++
 .../app/templates/delivery_service/add.html.ep |   4 +
 .../app/templates/delivery_service/edit.html.ep|   4 +
 .../client_tests/fixtures/delivery_service.go  |   1 +
 .../client_tests/fixtures/traffic_router_config.go |   8 +-
 .../tests/integration/deliveryservice_test.go  |   2 +
 .../FormDeliveryServiceController.js   |   5 +
 .../form.deliveryService.HTTP.tpl.html |  10 ++
 .../app/src/traffic_portal_properties.json |   1 +
 .../traffic_router/core/cache/CacheLocation.java   |  25 
 .../traffic_router/core/config/ConfigHandler.java  |  21 +++
 .../traffic_router/core/ds/DeliveryService.java|  21 ++-
 ...kNodeException.java => DeepNetworkUpdater.java} |  17 ++-
 .../traffic_router/core/loc/NetworkNode.java   | 154 +++--
 .../traffic_router/core/loc/NetworkUpdater.java|   8 +-
 .../traffic_router/core/router/StatTracker.java|  12 +-
 .../traffic_router/core/router/TrafficRouter.java  |  65 -
 

[incubator-trafficcontrol] 35/36: Remove DEEP_CZ_MISS rtype from Traffic Router

2018-01-24 Thread elsloo
This is an automated email from the ASF dual-hosted git repository.

elsloo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-trafficcontrol.git

commit a63a07c630a6d08cf482422266698c26ed28cbea
Author: Rawlin Peters 
AuthorDate: Tue Jan 23 16:36:50 2018 -0700

Remove DEEP_CZ_MISS rtype from Traffic Router

Falling back to the regular CZ will be logged as CZ rather than
DEEP_CZ_MISS.
---
 docs/source/admin/traffic_ops/using.rst|  4 +--
 docs/source/admin/traffic_router.rst   | 36 ++
 .../traffic_router/core/router/StatTracker.java| 12 +---
 .../traffic_router/core/router/TrafficRouter.java  |  1 -
 .../traffic_router/core/external/StatsTest.java|  4 +--
 5 files changed, 22 insertions(+), 35 deletions(-)

diff --git a/docs/source/admin/traffic_ops/using.rst 
b/docs/source/admin/traffic_ops/using.rst
index b11e20d..e7e8eb2 100644
--- a/docs/source/admin/traffic_ops/using.rst
+++ b/docs/source/admin/traffic_ops/using.rst
@@ -867,7 +867,7 @@ The Coverage Zone File (CZF) should contain a cachegroup 
name to network prefix
   "192.168.8.0/24",
   "192.168.9.0/24"
 ]
-  }
+  },
   "cache-group-02": {
 "coordinates": {
   "latitude":  3.3,
@@ -916,7 +916,7 @@ The Deep Coverage Zone File (DCZF) format is similar to the 
CZF format but adds
   "edge-01",
   "edge-02"
 ]
-  }
+  },
   "location-02": {
 "coordinates": {
   "latitude":  7.7,
diff --git a/docs/source/admin/traffic_router.rst 
b/docs/source/admin/traffic_router.rst
index 84b0f25..474dc96 100644
--- a/docs/source/admin/traffic_router.rst
+++ b/docs/source/admin/traffic_router.rst
@@ -187,23 +187,23 @@ Items within brackets below are detailed under the HTTP 
and DNS sections
 Fields Always Present
 -
 
-+--+-+---+
-|Name  |Description
  |Data 
  |
-+==+=+===+
-|qtype |Whether the request was for DNS or HTTP
  |Always DNS or HTTP   
  |
-+--+-+---+
-|chi   |The IP address of the requester
  |Depends on whether this was a DNS or HTTP request, see below 
sections  |
-+--+-+---+
-|ttms  |The amount of time in milliseconds it took Traffic Router to process 
the request |A number greater than or equal to zero 
|
-+--+-+---+
-|rtype |Routing Result Type
  |One of ERROR, CZ, GEO, MISS, STATIC_ROUTE, DS_REDIRECT, DS_MISS, 
INIT, FED |
-+--+-+---+
-|rloc  |GeoLocation of result  
  |Latitude and Longitude in Decimal Degrees
  |
-+--+-+---+
-|rdtl  |Result Details Associated with unusual conditions  
  |One of DS_NOT_FOUND, DS_NO_BYPASS, DS_BYPASS, DS_CZ_ONLY 
  |
-+--+-+---+
-|rerr  |Message about internal Traffic Router Error
  |String   
  |
-+--+-+---+
++--+-++

[incubator-trafficcontrol] 34/36: Rename Deep Caching goose migration script again due to rebase

2018-01-24 Thread elsloo
This is an automated email from the ASF dual-hosted git repository.

elsloo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-trafficcontrol.git

commit b6c84b925599de1d23a57aed4b42e79c959714de
Author: Rawlin Peters 
AuthorDate: Wed Jan 10 10:17:20 2018 -0700

Rename Deep Caching goose migration script again due to rebase
---
 ...add_deep_caching_type.sql => 2018011000_add_deep_caching_type.sql} | 0
 1 file changed, 0 insertions(+), 0 deletions(-)

diff --git 
a/traffic_ops/app/db/migrations/2017121800_add_deep_caching_type.sql 
b/traffic_ops/app/db/migrations/2018011000_add_deep_caching_type.sql
similarity index 100%
rename from 
traffic_ops/app/db/migrations/2017121800_add_deep_caching_type.sql
rename to traffic_ops/app/db/migrations/2018011000_add_deep_caching_type.sql

-- 
To stop receiving notification emails like this one, please contact
els...@apache.org.


[incubator-trafficcontrol] 21/36: WIP Dynamic Deep Caching docs

2018-01-24 Thread elsloo
This is an automated email from the ASF dual-hosted git repository.

elsloo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-trafficcontrol.git

commit 696caf1361750f797bdfe8fa540fdb8f542ad451
Author: Rawlin Peters 
AuthorDate: Mon Nov 6 16:50:31 2017 -0700

WIP Dynamic Deep Caching docs
---
 docs/source/admin/traffic_ops/using.rst | 84 +
 1 file changed, 76 insertions(+), 8 deletions(-)

diff --git a/docs/source/admin/traffic_ops/using.rst 
b/docs/source/admin/traffic_ops/using.rst
index 7a78bd1..19fb72a 100644
--- a/docs/source/admin/traffic_ops/using.rst
+++ b/docs/source/admin/traffic_ops/using.rst
@@ -306,6 +306,10 @@ The fields in the Delivery Service view are:
 
+--+-+
 | Content Routing Type | The type of content 
routing this delivery service will use. See :ref:`rl-ds-types`. 

|
 
+--+-+
+| Deep Caching | (for HTTP routed delivery 
services only) When to do deep caching for this delivery service (see 
:ref:`Deep Caching ` for more details: 
|
+|  | - NEVER   


  |
+|  | - ALWAYS  


  |
++--+-+
 | Delivery Service DNS TTL | The Time To Live on the 
DNS record for the Traffic Router A and  records 
(``..``).
   |
 
+--+-+
 | Delivery Servics URLs| (Read Only) An example of 
how the delivery URL may start. This could be multiple rows if multiple 
HOST_REGEXP entries have been entered.  
  |
@@ -846,23 +850,31 @@ The Coverage Zone File (CZF) should contain a cachegroup 
name to network prefix
   {
 "coverageZones": {
   "cache-group-01": {
+"coordinates": {
+  "latitude":  1.1,
+  "longitude": 2.2,
+},
 "network6": [
-  "1234:5678::\/64",
-  "1234:5679::\/64"
+  "1234:5678::/64",
+  "1234:5679::/64"
 ],
 "network": [
-  "192.168.8.0\/24",
-  "192.168.9.0\/24"
+  "192.168.8.0/24",
+  "192.168.9.0/24"
 ]
   }
   "cache-group-02": {
+"coordinates": {
+  "latitude":  3.3,
+  "longitude": 4.4,
+},
 "network6": [
-  "1234:567a::\/64",
-  "1234:567b::\/64"
+  "1234:567a::/64",
+  "1234:567b::/64"
 ],
 "network": [
-  "192.168.4.0\/24",
-  "192.168.5.0\/24"
+  "192.168.4.0/24",
+  "192.168.5.0/24"
 ]
   }
 }
@@ -872,6 +884,62 @@ The CZF is an input to the Traffic Control CDN, and as 
such does not get generat
 
 The script that generates the CZF file is not part of Traffic Control, since 
it is different for each situation.
 
+.. note:: The "coordinates" section is optional and may be used by Traffic 
Router for localization in the case of a CZF "hit" where the zone name does not 
map to a Cache Group name in Traffic Ops (i.e. Traffic Router will route to the 
closest Cache Group(s) geographically).
+
+.. _rl-deep-czf:
+
+The Deep Coverage Zone File

[incubator-trafficcontrol] 13/36: Remove the need for deepcoveragezone.polling.initialDelay parameter

2018-01-24 Thread elsloo
This is an automated email from the ASF dual-hosted git repository.

elsloo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-trafficcontrol.git

commit dfda01a0e3f4db4452d0c9ea81db78ef04da2d5b
Author: Rawlin Peters 
AuthorDate: Mon Oct 30 16:47:13 2017 -0600

Remove the need for deepcoveragezone.polling.initialDelay parameter
---
 .../traffic_router/core/loc/AbstractServiceUpdater.java  | 12 +---
 .../traffic_router/core/loc/NetworkNode.java | 16 ++--
 .../core/src/main/webapp/WEB-INF/applicationContext.xml  |  2 +-
 3 files changed, 16 insertions(+), 14 deletions(-)

diff --git 
a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/AbstractServiceUpdater.java
 
b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/AbstractServiceUpdater.java
index 650bdea..3304119 100644
--- 
a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/AbstractServiceUpdater.java
+++ 
b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/AbstractServiceUpdater.java
@@ -48,7 +48,6 @@ public abstract class AbstractServiceUpdater {
protected String databaseName;
protected ScheduledExecutorService executorService;
private long pollingInterval;
-   private long initialDelay = -1;
protected boolean loaded = false;
protected ScheduledFuture scheduledService;
private TrafficRouterManager trafficRouterManager;
@@ -93,13 +92,9 @@ public abstract class AbstractServiceUpdater {
 
public void init() {
final long pollingInterval = getPollingInterval();
-if (initialDelay == -1) {
- initialDelay = pollingInterval;
-}
-
final Date nextFetchDate = new Date(System.currentTimeMillis() 
+ pollingInterval);
LOGGER.info("[" + getClass().getSimpleName() + "] Fetching 
external resource " + dataBaseURL + " at interval: " + pollingInterval + " : " 
+ TimeUnit.MILLISECONDS + " next update occurrs at " + nextFetchDate);
-   scheduledService = 
executorService.scheduleWithFixedDelay(updater, initialDelay, pollingInterval, 
TimeUnit.MILLISECONDS);
+   scheduledService = 
executorService.scheduleWithFixedDelay(updater, pollingInterval, 
pollingInterval, TimeUnit.MILLISECONDS);
}
 
@SuppressWarnings({"PMD.CyclomaticComplexity", "PMD.NPathComplexity"})
@@ -199,11 +194,6 @@ public abstract class AbstractServiceUpdater {
dataBaseURL = null;
}
 
-public void setDataBaseURL(final String url, final long refresh, final 
long iDelay) {
-this.initialDelay = iDelay;
-this.setDataBaseURL(url, refresh);
-}
-
public void setDataBaseURL(final String url, final long refresh) {
if (refresh !=0 && refresh != pollingInterval) {
 
diff --git 
a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/NetworkNode.java
 
b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/NetworkNode.java
index bab5a2e..0b89d2e 100644
--- 
a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/NetworkNode.java
+++ 
b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/NetworkNode.java
@@ -24,7 +24,7 @@ import java.util.Map;
 import java.util.TreeMap;
 import java.util.List;
 import java.util.ArrayList;
-
+import java.util.concurrent.CountDownLatch;
 
 import com.comcast.cdn.traffic_control.traffic_router.core.util.CidrAddress;
 import com.comcast.cdn.traffic_control.traffic_router.core.util.JsonUtils;
@@ -47,6 +47,7 @@ public class NetworkNode implements Comparable {
 private static NetworkNode deepInstance;
 
 private static CacheRegister cacheRegister;
+private static final CountDownLatch cacheRegisterLatch = new 
CountDownLatch(1);
 
 private CidrAddress cidrAddress;
 private String loc;
@@ -84,6 +85,17 @@ public class NetworkNode implements Comparable {
 
 public static void setCacheRegister(final CacheRegister cr) {
 cacheRegister = cr;
+cacheRegisterLatch.countDown();
+}
+
+public static CacheRegister getCacheRegisterBlocking() {
+try {
+cacheRegisterLatch.await();
+} catch (InterruptedException e) {
+LOGGER.warn(e);
+} finally {
+return cacheRegister;
+}
 }
 
 public static NetworkNode generateTree(final File f, final boolean 
verifyOnly, final boolean useDeep) throws IOException  {
@@ -129,7 +141,7 @@ public class NetworkNode implements Comparable 
{
 }
 // Get the cache from the cacheregister here - 
don't create a new cache due to the deep file, only reuse the

[incubator-trafficcontrol] 16/36: Fix Java PMD violations

2018-01-24 Thread elsloo
This is an automated email from the ASF dual-hosted git repository.

elsloo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-trafficcontrol.git

commit d20eae653176d0855c261fda98657e5f66cce284
Author: Rawlin Peters 
AuthorDate: Wed Nov 1 14:36:15 2017 -0600

Fix Java PMD violations
---
 .../cdn/traffic_control/traffic_router/core/loc/NetworkNode.java| 6 +++---
 .../traffic_control/traffic_router/core/router/TrafficRouter.java   | 3 ++-
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git 
a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/NetworkNode.java
 
b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/NetworkNode.java
index c852184..c098320 100644
--- 
a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/NetworkNode.java
+++ 
b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/NetworkNode.java
@@ -138,7 +138,7 @@ public class NetworkNode implements Comparable 
{
 
 private static boolean addNetworkNodesToRoot(final SuperNode root, final 
String loc, final JsonNode locData,
  final Geolocation 
geolocation, final boolean useDeep) {
-CacheLocation deepLoc = new CacheLocation( "deep." + loc, geolocation 
!= null ? geolocation : new Geolocation(0.0, 0.0));  // TODO JvD
+final CacheLocation deepLoc = new CacheLocation( "deep." + loc, 
geolocation != null ? geolocation : new Geolocation(0.0, 0.0));  // TODO JvD
 final Set cacheNames = parseDeepCacheNames(locData);
 
 for (final String key : new String[]{"network6", "network"}) {
@@ -173,7 +173,7 @@ public class NetworkNode implements Comparable 
{
 return true;
 }
 
-private static Set parseDeepCacheNames(JsonNode locationData) {
+private static Set parseDeepCacheNames(final JsonNode 
locationData) {
 final Set cacheNames = new HashSet();
 final JsonNode cacheArray;
 
@@ -314,7 +314,7 @@ public class NetworkNode implements Comparable 
{
 clearCacheLocations(false);
 }
 
-public void clearCacheLocations(boolean clearCachesOnly) {
+public void clearCacheLocations(final boolean clearCachesOnly) {
 synchronized(this) {
 if (clearCachesOnly && cacheLocation != null) {
 cacheLocation.clearCaches();
diff --git 
a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/router/TrafficRouter.java
 
b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/router/TrafficRouter.java
index 68dfb6b..91d3751 100644
--- 
a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/router/TrafficRouter.java
+++ 
b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/router/TrafficRouter.java
@@ -642,6 +642,7 @@ public class TrafficRouter {
return getCoverageZoneCacheLocation(ip, deliveryServiceId, 
false); // default is not deep
}
 
+   @SuppressWarnings({"PMD.CyclomaticComplexity", "PMD.NPathComplexity"})
public CacheLocation getCoverageZoneCacheLocation(final String ip, 
final String deliveryServiceId, final boolean useDeep) {
NetworkNode networkNode;
if (useDeep) {
@@ -688,7 +689,7 @@ public class TrafficRouter {
return 
getClosestCacheLocation(cacheRegister.filterAvailableLocations(deliveryServiceId),
 networkNode.getGeolocation(), 
cacheRegister.getDeliveryService(deliveryServiceId));
}
 
-   private void loadDeepCaches(NetworkNode networkNode, CacheLocation 
cacheLocation) {
+   private void loadDeepCaches(final NetworkNode networkNode, final 
CacheLocation cacheLocation) {
if (networkNode.getDeepCacheNames() != null) {
for (final String deepCacheName : 
networkNode.getDeepCacheNames()) {
final Cache deepCache = 
cacheRegister.getCacheMap().get(deepCacheName);

-- 
To stop receiving notification emails like this one, please contact
els...@apache.org.


[incubator-trafficcontrol] 04/36: Add Deep Caching field to TP

2018-01-24 Thread elsloo
This is an automated email from the ASF dual-hosted git repository.

elsloo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-trafficcontrol.git

commit c41a029e7e4afba411c5378afc7f2f3394d49515
Author: Rawlin Peters 
AuthorDate: Fri Oct 13 11:12:33 2017 -0600

Add Deep Caching field to TP
---
 .../form/deliveryService/FormDeliveryServiceController.js  |  5 +
 .../form/deliveryService/form.deliveryService.HTTP.tpl.html| 10 ++
 traffic_portal/app/src/traffic_portal_properties.json  |  1 +
 3 files changed, 16 insertions(+)

diff --git 
a/traffic_portal/app/src/common/modules/form/deliveryService/FormDeliveryServiceController.js
 
b/traffic_portal/app/src/common/modules/form/deliveryService/FormDeliveryServiceController.js
index 71927fc..049a11b 100644
--- 
a/traffic_portal/app/src/common/modules/form/deliveryService/FormDeliveryServiceController.js
+++ 
b/traffic_portal/app/src/common/modules/form/deliveryService/FormDeliveryServiceController.js
@@ -128,6 +128,11 @@ var FormDeliveryServiceController = 
function(deliveryService, type, types, $scop
 { value: 56, label: '56  - CS7' }
 ];
 
+$scope.deepCachingTypes = [
+{ value: 0, label: '0 - Never' },
+{ value: 1, label: '1 - Always' }
+]
+
 $scope.dispersions = [
 { value: 1, label: '1 - OFF' },
 { value: 2, label: '2' },
diff --git 
a/traffic_portal/app/src/common/modules/form/deliveryService/form.deliveryService.HTTP.tpl.html
 
b/traffic_portal/app/src/common/modules/form/deliveryService/form.deliveryService.HTTP.tpl.html
index b651434..a36afe6 100644
--- 
a/traffic_portal/app/src/common/modules/form/deliveryService/form.deliveryService.HTTP.tpl.html
+++ 
b/traffic_portal/app/src/common/modules/form/deliveryService/form.deliveryService.HTTP.tpl.html
@@ -168,6 +168,16 @@ under the License.
 
 
 
+
+Deep Caching *
+
+
+Select...
+
+Required
+
+
+
 
 DSCP Tag *
 
diff --git a/traffic_portal/app/src/traffic_portal_properties.json 
b/traffic_portal/app/src/traffic_portal_properties.json
index d1bb1f0..2935001 100644
--- a/traffic_portal/app/src/traffic_portal_properties.json
+++ b/traffic_portal/app/src/traffic_portal_properties.json
@@ -83,6 +83,7 @@
 },
 "HTTP": {
   "routingName": "cdn",
+  "deepCachingType": "NEVER",
   "dscp": 0,
   "ipv6RoutingEnabled": false,
   "rangeRequestHandling": 0,

-- 
To stop receiving notification emails like this one, please contact
els...@apache.org.


[incubator-trafficcontrol] 22/36: More DDC documentation

2018-01-24 Thread elsloo
This is an automated email from the ASF dual-hosted git repository.

elsloo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-trafficcontrol.git

commit 5b890a008a073d6e36f114152ac22c76f0ab8003
Author: Rawlin Peters 
AuthorDate: Tue Nov 7 15:44:47 2017 -0700

More DDC documentation
---
 docs/source/admin/traffic_ops/using.rst| 20 ++-
 docs/source/admin/traffic_router.rst   |  8 +
 .../traffic_ops_api/v12/deliveryservice.rst| 40 +-
 .../development/traffic_ops_api/v12/server.rst |  5 +++
 .../development/traffic_ops_api/v12/user.rst   |  5 +++
 5 files changed, 69 insertions(+), 9 deletions(-)

diff --git a/docs/source/admin/traffic_ops/using.rst 
b/docs/source/admin/traffic_ops/using.rst
index 19fb72a..e37be4d 100644
--- a/docs/source/admin/traffic_ops/using.rst
+++ b/docs/source/admin/traffic_ops/using.rst
@@ -306,7 +306,7 @@ The fields in the Delivery Service view are:
 
+--+-+
 | Content Routing Type | The type of content 
routing this delivery service will use. See :ref:`rl-ds-types`. 

|
 
+--+-+
-| Deep Caching | (for HTTP routed delivery 
services only) When to do deep caching for this delivery service (see 
:ref:`Deep Caching ` for more details: 
|
+| Deep Caching | (for HTTP routed delivery 
services only) When to do deep caching for this delivery service (see 
:ref:`Deep Caching ` for more details):
|
 |  | - NEVER   


  |
 |  | - ALWAYS  


  |
 
+--+-+
@@ -714,7 +714,11 @@ Traffic Router Profile
 
+-++---+
 | coveragezone.polling.interval   | CRConfig.json  | How often 
to refresh the coverage zone map in ms  

|
 
+-++---+
-| coveragezone.polling.url| CRConfig.json  | The 
location (URL) to retrieve the coverage zone map file in XML format from.   

  |
+| coveragezone.polling.url| CRConfig.json  | The 
location (URL) to retrieve the coverage zone map file in JSON format from.  

  |
++-++---+
+| deepcoveragezone.polling.interval   | CRConfig.json  | How often 
to refresh the deep coverage zone map in ms  

svn commit: r24413 - /release/incubator/trafficcontrol/KEYS

2018-01-24 Thread rob
Author: rob
Date: Wed Jan 24 16:56:17 2018
New Revision: 24413

Log:
Update KEYS file for Release Manager

Modified:
release/incubator/trafficcontrol/KEYS

Modified: release/incubator/trafficcontrol/KEYS
==
--- release/incubator/trafficcontrol/KEYS (original)
+++ release/incubator/trafficcontrol/KEYS Wed Jan 24 16:56:17 2018
@@ -278,3 +278,203 @@ bEoA9qua4jJB3+fZECZBWeq5AU3RCPDiivCuH12n
 ncrQaxA=
 =FEOJ
 -END PGP PUBLIC KEY BLOCK-
+pub   4096R/D483C4A9 2016-01-19 [expires: 2020-01-19]
+uid   [ultimate] Robert Butts 
+sig 3D483C4A9 2016-01-19  Robert Butts 
+sig  B491952E 2016-01-19  [User ID not found]
+sig  ABACC34B 2016-01-19  Trevor Ackerman (Code Signing Key) 

+sig  0BDD66E8 2016-01-19  Jeremy Mitchell (CODE SIGNING KEY) 

+sig  53C6B1C9 2016-01-19  David Neuman (CODE SIGNING KEY) 

+sig  3117344F 2016-01-19  Jackie Heitzer (Code Signing Key) 

+sig  97AD9CCB 2016-01-19  Jan van Doorn 
+sig  A285F830 2016-01-19  Dewayne Richardson (Open Source Key) 

+sig  DAE1FE2B 2016-01-19  Phil Sorber (CODE SIGNING KEY) 

+sig  6F7762B8 2016-01-19  Dan Kirkwood (code signing key) 

+sig  08FF506F 2016-01-19  Jeff Elsloo 
+sig  97F0E1C7 2016-01-19  Mark Torluemke (CODE SIGNING KEY) 

+sig  75A77A64 2016-01-19  John J. Rushford (CODE SIGNING KEY) 

+sub   4096R/298FD492 2016-01-19 [expires: 2020-01-19]
+sig  D483C4A9 2016-01-19  Robert Butts 
+
+-BEGIN PGP PUBLIC KEY BLOCK-
+Comment: GPGTools - https://gpgtools.org
+
+mQINBFaeafIBEACqc0WE6caRL0l5fOsQTXUfNSIobi2BrOn1h8E9u4DbboV8M1Nc
+mUA6gpxaxJ4aD/kv+B0bE3DQpBa3whEnj6AUeOtz4HtvQwmiagr4Kl2Ion5J8nge
+H2EKGQMS2OQSPSXuLsyPGzPMFcvZ8+U3yP6rBYtpkQ7k1391JXIP5ImWrhGHZP2K
+o4Cbdt2pv7ETpRRtFTSrxJ9ld6bwEMu0VbIfVMWUIcXWBCENRl6l2gAPwXYkqlxh
+6QD3RjdDi/AbgupkP4PWuuj3s47zcMaL9DSt4wHjYszKhIreXKTFOr4Xd8PQIWoc
+VxdeSF8yHv80WOtaJ8gYK4Kj4HA5TuS+bOTZsnyjq5+x43qpE2H00fyz7m2fGS7U
+4TxgpdIXUR7whhmyiJzqSwpgY6CNBCHP5MHyFvZSu+ZpZomqYdTQ1rcW3fNrVS+y
+QUinbtR7hkk9NdEt5QpQkkQGSpnC1UL7d+l+wmScdtfqAzNxgnFzNZPtnmeF1iI+
+BcOgSdH6cqaVOGbyizd2tAIFuQOFTN1fu+3e3XWXUpqInm9+tKQ/SUTLbR2iP5U+
+l6UDpoP6E9pl6j+FtwqtEh8KC+s6Em3Vu+SiLofqsHncipNv5vZtwNLx1BNY8mw1
+bk09Wse+uq3NgD4TOtgyQJl4c8oGRtJAfmDKWFytHFrafJeRdR8U8b/rpQARAQAB
+tCdSb2JlcnQgQnV0dHMgPHJvYmVydC5vLmJ1dHRzQGdtYWlsLmNvbT6JAj0EEwEK
+ACcFAlaeafICGwMFCQeGH4AFCwkIBwMFFQoJCAsFFgIDAQACHgECF4AACgkQkrHr
+6dSDxKkAGA/+K5hzL9mabm/2iTE4yogzv89hF4YvXkfbvCEgZuu6VSSrl7O/cRJ+
+lydlGR3ummg0JlEBI5tyTiEvgJKDXLmh1ZGEK859uyk8AFOb2zBF2Xx/aZ06zajg
+LONdCL+XokRbb0ZNyEn0scymb6duggH996WmyaIM0HVHx2WyV7PcGstdfEGjigUu
+rbgTm33fKoLZg3koEf4Y8gtr2mvs5hjkb0ehlujK+MZ6o12mZYbqByiPycOaaSMl
+eynpDQBOtdf3CdqraPa0xxu9Q8LnOgnTZg4iLgphg3x0ydzrW5EbLSkC9pLLvN5q
+0ykqbb967M+pmKx2QTkrb0bQNAToLo1QcAdLYkfxG5hml1SjCrxtvFTps2QoF54W
+R6PC8IeLbKa8sqQ95JdQy7PQ6B+kSchiVwhmkg1wnykKiiJx5LXsSl4brTl0OdrN
+9DB9XMABuQYt1Jv5eAq2G5/Sb/fwjV23QARg22Fd3Zh7B3VW0o+tWySXtoBw4CNO
+Qm4ZsPReP0wNdLyC58HncNhkUM+UjFrldIYQ/i/aJJJ61POuI6DUqPLUE49SHdAV
+URNCyvOTAXVPm1+IOLIkY9/f3mcAcXBCGUzTAZoZq+DQPtSvcTf8gEJ0MHsVOLgp
+Uf2I6jSYzC1JrP+o0UamkPJBp1cN1hAH3WsDJcVj83NGX1/HeYSAjrKJARwEEAEK
+AAYFAlaeg1UACgkQolgrWLSRlS6SMQf+M+DIQEbxfDPlCWNNXLnd4miT3xwV3C2+
++cdsSbMxcMe2BT5L6k/ueOuytTWrnWcykqVgcD89mL6Yhf9G0xCss3ieZVSk8XPQ
++Kweuqbc9wp0rfXOYhk9nQF00g7PIndoiB8kV/olJc5JSLX8IsXKEAsSDcsQEEFb
++pbi/jvQ1HswQRcdpBtT/ZbBTegkHQaMdb2cnkEuVhf+QVsVeKTE8y+LYDnebuKI
+FSv2Nd/sq0EFR06NVMLfkzOTODnJhZPzKsNRW70l8Q3gc75RcacM02Cgkqsdrg3k
++H6RYVRRRam/TI+Q9lbVIRkk45B/4P7g3YxE5XN528I9Q79uDKPEr4kCHAQQAQIA
+BgUCVp6BYAAKCRDrKFMqq6zDS51MEADFi6P43TFNSNZGzFAGGAgu3SaItUeXePes
+jJ1a0wkAHkT/za/BfmKO60DCr4mjNHcOMgnn+a9p0y4gdA9qT/AJ9n1lkgYAYVie
+QUtyYgDqF38nw+ngTcR/vyVd1iHMIzWLvaVB6GL2fq7/sSDbjLmMFsKt9jxN+VgB
+7QecCzu9iJO5PQ8vwsjGg92b18cTYmOPUtfESEzLgdnLIWz5OVg9NrVW3FLZXrNp
+KpEQkgX3hi174XPfR50ARpKjnfn8sHEkRHi/fr9Kb2tcs9g/RGHOlWT9rvNvs5RV
+AOvagOlxJXDx8IdJ3PV2qaPi9KFNfZ40beJ9Mo8s2iiDz56U9OqSTg6F/i2UTxVt
+s6znCTvdcntMXJcSup74w0c79EOalTiu49ISi0iKaEkP802taiM96m1UU3LUEJcp
+ldMPjZD1NjjJwZpGEfAdG34oUtT9H/6NGeO8tUoaN1FYi9lXES9Kgy3+7vlw/3b5
+8GC8D8z+oKDZY1I6HZQ62sQggq5St7JUZn7ex+/b3I5dG+KWl8RbxKEhWVBkm1uN
+V8L1y4liXDDP3kmXrosqU/H8rcGSI451ylfx6T8f8C2DB4Mts+aAvf56UxqYw/Td
+M2jtYGPjVpGL4pRoi705K6G+9FhdPi812pkt10QFHlEQSjMT1080EvdGvd0YGhgf
+xYmHdRognokCHAQQAQIABgUCVp6BrgAKCRC2GjxrC91m6KhID/4xvhENNDAveRPg
+7K82SYBbJhpSW2K5giZwBIMYPd5DUMhzbI9kExvhbBaHsF5eGOx51/H3a0+exoqd
+nEG1YlSnvgUhcPQ1WTmPLh0ClbYEepjKgGWaCtjIjpA1k7MSrxrT/qIJUsFtAAl4
+qHNnmdUkHg5piVSJi1nwRGrfEiKGogd/00AO3YSMlzpU6vy77rzGmGbun6Jhb07I