def save()

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


def save(mode, solr_url, collection, filter_field, id_field, range_end, read_block_size, write_block_size,
         ignore_unfinished_uploading, additional_filter, name, solr_keytab, solr_principal, json_file,
         compression, hdfs_keytab, hdfs_principal, hdfs_user, hdfs_path, key_file_path, bucket, key_prefix, local_path,
         solr_output_collection, solr_output_url, exclude_fields, skip_date_usage):
  solr_kinit_command = None
  if solr_keytab:
    solr_kinit_command = "kinit -kt {0} {1}".format(solr_keytab, solr_principal)
    curl_prefix = "curl -k --negotiate -u : "
  else:
    curl_prefix = "curl -k"

  hdfs_kinit_command = None
  if hdfs_keytab:
    hdfs_kinit_command = "sudo -u {0} kinit -kt {1} {2}".format(hdfs_user, hdfs_keytab, hdfs_principal)

  if hdfs_path:
    ensure_hdfs_path(hdfs_kinit_command, hdfs_user, hdfs_path)

  working_dir = get_working_dir(solr_url, collection)
  if mode == "archive":
    handle_unfinished_uploading(solr_kinit_command, hdfs_kinit_command, curl_prefix, working_dir,
                                ignore_unfinished_uploading, skip_date_usage)

  save_data(mode, solr_kinit_command, hdfs_kinit_command, curl_prefix, solr_url, collection, filter_field, id_field,
            range_end, read_block_size, write_block_size, working_dir, additional_filter, name, json_file, compression,
            hdfs_user, hdfs_path, key_file_path, bucket, key_prefix, local_path, solr_output_collection, solr_output_url,
            exclude_fields, skip_date_usage)