Package org.apache.druid.segment
Class RestrictedCursorFactory
- java.lang.Object
-
- org.apache.druid.segment.RestrictedCursorFactory
-
- All Implemented Interfaces:
Expr.InputBindingInspector,ColumnInspector,CursorFactory
public class RestrictedCursorFactory extends Object implements CursorFactory
A factory class for creatingCursorinstances with strict adherence toPolicyrestrictions. Created byRestrictedSegment.asCursorFactory(), and applies policies transparently.The
CursorFactorysimplifies the process of initializing and retrievingCursorobjects while ensuring that any cursor created complies with thePolicyrestrictions.Policy enforcement in
makeCursorHolder(org.apache.druid.segment.CursorBuildSpec):- Row-level restrictions are enforced by adding filters to
CursorBuildSpec, which is then passed to delegate for execution. This ensures that only relevant data are accessible by the client.
-
-
Constructor Summary
Constructors Constructor Description RestrictedCursorFactory(CursorFactory delegate, Policy policy)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ColumnCapabilitiesgetColumnCapabilities(String column)Returns capabilities of a particular column, if known.RowSignaturegetRowSignature()Returns theRowSignatureof the data available from this cursor factory.CursorHoldermakeCursorHolder(CursorBuildSpec spec)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.druid.segment.ColumnInspector
getType
-
Methods inherited from interface org.apache.druid.math.expr.Expr.InputBindingInspector
areNumeric, areNumeric, areSameTypes, areSameTypes, areScalar, areScalar, canVectorize, canVectorize
-
-
-
-
Constructor Detail
-
RestrictedCursorFactory
public RestrictedCursorFactory(CursorFactory delegate, Policy policy)
-
-
Method Detail
-
makeCursorHolder
public CursorHolder makeCursorHolder(CursorBuildSpec spec)
- Specified by:
makeCursorHolderin interfaceCursorFactory
-
getRowSignature
public RowSignature getRowSignature()
Description copied from interface:CursorFactoryReturns theRowSignatureof the data available from this cursor factory. For mutable segments, even though the signature may evolve over time, any particular object returned by this method is an immutable snapshot.- Specified by:
getRowSignaturein interfaceCursorFactory
-
getColumnCapabilities
@Nullable public ColumnCapabilities getColumnCapabilities(String column)
Description copied from interface:CursorFactoryReturns capabilities of a particular column, if known. May be null if the column doesn't exist, or if the column does exist but the capabilities are unknown. The latter is possible with dynamically discovered columns. Note that CursorFactory are representations of "real" segments, so they are not aware of any virtual columns that may be involved in a query. In general, query engines should instead use the methodColumnSelectorFactory.getColumnCapabilities(String), which returns capabilities for virtual columns as well.- Specified by:
getColumnCapabilitiesin interfaceColumnInspector- Specified by:
getColumnCapabilitiesin interfaceCursorFactory- Parameters:
column- column name- Returns:
- capabilities, or null
-
-