public void writePartitionMapping(Map<TaskName, Integer> changelogEntries) {
    LOG.debug("Updating changelog information with: ");
    for (Map.Entry<TaskName, Integer> entry : changelogEntries.entrySet()) {
      Preconditions.checkNotNull(entry.getKey());
      String taskName = entry.getKey().getTaskName();
      if (entry.getValue() != null) {
        String changeLogPartitionId = String.valueOf(entry.getValue());
        LOG.debug("TaskName: {} to Partition: {}", taskName, entry.getValue());
        metadataStore.put(taskName, valueSerde.toBytes(changeLogPartitionId));
      } else {
        LOG.debug("Deleting the TaskName: {}", taskName);
        metadataStore.delete(taskName);
      }
    }
    metadataStore.flush();
  }
Writes the taskName to changelog partition assignments to the {@link MetadataStore}.
@param changelogEntries a map of the taskName to the changelog partition to be written to
                        metadata store.
samza-core/src/main/java/org/apache/samza/storage/ChangelogStreamManager.java