Java Code Examples for com.datastax.driver.core.UDTValue#setInt()

The following examples show how to use com.datastax.driver.core.UDTValue#setInt() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JobsService.java    From hawkular-metrics with Apache License 2.0 6 votes vote down vote up
static UDTValue getRepeatingTriggerValue(RxSession session, RepeatingTrigger trigger) {
    UserType triggerType = getKeyspace(session).getUserType("trigger_def");
    UDTValue triggerUDT = triggerType.newValue();
    triggerUDT.setInt("type", 1);
    triggerUDT.setLong("interval", trigger.getInterval());
    triggerUDT.setLong("trigger_time", trigger.getTriggerTime());
    if (trigger.getDelay() > 0) {
        triggerUDT.setLong("delay", trigger.getDelay());
    }
    if (trigger.getRepeatCount() != null) {
        triggerUDT.setInt("repeat_count", trigger.getRepeatCount());
        triggerUDT.setInt("execution_count", trigger.getExecutionCount());
    }

    return triggerUDT;
}
 
Example 2
Source File: JobsService.java    From hawkular-metrics with Apache License 2.0 5 votes vote down vote up
static UDTValue getSingleExecutionTriggerValue(RxSession session, SingleExecutionTrigger trigger) {
    UserType triggerType = getKeyspace(session).getUserType("trigger_def");
    UDTValue triggerUDT = triggerType.newValue();
    triggerUDT.setInt("type", 0);
    triggerUDT.setLong("trigger_time", trigger.getTriggerTime());

    return triggerUDT;
}