com.netflix.atlas.core.util
Members list
Type members
Classlikes
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
ArrayHelper.type
Fixed size buffer that can be used for computing the top-K items.
Fixed size buffer that can be used for computing the top-K items.
Value parameters
- comparator
-
Comparator used for checking the relative priority of entries.
- maxSize
-
Maximum size of the buffer.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
Wraps a ByteBuffer so it can be used with interfaces that require an InputStream. The buffer should not be modified outside of the reader until reading is complete.
Wraps a ByteBuffer so it can be used with interfaces that require an InputStream. The buffer should not be modified outside of the reader until reading is complete.
Attributes
- Supertypes
-
class InputStreamtrait Closeabletrait AutoCloseableclass Objecttrait Matchableclass AnyShow all
Interner based on a Caffeine cache. This implementation should only be used for memory reduction and not reference equality. If the cache is full, then some values will not be deduped.
Interner based on a Caffeine cache. This implementation should only be used for memory reduction and not reference equality. If the cache is full, then some values will not be deduped.
Value parameters
- maxSize
-
Maximum number of strings to intern.
Attributes
- Supertypes
Utility for cheaply estimating the number of distinct values for a set of objects.
Utility for cheaply estimating the number of distinct values for a set of objects.
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
Attributes
- Companion
- trait
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
CardinalityEstimator.type
Wraps a CharBuffer so it can be used with interfaces that require a Reader. The buffer should not be modified outside of the reader until reading is complete.
Wraps a CharBuffer so it can be used with interfaces that require a Reader. The buffer should not be modified outside of the reader until reading is complete.
Attributes
- Supertypes
-
class Readertrait Closeabletrait AutoCloseabletrait Readableclass Objecttrait Matchableclass AnyShow all
Comparator for classes that implement Comparable.
Comparator for classes that implement Comparable.
Attributes
- Supertypes
-
trait Comparator[T]class Objecttrait Matchableclass Any
Mutable double to integer map based on an underlying LongIntHashMap. Primary use-case is computing a count for the number of times a particular value was encountered.
Mutable double to integer map based on an underlying LongIntHashMap. Primary use-case is computing a count for the number of times a particular value was encountered.
Value parameters
- capacity
-
Initial capacity guideline. The actual size of the underlying buffer will be the next prime >=
capacity
. Default is 10. - noData
-
Value to use to represent no data in the array. This value should not be used in the input. Default is NaN.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
Wrap GZIPOutputStream to set the best speed compression level.
Wrap GZIPOutputStream to set the best speed compression level.
Attributes
- Supertypes
-
class GZIPOutputStreamclass DeflaterOutputStreamclass FilterOutputStreamclass OutputStreamtrait Flushabletrait Closeabletrait AutoCloseableclass Objecttrait Matchableclass AnyShow all
Wraps a Spectator Id so it can be used as Scala Map. Modifications will result in a different map type being returned.
Wraps a Spectator Id so it can be used as Scala Map. Modifications will result in a different map type being returned.
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Map[String, String]trait MapOps[String, String, Map, Map[String, String]]trait Map[String, String]trait Equalstrait MapFactoryDefaults[String, String, Map, Iterable]trait MapOps[String, String, Map, Map[String, String]]trait PartialFunction[String, String]trait String => Stringtrait Iterable[(String, String)]trait Iterable[(String, String)]trait IterableFactoryDefaults[(String, String), Iterable]trait IterableOps[(String, String), Iterable, Map[String, String]]trait IterableOnceOps[(String, String), Iterable, Map[String, String]]trait IterableOnce[(String, String)]class Objecttrait Matchableclass AnyShow all
Wraps the java IdentityHashMap as an immutable scala Map. Modifications will result in a copy of the wrapped map being created and used with the new instance.
Wraps the java IdentityHashMap as an immutable scala Map. Modifications will result in a copy of the wrapped map being created and used with the new instance.
Attributes
- Companion
- object
- Supertypes
-
trait Map[K, V]trait MapOps[K, V, Map, Map[K, V]]trait Map[K, V]trait Equalstrait MapFactoryDefaults[K, V, Map, Iterable]trait MapOps[K, V, Map, Map[K, V]]trait PartialFunction[K, V]trait K => Vtrait Iterable[(K, V)]trait Iterable[(K, V)]trait IterableFactoryDefaults[(K, V), Iterable]trait IterableOps[(K, V), Iterable, Map[K, V]]trait IterableOnceOps[(K, V), Iterable, Map[K, V]]trait IterableOnce[(K, V)]class Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
IdentityMap.type
Mutable integer set based on open-addressing. Primary use-case is deduping integers so it only supports add
and foreach
.
Mutable integer set based on open-addressing. Primary use-case is deduping integers so it only supports add
and foreach
.
Value parameters
- capacity
-
Initial capacity guideline. The actual size of the underlying buffer will be the next prime >=
capacity
. Default is 10. - noData
-
Value to use to represent no data in the array. This value should not be used in the input.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
Mutable integer map based on open-addressing. Primary use-case is computing a count for the number of times a particular value was encountered.
Mutable integer map based on open-addressing. Primary use-case is computing a count for the number of times a particular value was encountered.
Value parameters
- capacity
-
Initial capacity guideline. The actual size of the underlying buffer will be the next prime >=
capacity
. Default is 10. - noData
-
Value to use to represent no data in the array. This value should not be used in the input.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
Mutable integer map based on open-addressing. Primary use-case is computing a count for the number of times a particular value was encountered.
Mutable integer map based on open-addressing. Primary use-case is computing a count for the number of times a particular value was encountered.
Value parameters
- capacity
-
Initial capacity guideline. The actual size of the underlying buffer will be the next prime >=
capacity
. Default is 10.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
Attributes
- Companion
- object
- Supertypes
- Known subtypes
-
class ConcurrentInternMap[K]class OpenHashInternMap[K]
Keeps track of canonical references for a type of object. Typically used to reduce memory overhead if an application potentially creates many copies of equal objects and will need to keep them around for some period of time.
Keeps track of canonical references for a type of object. Typically used to reduce memory overhead if an application potentially creates many copies of equal objects and will need to keep them around for some period of time.
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
class CaffeineInterner[T]trait InternMap[K]class ConcurrentInternMap[K]class OpenHashInternMap[K]class NoopInterner[T]class PredefinedInterner[T]object StringInternerShow all
Helper for parsing the variations of ISO date/time formats that are used with Atlas. Since the DateTimeFormatter doesn't have a way to check if a string matches, this class uses pattern matching to normalize to a small number of cases (with and without zone) and avoid using exceptions as the control flow.
Helper for parsing the variations of ISO date/time formats that are used with Atlas. Since the DateTimeFormatter doesn't have a way to check if a string matches, this class uses pattern matching to normalize to a small number of cases (with and without zone) and avoid using exceptions as the control flow.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
IsoDateTimeParser.type
Helper functions for working with lists.
Helper functions for working with lists.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
ListHelper.type
Mutable integer set based on open-addressing. Primary use-case is deduping integers so it only supports add
and foreach
.
Mutable integer set based on open-addressing. Primary use-case is deduping integers so it only supports add
and foreach
.
Value parameters
- capacity
-
Initial capacity guideline. The actual size of the underlying buffer will be the next prime >=
capacity
. Default is 10. - noData
-
Value to use to represent no data in the array. This value should not be used in the input.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
Mutable long to integer map based on open-addressing. Primary use-case is computing a count for the number of times a particular value was encountered.
Mutable long to integer map based on open-addressing. Primary use-case is computing a count for the number of times a particular value was encountered.
Value parameters
- capacity
-
Initial capacity guideline. The actual size of the underlying buffer will be the next prime >=
capacity
. Default is 10. - noData
-
Value to use to represent no data in the array. This value should not be used in the input.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
Does nothing, the original value will always be returned.
Does nothing, the original value will always be returned.
Attributes
- Supertypes
Interner that starts with a predefined set of values. If a request is made to intern a value that is not in the predefined list, then it will be forwarded to the specified fallback interner.
Interner that starts with a predefined set of values. If a request is made to intern a value that is not in the predefined list, then it will be forwarded to the specified fallback interner.
Attributes
- Supertypes
Mutable reference to double map based on open-addressing. Primary use-case is computing an aggregate double value based on a key.
Mutable reference to double map based on open-addressing. Primary use-case is computing an aggregate double value based on a key.
Value parameters
- capacity
-
Initial capacity guideline. The actual size of the underlying buffer will be the next prime >=
capacity
. Default is 10.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
Mutable reference to integer map based on open-addressing. Primary use-case is computing a count for the number of times a particular value was encountered.
Mutable reference to integer map based on open-addressing. Primary use-case is computing a count for the number of times a particular value was encountered.
Value parameters
- capacity
-
Initial capacity guideline. The actual size of the underlying buffer will be the next prime >=
capacity
. Default is 10.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
Interval that moves over time in increments of a given unit. When in the middle of a unit it will round to the next even boundary. For example, if the unit is HOURS and it is 10:37, then it will round too 11:00.
Interval that moves over time in increments of a given unit. When in the middle of a unit it will round to the next even boundary. For example, if the unit is HOURS and it is 10:37, then it will round too 11:00.
The offset and duration must be an even multiple of the unit.
Value parameters
- duration
-
The length of the interval. The start time is
now - offset - duration
. - offset
-
Offset subtracted from the current time,
now - offset
is used as the end time for this interval. - unit
-
The unit to use when moving along. This is typically HOURS or DAYS.
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
RollingInterval.type
Utility functions for mapping ids or indices to a shard. For our purposes, a shard is an instance with a set of server groups. The union of data from all groups comprises a full copy of the overall dataset. To allow for smaller deployment units, an individual group or subset of the groups can be replicated. For redundancy, groups could be replicated all the time. At Netflix, we typically replicate the overall set of server groups in another region or zone instead.
Utility functions for mapping ids or indices to a shard. For our purposes, a shard is an instance with a set of server groups. The union of data from all groups comprises a full copy of the overall dataset. To allow for smaller deployment units, an individual group or subset of the groups can be replicated. For redundancy, groups could be replicated all the time. At Netflix, we typically replicate the overall set of server groups in another region or zone instead.
This class specifically focuses on relatively simple sharding schemes where the component making the decision only needs to know the set of instances and a slot for each instance. Edda is one example of a system that provides this information for AWS auto-scaling groups. More complex sharding schemes that require additional infrastructure, e.g, zookeeper, are out of scope here. There are two sharding modes supported by this class:
-
Mapping an id for a tagged item to a shard. This is typically done while data is flowing into the system and each datapoint can be routed based on the id.
-
Mapping an positional index to a shard. This is typically done for loading data that has been processed via Hadoop or similar tools and stored in a fixed number of files. There should be a manifest with an order list of the files for a given time and the position can be used to map to a shard. When using this approach it is recommended to use a highly composite number for the number of files. This makes it easier to pick a number of groups and sizes for the groups such that each instance will get the same number of files.
When mapping this to AWS an overall deployment is typically a set of auto-scaling groups (ASG). Each instance should get the same amount of data if possible given the set of files. Deployments are typically done as a red/black push of one ASG at a time. So the amount of additional capacity during a push is the size of one of these groups if deployments across the groups are performed serially. While multiple ASGs for a particular group are active the data will be replicated across them.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Shards.type
Attributes
- Companion
- class
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
SmallHashMap.type
Simple immutable hash map implementation intended for use-cases where the number of entries is known to be small. This implementation is backed by a single array and uses open addressing with linear probing to resolve conflicts. The underlying array is created to exactly fit the data size so hash collisions tend to be around 50%, but have a fairly low number of probes to find the actual entry. With a cheap equals function for the keys lookups should be fast and there is low memory overhead.
Simple immutable hash map implementation intended for use-cases where the number of entries is known to be small. This implementation is backed by a single array and uses open addressing with linear probing to resolve conflicts. The underlying array is created to exactly fit the data size so hash collisions tend to be around 50%, but have a fairly low number of probes to find the actual entry. With a cheap equals function for the keys lookups should be fast and there is low memory overhead.
You probably don't want to use this implementation if you expect more than around 50 keys in the map. If you have millions of small immutable maps, such as tag data associated with metrics, it may be a good fit.
Value parameters
- data
-
array with the items
- dataLength
-
number of pairs contained within the array starting at index 0.
Attributes
- Companion
- object
- Supertypes
-
trait Map[K, V]trait MapOps[K, V, Map, Map[K, V]]trait Map[K, V]trait Equalstrait MapFactoryDefaults[K, V, Map, Iterable]trait MapOps[K, V, Map, Map[K, V]]trait PartialFunction[K, V]trait K => Vtrait Iterable[(K, V)]trait Iterable[(K, V)]trait IterableFactoryDefaults[(K, V), Iterable]trait IterableOps[(K, V), Iterable, Map[K, V]]trait IterableOnceOps[(K, V), Iterable, Map[K, V]]trait IterableOnce[(K, V)]class Objecttrait Matchableclass AnyShow all
Immutable map implementation for tag maps using a sorted array as the underlying storage.
Immutable map implementation for tag maps using a sorted array as the underlying storage.
Attributes
- Companion
- object
- Supertypes
-
trait Comparable[SortedTagMap]trait Map[String, String]trait MapOps[String, String, Map, Map[String, String]]trait Map[String, String]trait Equalstrait MapFactoryDefaults[String, String, Map, Iterable]trait MapOps[String, String, Map, Map[String, String]]trait PartialFunction[String, String]trait String => Stringtrait Iterable[(String, String)]trait Iterable[(String, String)]trait IterableFactoryDefaults[(String, String), Iterable]trait IterableOps[(String, String), Iterable, Map[String, String]]trait IterableOnceOps[(String, String), Iterable, Map[String, String]]trait IterableOnce[(String, String)]class Objecttrait Matchableclass AnyShow all
Helper functions for working with sorted tag maps.
Helper functions for working with sorted tag maps.
Attributes
- Companion
- class
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
SortedTagMap.type
Utilities for computing and rounding times based on the step size for a dataset.
Utilities for computing and rounding times based on the step size for a dataset.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Step.type
Delegate to String.intern()
.
Helper functions for working with strings.
Helper functions for working with strings.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Strings.type
Sine function based on timestamps. The sine values will be pre-computed for a single wavelength and then looked up for all others. This can be significantly faster than using the sine function directly for longer spans.
Sine function based on timestamps. The sine values will be pre-computed for a single wavelength and then looked up for all others. This can be significantly faster than using the sine function directly for longer spans.
Value parameters
- step
-
How often to compute the sine value within the wavelength.
- wavelength
-
Span of time for the repeating pattern of the wave.
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait Long => Doubleclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
UnitPrefix.type
Common prefixes used for units or human readable strings.
Common prefixes used for units or human readable strings.
Value parameters
- factor
-
the multiplication factor for the prefix
- symbol
-
the symbol shown for the prefix
- text
-
text for the prefix
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all