use of com.netflix.conductor.common.metadata.tasks.PollData in project conductor by Netflix.
the class RedisPollDataDAO method updateLastPollData.
@Override
public void updateLastPollData(String taskDefName, String domain, String workerId) {
Preconditions.checkNotNull(taskDefName, "taskDefName name cannot be null");
PollData pollData = new PollData(taskDefName, domain, workerId, System.currentTimeMillis());
String key = nsKey(POLL_DATA, pollData.getQueueName());
String field = (domain == null) ? "DEFAULT" : domain;
String payload = toJson(pollData);
recordRedisDaoRequests("updatePollData");
recordRedisDaoPayloadSize("updatePollData", payload.length(), "n/a", "n/a");
dynoClient.hset(key, field, payload);
}
use of com.netflix.conductor.common.metadata.tasks.PollData in project conductor by Netflix.
the class RedisPollDataDAO method getPollData.
@Override
public PollData getPollData(String taskDefName, String domain) {
Preconditions.checkNotNull(taskDefName, "taskDefName name cannot be null");
String key = nsKey(POLL_DATA, taskDefName);
String field = (domain == null) ? "DEFAULT" : domain;
String pollDataJsonString = dynoClient.hget(key, field);
recordRedisDaoRequests("getPollData");
recordRedisDaoPayloadSize("getPollData", StringUtils.length(pollDataJsonString), "n/a", "n/a");
PollData pollData = null;
if (StringUtils.isNotBlank(pollDataJsonString)) {
pollData = readValue(pollDataJsonString, PollData.class);
}
return pollData;
}
Aggregations