You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by ch...@apache.org on 2022/10/11 11:04:11 UTC

[flink] branch release-1.16 updated (29d95797ac1 -> fc708c2fe21)

This is an automated email from the ASF dual-hosted git repository.

chesnay pushed a change to branch release-1.16
in repository https://gitbox.apache.org/repos/asf/flink.git


    from 29d95797ac1 [FLINK-29020][docs] Add document for CREATE TABLE AS SELECT
     new 141eeffb6b2 [FLINK-29504][rest] Add schema to jar upload content
     new fc708c2fe21 [FLINK-29503][rest] Add backpressureLevel field

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 docs/layouts/shortcodes/generated/rest_v1_dispatcher.html |  8 ++++++++
 docs/static/generated/rest_v1_dispatcher.yml              |  9 ++++++---
 .../org/apache/flink/docs/rest/OpenApiSpecGenerator.java  |  6 +++++-
 flink-runtime-web/src/test/resources/rest_api_v1.snapshot | 14 +++++++++++---
 .../runtime/rest/messages/JobVertexBackPressureInfo.java  | 15 +++++++++++++--
 5 files changed, 43 insertions(+), 9 deletions(-)


[flink] 01/02: [FLINK-29504][rest] Add schema to jar upload content

Posted by ch...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

chesnay pushed a commit to branch release-1.16
in repository https://gitbox.apache.org/repos/asf/flink.git

commit 141eeffb6b2c05d7c139c94273c2e5c468b44ec9
Author: Chesnay Schepler <ch...@apache.org>
AuthorDate: Wed Oct 5 10:57:46 2022 +0200

    [FLINK-29504][rest] Add schema to jar upload content
---
 docs/static/generated/rest_v1_dispatcher.yml                        | 5 ++++-
 .../main/java/org/apache/flink/docs/rest/OpenApiSpecGenerator.java  | 6 +++++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/docs/static/generated/rest_v1_dispatcher.yml b/docs/static/generated/rest_v1_dispatcher.yml
index 8055954cabb..f03eedbea6b 100644
--- a/docs/static/generated/rest_v1_dispatcher.yml
+++ b/docs/static/generated/rest_v1_dispatcher.yml
@@ -97,7 +97,10 @@ paths:
       operationId: uploadJar
       requestBody:
         content:
-          application/x-java-archive: {}
+          application/x-java-archive:
+            schema:
+              type: string
+              format: binary
         required: true
       responses:
         "200":
diff --git a/flink-docs/src/main/java/org/apache/flink/docs/rest/OpenApiSpecGenerator.java b/flink-docs/src/main/java/org/apache/flink/docs/rest/OpenApiSpecGenerator.java
index db3f7fff4c4..2599e8e269e 100644
--- a/flink-docs/src/main/java/org/apache/flink/docs/rest/OpenApiSpecGenerator.java
+++ b/flink-docs/src/main/java/org/apache/flink/docs/rest/OpenApiSpecGenerator.java
@@ -372,7 +372,11 @@ public class OpenApiSpecGenerator {
                                     new Content()
                                             .addMediaType(
                                                     "application/x-java-archive",
-                                                    new MediaType())));
+                                                    new MediaType()
+                                                            .schema(
+                                                                    new Schema<>()
+                                                                            .type("string")
+                                                                            .format("binary")))));
         }
 
         // TODO: unhack


[flink] 02/02: [FLINK-29503][rest] Add backpressureLevel field

Posted by ch...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

chesnay pushed a commit to branch release-1.16
in repository https://gitbox.apache.org/repos/asf/flink.git

commit fc708c2fe212826a25fa3151b5b8571e3993f15b
Author: Chesnay Schepler <ch...@apache.org>
AuthorDate: Wed Oct 5 11:17:33 2022 +0200

    [FLINK-29503][rest] Add backpressureLevel field
    
    Enum fields have naming restrictions in some languages.
---
 docs/layouts/shortcodes/generated/rest_v1_dispatcher.html |  8 ++++++++
 docs/static/generated/rest_v1_dispatcher.yml              |  4 ++--
 flink-runtime-web/src/test/resources/rest_api_v1.snapshot | 14 +++++++++++---
 .../runtime/rest/messages/JobVertexBackPressureInfo.java  | 15 +++++++++++++--
 4 files changed, 34 insertions(+), 7 deletions(-)

diff --git a/docs/layouts/shortcodes/generated/rest_v1_dispatcher.html b/docs/layouts/shortcodes/generated/rest_v1_dispatcher.html
index f80dc8e3f36..050d3750d8e 100644
--- a/docs/layouts/shortcodes/generated/rest_v1_dispatcher.html
+++ b/docs/layouts/shortcodes/generated/rest_v1_dispatcher.html
@@ -4344,6 +4344,10 @@ Using 'curl' you can upload a jar via 'curl -X POST -H "Expect:" -F "jarfile=@pa
       "type" : "string",
       "enum" : [ "ok", "low", "high" ]
     },
+    "backpressureLevel" : {
+      "type" : "string",
+      "enum" : [ "ok", "low", "high" ]
+    },
     "end-timestamp" : {
       "type" : "integer"
     },
@@ -4364,6 +4368,10 @@ Using 'curl' you can upload a jar via 'curl -X POST -H "Expect:" -F "jarfile=@pa
             "type" : "string",
             "enum" : [ "ok", "low", "high" ]
           },
+          "backpressureLevel" : {
+            "type" : "string",
+            "enum" : [ "ok", "low", "high" ]
+          },
           "busyRatio" : {
             "type" : "number"
           },
diff --git a/docs/static/generated/rest_v1_dispatcher.yml b/docs/static/generated/rest_v1_dispatcher.yml
index f03eedbea6b..e0c7855c589 100644
--- a/docs/static/generated/rest_v1_dispatcher.yml
+++ b/docs/static/generated/rest_v1_dispatcher.yml
@@ -2491,7 +2491,7 @@ components:
       properties:
         status:
           $ref: '#/components/schemas/VertexBackPressureStatus'
-        backpressure-level:
+        backpressureLevel:
           $ref: '#/components/schemas/VertexBackPressureLevel'
         end-timestamp:
           type: integer
@@ -3106,7 +3106,7 @@ components:
         attempt-number:
           type: integer
           format: int32
-        backpressure-level:
+        backpressureLevel:
           $ref: '#/components/schemas/VertexBackPressureLevel'
         ratio:
           type: number
diff --git a/flink-runtime-web/src/test/resources/rest_api_v1.snapshot b/flink-runtime-web/src/test/resources/rest_api_v1.snapshot
index ef9be2485d2..b13156998af 100644
--- a/flink-runtime-web/src/test/resources/rest_api_v1.snapshot
+++ b/flink-runtime-web/src/test/resources/rest_api_v1.snapshot
@@ -2516,7 +2516,7 @@
           "type" : "string",
           "enum" : [ "deprecated", "ok" ]
         },
-        "backpressure-level" : {
+        "backpressureLevel" : {
           "type" : "string",
           "enum" : [ "ok", "low", "high" ]
         },
@@ -2535,7 +2535,7 @@
               "attempt-number" : {
                 "type" : "integer"
               },
-              "backpressure-level" : {
+              "backpressureLevel" : {
                 "type" : "string",
                 "enum" : [ "ok", "low", "high" ]
               },
@@ -2554,9 +2554,17 @@
                   "type" : "object",
                   "$ref" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:JobVertexBackPressureInfo:SubtaskBackPressureInfo"
                 }
+              },
+              "backpressure-level" : {
+                "type" : "string",
+                "enum" : [ "ok", "low", "high" ]
               }
             }
           }
+        },
+        "backpressure-level" : {
+          "type" : "string",
+          "enum" : [ "ok", "low", "high" ]
         }
       }
     }
@@ -3845,4 +3853,4 @@
       }
     }
   } ]
-}
+}
\ No newline at end of file
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/JobVertexBackPressureInfo.java b/flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/JobVertexBackPressureInfo.java
index c475b6d7cd5..b3f8fcf0f35 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/JobVertexBackPressureInfo.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/JobVertexBackPressureInfo.java
@@ -20,12 +20,15 @@ package org.apache.flink.runtime.rest.messages;
 
 import org.apache.flink.runtime.rest.handler.job.JobVertexBackPressureHandler;
 
+import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonAlias;
 import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonCreator;
 import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonInclude;
 import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonInclude.Include;
 import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonProperty;
 import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonValue;
 
+import io.swagger.v3.oas.annotations.Hidden;
+
 import javax.annotation.Nullable;
 
 import java.util.Collections;
@@ -39,7 +42,8 @@ import static org.apache.flink.util.Preconditions.checkNotNull;
 public class JobVertexBackPressureInfo implements ResponseBody {
 
     public static final String FIELD_NAME_STATUS = "status";
-    public static final String FIELD_NAME_BACKPRESSURE_LEVEL = "backpressure-level";
+    public static final String DEPRECATED_FIELD_NAME_BACKPRESSURE_LEVEL = "backpressure-level";
+    public static final String FIELD_NAME_BACKPRESSURE_LEVEL = "backpressureLevel";
     public static final String FIELD_NAME_END_TIMESTAMP = "end-timestamp";
     public static final String FIELD_NAME_SUBTASKS = "subtasks";
 
@@ -51,6 +55,7 @@ public class JobVertexBackPressureInfo implements ResponseBody {
     private final VertexBackPressureStatus status;
 
     @JsonProperty(FIELD_NAME_BACKPRESSURE_LEVEL)
+    @JsonAlias(DEPRECATED_FIELD_NAME_BACKPRESSURE_LEVEL)
     private final VertexBackPressureLevel backpressureLevel;
 
     @JsonProperty(FIELD_NAME_END_TIMESTAMP)
@@ -100,6 +105,8 @@ public class JobVertexBackPressureInfo implements ResponseBody {
     }
 
     @Nullable
+    @Hidden
+    @JsonProperty(DEPRECATED_FIELD_NAME_BACKPRESSURE_LEVEL)
     public VertexBackPressureLevel getBackpressureLevel() {
         return backpressureLevel;
     }
@@ -123,7 +130,8 @@ public class JobVertexBackPressureInfo implements ResponseBody {
 
         public static final String FIELD_NAME_SUBTASK = "subtask";
         public static final String FIELD_NAME_ATTEMPT_NUMBER = "attempt-number";
-        public static final String FIELD_NAME_BACKPRESSURE_LEVEL = "backpressure-level";
+        public static final String DEPRECATED_FIELD_NAME_BACKPRESSURE_LEVEL = "backpressure-level";
+        public static final String FIELD_NAME_BACKPRESSURE_LEVEL = "backpressureLevel";
         public static final String FIELD_NAME_BACK_PRESSURED_RATIO = "ratio";
         public static final String FIELD_NAME_IDLE_RATIO = "idleRatio";
         public static final String FIELD_NAME_BUSY_RATIO = "busyRatio";
@@ -139,6 +147,7 @@ public class JobVertexBackPressureInfo implements ResponseBody {
         private final Integer attemptNumber;
 
         @JsonProperty(FIELD_NAME_BACKPRESSURE_LEVEL)
+        @JsonAlias(DEPRECATED_FIELD_NAME_BACKPRESSURE_LEVEL)
         private final VertexBackPressureLevel backpressureLevel;
 
         @JsonProperty(FIELD_NAME_BACK_PRESSURED_RATIO)
@@ -210,6 +219,8 @@ public class JobVertexBackPressureInfo implements ResponseBody {
             return subtask;
         }
 
+        @Hidden
+        @JsonProperty(DEPRECATED_FIELD_NAME_BACKPRESSURE_LEVEL)
         public VertexBackPressureLevel getBackpressureLevel() {
             return backpressureLevel;
         }