Package org.apache.druid.segment
Interface CloseableShapeshifter
- All Superinterfaces:
AutoCloseable,Closeable
- All Known Implementing Classes:
AbstractFrameRowsAndColumns,ColumnBasedFrameRowsAndColumns,CursorFactoryRowsAndColumns,QueryableIndexRowsAndColumns,RowBasedFrameRowsAndColumns
A CloseableShapeshifter is an interface created to allow Segments to be used from
as(Class), but also to
be able to ensure that any resource used by the object returned from the as(Class) method have proper
management of their lifecycle. This was initially introduced in order to make it possible for Segment to
become a RowsAndColumns without needing to add extra close() methods to
RowsAndColumns.-
Method Summary
-
Method Details
-
as
Asks the Object to return itself as a concrete implementation of a specific interface. The interface asked for will tend to be a semantically-meaningful interface.- Type Parameters:
T- The interface that the calling code wants a concrete implementation of- Parameters:
clazz- A class object representing the interface that the calling code wants a concrete implementation of- Returns:
- A concrete implementation of the interface, or null if there is no meaningful optimization to be had through a local implementation of the interface.
-