All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.honeycomb.libhoney.transport.batch.impl.HoneycombBatchKeyStrategy Maven / Gradle / Ivy

The newest version!
package io.honeycomb.libhoney.transport.batch.impl;

import io.honeycomb.libhoney.eventdata.ResolvedEvent;
import io.honeycomb.libhoney.transport.batch.BatchKeyStrategy;

/**
 * Key strategy operating on {@link ResolvedEvent}, returning a key that allows batching as described in the
 * SDK Spec#transmission:
 * "the library must separate events into batches that all have API Host, writekey, and dataset in common".
 */
public class HoneycombBatchKeyStrategy implements BatchKeyStrategy {
    /**
     * @param event to use for deducing the key.
     * @return A string key to determine what batch this event goes into.
     */
    @Override
    public String getKey(final ResolvedEvent event) {
        return event.getApiHost() + ";" + event.getWriteKey() + ";" + event.getDataset();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy