Pig
  1. Pig
  2. PIG-2604

Pig should print its build info at runtime

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.10.0, 0.11
    • Component/s: None
    • Labels:
      None

      Description

      Currently no build info is printed when running pig, so its not clear specifically what version you are running. For users, they do not know if the version was updated, which might explain a change in behavior. For developers, its not clear if you're actually running the development jar you're testing.

      This could be improved by printing a line at startup saying what version of pig you are using.

      PROPOSED BUILD MESSAGE:

      Note "exported" below happens because I built from a git repo, per the svnversion command.

      $ JAVA_HOME=/usr/java/default bin/pig
      2012-03-16 22:13:15,266 [main] INFO  org.apache.pig.Main - Apache Pig 0.11.0-SNAPSHOT revision exported built by travis at Mar 16 2012, 14:56:33
      2012-03-16 22:13:15,267 [main] INFO  org.apache.pig.Main - Logging error messages to: /home/travis/pig/pig_1331935995262.log
      2012-03-16 22:13:15,291 [main] INFO  org.apache.pig.impl.util.Utils - Default bootup file /home/travis/.pigbootup not found
      2012-03-16 22:13:15,509 [main] INFO  org.apache.pig.backend.hadoop.executionengine.HExecutionEngine - Connecting to hadoop file system at: hdfs://foo.com:8020
      2012-03-16 22:13:15,737 [main] INFO  org.apache.pig.backend.hadoop.executionengine.HExecutionEngine - Connecting to map-reduce job tracker at: foo.com:8021
      grunt>
      

      CURRENT MESSAGES:

      $ pig
      2012-03-16 22:06:14,604 [main] INFO  org.apache.pig.Main - Logging error messages to: /var/log/pig/pig_1331935574602.log
      2012-03-16 22:06:14,834 [main] INFO  org.apache.pig.backend.hadoop.executionengine.HExecutionEngine - Connecting to hadoop file system at: hdfs://foo.com:8020
      2012-03-16 22:06:15,078 [main] INFO  org.apache.pig.backend.hadoop.executionengine.HExecutionEngine - Connecting to map-reduce job tracker at: foo.com:8021
      grunt>
      
      1. PIG-2604-for0.10.patch
        0.9 kB
        Dmitriy V. Ryaboy
      2. PIG-2604_print_build_info_2.diff
        0.5 kB
        Travis Crawford
      3. PIG-2604_print_build_info.diff
        4 kB
        Travis Crawford

        Activity

        Hide
        Dmitriy V. Ryaboy added a comment -

        committed to 0.10 and trunk

        Show
        Dmitriy V. Ryaboy added a comment - committed to 0.10 and trunk
        Hide
        Dmitriy V. Ryaboy added a comment -

        That didn't quite apply right to 0.10. Attaching committed patch for 0.10.

        Show
        Dmitriy V. Ryaboy added a comment - That didn't quite apply right to 0.10. Attaching committed patch for 0.10.
        Hide
        Jonathan Coveney added a comment -

        +1 to apply to 0.10 and 0.11 trunk. I tested it and worked fine. My commit credentials aren't setup yet, so someone else will have to apply/checkin.

        For it to apply to 0.10 I had to do:

        patch -p0 -F3
        
        Show
        Jonathan Coveney added a comment - +1 to apply to 0.10 and 0.11 trunk. I tested it and worked fine. My commit credentials aren't setup yet, so someone else will have to apply/checkin. For it to apply to 0.10 I had to do: patch -p0 -F3
        Hide
        Travis Crawford added a comment -

        This change is far simpler than the previous one (thanks @jco!) and prints the existing version string. For example:

        TW-MBP13-TCrawford:pig-git travis$ bin/pig
        2012-03-16 18:12:11,491 [main] INFO  org.apache.pig.Main - Apache Pig version 0.11.0-SNAPSHOT (rexported) compiled Mar 16 2012, 18:08:17
        2012-03-16 18:12:11,491 [main] INFO  org.apache.pig.Main - Logging error messages to: /Users/travis/apache/pig-git/pig_1331946731489.log
        2012-03-16 18:12:11,510 [main] INFO  org.apache.pig.impl.util.Utils - Default bootup file /Users/travis/.pigbootup not found
        2012-03-16 18:12:11,665 [main] INFO  org.apache.pig.backend.hadoop.executionengine.HExecutionEngine - Connecting to hadoop file system at: file:///
        grunt> TW-MBP13-TCrawford:pig-git travis$ 
        
        Show
        Travis Crawford added a comment - This change is far simpler than the previous one (thanks @jco!) and prints the existing version string. For example: TW-MBP13-TCrawford:pig-git travis$ bin/pig 2012-03-16 18:12:11,491 [main] INFO org.apache.pig.Main - Apache Pig version 0.11.0-SNAPSHOT (rexported) compiled Mar 16 2012, 18:08:17 2012-03-16 18:12:11,491 [main] INFO org.apache.pig.Main - Logging error messages to: /Users/travis/apache/pig-git/pig_1331946731489.log 2012-03-16 18:12:11,510 [main] INFO org.apache.pig.impl.util.Utils - Default bootup file /Users/travis/.pigbootup not found 2012-03-16 18:12:11,665 [main] INFO org.apache.pig.backend.hadoop.executionengine.HExecutionEngine - Connecting to hadoop file system at: file: /// grunt> TW-MBP13-TCrawford:pig-git travis$
        Hide
        Travis Crawford added a comment -

        @jco - Ha, thanks for cluing me into that. We should certainly use that. This turns into a one-line change

        Show
        Travis Crawford added a comment - @jco - Ha, thanks for cluing me into that. We should certainly use that. This turns into a one-line change
        Hide
        Jonathan Coveney added a comment -

        Travis,

        They don't exist for every property you want to set, but there are methods in Main that expose some of this information. They are set based on the build manifest. I'd support exposing the rest of the information you want, and then using these methods... it might be handy for other implementations to have the same info. Otherwise, +1

        public static String getMajorVersion() {
            return majorVersion;
        }
        
        /**
         * Returns the major version of the Pig build being run.
         */
        public static String getMinorVersion() {
            return minorVersion;
        }
        
        /**
         * Returns the patch version of the Pig build being run.
         */
        public static String getPatchVersion() {
            return patchVersion;
        }
        
        /**
         * Returns the svn revision number of the Pig build being run.
         */
        public static String getSvnRevision() {
            return svnRevision;
        }
        
        /**
         * Returns the built time of the Pig build being run.
         */
        public static String getBuildTime() {
            return buildTime;
        }
        
        Show
        Jonathan Coveney added a comment - Travis, They don't exist for every property you want to set, but there are methods in Main that expose some of this information. They are set based on the build manifest. I'd support exposing the rest of the information you want, and then using these methods... it might be handy for other implementations to have the same info. Otherwise, +1 public static String getMajorVersion() { return majorVersion; } /** * Returns the major version of the Pig build being run. */ public static String getMinorVersion() { return minorVersion; } /** * Returns the patch version of the Pig build being run. */ public static String getPatchVersion() { return patchVersion; } /** * Returns the svn revision number of the Pig build being run. */ public static String getSvnRevision() { return svnRevision; } /** * Returns the built time of the Pig build being run. */ public static String getBuildTime() { return buildTime; }

          People

          • Assignee:
            Travis Crawford
            Reporter:
            Travis Crawford
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development