Package org.apache.druid.segment
Interface CloseableShapeshifter
-
- All Superinterfaces:
AutoCloseable
,Closeable
- All Known Implementing Classes:
AbstractFrameRowsAndColumns
,ColumnBasedFrameRowsAndColumns
,CursorFactoryRowsAndColumns
,QueryableIndexRowsAndColumns
,RowBasedFrameRowsAndColumns
public interface CloseableShapeshifter extends Closeable
A CloseableShapeshifter is an interface created to allow Segments to be used fromas(Class)
, but also to be able to ensure that any resource used by the object returned from theas(Class)
method have proper management of their lifecycle. This was initially introduced in order to make it possible forSegment
to become aRowsAndColumns
without needing to add extra close() methods toRowsAndColumns
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T> T
as(Class<T> clazz)
Asks the Object to return itself as a concrete implementation of a specific interface.
-
-
-
Method Detail
-
as
@Nullable <T> T as(@Nonnull Class<T> clazz)
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.
-
-