[GitHub] [knox] lmccay commented on issue #299: KNOX-2307 - CSVKnoxShellTableBuilder must support quoted strings and …

2020-03-21 Thread GitBox
lmccay commented on issue #299: KNOX-2307 - CSVKnoxShellTableBuilder must 
support quoted strings and …
URL: https://github.com/apache/knox/pull/299#issuecomment-602112910
 
 
   Fixed to not rely on changes from PR #296 


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


With regards,
Apache Git Services


[jira] [Work logged] (KNOX-2307) CSVKnoxShellTableBuilder must support quoted strings and embedded commas

2020-03-21 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/KNOX-2307?focusedWorklogId=407515=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-407515
 ]

ASF GitHub Bot logged work on KNOX-2307:


Author: ASF GitHub Bot
Created on: 21/Mar/20 22:20
Start Date: 21/Mar/20 22:20
Worklog Time Spent: 10m 
  Work Description: lmccay commented on issue #299: KNOX-2307 - 
CSVKnoxShellTableBuilder must support quoted strings and …
URL: https://github.com/apache/knox/pull/299#issuecomment-602112910
 
 
   Fixed to not rely on changes from PR #296 
 

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


Issue Time Tracking
---

Worklog Id: (was: 407515)
Time Spent: 40m  (was: 0.5h)

> CSVKnoxShellTableBuilder must support quoted strings and embedded commas
> 
>
> Key: KNOX-2307
> URL: https://issues.apache.org/jira/browse/KNOX-2307
> Project: Apache Knox
>  Issue Type: Improvement
>  Components: KnoxShell
>Reporter: Larry McCay
>Assignee: Larry McCay
>Priority: Major
> Fix For: 1.4.0
>
>  Time Spent: 40m
>  Remaining Estimate: 0h
>
> Embedded commas within a quoted string/col in CSV files result in separate 
> cols currently. This patch allows for them to be ignored during the split() 
> call via regex for identifying such patterns.
> It will result in the value - either header or cell value - as retaining the 
> quotes currently. If this is not desired we can revisit and make configurable 
> or just removed.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (KNOX-2302) Skip re-deployment of generated topology if the topology has not changed

2020-03-21 Thread Philip Zampino (Jira)


 [ 
https://issues.apache.org/jira/browse/KNOX-2302?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Philip Zampino updated KNOX-2302:
-
Status: Patch Available  (was: In Progress)

> Skip re-deployment of generated topology if the topology has not changed
> 
>
> Key: KNOX-2302
> URL: https://issues.apache.org/jira/browse/KNOX-2302
> Project: Apache Knox
>  Issue Type: Improvement
>  Components: Server
>Affects Versions: 1.4.0
>Reporter: Philip Zampino
>Assignee: Philip Zampino
>Priority: Major
>
> Knox discovery +always+ writes generated topologies to disk, triggering 
> [re]deployment of that topology. It would be better to compare the generated 
> topology against the already-deployed version (if it exists) prior to writing 
> it to disk. If the generated version is the same as the already-deployed 
> version, then the newly-generated topology should be discarded, so the 
> re-deployment will be skipped.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work started] (KNOX-2302) Skip re-deployment of generated topology if the topology has not changed

2020-03-21 Thread Philip Zampino (Jira)


 [ 
https://issues.apache.org/jira/browse/KNOX-2302?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Work on KNOX-2302 started by Philip Zampino.

> Skip re-deployment of generated topology if the topology has not changed
> 
>
> Key: KNOX-2302
> URL: https://issues.apache.org/jira/browse/KNOX-2302
> Project: Apache Knox
>  Issue Type: Improvement
>  Components: Server
>Affects Versions: 1.4.0
>Reporter: Philip Zampino
>Assignee: Philip Zampino
>Priority: Major
>
> Knox discovery +always+ writes generated topologies to disk, triggering 
> [re]deployment of that topology. It would be better to compare the generated 
> topology against the already-deployed version (if it exists) prior to writing 
> it to disk. If the generated version is the same as the already-deployed 
> version, then the newly-generated topology should be discarded, so the 
> re-deployment will be skipped.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (KNOX-2301) Trigger discovery for descriptors at gateway start time

2020-03-21 Thread Philip Zampino (Jira)


 [ 
https://issues.apache.org/jira/browse/KNOX-2301?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Philip Zampino updated KNOX-2301:
-
Status: Patch Available  (was: In Progress)

> Trigger discovery for descriptors at gateway start time
> ---
>
> Key: KNOX-2301
> URL: https://issues.apache.org/jira/browse/KNOX-2301
> Project: Apache Knox
>  Issue Type: Improvement
>  Components: Server
>Affects Versions: 1.4.0
>Reporter: Philip Zampino
>Assignee: Philip Zampino
>Priority: Major
>  Time Spent: 1h 40m
>  Remaining Estimate: 0h
>
> Discovery and topology generation is triggered only by changes to provider 
> configuration or descriptor files on disk. Knox should also perform discovery 
> for all existing descriptors (that include discovery config) when the gateway 
> is started.
> This will help ensure that the generated topologies are accurate reflections 
> of the proxied services' configurations.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (KNOX-2301) Trigger discovery for descriptors at gateway start time

2020-03-21 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/KNOX-2301?focusedWorklogId=407513=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-407513
 ]

ASF GitHub Bot logged work on KNOX-2301:


Author: ASF GitHub Bot
Created on: 21/Mar/20 21:13
Start Date: 21/Mar/20 21:13
Worklog Time Spent: 10m 
  Work Description: pzampino commented on pull request #297: KNOX-2301 and 
KNOX-2302
URL: https://github.com/apache/knox/pull/297#discussion_r396029708
 
 

 ##
 File path: 
gateway-topology-simple/src/main/java/org/apache/knox/gateway/topology/simple/TopologyComparisonUtil.java
 ##
 @@ -0,0 +1,192 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file 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 KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations 
under
+ * the License.
+ */
+package org.apache.knox.gateway.topology.simple;
+
+import org.apache.knox.gateway.topology.Application;
+import org.apache.knox.gateway.topology.Provider;
+import org.apache.knox.gateway.topology.Service;
+import org.apache.knox.gateway.topology.Topology;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Utility for comparing Topology objects for equivalence.
+ */
+class TopologyComparisonUtil {
 
 Review comment:
   Moved to Topology#equals() method.
 

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


Issue Time Tracking
---

Worklog Id: (was: 407513)
Time Spent: 1h 40m  (was: 1.5h)

> Trigger discovery for descriptors at gateway start time
> ---
>
> Key: KNOX-2301
> URL: https://issues.apache.org/jira/browse/KNOX-2301
> Project: Apache Knox
>  Issue Type: Improvement
>  Components: Server
>Affects Versions: 1.4.0
>Reporter: Philip Zampino
>Assignee: Philip Zampino
>Priority: Major
>  Time Spent: 1h 40m
>  Remaining Estimate: 0h
>
> Discovery and topology generation is triggered only by changes to provider 
> configuration or descriptor files on disk. Knox should also perform discovery 
> for all existing descriptors (that include discovery config) when the gateway 
> is started.
> This will help ensure that the generated topologies are accurate reflections 
> of the proxied services' configurations.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[GitHub] [knox] pzampino commented on a change in pull request #297: KNOX-2301 and KNOX-2302

2020-03-21 Thread GitBox
pzampino commented on a change in pull request #297: KNOX-2301 and KNOX-2302
URL: https://github.com/apache/knox/pull/297#discussion_r396029708
 
 

 ##
 File path: 
gateway-topology-simple/src/main/java/org/apache/knox/gateway/topology/simple/TopologyComparisonUtil.java
 ##
 @@ -0,0 +1,192 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file 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 KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations 
under
+ * the License.
+ */
+package org.apache.knox.gateway.topology.simple;
+
+import org.apache.knox.gateway.topology.Application;
+import org.apache.knox.gateway.topology.Provider;
+import org.apache.knox.gateway.topology.Service;
+import org.apache.knox.gateway.topology.Topology;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Utility for comparing Topology objects for equivalence.
+ */
+class TopologyComparisonUtil {
 
 Review comment:
   Moved to Topology#equals() method.


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


With regards,
Apache Git Services


[GitHub] [knox] lmccay opened a new pull request #299: KNOX-2307 - CSVKnoxShellTableBuilder must support quoted strings and …

2020-03-21 Thread GitBox
lmccay opened a new pull request #299: KNOX-2307 - CSVKnoxShellTableBuilder 
must support quoted strings and …
URL: https://github.com/apache/knox/pull/299
 
 
   …embedded commas
   
   Change-Id: I3d2e0dc8144e79c73df2067a7b6320e5d0a84266
   
   (It is very **important** that you created an Apache Knox JIRA for this 
change and that the PR title/commit message includes the Apache Knox JIRA ID!)
   
   ## What changes were proposed in this pull request?
   
   Embedded commas within a quoted string/col in CSV files result in separate 
cols currently. This patch allows for them to be ignored during the split() 
call via regex for identifying such patterns.
   
   ## How was this patch tested?
   
   New unit test added and existing unit tests run.
   Manually tested with dataset with such embedded commas in quoted strings.
   
   Please review [Knox Contributing 
Process](https://cwiki.apache.org/confluence/display/KNOX/Contribution+Process#ContributionProcess-GithubWorkflow)
 before opening a pull request.
   


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


With regards,
Apache Git Services


[jira] [Work logged] (KNOX-2307) CSVKnoxShellTableBuilder must support quoted strings and embedded commas

2020-03-21 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/KNOX-2307?focusedWorklogId=407504=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-407504
 ]

ASF GitHub Bot logged work on KNOX-2307:


Author: ASF GitHub Bot
Created on: 21/Mar/20 19:35
Start Date: 21/Mar/20 19:35
Worklog Time Spent: 10m 
  Work Description: lmccay commented on pull request #299: KNOX-2307 - 
CSVKnoxShellTableBuilder must support quoted strings and …
URL: https://github.com/apache/knox/pull/299
 
 
   …embedded commas
   
   Change-Id: I3d2e0dc8144e79c73df2067a7b6320e5d0a84266
   
   (It is very **important** that you created an Apache Knox JIRA for this 
change and that the PR title/commit message includes the Apache Knox JIRA ID!)
   
   ## What changes were proposed in this pull request?
   
   Embedded commas within a quoted string/col in CSV files result in separate 
cols currently. This patch allows for them to be ignored during the split() 
call via regex for identifying such patterns.
   
   ## How was this patch tested?
   
   New unit test added and existing unit tests run.
   Manually tested with dataset with such embedded commas in quoted strings.
   
   Please review [Knox Contributing 
Process](https://cwiki.apache.org/confluence/display/KNOX/Contribution+Process#ContributionProcess-GithubWorkflow)
 before opening a pull request.
   
 

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


Issue Time Tracking
---

Worklog Id: (was: 407504)
Time Spent: 0.5h  (was: 20m)

> CSVKnoxShellTableBuilder must support quoted strings and embedded commas
> 
>
> Key: KNOX-2307
> URL: https://issues.apache.org/jira/browse/KNOX-2307
> Project: Apache Knox
>  Issue Type: Improvement
>  Components: KnoxShell
>Reporter: Larry McCay
>Assignee: Larry McCay
>Priority: Major
> Fix For: 1.4.0
>
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> Embedded commas within a quoted string/col in CSV files result in separate 
> cols currently. This patch allows for them to be ignored during the split() 
> call via regex for identifying such patterns.
> It will result in the value - either header or cell value - as retaining the 
> quotes currently. If this is not desired we can revisit and make configurable 
> or just removed.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (KNOX-2307) CSVKnoxShellTableBuilder must support quoted strings and embedded commas

2020-03-21 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/KNOX-2307?focusedWorklogId=407501=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-407501
 ]

ASF GitHub Bot logged work on KNOX-2307:


Author: ASF GitHub Bot
Created on: 21/Mar/20 19:11
Start Date: 21/Mar/20 19:11
Worklog Time Spent: 10m 
  Work Description: lmccay commented on pull request #298: KNOX-2307
URL: https://github.com/apache/knox/pull/298
 
 
   
 

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


Issue Time Tracking
---

Worklog Id: (was: 407501)
Time Spent: 20m  (was: 10m)

> CSVKnoxShellTableBuilder must support quoted strings and embedded commas
> 
>
> Key: KNOX-2307
> URL: https://issues.apache.org/jira/browse/KNOX-2307
> Project: Apache Knox
>  Issue Type: Improvement
>  Components: KnoxShell
>Reporter: Larry McCay
>Assignee: Larry McCay
>Priority: Major
> Fix For: 1.4.0
>
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> Embedded commas within a quoted string/col in CSV files result in separate 
> cols currently. This patch allows for them to be ignored during the split() 
> call via regex for identifying such patterns.
> It will result in the value - either header or cell value - as retaining the 
> quotes currently. If this is not desired we can revisit and make configurable 
> or just removed.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[GitHub] [knox] lmccay closed pull request #298: KNOX-2307

2020-03-21 Thread GitBox
lmccay closed pull request #298: KNOX-2307
URL: https://github.com/apache/knox/pull/298
 
 
   


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


With regards,
Apache Git Services


[jira] [Work logged] (KNOX-2307) CSVKnoxShellTableBuilder must support quoted strings and embedded commas

2020-03-21 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/KNOX-2307?focusedWorklogId=407500=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-407500
 ]

ASF GitHub Bot logged work on KNOX-2307:


Author: ASF GitHub Bot
Created on: 21/Mar/20 19:05
Start Date: 21/Mar/20 19:05
Worklog Time Spent: 10m 
  Work Description: lmccay commented on pull request #298: KNOX-2307
URL: https://github.com/apache/knox/pull/298
 
 
   (It is very **important** that you created an Apache Knox JIRA for this 
change and that the PR title/commit message includes the Apache Knox JIRA ID!)
   
   ## What changes were proposed in this pull request?
   Support for quoted strings with embedded commans within CSV files to be 
parsed into KnoxShellTable instance.
   
   ## How was this patch tested?
   Unit test added and existing unit tests ran.
   Manual testing with datasets that include such embedded commas and quoted 
string values.
   
   Please review [Knox Contributing 
Process](https://cwiki.apache.org/confluence/display/KNOX/Contribution+Process#ContributionProcess-GithubWorkflow)
 before opening a pull request.
   
 

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


Issue Time Tracking
---

Worklog Id: (was: 407500)
Remaining Estimate: 0h
Time Spent: 10m

> CSVKnoxShellTableBuilder must support quoted strings and embedded commas
> 
>
> Key: KNOX-2307
> URL: https://issues.apache.org/jira/browse/KNOX-2307
> Project: Apache Knox
>  Issue Type: Improvement
>  Components: KnoxShell
>Reporter: Larry McCay
>Assignee: Larry McCay
>Priority: Major
> Fix For: 1.4.0
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> Embedded commas within a quoted string/col in CSV files result in separate 
> cols currently. This patch allows for them to be ignored during the split() 
> call via regex for identifying such patterns.
> It will result in the value - either header or cell value - as retaining the 
> quotes currently. If this is not desired we can revisit and make configurable 
> or just removed.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[GitHub] [knox] lmccay opened a new pull request #298: KNOX-2307

2020-03-21 Thread GitBox
lmccay opened a new pull request #298: KNOX-2307
URL: https://github.com/apache/knox/pull/298
 
 
   (It is very **important** that you created an Apache Knox JIRA for this 
change and that the PR title/commit message includes the Apache Knox JIRA ID!)
   
   ## What changes were proposed in this pull request?
   Support for quoted strings with embedded commans within CSV files to be 
parsed into KnoxShellTable instance.
   
   ## How was this patch tested?
   Unit test added and existing unit tests ran.
   Manual testing with datasets that include such embedded commas and quoted 
string values.
   
   Please review [Knox Contributing 
Process](https://cwiki.apache.org/confluence/display/KNOX/Contribution+Process#ContributionProcess-GithubWorkflow)
 before opening a pull request.
   


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


With regards,
Apache Git Services


[jira] [Created] (KNOX-2307) CSVKnoxShellTableBuilder must support quoted strings and embedded commas

2020-03-21 Thread Larry McCay (Jira)
Larry McCay created KNOX-2307:
-

 Summary: CSVKnoxShellTableBuilder must support quoted strings and 
embedded commas
 Key: KNOX-2307
 URL: https://issues.apache.org/jira/browse/KNOX-2307
 Project: Apache Knox
  Issue Type: Improvement
  Components: KnoxShell
Reporter: Larry McCay
Assignee: Larry McCay
 Fix For: 1.4.0


Embedded commas within a quoted string/col in CSV files result in separate cols 
currently. This patch allows for them to be ignored during the split() call via 
regex for identifying such patterns.

It will result in the value - either header or cell value - as retaining the 
quotes currently. If this is not desired we can revisit and make configurable 
or just removed.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (KNOX-2301) Trigger discovery for descriptors at gateway start time

2020-03-21 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/KNOX-2301?focusedWorklogId=407430=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-407430
 ]

ASF GitHub Bot logged work on KNOX-2301:


Author: ASF GitHub Bot
Created on: 21/Mar/20 14:15
Start Date: 21/Mar/20 14:15
Worklog Time Spent: 10m 
  Work Description: pzampino commented on pull request #297: KNOX-2301 and 
KNOX-2302
URL: https://github.com/apache/knox/pull/297#discussion_r395996190
 
 

 ##
 File path: 
gateway-topology-simple/src/main/java/org/apache/knox/gateway/topology/simple/TopologyComparisonUtil.java
 ##
 @@ -0,0 +1,192 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file 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 KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations 
under
+ * the License.
+ */
+package org.apache.knox.gateway.topology.simple;
+
+import org.apache.knox.gateway.topology.Application;
+import org.apache.knox.gateway.topology.Provider;
+import org.apache.knox.gateway.topology.Service;
+import org.apache.knox.gateway.topology.Topology;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Utility for comparing Topology objects for equivalence.
+ */
+class TopologyComparisonUtil {
 
 Review comment:
   I'm already converting JSON to a Topology object for this purpose, and would 
prefer to avoid re-converting them back to JSON for the sake of comparison.
 

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


Issue Time Tracking
---

Worklog Id: (was: 407430)
Time Spent: 1.5h  (was: 1h 20m)

> Trigger discovery for descriptors at gateway start time
> ---
>
> Key: KNOX-2301
> URL: https://issues.apache.org/jira/browse/KNOX-2301
> Project: Apache Knox
>  Issue Type: Improvement
>  Components: Server
>Affects Versions: 1.4.0
>Reporter: Philip Zampino
>Assignee: Philip Zampino
>Priority: Major
>  Time Spent: 1.5h
>  Remaining Estimate: 0h
>
> Discovery and topology generation is triggered only by changes to provider 
> configuration or descriptor files on disk. Knox should also perform discovery 
> for all existing descriptors (that include discovery config) when the gateway 
> is started.
> This will help ensure that the generated topologies are accurate reflections 
> of the proxied services' configurations.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[GitHub] [knox] pzampino commented on a change in pull request #297: KNOX-2301 and KNOX-2302

2020-03-21 Thread GitBox
pzampino commented on a change in pull request #297: KNOX-2301 and KNOX-2302
URL: https://github.com/apache/knox/pull/297#discussion_r395996190
 
 

 ##
 File path: 
gateway-topology-simple/src/main/java/org/apache/knox/gateway/topology/simple/TopologyComparisonUtil.java
 ##
 @@ -0,0 +1,192 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file 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 KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations 
under
+ * the License.
+ */
+package org.apache.knox.gateway.topology.simple;
+
+import org.apache.knox.gateway.topology.Application;
+import org.apache.knox.gateway.topology.Provider;
+import org.apache.knox.gateway.topology.Service;
+import org.apache.knox.gateway.topology.Topology;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Utility for comparing Topology objects for equivalence.
+ */
+class TopologyComparisonUtil {
 
 Review comment:
   I'm already converting JSON to a Topology object for this purpose, and would 
prefer to avoid re-converting them back to JSON for the sake of comparison.


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


With regards,
Apache Git Services


[jira] [Work logged] (KNOX-2301) Trigger discovery for descriptors at gateway start time

2020-03-21 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/KNOX-2301?focusedWorklogId=407429=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-407429
 ]

ASF GitHub Bot logged work on KNOX-2301:


Author: ASF GitHub Bot
Created on: 21/Mar/20 14:14
Start Date: 21/Mar/20 14:14
Worklog Time Spent: 10m 
  Work Description: pzampino commented on pull request #297: KNOX-2301 and 
KNOX-2302
URL: https://github.com/apache/knox/pull/297#discussion_r395996016
 
 

 ##
 File path: 
gateway-topology-simple/src/main/java/org/apache/knox/gateway/topology/simple/TopologyComparisonUtil.java
 ##
 @@ -0,0 +1,192 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file 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 KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations 
under
+ * the License.
+ */
+package org.apache.knox.gateway.topology.simple;
+
+import org.apache.knox.gateway.topology.Application;
+import org.apache.knox.gateway.topology.Provider;
+import org.apache.knox.gateway.topology.Service;
+import org.apache.knox.gateway.topology.Topology;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Utility for comparing Topology objects for equivalence.
+ */
+class TopologyComparisonUtil {
 
 Review comment:
   This thought had crossed my mind as I was implementing it; I think the fact 
that this requirement doesn't care about the URI, default service path or 
timestamp is what made me opt for this. I think a complete equals() 
implementation would include at least the URI, but if others disagree, I could 
be persuaded to move this logic into the Topology equals() method.
 

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


Issue Time Tracking
---

Worklog Id: (was: 407429)
Time Spent: 1h 20m  (was: 1h 10m)

> Trigger discovery for descriptors at gateway start time
> ---
>
> Key: KNOX-2301
> URL: https://issues.apache.org/jira/browse/KNOX-2301
> Project: Apache Knox
>  Issue Type: Improvement
>  Components: Server
>Affects Versions: 1.4.0
>Reporter: Philip Zampino
>Assignee: Philip Zampino
>Priority: Major
>  Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> Discovery and topology generation is triggered only by changes to provider 
> configuration or descriptor files on disk. Knox should also perform discovery 
> for all existing descriptors (that include discovery config) when the gateway 
> is started.
> This will help ensure that the generated topologies are accurate reflections 
> of the proxied services' configurations.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[GitHub] [knox] pzampino commented on a change in pull request #297: KNOX-2301 and KNOX-2302

2020-03-21 Thread GitBox
pzampino commented on a change in pull request #297: KNOX-2301 and KNOX-2302
URL: https://github.com/apache/knox/pull/297#discussion_r395996016
 
 

 ##
 File path: 
gateway-topology-simple/src/main/java/org/apache/knox/gateway/topology/simple/TopologyComparisonUtil.java
 ##
 @@ -0,0 +1,192 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file 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 KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations 
under
+ * the License.
+ */
+package org.apache.knox.gateway.topology.simple;
+
+import org.apache.knox.gateway.topology.Application;
+import org.apache.knox.gateway.topology.Provider;
+import org.apache.knox.gateway.topology.Service;
+import org.apache.knox.gateway.topology.Topology;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Utility for comparing Topology objects for equivalence.
+ */
+class TopologyComparisonUtil {
 
 Review comment:
   This thought had crossed my mind as I was implementing it; I think the fact 
that this requirement doesn't care about the URI, default service path or 
timestamp is what made me opt for this. I think a complete equals() 
implementation would include at least the URI, but if others disagree, I could 
be persuaded to move this logic into the Topology equals() method.


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


With regards,
Apache Git Services


[jira] [Work logged] (KNOX-2301) Trigger discovery for descriptors at gateway start time

2020-03-21 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/KNOX-2301?focusedWorklogId=407427=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-407427
 ]

ASF GitHub Bot logged work on KNOX-2301:


Author: ASF GitHub Bot
Created on: 21/Mar/20 14:01
Start Date: 21/Mar/20 14:01
Worklog Time Spent: 10m 
  Work Description: pzampino commented on pull request #297: KNOX-2301 and 
KNOX-2302
URL: https://github.com/apache/knox/pull/297#discussion_r395995104
 
 

 ##
 File path: 
gateway-server/src/test/java/org/apache/knox/gateway/services/topology/DefaultTopologyServiceTest.java
 ##
 @@ -177,6 +181,21 @@ public void testGetTopologies() throws Exception {
 }
   }
 
+  /**
+   * Set the static GatewayServices field to the specified value.
+   *
+   * @param gws A GatewayServices object, or null.
+   */
+  private void setGatewayServices(final GatewayServices gws) {
+try {
+  Field gwsField = GatewayServer.class.getDeclaredField("services");
+  gwsField.setAccessible(true);
+  gwsField.set(null, gws);
+} catch (Exception e) {
+  e.printStackTrace();
 
 Review comment:
   +1
 

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


Issue Time Tracking
---

Worklog Id: (was: 407427)
Time Spent: 1h 10m  (was: 1h)

> Trigger discovery for descriptors at gateway start time
> ---
>
> Key: KNOX-2301
> URL: https://issues.apache.org/jira/browse/KNOX-2301
> Project: Apache Knox
>  Issue Type: Improvement
>  Components: Server
>Affects Versions: 1.4.0
>Reporter: Philip Zampino
>Assignee: Philip Zampino
>Priority: Major
>  Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> Discovery and topology generation is triggered only by changes to provider 
> configuration or descriptor files on disk. Knox should also perform discovery 
> for all existing descriptors (that include discovery config) when the gateway 
> is started.
> This will help ensure that the generated topologies are accurate reflections 
> of the proxied services' configurations.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (KNOX-2301) Trigger discovery for descriptors at gateway start time

2020-03-21 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/KNOX-2301?focusedWorklogId=407426=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-407426
 ]

ASF GitHub Bot logged work on KNOX-2301:


Author: ASF GitHub Bot
Created on: 21/Mar/20 14:00
Start Date: 21/Mar/20 14:00
Worklog Time Spent: 10m 
  Work Description: pzampino commented on pull request #297: KNOX-2301 and 
KNOX-2302
URL: https://github.com/apache/knox/pull/297#discussion_r395995034
 
 

 ##
 File path: 
gateway-server/src/main/java/org/apache/knox/gateway/services/topology/impl/DefaultTopologyService.java
 ##
 @@ -153,17 +146,18 @@ private Topology loadTopology(File file) throws 
IOException, SAXException, Inter
 return topology;
   }
 
+  @Override
+  public Topology parse(final InputStream content) throws IOException, 
SAXException {
+return TopologyUtils.parse(content);
+  }
+
   private Topology loadTopologyAttempt(File file) throws IOException, 
SAXException {
-Topology topology;
-Digester digester = digesterLoader.newDigester();
-TopologyBuilder topologyBuilder = 
digester.parse(FileUtils.openInputStream(file));
-if (null == topologyBuilder) {
-  return null;
-}
-topology = topologyBuilder.build();
-topology.setUri(file.toURI());
-topology.setName(FilenameUtils.removeExtension(file.getName()));
-topology.setTimestamp(file.lastModified());
+Topology topology = parse(FileUtils.openInputStream(file));
 
 Review comment:
   The reason for the TopologyService method taking an InputStream (rather than 
a File) is that there is not a File available in every case. In one case, it is 
being used to parse a generated String. There could be two signatures, but I 
think the InputStream signature supports the two existing cases well enough. 
The streams must be closed though.
 

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


Issue Time Tracking
---

Worklog Id: (was: 407426)
Time Spent: 1h  (was: 50m)

> Trigger discovery for descriptors at gateway start time
> ---
>
> Key: KNOX-2301
> URL: https://issues.apache.org/jira/browse/KNOX-2301
> Project: Apache Knox
>  Issue Type: Improvement
>  Components: Server
>Affects Versions: 1.4.0
>Reporter: Philip Zampino
>Assignee: Philip Zampino
>Priority: Major
>  Time Spent: 1h
>  Remaining Estimate: 0h
>
> Discovery and topology generation is triggered only by changes to provider 
> configuration or descriptor files on disk. Knox should also perform discovery 
> for all existing descriptors (that include discovery config) when the gateway 
> is started.
> This will help ensure that the generated topologies are accurate reflections 
> of the proxied services' configurations.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[GitHub] [knox] pzampino commented on a change in pull request #297: KNOX-2301 and KNOX-2302

2020-03-21 Thread GitBox
pzampino commented on a change in pull request #297: KNOX-2301 and KNOX-2302
URL: https://github.com/apache/knox/pull/297#discussion_r395995104
 
 

 ##
 File path: 
gateway-server/src/test/java/org/apache/knox/gateway/services/topology/DefaultTopologyServiceTest.java
 ##
 @@ -177,6 +181,21 @@ public void testGetTopologies() throws Exception {
 }
   }
 
+  /**
+   * Set the static GatewayServices field to the specified value.
+   *
+   * @param gws A GatewayServices object, or null.
+   */
+  private void setGatewayServices(final GatewayServices gws) {
+try {
+  Field gwsField = GatewayServer.class.getDeclaredField("services");
+  gwsField.setAccessible(true);
+  gwsField.set(null, gws);
+} catch (Exception e) {
+  e.printStackTrace();
 
 Review comment:
   +1


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


With regards,
Apache Git Services


[GitHub] [knox] pzampino commented on a change in pull request #297: KNOX-2301 and KNOX-2302

2020-03-21 Thread GitBox
pzampino commented on a change in pull request #297: KNOX-2301 and KNOX-2302
URL: https://github.com/apache/knox/pull/297#discussion_r395995034
 
 

 ##
 File path: 
gateway-server/src/main/java/org/apache/knox/gateway/services/topology/impl/DefaultTopologyService.java
 ##
 @@ -153,17 +146,18 @@ private Topology loadTopology(File file) throws 
IOException, SAXException, Inter
 return topology;
   }
 
+  @Override
+  public Topology parse(final InputStream content) throws IOException, 
SAXException {
+return TopologyUtils.parse(content);
+  }
+
   private Topology loadTopologyAttempt(File file) throws IOException, 
SAXException {
-Topology topology;
-Digester digester = digesterLoader.newDigester();
-TopologyBuilder topologyBuilder = 
digester.parse(FileUtils.openInputStream(file));
-if (null == topologyBuilder) {
-  return null;
-}
-topology = topologyBuilder.build();
-topology.setUri(file.toURI());
-topology.setName(FilenameUtils.removeExtension(file.getName()));
-topology.setTimestamp(file.lastModified());
+Topology topology = parse(FileUtils.openInputStream(file));
 
 Review comment:
   The reason for the TopologyService method taking an InputStream (rather than 
a File) is that there is not a File available in every case. In one case, it is 
being used to parse a generated String. There could be two signatures, but I 
think the InputStream signature supports the two existing cases well enough. 
The streams must be closed though.


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


With regards,
Apache Git Services