From fd6f732a4bf744f292fcaa77cda81ae80053cb4e Mon Sep 17 00:00:00 2001 From: Sam sam Date: Wed, 22 Feb 2023 10:58:35 -0800 Subject: [PATCH] Add Data Sampling capability URN to Java SDK (#25593) * Add Data Sampling capability URN to Java SDK * trigger tests * Update runners/core-construction-java/src/main/java/org/apache/beam/runners/core/construction/Environments.java --------- Co-authored-by: Sam Rohde Co-authored-by: Lukasz Cwik --- .../apache/beam/runners/core/construction/Environments.java | 1 + .../beam/runners/core/construction/EnvironmentsTest.java | 3 +++ 2 files changed, 4 insertions(+) diff --git a/runners/core-construction-java/src/main/java/org/apache/beam/runners/core/construction/Environments.java b/runners/core-construction-java/src/main/java/org/apache/beam/runners/core/construction/Environments.java index c59ca23fd77c..646e9bc744ca 100644 --- a/runners/core-construction-java/src/main/java/org/apache/beam/runners/core/construction/Environments.java +++ b/runners/core-construction-java/src/main/java/org/apache/beam/runners/core/construction/Environments.java @@ -423,6 +423,7 @@ public static Set getJavaCapabilities() { capabilities.add("beam:version:sdk_base:" + JAVA_SDK_HARNESS_CONTAINER_URL); capabilities.add(BeamUrns.getUrn(SplittableParDoComponents.TRUNCATE_SIZED_RESTRICTION)); capabilities.add(BeamUrns.getUrn(Primitives.TO_STRING)); + capabilities.add(BeamUrns.getUrn(StandardProtocols.Enum.DATA_SAMPLING)); return capabilities.build(); } diff --git a/runners/core-construction-java/src/test/java/org/apache/beam/runners/core/construction/EnvironmentsTest.java b/runners/core-construction-java/src/test/java/org/apache/beam/runners/core/construction/EnvironmentsTest.java index 17c85323ad16..9a3ed7db6bc7 100644 --- a/runners/core-construction-java/src/test/java/org/apache/beam/runners/core/construction/EnvironmentsTest.java +++ b/runners/core-construction-java/src/test/java/org/apache/beam/runners/core/construction/EnvironmentsTest.java @@ -204,6 +204,9 @@ public void testCapabilities() { assertThat( Environments.getJavaCapabilities(), hasItem(BeamUrns.getUrn(RunnerApi.StandardProtocols.Enum.STATE_CACHING))); + assertThat( + Environments.getJavaCapabilities(), + hasItem(BeamUrns.getUrn(RunnerApi.StandardProtocols.Enum.DATA_SAMPLING))); // Check that SDF truncation is supported assertThat( Environments.getJavaCapabilities(),