Index
All Classes and Interfaces|All Packages|Serialized Form
C
- ClockMovedBackwardsException - Exception Class in com.fayupable.snowflake.exception
-
Thrown when the clock source reports a time earlier than the last generated id's timestamp.
- ClockMovedBackwardsException(long, long) - Constructor for exception class com.fayupable.snowflake.exception.ClockMovedBackwardsException
- ClockSource - Interface in com.fayupable.snowflake.port
-
Output port that abstracts the current time source.
- com.fayupable.snowflake - package com.fayupable.snowflake
- com.fayupable.snowflake.config - package com.fayupable.snowflake.config
- com.fayupable.snowflake.exception - package com.fayupable.snowflake.exception
- com.fayupable.snowflake.jpa - package com.fayupable.snowflake.jpa
- com.fayupable.snowflake.jpaspring - package com.fayupable.snowflake.jpaspring
- com.fayupable.snowflake.port - package com.fayupable.snowflake.port
D
- defaultConfig(long, long) - Static method in record class com.fayupable.snowflake.config.SnowflakeConfig
E
- epoch() - Method in record class com.fayupable.snowflake.config.SnowflakeConfig
-
Returns the value of the
epochrecord component. - equals(Object) - Method in record class com.fayupable.snowflake.config.SnowflakeConfig
-
Indicates whether some other object is "equal to" this one.
- equals(Object) - Method in record class com.fayupable.snowflake.SnowflakeId
-
Indicates whether some other object is "equal to" this one.
F
- fromLong(long, SnowflakeConfig) - Static method in record class com.fayupable.snowflake.SnowflakeId
G
- generate(SharedSessionContractImplementor, Object) - Method in class com.fayupable.snowflake.jpa.SnowflakeIdentifierGenerator
-
Produces the next id for an entity about to be inserted.
- getEpoch() - Method in class com.fayupable.snowflake.jpaspring.SnowflakeProperties
- getInstance() - Static method in class com.fayupable.snowflake.jpa.SnowflakeIdGeneratorHolder
-
Returns the currently registered
IdGenerator. - getNodeId() - Method in class com.fayupable.snowflake.jpaspring.SnowflakeProperties
H
- hashCode() - Method in record class com.fayupable.snowflake.config.SnowflakeConfig
-
Returns a hash code value for this object.
- hashCode() - Method in record class com.fayupable.snowflake.SnowflakeId
-
Returns a hash code value for this object.
I
- idGenerator(SnowflakeProperties, ObjectProvider<MeterRegistry>) - Method in class com.fayupable.snowflake.jpaspring.SnowflakeAutoConfiguration
-
Creates the singleton
IdGeneratorfor this application instance and registers it withSnowflakeIdGeneratorHolderso that@SnowflakeGeneratedId-annotated entity fields can be populated by Hibernate. - IdGenerator - Interface in com.fayupable.snowflake.port
-
Input port for generating unique identifiers.
- INSTANCE - Static variable in class com.fayupable.snowflake.NoOpSnowflakeMetrics
M
- maxSequence() - Method in record class com.fayupable.snowflake.config.SnowflakeConfig
- MicrometerSnowflakeMetrics - Class in com.fayupable.snowflake.jpaspring
-
Publishes generator activity as Micrometer counters, so it shows up in whatever backend the application already has configured (Prometheus, Grafana, or nothing at all if no registry is wired).
- MicrometerSnowflakeMetrics(MeterRegistry) - Constructor for class com.fayupable.snowflake.jpaspring.MicrometerSnowflakeMetrics
- millis() - Method in interface com.fayupable.snowflake.port.ClockSource
- millis() - Method in class com.fayupable.snowflake.SystemClock
N
- nextId() - Method in interface com.fayupable.snowflake.port.IdGenerator
- nextId() - Method in class com.fayupable.snowflake.SnowflakeIdGenerator
- nodeBits() - Method in record class com.fayupable.snowflake.config.SnowflakeConfig
-
Returns the value of the
nodeBitsrecord component. - nodeId() - Method in record class com.fayupable.snowflake.config.SnowflakeConfig
-
Returns the value of the
nodeIdrecord component. - nodeId() - Method in record class com.fayupable.snowflake.SnowflakeId
-
Returns the value of the
nodeIdrecord component. - nodeShift() - Method in record class com.fayupable.snowflake.config.SnowflakeConfig
- NoOpSnowflakeMetrics - Class in com.fayupable.snowflake
-
Default
SnowflakeMetricsimplementation that discards every event.
R
- recordIdGenerated() - Method in class com.fayupable.snowflake.jpaspring.MicrometerSnowflakeMetrics
- recordIdGenerated() - Method in class com.fayupable.snowflake.NoOpSnowflakeMetrics
- recordIdGenerated() - Method in interface com.fayupable.snowflake.port.SnowflakeMetrics
-
Called every time
nextId()successfully produces an id. - recordSpinWait() - Method in class com.fayupable.snowflake.jpaspring.MicrometerSnowflakeMetrics
- recordSpinWait() - Method in class com.fayupable.snowflake.NoOpSnowflakeMetrics
- recordSpinWait() - Method in interface com.fayupable.snowflake.port.SnowflakeMetrics
-
Called every time the generator spins waiting for the clock to advance because the current millisecond's sequence capacity is exhausted.
- reset() - Static method in class com.fayupable.snowflake.jpa.SnowflakeIdGeneratorHolder
-
Clears the held instance so it does not leak across independent test contexts.
S
- sequence() - Method in record class com.fayupable.snowflake.SnowflakeId
-
Returns the value of the
sequencerecord component. - sequenceBits() - Method in record class com.fayupable.snowflake.config.SnowflakeConfig
-
Returns the value of the
sequenceBitsrecord component. - setEpoch(Instant) - Method in class com.fayupable.snowflake.jpaspring.SnowflakeProperties
- setInstance(IdGenerator) - Static method in class com.fayupable.snowflake.jpa.SnowflakeIdGeneratorHolder
-
Registers the
IdGeneratorthatSnowflakeIdGeneratorHolder.getInstance()will return. - setNodeId(long) - Method in class com.fayupable.snowflake.jpaspring.SnowflakeProperties
- SnowflakeAutoConfiguration - Class in com.fayupable.snowflake.jpaspring
-
Wires a Spring-managed
IdGeneratorfromSnowflakePropertiesand publishes it toSnowflakeIdGeneratorHolder, since Hibernate instantiatesSnowflakeIdentifierGeneratorvia reflection and never asks theApplicationContextfor it. - SnowflakeAutoConfiguration() - Constructor for class com.fayupable.snowflake.jpaspring.SnowflakeAutoConfiguration
- SnowflakeConfig - Record Class in com.fayupable.snowflake.config
-
Configuration for the Snowflake id layout.
- SnowflakeConfig(long, long, int, int, int) - Constructor for record class com.fayupable.snowflake.config.SnowflakeConfig
-
Creates an instance of a
SnowflakeConfigrecord class. - SnowflakeGeneratedId - Annotation Interface in com.fayupable.snowflake.jpa
-
Marks a JPA id field or property as generated by the Snowflake algorithm.
- SnowflakeId - Record Class in com.fayupable.snowflake
-
Value object representing a generated Snowflake id decomposed into its parts.
- SnowflakeId(long, long, long, long) - Constructor for record class com.fayupable.snowflake.SnowflakeId
-
Creates an instance of a
SnowflakeIdrecord class. - SnowflakeIdentifierGenerator - Class in com.fayupable.snowflake.jpa
-
Hibernate
IdentifierGeneratorthat delegates id generation to whateverIdGeneratoris registered inSnowflakeIdGeneratorHolder. - SnowflakeIdentifierGenerator() - Constructor for class com.fayupable.snowflake.jpa.SnowflakeIdentifierGenerator
- SnowflakeIdGenerator - Class in com.fayupable.snowflake
-
Thread-safe Snowflake id generator.
- SnowflakeIdGenerator(SnowflakeConfig, ClockSource) - Constructor for class com.fayupable.snowflake.SnowflakeIdGenerator
- SnowflakeIdGenerator(SnowflakeConfig, ClockSource, SnowflakeMetrics) - Constructor for class com.fayupable.snowflake.SnowflakeIdGenerator
- SnowflakeIdGeneratorHolder - Class in com.fayupable.snowflake.jpa
-
Static bridge between a Spring/DI-managed
IdGeneratorand Hibernate, which instantiatesSnowflakeIdentifierGeneratorvia reflection and never consults the dependency injection container. - SnowflakeMetrics - Interface in com.fayupable.snowflake.port
-
Output port for observing generator activity.
- SnowflakeProperties - Class in com.fayupable.snowflake.jpaspring
-
Binds to the
snowflakeprefix inapplication.yml/application.properties. - SnowflakeProperties() - Constructor for class com.fayupable.snowflake.jpaspring.SnowflakeProperties
- SystemClock - Class in com.fayupable.snowflake
-
Production adapter for ClockSource, backed by the system clock.
- SystemClock() - Constructor for class com.fayupable.snowflake.SystemClock
T
- timestamp() - Method in record class com.fayupable.snowflake.SnowflakeId
-
Returns the value of the
timestamprecord component. - timestampBits() - Method in record class com.fayupable.snowflake.config.SnowflakeConfig
-
Returns the value of the
timestampBitsrecord component. - timestampShift() - Method in record class com.fayupable.snowflake.config.SnowflakeConfig
- toString() - Method in record class com.fayupable.snowflake.config.SnowflakeConfig
-
Returns a string representation of this record class.
- toString() - Method in record class com.fayupable.snowflake.SnowflakeId
-
Returns a string representation of this record class.
V
- value() - Method in record class com.fayupable.snowflake.SnowflakeId
-
Returns the value of the
valuerecord component.
All Classes and Interfaces|All Packages|Serialized Form