-
Notifications
You must be signed in to change notification settings - Fork 0
/
koptions.ml
52 lines (40 loc) · 1.79 KB
/
koptions.ml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
open Cmdliner
let manager_id =
let doc = "Manager identifier" in
Arg.(required & pos 0 (some int) None & info [] ~docv:"MANAGER_ID" ~doc)
let manager_count =
let doc = "Count of managers" in
Arg.(required & pos 1 (some int) None & info [] ~docv:"MANAGER_COUNT" ~doc)
let partition_id =
let doc = "Database partition identifier" in
Arg.(required & pos 0 (some int) None & info [] ~docv:"PARTITION_ID" ~doc)
let partition_count =
let doc = "Count of database partition" in
Arg.(required & pos 1 (some int) None & info [] ~docv:"PARTITION_COUNT" ~doc)
let kafka_cluster =
let doc = "Connection string to the Kafka cluster." in
Arg.(value & opt string "localhost" & info ["k"; "kafka"] ~docv:"KAFKA_CLUSTER" ~doc)
let transac_topic =
let doc = "Kafka topic from where the transactions are consumed." in
Arg.(value & opt string "db_transaction_request" & info ["t"; "transac_topic"] ~docv:"TRANSAC_TOPIC" ~doc)
let outcome_topic =
let doc = "Kafka topic where the transaction outcomes are published." in
Arg.(value & opt string "db_transaction_outcome" & info ["o"; "outcome_topic"] ~docv:"OUTCOME_TOPIC" ~doc)
let request_topic =
let doc = "Kafka topic where the partition requests are published." in
Arg.(value & opt string "db_partition_request" & info ["r"; "request_topic"] ~docv:"REQUEST_TOPIC" ~doc)
let criteria_topic =
let doc = "Kafka topic where the transaction criteria are published." in
Arg.(value & opt string "db_transaction_criteria" & info ["c"; "criteria_topic"] ~docv:"CRITERIA_TOPIC" ~doc)
let fatal_error msg =
prerr_string "ERROR: ";
prerr_endline msg;
exit 2
let consumer_options brokers = [
"metadata.broker.list", brokers;
"fetch.wait.max.ms", "10";
]
let producer_options brokers = [
"metadata.broker.list", brokers;
"queue.buffering.max.ms", "5";
]