org.apache.gobblin.util.WriterUtils.getDefaultWriterFilePath()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(3.1k)|赞(0)|评价(0)|浏览(129)

本文整理了Java中org.apache.gobblin.util.WriterUtils.getDefaultWriterFilePath()方法的一些代码示例,展示了WriterUtils.getDefaultWriterFilePath()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WriterUtils.getDefaultWriterFilePath()方法的具体详情如下:
包路径:org.apache.gobblin.util.WriterUtils
类名称:WriterUtils
方法名:getDefaultWriterFilePath

WriterUtils.getDefaultWriterFilePath介绍

[英]Creates the default Path for the ConfigurationKeys#WRITER_FILE_PATH key.
[中]为ConfigurationKeys#WRITER _FILE _Path键创建默认路径。

代码示例

代码示例来源:origin: apache/incubator-gobblin

/**
 * Get the {@link Path} corresponding the the relative file path for a given {@link org.apache.gobblin.writer.DataWriter}.
 * This method retrieves the value of {@link ConfigurationKeys#WRITER_FILE_PATH} from the given {@link State}. It also
 * constructs the default value of the {@link ConfigurationKeys#WRITER_FILE_PATH} if not is not specified in the given
 * {@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.
 * @return a {@link Path} specifying the relative directory where the {@link org.apache.gobblin.writer.DataWriter} will write to.
 */
public static Path getWriterFilePath(State state, int numBranches, int branchId) {
 if (state.contains(
   ForkOperatorUtils.getPropertyNameForBranch(ConfigurationKeys.WRITER_FILE_PATH, numBranches, branchId))) {
  return new Path(state.getProp(
    ForkOperatorUtils.getPropertyNameForBranch(ConfigurationKeys.WRITER_FILE_PATH, numBranches, branchId)));
 }
 switch (getWriterFilePathType(state)) {
  case NAMESPACE_TABLE:
   return getNamespaceTableWriterFilePath(state);
  case TABLENAME:
   return WriterUtils.getTableNameWriterFilePath(state);
  default:
   return WriterUtils.getDefaultWriterFilePath(state, numBranches, branchId);
 }
}

代码示例来源:origin: org.apache.gobblin/gobblin-utility

/**
 * Get the {@link Path} corresponding the the relative file path for a given {@link org.apache.gobblin.writer.DataWriter}.
 * This method retrieves the value of {@link ConfigurationKeys#WRITER_FILE_PATH} from the given {@link State}. It also
 * constructs the default value of the {@link ConfigurationKeys#WRITER_FILE_PATH} if not is not specified in the given
 * {@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.
 * @return a {@link Path} specifying the relative directory where the {@link org.apache.gobblin.writer.DataWriter} will write to.
 */
public static Path getWriterFilePath(State state, int numBranches, int branchId) {
 if (state.contains(
   ForkOperatorUtils.getPropertyNameForBranch(ConfigurationKeys.WRITER_FILE_PATH, numBranches, branchId))) {
  return new Path(state.getProp(
    ForkOperatorUtils.getPropertyNameForBranch(ConfigurationKeys.WRITER_FILE_PATH, numBranches, branchId)));
 }
 switch (getWriterFilePathType(state)) {
  case NAMESPACE_TABLE:
   return getNamespaceTableWriterFilePath(state);
  case TABLENAME:
   return WriterUtils.getTableNameWriterFilePath(state);
  default:
   return WriterUtils.getDefaultWriterFilePath(state, numBranches, branchId);
 }
}

相关文章