Skip to content

Commit 47b5a9b

Browse files
committed
Merge branch 'apache:master' into feature/stateful-core-length-aware-keying
2 parents 0aa8bcb + d6390b8 commit 47b5a9b

59 files changed

Lines changed: 1498 additions & 252 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/REVIEWERS.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ labels:
5050
- name: kafka
5151
reviewers:
5252
- johnjcasey
53-
- fozzie15
5453
- Dippatel98
5554
- sjvanrossum
5655
- name: Build

.github/workflows/beam_PreCommit_Website_Stage_GCS.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16-
name: PreCommit Website Stage GCS
16+
name: PreCommit Website Stage GCS
1717

1818
on:
1919
push:
@@ -38,7 +38,7 @@ env:
3838
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
3939
GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }}
4040
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }}
41-
gcsbucket: apache-beam-website-pull-requests
41+
gcsbucket: apache-beam-website-pull-requests
4242
ghprbPullId:
4343

4444
#Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event
@@ -87,11 +87,17 @@ jobs:
8787
with:
8888
python-version: default
8989
java-version: default
90+
- name: Authenticate on GCP
91+
id: auth-gcp
92+
uses: google-github-actions/auth@v3
93+
with:
94+
service_account: ${{ secrets.GCP_SA_EMAIL }}
95+
credentials_json: ${{ secrets.GCP_SA_KEY }}
9096
- name: Run website_stageWebsite script
9197
uses: ./.github/actions/gradle-command-self-hosted-action
9298
with:
9399
gradle-command: :website:stageWebsite
94-
arguments: -PwebsiteBucket=$gcsbucket
100+
arguments: -PwebsiteBucket=$gcsbucket -PgcpCredsFile="${{ steps.auth-gcp.outputs.credentials_file_path }}"
95101
- name: Add website link to the summary if pr
96102
if: env.ghprbPullId != null
97103
run: echo "Website published to http://$gcsbucket.storage.googleapis.com/$ghprbPullId/index.html" >> $GITHUB_STEP_SUMMARY

.github/workflows/beam_Publish_Website.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,15 @@ jobs:
5858
uses: ./.github/actions/setup-environment-action
5959
with:
6060
disable-cache: true
61+
- name: Authenticate on GCP
62+
id: auth-gcp
63+
uses: google-github-actions/auth@v3
64+
with:
65+
service_account: ${{ secrets.GCP_SA_EMAIL }}
66+
credentials_json: ${{ secrets.GCP_SA_KEY }}
6167
- name: run PostCommit Website Publish script
6268
uses: ./.github/actions/gradle-command-self-hosted-action
6369
with:
6470
gradle-command: :website:clean :website:publishWebsite
65-
arguments: -PgitPublishRemote="https://github.com/apache/beam.git"
71+
arguments: -PgitPublishRemote="https://github.com/apache/beam.git" -PgcpCredsFile="${{ steps.auth-gcp.outputs.credentials_file_path }}"
6672
- uses: actions/checkout@v4 # Extra checkout to make sure we're on master for post steps.

it/datadog/build.gradle

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
plugins { id 'org.apache.beam.module' }
20+
applyJavaNature(
21+
automaticModuleName: 'org.apache.beam.it.datadog',
22+
)
23+
24+
description = "Apache Beam :: IT :: Datadog"
25+
ext.summary = "Integration test utilities for Datadog."
26+
27+
dependencies {
28+
implementation project(path: ":it:common")
29+
implementation project(path: ":it:testcontainers")
30+
implementation project(path: ":it:truthmatchers")
31+
implementation project(path: ":it:conditions")
32+
implementation "org.testcontainers:mockserver:1.19.7"
33+
implementation "org.testcontainers:testcontainers:1.19.7"
34+
implementation "org.mock-server:mockserver-client-java:5.10.0"
35+
implementation "org.mock-server:mockserver-core:5.10.0"
36+
37+
implementation "org.apache.httpcomponents:httpclient:4.5.13"
38+
implementation "org.apache.httpcomponents:httpcore:4.4.14"
39+
implementation library.java.google_code_gson
40+
41+
implementation library.java.vendored_guava_32_1_2_jre
42+
implementation "org.slf4j:slf4j-api:2.0.16"
43+
compileOnly library.java.auto_value_annotations
44+
45+
testImplementation(library.java.truth) {
46+
exclude group: 'com.google.guava', module: 'guava'
47+
}
48+
testImplementation library.java.junit
49+
testImplementation library.java.mockito_inline
50+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
package org.apache.beam.it.datadog;
19+
20+
import org.apache.http.impl.client.CloseableHttpClient;
21+
import org.apache.http.impl.client.HttpClientBuilder;
22+
import org.mockserver.client.MockServerClient;
23+
24+
/** Datadog Driver Factory class. */
25+
class DatadogClientFactory {
26+
DatadogClientFactory() {}
27+
28+
/**
29+
* Returns an HTTP client that is used to send HTTP messages to Datadog API.
30+
*
31+
* @return An HTTP client for sending HTTP messages to Datadog API.
32+
*/
33+
CloseableHttpClient getHttpClient() {
34+
return HttpClientBuilder.create().disableContentCompression().build();
35+
}
36+
37+
/**
38+
* Returns a {@link MockServerClient} for sending requests to a MockServer instance.
39+
*
40+
* @param host the service host.
41+
* @param port the service port.
42+
* @return A {@link MockServerClient} to retrieve messages from a MockServer instance.
43+
*/
44+
MockServerClient getServiceClient(String host, int port) {
45+
return new MockServerClient(host, port);
46+
}
47+
}
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
package org.apache.beam.it.datadog;
19+
20+
import static org.apache.beam.vendor.guava.v32_1_2_jre.com.google.common.base.Preconditions.checkNotNull;
21+
22+
import com.google.auto.value.AutoValue;
23+
import javax.annotation.Nullable;
24+
25+
/** A class for Datadog log entries, copy of DatadogEvent. */
26+
@AutoValue
27+
public abstract class DatadogLogEntry {
28+
29+
public static Builder newBuilder() {
30+
return new AutoValue_DatadogLogEntry.Builder();
31+
}
32+
33+
@Nullable
34+
public abstract String ddsource();
35+
36+
@Nullable
37+
public abstract String ddtags();
38+
39+
@Nullable
40+
public abstract String hostname();
41+
42+
@Nullable
43+
public abstract String service();
44+
45+
@Nullable
46+
public abstract String message();
47+
48+
/** A builder class for creating {@link DatadogLogEntry} objects. */
49+
@AutoValue.Builder
50+
public abstract static class Builder {
51+
52+
abstract Builder setDdsource(String source);
53+
54+
abstract Builder setDdtags(String tags);
55+
56+
abstract Builder setHostname(String hostname);
57+
58+
abstract Builder setService(String service);
59+
60+
abstract Builder setMessage(String message);
61+
62+
abstract String message();
63+
64+
abstract DatadogLogEntry autoBuild();
65+
66+
public Builder withSource(String source) {
67+
checkNotNull(source, "withSource(source) called with null input.");
68+
69+
return setDdsource(source);
70+
}
71+
72+
public Builder withTags(String tags) {
73+
checkNotNull(tags, "withTags(tags) called with null input.");
74+
75+
return setDdtags(tags);
76+
}
77+
78+
public Builder withHostname(String hostname) {
79+
checkNotNull(hostname, "withHostname(hostname) called with null input.");
80+
81+
return setHostname(hostname);
82+
}
83+
84+
public Builder withService(String service) {
85+
checkNotNull(service, "withService(service) called with null input.");
86+
87+
return setService(service);
88+
}
89+
90+
public Builder withMessage(String message) {
91+
checkNotNull(message, "withMessage(message) called with null input.");
92+
93+
return setMessage(message);
94+
}
95+
96+
public DatadogLogEntry build() {
97+
checkNotNull(message(), "Message is required.");
98+
99+
return autoBuild();
100+
}
101+
}
102+
}

0 commit comments

Comments
 (0)