use of com.netflix.conductor.common.metadata.events.EventExecution in project conductor by Netflix.
the class AbstractProtoMapper method fromProto.
public EventExecution fromProto(EventExecutionPb.EventExecution from) {
EventExecution to = new EventExecution();
to.setId(from.getId());
to.setMessageId(from.getMessageId());
to.setName(from.getName());
to.setEvent(from.getEvent());
to.setCreated(from.getCreated());
to.setStatus(fromProto(from.getStatus()));
to.setAction(fromProto(from.getAction()));
Map<String, Object> outputMap = new HashMap<String, Object>();
for (Map.Entry<String, Value> pair : from.getOutputMap().entrySet()) {
outputMap.put(pair.getKey(), fromProto(pair.getValue()));
}
to.setOutput(outputMap);
return to;
}
use of com.netflix.conductor.common.metadata.events.EventExecution in project conductor by Netflix.
the class TestElasticSearchRestDAOV7 method shouldAddEventExecution.
@Test
public void shouldAddEventExecution() {
String event = "event";
EventExecution execution1 = createEventExecution(event);
EventExecution execution2 = createEventExecution(event);
indexDAO.addEventExecution(execution1);
indexDAO.addEventExecution(execution2);
List<EventExecution> indexedExecutions = tryFindResults(() -> indexDAO.getEventExecutions(event), 2);
assertEquals(2, indexedExecutions.size());
assertTrue("Not all event executions was indexed", indexedExecutions.containsAll(Arrays.asList(execution1, execution2)));
}
use of com.netflix.conductor.common.metadata.events.EventExecution in project conductor by Netflix.
the class TestElasticSearchRestDAOV7 method shouldAsyncAddEventExecution.
@Test
public void shouldAsyncAddEventExecution() throws Exception {
String event = "event2";
EventExecution execution1 = createEventExecution(event);
EventExecution execution2 = createEventExecution(event);
indexDAO.asyncAddEventExecution(execution1).get();
indexDAO.asyncAddEventExecution(execution2).get();
List<EventExecution> indexedExecutions = tryFindResults(() -> indexDAO.getEventExecutions(event), 2);
assertEquals(2, indexedExecutions.size());
assertTrue("Not all event executions was indexed", indexedExecutions.containsAll(Arrays.asList(execution1, execution2)));
}
use of com.netflix.conductor.common.metadata.events.EventExecution in project conductor by Netflix.
the class ElasticSearchRestDAOV5 method mapEventExecutionsResponse.
private List<EventExecution> mapEventExecutionsResponse(SearchResponse response) throws IOException {
SearchHit[] hits = response.getHits().getHits();
List<EventExecution> executions = new ArrayList<>(hits.length);
for (SearchHit hit : hits) {
String source = hit.getSourceAsString();
EventExecution tel = objectMapper.readValue(source, EventExecution.class);
executions.add(tel);
}
return executions;
}
use of com.netflix.conductor.common.metadata.events.EventExecution in project conductor by Netflix.
the class ElasticSearchDAOV6 method mapEventExecutionsResponse.
private List<EventExecution> mapEventExecutionsResponse(SearchResponse response) throws IOException {
SearchHit[] hits = response.getHits().getHits();
List<EventExecution> executions = new ArrayList<>(hits.length);
for (SearchHit hit : hits) {
String source = hit.getSourceAsString();
EventExecution tel = objectMapper.readValue(source, EventExecution.class);
executions.add(tel);
}
return executions;
}
Aggregations