[
https://issues.apache.org/jira/browse/KNOX-2301?focusedWorklogId=407426&page=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:
[email protected]
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)