@Override public void moveAllApps(String sourceQueue, String destQueue) throws YarnException { try { writeLock.lock(); // check if destination queue is a valid leaf queue try { getQueueInfo(destQueue, false, false); } catch (IOException e) { LOG.warn(e); throw new YarnException(e); } // check if source queue is a valid List<ApplicationAttemptId> apps = getAppsInQueue(sourceQueue); if (apps == null) { String errMsg = "The specified Queue: " + sourceQueue + " doesn't exist"; LOG.warn(errMsg); throw new YarnException(errMsg); } // generate move events for each pending/running app for (ApplicationAttemptId appAttemptId : apps) { this.rmContext.getDispatcher().getEventHandler() .handle(new RMAppManagerEvent(appAttemptId.getApplicationId(), destQueue, RMAppManagerEventType.APP_MOVE)); } } finally { writeLock.unlock(); } }
@Override public synchronized void moveAllApps(String sourceQueue, String destQueue) throws YarnException { // check if destination queue is a valid leaf queue try { getQueueInfo(destQueue, false, false); } catch (IOException e) { LOG.warn(e); throw new YarnException(e); } // check if source queue is a valid List<ApplicationAttemptId> apps = getAppsInQueue(sourceQueue); if (apps == null) { String errMsg = "The specified Queue: " + sourceQueue + " doesn't exist"; LOG.warn(errMsg); throw new YarnException(errMsg); } // generate move events for each pending/running app for (ApplicationAttemptId app : apps) { SettableFuture<Object> future = SettableFuture.create(); this.rmContext .getDispatcher() .getEventHandler() .handle(new RMAppMoveEvent(app.getApplicationId(), destQueue, future)); } }
@Override public synchronized void moveAllApps(String sourceQueue, String destQueue) throws YarnException { // check if destination queue is a valid leaf queue try { getQueueInfo(destQueue, false, false); } catch (IOException e) { LOG.warn(e); throw new YarnException(e); } // check if source queue is a valid List<ApplicationAttemptId> apps = getAppsInQueue(sourceQueue); if (apps == null) { String errMsg = "The specified Queue: " + sourceQueue + " doesn't exist"; LOG.warn(errMsg); throw new YarnException(errMsg); } // generate move events for each pending/running app for (ApplicationAttemptId app : apps) { SettableFuture<Object> future = SettableFuture.create(); this.rmContext .getDispatcher() .getEventHandler() .handle(new RMAppMoveEvent(app.getApplicationId(), destQueue, future)); } }