Skip to content

Commit d59ca8e

Browse files
author
Mike Skells
committed
added some comments and copyrights
1 parent 98b85bb commit d59ca8e

File tree

4 files changed

+71
-4
lines changed

4 files changed

+71
-4
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ jobs:
4343
uses: actions/checkout@v4
4444

4545
# Initializes the CodeQL tools for scanning.
46-
- name: Initialize CodeQL
47-
uses: github/codeql-action/init@v2
48-
with:
49-
languages: ${{ matrix.language }}
46+
- name: Initialize CodeQL
47+
uses: github/codeql-action/init@v2
48+
with:
49+
languages: ${{ matrix.language }}
5050
# If you wish to specify custom queries, you can do so here or in a config file.
5151
# By default, queries listed here will override any specified in a config file.
5252
# Prefix the list here with "+" to use these queries and those in the config file.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,33 @@
1+
/*
2+
* Copyright 2020 Aiven Oy
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
package io.aiven.kafka.connect.common.config.extractors;
218

319
import org.apache.kafka.connect.sink.SinkRecord;
420

21+
/**
22+
* Extracts data from a {@link SinkRecord}. The actual data extracted is implementation specific
23+
*/
524
public interface DataExtractor {
625

26+
/**
27+
* Extracts data from a {@link SinkRecord}.
28+
*
29+
* @param record the record to extract data from
30+
* @return the extracted data
31+
*/
732
Object extractDataFrom(final SinkRecord record);
833
}

commons/src/main/java/io/aiven/kafka/connect/common/config/extractors/HeaderValueExtractor.java

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,37 @@
1+
/*
2+
* Copyright 2020 Aiven Oy
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
package io.aiven.kafka.connect.common.config.extractors;
218

319
import org.apache.kafka.connect.header.Header;
420
import org.apache.kafka.connect.sink.SinkRecord;
521

22+
/**
23+
* A DataExtractor that extracts the value of a header from a SinkRecord
24+
* If there are multiple headers with the same ane, then the last occurrence will be used
25+
* If the header does not exist, then the extraction will yield null
26+
*/
627
public class HeaderValueExtractor implements DataExtractor {
728
private final String headerKey;
829

30+
/**
31+
* Create a new HeaderValueExtractor
32+
*
33+
* @param headerKey the key of the header to extract.
34+
*/
935
public HeaderValueExtractor(final String headerKey) {
1036
this.headerKey = headerKey;
1137
}

commons/src/main/java/io/aiven/kafka/connect/common/config/extractors/SimpleValuePath.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,22 @@
2626
import java.util.Map;
2727
import java.util.regex.Pattern;
2828

29+
/*
30+
* Copyright 2020 Aiven Oy
31+
*
32+
* Licensed under the Apache License, Version 2.0 (the "License");
33+
* you may not use this file except in compliance with the License.
34+
* You may obtain a copy of the License at
35+
*
36+
* http://www.apache.org/licenses/LICENSE-2.0
37+
*
38+
* Unless required by applicable law or agreed to in writing, software
39+
* distributed under the License is distributed on an "AS IS" BASIS,
40+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41+
* See the License for the specific language governing permissions and
42+
* limitations under the License.
43+
*/
44+
2945
public final class SimpleValuePath implements DataExtractor {
3046
private final String[] terms;
3147

0 commit comments

Comments
 (0)