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

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

本文整理了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

  1. private Slice dropStringMinMaxIfNecessary(Slice minOrMax)
  2. {
  3. if (minOrMax == null || minOrMax.length() > stringStatisticsLimitInBytes) {
  4. return null;
  5. }
  6. // Do not hold the entire slice where the actual stats could be small
  7. if (minOrMax.isCompact()) {
  8. return minOrMax;
  9. }
  10. return Slices.copyOf(minOrMax);
  11. }
  12. }

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

  1. /**
  2. * Returns a slice containing values in the specified range of the specified slice.
  3. * If the range matches the entire slice, the input slice will be returned.
  4. * Otherwise, a copy will be returned.
  5. */
  6. static Slice compactSlice(Slice slice, int index, int length)
  7. {
  8. if (slice.isCompact() && index == 0 && length == slice.length()) {
  9. return slice;
  10. }
  11. return Slices.copyOf(slice, index, length);
  12. }

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

  1. private static void assertCompact(Slice data)
  2. {
  3. assertTrue(data.isCompact());
  4. }

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

  1. private static void assertNotCompact(Slice data)
  2. {
  3. assertFalse(data.isCompact());
  4. }
  5. }

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

  1. private static void assertNotCompact(Slice data)
  2. {
  3. assertFalse(data.isCompact());
  4. }
  5. }

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

  1. private static void assertCompact(Slice data)
  2. {
  3. assertTrue(data.isCompact());
  4. }

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

  1. /**
  2. * Returns a slice containing values in the specified range of the specified slice.
  3. * If the range matches the entire slice, the input slice will be returned.
  4. * Otherwise, a copy will be returned.
  5. */
  6. static Slice compactSlice(Slice slice, int index, int length)
  7. {
  8. if (slice.isCompact() && index == 0 && length == slice.length()) {
  9. return slice;
  10. }
  11. return Slices.copyOf(slice, index, length);
  12. }

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

  1. private Slice dropStringMinMaxIfNecessary(Slice minOrMax)
  2. {
  3. if (minOrMax == null || minOrMax.length() > stringStatisticsLimitInBytes) {
  4. return null;
  5. }
  6. // Do not hold the entire slice where the actual stats could be small
  7. if (minOrMax.isCompact()) {
  8. return minOrMax;
  9. }
  10. return Slices.copyOf(minOrMax);
  11. }
  12. }

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

  1. private Slice dropStringMinMaxIfNecessary(Slice minOrMax)
  2. {
  3. if (minOrMax == null || minOrMax.length() > stringStatisticsLimitInBytes) {
  4. return null;
  5. }
  6. // Do not hold the entire slice where the actual stats could be small
  7. if (minOrMax.isCompact()) {
  8. return minOrMax;
  9. }
  10. return Slices.copyOf(minOrMax);
  11. }
  12. }

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

  1. private Slice dropStringMinMaxIfNecessary(Slice minOrMax)
  2. {
  3. if (minOrMax == null || minOrMax.length() > stringStatisticsLimitInBytes) {
  4. return null;
  5. }
  6. // Do not hold the entire slice where the actual stats could be small
  7. if (minOrMax.isCompact()) {
  8. return minOrMax;
  9. }
  10. return Slices.copyOf(minOrMax);
  11. }
  12. }

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

  1. /**
  2. * Returns a slice containing values in the specified range of the specified slice.
  3. * If the range matches the entire slice, the input slice will be returned.
  4. * Otherwise, a copy will be returned.
  5. */
  6. static Slice compactSlice(Slice slice, int index, int length)
  7. {
  8. if (slice.isCompact() && index == 0 && length == slice.length()) {
  9. return slice;
  10. }
  11. return Slices.copyOf(slice, index, length);
  12. }

相关文章