Skip to content

Commit a6868a5

Browse files
committed
fix(openapi): adds in previously ignored keep alive value
1 parent bb67af0 commit a6868a5

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

docs/how/updating-datahub.md

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ This file documents any backwards-incompatible changes in DataHub and assists pe
3737
- #11742: For PowerBi ingestion, `use_powerbi_email` is now enabled by default when extracting ownership information.
3838
- #12056: The DataHub Airflow plugin no longer supports Airflow 2.1 and Airflow 2.2.
3939
- #12056: The DataHub Airflow plugin now defaults to the v2 plugin implementation.
40+
- OpenAPI Update: PIT Keep Alive parameter added to scroll. NOTE: This parameter requires the `pointInTimeCreationEnabled` feature flag to be enabled and the `elasticSearch.implementation` configuration to be `elasticsearch`. This feature is not supported for OpenSearch at this time and the parameter will not be respected without both of these set.
4041

4142
### Breaking Changes
4243

metadata-service/openapi-servlet/src/main/java/io/datahubproject/openapi/controller/GenericEntitiesController.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,9 @@ public ResponseEntity<S> getEntities(
199199
@RequestParam(value = "skipCache", required = false, defaultValue = "false")
200200
Boolean skipCache,
201201
@RequestParam(value = "includeSoftDelete", required = false, defaultValue = "false")
202-
Boolean includeSoftDelete)
202+
Boolean includeSoftDelete,
203+
@RequestParam(value = "pitKeepAlive", required = false, defaultValue = "5m")
204+
String pitKeepALive)
203205
throws URISyntaxException {
204206

205207
EntitySpec entitySpec = entityRegistry.getEntitySpec(entityName);
@@ -241,7 +243,7 @@ public ResponseEntity<S> getEntities(
241243
null,
242244
sortCriteria,
243245
scrollId,
244-
null,
246+
pitKeepALive,
245247
count);
246248

247249
if (!AuthUtil.isAPIAuthorizedResult(opContext, result)) {

metadata-service/openapi-servlet/src/main/java/io/datahubproject/openapi/v3/OpenAPIV3Generator.java

+7
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ public class OpenAPIV3Generator {
4545
private static final String NAME_VERSION = "version";
4646
private static final String NAME_SCROLL_ID = "scrollId";
4747
private static final String NAME_INCLUDE_SOFT_DELETE = "includeSoftDelete";
48+
private static final String NAME_PIT_KEEP_ALIVE = "pitKeepAlive";
4849
private static final String PROPERTY_VALUE = "value";
4950
private static final String PROPERTY_URN = "urn";
5051
private static final String PROPERTY_PATCH = "patch";
@@ -502,6 +503,12 @@ private static PathItem buildGenericListEntitiesPath() {
502503
.name(NAME_SKIP_CACHE)
503504
.description("Skip cache when listing entities.")
504505
.schema(new Schema().type(TYPE_BOOLEAN)._default(false)),
506+
new Parameter()
507+
.in(NAME_QUERY)
508+
.name(NAME_PIT_KEEP_ALIVE)
509+
.description(
510+
"Point In Time keep alive, accepts a time based string like \"5m\" for five minutes.")
511+
.schema(new Schema().type(TYPE_STRING)._default("5m")),
505512
new Parameter().$ref("#/components/parameters/PaginationCount" + MODEL_VERSION),
506513
new Parameter().$ref("#/components/parameters/ScrollId" + MODEL_VERSION),
507514
new Parameter().$ref("#/components/parameters/SortBy" + MODEL_VERSION),

metadata-service/openapi-servlet/src/main/java/io/datahubproject/openapi/v3/controller/EntityController.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,8 @@ public ResponseEntity<GenericEntityScrollResultV3> scrollEntities(
146146
Boolean skipCache,
147147
@RequestParam(value = "includeSoftDelete", required = false, defaultValue = "false")
148148
Boolean includeSoftDelete,
149+
@RequestParam(value = "pitKeepAlive", required = false, defaultValue = "5m")
150+
String pitKeepALive,
149151
@RequestBody @Nonnull GenericEntityAspectsBodyV3 entityAspectsBody)
150152
throws URISyntaxException {
151153

@@ -202,7 +204,7 @@ public ResponseEntity<GenericEntityScrollResultV3> scrollEntities(
202204
null,
203205
sortCriteria,
204206
scrollId,
205-
null,
207+
pitKeepALive,
206208
count);
207209

208210
if (!AuthUtil.isAPIAuthorizedResult(opContext, result)) {

0 commit comments

Comments
 (0)