code: public static String getWriterFileName(State state, int numBranches, int branchId, String writerId,
        String formatExtension) {
      String defaultFileName = Strings.isNullOrEmpty(formatExtension)
          ? String.format("%s.%s", ConfigurationKeys.DEFAULT_WRITER_FILE_BASE_NAME, writerId)
          : String.format("%s.%s.%s", ConfigurationKeys.DEFAULT_WRITER_FILE_BASE_NAME, writerId, formatExtension);
      return state.getProp(
          ForkOperatorUtils.getPropertyNameForBranch(ConfigurationKeys.WRITER_FILE_NAME, numBranches, branchId),
          defaultFileName);
    }
docs: Get the value of {@link ConfigurationKeys#WRITER_FILE_NAME} for the a given {@link org.apache.gobblin.writer.DataWriter}. The
  method also constructs the default value of the {@link ConfigurationKeys#WRITER_FILE_NAME} if it is not set in the
  {@link State}
  @param state is the {@link State} corresponding to a specific {@link org.apache.gobblin.writer.DataWriter}.
  @param numBranches is the total number of branches for the given {@link State}.
  @param branchId is the id for the specific branch that the {{@link org.apache.gobblin.writer.DataWriter} will write to.
  @param writerId is the id for a specific {@link org.apache.gobblin.writer.DataWriter}.
  @param formatExtension is the format extension for the file (e.g. ".avro").
  @return a {@link String} representation of the file name.