@Override public List<JobInstance> poll(DbConn cnx, Queue queue, int headSize) { return JobInstance.select(cnx, "ji_select_poll", queue.getId(), headSize); } }
@Override public List<JobInstance> poll(DbConn cnx, Queue queue, int headSize) { return JobInstance.select(cnx, "ji_select_poll", queue.getId(), headSize); } }
@Override public List<JobInstance> poll(DbConn cnx, Queue queue, int headSize) { return JobInstance.select(cnx, "ji_select_poll", queue.getId(), headSize); } }
@Override public List<JobInstance> poll(DbConn cnx, Queue queue, int headSize) { return JobInstance.select(cnx, "ji_select_poll", queue.getId(), headSize); } }
@Override public List<JobInstance> poll(DbConn cnx, Queue queue, int headSize) { return JobInstance.select(cnx, "ji_select_poll", queue.getId(), headSize); } }
public static int createJobDef(String description, boolean canBeRestarted, String javaClassName, Map<String, String> parameters, String jp, Queue queue, Integer maxTimeRunning, String applicationName, String application, String module, String keyword1, String keyword2, String keyword3, boolean highlander, DbConn cnx) { return createJobDef(description, canBeRestarted, javaClassName, parameters, jp, queue.getId(), maxTimeRunning, applicationName, application, module, keyword1, keyword2, keyword3, highlander, cnx, null, false, null, false, PathType.FS); }
@Override public List<JobInstance> poll(DbConn cnx, Queue queue, int headSize) { return JobInstance.select(cnx, "ji_select_poll", queue.getId(), headSize); } }
public static int createJobDef(String description, boolean canBeRestarted, String javaClassName, Map<String, String> parameters, String jp, Queue queue, Integer maxTimeRunning, String applicationName, String application, String module, String keyword1, String keyword2, String keyword3, boolean highlander, DbConn cnx) { return createJobDef(description, canBeRestarted, javaClassName, parameters, jp, queue.getId(), maxTimeRunning, applicationName, application, module, keyword1, keyword2, keyword3, highlander, cnx, null, false, null, false, PathType.FS); }
/** * The polling method. Creating "queues" on the different databases can be extremely different in the different supported RDBMS, so this * method allows to fully change the polling method. <br> * <br> * Default implementation uses the ji_select_poll SQL template query and does retrieve the whole queue without using headSize, so is a * performance waste. * * @param cnx * a session without active TX. * @param queue * the queue being polled * @param headSize * upper estimate of how many slots are available - i.e. max JI which can be taken from the queue. * @return a list of JI, or an empty list. Never null. */ public List<JobInstance> poll(DbConn cnx, Queue queue, int headSize) { return JobInstance.select(cnx, "ji_select_poll", queue.getId()); } }
/** * The polling method. Creating "queues" on the different databases can be extremely different in the different supported RDBMS, so this * method allows to fully change the polling method. <br> * <br> * Default implementation uses the ji_select_poll SQL template query and does retrieve the whole queue without using headSize, so is a * performance waste. * * @param cnx * a session without active TX. * @param queue * the queue being polled * @param headSize * upper estimate of how many slots are available - i.e. max JI which can be taken from the queue. * @return a list of JI, or an empty list. Never null. */ public List<JobInstance> poll(DbConn cnx, Queue queue, int headSize) { return JobInstance.select(cnx, "ji_select_poll", queue.getId()); } }
private static Element getQueueElement(Queue q, DbConn cnx) { Element queue = new Element("queue"); Element name = new Element("name"); name.setText(q.getName()); Element description = new Element("description"); description.setText(q.getDescription()); Element timeToLive = new Element("timeToLive"); timeToLive.setText(q.getTimeToLive() + ""); queue.addContent(name); queue.addContent(description); queue.addContent(timeToLive); Element jobs = new Element("jobs"); queue.addContent(jobs); List<JobDef> jds = JobDef.select(cnx, "jd_select_by_queue", q.getId()); for (JobDef j : jds) { Element job = new Element("applicationName"); job.setText(j.getApplicationName()); jobs.addContent(job); } return queue; }
private static Element getQueueElement(Queue q, DbConn cnx) { Element queue = new Element("queue"); Element name = new Element("name"); name.setText(q.getName()); Element description = new Element("description"); description.setText(q.getDescription()); Element timeToLive = new Element("timeToLive"); timeToLive.setText(q.getTimeToLive() + ""); queue.addContent(name); queue.addContent(description); queue.addContent(timeToLive); Element jobs = new Element("jobs"); queue.addContent(jobs); List<JobDef> jds = JobDef.select(cnx, "jd_select_by_queue", q.getId()); for (JobDef j : jds) { Element job = new Element("applicationName"); job.setText(j.getApplicationName()); jobs.addContent(job); } return queue; }
String appName = appElement.getTextContent(); jqmlogger.debug("Default queue of the job " + appName + " must be changed"); cnx.runUpdate("jd_update_set_queue_by_key", q.getId(), appName);
@Override public long getCumulativeJobInstancesCount() { DbConn em2 = Helpers.getNewDbSession(); try { return em2.runSelectSingle("history_select_count_for_poller", Long.class, this.queue.getId(), this.engine.getNode().getId()); } finally { Helpers.closeQuietly(em2); } }
@Override public long getCumulativeJobInstancesCount() { DbConn em2 = Helpers.getNewDbSession(); try { return em2.runSelectSingle("history_select_count_for_poller", Long.class, this.queue.getId(), this.engine.getNode().getId()); } finally { Helpers.closeQuietly(em2); } }
@Override public float getJobsFinishedPerSecondLastMinute() { DbConn em2 = Helpers.getNewDbSession(); try { return em2.runSelectSingle("history_select_count_last_mn_for_poller", Float.class, this.queue.getId(), this.engine.getNode().getId()); } finally { Helpers.closeQuietly(em2); } }
@Override public float getJobsFinishedPerSecondLastMinute() { DbConn em2 = Helpers.getNewDbSession(); try { return em2.runSelectSingle("history_select_count_last_mn_for_poller", Float.class, this.queue.getId(), this.engine.getNode().getId()); } finally { Helpers.closeQuietly(em2); } }
private static com.enioka.jqm.api.Queue getQueue(Queue queue) { com.enioka.jqm.api.Queue q = new com.enioka.jqm.api.Queue(); q.setDescription(queue.getDescription()); q.setId(queue.getId()); q.setName(queue.getName()); return q; }
cnx.runUpdate("q_update_default_by_id", q.getId()); jqmlogger.info("Queue " + q.getName() + " was modified to become the default queue as there were multiple default queues"); cnx.runUpdate("q_update_default_by_id", q.getId()); jqmlogger.info("Queue " + q.getName() + " was modified to become the default queue as there were multiple default queues");
cnx.runUpdate("q_update_default_by_id", q.getId()); jqmlogger.info("Queue " + q.getName() + " was modified to become the default queue as there were multiple default queues"); cnx.runUpdate("q_update_default_by_id", q.getId()); jqmlogger.info("Queue " + q.getName() + " was modified to become the default queue as there were multiple default queues");