package cn.superdesk.uniorder.common.lock.zookeeper.config;


import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;


/**
 * @Description: zookeeper:
 * servers: localhost:2181,localhost:2182 # 换成自己的环境
 * lockPath: /lock/ # 指定分布式锁路径
 * sessionTimeoutMs: 60000 # session超时时间
 * connectionTimeoutMs: 5000 # 连接超时时间
 * retryCount: 5 # 尝试获取锁最大重试次数
 * elapsedTimeMs: 1000 # 重试间隔时间
 * @Author: linjinyu
 * @CreateDate: 2020/12/3 下午12:19
 * @UpdateUser: linjinyu
 * @UpdateDate: 2020/12/3 下午12:19
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
@Data
@Component
@ConfigurationProperties(prefix = "zookeeper")
public class ZookeeperConfigurer {

	/**
	 * 尝试次数
	 */
	private int retryCount;

	/**
	 * 重试间隔时间
	 */
	private int elapsedTimeMs;

	/**
	 * session超时时间
	 */
	private int sessionTimeoutMs;

	/**
	 * 连接超时时间
	 */
	private int connectionTimeoutMs;

	/**
	 * zookeeper集群地址
	 */
	private String servers;

	/**
	 * zookeeper分布式锁跟路径
	 */
	private String lockPath;
}
