我正在尝试添加一个简单的sleep
函数来扩展基本ESQL API。
Java实现:
public static void sleep(long millis) {
try {
Thread.sleep(millis);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
ESQL参考:
CREATE PROCEDURE sleep(IN millis INT)
LANGUAGE JAVA
EXTERNAL NAME "com.mypackage.Util.sleep";
这是错误跟踪:
(0x01000000:Name ):RecoverableException = (
(0x03000000:NameValue):File = '/build/S610_P/src/DataFlowEngine/ImbRdl/ImbRdlExternalJava.cpp' (CHARACTER)
(0x03000000:NameValue):Line = 1102 (INTEGER)
(0x03000000:NameValue):Function = 'ESQL2JavaMethodResolver::decodeReturnStatus' (CHARACTER)
(0x03000000:NameValue):Type = '' (CHARACTER)
(0x03000000:NameValue):Name = '' (CHARACTER)
(0x03000000:NameValue):Label = '' (CHARACTER)
(0x03000000:NameValue):Catalog = 'BIPv610' (CHARACTER)
(0x03000000:NameValue):Severity = 3 (INTEGER)
(0x03000000:NameValue):Number = 2946 (INTEGER)
(0x03000000:NameValue):Text = 'The Java method could not be found' (CHARACTER)
(0x01000000:Name ):Insert = (
(0x03000000:NameValue):Type = 5 (INTEGER)
(0x03000000:NameValue):Text = 'com.mypackage.Util.sleep' (CHARACTER)
)
)
)
)
)
答案 0 :(得分:0)
解决!供将来参考:
问题出在需要包装类型的方法签名检查中
在这种情况下,Long
代替long
。
public static void sleep(Long millis) {
try {
Thread.sleep(millis);
} catch (InterruptedException e) {
e.printStackTrace();
}
}