本文整理了Java中com.enioka.jqm.model.Node.getId()
方法的一些代码示例,展示了Node.getId()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node.getId()
方法的具体详情如下:
包路径:com.enioka.jqm.model.Node
类名称:Node
方法名:getId
[英]A technical ID without any meaning. Generated by the database.
[中]没有任何意义的技术ID。由数据库生成。
代码示例来源:origin: enioka/jqm
/**
* See {@link #getNode()}
*/
public void setNode(final Node node)
{
this.n = node;
this.node_id = node.getId();
}
代码示例来源:origin: com.enioka.jqm/jqm-model
/**
* See {@link #getNode()}
*/
public void setNode(final Node node)
{
this.n = node;
this.node_id = node.getId();
}
代码示例来源:origin: com.enioka.jqm/jqm-model
public static DeploymentParameter create(DbConn cnx, Node node, Integer nbThread, Integer pollingInterval, Integer queueId)
{
return create(cnx, node.getId(), nbThread, pollingInterval, queueId);
}
代码示例来源:origin: enioka/jqm
public static DeploymentParameter create(DbConn cnx, Node node, Integer nbThread, Integer pollingInterval, Integer queueId)
{
return create(cnx, node.getId(), nbThread, pollingInterval, queueId);
}
代码示例来源:origin: enioka/jqm
@Override
public String getWebApiLocalUrl(DbConn cnx)
{
// Do not use port from engine.getNode, as it may have been set AFTER engine startup.
Node node = Node.select_single(cnx, "node_select_by_id", this.engine.getNode().getId());
boolean useSsl = Boolean.parseBoolean(GlobalParameter.getParameter(cnx, "enableWsApiSsl", "false"));
return (useSsl ? "https://localhost:" : "http://localhost:") + node.getPort();
}
}
代码示例来源:origin: com.enioka.jqm/jqm-engine
@Override
public String getWebApiLocalUrl(DbConn cnx)
{
// Do not use port from engine.getNode, as it may have been set AFTER engine startup.
Node node = Node.select_single(cnx, "node_select_by_id", this.engine.getNode().getId());
boolean useSsl = Boolean.parseBoolean(GlobalParameter.getParameter(cnx, "enableWsApiSsl", "false"));
return (useSsl ? "https://localhost:" : "http://localhost:") + node.getPort();
}
}
代码示例来源:origin: com.enioka.jqm/jqm-engine
@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);
}
}
代码示例来源:origin: enioka/jqm
@Before
public void before() throws IOException
{
Helpers.setSingleParam("disableWsApi", "false", cnx);
Helpers.setSingleParam("enableWsApiAuth", "false", cnx);
File jar = FileUtils.listFiles(new File("../jqm-ws/target/"), new String[] { "war" }, false).iterator().next();
FileUtils.copyFile(jar, new File("./webapp/jqm-ws.war"));
addAndStartEngine();
TestHelpers.node = Node.select_single(cnx, "node_select_by_id", TestHelpers.node.getId());
}
代码示例来源:origin: enioka/jqm
@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);
}
}
代码示例来源:origin: com.enioka.jqm/jqm-engine
@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);
}
}
代码示例来源:origin: enioka/jqm
@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);
}
}
代码示例来源:origin: com.enioka.jqm/jqm-engine
@Override
public void resume()
{
DbConn cnx = null;
try
{
cnx = Helpers.getNewDbSession();
cnx.runUpdate("node_update_enabled_by_id", Boolean.TRUE, node.getId());
cnx.commit();
}
finally
{
Helpers.closeQuietly(cnx);
}
refreshConfiguration();
}
代码示例来源:origin: enioka/jqm
@Override
public void pause()
{
DbConn cnx = null;
try
{
cnx = Helpers.getNewDbSession();
cnx.runUpdate("node_update_enabled_by_id", Boolean.FALSE, node.getId());
cnx.commit();
}
finally
{
Helpers.closeQuietly(cnx);
}
refreshConfiguration();
}
代码示例来源:origin: com.enioka.jqm/jqm-engine
@Override
public void pause()
{
DbConn cnx = null;
try
{
cnx = Helpers.getNewDbSession();
cnx.runUpdate("node_update_enabled_by_id", Boolean.FALSE, node.getId());
cnx.commit();
}
finally
{
Helpers.closeQuietly(cnx);
}
refreshConfiguration();
}
代码示例来源:origin: enioka/jqm
@Test
public void testRemoteStop() throws Exception
{
Helpers.setSingleParam("internalPollingPeriodMs", "10", cnx);
addAndStartEngine();
cnx.runUpdate("node_update_stop_by_id", TestHelpers.node.getId());
cnx.commit();
TestHelpers.waitFor(2, 3000, cnx);
Assert.assertFalse(engines.get("localhost").areAllPollersPolling());
engines.clear();
}
代码示例来源:origin: enioka/jqm
@Test
public void testTemplate() throws Exception
{
NodeDto template = MetaService.getNode(cnx, TestHelpers.nodeMix.getId());
template.setPort(123);
MetaService.upsertNode(cnx, template);
cnx.commit();
NodeDto target = MetaService.getNode(cnx, TestHelpers.node.getId());
Assert.assertEquals(3, MetaService.getNodeQueueMappings(cnx, target.getId()).size());
// Capital letter -> should be ignored.
Main.runCommand(new String[] { "Install-NodeTemPlate", "-t", TestHelpers.nodeMix.getName(), "-n", TestHelpers.node.getName() });
target = MetaService.getNode(cnx, TestHelpers.node.getId());
Assert.assertEquals(template.getPort(), target.getPort());
Assert.assertEquals(1, MetaService.getNodeQueueMappings(cnx, target.getId()).size());
}
}
代码示例来源:origin: enioka/jqm
@Test
public void testPauseResume() throws Exception
{
cnx.runUpdate("node_update_enabled_by_id", false, TestHelpers.node.getId());
cnx.commit();
// Submit request => nothing should happen
JqmSimpleTest.create(cnx, "pyl.PckMain", "jqm-test-pyl-nodep").addWaitTime(3000).expectNonOk(0).expectOk(0).run(this);
// Resume => JI should be run and end OK
this.engines.get("localhost").resume();
TestHelpers.waitFor(1, 5000, cnx);
Assert.assertEquals(1, TestHelpers.getOkCount(cnx));
}
}
代码示例来源:origin: enioka/jqm
@Test(expected = JqmInvalidRequestException.class)
public void testPriorityLimits()
{
int qId = Queue.create(cnx, "testqueue", " ", false);
DeploymentParameter.create(cnx, TestHelpers.node.getId(), 1, 1, qId);
CreationTools.createJobDef(null, true, "pyl.Wait", null, "jqm-tests/jqm-test-pyl-nodep/target/test.jar", qId, 42, "jqm-test-wait",
null, "Franquin", "ModuleMachin", "other", "other", false, cnx);
cnx.commit();
// No priority = FIFO queue.
JobRequest.create("jqm-test-wait", "test").addParameter("ms", "100").setPriority(Integer.MAX_VALUE).submit();
}
代码示例来源:origin: enioka/jqm
@Test
public void testStartupCleanupAttr() throws Exception
{
CreationTools.createJobDef(null, true, "App", null, "jqm-tests/jqm-test-em/target/test.jar", TestHelpers.qVip, 42, "jqm-test-em",
null, "Franquin", "ModuleMachin", "other", "other", false, cnx);
// Create a running job that should be cleaned at startup
int i = JqmClientFactory.getClient().enqueue("jqm-test-em", "test");
cnx.runUpdate("ji_update_status_by_id", TestHelpers.node.getId(), i);
cnx.commit();
addAndStartEngine();
Assert.assertEquals(0, TestHelpers.getQueueAllCount(cnx));
Assert.assertEquals(1, TestHelpers.getHistoryAllCount(cnx));
Assert.assertEquals(1, TestHelpers.getNonOkCount(cnx));
}
代码示例来源:origin: enioka/jqm
@Test
public void testStartupCleanupRunning() throws Exception
{
CreationTools.createJobDef(null, true, "App", null, "jqm-tests/jqm-test-em/target/test.jar", TestHelpers.qVip, 42, "jqm-test-em",
null, "Franquin", "ModuleMachin", "other", "other", false, cnx);
/// Create a running job that should be cleaned at startup
int i1 = JqmClientFactory.getClient().enqueue("jqm-test-em", "test");
cnx.runUpdate("ji_update_status_by_id", TestHelpers.node.getId(), i1);
cnx.runUpdate("jj_update_run_by_id", i1);
cnx.commit();
addAndStartEngine();
Assert.assertEquals(0, TestHelpers.getQueueAllCount(cnx));
Assert.assertEquals(1, TestHelpers.getHistoryAllCount(cnx));
Assert.assertEquals(1, TestHelpers.getNonOkCount(cnx));
}
内容来源于网络,如有侵权,请联系作者删除!