修改 IdWorker#generateWorkerIdBaseOnMac 的注释
This commit is contained in:
@@ -161,7 +161,7 @@ public class IdWorker {
|
|||||||
* use lowest 10 bit of available MAC as workerId
|
* use lowest 10 bit of available MAC as workerId
|
||||||
* @return workerId
|
* @return workerId
|
||||||
* @throws SocketException
|
* @throws SocketException
|
||||||
* @throws Exception when there is no available mac found
|
* @throws NoAvailableMacFoundException when there is no available mac found
|
||||||
*/
|
*/
|
||||||
private static long generateWorkerIdBaseOnMac() throws SocketException, NoAvailableMacFoundException {
|
private static long generateWorkerIdBaseOnMac() throws SocketException, NoAvailableMacFoundException {
|
||||||
Enumeration<NetworkInterface> all = NetworkInterface.getNetworkInterfaces();
|
Enumeration<NetworkInterface> all = NetworkInterface.getNetworkInterfaces();
|
||||||
@@ -185,4 +185,4 @@ public class IdWorker {
|
|||||||
private static long generateRandomWorkerId() {
|
private static long generateRandomWorkerId() {
|
||||||
return ThreadLocalRandom.current().nextInt(MAX_WORKER_ID + 1);
|
return ThreadLocalRandom.current().nextInt(MAX_WORKER_ID + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user