org.apache.gobblin.configuration.State.getPropAsShortWithRadix()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(4.2k)|赞(0)|评价(0)|浏览(84)

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

State.getPropAsShortWithRadix介绍

[英]Get the value of a property as a short.
[中]将属性的值作为短字符串获取。

代码示例

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

/**
 * Get {@link FsPermission} from a {@link State} object.
 *
 * @param props A {@link State} containing properties.
 * @param propName The property name for the permission. If not contained in the given state,
 * defaultPermission will be used.
 * @param defaultPermission default permission if propName is not contained in props.
 * @return An {@link FsPermission} object.
 */
public static FsPermission deserializeFsPermission(State props, String propName, FsPermission defaultPermission) {
 short mode = props.getPropAsShortWithRadix(propName, defaultPermission.toShort(),
   ConfigurationKeys.PERMISSION_PARSING_RADIX);
 return new FsPermission(mode);
}

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

/**
 * Deserializes a {@link FsPermission}s object that should be used when a {@link DataWriter} is creating directories.
 */
public static FsPermission deserializeWriterDirPermissions(State state, int numBranches, int branchId) {
 return new FsPermission(state.getPropAsShortWithRadix(
   ForkOperatorUtils.getPropertyNameForBranch(ConfigurationKeys.WRITER_DIR_PERMISSIONS, numBranches, branchId),
   FsPermission.getDefault().toShort(), ConfigurationKeys.PERMISSION_PARSING_RADIX));
}

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

/**
 * Deserializes a {@link FsPermission}s object that should be used when a {@link DataWriter} is writing a file.
 */
public static FsPermission deserializeWriterFilePermissions(State state, int numBranches, int branchId) {
 return new FsPermission(state.getPropAsShortWithRadix(
   ForkOperatorUtils.getPropertyNameForBranch(ConfigurationKeys.WRITER_FILE_PERMISSIONS, numBranches, branchId),
   FsPermission.getDefault().toShort(), ConfigurationKeys.PERMISSION_PARSING_RADIX));
}

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

this.permissions.add(new FsPermission(state.getPropAsShortWithRadix(
  ForkOperatorUtils.getPropertyNameForBranch(ConfigurationKeys.DATA_PUBLISHER_PERMISSIONS, this.numBranches, i),
  FsPermission.getDefault().toShort(), ConfigurationKeys.PERMISSION_PARSING_RADIX)));

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

/**
 * Get {@link FsPermission} from a {@link State} object.
 *
 * @param props A {@link State} containing properties.
 * @param propName The property name for the permission. If not contained in the given state,
 * defaultPermission will be used.
 * @param defaultPermission default permission if propName is not contained in props.
 * @return An {@link FsPermission} object.
 */
public static FsPermission deserializeFsPermission(State props, String propName, FsPermission defaultPermission) {
 short mode = props.getPropAsShortWithRadix(propName, defaultPermission.toShort(),
   ConfigurationKeys.PERMISSION_PARSING_RADIX);
 return new FsPermission(mode);
}

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

/**
 * Deserializes a {@link FsPermission}s object that should be used when a {@link DataWriter} is writing a file.
 */
public static FsPermission deserializeWriterFilePermissions(State state, int numBranches, int branchId) {
 return new FsPermission(state.getPropAsShortWithRadix(
   ForkOperatorUtils.getPropertyNameForBranch(ConfigurationKeys.WRITER_FILE_PERMISSIONS, numBranches, branchId),
   FsPermission.getDefault().toShort(), ConfigurationKeys.PERMISSION_PARSING_RADIX));
}

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

/**
 * Deserializes a {@link FsPermission}s object that should be used when a {@link DataWriter} is creating directories.
 */
public static FsPermission deserializeWriterDirPermissions(State state, int numBranches, int branchId) {
 return new FsPermission(state.getPropAsShortWithRadix(
   ForkOperatorUtils.getPropertyNameForBranch(ConfigurationKeys.WRITER_DIR_PERMISSIONS, numBranches, branchId),
   FsPermission.getDefault().toShort(), ConfigurationKeys.PERMISSION_PARSING_RADIX));
}

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

this.permissions.add(new FsPermission(state.getPropAsShortWithRadix(
  ForkOperatorUtils.getPropertyNameForBranch(ConfigurationKeys.DATA_PUBLISHER_PERMISSIONS, this.numBranches, i),
  FsPermission.getDefault().toShort(), ConfigurationKeys.PERMISSION_PARSING_RADIX)));

相关文章