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

ASF GitHub Bot logged work on KNOX-2023:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 05/Oct/19 10:11
            Start Date: 05/Oct/19 10:11
    Worklog Time Spent: 10m 
      Work Description: smolnar82 commented on pull request #162: KNOX-2023 - 
Recording KnoxShellTable builder/filter chain and providing rollback/replay 
capabilities using the call history as well as allowing end-users to export 
JSON without data (in this case only the call history will be serialized)
URL: https://github.com/apache/knox/pull/162#discussion_r331741693
 
 

 ##########
 File path: 
gateway-shell/src/main/java/org/apache/knox/gateway/shell/table/CSVKnoxShellTableBuilder.java
 ##########
 @@ -28,24 +28,26 @@
 
   private boolean withHeaders;
 
+  CSVKnoxShellTableBuilder(long id) {
+    super(id);
+  }
+
   public CSVKnoxShellTableBuilder withHeaders() {
     withHeaders = true;
     return this;
   }
 
   public KnoxShellTable url(String url) throws IOException {
     int rowIndex = 0;
-    URLConnection connection;
-    BufferedReader csvReader = null;
     KnoxShellTable table = null;
-    try {
-      URL urlToCsv = new URL(url);
-      connection = urlToCsv.openConnection();
-      csvReader = new BufferedReader(new 
InputStreamReader(connection.getInputStream(), StandardCharsets.UTF_8));
+    URL urlToCsv = new URL(url);
+    URLConnection connection = urlToCsv.openConnection();
+    try (BufferedReader csvReader = new BufferedReader(new 
InputStreamReader(connection.getInputStream(), StandardCharsets.UTF_8));) {
 
 Review comment:
   `BufferedReader` closes the given `Reader` for you when you invoke `close` 
on it:
   
   ```
   public void close() throws IOException {
       synchronized (lock) {
               if (in == null)
                   return;
               try {
                   in.close();
               } finally {
                   in = null;
                   cb = null;
               }
       }
   }
   ```
   
   On the other hand, I can make this little change as it does not cause any 
harm (` Closing a previously closed stream has no effect.`)
 
----------------------------------------------------------------
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: 323894)
    Time Spent: 1h  (was: 50m)

> KnoxShellTable - Record the Creation Sequence of Tables
> -------------------------------------------------------
>
>                 Key: KNOX-2023
>                 URL: https://issues.apache.org/jira/browse/KNOX-2023
>             Project: Apache Knox
>          Issue Type: Improvement
>          Components: KnoxShell
>            Reporter: Larry McCay
>            Assignee: Sandor Molnar
>            Priority: Major
>             Fix For: 1.4.0
>
>          Time Spent: 1h
>  Remaining Estimate: 0h
>
> Each KnoxShellTable instance goes through a number of builders, filters, 
> sorts, etc in order to get to their final state.
> Currently, those builder classes just go out of scope as they complete and 
> return the resulting table.
> This JIRA represents the thought of recording them in an ArrayList within the 
> table so that we could do a number of interesting things:
>  * persist JSON representation that doesn't require the actual data
>  * materialize tables from that persisted state by replaying the builders in 
> order
>  * possibly undo or rollback to a previous state
>  * possibly providing interesting provenance capabilities with confidence 
> factors based on sources
> Interesting challenges here will be when authentication is required for a SQL 
> query in the JDBC builder or in accessing data accessed through Knox gateway 
> instances.
>  
>  



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

Reply via email to