<commit_before>[Unit]
Description=Apache Kafka server (<%= (@service_name.split(/-/)[1] and @service_name.split(/-/)[1].capitalize) or 'broker' -%>)
Documentation=http://kafka.apache.org/documentation.html
<%- if @service_requires_zookeeper -%>
Wants=zookeeper.service
After=network.target syslog.target zookeeper.service
Requires=zookeeper.service
<%- else -%>
After=network.target syslog.target
<%- end -%>

[Service]
Type=simple
User=<%= @user %>
Group=<%= @group %>
SyslogIdentifier=<%= @service_name %>
<% @environment.sort.map do |k,v| -%>
<% unless v.to_s.strip.empty? -%>
Environment='<%= k %>=<%= v %>'
<% end -%>
<% end -%>
<%- case @service_name when 'kafka' -%>
ExecStart=<%= @bin_dir %>/kafka-server-start.sh <%= @config_dir %>/server.properties
<%- if @exec_stop -%>
ExecStop=<%= @bin_dir %>/kafka-server-stop.sh
<%- end -%>
<%- if @timeout_stop -%>
TimeoutStopSec=<%= @timeout_stop %>
<%- end -%>
<%- when 'kafka-consumer' -%>
ExecStart=<%= @bin_dir %>/kafka-console-consumer.sh <% @service_config.sort.each do |k,v| -%><% unless v.to_s.strip.empty? -%>--<%= k -%> '<%= v.is_a?(Array) ? v.join(',') : v %>' <% end -%><% end -%>
<%- when 'kafka-mirror' -%>
ExecStart=<%= @bin_dir %>/kafka-run-class.sh kafka.tools.MirrorMaker --consumer.config <%= @config_dir %>/consumer.properties --producer.config <%= @config_dir %>/producer.properties <% @service_config.sort.each do |k,v| -%><% unless v.to_s.strip.empty? -%>--<%= k -%> '<%= v.is_a?(Array) ? v.join(',') : v %>' <% end -%><% end -%>
<%- when 'kafka-producer' -%>
ExecStart=<%= @bin_dir %>/kafka-console-producer.sh <% @service_config.sort.each do |k,v| -%><% unless v.to_s.strip.empty? -%>--<%= k -%> '<%= v.is_a?(Array) ? v.join(',') : v %>' <% end -%><% end -%> <%= @input %>
<%- end -%>
<%- if @limit_nofile -%>
LimitNOFILE=<%= @limit_nofile %>
<%- end -%>
<%- if @limit_core -%>
LimitCORE=<%= @limit_core %>
<%- end -%>

[Install]
WantedBy=multi-user.target<commit_msg>added missing newlines<commit_after>[Unit]
Description=Apache Kafka server (<%= (@service_name.split(/-/)[1] and @service_name.split(/-/)[1].capitalize) or 'broker' -%>)
Documentation=http://kafka.apache.org/documentation.html
<%- if @service_requires_zookeeper -%>
Wants=zookeeper.service
After=network.target syslog.target zookeeper.service
Requires=zookeeper.service
<%- else -%>
After=network.target syslog.target
<%- end -%>

[Service]
Type=simple
User=<%= @user %>
Group=<%= @group %>
SyslogIdentifier=<%= @service_name %>
<% @environment.sort.map do |k,v| -%>
<% unless v.to_s.strip.empty? -%>
Environment='<%= k %>=<%= v %>'
<% end -%>
<% end -%>
<%- case @service_name when 'kafka' -%>
ExecStart=<%= @bin_dir %>/kafka-server-start.sh <%= @config_dir %>/server.properties
<%- if @exec_stop -%>
ExecStop=<%= @bin_dir %>/kafka-server-stop.sh
<%- end -%>
<%- if @timeout_stop -%>
TimeoutStopSec=<%= @timeout_stop %>
<%- end -%>
<%- when 'kafka-consumer' -%>
ExecStart=<%= @bin_dir %>/kafka-console-consumer.sh <% @service_config.sort.each do |k,v| -%><% unless v.to_s.strip.empty? -%>--<%= k -%> '<%= v.is_a?(Array) ? v.join(',') : v %>' <% end -%><% end %>
<%- when 'kafka-mirror' -%>
ExecStart=<%= @bin_dir %>/kafka-run-class.sh kafka.tools.MirrorMaker --consumer.config <%= @config_dir %>/consumer.properties --producer.config <%= @config_dir %>/producer.properties <% @service_config.sort.each do |k,v| -%><% unless v.to_s.strip.empty? -%>--<%= k -%> '<%= v.is_a?(Array) ? v.join(',') : v %>' <% end -%><% end %>
<%- when 'kafka-producer' -%>
ExecStart=<%= @bin_dir %>/kafka-console-producer.sh <% @service_config.sort.each do |k,v| -%><% unless v.to_s.strip.empty? -%>--<%= k -%> '<%= v.is_a?(Array) ? v.join(',') : v %>' <% end -%><% end -%> <%= @input %>
<%- end -%>
<%- if @limit_nofile -%>
LimitNOFILE=<%= @limit_nofile %>
<%- end -%>
<%- if @limit_core -%>
LimitCORE=<%= @limit_core %>
<%- end -%>

[Install]
WantedBy=multi-user.target
{'fraction_non_alphanumeric': 0.27022861546365273, 'fraction_numerical': 0.0010274852298998202, 'mean_word_length': 4.3710344827586205, 'pattern_counts': {'":': 0, '<': 115, '<?xml version=': 0, '>': 115, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1633962', 'n_tokens_mistral': 1734, 'n_tokens_neox': 1603, 'n_words': 257}