Search in sources :

Example 1 with ClusterIdGenerator

use of com.ctrip.framework.dal.cluster.client.sharding.idgen.ClusterIdGenerator in project dal by ctripcorp.

the class ClusterIdGeneratorConfigAdapter method getIdGenerator.

@Override
public IdGenerator getIdGenerator(String name) {
    ClusterIdGeneratorConfig idGeneratorConfig = getIdGeneratorConfig();
    if (idGeneratorConfig == null)
        return null;
    ClusterIdGenerator idGenerator = idGeneratorConfig.getIdGenerator(name);
    if (idGenerator instanceof IdGenerator)
        return (IdGenerator) idGenerator;
    return null;
}
Also used : ClusterIdGeneratorConfig(com.ctrip.framework.dal.cluster.client.sharding.idgen.ClusterIdGeneratorConfig) ClusterIdGenerator(com.ctrip.framework.dal.cluster.client.sharding.idgen.ClusterIdGenerator) ClusterIdGenerator(com.ctrip.framework.dal.cluster.client.sharding.idgen.ClusterIdGenerator)

Aggregations

ClusterIdGenerator (com.ctrip.framework.dal.cluster.client.sharding.idgen.ClusterIdGenerator)1 ClusterIdGeneratorConfig (com.ctrip.framework.dal.cluster.client.sharding.idgen.ClusterIdGeneratorConfig)1