com.hazelcast.jet

## Class Util

- java.lang.Object
- - com.hazelcast.jet.Util

-     public final class Util
      extends Object

  Miscellaneous utility methods useful in DAG building logic.

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static <K,V> DistributedFunction<EventJournalCacheEvent<K,V>,Map.Entry<K,V>>` | `cacheEventToEntry()` Returns a projection that converts the `EventJournalCacheEvent` to a `Map.Entry` using the event's new value as a value.
    `static <K,V> DistributedPredicate<EventJournalCacheEvent<K,V>>` | `cachePutEvents()` Returns a predicate for `Sources.cacheJournal(java.lang.String, com.hazelcast.jet.function.DistributedPredicate<? super com.hazelcast.cache.journal.EventJournalCacheEvent<K, V>>, com.hazelcast.jet.function.DistributedFunction<? super com.hazelcast.cache.journal.EventJournalCacheEvent<K, V>, ? extends T>, com.hazelcast.jet.pipeline.JournalInitialPosition)` and `Sources.remoteCacheJournal(java.lang.String, com.hazelcast.client.config.ClientConfig, com.hazelcast.jet.function.DistributedPredicate<? super com.hazelcast.cache.journal.EventJournalCacheEvent<K, V>>, com.hazelcast.jet.function.DistributedFunction<? super com.hazelcast.cache.journal.EventJournalCacheEvent<K, V>, ? extends T>, com.hazelcast.jet.pipeline.JournalInitialPosition)` that passes only `CREATED` and `UPDATED` events.
    `static <K,V> Map.Entry<K,V>` | `entry(K k, V v)` Returns a `Map.Entry` with the given key and value.
    `static String` | `idToString(long id)` Converts a `long` job or execution ID to a string representation.
    `static <K,V> DistributedFunction<EventJournalMapEvent<K,V>,V>` | `mapEventNewValue()` Returns a projection that extracts the new value from a `EventJournalMapEvent`.
    `static <K,V> DistributedFunction<EventJournalMapEvent<K,V>,Map.Entry<K,V>>` | `mapEventToEntry()` Returns a projection that converts the `EventJournalMapEvent` to a `Map.Entry` using the event's new value as a value.
    `static <K,V> DistributedPredicate<EventJournalMapEvent<K,V>>` | `mapPutEvents()` Returns a predicate for `Sources.mapJournal(java.lang.String, com.hazelcast.jet.function.DistributedPredicate<? super com.hazelcast.map.journal.EventJournalMapEvent<K, V>>, com.hazelcast.jet.function.DistributedFunction<? super com.hazelcast.map.journal.EventJournalMapEvent<K, V>, ? extends T>, com.hazelcast.jet.pipeline.JournalInitialPosition)` and `Sources.remoteMapJournal(java.lang.String, com.hazelcast.client.config.ClientConfig, com.hazelcast.jet.function.DistributedPredicate<? super com.hazelcast.map.journal.EventJournalMapEvent<K, V>>, com.hazelcast.jet.function.DistributedFunction<? super com.hazelcast.map.journal.EventJournalMapEvent<K, V>, ? extends T>, com.hazelcast.jet.pipeline.JournalInitialPosition)` that passes only `ADDED` and `UPDATED` events.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### entry

          public static <K,V> Map.Entry<K,V> entry(K k,
                                                   V v)

      Returns a `Map.Entry` with the given key and value.

    - #### mapPutEvents

          public static <K,V> DistributedPredicate<EventJournalMapEvent<K,V>> mapPutEvents()

      Returns a predicate for `Sources.mapJournal(java.lang.String, com.hazelcast.jet.function.DistributedPredicate<? super com.hazelcast.map.journal.EventJournalMapEvent<K, V>>, com.hazelcast.jet.function.DistributedFunction<? super com.hazelcast.map.journal.EventJournalMapEvent<K, V>, ? extends T>, com.hazelcast.jet.pipeline.JournalInitialPosition)` and `Sources.remoteMapJournal(java.lang.String, com.hazelcast.client.config.ClientConfig, com.hazelcast.jet.function.DistributedPredicate<? super com.hazelcast.map.journal.EventJournalMapEvent<K, V>>, com.hazelcast.jet.function.DistributedFunction<? super com.hazelcast.map.journal.EventJournalMapEvent<K, V>, ? extends T>, com.hazelcast.jet.pipeline.JournalInitialPosition)` that passes only `ADDED` and `UPDATED` events.

    - #### cachePutEvents

          public static <K,V> DistributedPredicate<EventJournalCacheEvent<K,V>> cachePutEvents()

      Returns a predicate for `Sources.cacheJournal(java.lang.String, com.hazelcast.jet.function.DistributedPredicate<? super com.hazelcast.cache.journal.EventJournalCacheEvent<K, V>>, com.hazelcast.jet.function.DistributedFunction<? super com.hazelcast.cache.journal.EventJournalCacheEvent<K, V>, ? extends T>, com.hazelcast.jet.pipeline.JournalInitialPosition)` and `Sources.remoteCacheJournal(java.lang.String, com.hazelcast.client.config.ClientConfig, com.hazelcast.jet.function.DistributedPredicate<? super com.hazelcast.cache.journal.EventJournalCacheEvent<K, V>>, com.hazelcast.jet.function.DistributedFunction<? super com.hazelcast.cache.journal.EventJournalCacheEvent<K, V>, ? extends T>, com.hazelcast.jet.pipeline.JournalInitialPosition)` that passes only `CREATED` and `UPDATED` events.

    - #### mapEventToEntry

          public static <K,V> DistributedFunction<EventJournalMapEvent<K,V>,Map.Entry<K,V>> mapEventToEntry()

      Returns a projection that converts the `EventJournalMapEvent` to a `Map.Entry` using the event's new value as a value.
      See Also:
        `Sources.mapJournal(java.lang.String, com.hazelcast.jet.function.DistributedPredicate<? super com.hazelcast.map.journal.EventJournalMapEvent<K, V>>, com.hazelcast.jet.function.DistributedFunction<? super com.hazelcast.map.journal.EventJournalMapEvent<K, V>, ? extends T>, com.hazelcast.jet.pipeline.JournalInitialPosition)`, `Sources.remoteMapJournal(java.lang.String, com.hazelcast.client.config.ClientConfig, com.hazelcast.jet.function.DistributedPredicate<? super com.hazelcast.map.journal.EventJournalMapEvent<K, V>>, com.hazelcast.jet.function.DistributedFunction<? super com.hazelcast.map.journal.EventJournalMapEvent<K, V>, ? extends T>, com.hazelcast.jet.pipeline.JournalInitialPosition)`

    - #### mapEventNewValue

          public static <K,V> DistributedFunction<EventJournalMapEvent<K,V>,V> mapEventNewValue()

      Returns a projection that extracts the new value from a `EventJournalMapEvent`.
      See Also:
        `Sources.mapJournal(java.lang.String, com.hazelcast.jet.function.DistributedPredicate<? super com.hazelcast.map.journal.EventJournalMapEvent<K, V>>, com.hazelcast.jet.function.DistributedFunction<? super com.hazelcast.map.journal.EventJournalMapEvent<K, V>, ? extends T>, com.hazelcast.jet.pipeline.JournalInitialPosition)`, `Sources.remoteMapJournal(java.lang.String, com.hazelcast.client.config.ClientConfig, com.hazelcast.jet.function.DistributedPredicate<? super com.hazelcast.map.journal.EventJournalMapEvent<K, V>>, com.hazelcast.jet.function.DistributedFunction<? super com.hazelcast.map.journal.EventJournalMapEvent<K, V>, ? extends T>, com.hazelcast.jet.pipeline.JournalInitialPosition)`

    - #### cacheEventToEntry

          public static <K,V> DistributedFunction<EventJournalCacheEvent<K,V>,Map.Entry<K,V>> cacheEventToEntry()

      Returns a projection that converts the `EventJournalCacheEvent` to a `Map.Entry` using the event's new value as a value.
      See Also:
        `Sources.cacheJournal(java.lang.String, com.hazelcast.jet.function.DistributedPredicate<? super com.hazelcast.cache.journal.EventJournalCacheEvent<K, V>>, com.hazelcast.jet.function.DistributedFunction<? super com.hazelcast.cache.journal.EventJournalCacheEvent<K, V>, ? extends T>, com.hazelcast.jet.pipeline.JournalInitialPosition)`, `Sources.remoteCacheJournal(java.lang.String, com.hazelcast.client.config.ClientConfig, com.hazelcast.jet.function.DistributedPredicate<? super com.hazelcast.cache.journal.EventJournalCacheEvent<K, V>>, com.hazelcast.jet.function.DistributedFunction<? super com.hazelcast.cache.journal.EventJournalCacheEvent<K, V>, ? extends T>, com.hazelcast.jet.pipeline.JournalInitialPosition)`

    - #### idToString

          public static String idToString(long id)

      Converts a `long` job or execution ID to a string representation. Currently it is an unsigned 16-digit hex number.

Copyright © 2018. All rights reserved.