Skip to content

Commit af11f60

Browse files
committed
Resolve merge conflicts with upstream main
Signed-off-by: huy pham <huyp@amazon.com>
2 parents 01851ea + c2d6a2c commit af11f60

255 files changed

Lines changed: 11429 additions & 958 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.

data-prepper-api/src/main/java/org/opensearch/dataprepper/model/buffer/Buffer.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
package org.opensearch.dataprepper.model.buffer;
77

88
import org.opensearch.dataprepper.model.CheckpointState;
9+
import org.opensearch.dataprepper.model.plugin.PluginComponentType;
910
import org.opensearch.dataprepper.model.record.Record;
1011

1112
import java.time.Duration;
@@ -18,6 +19,7 @@
1819
* Buffer queues the records between TI components and acts as a layer between source and processor/sink. Buffer can
1920
* be in-memory, disk based or other a standalone implementation.
2021
*/
22+
@PluginComponentType("buffer")
2123
public interface Buffer<T extends Record<?>> {
2224
/**
2325
* writes the record to the buffer
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
* Copyright OpenSearch Contributors
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
package org.opensearch.dataprepper.model.encryption;
7+
8+
public interface EncryptionEngine {
9+
/**
10+
* Encrypts raw data into {@link EncryptionEnvelope}.
11+
*
12+
* @param data the raw data in bytes
13+
* @return returns the encryption envelope
14+
*/
15+
EncryptionEnvelope encrypt(byte[] data);
16+
17+
/**
18+
* Decrypts the encryption envelope into raw data.
19+
*
20+
* @param encryptionEnvelope the encryption envelope
21+
* @return returns the raw data in bytes
22+
*/
23+
byte[] decrypt(EncryptionEnvelope encryptionEnvelope);
24+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
* Copyright OpenSearch Contributors
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
package org.opensearch.dataprepper.model.encryption;
7+
8+
public interface EncryptionEnvelope {
9+
/**
10+
* The encrypted data.
11+
*/
12+
byte[] getEncryptedData();
13+
14+
/**
15+
* The encrypted data key.
16+
*/
17+
String getEncryptedDataKey();
18+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/*
2+
* Copyright OpenSearch Contributors
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
package org.opensearch.dataprepper.model.encryption;
7+
8+
@FunctionalInterface
9+
public interface KeyProvider {
10+
byte[] decryptKey(byte[] encryptedKey);
11+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
* Copyright OpenSearch Contributors
3+
* SPDX-License-Identifier: Apache-2.0
4+
*
5+
* The OpenSearch Contributors require contributions made to
6+
* this file be licensed under the Apache-2.0 license or a
7+
* compatible open source license.
8+
*/
9+
10+
package org.opensearch.dataprepper.model.plugin;
11+
12+
import java.lang.annotation.Documented;
13+
import java.lang.annotation.ElementType;
14+
import java.lang.annotation.Retention;
15+
import java.lang.annotation.RetentionPolicy;
16+
import java.lang.annotation.Target;
17+
18+
/**
19+
* Annotation for Data Prepper plugin type components.
20+
* Intended for processor, sink, source, buffer.
21+
*
22+
* @since 2.12
23+
*/
24+
@Documented
25+
@Retention(RetentionPolicy.RUNTIME)
26+
@Target({ElementType.TYPE})
27+
public @interface PluginComponentType {
28+
/**
29+
* Gets the name of the plugin component type.
30+
*
31+
* @return The name of the plugin component type.
32+
*/
33+
String value();
34+
}

data-prepper-api/src/main/java/org/opensearch/dataprepper/model/processor/Processor.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
package org.opensearch.dataprepper.model.processor;
77

8+
import org.opensearch.dataprepper.model.plugin.PluginComponentType;
89
import org.opensearch.dataprepper.model.record.Record;
910

1011
import java.util.Collection;
@@ -14,6 +15,7 @@
1415
* Processor interface. These are intermediary processing units using which users can filter,
1516
* transform and enrich the records into desired format before publishing to the sink.
1617
*/
18+
@PluginComponentType("processor")
1719
public interface Processor<InputRecord extends Record<?>, OutputRecord extends Record<?>> {
1820

1921
/**

data-prepper-api/src/main/java/org/opensearch/dataprepper/model/sink/Sink.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
package org.opensearch.dataprepper.model.sink;
77

8+
import org.opensearch.dataprepper.model.plugin.PluginComponentType;
89
import org.opensearch.dataprepper.model.record.Record;
910

1011
import java.util.Collection;
@@ -13,6 +14,7 @@
1314
* Data Prepper sink interface. Sink may publish records to a disk, a file,
1415
* to OpenSearch, other pipelines, or other external systems.
1516
*/
17+
@PluginComponentType("sink")
1618
public interface Sink<T extends Record<?>> {
1719

1820
/**

data-prepper-api/src/main/java/org/opensearch/dataprepper/model/source/Source.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@
66
package org.opensearch.dataprepper.model.source;
77

88
import org.opensearch.dataprepper.model.buffer.Buffer;
9+
import org.opensearch.dataprepper.model.plugin.PluginComponentType;
910
import org.opensearch.dataprepper.model.record.Record;
1011
import org.opensearch.dataprepper.model.codec.HasByteDecoder;
1112

1213
/**
1314
* Data Prepper source interface. Source acts as receiver of the events that flow
1415
* through the transformation pipeline.
1516
*/
17+
@PluginComponentType("source")
1618
public interface Source<T extends Record<?>> extends HasByteDecoder {
1719

1820
/**

data-prepper-core/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ dependencies {
2323
implementation project(':data-prepper-event')
2424
implementation project(':data-prepper-plugins:blocking-buffer')
2525
implementation project(':data-prepper-plugins:common')
26+
implementation project(':data-prepper-plugins:encryption-plugin')
2627
implementation project(':data-prepper-logstash-configuration')
2728
implementation project(':data-prepper-pipeline-parser')
2829
implementation project(':data-prepper-plugin-framework')

0 commit comments

Comments
 (0)