Skip to content

Commit

Permalink
trivial changes (#322)
Browse files Browse the repository at this point in the history
Co-authored-by: Mike Skells <[email protected]>
  • Loading branch information
2 people authored and ¨Claude committed Nov 11, 2024
1 parent 7ec9393 commit b6ccad4
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 14 deletions.
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ GitHub provides additional document on [forking a repository](https://help.githu

All connectors for Apache Kafka in this repository are open source products released under the Apache 2.0 license (see either [the Apache site](https://www.apache.org/licenses/LICENSE-2.0) or the [LICENSE.txt file](LICENSE.txt)). The Apache 2.0 license allows you to freely use, modify, distribute, and sell your own products that include Apache 2.0 licensed software.

We respect intellectual property rights of others and we want to make sure all incoming contributions are correctly attributed and licensed. A Developer Certificate of Origin (DCO) is a lightweight mechanism to do that.
We respect intellectual property rights of others, and we want to make sure all incoming contributions are correctly attributed and licensed. A Developer Certificate of Origin (DCO) is a lightweight mechanism to do that.

So we require by making a contribution every contributor certifies that:
```
Expand All @@ -62,7 +62,7 @@ For more information see the [Code of Conduct FAQ](https://www.contributor-coven


## Security issue notifications
If you discover a potential security issue in this project we ask that you report it according to [Security Policy](SECURITY.md). Please do **not** create a public github issue.
If you discover a potential security issue in this project we ask that you report it according to [Security Policy](SECURITY.md). Please do **not** create a public GitHub issue.

## Licensing

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,8 @@ public void put(final SinkRecord record) {

final String recordKey = generateRecordKey(record);

fileBuffers.putIfAbsent(recordKey, new ArrayList<>());

final List<SinkRecord> records = fileBuffers.computeIfAbsent(recordKey, ignored -> new ArrayList<>(1));
// one record per file
final List<SinkRecord> records = fileBuffers.get(recordKey);
records.clear();
records.add(record);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public interface RecordGrouper {
/**
* Get all records associated with files, grouped by the file name.
*
* @return map of records assotiated with files
* @return map of records associated with files
*/
Map<String, List<SinkRecord>> records();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ private GoogleCredentialsBuilder() {
* non-{@code null}), this is an error.
*
* <p>
* If either @code credentialsPath} or {@code credentialsJson} is provided, it's used to construct the credentials.
* If either {@code credentialsPath} or {@code credentialsJson} is provided, it's used to construct the credentials.
*
* <p>
* If none are provided, the default GCP SDK credentials acquisition mechanism is used.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
* <a href="https://jqwik.net/docs/current/user-guide.html">jqwik</a>.
*
* <p>
* The idea is to generate random batches of {@link SinkRecord} (see {@link PbtBase#recordBatches()}, put them into a
* The idea is to generate random batches of {@link SinkRecord} (see {@link PbtBase#recordBatches()}), put them into a
* task, and check certain properties of the written files afterwards. Files are written virtually using the in-memory
* GCS mock.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
* <a href="https://jqwik.net/docs/current/user-guide.html">jqwik</a>.
*
* <p>
* The idea is to generate random batches of {@link SinkRecord} (see {@link PbtBase#recordBatches()}, put them into a
* The idea is to generate random batches of {@link SinkRecord} (see {@link PbtBase#recordBatches()}), put them into a
* task, and check certain properties of the written files afterwards. Files are written virtually using the in-memory
* GCS mock.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ private Map<String, Collection<Record>> toBlobNameWithRecordsMap(final String co
for (final Record record : records) {
final int offset = topicPartitionMinimumOffset.get(record.topic + "-" + record.partition);
final String key = record.topic + "-" + record.partition + "-" + offset + extension;
blobNameWithRecordsMap.putIfAbsent(key, new ArrayList<>()); // NOPMD
blobNameWithRecordsMap.get(key).add(record);
blobNameWithRecordsMap.computeIfAbsent(key, ignored -> new ArrayList<>()) // NOPMD
.add(record);
}
return blobNameWithRecordsMap;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,11 +224,11 @@ void wrongRetryPolicySettings() {
"Invalid value -1 for configuration gcs.retry.backoff.total.timeout.ms: " + "Value must be at least 0",
totalTimeoutE.getMessage());

final var tooBigTotoalTimeoutProp = Map.of("gcs.bucket.name", "test-bucket",
final var tooBigTotalTimeoutProp = Map.of("gcs.bucket.name", "test-bucket",
"gcs.retry.backoff.total.timeout.ms", String.valueOf(TimeUnit.HOURS.toMillis(25)));

final var tooBigTotalTimeoutE = assertThrows(ConfigException.class,
() -> new GcsSinkConfig(tooBigTotoalTimeoutProp));
() -> new GcsSinkConfig(tooBigTotalTimeoutProp));
assertEquals("Invalid value 90000000 for configuration gcs.retry.backoff.total.timeout.ms: "
+ "Value must be no more than 86400000 (24 hours)", tooBigTotalTimeoutE.getMessage());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ void gcsCredentialsDefault() {
final GcsSinkConfig config = new GcsSinkConfig(properties);

// Note that we're using a mock here since the Google credentials are not part of the environment when running
// in github actions. It's better to use a mock here and make the test self-contained than it is to make things
// in GitHub actions. It's better to use a mock here and make the test self-contained than it is to make things
// more complicated and making it rely on the environment it's executing within.
try (MockedStatic<GoogleCredentials> mocked = mockStatic(GoogleCredentials.class)) {
final GoogleCredentials googleCredentials = mock(GoogleCredentials.class);
Expand Down

0 comments on commit b6ccad4

Please sign in to comment.