-
Notifications
You must be signed in to change notification settings - Fork 488
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support producing to specific partition (#4241)
- Loading branch information
Showing
7 changed files
with
66 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,7 @@ mod cmd { | |
ProduceOutput, DeliverySemantic, SmartModuleContextData, Isolation, SmartModuleInvocation, | ||
}; | ||
use fluvio_extension_common::Terminal; | ||
use fluvio_types::print_cli_ok; | ||
use fluvio_types::{print_cli_ok, PartitionId}; | ||
|
||
#[cfg(feature = "producer-file-io")] | ||
use fluvio_cli_common::user_input::{UserInputRecords, UserInputType}; | ||
|
@@ -171,6 +171,10 @@ mod cmd { | |
/// E.g. fluvio produce topic-name --transforms-line='{"uses":"infinyon/[email protected]","with":{"spec":"[{\"operation\":\"default\",\"spec\":{\"source\":\"test\"}}]"}}' | ||
#[arg(long, conflicts_with_all = &["smartmodule_group", "transforms"], alias = "transform")] | ||
pub transforms_line: Vec<String>, | ||
|
||
/// Partition id | ||
#[arg(short = 'p', long, value_name = "integer")] | ||
pub partition: Option<PartitionId>, | ||
} | ||
|
||
fn validate_key_separator(separator: &str) -> std::result::Result<String, String> { | ||
|
@@ -243,6 +247,12 @@ mod cmd { | |
let config_builder = | ||
config_builder.smartmodules(self.smartmodule_invocations(initial_param)?); | ||
|
||
let config_builder = if let Some(partition) = self.partition { | ||
config_builder.set_specific_partitioner(partition) | ||
} else { | ||
config_builder | ||
}; | ||
|
||
let config = config_builder | ||
.delivery_semantic(self.delivery_semantic) | ||
.build() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters