Tabnine Logo
SamzaSqlApplicationConfig.getWindowDurationMs
Code IndexAdd Tabnine to your IDE (free)

How to use
getWindowDurationMs
method
in
org.apache.samza.sql.runner.SamzaSqlApplicationConfig

Best Java code snippets using org.apache.samza.sql.runner.SamzaSqlApplicationConfig.getWindowDurationMs (Showing top 2 results out of 315)

origin: org.apache.samza/samza-sql

void translate(final LogicalAggregate aggregate, final TranslatorContext context) {
 validateAggregateFunctions(aggregate);
 MessageStream<SamzaSqlRelMessage> inputStream = context.getMessageStream(aggregate.getInput().getId());
 // At this point, the assumption is that only count function is supported.
 SupplierFunction<Long> initialValue = () -> (long) 0;
 FoldLeftFunction<SamzaSqlRelMessage, Long> foldCountFn = (m, c) -> c + 1;
 final ArrayList<String> aggFieldNames = getAggFieldNames(aggregate);
 MessageStream<SamzaSqlRelMessage> outputStream =
   inputStream
     .window(Windows.keyedTumblingWindow(m -> m,
       Duration.ofMillis(context.getExecutionContext().getSamzaSqlApplicationConfig().getWindowDurationMs()),
       initialValue,
       foldCountFn,
       new SamzaSqlRelMessageSerdeFactory.SamzaSqlRelMessageSerde(),
       new LongSerde())
       .setAccumulationMode(AccumulationMode.DISCARDING), "tumblingWindow_" + windowId)
     .map(windowPane -> {
       List<String> fieldNames = windowPane.getKey().getKey().getSamzaSqlRelRecord().getFieldNames();
       List<Object> fieldValues = windowPane.getKey().getKey().getSamzaSqlRelRecord().getFieldValues();
       fieldNames.add(aggFieldNames.get(0));
       fieldValues.add(windowPane.getMessage());
       return new SamzaSqlRelMessage(fieldNames, fieldValues);
      });
 context.registerMessageStream(aggregate.getId(), outputStream);
}
origin: apache/samza

void translate(final LogicalAggregate aggregate, final TranslatorContext context) {
 validateAggregateFunctions(aggregate);
 MessageStream<SamzaSqlRelMessage> inputStream = context.getMessageStream(aggregate.getInput().getId());
 // At this point, the assumption is that only count function is supported.
 SupplierFunction<Long> initialValue = () -> (long) 0;
 FoldLeftFunction<SamzaSqlRelMessage, Long> foldCountFn = (m, c) -> c + 1;
 final ArrayList<String> aggFieldNames = getAggFieldNames(aggregate);
 MessageStream<SamzaSqlRelMessage> outputStream =
   inputStream
     .map(new TranslatorInputMetricsMapFunction(logicalOpId))
     .window(Windows.keyedTumblingWindow(m -> m,
       Duration.ofMillis(context.getExecutionContext().getSamzaSqlApplicationConfig().getWindowDurationMs()),
       initialValue,
       foldCountFn,
       new SamzaSqlRelMessageSerdeFactory.SamzaSqlRelMessageSerde(),
       new LongSerde())
       .setAccumulationMode(
         AccumulationMode.DISCARDING), changeLogStorePrefix + "_tumblingWindow_" + logicalOpId)
     .map(windowPane -> {
       List<String> fieldNames = windowPane.getKey().getKey().getSamzaSqlRelRecord().getFieldNames();
       List<Object> fieldValues = windowPane.getKey().getKey().getSamzaSqlRelRecord().getFieldValues();
       fieldNames.add(aggFieldNames.get(0));
       fieldValues.add(windowPane.getMessage());
       return new SamzaSqlRelMessage(fieldNames, fieldValues, new SamzaSqlRelMsgMetadata("", "", ""));
      });
 context.registerMessageStream(aggregate.getId(), outputStream);
 outputStream.map(new TranslatorOutputMetricsMapFunction(logicalOpId));
}
org.apache.samza.sql.runnerSamzaSqlApplicationConfiggetWindowDurationMs

Popular methods of SamzaSqlApplicationConfig

  • <init>
  • createIOResolver
  • getInputSystemStreamConfigBySource
  • getOutputSystemStreamConfigsBySource
  • getUdfMetadata
  • initializePlugin
  • createUdfResolver
  • deserializeSqlStmts
  • getDomainProperties
  • getOutputSystemStreams
  • getRelSchemaProviders
  • getSamzaRelConverters
  • getRelSchemaProviders,
  • getSamzaRelConverters,
  • getSystemStreamName,
  • populateSystemStreams,
  • populateSystemStreamsAndGetRelRoots,
  • serializeSqlStmts,
  • getIoResolver,
  • getMetadataTopicPrefix,
  • getSamzaRelTableKeyConverters

Popular in Java

  • Creating JSON documents from java classes using gson
  • getResourceAsStream (ClassLoader)
  • getSupportFragmentManager (FragmentActivity)
  • scheduleAtFixedRate (Timer)
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • Reference (javax.naming)
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now