Tabnine Logo
Stream.window
Code IndexAdd Tabnine to your IDE (free)

How to use
window
method
in
storm.trident.Stream

Best Java code snippets using storm.trident.Stream.window (Showing top 13 results out of 315)

origin: alibaba/jstorm

/**
 * Returns stream of aggregated results based on the given window configuration.
 *
 * @param windowConfig window configuration like window length and slide length.
 * @param windowStoreFactory intermediary tuple store for storing tuples for windowing
 * @param inputFields input fields
 * @param aggregator aggregator to run on the window of tuples to compute the result and emit to the stream.
 * @param functionFields fields of values to emit with aggregation.
 *
 * @return the new stream with this operation.
 */
public Stream window(WindowConfig windowConfig, WindowsStoreFactory windowStoreFactory, Fields inputFields,
           Aggregator aggregator, Fields functionFields) {
  return window(windowConfig, windowStoreFactory, inputFields, aggregator, functionFields, true);
}
origin: alibaba/jstorm

/**
 * Returns a stream of tuples which are aggregated results of a sliding window with every {@code windowCount} of tuples
 * and slides the window after {@code slideCount}.
 *
 * @param windowCount represents tuples count of a window
 * @param inputFields projected fields for aggregator
 * @param aggregator aggregator to run on the window of tuples to compute the result and emit to the stream.
 * @param functionFields fields of values to emit with aggregation.
 *
 * @return the new stream with this operation.
 */
public Stream slidingWindow(int windowCount, int slideCount, WindowsStoreFactory windowStoreFactory,
                 Fields inputFields, Aggregator aggregator, Fields functionFields) {
  return window(SlidingCountWindow.of(windowCount, slideCount), windowStoreFactory, inputFields, aggregator, functionFields);
}
origin: alibaba/jstorm

/**
 * Returns a stream of tuples which are aggregated results of a window that tumbles at duration of {@code windowDuration}
 *
 * @param windowDuration represents tumbling window duration configuration
 * @param windowStoreFactory intermediary tuple store for storing windowing tuples
 * @param inputFields projected fields for aggregator
 * @param aggregator aggregator to run on the window of tuples to compute the result and emit to the stream.
 * @param functionFields fields of values to emit with aggregation.
 *
 * @return the new stream with this operation.
 */
public Stream tumblingWindow(BaseWindowedBolt.Duration windowDuration, WindowsStoreFactory windowStoreFactory,
                 Fields inputFields, Aggregator aggregator, Fields functionFields) {
  return window(TumblingDurationWindow.of(windowDuration), windowStoreFactory, inputFields, aggregator, functionFields);
}
origin: alibaba/jstorm

/**
 * Returns a stream of tuples which are aggregated results of a tumbling window with every {@code windowCount} of tuples.
 *
 * @param windowCount represents number of tuples in the window
 * @param windowStoreFactory intermediary tuple store for storing windowing tuples
 * @param inputFields projected fields for aggregator
 * @param aggregator aggregator to run on the window of tuples to compute the result and emit to the stream.
 * @param functionFields fields of values to emit with aggregation.
 *
 * @return the new stream with this operation.
 */
public Stream tumblingWindow(int windowCount, WindowsStoreFactory windowStoreFactory,
                 Fields inputFields, Aggregator aggregator, Fields functionFields) {
  return window(TumblingCountWindow.of(windowCount), windowStoreFactory, inputFields, aggregator, functionFields);
}
origin: alibaba/jstorm

/**
 * Returns a stream of tuples which are aggregated results of a window which slides at duration of {@code slidingInterval}
 * and completes a window at {@code windowDuration}
 *
 * @param windowDuration represents window duration configuration
 * @param inputFields projected fields for aggregator
 * @param aggregator aggregator to run on the window of tuples to compute the result and emit to the stream.
 * @param functionFields fields of values to emit with aggregation.
 *
 * @return the new stream with this operation.
 */
public Stream slidingWindow(BaseWindowedBolt.Duration windowDuration, BaseWindowedBolt.Duration slidingInterval,
                WindowsStoreFactory windowStoreFactory, Fields inputFields, Aggregator aggregator, Fields functionFields) {
  return window(SlidingDurationWindow.of(windowDuration, slidingInterval), windowStoreFactory, inputFields, aggregator, functionFields);
}
origin: alibaba/jstorm

/**
 * Returns a stream of aggregated results based on the given window configuration which uses inmemory windowing tuple store.
 *
 * @param windowConfig window configuration like window length and slide length.
 * @param inputFields input fields
 * @param aggregator aggregator to run on the window of tuples to compute the result and emit to the stream.
 * @param functionFields fields of values to emit with aggregation.
 *
 * @return the new stream with this operation.
 */
public Stream window(WindowConfig windowConfig, Fields inputFields, Aggregator aggregator, Fields functionFields) {
  // this store is used only for storing triggered aggregated results but not tuples as storeTuplesInStore is set
  // as false int he below call.
  InMemoryWindowsStoreFactory inMemoryWindowsStoreFactory = new InMemoryWindowsStoreFactory();
  return window(windowConfig, inMemoryWindowsStoreFactory, inputFields, aggregator, functionFields, false);
}
origin: alibaba/jstorm

public static StormTopology buildTopology(WindowsStoreFactory windowStore, WindowConfig windowConfig)
    throws Exception {
  FixedBatchSpout spout = new FixedBatchSpout(new Fields("sentence"), 3,
      new Values("the cow jumped over the moon"),
      new Values("the man went to the store and bought some candy"),
      new Values("four score and seven years ago"), new Values("how many apples can you eat"),
      new Values("to be or not to be the person"));
  spout.setCycle(true);
  
  TridentTopology topology = new TridentTopology();
  
  Stream stream = topology.newStream("spout1", spout).parallelismHint(16)
      .each(new Fields("sentence"), new Split(), new Fields("word"))
      .window(windowConfig, windowStore, new Fields("word"), new CountAsAggregator(), new Fields("count"))
      .peek(new Consumer() {
        @Override
        public void accept(TridentTuple input) {
          LOG.info("Received tuple: [{}]", input);
        }
      });
      
  return topology.build();
}

origin: com.alibaba.jstorm/jstorm-core

/**
 * Returns stream of aggregated results based on the given window configuration.
 *
 * @param windowConfig window configuration like window length and slide length.
 * @param windowStoreFactory intermediary tuple store for storing tuples for windowing
 * @param inputFields input fields
 * @param aggregator aggregator to run on the window of tuples to compute the result and emit to the stream.
 * @param functionFields fields of values to emit with aggregation.
 *
 * @return the new stream with this operation.
 */
public Stream window(WindowConfig windowConfig, WindowsStoreFactory windowStoreFactory, Fields inputFields,
           Aggregator aggregator, Fields functionFields) {
  return window(windowConfig, windowStoreFactory, inputFields, aggregator, functionFields, true);
}
origin: com.alibaba.jstorm/jstorm-core

/**
 * Returns a stream of tuples which are aggregated results of a sliding window with every {@code windowCount} of tuples
 * and slides the window after {@code slideCount}.
 *
 * @param windowCount represents tuples count of a window
 * @param inputFields projected fields for aggregator
 * @param aggregator aggregator to run on the window of tuples to compute the result and emit to the stream.
 * @param functionFields fields of values to emit with aggregation.
 *
 * @return the new stream with this operation.
 */
public Stream slidingWindow(int windowCount, int slideCount, WindowsStoreFactory windowStoreFactory,
                 Fields inputFields, Aggregator aggregator, Fields functionFields) {
  return window(SlidingCountWindow.of(windowCount, slideCount), windowStoreFactory, inputFields, aggregator, functionFields);
}
origin: com.alibaba.jstorm/jstorm-core

/**
 * Returns a stream of tuples which are aggregated results of a window that tumbles at duration of {@code windowDuration}
 *
 * @param windowDuration represents tumbling window duration configuration
 * @param windowStoreFactory intermediary tuple store for storing windowing tuples
 * @param inputFields projected fields for aggregator
 * @param aggregator aggregator to run on the window of tuples to compute the result and emit to the stream.
 * @param functionFields fields of values to emit with aggregation.
 *
 * @return the new stream with this operation.
 */
public Stream tumblingWindow(BaseWindowedBolt.Duration windowDuration, WindowsStoreFactory windowStoreFactory,
                 Fields inputFields, Aggregator aggregator, Fields functionFields) {
  return window(TumblingDurationWindow.of(windowDuration), windowStoreFactory, inputFields, aggregator, functionFields);
}
origin: com.alibaba.jstorm/jstorm-core

/**
 * Returns a stream of tuples which are aggregated results of a tumbling window with every {@code windowCount} of tuples.
 *
 * @param windowCount represents number of tuples in the window
 * @param windowStoreFactory intermediary tuple store for storing windowing tuples
 * @param inputFields projected fields for aggregator
 * @param aggregator aggregator to run on the window of tuples to compute the result and emit to the stream.
 * @param functionFields fields of values to emit with aggregation.
 *
 * @return the new stream with this operation.
 */
public Stream tumblingWindow(int windowCount, WindowsStoreFactory windowStoreFactory,
                 Fields inputFields, Aggregator aggregator, Fields functionFields) {
  return window(TumblingCountWindow.of(windowCount), windowStoreFactory, inputFields, aggregator, functionFields);
}
origin: com.alibaba.jstorm/jstorm-core

/**
 * Returns a stream of tuples which are aggregated results of a window which slides at duration of {@code slidingInterval}
 * and completes a window at {@code windowDuration}
 *
 * @param windowDuration represents window duration configuration
 * @param inputFields projected fields for aggregator
 * @param aggregator aggregator to run on the window of tuples to compute the result and emit to the stream.
 * @param functionFields fields of values to emit with aggregation.
 *
 * @return the new stream with this operation.
 */
public Stream slidingWindow(BaseWindowedBolt.Duration windowDuration, BaseWindowedBolt.Duration slidingInterval,
                WindowsStoreFactory windowStoreFactory, Fields inputFields, Aggregator aggregator, Fields functionFields) {
  return window(SlidingDurationWindow.of(windowDuration, slidingInterval), windowStoreFactory, inputFields, aggregator, functionFields);
}
origin: com.alibaba.jstorm/jstorm-core

/**
 * Returns a stream of aggregated results based on the given window configuration which uses inmemory windowing tuple store.
 *
 * @param windowConfig window configuration like window length and slide length.
 * @param inputFields input fields
 * @param aggregator aggregator to run on the window of tuples to compute the result and emit to the stream.
 * @param functionFields fields of values to emit with aggregation.
 *
 * @return the new stream with this operation.
 */
public Stream window(WindowConfig windowConfig, Fields inputFields, Aggregator aggregator, Fields functionFields) {
  // this store is used only for storing triggered aggregated results but not tuples as storeTuplesInStore is set
  // as false int he below call.
  InMemoryWindowsStoreFactory inMemoryWindowsStoreFactory = new InMemoryWindowsStoreFactory();
  return window(windowConfig, inMemoryWindowsStoreFactory, inputFields, aggregator, functionFields, false);
}
storm.tridentStreamwindow

Javadoc

Returns a stream of aggregated results based on the given window configuration which uses inmemory windowing tuple store.

Popular methods of Stream

  • each
  • groupBy
    ## Grouping Operation
  • project
    Filters out fields from a stream, resulting in a Stream containing only the fields specified by `kee
  • aggregate
  • partitionBy
    ## Repartitioning Operation
  • shuffle
    ## Repartitioning Operation Use random round robin algorithm to evenly redistribute tuples across al
  • stateQuery
  • parallelismHint
    Applies a parallelism hint to a stream.
  • partitionAggregate
  • partitionPersist
  • global
    ## Repartitioning Operation All tuples are sent to the same partition. The same partition is chosen
  • batchGlobal
    ## Repartitioning Operation All tuples in the batch are sent to the same partition. Different batche
  • global,
  • batchGlobal,
  • chainedAgg,
  • <init>,
  • broadcast,
  • getOutputFields,
  • name,
  • partition,
  • persistentAggregate,
  • projectionValidation

Popular in Java

  • Reading from database using SQL prepared statement
  • notifyDataSetChanged (ArrayAdapter)
  • onRequestPermissionsResult (Fragment)
  • startActivity (Activity)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • JFileChooser (javax.swing)
  • JFrame (javax.swing)
  • Top 12 Jupyter Notebook extensions
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