private Map transferCommitData()

in encryption/src/main/java/org/apache/solr/encryption/EncryptionUpdateHandler.java [65:86]


  private Map<String, String> transferCommitData(Map<String, String> commitData) throws IOException {
    // Two cases:
    // - If commitData is null, then transfer all the latest commit transferable
    //   data to the current commit.
    // - If commitData is not null, nothing is transferred. It is the caller
    //   responsibility to include all the required user data from the latest commit.
    //   That way, the caller can remove some entries.
    if (commitData == null) {
      Map<String, String> latestCommitData = readLatestCommit(core).getUserData();
      Map<String, String> newCommitData = null;
      for (Map.Entry<String, String> latestCommitEntry : latestCommitData.entrySet()) {
        if (latestCommitEntry.getKey().startsWith(TRANSFERABLE_COMMIT_DATA)) {
          if (newCommitData == null) {
            newCommitData = new HashMap<>();
          }
          newCommitData.put(latestCommitEntry.getKey(), latestCommitEntry.getValue());
        }
      }
      return newCommitData;
    }
    return commitData;
  }