Skip to content

Commit

Permalink
Java V2 Add the Firehose scenario (#7144)
Browse files Browse the repository at this point in the history
  • Loading branch information
scmacdon authored Dec 13, 2024
1 parent c58d011 commit 8ea9e17
Show file tree
Hide file tree
Showing 14 changed files with 13,111 additions and 382 deletions.
24 changes: 24 additions & 0 deletions .doc_gen/metadata/firehose_metadata.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# zexi 0.4.0
firehose_PutRecord:
languages:
Java:
versions:
- sdk_version: 2
github: javav2/example_code/firehose
excerpts:
- description:
snippet_tags:
- firehose.java2.put_record.main
Python:
versions:
- sdk_version: 3
Expand All @@ -14,6 +22,14 @@ firehose_PutRecord:
firehose: {PutRecord}
firehose_PutRecordBatch:
languages:
Java:
versions:
- sdk_version: 2
github: javav2/example_code/firehose
excerpts:
- description:
snippet_tags:
- firehose.java2.put_batch_records.main
Rust:
versions:
- sdk_version: 1
Expand All @@ -40,6 +56,14 @@ firehose_Scenario_PutRecords:
synopsis: use &FH; to process individual and batch records.
category: Scenarios
languages:
Java:
versions:
- sdk_version: 2
github: javav2/example_code/firehose
excerpts:
- description: This example puts individual and batch records to &FH;.
snippet_tags:
- firehose.java2.scenario.main
Python:
versions:
- sdk_version: 3
Expand Down
29 changes: 28 additions & 1 deletion javav2/example_code/firehose/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,21 @@ For prerequisites, see the [README](../../README.md#Prerequisites) in the `javav
<!--custom.prerequisites.start-->
<!--custom.prerequisites.end-->

### Single actions

Code excerpts that show you how to call individual service functions.

- [PutRecord](src/main/java/com/example/firehose/scenario/FirehoseScenario.java#L92)
- [PutRecordBatch](src/main/java/com/example/firehose/scenario/FirehoseScenario.java#L125)

### Scenarios

Code examples that show you how to accomplish a specific task by calling multiple
functions within the same service.

- [Put records to Data Firehose](src/main/java/com/example/firehose/scenario/FirehoseScenario.java)


<!--custom.examples.start-->
<!--custom.examples.end-->

Expand All @@ -42,6 +57,18 @@ For prerequisites, see the [README](../../README.md#Prerequisites) in the `javav



#### Put records to Data Firehose

This example shows you how to use Data Firehose to process individual and batch records.


<!--custom.scenario_prereqs.firehose_Scenario_PutRecords.start-->
<!--custom.scenario_prereqs.firehose_Scenario_PutRecords.end-->


<!--custom.scenarios.firehose_Scenario_PutRecords.start-->
<!--custom.scenarios.firehose_Scenario_PutRecords.end-->

### Tests

⚠ Running tests might result in charges to your AWS account.
Expand All @@ -68,4 +95,4 @@ in the `javav2` folder.

Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

SPDX-License-Identifier: Apache-2.0
SPDX-License-Identifier: Apache-2.0
4 changes: 4 additions & 0 deletions javav2/example_code/firehose/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@
<groupId>software.amazon.awssdk</groupId>
<artifactId>secretsmanager</artifactId>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>cloudwatch</artifactId>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public static void main(String[] args) {

if (args.length != 3) {
System.out.println(usage);
System.exit(1);
return;
}

String bucketARN = args[0];
Expand Down Expand Up @@ -70,7 +70,6 @@ public static void createStream(FirehoseClient firehoseClient, String bucketARN,

} catch (FirehoseException e) {
System.out.println(e.getLocalizedMessage());
System.exit(1);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public static void main(String[] args) {

if (args.length != 1) {
System.out.println(usage);
System.exit(1);
return;
}

String streamName = args[0];
Expand All @@ -57,7 +57,6 @@ public static void delStream(FirehoseClient firehoseClient, String streamName) {

} catch (FirehoseException e) {
System.out.println(e.getLocalizedMessage());
System.exit(1);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ public static void listStreams(FirehoseClient firehoseClient) {

} catch (FirehoseException e) {
System.out.println(e.getLocalizedMessage());
System.exit(1);
}
}
}
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit 8ea9e17

Please sign in to comment.