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); } }
/** * 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); }
private static void assertCompact(Slice data) { assertTrue(data.isCompact()); }
private static void assertNotCompact(Slice data) { assertFalse(data.isCompact()); } }
private static void assertNotCompact(Slice data) { assertFalse(data.isCompact()); } }
private static void assertCompact(Slice data) { assertTrue(data.isCompact()); }
/** * 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); }
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); } }
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); } }
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); } }
/** * 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); }