- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.apache.helix.task.WorkflowConfig.getJobDag()
方法的一些代码示例,展示了WorkflowConfig.getJobDag()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WorkflowConfig.getJobDag()
方法的具体详情如下:
包路径:org.apache.helix.task.WorkflowConfig
类名称:WorkflowConfig
方法名:getJobDag
暂无
代码示例来源:origin: org.apache.helix/helix-core
private void removeWorkflowFromZK(String workflow) {
Set<String> jobSet = new HashSet<>();
// Note that even WorkflowConfig is null, if WorkflowContext exists, still need to remove workflow
WorkflowConfig wCfg = TaskUtil.getWorkflowConfig(_accessor, workflow);
if (wCfg != null) {
jobSet.addAll(wCfg.getJobDag().getAllNodes());
}
boolean success = TaskUtil.removeWorkflow(_accessor, _propertyStore, workflow, jobSet);
if (!success) {
LOG.info("Failed to delete the workflow " + workflow);
throw new HelixException("Failed to delete the workflow " + workflow);
}
}
代码示例来源:origin: apache/helix
private void removeWorkflowFromZK(String workflow) {
Set<String> jobSet = new HashSet<>();
// Note that even WorkflowConfig is null, if WorkflowContext exists, still need to remove workflow
WorkflowConfig wCfg = TaskUtil.getWorkflowConfig(_accessor, workflow);
if (wCfg != null) {
jobSet.addAll(wCfg.getJobDag().getAllNodes());
}
boolean success = TaskUtil.removeWorkflow(_accessor, _propertyStore, workflow, jobSet);
if (!success) {
LOG.info("Failed to delete the workflow " + workflow);
throw new HelixException("Failed to delete the workflow " + workflow);
}
}
代码示例来源:origin: org.apache.helix/helix-core
/**
* Count the number of jobs in a workflow that are not in final state.
* @param workflowCfg
* @param workflowCtx
* @return
*/
public static int getInCompleteJobCount(WorkflowConfig workflowCfg, WorkflowContext workflowCtx) {
int inCompleteCount = 0;
for (String jobName : workflowCfg.getJobDag().getAllNodes()) {
TaskState jobState = workflowCtx.getJobState(jobName);
if (jobState == TaskState.IN_PROGRESS || jobState == TaskState.STOPPED) {
++inCompleteCount;
}
}
return inCompleteCount;
}
代码示例来源:origin: apache/helix
/**
* Count the number of jobs in a workflow that are not in final state.
* @param workflowCfg
* @param workflowCtx
* @return
*/
public static int getInCompleteJobCount(WorkflowConfig workflowCfg, WorkflowContext workflowCtx) {
int inCompleteCount = 0;
for (String jobName : workflowCfg.getJobDag().getAllNodes()) {
TaskState jobState = workflowCtx.getJobState(jobName);
if (jobState == TaskState.IN_PROGRESS || jobState == TaskState.STOPPED
|| jobState == TaskState.STOPPING) {
++inCompleteCount;
}
}
return inCompleteCount;
}
代码示例来源:origin: apache/helix
/**
* Checks if the workflow has been stopped.
* @param ctx Workflow context containing task states
* @param cfg Workflow config containing set of tasks
* @return returns true if all tasks are {@link TaskState#STOPPED}, false otherwise.
*/
private static boolean isWorkflowStopped(WorkflowContext ctx, WorkflowConfig cfg) {
for (String job : cfg.getJobDag().getAllNodes()) {
if (ctx.getJobState(job) != TaskState.STOPPED && ctx.getJobState(job) != null) {
return false;
}
}
return true;
}
代码示例来源:origin: org.apache.helix/helix-core
/**
* Checks if the workflow has been stopped.
* @param ctx Workflow context containing task states
* @param cfg Workflow config containing set of tasks
* @return returns true if all tasks are {@link TaskState#STOPPED}, false otherwise.
*/
private static boolean isWorkflowStopped(WorkflowContext ctx, WorkflowConfig cfg) {
for (String job : cfg.getJobDag().getAllNodes()) {
if (ctx.getJobState(job) != TaskState.STOPPED && ctx.getJobState(job) != null) {
return false;
}
}
return true;
}
代码示例来源:origin: org.apache.helix/helix-core
private Set<String> getInstancesAssignedToOtherJobs(String currentJobName,
WorkflowConfig workflowCfg, ClusterDataCache cache) {
Set<String> ret = new HashSet<String>();
for (String jobName : workflowCfg.getJobDag().getAllNodes()) {
if (jobName.equals(currentJobName)) {
continue;
}
JobContext jobContext = cache.getJobContext(jobName);
if (jobContext == null) {
continue;
}
for (int partition : jobContext.getPartitionSet()) {
TaskPartitionState partitionState = jobContext.getPartitionState(partition);
if (partitionState == TaskPartitionState.INIT ||
partitionState == TaskPartitionState.RUNNING) {
ret.add(jobContext.getAssignedParticipant(partition));
}
}
}
return ret;
}
代码示例来源:origin: apache/helix
private Set<String> getInstancesAssignedToOtherJobs(String currentJobName,
WorkflowConfig workflowCfg, ClusterDataCache cache) {
Set<String> ret = new HashSet<String>();
for (String jobName : workflowCfg.getJobDag().getAllNodes()) {
if (jobName.equals(currentJobName)) {
continue;
}
JobContext jobContext = cache.getJobContext(jobName);
if (jobContext == null) {
continue;
}
for (int partition : jobContext.getPartitionSet()) {
TaskPartitionState partitionState = jobContext.getPartitionState(partition);
if (partitionState == TaskPartitionState.INIT ||
partitionState == TaskPartitionState.RUNNING) {
ret.add(jobContext.getAssignedParticipant(partition));
}
}
}
return ret;
}
代码示例来源:origin: org.apache.helix/helix-core
/**
* Checks if the workflow has completed.
* @param ctx Workflow context containing job states
* @param cfg Workflow config containing set of jobs
* @return returns true if all tasks are {@link TaskState#COMPLETED}, false otherwise.
*/
private static boolean isWorkflowComplete(WorkflowContext ctx, WorkflowConfig cfg) {
if (!cfg.isTerminable()) {
return false;
}
for (String job : cfg.getJobDag().getAllNodes()) {
if (ctx.getJobState(job) != TaskState.COMPLETED) {
return false;
}
}
return true;
}
代码示例来源:origin: apache/helix
/**
* Checks if the workflow has completed.
* @param ctx Workflow context containing job states
* @param cfg Workflow config containing set of jobs
* @return returns true if all tasks are {@link TaskState#COMPLETED}, false otherwise.
*/
private static boolean isWorkflowComplete(WorkflowContext ctx, WorkflowConfig cfg) {
if (!cfg.isTerminable()) {
return false;
}
for (String job : cfg.getJobDag().getAllNodes()) {
if (ctx.getJobState(job) != TaskState.COMPLETED) {
return false;
}
}
return true;
}
代码示例来源:origin: apache/helix
private void verifyJobNotInQueue(String queueName, String namedSpacedJobName) {
WorkflowConfig workflowCfg = _driver.getWorkflowConfig(queueName);
JobDag dag = workflowCfg.getJobDag();
Assert.assertFalse(dag.getAllNodes().contains(namedSpacedJobName));
Assert.assertFalse(dag.getChildrenToParents().containsKey(namedSpacedJobName));
Assert.assertFalse(dag.getParentsToChildren().containsKey(namedSpacedJobName));
}
}
代码示例来源:origin: org.apache.helix/helix-core
/**
* Checks if the workflow has been stopped.
* @param ctx Workflow context containing task states
* @param cfg Workflow config containing set of tasks
* @return returns true if all tasks are {@link TaskState#STOPPED}, false otherwise.
*/
protected boolean isWorkflowStopped(WorkflowContext ctx, WorkflowConfig cfg) {
for (String job : cfg.getJobDag().getAllNodes()) {
TaskState jobState = ctx.getJobState(job);
if (jobState != null
&& (jobState.equals(TaskState.IN_PROGRESS) || jobState.equals(TaskState.STOPPING))) {
return false;
}
}
return true;
}
代码示例来源:origin: apache/helix
/**
* Checks if the workflow has been stopped.
* @param ctx Workflow context containing task states
* @param cfg Workflow config containing set of tasks
* @return returns true if all tasks are {@link TaskState#STOPPED}, false otherwise.
*/
protected boolean isWorkflowStopped(WorkflowContext ctx, WorkflowConfig cfg) {
for (String job : cfg.getJobDag().getAllNodes()) {
TaskState jobState = ctx.getJobState(job);
if (jobState != null
&& (jobState.equals(TaskState.IN_PROGRESS) || jobState.equals(TaskState.STOPPING))) {
return false;
}
}
return true;
}
代码示例来源:origin: apache/helix
@GET
public Response getJobs(@PathParam("clusterId") String clusterId,
@PathParam("workflowName") String workflowName) {
TaskDriver driver = getTaskDriver(clusterId);
WorkflowConfig workflowConfig = driver.getWorkflowConfig(workflowName);
ObjectNode root = JsonNodeFactory.instance.objectNode();
if (workflowConfig == null) {
return badRequest(String.format("Workflow %s is not found!", workflowName));
}
Set<String> jobs = workflowConfig.getJobDag().getAllNodes();
root.put(Properties.id.name(), JobProperties.Jobs.name());
ArrayNode jobsNode = root.putArray(JobProperties.Jobs.name());
if (jobs != null) {
jobsNode.addAll((ArrayNode) OBJECT_MAPPER.valueToTree(jobs));
}
return JSONRepresentation(root);
}
代码示例来源:origin: apache/helix
public WorkflowConfig(WorkflowConfig cfg, String workflowId) {
this(workflowId, cfg.getJobDag(), cfg.getParallelJobs(), cfg.getTargetState(), cfg.getExpiry(),
cfg.getFailureThreshold(), cfg.isTerminable(), cfg.getScheduleConfig(), cfg.getCapacity(),
cfg.getWorkflowType(), cfg.isJobQueue(), cfg.getJobTypes(), cfg.getJobPurgeInterval(),
cfg.isAllowOverlapJobAssignment(), cfg.getTimeout());
}
代码示例来源:origin: org.apache.helix/helix-core
public WorkflowConfig(WorkflowConfig cfg, String workflowId) {
this(workflowId, cfg.getJobDag(), cfg.getParallelJobs(), cfg.getTargetState(), cfg.getExpiry(),
cfg.getFailureThreshold(), cfg.isTerminable(), cfg.getScheduleConfig(), cfg.getCapacity(),
cfg.getWorkflowType(), cfg.isJobQueue(), cfg.getJobTypes(), cfg.getJobPurgeInterval(),
cfg.isAllowOverlapJobAssignment(), cfg.getTimeout());
}
代码示例来源:origin: org.apache.helix/helix-core
public Builder(WorkflowConfig workflowConfig) {
_workflowId = workflowConfig.getWorkflowId();
_taskDag = workflowConfig.getJobDag();
_parallelJobs = workflowConfig.getParallelJobs();
_targetState = workflowConfig.getTargetState();
_expiry = workflowConfig.getExpiry();
_isTerminable = workflowConfig.isTerminable();
_scheduleConfig = workflowConfig.getScheduleConfig();
_capacity = workflowConfig.getCapacity();
_failureThreshold = workflowConfig.getFailureThreshold();
_workflowType = workflowConfig.getWorkflowType();
_isJobQueue = workflowConfig.isJobQueue();
_jobTypes = workflowConfig.getJobTypes();
_jobPurgeInterval = workflowConfig.getJobPurgeInterval();
_allowOverlapJobAssignment = workflowConfig.isAllowOverlapJobAssignment();
_timeout = workflowConfig.getTimeout();
}
代码示例来源:origin: apache/helix
public Builder(WorkflowConfig workflowConfig) {
_workflowId = workflowConfig.getWorkflowId();
_taskDag = workflowConfig.getJobDag();
_parallelJobs = workflowConfig.getParallelJobs();
_targetState = workflowConfig.getTargetState();
_expiry = workflowConfig.getExpiry();
_isTerminable = workflowConfig.isTerminable();
_scheduleConfig = workflowConfig.getScheduleConfig();
_capacity = workflowConfig.getCapacity();
_failureThreshold = workflowConfig.getFailureThreshold();
_workflowType = workflowConfig.getWorkflowType();
_isJobQueue = workflowConfig.isJobQueue();
_jobTypes = workflowConfig.getJobTypes();
_jobPurgeInterval = workflowConfig.getJobPurgeInterval();
_allowOverlapJobAssignment = workflowConfig.isAllowOverlapJobAssignment();
_timeout = workflowConfig.getTimeout();
}
代码示例来源:origin: apache/helix
@Test
public void testJobQueueCleanUp() throws InterruptedException {
String queueName = TestHelper.getTestMethodName();
JobQueue.Builder builder = TaskTestUtil.buildJobQueue(queueName);
JobConfig.Builder jobBuilder =
new JobConfig.Builder().setTargetResource(WorkflowGenerator.DEFAULT_TGT_DB)
.setCommand(MockTask.TASK_COMMAND).setMaxAttemptsPerTask(2)
.setJobCommandConfigMap(ImmutableMap.of(MockTask.SUCCESS_COUNT_BEFORE_FAIL, "2"));
for (int i = 0; i < 5; i++) {
builder.enqueueJob("JOB" + i, jobBuilder);
}
_driver.start(builder.build());
_driver.pollForJobState(queueName, TaskUtil.getNamespacedJobName(queueName, "JOB" + 4),
TaskState.FAILED);
_driver.cleanupQueue(queueName);
Assert.assertEquals(_driver.getWorkflowConfig(queueName).getJobDag().size(), 0);
}
代码示例来源:origin: apache/helix
@Test public void testJobQueueNotCleanupRunningJobs() throws InterruptedException {
String queueName = TestHelper.getTestMethodName();
JobQueue.Builder builder = TaskTestUtil.buildJobQueue(queueName);
JobConfig.Builder jobBuilder =
new JobConfig.Builder().setTargetResource(WorkflowGenerator.DEFAULT_TGT_DB)
.setCommand(MockTask.TASK_COMMAND).setMaxAttemptsPerTask(2);
for (int i = 0; i < 3; i++) {
builder.enqueueJob("JOB" + i, jobBuilder);
}
builder.enqueueJob("JOB" + 3,
jobBuilder.setJobCommandConfigMap(ImmutableMap.of(MockTask.JOB_DELAY, "1000000")));
builder.enqueueJob("JOB" + 4, jobBuilder);
_driver.start(builder.build());
_driver.pollForJobState(queueName, TaskUtil.getNamespacedJobName(queueName, "JOB" + 3),
TaskState.IN_PROGRESS);
_driver.cleanupQueue(queueName);
Assert.assertEquals(_driver.getWorkflowConfig(queueName).getJobDag().size(), 2);
}
我正在尝试使用 C# 在我的 WPF 世界中为一条鱼制作动画我正在使用 helixtoolkit 导入和显示对象 现在要创建的代码如下: public MainViewModel() { var
本文整理了Java中org.apache.helix.ZNRecord类的一些代码示例,展示了ZNRecord类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等
本文整理了Java中org.apache.helix.ZNRecordUpdater类的一些代码示例,展示了ZNRecordUpdater类的具体用法。这些代码示例主要来源于Github/Stacko
在新的 Habitat 设置上遇到问题...遵循所有步骤,发布项目等,但现在我收到此错误: 拒绝访问路径“$(sourceFolder)\feature\accounts\serialization”
我在 Helix Toolkit 上找到了一个示例,它调用了 ScatterPlot,这非常接近我真正需要的。但是我找不到任何关于如何向创建的对象(在本例中为球体)添加一些 onclick 事件监听器
我有一组程序图像,我想将它们作为广告牌添加到我的 helix 3D 应用程序中。 目前我的应用程序如下所示: public partial class _3DControl { HelixVi
说到 基于终端的文本编辑器,通常 Vim、Emacs 和 Nano 受到了关注。 这并不意味着没有其他这样的文本编辑器。Vim 的现代增强版 Neovim,是许多这样的例子
本文整理了Java中org.apache.helix.task.WorkflowContext类的一些代码示例,展示了WorkflowContext类的具体用法。这些代码示例主要来源于Github/S
本文整理了Java中org.apache.helix.task.WorkflowConfig类的一些代码示例,展示了WorkflowConfig类的具体用法。这些代码示例主要来源于Github/Sta
本文整理了Java中org.apache.helix.messaging.ZNRecordRow类的一些代码示例,展示了ZNRecordRow类的具体用法。这些代码示例主要来源于Github/Stac
我在一个使用 的项目中工作Perforce 存储库。所以我使用 P4 和 P4V 工具,进行提交和提交。现在我决定让我的机器更干净,所以我重新安装了 Ubuntu,并进行了新的设置。 安装P4和P4V
我正在使用 HelixToolkit 来展示一些 3-D 模型。窗口右下角有一个图标。怎么可能隐藏?请看这个截图: 最佳答案 您只需设置 HelixViewport3D的 ShowViewCube属性
C#,WPF,Helix Toolkit .我正在尝试从 HelixViewport3D 视口(viewport)(如 here 所述)保存图像,但仍有问题。 预期方法:将图像渲染到视口(viewpo
我想将 Apache Helix 与 ZooKeeper 以外的共识服务一起使用。有可能这样做吗?需要实现哪些 API? 最佳答案 Helix 使用 ZooKeeper 来维护集群的状态,并在集群状态
Apache Helix 和 Hadoop YARN (MRv2) 之间有什么区别。有没有人有这两种技术的经验?有人能给我解释一下 Helix 相对于 YARN 的优点/缺点,以及为什么 Linked
本文整理了Java中org.apache.helix.manager.zk.ZNRecordSerializer类的一些代码示例,展示了ZNRecordSerializer类的具体用法。这些代码示例主
本文整理了Java中org.apache.helix.manager.zk.ZKHelixAdmin类的一些代码示例,展示了ZKHelixAdmin类的具体用法。这些代码示例主要来源于Github/S
本文整理了Java中org.apache.helix.store.zk.ZkHelixPropertyStore类的一些代码示例,展示了ZkHelixPropertyStore类的具体用法。这些代码示
本文整理了Java中org.apache.helix.ZNRecord.getRawPayload()方法的一些代码示例,展示了ZNRecord.getRawPayload()的具体用法。这些代码示例
本文整理了Java中org.apache.helix.ZNRecord.getIntField()方法的一些代码示例,展示了ZNRecord.getIntField()的具体用法。这些代码示例主要来源
我是一名优秀的程序员,十分优秀!