public void refreshDefaultQueue(Configuration conf, String userName)
throws IOException {
String requestedQueue = YarnConfiguration.DEFAULT_QUEUE_NAME;
final AtomicReference<AllocationConfiguration> allocConf = new AtomicReference<AllocationConfiguration>();
AllocationFileLoaderService allocsLoader = new AllocationFileLoaderService();
allocsLoader.init(conf);
allocsLoader.setReloadListener(new AllocationFileLoaderService.Listener() {
@Override
public void onReload(AllocationConfiguration allocs) {
allocConf.set(allocs);
}
});
try {
allocsLoader.reloadAllocations();
} catch (Exception ex) {
throw new IOException("Failed to load queue allocations", ex);
}
if (allocConf.get() == null) {
allocConf.set(new AllocationConfiguration(conf));