azkaban.utils.Utils.parseMemString()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(3.4k)|赞(0)|评价(0)|浏览(292)

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

Utils.parseMemString介绍

暂无

代码示例

代码示例来源:origin: azkaban/azkaban

final String strXms = getInitialMemorySize();
final String strXmx = getMaxMemorySize();
final long xms = Utils.parseMemString(strXms);
final long xmx = Utils.parseMemString(strXmx);
 final String maxXmx = azkabanProperties
   .getString(Constants.JobProperties.JOB_MAX_XMX, Constants.JobProperties.MAX_XMX_DEFAULT);
 final long sizeMaxXms = Utils.parseMemString(maxXms);
 final long sizeMaxXmx = Utils.parseMemString(maxXmx);

代码示例来源:origin: azkaban/azkaban

final String maxXmx = props.getString(
  Constants.JobProperties.JOB_MAX_XMX, Constants.JobProperties.MAX_XMX_DEFAULT);
final long sizeMaxXms = Utils.parseMemString(maxXms);
final long sizeMaxXmx = Utils.parseMemString(maxXmx);
 final String xms = jobProps.getString(XMS, null);
 if (xms != null && !PropsUtils.isVariableReplacementPattern(xms)
   && Utils.parseMemString(xms) > sizeMaxXms) {
  errors.add(String.format(
    "%s: Xms value has exceeded the allowed limit (max Xms = %s)",
   && Utils.parseMemString(xmx) > sizeMaxXmx) {
  errors.add(String.format(
    "%s: Xmx value has exceeded the allowed limit (max Xmx = %s)",

代码示例来源:origin: azkaban/azkaban

@Test
public void testConversion() {
 Assert.assertEquals(Utils.parseMemString("1024"), 1L);
 Assert.assertEquals(Utils.parseMemString("1K"), 1L);
 Assert.assertEquals(Utils.parseMemString("1M"), 1024L);
 Assert.assertEquals(Utils.parseMemString("1G"), 1024L * 1024L);
 Assert.assertEquals(Utils.parseMemString("1k"), 1L);
 Assert.assertEquals(Utils.parseMemString("1m"), 1024L);
 Assert.assertEquals(Utils.parseMemString("1g"), 1024L * 1024L);
 Assert.assertEquals(Utils.parseMemString("5000"), 4L);
 Assert.assertEquals(Utils.parseMemString("1024K"), 1024L);
 Assert.assertEquals(Utils.parseMemString("512M"), 512 * 1024L);
 Assert.assertEquals(Utils.parseMemString("2G"), 2L * 1024L * 1024L);
}

代码示例来源:origin: azkaban/azkaban

private void badFormatHelper(final String str) {
  try {
   Utils.parseMemString(str);
   Assert.fail("should get a runtime exception");
  } catch (final Exception e) {
   Assert.assertEquals(e instanceof NumberFormatException, true);
  }
 }
}

代码示例来源:origin: com.linkedin.azkaban/azkaban-common

final String strXms = getInitialMemorySize();
final String strXmx = getMaxMemorySize();
final long xms = Utils.parseMemString(strXms);
final long xmx = Utils.parseMemString(strXmx);
 final String maxXmx = azkabanProperties
   .getString(Constants.JobProperties.JOB_MAX_XMX, Constants.JobProperties.MAX_XMX_DEFAULT);
 final long sizeMaxXms = Utils.parseMemString(maxXms);
 final long sizeMaxXmx = Utils.parseMemString(maxXmx);

代码示例来源:origin: com.linkedin.azkaban/azkaban-common

final String maxXmx = props.getString(
  Constants.JobProperties.JOB_MAX_XMX, Constants.JobProperties.MAX_XMX_DEFAULT);
final long sizeMaxXms = Utils.parseMemString(maxXms);
final long sizeMaxXmx = Utils.parseMemString(maxXmx);
 final String xms = jobProps.getString(XMS, null);
 if (xms != null && !PropsUtils.isVariableReplacementPattern(xms)
   && Utils.parseMemString(xms) > sizeMaxXms) {
  errors.add(String.format(
    "%s: Xms value has exceeded the allowed limit (max Xms = %s)",
   && Utils.parseMemString(xmx) > sizeMaxXmx) {
  errors.add(String.format(
    "%s: Xmx value has exceeded the allowed limit (max Xmx = %s)",

相关文章