Examples of QueueManager


Examples of org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.QueueManager

 
  public FairSchedulerQueueInfo() {
  }
 
  public FairSchedulerQueueInfo(FSQueue queue, FairScheduler scheduler) {
    QueueManager manager = scheduler.getQueueManager();
   
    queueName = queue.getName();
    schedulingPolicy = queue.getPolicy().getName();
   
    clusterResources = new ResourceInfo(scheduler.getClusterCapacity());
   
    usedResources = new ResourceInfo(queue.getResourceUsage());
    fractionMemUsed = (float)usedResources.getMemory() /
        clusterResources.getMemory();
   
    fairResources = new ResourceInfo(queue.getFairShare());
    minResources = new ResourceInfo(queue.getMinShare());
    maxResources = new ResourceInfo(queue.getMaxShare());
    maxResources = new ResourceInfo(
        Resources.componentwiseMin(queue.getMaxShare(),
            scheduler.getClusterCapacity()));
   
    fractionMemFairShare = (float)fairResources.getMemory() / clusterResources.getMemory();
    fractionMemMinShare = (float)minResources.getMemory() / clusterResources.getMemory();
    fractionMemMaxShare = (float)maxResources.getMemory() / clusterResources.getMemory();
   
    maxApps = manager.getQueueMaxApps(queueName);
   
    Collection<FSQueue> children = queue.getChildQueues();
    childQueues = new ArrayList<FairSchedulerQueueInfo>();
    for (FSQueue child : children) {
      if (child instanceof FSLeafQueue) {
View Full Code Here

Examples of org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.QueueManager

  private String queueName;
 
  private Collection<FairSchedulerQueueInfo> childInfos;
 
  public FairSchedulerQueueInfo(FSQueue queue, FairScheduler scheduler) {
    QueueManager manager = scheduler.getQueueManager();
   
    queueName = queue.getName();
       
    clusterResources = scheduler.getClusterCapacity();
   
    usedResources = queue.getResourceUsage();
    fractionMemUsed = (float)usedResources.getMemory() /
        clusterResources.getMemory();
   
    fairResources = queue.getFairShare();
    minResources = queue.getMinShare();
    maxResources = queue.getMaxShare();
    maxResources = Resources.componentwiseMin(maxResources, clusterResources);
   
    fractionMemFairShare = (float)fairResources.getMemory() / clusterResources.getMemory();
    fractionMemMinShare = (float)minResources.getMemory() / clusterResources.getMemory();
    fractionMemMaxShare = (float)maxResources.getMemory() / clusterResources.getMemory();
   
    maxApps = manager.getQueueMaxApps(queueName);
   
    Collection<FSQueue> childQueues = queue.getChildQueues();
    childInfos = new ArrayList<FairSchedulerQueueInfo>();
    for (FSQueue child : childQueues) {
      if (child instanceof FSLeafQueue) {
View Full Code Here

Examples of org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.QueueManager

  private String queueName;
 
  private Collection<FairSchedulerQueueInfo> childInfos;
 
  public FairSchedulerQueueInfo(FSQueue queue, FairScheduler scheduler) {
    QueueManager manager = scheduler.getQueueManager();
   
    queueName = queue.getName();
       
    Resource clusterMax = scheduler.getClusterCapacity();
    clusterMaxMem = clusterMax.getMemory();
   
    usedResources = queue.getResourceUsage();
    fractionUsed = (float)usedResources.getMemory() / clusterMaxMem;
   
    fairShare = queue.getFairShare().getMemory();
    minResources = queue.getMinShare();
    minShare = minResources.getMemory();
    maxResources = scheduler.getQueueManager().getMaxResources(queueName);
    if (maxResources.getMemory() > clusterMaxMem) {
      maxResources = Resources.createResource(clusterMaxMem);
    }
    maxShare = maxResources.getMemory();
   
    fractionFairShare = (float)fairShare / clusterMaxMem;
    fractionMinShare = (float)minShare / clusterMaxMem;
   
    maxApps = manager.getQueueMaxApps(queueName);
   
    Collection<FSQueue> childQueues = queue.getChildQueues();
    childInfos = new ArrayList<FairSchedulerQueueInfo>();
    for (FSQueue child : childQueues) {
      if (child instanceof FSLeafQueue) {
View Full Code Here

Examples of org.apache.oodt.cas.resource.scheduler.QueueManager

    this.dirUris = dirUris;
  }

  public QueueManager loadQueues() {

    QueueManager queueManager = new QueueManager();

    if (dirUris != null && dirUris.size() > 0) {
      for (Iterator i = dirUris.iterator(); i.hasNext();) {
        String dirUri = (String) i.next();

        try {
          File nodesDir = new File(new URI(dirUri));
          if (nodesDir.isDirectory()) {

            String nodesDirStr = nodesDir.getAbsolutePath();

            if (!nodesDirStr.endsWith("/")) {
              nodesDirStr += "/";
            }

            // get all the workflow xml files
            File[] nodesFiles = nodesDir.listFiles(queuesXmlFilter);

            for (int j = 0; j < nodesFiles.length; j++) {

              String nodesXmlFile = nodesFiles[j]
                  .getAbsolutePath();
              Document nodesRoot = null;
              try {
                nodesRoot = XMLUtils
                    .getDocumentRoot(new FileInputStream(
                        nodesFiles[j]));
              } catch (FileNotFoundException e) {
                e.printStackTrace();
                return null;
              }

              NodeList nodeList = nodesRoot
                  .getElementsByTagName("node");

              if (nodeList != null && nodeList.getLength() > 0) {
                for (int k = 0; k < nodeList.getLength(); k++) {

                  String nodeId = ((Element) nodeList.item(k))
                      .getAttribute("id");
                  Vector assignments = (Vector) XmlStructFactory
                      .getQueueAssignment((Element) nodeList
                          .item(k));
                  for (int l = 0; l < assignments.size(); l++) {
                    try {
                      // make sure queue exists
                      queueManager
                          .addQueue((String) assignments
                              .get(l));
                      // add node to queue
                      queueManager
                          .addNodeToQueue(nodeId,
                              (String) assignments
                                  .get(l));
                    } catch (Exception e) {
                      LOG
View Full Code Here

Examples of org.mule.util.queue.QueueManager

        configureSystemModel(registry);
    }

    protected void configureQueueManager(MuleContext muleContext) throws RegistrationException
    {
        QueueManager queueManager = new TransactionalQueueManager();
        muleContext.getRegistry().registerObject(MuleProperties.OBJECT_QUEUE_MANAGER, queueManager);
    }
View Full Code Here

Examples of org.mule.util.queue.QueueManager

   
        // DefaultMuleContext refuses to start without these objects in place
        SecurityManager securityManager = Mockito.mock(SecurityManager.class);
        ctx.getRegistry().registerObject(UUID.getUUID(), securityManager);
       
        QueueManager queueManager = Mockito.mock(QueueManager.class);
        ctx.getRegistry().registerObject(UUID.getUUID(), queueManager);
       
        ctx.start();
        return ctx;
    }
View Full Code Here

Examples of org.mule.util.queue.QueueManager

{

    public VMTransaction(MuleContext muleContext) throws TransactionException
    {
        super(muleContext);
        QueueManager qm = muleContext.getQueueManager();
        QueueSession qs = qm.getQueueSession();
        bindResource(qm, qs);
    }
View Full Code Here

Examples of org.mule.util.queue.QueueManager

     */
    public void testQueueConfiguration() throws Exception
    {
        int capacity = 345;

        QueueManager queueManager = muleContext.getQueueManager();

        QueueManager mockTransactionalQueueManager = mock(QueueManager.class);
        when(mockTransactionalQueueManager.getQueueSession()).thenReturn(queueManager.getQueueSession());

        // Replace queueManager instance with mock via registry as it cannot be set
        // once muleContext is initialized.
        muleContext.getRegistry().registerObject(MuleProperties.OBJECT_QUEUE_MANAGER,
            mockTransactionalQueueManager);
View Full Code Here

Examples of org.mule.util.queue.QueueManager

        return workListener;
    }

    public QueueManager getQueueManager()
    {
        QueueManager queueManager = (QueueManager) registryBroker.lookupObject(MuleProperties.OBJECT_QUEUE_MANAGER);
        if (queueManager == null)
        {
            Collection<QueueManager> temp = registryBroker.lookupObjects(QueueManager.class);
            if (temp.size() > 0)
            {
View Full Code Here

Examples of org.mule.util.queue.QueueManager

        // DefaultMuleContext refuses to start without these objects in place
        SecurityManager securityManager = Mockito.mock(SecurityManager.class);
        ctx.getRegistry().registerObject(UUID.getUUID(), securityManager);

        QueueManager queueManager = Mockito.mock(QueueManager.class);
        ctx.getRegistry().registerObject(UUID.getUUID(), queueManager);

        ctx.start();
        return ctx;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.