Github user denalex commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/1209#discussion_r109264668
  
    --- Diff: 
pxf/pxf-api/src/main/java/org/apache/hawq/pxf/api/utilities/Utilities.java ---
    @@ -151,4 +157,78 @@ public static String maskNonPrintables(String input) {
             }
             return input.replaceAll("[^a-zA-Z0-9_:/-]", ".");
         }
    +
    +    /**
    +     * Parses input data and returns fragment metadata.
    +     * 
    +     * @param inputData input data which has protocol information
    +     * @return fragment metadata
    +     * @throws IllegalArgumentException if fragment metadata information 
wasn't found in input data
    +     * @throws Exception
    +     */
    +    public static FragmentMetadata parseFragmentMetadata(InputData 
inputData) throws Exception {
    +        byte[] serializedLocation = inputData.getFragmentMetadata();
    +        if (serializedLocation == null) {
    +            throw new IllegalArgumentException("Missing fragment location 
information");
    +        }
    +        try (ByteArrayInputStream bytesStream = new 
ByteArrayInputStream(serializedLocation);
    --- End diff --
    
    since you're not using bytesStream directly, can collapse to 
    ObjectInputStream objectStream = new ObjectInputStream( new 
ByteArrayInputStream(serializedLocation))


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to