本文整理汇总了Java中org.apache.hadoop.fs.slive.Constants.Distribution.valueOf方法的典型用法代码示例。如果您正苦于以下问题:Java Distribution.valueOf方法的具体用法?Java Distribution.valueOf怎么用?Java Distribution.valueOf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.hadoop.fs.slive.Constants.Distribution
的用法示例。
在下文中一共展示了Distribution.valueOf方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: OperationData
import org.apache.hadoop.fs.slive.Constants.Distribution; //导入方法依赖的package包/类
/**
* Expects a comma separated list (where the first element is the ratio
* (between 0 and 100)) and the second element is the distribution (if
* non-existent then uniform will be selected). If an empty list is passed in
* then this element will just set the distribution (to uniform) and leave the
* percent as null.
*/
OperationData(String data) {
String pieces[] = Helper.getTrimmedStrings(data);
distribution = Distribution.UNIFORM;
percent = null;
if (pieces.length == 1) {
percent = (Double.parseDouble(pieces[0]) / 100.0d);
} else if (pieces.length >= 2) {
percent = (Double.parseDouble(pieces[0]) / 100.0d);
distribution = Distribution.valueOf(StringUtils.toUpperCase(pieces[1]));
}
}
示例2: OperationData
import org.apache.hadoop.fs.slive.Constants.Distribution; //导入方法依赖的package包/类
/**
* Expects a comma separated list (where the first element is the ratio
* (between 0 and 100)) and the second element is the distribution (if
* non-existent then uniform will be selected). If an empty list is passed in
* then this element will just set the distribution (to uniform) and leave the
* percent as null.
*/
OperationData(String data) {
String pieces[] = Helper.getTrimmedStrings(data);
distribution = Distribution.UNIFORM;
percent = null;
if (pieces.length == 1) {
percent = (Double.parseDouble(pieces[0]) / 100.0d);
} else if (pieces.length >= 2) {
percent = (Double.parseDouble(pieces[0]) / 100.0d);
distribution = Distribution.valueOf(pieces[1].toUpperCase());
}
}