INNER CODE UNIT · Java

assignDispatcher

RuedigerMoeller/kontraktor · attic/ElasticScheduler.java:318

    public DispatcherThread assignDispatcher(int minLoadPerc) {
        synchronized (balanceLock) {
            DispatcherThread minThread = findMinLoadThread(minLoadPerc, null);
            if ( minThread != null ) {
                return minThread;
            }
            DispatcherThread newThreadIfPossible = createNewThreadIfPossible();
            if ( newThreadIfPossible != null ) {
                newThreadIfPossible.start();
                return newThreadIfPossible;
            } else {
                return findMinLoadThread(Integer.MIN_VALUE, null); // return thread with lowest load
            }
        }
    }

    private DispatcherThread findMinLoadThread(int minLoad, DispatcherThread dispatcherThread) {
        synchronized (balanceLock) {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…