44
55from saluki .consume import consume
66from saluki .listen import listen
7+ from saluki .play import play
78from saluki .sniff import sniff
89from saluki .utils import parse_kafka_uri
910
@@ -88,7 +89,8 @@ def main() -> None:
8889 # saluki consume -f pl72,6s4t mybroker:9092/XXX_runInfo -m 10 # get the last pl72 run starts or 6s4t run stops#
8990
9091 # saluki bury - dump data on topic to file
91- # saluki bury mybroker:9092/topicname -p 0 -f offsetortimestamp -t offsetortimestamp outputfile
92+ # saluki bury mybroker:9092/topicname -p 0 -o startoffset finishoffset outputfile
93+ # saluki bury mybroker:9092/topicname -p 0 -t starttimestamp finishtimestamp outputfile
9294
9395 # saluki dig - push data from dump generated by saluki bury to topic
9496 # saluki dig mybroker:9092/topicname -p 0 outputfile
@@ -102,6 +104,7 @@ def main() -> None:
102104 g = play_parser .add_mutually_exclusive_group (required = True )
103105 g .add_argument ("-o" , "--offsets" , help = "offsets to replay between (inclusive)" , type = int , nargs = 2 )
104106 g .add_argument ("-t" , "--timestamps" , help = "timestamps to replay between" , type = str , nargs = 2 )
107+ g .add_argument ("-c" , "--chunk" , help = "forward in chunks. ie to avoid storing a huge list in memory" , default = 0 , type = int , required = False )
105108
106109 if len (sys .argv ) == 1 :
107110 parser .print_help ()
@@ -135,7 +138,7 @@ def main() -> None:
135138 print (f"Replaying { src_broker } /{ src_topic } between timestamps { args .timestamps [0 ]} and { args .timestamps [1 ]} to { dest_broker } /{ dest_topic } " )
136139
137140 if input ("OK? (y/n)" ).lower () == 'y' :
138- # play(src_broker, src_topic, dest_broker, dest_topic, args.offset , args.timestamp )
141+ play (src_broker , src_topic , dest_broker , dest_topic , args .offsets , args .timestamps , args . chunks )
139142 print ("replayed" )
140143 elif args .command == _SNIFF :
141144 sniff (args .broker )
0 commit comments