You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hawq.apache.org by sansanichfb <gi...@git.apache.org> on 2016/01/23 01:00:53 UTC

[GitHub] incubator-hawq pull request: HAWQ-340. Make getVersion API return ...

GitHub user sansanichfb opened a pull request:

    https://github.com/apache/incubator-hawq/pull/290

    HAWQ-340. Make getVersion API return JSON format.

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/apache/incubator-hawq HAWQ-340

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-hawq/pull/290.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #290
    
----
commit cf03aa9309b93a05fe36949e10cdd6d695440e61
Author: Oleksandr Diachenko <od...@pivotal.io>
Date:   2016-01-22T23:58:06Z

    HAWQ-340. Make getVersion API return JSON format.

----


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-340. Make getVersion API return ...

Posted by sansanichfb <gi...@git.apache.org>.
Github user sansanichfb commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/290#discussion_r50761090
  
    --- Diff: pxf/build.gradle ---
    @@ -122,6 +124,42 @@ subprojects { subProject ->
     }
     
     project('pxf-service') {
    +
    +
    +    task generateSources {
    --- End diff --
    
    Sure, let me add comments.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-340. Make getVersion API return ...

Posted by shivzone <gi...@git.apache.org>.
Github user shivzone commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/290#discussion_r50771928
  
    --- Diff: pxf/pxf-service/src/test/java/org/apache/hawq/pxf/service/rest/VersionResourceTest.java ---
    @@ -22,21 +22,26 @@
     
     import static org.junit.Assert.assertEquals;
     
    +import javax.ws.rs.core.HttpHeaders;
    +import javax.ws.rs.core.MediaType;
     import javax.ws.rs.core.Response;
     
     import org.junit.Test;
     
     public class VersionResourceTest {
     
    -    @Test
    -    public void getProtocolVersion() throws Exception {
    +	@Test
    +	public void getProtocolVersion() throws Exception {
     
    -        VersionResource resource = new VersionResource();
    -        Response result = resource.getProtocolVersion();
    +		VersionResource resource = new VersionResource();
    --- End diff --
    
    Fix your indentation to 4 space instead of 8 space


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-340. Make getVersion API return ...

Posted by hornn <gi...@git.apache.org>.
Github user hornn commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/290#discussion_r50758941
  
    --- Diff: pxf/pxf-service/src/main/java/org/apache/hawq/pxf/service/rest/VersionResource.java ---
    @@ -33,7 +34,7 @@
      * version e.g. {@code ...pxf/v14/Bridge}
      */
     class Version {
    -    final static String PXF_PROTOCOL_VERSION = "v14";
    +    final static String PXF_PROTOCOL_VERSION = "@pxfProtocolVersion@";
    --- End diff --
    
    also here please explain where this value is derived from


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-340. Make getVersion API return ...

Posted by sansanichfb <gi...@git.apache.org>.
Github user sansanichfb commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/290#discussion_r50765934
  
    --- Diff: pxf/pxf-service/src/test/java/org/apache/hawq/pxf/service/rest/VersionResourceTest.java ---
    @@ -36,7 +36,7 @@ public void getProtocolVersion() throws Exception {
     
             assertEquals(Response.Status.OK,
                     Response.Status.fromStatusCode(result.getStatus()));
    -        assertEquals("PXF protocol version " + Version.PXF_PROTOCOL_VERSION,
    +        assertEquals("{ \"version\": \"" + Version.PXF_PROTOCOL_VERSION + "\"}",
    --- End diff --
    
    Sure, good catch.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-340. Make getVersion API return ...

Posted by sansanichfb <gi...@git.apache.org>.
Github user sansanichfb commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/290#discussion_r50761112
  
    --- Diff: pxf/pxf-service/src/main/java/org/apache/hawq/pxf/service/rest/VersionResource.java ---
    @@ -33,7 +34,7 @@
      * version e.g. {@code ...pxf/v14/Bridge}
      */
     class Version {
    -    final static String PXF_PROTOCOL_VERSION = "v14";
    +    final static String PXF_PROTOCOL_VERSION = "@pxfProtocolVersion@";
    --- End diff --
    
    Will add explanation.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-340. Make getVersion API return ...

Posted by shivzone <gi...@git.apache.org>.
Github user shivzone commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/290#discussion_r50772905
  
    --- Diff: pxf/build.gradle ---
    @@ -122,6 +124,47 @@ subprojects { subProject ->
     }
     
     project('pxf-service') {
    +
    +// Copy existing sources and replace any occurrences of @tokenName@ with desired values
    +    task generateSources {
    +        doFirst {
    +            copy {
    +                from('src/main/java') {
    +                    include '**/*.java'
    --- End diff --
    
    Instead include the specific class file. We will never hardcode the version in multiple class files


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-340. Make getVersion API return ...

Posted by shivzone <gi...@git.apache.org>.
Github user shivzone commented on the pull request:

    https://github.com/apache/incubator-hawq/pull/290#issuecomment-174725634
  
    +1 Nice fix


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-340. Make getVersion API return ...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/incubator-hawq/pull/290


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-340. Make getVersion API return ...

Posted by sansanichfb <gi...@git.apache.org>.
Github user sansanichfb commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/290#discussion_r50788147
  
    --- Diff: pxf/build.gradle ---
    @@ -122,6 +124,47 @@ subprojects { subProject ->
     }
     
     project('pxf-service') {
    +
    +// Copy existing sources and replace any occurrences of @tokenName@ with desired values
    +    task generateSources {
    +        doFirst {
    +            copy {
    +                from('src/main/java') {
    +                    include '**/*.java'
    --- End diff --
    
    This task just copies files from one place to another and replaces all occurrences of passed tokens, therefore we have to copy all *.java files to temp location. 


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-340. Make getVersion API return ...

Posted by hornn <gi...@git.apache.org>.
Github user hornn commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/290#discussion_r50758859
  
    --- Diff: pxf/build.gradle ---
    @@ -122,6 +124,42 @@ subprojects { subProject ->
     }
     
     project('pxf-service') {
    +
    +
    +    task generateSources {
    --- End diff --
    
    can you please add a comment in the code explaining the basic idea here? If I understand correctly, we replace any mention of @pxfProtocolVersion@ with the value from gradle.properties?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-340. Make getVersion API return ...

Posted by sansanichfb <gi...@git.apache.org>.
Github user sansanichfb commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/290#discussion_r50788596
  
    --- Diff: pxf/pxf-service/src/test/java/org/apache/hawq/pxf/service/rest/VersionResourceTest.java ---
    @@ -22,21 +22,26 @@
     
     import static org.junit.Assert.assertEquals;
     
    +import javax.ws.rs.core.HttpHeaders;
    +import javax.ws.rs.core.MediaType;
     import javax.ws.rs.core.Response;
     
     import org.junit.Test;
     
     public class VersionResourceTest {
     
    -    @Test
    -    public void getProtocolVersion() throws Exception {
    +	@Test
    +	public void getProtocolVersion() throws Exception {
     
    -        VersionResource resource = new VersionResource();
    -        Response result = resource.getProtocolVersion();
    +		VersionResource resource = new VersionResource();
    --- End diff --
    
    @shivzone thanks, fixed.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-340. Make getVersion API return ...

Posted by hornn <gi...@git.apache.org>.
Github user hornn commented on the pull request:

    https://github.com/apache/incubator-hawq/pull/290#issuecomment-174671513
  
    Really nice implementation, especially using gradle! I didn't know about this replacing mechanism.
    +10 


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-340. Make getVersion API return ...

Posted by mithmatt <gi...@git.apache.org>.
Github user mithmatt commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/290#discussion_r50607911
  
    --- Diff: pxf/pxf-service/src/test/java/org/apache/hawq/pxf/service/rest/VersionResourceTest.java ---
    @@ -36,7 +36,7 @@ public void getProtocolVersion() throws Exception {
     
             assertEquals(Response.Status.OK,
                     Response.Status.fromStatusCode(result.getStatus()));
    -        assertEquals("PXF protocol version " + Version.PXF_PROTOCOL_VERSION,
    +        assertEquals("{ \"version\": \"" + Version.PXF_PROTOCOL_VERSION + "\"}",
    --- End diff --
    
    Do you think an additional assert statement is required for MediaType to see if it is APPLICATION_JSON_TYPE?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---