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

dev.vality.woody.api.generator.ConfiguredSnowflakeIdGenerator Maven / Gradle / Ivy

There is a newer version: 2.0.8
Show newest version
package dev.vality.woody.api.generator;

public class ConfiguredSnowflakeIdGenerator extends SnowflakeIdGenerator {
    public static final String NODE_ID_ENV_PARAM = "woody.node_id";

    public ConfiguredSnowflakeIdGenerator() {
        super(getNodeIdParam());
    }

    public ConfiguredSnowflakeIdGenerator(String suffix) {
        super(suffix, getNodeIdParam());
    }

    private static long getNodeIdParam() {
        return Long.parseLong(System.getProperty(NODE_ID_ENV_PARAM, "-1"));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy