Interface Segment

All Superinterfaces:
AutoCloseable, Closeable
All Known Implementing Classes:
ArrayListSegment, FilteredSegment, FrameSegment, HashJoinSegment, IncrementalIndexSegment, LookupSegment, QueryableIndexSegment, ReferenceCountedSegmentProvider.CloseableWrappedReference, ReferenceCountedSegmentProvider.LeafReference, ReferenceCountedSegmentProvider.ReferenceClosingSegment, ReferenceCountedSegmentProvider.UnmanagedReference, RestrictedSegment, RowBasedSegment, UnnestSegment, WrappedSegment

public interface Segment extends Closeable
The difference between this class and DataSegment is that DataSegment contains the segment metadata only, while this class represents the actual body of segment data, queryable.
  • Method Summary

    Modifier and Type
    Method
    Description
    <T> T
    as(Class<T> clazz)
    Request an implementation of a particular interface.
    org.joda.time.Interval
     
    default String
    Developer friendly string suitable to use in internal error messages and provide some additional information about what kind of segment was involved in a problem
    Returns the SegmentId of this segment, if it is backed by a real table, otherwise returns null.
    default boolean
     
    default void
    Validates if the segment complies with the policy restrictions on tables.

    Methods inherited from interface java.io.Closeable

    close
  • Method Details

    • getId

      @Nullable SegmentId getId()
      Returns the SegmentId of this segment, if it is backed by a real table, otherwise returns null.
    • getDataInterval

      org.joda.time.Interval getDataInterval()
    • as

      @Nullable <T> T as(@Nonnull Class<T> clazz)
      Request an implementation of a particular interface.

      All implementations of this method should be able to provide a CursorFactory. Other interfaces are only expected to be requested by callers that have specific knowledge of extra features provided by specific segment types. For example, an extension might provide a custom Segment type that can offer both CursorFactory and some new interface. That extension can also offer a Query that uses that new interface.

      Implementations which accept classes other than known built-in interfaces such as CursorFactory are limited to using those classes within the extension. This means that one extension cannot rely on the `Segment.as` behavior of another extension.

      Type Parameters:
      T - desired interface
      Parameters:
      clazz - desired interface
      Returns:
      instance of clazz, or null if the interface is not supported by this segment, one of the following:
    • isTombstone

      default boolean isTombstone()
    • getDebugString

      default String getDebugString()
      Developer friendly string suitable to use in internal error messages and provide some additional information about what kind of segment was involved in a problem
    • validateOrElseThrow

      default void validateOrElseThrow(PolicyEnforcer policyEnforcer)
      Validates if the segment complies with the policy restrictions on tables.

      This should be called right before the segment is about to be processed by the query stack, and after ExecutionVertex.createSegmentMapFunction(PolicyEnforcer).