Class PublisherUtils


  • public class PublisherUtils
    extends Object
    Utils for publishers.
    • Constructor Detail

      • PublisherUtils

        public PublisherUtils()
    • Method Detail

      • createTupleForStore

        public static Object[] createTupleForStore​(com.qfs.store.IDatastore datastore,
                                                   Map<String,​Integer> translatorTupleFields,
                                                   Object[] initialTuple,
                                                   String store,
                                                   Map<String,​Object> fieldsToOverride)
        Creates a tuple for the required store, by attempting to extract the value for each store field from the input tuple
        Parameters:
        datastore - The datastore object
        translatorTupleFields - Map holding the fields that exist in the incoming tuple and their respective indexes
        initialTuple - The initial tuple from the source
        store - The store for which a tuple has to be created
        fieldsToOverride - A map of any fields that have values set by the tuple publisher and those values
        Returns:
        The tuple that conforms to the store format
      • createTupleForStore

        public static Object[] createTupleForStore​(com.qfs.store.IDatastore datastore,
                                                   Map<String,​Integer> translatorTupleFields,
                                                   Object[] initialTuple,
                                                   String store)
        Creates a tuple for the required store, by attempting to extract the value for each store field from the input tuple
        Parameters:
        datastore - The datastore object
        translatorTupleFields - Map holding the fields that exist in the incoming tuple and their respective indexes
        initialTuple - The initial tuple from the source
        store - The store for which a tuple has to be created
        Returns:
        The tuple that conforms to the store format
      • extractDistinctTuples

        public static List<Object[]> extractDistinctTuples​(Collection<Object[]> tuples)
        Extracts unique tuples from an incoming list. Comparison is made on all incoming fields, not based on a particular key subset.
        Parameters:
        tuples - The list of tuples that contains duplicates.
        Returns:
        The list of unique tuples.