blob: be0bb66f91f1455471df6299b1ab39cf2975bf61 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.search.grouping.request;
import java.util.Arrays;
/**
* This class represents debug_wait function in a {@link GroupingExpression}. For each hit evaluated,
* it waits for the time specified as the second argument. The third argument specifies if the wait
* should be a busy-wait or not. The first argument is then evaluated.
*
* @author <a href="mailto:lulf@yahoo-inc.com">Ulf Lilleengen</a>
*/
public class DebugWaitFunction extends FunctionNode {
/**
* Constructs a new instance of this class.
*
* @param arg1 The first compulsory argument, the expression to proxy.
* @param arg2 The second compulsory argument, must evaluate to a positive number.
* @param arg3 The third compulsory argument, specifying busy wait or not.
*/
public DebugWaitFunction(GroupingExpression arg1, DoubleValue arg2, BooleanValue arg3) {
super("debugwait", Arrays.asList(arg1, arg2, arg3));
}
/**
* Returns the time to wait when evaluating this function.
*
* @return the number of seconds to wait.
*/
public double getWaitTime() {
return ((DoubleValue)getArg(1)).getValue();
}
/**
* Returns whether or not the debug node should busy-wait.
*
* @return true if busy-wait, false if not.
*/
public boolean getBusyWait() {
return ((BooleanValue)getArg(2)).getValue();
}
}
|