以下是IdUtil源码里边的几行代码,为什么是n < 8,跟8有什么关系
if (matcher.matches()) {
long n = Long.parseLong(matcher.group(1));
if (n >= 0 && n < 8) {
logger.info("detect server id from host name {}: {}.", hostname, n);
return n;
}
同问,为什么是8,而不是31
Sign in to make a reply
和36224
以下是IdUtil源码里边的几行代码,为什么是n < 8,跟8有什么关系
if (matcher.matches()) {
long n = Long.parseLong(matcher.group(1));
if (n >= 0 && n < 8) {
logger.info("detect server id from host name {}: {}.", hostname, n);
return n;
}
}