yinjihuan / kitty Goto Github PK
View Code? Open in Web Editor NEWSpring Cloud & Spring Cloud Alibaba 基础框架,内置了 Cat 监控,互联网公司落地 Spring Cloud 架构必备。
Spring Cloud & Spring Cloud Alibaba 基础框架,内置了 Cat 监控,互联网公司落地 Spring Cloud 架构必备。
这里应该是Runnable failRunnable = (Runnable) fail;
1.从代码上看只是开放了setCapacity的入口,且capacity是通过volatile修饰的,所以capacity的变化会及时通知到各个线程,
关键问题是,当我往队列里插入或者取对象的时候,会有个判断
public void put(E e) throws InterruptedException {
if (e == null) throw new NullPointerException();
// Note: convention in all put/take/etc is to preset local var
// holding count negative to indicate failure unless set.
int c = -1;
ResizableCapacityLinkedBlockIngQueue.Node node = new ResizableCapacityLinkedBlockIngQueue.Node(e);
final ReentrantLock putLock = this.putLock;
final AtomicInteger count = this.count;
putLock.lockInterruptibly();
try {
/*
* Note that count is used in wait guard even though it is
* not protected by lock. This works because count can
* only decrease at this point (all other puts are shut
* out by lock), and we (or some other waiting put) are
* signalled if it ever changes from capacity. Similarly
* for all other uses of count in other wait guards.
*/
while (count.get() == capacity) {
notFull.await();
}
enqueue(node);
c = count.getAndIncrement();
if (c + 1 < capacity)
notFull.signal();
} finally {
putLock.unlock();
}
if (c == 0)
signalNotEmpty();
}
如果这个时候我调整了假设当前的任务数量是100,capacity是200,现在我调整capacity的大小为50,这个时候根据这个判断count.get() == capacity,任务队列是没有满的,这样还会往队列里塞数据,不知道我理解的对不对,是不是调整为count.get()>=capacity
你好,我尝试下了在项目中设置 cat.servers 服务器,好像不起作用呀,
还得通过CAT_HOME/client.xml 来设置servers 才行呀,
debug 跟了下 代码发现 DefaultClientConfigManager 类默认就是加载 cat_HOME 下的client.xml 文件中的 Server
如果动态修改线程池参数的话,服务重启后,之前修改的线程池参数还有效嘛
能否增加日记组件,增加traceId标识
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.