- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中co.cask.cdap.api.workflow.WorkflowToken.getAll()
方法的一些代码示例,展示了WorkflowToken.getAll()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WorkflowToken.getAll()
方法的具体详情如下:
包路径:co.cask.cdap.api.workflow.WorkflowToken
类名称:WorkflowToken
方法名:getAll
[英]Same key can be added to the WorkflowToken by multiple nodes. This method returns the key to List of NodeValueadded in the Scope#USER scope.
[中]多个节点可以向WorkflowToken添加相同的密钥。此方法返回作用域#用户作用域中添加的nodeValueList的键。
代码示例来源:origin: cdapio/cdap
/**
* Merge the other WorkflowToken passed to the method as a parameter
* with the WorkflowToken on which the method is invoked.
* @param other the other WorkflowToken to be merged
*/
synchronized void mergeToken(WorkflowToken other) {
for (Scope scope : Scope.values()) {
Map<String, List<NodeValue>> thisTokenValueMapForScope = this.tokenValueMap.get(scope);
for (Map.Entry<String, List<NodeValue>> otherTokenValueMapForScopeEntry : other.getAll(scope).entrySet()) {
String otherKey = otherTokenValueMapForScopeEntry.getKey();
if (!thisTokenValueMapForScope.containsKey(otherKey)) {
thisTokenValueMapForScope.put(otherKey, Lists.<NodeValue>newArrayList());
}
// Iterate over the list of NodeValue corresponding to the current key.
// Only add those NodeValue to the merged token which already do not exist.
for (NodeValue otherNodeValue : otherTokenValueMapForScopeEntry.getValue()) {
boolean otherNodeValueExist = false;
for (NodeValue thisNodeValue : thisTokenValueMapForScope.get(otherKey)) {
if (thisNodeValue.equals(otherNodeValue)) {
otherNodeValueExist = true;
break;
}
}
if (!otherNodeValueExist) {
addOrUpdate(otherKey, otherNodeValue, thisTokenValueMapForScope.get(otherKey), -1);
}
}
}
}
}
代码示例来源:origin: co.cask.cdap/cdap-app-fabric
@GET
@Path("/apps/{app-id}/workflows/{workflow-id}/runs/{run-id}/token")
public void getWorkflowToken(HttpRequest request, HttpResponder responder,
@PathParam("namespace-id") String namespaceId,
@PathParam("app-id") String appId,
@PathParam("workflow-id") String workflowId,
@PathParam("run-id") String runId,
@QueryParam("scope") @DefaultValue("user") String scope,
@QueryParam("key") @DefaultValue("") String key) throws NotFoundException {
WorkflowToken workflowToken = getWorkflowToken(namespaceId, appId, workflowId, runId);
WorkflowToken.Scope tokenScope = WorkflowToken.Scope.valueOf(scope.toUpperCase());
WorkflowTokenDetail workflowTokenDetail = WorkflowTokenDetail.of(workflowToken.getAll(tokenScope));
Type workflowTokenDetailType = new TypeToken<WorkflowTokenDetail>() { }.getType();
if (key.isEmpty()) {
responder.sendJson(HttpResponseStatus.OK, GSON.toJson(workflowTokenDetail, workflowTokenDetailType));
return;
}
List<NodeValue> nodeValueEntries = workflowToken.getAll(key, tokenScope);
if (nodeValueEntries.isEmpty()) {
throw new NotFoundException(key);
}
responder.sendJson(HttpResponseStatus.OK,
GSON.toJson(WorkflowTokenDetail.of(Collections.singletonMap(key, nodeValueEntries)),
workflowTokenDetailType));
}
代码示例来源:origin: co.cask.cdap/cdap-app-fabric
/**
* Merge the other WorkflowToken passed to the method as a parameter
* with the WorkflowToken on which the method is invoked.
* @param other the other WorkflowToken to be merged
*/
synchronized void mergeToken(WorkflowToken other) {
for (Scope scope : Scope.values()) {
Map<String, List<NodeValue>> thisTokenValueMapForScope = this.tokenValueMap.get(scope);
for (Map.Entry<String, List<NodeValue>> otherTokenValueMapForScopeEntry : other.getAll(scope).entrySet()) {
String otherKey = otherTokenValueMapForScopeEntry.getKey();
if (!thisTokenValueMapForScope.containsKey(otherKey)) {
thisTokenValueMapForScope.put(otherKey, Lists.<NodeValue>newArrayList());
}
// Iterate over the list of NodeValue corresponding to the current key.
// Only add those NodeValue to the merged token which already do not exist.
for (NodeValue otherNodeValue : otherTokenValueMapForScopeEntry.getValue()) {
boolean otherNodeValueExist = false;
for (NodeValue thisNodeValue : thisTokenValueMapForScope.get(otherKey)) {
if (thisNodeValue.equals(otherNodeValue)) {
otherNodeValueExist = true;
break;
}
}
if (!otherNodeValueExist) {
addOrUpdate(otherKey, otherNodeValue, thisTokenValueMapForScope.get(otherKey), -1);
}
}
}
}
}
代码示例来源:origin: cdapio/cdap
@GET
@Path("/apps/{app-id}/workflows/{workflow-id}/runs/{run-id}/token")
public void getWorkflowToken(HttpRequest request, HttpResponder responder,
@PathParam("namespace-id") String namespaceId,
@PathParam("app-id") String appId,
@PathParam("workflow-id") String workflowId,
@PathParam("run-id") String runId,
@QueryParam("scope") @DefaultValue("user") String scope,
@QueryParam("key") @DefaultValue("") String key) throws NotFoundException {
WorkflowToken workflowToken = getWorkflowToken(namespaceId, appId, workflowId, runId);
WorkflowToken.Scope tokenScope = WorkflowToken.Scope.valueOf(scope.toUpperCase());
WorkflowTokenDetail workflowTokenDetail = WorkflowTokenDetail.of(workflowToken.getAll(tokenScope));
Type workflowTokenDetailType = new TypeToken<WorkflowTokenDetail>() { }.getType();
if (key.isEmpty()) {
responder.sendJson(HttpResponseStatus.OK, GSON.toJson(workflowTokenDetail, workflowTokenDetailType));
return;
}
List<NodeValue> nodeValueEntries = workflowToken.getAll(key, tokenScope);
if (nodeValueEntries.isEmpty()) {
throw new NotFoundException(key);
}
responder.sendJson(HttpResponseStatus.OK,
GSON.toJson(WorkflowTokenDetail.of(Collections.singletonMap(key, nodeValueEntries)),
workflowTokenDetailType));
}
代码示例来源:origin: co.cask.cdap/cdap-etl-batch
WorkflowToken token = context.getToken();
for (WorkflowToken.Scope scope : Arrays.asList(WorkflowToken.Scope.SYSTEM, WorkflowToken.Scope.USER)) {
Map<String, List<NodeValue>> all = token.getAll(scope);
for (Map.Entry<String, List<NodeValue>> entry : all.entrySet()) {
if (!entry.getKey().startsWith(Constants.StageStatistics.PREFIX + ".")) {
代码示例来源:origin: co.cask.hydrator/core-plugins
WorkflowToken token = context.getToken();
String message = config.includeWorkflowToken ?
config.message + "\nUSER Workflow Tokens:\n" + token.getAll(WorkflowToken.Scope.USER)
+ "\nSYSTEM Workflow Tokens:\n" + token.getAll(WorkflowToken.Scope.SYSTEM) :
config.message;
msg.setText(message);
代码示例来源:origin: co.cask.cdap/cdap-data-pipeline
List<NodeValue> allNodeValues = token.getAll(Constants.FIELD_OPERATION_KEY_IN_WORKFLOW_TOKEN);
代码示例来源:origin: cdapio/cdap
if (trueBranchExecuted) {
List<NodeValue> nodeValueEntries = workflowToken.getAll("action.type");
Preconditions.checkArgument(5 == nodeValueEntries.size());
Preconditions.checkArgument(new NodeValue("RecordVerifier",
} else {
List<NodeValue> nodeValueEntries = workflowToken.getAll("action.type");
Preconditions.checkArgument(5 == nodeValueEntries.size());
Preconditions.checkArgument(new NodeValue("RecordVerifier",
validateMapReduceCounters(workflowToken, "RecordVerifier");
Map<String, List<NodeValue>> allUserKeys = workflowToken.getAll(WorkflowToken.Scope.USER);
Preconditions.checkArgument(5 == allUserKeys.get("action.type").size());
代码示例来源:origin: cdapio/cdap
@Override
public boolean apply(@Nullable WorkflowContext input) {
if (input != null) {
input.getToken().put("action.type", "Condition");
List<NodeValue> goodRecords = input.getToken().getAll("MyCustomCounter.GoodRecord", WorkflowToken.Scope.SYSTEM);
List<NodeValue> badRecords = input.getToken().getAll("MyCustomCounter.BadRecord", WorkflowToken.Scope.SYSTEM);
// If number of good records are greater than the number of bad records then only
// return true to execute the true branch associated with this Condition node
if (goodRecords.get(0).getValue().getAsLong() > badRecords.get(0).getValue().getAsLong()) {
input.getToken().put("conditionResult", "true");
return true;
}
input.getToken().put("conditionResult", "false");
}
return false;
}
}
代码示例来源:origin: cdapio/cdap
@Test
public void testSerDeserScheduleInfo() {
BasicWorkflowToken token = new BasicWorkflowToken(1);
token.setCurrentNode("node");
token.put("tokenKey", "tokenVal");
List<TriggerInfo> triggerInfos = ImmutableList.of(
new DefaultProgramStatusTriggerInfo("ns", Specifications.from(new WorkflowAppWithFork()), ProgramType.WORKFLOW,
WorkflowAppWithFork.WorkflowWithFork.class.getSimpleName(),
RunIds.generate(), ProgramStatus.COMPLETED,
token, Collections.emptyMap()),
new DefaultPartitionTriggerInfo("ns", "ds", 10, 11),
new DefaultTimeTriggerInfo("1 * * * *", 0L)
);
TriggeringScheduleInfo scheduleInfo = new DefaultTriggeringScheduleInfo("schedule", "description", triggerInfos,
ImmutableMap.of("key", "value"));
String scheduleInfoJson = GSON.toJson(scheduleInfo);
TriggeringScheduleInfo deserializedScheduleInfo = GSON.fromJson(scheduleInfoJson,
TriggeringScheduleInfo.class);
Assert.assertEquals(scheduleInfoJson, GSON.toJson(deserializedScheduleInfo));
DefaultProgramStatusTriggerInfo expectedProgramStatusTriggerInfo =
(DefaultProgramStatusTriggerInfo) triggerInfos.get(0);
DefaultProgramStatusTriggerInfo deserializedProgramStatusTriggerInfo =
(DefaultProgramStatusTriggerInfo) deserializedScheduleInfo.getTriggerInfos().get(0);
Assert.assertEquals(expectedProgramStatusTriggerInfo.getApplicationSpecification().getName(),
deserializedProgramStatusTriggerInfo.getApplicationSpecification().getName());
Assert.assertEquals(expectedProgramStatusTriggerInfo.getWorkflowToken().getAll(),
deserializedProgramStatusTriggerInfo.getWorkflowToken().getAll());
}
}
我将 Angular 更新到版本 1.6.4。所以我必须将 .success 和 .error 更新为 .then 现在我收到以下错误: TypeError: .getAll(...).then is
对于像这样的简单域类: class Color { String name; } 为什么getAll()不起作用? @TestFor(MyColorService) @TestMixin(Do
我正在尝试使用泛型修改我的代码以避免所有重复的代码。 我有一个 DBBaseClass 类,它将由其他一些类扩展。我正在尝试创建一个 getAll 方法,该方法返回存储在数据库中的子类的所有对象。
我得到 RqlRuntimeError: Expected type TABLE_SLICE but found SELECTION: 链接 getAll 和 between 方法时出现错误。 r.d
我正在尝试将服务 worker 实现到我的应用程序中,我已经在 Chrome、Firefox 和 Safari 中成功做到了这一点,但在 IE 中还没有完全做到。到目前为止,我能够创建一个对象存储并向
亲爱的, 我只是想知道是否可以创建一个以 SQL 查询作为参数并继续处理请求的函数。考虑两个函数: async addExpense(req, res){ const addExpense =
我试图更新数据库上的一行,并注意到一旦更新了该行,getAll就会停止正常工作。所有已更新的记录开始从getAll的结果中丢失。 例如,假设您有一个产品列表[product1,product2,pro
这是使用 Xodus API 限制实体查询的方法: final EntityIterable allUsers = txn.getAll(storeName).skip(skip).take(limi
我想做一个项目来学习Java ee。我计划建立一个票务管理系统。所以我创建了一个 mysql 数据库、实体类、访问类、ejb 类,最后是 WService 类。对于单个 Seat 和 Customer
我正在做一个 java 应用程序。 到目前为止,这是我的文件: 人机界面。 有一个 setName(String aName) 方法 PersonImpl 人机界面的实现。 个人工厂接口(interf
IDBObjectStore有一个方法 getAll() . 但是,TypeScript 报告没有这样的方法。 lib.d.ts 中的相关部分是: interface IDBObjectStore {
我正在尝试使用 ngrx-data-lab作为我的项目的示例。 这是 stackblitz我使用的项目。 我不能使用我正在使用的服务器的实际 url。该网址属于我的公司。但实际情况是服务器将随机生成的
使用带有 4 个 Analytics 标记的 Google 跟踪代码管理器:3 个标记在“页面查看”上触发,而 1 个标记在“JavaScript 错误”上触发。 标签本身工作正常:如果 uncaug
在数据访问层中使用如下方法很常见: Tuple> GetAllWithFilter(int? page, string folderName, string title, string fil
我正在开发一个简单的 chrome 扩展程序,只需单击一下即可删除域中的所有 cookie,但由于某种原因,它无法正常工作。当我尝试从域中获取所有 cookie 时,它返回一个空数组。我究竟做错了
Angular 4 使用 get 和 getAll 方法添加了对 paramMap 的支持: 我能理解这段产生“id”值的代码 route.paramMap.subscribe( param
我在 Java 中使用 Ignite v2。下面是我的点燃节点配置。 CacheConfiguration cacheCfg = new CacheConfiguration(); c
我想为 google chrome/chromium 编写一个扩展(一个 session 管理器,它比画廊中已有的具有更多的功能和视觉效果)。 但是我无法让下面的代码工作: function list
我正在使用 Guava LoadingCache 将所有元素一次批量加载到我的急切缓存中。但是执行loadAll我提供的方法实际上并不需要 Iterable keys 参数,因为我的 DAO 也不排除
我正在使用 getAll()从数据库中获取所有项目的方法。 db.transaction('history', 'readonly').objectStore('history').getAll().
我是一名优秀的程序员,十分优秀!