mirror of https://github.com/apache/kafka.git
				
				
				
			MINOR: ProducerPerformance should work with older client jars
Author: Jun Rao <junrao@gmail.com> Reviewers: Ismael Juma <ismael@juma.me.uk> Closes #2896 from junrao/minor
This commit is contained in:
		
							parent
							
								
									1fbb8cfafa
								
							
						
					
					
						commit
						b154221774
					
				|  | @ -129,17 +129,24 @@ public class ProducerPerformance { | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|  |             if (!shouldPrintMetrics) { | ||||||
|  |                 producer.close(); | ||||||
|  | 
 | ||||||
|  |                 /* print final results */ | ||||||
|  |                 stats.printTotal(); | ||||||
|  |             } else { | ||||||
|                 // Make sure all messages are sent before printing out the stats and the metrics |                 // Make sure all messages are sent before printing out the stats and the metrics | ||||||
|  |                 // We need to do this in a different branch for now since tests/kafkatest/sanity_checks/test_performance_services.py | ||||||
|  |                 // expects this class to work with older versions of the client jar that don't support flush(). | ||||||
|                 producer.flush(); |                 producer.flush(); | ||||||
| 
 | 
 | ||||||
|                 /* print final results */ |                 /* print final results */ | ||||||
|                 stats.printTotal(); |                 stats.printTotal(); | ||||||
| 
 | 
 | ||||||
|                 /* print out metrics */ |                 /* print out metrics */ | ||||||
|             if (shouldPrintMetrics) { |  | ||||||
|                 ToolsUtils.printMetrics(producer.metrics()); |                 ToolsUtils.printMetrics(producer.metrics()); | ||||||
|             } |  | ||||||
|                 producer.close(); |                 producer.close(); | ||||||
|  |             } | ||||||
|         } catch (ArgumentParserException e) { |         } catch (ArgumentParserException e) { | ||||||
|             if (args.length == 0) { |             if (args.length == 0) { | ||||||
|                 parser.printHelp(); |                 parser.printHelp(); | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue