public void updateIsLeader(String jmVersion, String pid, boolean isLeader) {
    try {
      TableOperation retrieveEntity = TableOperation.retrieve(jmVersion, pid, ProcessorEntity.class);
      ProcessorEntity entity = table.execute(retrieveEntity).getResultAsType();
      entity.setIsLeader(isLeader);
      TableOperation update = TableOperation.replace(entity);
      table.execute(update);
    } catch (StorageException e) {
      LOG.error("Azure storage exception while updating isLeader value for job model version: " + jmVersion + "and pid: " + pid, e);
      throw new AzureException(e);
    }
  }
Updates the isLeader value when the processor starts or stops being a leader.
@param jmVersion Job model version of the processor row to be updated.
@param pid Unique processor ID of the processor row to be updated.
@param isLeader Denotes whether the processor is a leader or not.
@throws AzureException If an Azure storage service error occurred.
samza-azure/src/main/java/org/apache/samza/util/TableUtils.java