Class LookupStrategy

  • All Implemented Interfaces:
    java.util.function.BiFunction<org.apache.spark.sql.Dataset<org.apache.spark.sql.Row>,​java.util.function.Supplier<org.apache.spark.sql.Dataset<org.apache.spark.sql.Row>>,​org.apache.spark.sql.Dataset<org.apache.spark.sql.Row>>

    public final class LookupStrategy
    extends java.lang.Object
    implements java.util.function.BiFunction<org.apache.spark.sql.Dataset<org.apache.spark.sql.Row>,​java.util.function.Supplier<org.apache.spark.sql.Dataset<org.apache.spark.sql.Row>>,​org.apache.spark.sql.Dataset<org.apache.spark.sql.Row>>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static LookupStrategy LAST_BEFORE_START
      Perform data lookup to extract the last available datapoint (if any) prior the actual data that belong to a given time window.
      static LookupStrategy LAST_BEFORE_START_IF_EMPTY
      Perform data lookup to extract the last available datapoint (if any) prior the given time window, only if the actual data do not exist.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.apache.spark.sql.Dataset<org.apache.spark.sql.Row> apply​(org.apache.spark.sql.Dataset<org.apache.spark.sql.Row> dataset, java.util.function.Supplier<org.apache.spark.sql.Dataset<org.apache.spark.sql.Row>> datasetSupplier)  
      boolean equals​(java.lang.Object o)  
      @NonNull java.time.Duration getDuration()  
      @NonNull cern.nxcals.api.custom.service.extraction.LookupStrategy.Handler getHandler()  
      int hashCode()  
      java.lang.String toString()  
      LookupStrategy withLookupDuration​(long amount, @NonNull java.time.temporal.TemporalUnit unit)  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.function.BiFunction

        andThen
    • Field Detail

      • LAST_BEFORE_START

        public static final LookupStrategy LAST_BEFORE_START
        Perform data lookup to extract the last available datapoint (if any) prior the actual data that belong to a given time window. If such datapoint exists, it would be merged into the actual dataset.
      • LAST_BEFORE_START_IF_EMPTY

        public static final LookupStrategy LAST_BEFORE_START_IF_EMPTY
        Perform data lookup to extract the last available datapoint (if any) prior the given time window, only if the actual data do not exist. In that case a single row dataset would be returned, containing that last datapoint. Otherwise, if data exist for the given time window, this strategy will not perform any data lookup action, thus, only data points matching the query time window would be included on the result.
    • Method Detail

      • withLookupDuration

        public LookupStrategy withLookupDuration​(long amount,
                                                 @NonNull
                                                 @NonNull java.time.temporal.TemporalUnit unit)
      • apply

        public org.apache.spark.sql.Dataset<org.apache.spark.sql.Row> apply​(org.apache.spark.sql.Dataset<org.apache.spark.sql.Row> dataset,
                                                                            java.util.function.Supplier<org.apache.spark.sql.Dataset<org.apache.spark.sql.Row>> datasetSupplier)
        Specified by:
        apply in interface java.util.function.BiFunction<org.apache.spark.sql.Dataset<org.apache.spark.sql.Row>,​java.util.function.Supplier<org.apache.spark.sql.Dataset<org.apache.spark.sql.Row>>,​org.apache.spark.sql.Dataset<org.apache.spark.sql.Row>>
      • getHandler

        @NonNull
        public @NonNull cern.nxcals.api.custom.service.extraction.LookupStrategy.Handler getHandler()
      • getDuration

        @NonNull
        public @NonNull java.time.Duration getDuration()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object