Skip to content

Commit

Permalink
added some comments and copyrights
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Skells committed Nov 4, 2024
1 parent 98b85bb commit d59ca8e
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ jobs:
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,33 @@
/*
* Copyright 2020 Aiven Oy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package io.aiven.kafka.connect.common.config.extractors;

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

/**
* Extracts data from a {@link SinkRecord}. The actual data extracted is implementation specific
*/
public interface DataExtractor {

/**
* Extracts data from a {@link SinkRecord}.
*
* @param record the record to extract data from
* @return the extracted data
*/
Object extractDataFrom(final SinkRecord record);
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,37 @@
/*
* Copyright 2020 Aiven Oy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package io.aiven.kafka.connect.common.config.extractors;

import org.apache.kafka.connect.header.Header;
import org.apache.kafka.connect.sink.SinkRecord;

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

/**
* Create a new HeaderValueExtractor
*
* @param headerKey the key of the header to extract.
*/
public HeaderValueExtractor(final String headerKey) {
this.headerKey = headerKey;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,22 @@
import java.util.Map;
import java.util.regex.Pattern;

/*
* Copyright 2020 Aiven Oy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

public final class SimpleValuePath implements DataExtractor {
private final String[] terms;

Expand Down

0 comments on commit d59ca8e

Please sign in to comment.