Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-13241

add long--formatted timestamps to org.apache.spark.status.api.v1.ApplicationAttemptInfo

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.6.0
    • 2.0.0
    • Web UI
    • None

    Description

      While writing tests to parse org.apache.spark.status.api.v1.ApplicationAttemptInfo coming off the history rest server, I can see that I can't actually unmarshall the timestamps without parsing the strings —and I fear that may be local specific.

      The problem here is that jersey is marshalling Date classes by calling Date.toString(), leaving an entry like

        {
          "id": "application_1111_0000",
          "name": "spark-demo",
          "attempts": [
            {
              "attemptId": "1",
              "startTime": "2016-02-08T20:12:20.825GMT",
              "endTime": "1970-01-01T00:00:00.000GMT",
              "lastUpdated": "2016-02-08T20:12:20.848GMT",
              "duration": 0,
              "sparkUser": "hdfs",
              "completed": false
            }
          ]
        }
      

      This is good for humans and the web UI, bad for any code trying to use the API for its own purposes.

      I propose adding, alongside the existing values, a simple long value for each time, representing the time in millis from the start of the epoch. This is trivial to marshall/unmarshall.

      This is easy to add, provided everyone is happy that adding a new field to the returned JSON is considered compatible with the existing REST API.

      Attachments

        Activity

          People

            ajbozarth Alex Bozarth
            stevel@apache.org Steve Loughran
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: