跳过导航链接
A B C D E G H I N P R S T U V W 

A

addWorkerNode(WorkerNodeEntity) - 接口 中的方法top.tangyh.basic.uid.dao.WorkerNodeDao
afterPropertiesSet() - 类 中的方法com.baidu.fsg.uid.impl.CachedUidGenerator
 
afterPropertiesSet() - 类 中的方法com.baidu.fsg.uid.impl.DefaultUidGenerator
 
allocate(long, long, long) - 类 中的方法com.baidu.fsg.uid.BitsAllocator
这里就是把不同的字段放到相应的位上 id的总体结构是: sign (fixed 1bit) -> deltaSecond -> workerId -> sequence(within the same second) deltaSecond 左移(workerIdBits + sequenceBits)位,workerId左移sequenceBits位,此时就完成了字节的分配 Allocate bits for UID according to delta seconds & workerId & sequence
Note that: The highest bit will always be 0 for sign
assignWorkerId() - 类 中的方法com.baidu.fsg.uid.worker.DisposableWorkerIdAssigner
Assign worker id base on database.
assignWorkerId() - 接口 中的方法com.baidu.fsg.uid.worker.WorkerIdAssigner
Assign worker id for DefaultUidGenerator
asyncPadding() - 类 中的方法com.baidu.fsg.uid.buffer.BufferPaddingExecutor
Padding buffer in the thread pool

B

BitsAllocator - com.baidu.fsg.uid中的类
对SnowFlake 的ID进行位操作的共聚类 为UID分配64位(long)
sign (fixed 1bit) -> deltaSecond -> workerId -> sequence(within the same second)
BitsAllocator(int, int, int) - 类 的构造器com.baidu.fsg.uid.BitsAllocator
Constructor with timestampBits, workerIdBits, sequenceBits
The highest bit used for sign, so 63 bits for timestampBits, workerIdBits, sequenceBits
BufferedUidProvider - com.baidu.fsg.uid.buffer中的接口
Buffered UID provider(Lambda supported), which provides UID in the same one second
BufferPaddingExecutor - com.baidu.fsg.uid.buffer中的类
Represents an executor for padding RingBuffer
There are two kinds of executors: one for scheduled padding, the other for padding immediately.
BufferPaddingExecutor(RingBuffer, BufferedUidProvider) - 类 的构造器com.baidu.fsg.uid.buffer.BufferPaddingExecutor
Constructor with RingBuffer and BufferedUidProvider, default use schedule
BufferPaddingExecutor(RingBuffer, BufferedUidProvider, boolean) - 类 的构造器com.baidu.fsg.uid.buffer.BufferPaddingExecutor
Constructor with RingBuffer, BufferedUidProvider, and whether use schedule padding

C

CachedUidGenerator - com.baidu.fsg.uid.impl中的类
Represents a cached implementation of UidGenerator extends from DefaultUidGenerator, based on a lock free RingBuffer The spring properties you can specified as below:
boostPower: RingBuffer size boost for a power of 2, Sample: boostPower is 3, it means the buffer size will be (BitsAllocator.getMaxSequence() + 1) << CachedUidGenerator.boostPower, Default as paddingFactor: Represents a percent value of (0 - 100).
CachedUidGenerator() - 类 的构造器com.baidu.fsg.uid.impl.CachedUidGenerator
 
calSlotIndex(long) - 类 中的方法com.baidu.fsg.uid.buffer.RingBuffer
Calculate slot index with the slot sequence (sequence % bufferSize)
com.baidu.fsg.uid - 程序包 com.baidu.fsg.uid
 
com.baidu.fsg.uid.buffer - 程序包 com.baidu.fsg.uid.buffer
 
com.baidu.fsg.uid.exception - 程序包 com.baidu.fsg.uid.exception
 
com.baidu.fsg.uid.impl - 程序包 com.baidu.fsg.uid.impl
 
com.baidu.fsg.uid.utils - 程序包 com.baidu.fsg.uid.utils
 
com.baidu.fsg.uid.worker - 程序包 com.baidu.fsg.uid.worker
 
com.baidu.fsg.uid.worker.entity - 程序包 com.baidu.fsg.uid.worker.entity
 

D

DEFAULT_PADDING_PERCENT - 类 中的静态变量com.baidu.fsg.uid.buffer.RingBuffer
 
DefaultUidGenerator - com.baidu.fsg.uid.impl中的类
Represents an implementation of UidGenerator The unique id has 64bits (long), default allocated as blow:
sign: The highest bit is 0 delta seconds: The next 28 bits, represents delta seconds since a customer epoch(2016-05-20 00:00:00.000).
DefaultUidGenerator() - 类 的构造器com.baidu.fsg.uid.impl.DefaultUidGenerator
 
destroy() - 类 中的方法com.baidu.fsg.uid.impl.CachedUidGenerator
 
discardPutBuffer(RingBuffer, long) - 类 中的方法com.baidu.fsg.uid.buffer.RingBuffer
Discard policy for RejectedPutBufferHandler, we just do logging
DisposableWorkerIdAssigner - com.baidu.fsg.uid.worker中的类
Represents an implementation of WorkerIdAssigner, the worker id will be discarded after assigned to the UidGenerator 基于DB自增的worker id 分配器的实现 SnowFlake中,deltaSeconds依赖时间戳,可以通过系统获取;sequence可以通过自增来控制;这俩字段都是项目可以自给自足的,而WorkerId则必须还有一个策略来提供。
DisposableWorkerIdAssigner() - 类 的构造器com.baidu.fsg.uid.worker.DisposableWorkerIdAssigner
 
DockerUtils - com.baidu.fsg.uid.utils中的类
DockerUtils

E

exceptionRejectedTakeBuffer(RingBuffer) - 类 中的方法com.baidu.fsg.uid.buffer.RingBuffer
Policy for RejectedTakeBufferHandler, throws RuntimeException after logging

G

getBufferSize() - 类 中的方法com.baidu.fsg.uid.buffer.RingBuffer
 
getCreated() - 类 中的方法com.baidu.fsg.uid.worker.entity.WorkerNodeEntity
 
getCursor() - 类 中的方法com.baidu.fsg.uid.buffer.RingBuffer
 
getDockerHost() - 类 中的静态方法com.baidu.fsg.uid.utils.DockerUtils
Retrieve docker host
getDockerPort() - 类 中的静态方法com.baidu.fsg.uid.utils.DockerUtils
Retrieve docker port
getHostName() - 类 中的方法com.baidu.fsg.uid.worker.entity.WorkerNodeEntity
 
getId() - 类 中的方法com.baidu.fsg.uid.worker.entity.WorkerNodeEntity
Getters & Setters
getLaunchDate() - 类 中的方法com.baidu.fsg.uid.worker.entity.WorkerNodeEntity
 
getLocalAddress() - 类 中的静态方法com.baidu.fsg.uid.utils.NetUtils
Retrieve local address
getLocalInetAddress() - 类 中的静态方法com.baidu.fsg.uid.utils.NetUtils
Retrieve the first validated local ip address(the Public and LAN ip addresses are validated).
getMaxDeltaSeconds() - 类 中的方法com.baidu.fsg.uid.BitsAllocator
 
getMaxSequence() - 类 中的方法com.baidu.fsg.uid.BitsAllocator
 
getMaxWorkerId() - 类 中的方法com.baidu.fsg.uid.BitsAllocator
 
getModified() - 类 中的方法com.baidu.fsg.uid.worker.entity.WorkerNodeEntity
 
getName() - 类 中的方法com.baidu.fsg.uid.utils.NamingThreadFactory
Getters & Setters
getPort() - 类 中的方法com.baidu.fsg.uid.worker.entity.WorkerNodeEntity
 
getSequenceBits() - 类 中的方法com.baidu.fsg.uid.BitsAllocator
 
getSignBits() - 类 中的方法com.baidu.fsg.uid.BitsAllocator
Getters
getTail() - 类 中的方法com.baidu.fsg.uid.buffer.RingBuffer
Getters
getTimestampBits() - 类 中的方法com.baidu.fsg.uid.BitsAllocator
 
getTimestampShift() - 类 中的方法com.baidu.fsg.uid.BitsAllocator
 
getType() - 类 中的方法com.baidu.fsg.uid.worker.entity.WorkerNodeEntity
 
getUid() - 类 中的方法com.baidu.fsg.uid.impl.CachedUidGenerator
 
getUid() - 类 中的方法com.baidu.fsg.uid.impl.DefaultUidGenerator
 
getUid() - 类 中的方法com.baidu.fsg.uid.impl.HuToolUidGenerator
 
getUid() - 接口 中的方法com.baidu.fsg.uid.UidGenerator
Get a unique ID
getUncaughtExceptionHandler() - 类 中的方法com.baidu.fsg.uid.utils.NamingThreadFactory
 
getWorkerIdBits() - 类 中的方法com.baidu.fsg.uid.BitsAllocator
 
getWorkerIdShift() - 类 中的方法com.baidu.fsg.uid.BitsAllocator
 

H

HuToolUidGenerator - com.baidu.fsg.uid.impl中的类
基于Hu tool 工具类实现的雪花id生成器
HuToolUidGenerator(long, long) - 类 的构造器com.baidu.fsg.uid.impl.HuToolUidGenerator
 

I

isDaemon() - 类 中的方法com.baidu.fsg.uid.utils.NamingThreadFactory
 
isDocker() - 类 中的静态方法com.baidu.fsg.uid.utils.DockerUtils
Whether a docker
isRunning() - 类 中的方法com.baidu.fsg.uid.buffer.BufferPaddingExecutor
Whether is padding

N

NamingThreadFactory - com.baidu.fsg.uid.utils中的类
Named thread in ThreadFactory.
NamingThreadFactory() - 类 的构造器com.baidu.fsg.uid.utils.NamingThreadFactory
Constructors
NamingThreadFactory(String) - 类 的构造器com.baidu.fsg.uid.utils.NamingThreadFactory
 
NamingThreadFactory(String, boolean) - 类 的构造器com.baidu.fsg.uid.utils.NamingThreadFactory
 
NamingThreadFactory(String, boolean, Thread.UncaughtExceptionHandler) - 类 的构造器com.baidu.fsg.uid.utils.NamingThreadFactory
 
NetUtils - com.baidu.fsg.uid.utils中的类
NetUtils
newThread(Runnable) - 类 中的方法com.baidu.fsg.uid.utils.NamingThreadFactory
 
nextId() - 类 中的方法com.baidu.fsg.uid.impl.DefaultUidGenerator
Get UID
nextIdsForOneSecond(long) - 类 中的方法com.baidu.fsg.uid.impl.CachedUidGenerator
Get the UIDs in the same specified second under the max sequence

P

PaddedAtomicLong - com.baidu.fsg.uid.utils中的类
Represents a padded AtomicLong to prevent the FalseSharing problem The CPU cache line commonly be 64 bytes, here is a sample of cache line after padding:
64 bytes = 8 bytes (object reference) + 6 * 8 bytes (padded long) + 8 bytes (a long value)
PaddedAtomicLong() - 类 的构造器com.baidu.fsg.uid.utils.PaddedAtomicLong
Constructors from AtomicLong
PaddedAtomicLong(long) - 类 的构造器com.baidu.fsg.uid.utils.PaddedAtomicLong
 
paddingBuffer() - 类 中的方法com.baidu.fsg.uid.buffer.BufferPaddingExecutor
Padding buffer fill the slots until to catch the cursor
parseUid(long) - 类 中的方法com.baidu.fsg.uid.impl.DefaultUidGenerator
 
parseUid(long) - 类 中的方法com.baidu.fsg.uid.impl.HuToolUidGenerator
 
parseUid(long) - 接口 中的方法com.baidu.fsg.uid.UidGenerator
Parse the UID into elements which are used to generate the UID.
provide(long) - 接口 中的方法com.baidu.fsg.uid.buffer.BufferedUidProvider
Provides UID in one second
put(long) - 类 中的方法com.baidu.fsg.uid.buffer.RingBuffer
Put an UID in the ring & tail moved
We use 'synchronized' to guarantee the UID fill in slot & publish new tail sequence as atomic operations
Note that: It is recommended to put UID in a serialize way, cause we once batch generate a series UIDs and put the one by one into the buffer, so it is unnecessary put in multi-threads

R

RejectedPutBufferHandler - com.baidu.fsg.uid.buffer中的接口
If tail catches the cursor it means that the ring buffer is full, any more buffer put request will be rejected.
RejectedTakeBufferHandler - com.baidu.fsg.uid.buffer中的接口
If cursor catches the tail it means that the ring buffer is empty, any more buffer take request will be rejected.
rejectPutBuffer(RingBuffer, long) - 接口 中的方法com.baidu.fsg.uid.buffer.RejectedPutBufferHandler
Reject put buffer request
rejectTakeBuffer(RingBuffer) - 接口 中的方法com.baidu.fsg.uid.buffer.RejectedTakeBufferHandler
Reject take buffer request
RingBuffer - com.baidu.fsg.uid.buffer中的类
Represents a ring buffer based on array.
RingBuffer(int) - 类 的构造器com.baidu.fsg.uid.buffer.RingBuffer
Constructor with buffer size, paddingFactor default as 50
RingBuffer(int, int) - 类 的构造器com.baidu.fsg.uid.buffer.RingBuffer
Constructor with buffer size & padding factor

S

setBoostPower(int) - 类 中的方法com.baidu.fsg.uid.impl.CachedUidGenerator
Setters for spring property
setBufferPaddingExecutor(BufferPaddingExecutor) - 类 中的方法com.baidu.fsg.uid.buffer.RingBuffer
Setters
setCreated(Date) - 类 中的方法com.baidu.fsg.uid.worker.entity.WorkerNodeEntity
 
setDaemon(boolean) - 类 中的方法com.baidu.fsg.uid.utils.NamingThreadFactory
 
setEpochStr(String) - 类 中的方法com.baidu.fsg.uid.impl.DefaultUidGenerator
 
setHostName(String) - 类 中的方法com.baidu.fsg.uid.worker.entity.WorkerNodeEntity
 
setId(long) - 类 中的方法com.baidu.fsg.uid.worker.entity.WorkerNodeEntity
 
setLaunchDateDate(Date) - 类 中的方法com.baidu.fsg.uid.worker.entity.WorkerNodeEntity
 
setModified(Date) - 类 中的方法com.baidu.fsg.uid.worker.entity.WorkerNodeEntity
 
setName(String) - 类 中的方法com.baidu.fsg.uid.utils.NamingThreadFactory
 
setPort(String) - 类 中的方法com.baidu.fsg.uid.worker.entity.WorkerNodeEntity
 
setRejectedPutBufferHandler(RejectedPutBufferHandler) - 类 中的方法com.baidu.fsg.uid.impl.CachedUidGenerator
 
setRejectedPutHandler(RejectedPutBufferHandler) - 类 中的方法com.baidu.fsg.uid.buffer.RingBuffer
 
setRejectedTakeBufferHandler(RejectedTakeBufferHandler) - 类 中的方法com.baidu.fsg.uid.impl.CachedUidGenerator
 
setRejectedTakeHandler(RejectedTakeBufferHandler) - 类 中的方法com.baidu.fsg.uid.buffer.RingBuffer
 
setScheduleInterval(long) - 类 中的方法com.baidu.fsg.uid.buffer.BufferPaddingExecutor
Setters
setScheduleInterval(Long) - 类 中的方法com.baidu.fsg.uid.impl.CachedUidGenerator
 
setSeqBits(int) - 类 中的方法com.baidu.fsg.uid.impl.DefaultUidGenerator
 
setTimeBits(int) - 类 中的方法com.baidu.fsg.uid.impl.DefaultUidGenerator
 
setType(int) - 类 中的方法com.baidu.fsg.uid.worker.entity.WorkerNodeEntity
 
setUncaughtExceptionHandler(Thread.UncaughtExceptionHandler) - 类 中的方法com.baidu.fsg.uid.utils.NamingThreadFactory
 
setWorkerBits(int) - 类 中的方法com.baidu.fsg.uid.impl.DefaultUidGenerator
 
setWorkerIdAssigner(WorkerIdAssigner) - 类 中的方法com.baidu.fsg.uid.impl.DefaultUidGenerator
Setters for spring property
shutdown() - 类 中的方法com.baidu.fsg.uid.buffer.BufferPaddingExecutor
Shutdown executors
start() - 类 中的方法com.baidu.fsg.uid.buffer.BufferPaddingExecutor
Start executors such as schedule
sumPaddingToPreventOptimization() - 类 中的方法com.baidu.fsg.uid.utils.PaddedAtomicLong
To prevent GC optimizations for cleaning unused padded references

T

take() - 类 中的方法com.baidu.fsg.uid.buffer.RingBuffer
Take an UID of the ring at the next cursor, this is a lock free operation by using atomic cursor Before getting the UID, we also check whether reach the padding threshold, the padding buffer operation will be triggered in another thread
If there is no more available UID to be taken, the specified RejectedTakeBufferHandler will be applied
top.tangyh.basic.uid.dao - 程序包 top.tangyh.basic.uid.dao
 
toString() - 类 中的方法com.baidu.fsg.uid.BitsAllocator
 
toString() - 类 中的方法com.baidu.fsg.uid.buffer.RingBuffer
 
toString() - 类 中的方法com.baidu.fsg.uid.worker.entity.WorkerNodeEntity
 
TOTAL_BITS - 类 中的静态变量com.baidu.fsg.uid.BitsAllocator
Total 64 bits

U

UidGenerateException - com.baidu.fsg.uid.exception中的异常错误
UidGenerateException
UidGenerateException() - 异常错误 的构造器com.baidu.fsg.uid.exception.UidGenerateException
Default constructor
UidGenerateException(String, Throwable) - 异常错误 的构造器com.baidu.fsg.uid.exception.UidGenerateException
Constructor with message & cause
UidGenerateException(String) - 异常错误 的构造器com.baidu.fsg.uid.exception.UidGenerateException
Constructor with message
UidGenerateException(String, Object...) - 异常错误 的构造器com.baidu.fsg.uid.exception.UidGenerateException
Constructor with message format
UidGenerateException(Throwable) - 异常错误 的构造器com.baidu.fsg.uid.exception.UidGenerateException
Constructor with cause
UidGenerator - com.baidu.fsg.uid中的接口
Represents a unique id generator.

V

value() - 接口 中的方法com.baidu.fsg.uid.utils.ValuedEnum
value() - 枚举 中的方法com.baidu.fsg.uid.worker.WorkerNodeType
 
ValuedEnum<T> - com.baidu.fsg.uid.utils中的接口
ValuedEnum defines an enumeration which is bounded to a value, you may implements this interface when you defines such kind of enumeration
valueOf(String) - 枚举 中的静态方法com.baidu.fsg.uid.worker.WorkerNodeType
返回带有指定名称的该类型的枚举常量。
values() - 枚举 中的静态方法com.baidu.fsg.uid.worker.WorkerNodeType
按照声明该枚举类型的常量的顺序, 返回 包含这些常量的数组。

W

WorkerIdAssigner - com.baidu.fsg.uid.worker中的接口
Represents a worker id assigner for DefaultUidGenerator
WorkerNodeDao - top.tangyh.basic.uid.dao中的接口
DAO for M_WORKER_NODE
WorkerNodeEntity - com.baidu.fsg.uid.worker.entity中的类
Entity for M_WORKER_NODE
WorkerNodeEntity() - 类 的构造器com.baidu.fsg.uid.worker.entity.WorkerNodeEntity
 
WorkerNodeType - com.baidu.fsg.uid.worker中的枚举
WorkerNodeType CONTAINER: Such as Docker ACTUAL: Actual machine
A B C D E G H I N P R S T U V W 
跳过导航链接

Copyright © 2023. All rights reserved.