Examples of JGDI


Examples of com.sun.grid.jgdi.JGDI

            jgdi.close();
        }
    }
   
    public void testUnsuspendQueues() throws Exception {
        JGDI jgdi = createJGDI();
        try {
            jgdi.unsuspendQueues(new String[]{"*"}, false);
        } finally {
            jgdi.close();
        }
    }
View Full Code Here

Examples of com.sun.grid.jgdi.JGDI

        }
    }
   
    public void testQueueUserFilter() throws Exception {
       
        JGDI jgdi = createJGDI();
        try {
            ClusterQueueSummaryOptions options = new ClusterQueueSummaryOptions();
            UserSet userSet = ConfigurationFactory.createUserSet();
            userSet.setName("NoAccessUsers");
            userSet.addEntries("noaccess");
            jgdi.addUserSet(userSet);
            try {
                ClusterQueue cq = ConfigurationFactory.createClusterQueueWithDefaults();
                cq.setName("testQueueUserFilter");
                UserFilter uf = new UserFilter();
                uf.addUser("noaccess");
                jgdi.addClusterQueue(cq);
               
                try {
                    options.setQueueUserFilter(uf);
                    logger.fine("testQueueUserFilter for queue " + cq.getName());
                    List<ClusterQueueSummary> result = jgdi.getClusterQueueSummary(options);
                    printResult(result);
                } finally {
                    jgdi.deleteClusterQueue(cq);
                }
            } finally {
                jgdi.deleteUserSet(userSet);
            }
        } finally {
            jgdi.close();
        }
    }
View Full Code Here

Examples of com.sun.grid.jgdi.JGDI

//         jgdi.close();
//      }
//   }
   
    public void testClearShareTreeUsage() throws Exception {
        JGDI jgdi = createJGDI();
        try {
            jgdi.clearShareTreeUsage();
        } finally {
            jgdi.close();
        }
    }
View Full Code Here

Examples of com.sun.grid.jgdi.JGDI

            jgdi.close();
        }
    }
   
    public void testGetSchedulerHost() throws Exception {
        JGDI jgdi = createJGDI();
        try {
            logger.fine("Scheduler Host: " + jgdi.getSchedulerHost());
        } finally {
            jgdi.close();
        }
    }
View Full Code Here

Examples of com.sun.grid.jgdi.JGDI

            jgdi.close();
        }
    }
   
    public void testDisableQueues() throws Exception {
        JGDI jgdi = createJGDI();
        try {
            List<ClusterQueue> cqs = jgdi.getClusterQueueList();
            String[] queues = new String[cqs.size()];
            int i = 0;
            for (ClusterQueue cq : cqs) {
                if (cq.getName().equals("template")) {
                    continue;
                }
                queues[i] = cq.getName();
                i++;
            }
            for (i = 0; i < queues.length; i++) {
                logger.fine("Disable Queue: " + queues[i]);
            }
            try {
                jgdi.disableQueues(queues, false);
                for (ClusterQueueSummary cs : jgdi.getClusterQueueSummary(null)) {
                    for (int j = 0; j < queues.length; j++) {
                        if (cs.getName().equals(queues[j])) {
                            System.out.println("disabled queue count for queue " + cs.getName() + " is " + cs.getDisabledManual());
                        }
                    }
                }
            } catch (IllegalArgumentException je) {
                je.printStackTrace();
            }
        } finally {
            jgdi.close();
        }
    }
View Full Code Here

Examples of com.sun.grid.jgdi.JGDI

            jgdi.close();
        }
    }
   
    public void testEnableQueues() throws Exception {
        JGDI jgdi = createJGDI();
        try {
            List<ClusterQueue> cqs = jgdi.getClusterQueueList();
            String[] queues = new String[cqs.size()];
            int i = 0;
            for (ClusterQueue cq : cqs) {
                if (cq.getName().equals("template")) {
                    continue;
                }
                queues[i] = cq.getName();
                i++;
            }
            for (i = 0; i < queues.length; i++) {
                logger.fine("Enable Queue: " + queues[i]);
            }
            try {
                jgdi.enableQueues(queues, false);
                for (ClusterQueueSummary cs : jgdi.getClusterQueueSummary(null)) {
                    for (int j = 0; j < queues.length; j++) {
                        if (cs.getName().equals(queues[j])) {
                            System.out.println("disabled queue count for queue " + cs.getName() + " is " + cs.getDisabledManual());
                        }
                    }
                }
            } catch (IllegalArgumentException je) {
                je.printStackTrace();
            }
        } finally {
            jgdi.close();
        }
    }
View Full Code Here

Examples of com.sun.grid.jgdi.JGDI

           
            if (args.length == 1) {
                url = args[0];
            }
           
            JGDI jgdi = JGDIFactory.newInstance(url);
           
            try {
                ClusterQueueSummaryOptions options = new ClusterQueueSummaryOptions();
                QueueStateFilter queueStateFilter = new QueueStateFilter();
                queueStateFilter.setDisabled(true);
                options.setQueueStateFilter(queueStateFilter);
                List<ClusterQueueSummary> resultList = jgdi.getClusterQueueSummary(options);
                if (!resultList.isEmpty()) {
                    for (ClusterQueueSummary cqs : resultList) {
                        System.out.println(cqs.getName() + " is disabled");
                    }
                } else {
                    System.out.println("Found no disabled queue");
                }
            } finally {
                jgdi.close();
            }
        } catch (JGDIException e) {
            e.printStackTrace();
        }
    }
View Full Code Here

Examples of com.sun.grid.jgdi.JGDI

   
    public static void main(String [] args)  {
       
        try {
            String url = args[0];
            JGDI jgdi = JGDIFactory.newInstance(url);
            try {
                System.out.println("Successfully connected to " + url);
                List<ClusterQueue> cql = jgdi.getClusterQueueList();
                for (ClusterQueue cq : cql) {
                    System.out.println("Found cluster queue " + cq.getName());
                }
            } finally {
                jgdi.close();
            }
           
        } catch (JGDIException e) {
            e.printStackTrace();
        }
View Full Code Here

Examples of com.sun.grid.jgdi.JGDI

           
            if(args.length == 1 ) {
                url = args[0];
            }
           
            JGDI jgdi = JGDIFactory.newInstance(url);
           
            try {
                System.out.println("Successfully connected to " + url);
                QueueInstanceSummaryOptions options = new QueueInstanceSummaryOptions();
//            ResourceAttributeFilter raf = new ResourceAttributeFilter();
//            raf.addValueName("arch");
//            options.setResourceAttributeFilter(raf);
                QueueInstanceSummaryResult res = jgdi.getQueueInstanceSummary(options);
                for (QueueInstanceSummary cis : res.getQueueInstanceSummary()) {
                    cis.getJobList();
                    System.out.println(cis.getName() + " " + cis.getLoadAvg());
                }
               
                for (JobSummary js : res.getPendingJobs()) {
                    System.out.println(js.getId() + " (" + js.getName() + ") is pending");
                }
            } finally {
                jgdi.close();
            }
        } catch (JGDIException e) {
            e.printStackTrace();
        }
       
View Full Code Here

Examples of com.sun.grid.jgdi.JGDI

            if (args.length == 1) {
                url = args[0];
            }

            JGDI jgdi = JGDIFactory.newInstance(url);
            List<JGDIAnswer> answers = new LinkedList<JGDIAnswer>();

            try {
                System.out.println("Successfully connected to " + url);

                // Create a new checkpoint object which intialized with default values
                Checkpoint ckpt = ConfigurationFactory.createCheckpointWithDefaults();
                ckpt.setName("sample");
                ckpt.setCkptCommand("/usr/bin/ckpt");
                ckpt.setCkptDir("/tmp");

                jgdi.addCheckpointWithAnswer(ckpt, answers);
                for (JGDIAnswer a : answers) {
                    System.out.println(a.getText());
                }
                try {
                    ckpt = jgdi.getCheckpoint(ckpt.getName());
                    ckpt.setRestCommand("/tmp/blubber");
                    jgdi.updateCheckpointWithAnswer(ckpt, answers);
                    for (JGDIAnswer a : answers) {
                        System.out.println(a.getText());
                    }
                } finally {
                    jgdi.deleteCheckpointWithAnswer(ckpt.getName(), answers);
                    for (JGDIAnswer a : answers) {
                        System.out.println(a.getText());
                    }
                }
            } finally {
                jgdi.close();
            }
        } catch (JGDIException e) {
            e.printStackTrace();
        }
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.