io.airlift.slice.Slice.isCompact()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(3.2k)|赞(0)|评价(0)|浏览(134)

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

Slice.isCompact介绍

[英]A slice is considered compact if the base object is an array and it contains the whole array. As a result, it cannot be a view of a bigger slice.
[中]如果基本对象是一个数组,并且包含整个数组,则切片被认为是紧凑的。因此,它不可能是一个更大层面的视图。

代码示例

代码示例来源:origin: prestodb/presto

private Slice dropStringMinMaxIfNecessary(Slice minOrMax)
  {
    if (minOrMax == null || minOrMax.length() > stringStatisticsLimitInBytes) {
      return null;
    }

    // Do not hold the entire slice where the actual stats could be small
    if (minOrMax.isCompact()) {
      return minOrMax;
    }
    return Slices.copyOf(minOrMax);
  }
}

代码示例来源:origin: prestodb/presto

/**
 * Returns a slice containing values in the specified range of the specified slice.
 * If the range matches the entire slice, the input slice will be returned.
 * Otherwise, a copy will be returned.
 */
static Slice compactSlice(Slice slice, int index, int length)
{
  if (slice.isCompact() && index == 0 && length == slice.length()) {
    return slice;
  }
  return Slices.copyOf(slice, index, length);
}

代码示例来源:origin: airlift/slice

private static void assertCompact(Slice data)
{
  assertTrue(data.isCompact());
}

代码示例来源:origin: io.airlift/slice

private static void assertNotCompact(Slice data)
  {
    assertFalse(data.isCompact());
  }
}

代码示例来源:origin: airlift/slice

private static void assertNotCompact(Slice data)
  {
    assertFalse(data.isCompact());
  }
}

代码示例来源:origin: io.airlift/slice

private static void assertCompact(Slice data)
{
  assertTrue(data.isCompact());
}

代码示例来源:origin: com.facebook.presto/presto-spi

/**
 * Returns a slice containing values in the specified range of the specified slice.
 * If the range matches the entire slice, the input slice will be returned.
 * Otherwise, a copy will be returned.
 */
static Slice compactSlice(Slice slice, int index, int length)
{
  if (slice.isCompact() && index == 0 && length == slice.length()) {
    return slice;
  }
  return Slices.copyOf(slice, index, length);
}

代码示例来源:origin: prestosql/presto

private Slice dropStringMinMaxIfNecessary(Slice minOrMax)
  {
    if (minOrMax == null || minOrMax.length() > stringStatisticsLimitInBytes) {
      return null;
    }

    // Do not hold the entire slice where the actual stats could be small
    if (minOrMax.isCompact()) {
      return minOrMax;
    }
    return Slices.copyOf(minOrMax);
  }
}

代码示例来源:origin: com.facebook.presto/presto-orc

private Slice dropStringMinMaxIfNecessary(Slice minOrMax)
  {
    if (minOrMax == null || minOrMax.length() > stringStatisticsLimitInBytes) {
      return null;
    }

    // Do not hold the entire slice where the actual stats could be small
    if (minOrMax.isCompact()) {
      return minOrMax;
    }
    return Slices.copyOf(minOrMax);
  }
}

代码示例来源:origin: io.prestosql/presto-orc

private Slice dropStringMinMaxIfNecessary(Slice minOrMax)
  {
    if (minOrMax == null || minOrMax.length() > stringStatisticsLimitInBytes) {
      return null;
    }

    // Do not hold the entire slice where the actual stats could be small
    if (minOrMax.isCompact()) {
      return minOrMax;
    }
    return Slices.copyOf(minOrMax);
  }
}

代码示例来源:origin: prestosql/presto

/**
 * Returns a slice containing values in the specified range of the specified slice.
 * If the range matches the entire slice, the input slice will be returned.
 * Otherwise, a copy will be returned.
 */
static Slice compactSlice(Slice slice, int index, int length)
{
  if (slice.isCompact() && index == 0 && length == slice.length()) {
    return slice;
  }
  return Slices.copyOf(slice, index, length);
}

相关文章