def add_line()

in ambari-infra-solr-client/src/main/python/solrDataManager.py [0:0]


def add_line(tmp_file, doc, json_file, records, exclude_fields):
  if records > 0:
    if json_file:
      tmp_file.write(",\n")
    else:
      tmp_file.write("\n")
  if exclude_fields:
    for exclude_field in exclude_fields:
      if doc and exclude_field in doc:
        del doc[exclude_field]

  tmp_file.write(json.dumps(doc))