Package org.apache.druid.frame.processor
Class FrameProcessors
- java.lang.Object
-
- org.apache.druid.frame.processor.FrameProcessors
-
public class FrameProcessors extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcloseAll(List<ReadableFrameChannel> readableFrameChannels, List<WritableFrameChannel> writableFrameChannels, Closeable... otherCloseables)Helper method for implementingFrameProcessor.cleanup().static FrameCursormakeCursor(Frame frame, FrameReader frameReader)Returns aFrameCursorfor the providedFrame, allowing both sequential and random access.static FrameCursormakeCursor(Frame frame, FrameReader frameReader, VirtualColumns virtualColumns)Returns aFrameCursorfor the providedFrameandVirtualColumns, allowing both sequential and random access.static it.unimi.dsi.fastutil.ints.IntSortedSetrangeSet(int size)Creates a mutable sorted set from 0 to "size" (exclusive).static intselectRandom(it.unimi.dsi.fastutil.ints.IntSet ints)Selects a random element from a set of ints.static <T> FrameProcessor<T>withBaggage(FrameProcessor<T> processor, Closeable baggage)
-
-
-
Method Detail
-
withBaggage
public static <T> FrameProcessor<T> withBaggage(FrameProcessor<T> processor, Closeable baggage)
-
makeCursor
public static FrameCursor makeCursor(Frame frame, FrameReader frameReader)
Returns aFrameCursorfor the providedFrame, allowing both sequential and random access.
-
makeCursor
public static FrameCursor makeCursor(Frame frame, FrameReader frameReader, VirtualColumns virtualColumns)
Returns aFrameCursorfor the providedFrameandVirtualColumns, allowing both sequential and random access.
-
rangeSet
public static it.unimi.dsi.fastutil.ints.IntSortedSet rangeSet(int size)
Creates a mutable sorted set from 0 to "size" (exclusive).- Throws:
IllegalArgumentException- if size is negative
-
selectRandom
public static int selectRandom(it.unimi.dsi.fastutil.ints.IntSet ints)
Selects a random element from a set of ints.
-
closeAll
public static void closeAll(List<ReadableFrameChannel> readableFrameChannels, List<WritableFrameChannel> writableFrameChannels, Closeable... otherCloseables) throws IOException
Helper method for implementingFrameProcessor.cleanup(). The objects are closed in the order provided.- Throws:
IOException
-
-