public interface Events extends Namespaceable
| Modifier and Type | Interface and Description |
|---|---|
static class |
Events.Event
An event consists of a timestamp in milli-seconds, a map of string to string as metadata, and a map of string
to double value as dimensions.
|
| Modifier and Type | Method and Description |
|---|---|
void |
expire(String namespace,
long endTimestampMillis)
Expire all events with timestamp before the given end timestamp.
|
default List<Events.Event> |
get(String namespace,
long startTimestampMillis,
long endTimestampMillis)
Get all events in the given namespace, with timestamp between the start and end.
|
default List<Events.Event> |
get(String namespace,
long startTimestampMillis,
long endTimestampMillis,
boolean includePayloads)
Get all events in the given namespace, with timestamp between the start and end.
|
default List<Events.Event> |
get(String namespace,
long startTimestampMillis,
long endTimestampMillis,
Map<String,String> metadataQuery,
Map<String,String> dimensionsQuery)
Get all events in the given namespace, with timestamp between the start and end, and metadata and dimensions
matching the given queries.
|
default List<Events.Event> |
get(String namespace,
long startTimestampMillis,
long endTimestampMillis,
Map<String,String> metadataQuery,
Map<String,String> dimensionsQuery,
boolean includePayloads)
Get all events in the given namespace, with timestamp between the start and end, and metadata and dimensions
matching the given queries.
|
List<Events.Event> |
get(String namespace,
long startTimestampMillis,
long endTimestampMillis,
Map<String,String> metadataQuery,
Map<String,String> dimensionsQuery,
boolean includePayloads,
boolean ascending,
int limit)
Get all events in the given namespace, with timestamp between the start and end, and metadata and dimensions
matching the given queries.
|
Set<String> |
metadata(String namespace,
String metadataKey,
long startTimestampMillis,
long endTimestampMillis,
Map<String,String> metadataQuery,
Map<String,String> dimensionsQuery)
Get distinct metadata values for the given metadata key for events in the given namespace, with timestamp between
the start and end, metadata and dimensions matching the given queries.
|
void |
store(String namespace,
Collection<Events.Event> batch)
Store batch of events in the given namespace.
|
default void |
store(String namespace,
Events.Event event)
Store an event object.
|
default void |
store(String namespace,
long timestampMillis,
Map<String,String> metadata,
Map<String,Double> dimensions)
Store an event in the given namespace, with timestamp and optionally metadata and dimensions.
|
default void |
store(String namespace,
long timestampMillis,
Map<String,String> metadata,
Map<String,Double> dimensions,
byte[] payload)
Store an event in the given namespace, with timestamp and optionally metadata and dimensions, along with an
arbitrary byte array as payload.
|
create, drop, namespacesdefault void store(String namespace, long timestampMillis, Map<String,String> metadata, Map<String,Double> dimensions) throws IOException
namespace - the namespace identifiertimestampMillis - event's UTC timestamp in milli-secondsmetadata - metadata to be attached to the eventdimensions - dimensions to be attached to the eventIOException - exception thrown from the underlying storage implementationdefault void store(String namespace, Events.Event event) throws IOException
namespace - the namespace identifierevent - the event objectIOException - exception thrown from the underlying storage implementationdefault void store(String namespace, long timestampMillis, Map<String,String> metadata, Map<String,Double> dimensions, byte[] payload) throws IOException
namespace - the namespace identifiertimestampMillis - event's UTC timestamp in milli-secondsmetadata - metadata to be attached to the eventdimensions - dimensions to be attached to the eventpayload - payload to be attached to the eventIOException - exception thrown from the underlying storage implementationvoid store(String namespace, Collection<Events.Event> batch) throws IOException
namespace - the namespace identifierbatch - batch of eventsIOException - exception thrown from the underlying storage implementationdefault List<Events.Event> get(String namespace, long startTimestampMillis, long endTimestampMillis) throws IOException
namespace - the namespace identifierstartTimestampMillis - start UTC timestamp in milli-secondsendTimestampMillis - end UTC timestamp in milli-secondsIOException - exception thrown from the underlying storage implementationdefault List<Events.Event> get(String namespace, long startTimestampMillis, long endTimestampMillis, boolean includePayloads) throws IOException
namespace - the namespace identifierstartTimestampMillis - start UTC timestamp in milli-secondsendTimestampMillis - end UTC timestamp in milli-secondsincludePayloads - flag to include payloads in the response or not; if false, event.getPayload() returns nullIOException - exception thrown from the underlying storage implementationdefault List<Events.Event> get(String namespace, long startTimestampMillis, long endTimestampMillis, Map<String,String> metadataQuery, Map<String,String> dimensionsQuery) throws IOException
A metadata query can match against an exact value for a key, or use wild-card character (i.e., '*'). For example: "host" => "localhost" matches with all events where the value of metadata with key "host" is exactly "localhost"; and the query "host" => "~prod-*-example" matches all events where the value is "like 'prod-*-example'". Note that wild-card queries have to start with "~", exact queries can optionally start with "=".
A dimensions query can match against exact values or less-than, less-than-or-equal, more-than, more-than-or-equal values for a set of dimensions. For example: "cpu" => ">=0.3" matches all events where the dimension with key "cpu" has a value higher than or equal to 0.3.
namespace - the namespace identifierstartTimestampMillis - start UTC timestamp in milli-secondsendTimestampMillis - end UTC timestamp in milli-secondsmetadataQuery - map of string to string representing a query to run against events metadatadimensionsQuery - map of string to string representing a query to run against events dimensionsIOException - exception thrown from the underlying storage implementationdefault List<Events.Event> get(String namespace, long startTimestampMillis, long endTimestampMillis, Map<String,String> metadataQuery, Map<String,String> dimensionsQuery, boolean includePayloads) throws IOException
namespace - the namespace identifierstartTimestampMillis - start UTC timestamp in milli-secondsendTimestampMillis - end UTC timestamp in milli-secondsmetadataQuery - map of string to string representing a query to run against events metadatadimensionsQuery - map of string to string representing a query to run against events dimensionsincludePayloads - flag to include payloads in the response or not; if false, event.getPayload() returns nullIOException - exception thrown from the underlying storage implementationList<Events.Event> get(String namespace, long startTimestampMillis, long endTimestampMillis, Map<String,String> metadataQuery, Map<String,String> dimensionsQuery, boolean includePayloads, boolean ascending, int limit) throws IOException
namespace - the namespace identifierstartTimestampMillis - start UTC timestamp in milli-secondsendTimestampMillis - end UTC timestamp in milli-secondsmetadataQuery - map of string to string representing a query to run against events metadatadimensionsQuery - map of string to string representing a query to run against events dimensionsincludePayloads - flag to include payloads in the response or not; if false, event.getPayload() returns nullascending - order results ascending if true; descending if falselimit - maximum number of events to returnIOException - exception thrown from the underlying storage implementationSet<String> metadata(String namespace, String metadataKey, long startTimestampMillis, long endTimestampMillis, Map<String,String> metadataQuery, Map<String,String> dimensionsQuery) throws IOException
namespace - the namespace identifierstartTimestampMillis - start timestamp in milli-secondsendTimestampMillis - end timestamp in milli-secondsmetadataQuery - map of string to string representing a query to run against events metadatadimensionsQuery - map of string to string representing a query to run against events dimensionsIOException - exception thrown from the underlying storage implementationvoid expire(String namespace, long endTimestampMillis) throws IOException
endTimestampMillis - end timestamp in milli-secondsIOException - exception thrown from the underlying storage implementationCopyright © 2021. All rights reserved.