本文整理汇总了Java中org.wso2.siddhi.core.util.config.ConfigReader类的典型用法代码示例。如果您正苦于以下问题:Java ConfigReader类的具体用法?Java ConfigReader怎么用?Java ConfigReader使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ConfigReader类属于org.wso2.siddhi.core.util.config包,在下文中一共展示了ConfigReader类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: init
import org.wso2.siddhi.core.util.config.ConfigReader; //导入依赖的package包/类
/**
* Initialize the mapper and the mapping configurations.
*
* @param streamDefinition The stream definition
* @param optionHolder Option holder containing static and dynamic options
* @param payloadTemplateBuilderMap Unmapped list of payloads for reference
*/
@Override
public void init(StreamDefinition streamDefinition, OptionHolder optionHolder,
Map<String, TemplateBuilder> payloadTemplateBuilderMap, ConfigReader mapperConfigReader,
SiddhiAppContext siddhiAppContext) {
attributeNameArray = streamDefinition.getAttributeNameArray();
enclosingElement = optionHolder.validateAndGetStaticValue(ENCLOSING_ELEMENT_IDENTIFIER, null);
isJsonValidationEnabled = Boolean.parseBoolean(optionHolder
.validateAndGetStaticValue(JSON_VALIDATION_IDENTIFIER, "false"));
//if @payload() is added there must be at least 1 element in it, otherwise a SiddhiParserException raised
if (payloadTemplateBuilderMap != null && payloadTemplateBuilderMap.size() != 1) {
throw new SiddhiAppCreationException("Json sink-mapper does not support multiple @payload mappings, " +
"error at the mapper of '" + streamDefinition.getId() + "'");
}
if (payloadTemplateBuilderMap != null &&
payloadTemplateBuilderMap.get(payloadTemplateBuilderMap.keySet().iterator().next()).isObjectMessage()) {
throw new SiddhiAppCreationException("Json sink-mapper does not support object @payload mappings, " +
"error at the mapper of '" + streamDefinition.getId() + "'");
}
}
开发者ID:wso2-extensions,项目名称:siddhi-map-json,代码行数:29,代码来源:JsonSinkMapper.java
示例2: getSenderConfigurations
import org.wso2.siddhi.core.util.config.ConfigReader; //导入依赖的package包/类
/**
* Method is responsible for set sender configuration values .
*
* @param httpStaticProperties the map that url details.
* @param clientStoreFile the client trust store file path.
* @param clientStorePass the client trust store pass path.
* @return set of sender configurations.
*/
public static SenderConfiguration getSenderConfigurations(Map<String, String> httpStaticProperties, String
clientStoreFile, String clientStorePass, ConfigReader configReader) {
SenderConfiguration httpSender = new SenderConfiguration(httpStaticProperties
.get(HttpConstants.PORT));
if (httpStaticProperties.get(HttpConstants.SCHEME).equals(HttpConstants.SCHEME_HTTPS)) {
httpSender.setTrustStoreFile(clientStoreFile);
httpSender.setTrustStorePass(clientStorePass);
httpSender.setId(httpStaticProperties.get(HttpConstants.TO));
httpSender.setScheme(httpStaticProperties.get(HttpConstants.SCHEME));
} else {
httpSender.setScheme(httpStaticProperties.get(HttpConstants.SCHEME));
}
if (isHTTPTraceLoggerEnabled(configReader)) {
httpSender.setHttpTraceLogEnabled(true);
}
return httpSender;
}
开发者ID:wso2-extensions,项目名称:siddhi-io-http,代码行数:26,代码来源:HttpSinkUtil.java
示例3: initBootstrapConfigIfFirst
import org.wso2.siddhi.core.util.config.ConfigReader; //导入依赖的package包/类
/**
* Initialize and start the server connector factory. This should be created at once for siddhi.
*
* @param sourceConfigReader the siddhi source config reader.
*/
synchronized void initBootstrapConfigIfFirst(ConfigReader sourceConfigReader) {
// to make sure it will create only once
if ((this.sourceListenersMap.isEmpty()) && (httpConnectorFactory == null)) {
String bootstrapWorker = sourceConfigReader.readConfig(HttpConstants
.SERVER_BOOTSTRAP_WORKER_GROUP_SIZE, HttpConstants.SERVER_BOOTSTRAP_WORKER_GROUP_SIZE_VALUE);
String bootstrapBoss = sourceConfigReader.readConfig(HttpConstants
.SERVER_BOOTSTRAP_BOSS_GROUP_SIZE, HttpConstants.SERVER_BOOTSTRAP_BOSS_GROUP_SIZE_VALUE);
if (!HttpConstants.EMPTY_STRING.equals(bootstrapBoss) && !HttpConstants.EMPTY_STRING.equals
(bootstrapWorker)) {
httpConnectorFactory = new HttpWsConnectorFactoryImpl(Integer.parseInt(bootstrapBoss), Integer
.parseInt(bootstrapWorker));
} else {
httpConnectorFactory = new HttpWsConnectorFactoryImpl();
}
}
}
开发者ID:wso2-extensions,项目名称:siddhi-io-http,代码行数:22,代码来源:HttpConnectorRegistry.java
示例4: init
import org.wso2.siddhi.core.util.config.ConfigReader; //导入依赖的package包/类
/**
* The initialization method for FunctionExecutor, this method will be called before the other methods
* @param attributeExpressionExecutors are the executors of each function parameters
* @param configReader
* @param siddhiAppContext the context of the siddhi app
*/
@Override
protected void init(ExpressionExecutor[] attributeExpressionExecutors, ConfigReader configReader,
SiddhiAppContext siddhiAppContext) {
for (ExpressionExecutor expressionExecutor : attributeExpressionExecutors) {
Attribute.Type attributeType = expressionExecutor.getReturnType();
if (attributeType == Attribute.Type.DOUBLE) {
returnType = attributeType;
} else if ((attributeType == Attribute.Type.STRING) || (attributeType == Attribute.Type.BOOL)) {
throw new SiddhiAppCreationException("Plus cannot have parameters with types String or Bool");
} else {
returnType = Attribute.Type.LONG;
}
}
}
开发者ID:wso2,项目名称:siddhi,代码行数:22,代码来源:CustomFunctionExtension.java
示例5: init
import org.wso2.siddhi.core.util.config.ConfigReader; //导入依赖的package包/类
public final void init(StreamDefinition streamDefinition,
String type,
OptionHolder mapOptionHolder,
List<Element> unmappedPayloadList,
Sink sink, ConfigReader mapperConfigReader,
LatencyTracker mapperLatencyTracker,
SiddhiAppContext siddhiAppContext) {
this.mapperLatencyTracker = mapperLatencyTracker;
this.siddhiAppContext = siddhiAppContext;
sink.setTrpDynamicOptions(trpDynamicOptions);
this.sinkListener = sink;
this.optionHolder = mapOptionHolder;
this.type = type;
if (unmappedPayloadList != null && !unmappedPayloadList.isEmpty()) {
templateBuilderMap = new HashMap<>();
for (Element e : unmappedPayloadList) {
TemplateBuilder templateBuilder = new TemplateBuilder(streamDefinition, e.getValue());
if (templateBuilderMap.containsKey(e.getKey())) {
throw new SiddhiAppCreationException("Duplicate Keys, " + e.getKey() + ", in @payload() ");
}
templateBuilderMap.put(e.getKey(), templateBuilder);
}
}
init(streamDefinition, mapOptionHolder, templateBuilderMap, mapperConfigReader, siddhiAppContext);
}
开发者ID:wso2,项目名称:siddhi,代码行数:27,代码来源:SinkMapper.java
示例6: init
import org.wso2.siddhi.core.util.config.ConfigReader; //导入依赖的package包/类
/**
* Initialize the Distribution strategy with the information it will require to make decisions.
* @param streamDefinition The stream attached to the sink this DistributionStrategy is used in
* @param transportOptionHolder Sink options of the sink which uses this DistributionStrategy
* @param destinationOptionHolders The list of options under @destination of the relevant sink.
* @param configReader This hold the {@link PartitionedDistributionStrategy} configuration reader.
*/
@Override
public void init(StreamDefinition streamDefinition, OptionHolder transportOptionHolder,
OptionHolder distributionOptionHolder, List<OptionHolder> destinationOptionHolders,
ConfigReader configReader) {
totalDestinationCount = destinationOptionHolders.size();
String partitionKey = distributionOptionHolder.validateAndGetStaticValue(SiddhiConstants
.PARTITION_KEY_FIELD_KEY);
if (partitionKey == null || partitionKey.isEmpty()) {
throw new SiddhiAppValidationException("PartitionKey is required for partitioned distribution " +
"strategy.");
}
try {
int partitionKeyFieldPosition = streamDefinition.getAttributePosition(partitionKey);
partitionOption = new Option(partitionKeyFieldPosition);
} catch (AttributeNotExistException e) {
throw new SiddhiAppValidationException("Could not find partition key attribute", e);
}
}
开发者ID:wso2,项目名称:siddhi,代码行数:28,代码来源:PartitionedDistributionStrategy.java
示例7: init
import org.wso2.siddhi.core.util.config.ConfigReader; //导入依赖的package包/类
public final void init(String sourceType, OptionHolder transportOptionHolder, SourceMapper sourceMapper,
String[] transportPropertyNames, ConfigReader configReader, String mapType,
OptionHolder mapOptionHolder, List<AttributeMapping> attributeMappings,
List<AttributeMapping> transportMappings, ConfigReader mapperConfigReader,
SourceHandler sourceHandler, StreamDefinition streamDefinition,
SiddhiAppContext siddhiAppContext) {
this.type = sourceType;
sourceMapper.init(streamDefinition, mapType, mapOptionHolder, attributeMappings, sourceType, transportMappings,
sourceHandler, mapperConfigReader, siddhiAppContext);
this.mapper = sourceMapper;
this.streamDefinition = streamDefinition;
this.elementId = siddhiAppContext.getElementIdGenerator().createNewId();
this.siddhiAppContext = siddhiAppContext;
init(sourceMapper, transportOptionHolder, transportPropertyNames, configReader, siddhiAppContext);
scheduledExecutorService = siddhiAppContext.getScheduledExecutorService();
}
开发者ID:wso2,项目名称:siddhi,代码行数:17,代码来源:Source.java
示例8: init
import org.wso2.siddhi.core.util.config.ConfigReader; //导入依赖的package包/类
public final void init(StreamDefinition streamDefinition, String mapType, OptionHolder mapOptionHolder,
List<AttributeMapping> attributeMappings, String sourceType,
List<AttributeMapping> transportMappings, SourceHandler sourceHandler,
ConfigReader configReader, SiddhiAppContext siddhiAppContext) {
this.streamDefinition = streamDefinition;
this.mapType = mapType;
this.sourceType = sourceType;
this.transportMappings = transportMappings;
if (sourceHandler != null) {
sourceHandler.initSourceHandler(siddhiAppContext.getElementIdGenerator().createNewId(), streamDefinition);
}
this.sourceHandler = sourceHandler;
this.siddhiAppContext = siddhiAppContext;
if (siddhiAppContext.getStatisticsManager() != null) {
this.throughputTracker = QueryParserHelper.createThroughputTracker(siddhiAppContext,
streamDefinition.getId(),
SiddhiConstants.METRIC_INFIX_SOURCES, sourceType);
this.mapperLatencyTracker = QueryParserHelper.createLatencyTracker(siddhiAppContext,
streamDefinition.getId(),
SiddhiConstants.METRIC_INFIX_SOURCE_MAPPERS,
sourceType + SiddhiConstants.METRIC_DELIMITER + mapType);
}
init(streamDefinition, mapOptionHolder, attributeMappings, configReader, siddhiAppContext);
}
开发者ID:wso2,项目名称:siddhi,代码行数:25,代码来源:SourceMapper.java
示例9: init
import org.wso2.siddhi.core.util.config.ConfigReader; //导入依赖的package包/类
@Override
public void init(SourceEventListener sourceEventListener, OptionHolder optionHolder,
String[] requestedTransportPropertyNames, ConfigReader configReader,
SiddhiAppContext siddhiAppContext) {
this.sourceEventListener = sourceEventListener;
String topic = optionHolder.validateAndGetStaticValue(TOPIC_KEY, "input inMemory source");
this.subscriber = new InMemoryBroker.Subscriber() {
@Override
public void onMessage(Object event) {
sourceEventListener.onEvent(event, null);
}
@Override
public String getTopic() {
return topic;
}
};
}
开发者ID:wso2,项目名称:siddhi,代码行数:19,代码来源:InMemorySource.java
示例10: init
import org.wso2.siddhi.core.util.config.ConfigReader; //导入依赖的package包/类
/**
* The initialization method for FunctionExecutor
*
* @param attributeExpressionExecutors are the executors of each attributes in the function
* @param configReader this hold the {@link MinForeverAttributeAggregator} configuration reader.
* @param siddhiAppContext Siddhi app runtime context
*/
@Override
protected void init(ExpressionExecutor[] attributeExpressionExecutors, ConfigReader configReader,
SiddhiAppContext siddhiAppContext) {
if (attributeExpressionExecutors.length != 1) {
throw new OperationNotSupportedException("MinForever aggregator has to have exactly 1 parameter, " +
"currently " + attributeExpressionExecutors.length + " parameters provided");
}
Attribute.Type type = attributeExpressionExecutors[0].getReturnType();
switch (type) {
case FLOAT:
minForeverAttributeAggregator = new MinForeverAttributeAggregatorFloat();
break;
case INT:
minForeverAttributeAggregator = new MinForeverAttributeAggregatorInt();
break;
case LONG:
minForeverAttributeAggregator = new MinForeverAttributeAggregatorLong();
break;
case DOUBLE:
minForeverAttributeAggregator = new MinForeverAttributeAggregatorDouble();
break;
default:
throw new OperationNotSupportedException("MinForever not supported for " + type);
}
}
开发者ID:wso2,项目名称:siddhi,代码行数:33,代码来源:MinForeverAttributeAggregator.java
示例11: init
import org.wso2.siddhi.core.util.config.ConfigReader; //导入依赖的package包/类
/**
* The initialization method for FunctionExecutor
*
* @param attributeExpressionExecutors are the executors of each attributes in the function
* @param configReader this hold the {@link MaxAttributeAggregator} configuration reader.
* @param siddhiAppContext Siddhi app runtime context
*/
@Override
protected void init(ExpressionExecutor[] attributeExpressionExecutors, ConfigReader configReader,
SiddhiAppContext siddhiAppContext) {
if (attributeExpressionExecutors.length != 1) {
throw new OperationNotSupportedException("Max aggregator has to have exactly 1 parameter, currently " +
attributeExpressionExecutors.length + " parameters provided");
}
Attribute.Type type = attributeExpressionExecutors[0].getReturnType();
switch (type) {
case FLOAT:
maxOutputAttributeAggregator = new MaxAttributeAggregatorFloat();
break;
case INT:
maxOutputAttributeAggregator = new MaxAttributeAggregatorInt();
break;
case LONG:
maxOutputAttributeAggregator = new MaxAttributeAggregatorLong();
break;
case DOUBLE:
maxOutputAttributeAggregator = new MaxAttributeAggregatorDouble();
break;
default:
throw new OperationNotSupportedException("Max not supported for " + type);
}
}
开发者ID:wso2,项目名称:siddhi,代码行数:33,代码来源:MaxAttributeAggregator.java
示例12: init
import org.wso2.siddhi.core.util.config.ConfigReader; //导入依赖的package包/类
/**
* The initialization method for FunctionExecutor
*
* @param attributeExpressionExecutors are the executors of each attributes in the function
* @param configReader this hold the {@link AvgAttributeAggregator} configuration reader.
* @param siddhiAppContext Siddhi app runtime context
*/
@Override
protected void init(ExpressionExecutor[] attributeExpressionExecutors, ConfigReader configReader,
SiddhiAppContext siddhiAppContext) {
if (attributeExpressionExecutors.length != 1) {
throw new OperationNotSupportedException("Avg aggregator has to have exactly 1 parameter, currently " +
attributeExpressionExecutors.length + " parameters provided");
}
Attribute.Type type = attributeExpressionExecutors[0].getReturnType();
switch (type) {
case FLOAT:
avgOutputAttributeAggregator = new AvgAttributeAggregatorFloat();
break;
case INT:
avgOutputAttributeAggregator = new AvgAttributeAggregatorInt();
break;
case LONG:
avgOutputAttributeAggregator = new AvgAttributeAggregatorLong();
break;
case DOUBLE:
avgOutputAttributeAggregator = new AvgAttributeAggregatorDouble();
break;
default:
throw new OperationNotSupportedException("Avg not supported for " + type);
}
}
开发者ID:wso2,项目名称:siddhi,代码行数:33,代码来源:AvgAttributeAggregator.java
示例13: initAggregator
import org.wso2.siddhi.core.util.config.ConfigReader; //导入依赖的package包/类
public void initAggregator(ExpressionExecutor[] attributeExpressionExecutors, SiddhiAppContext
siddhiAppContext, ConfigReader configReader) {
this.configReader = configReader;
try {
this.siddhiAppContext = siddhiAppContext;
this.attributeExpressionExecutors = attributeExpressionExecutors;
this.attributeSize = attributeExpressionExecutors.length;
if (elementId == null) {
elementId = "AttributeAggregator-" + siddhiAppContext.getElementIdGenerator().createNewId();
}
//Not added to Snapshotable as the AggregationAttributeExecutors are added
// siddhiAppContext.getSnapshotService().addSnapshotable(this);
init(attributeExpressionExecutors, configReader, siddhiAppContext);
} catch (Throwable t) {
throw new SiddhiAppCreationException(t);
}
}
开发者ID:wso2,项目名称:siddhi,代码行数:18,代码来源:AttributeAggregator.java
示例14: init
import org.wso2.siddhi.core.util.config.ConfigReader; //导入依赖的package包/类
/**
* The initialization method for FunctionExecutor
*
* @param attributeExpressionExecutors are the executors of each attributes in the function
* @param configReader this hold the {@link MinAttributeAggregator} configuration reader.
* @param siddhiAppContext Siddhi app runtime context
*/
@Override
protected void init(ExpressionExecutor[] attributeExpressionExecutors, ConfigReader configReader,
SiddhiAppContext siddhiAppContext) {
if (attributeExpressionExecutors.length != 1) {
throw new OperationNotSupportedException("Min aggregator has to have exactly 1 parameter, currently " +
attributeExpressionExecutors.length + " parameters provided");
}
Attribute.Type type = attributeExpressionExecutors[0].getReturnType();
switch (type) {
case FLOAT:
minOutputAttributeAggregator = new MinAttributeAggregatorFloat();
break;
case INT:
minOutputAttributeAggregator = new MinAttributeAggregatorInt();
break;
case LONG:
minOutputAttributeAggregator = new MinAttributeAggregatorLong();
break;
case DOUBLE:
minOutputAttributeAggregator = new MinAttributeAggregatorDouble();
break;
default:
throw new OperationNotSupportedException("Min not supported for " + type);
}
}
开发者ID:wso2,项目名称:siddhi,代码行数:33,代码来源:MinAttributeAggregator.java
示例15: init
import org.wso2.siddhi.core.util.config.ConfigReader; //导入依赖的package包/类
@Override
protected void init(ExpressionExecutor[] attributeExpressionExecutors, ConfigReader configReader, boolean
outputExpectsExpiredEvents, SiddhiAppContext siddhiAppContext) {
support = Double.parseDouble(String.valueOf(((ConstantExpressionExecutor) attributeExpressionExecutors[0])
.getValue()));
if (attributeExpressionExecutors.length > 1) {
error = Double.parseDouble(String.valueOf(((ConstantExpressionExecutor) attributeExpressionExecutors[1])
.getValue()));
} else {
error = support / 10; // recommended error is 10% of 20$ of support value;
}
if ((support > 1 || support < 0) || (error > 1 || error < 0)) {
log.error("Wrong argument has provided, Error executing the window");
}
variableExpressionExecutors = new VariableExpressionExecutor[attributeExpressionExecutors.length - 2];
if (attributeExpressionExecutors.length > 2) { // by-default all the attributes will be compared
for (int i = 2; i < attributeExpressionExecutors.length; i++) {
variableExpressionExecutors[i - 2] = (VariableExpressionExecutor) attributeExpressionExecutors[i];
}
}
windowWidth = Math.ceil(1 / error);
currentBucketId = 1;
}
开发者ID:wso2,项目名称:siddhi,代码行数:24,代码来源:LossyFrequentWindowProcessor.java
示例16: initTransport
import org.wso2.siddhi.core.util.config.ConfigReader; //导入依赖的package包/类
@Override
public void initTransport(OptionHolder sinkOptionHolder, List<OptionHolder> destinationOptionHolders, Annotation
sinkAnnotation, ConfigReader sinkConfigReader, SiddhiAppContext siddhiAppContext) {
String transportType = sinkOptionHolder.validateAndGetStaticValue(SiddhiConstants.ANNOTATION_ELEMENT_TYPE);
Extension sinkExtension = DefinitionParserHelper.constructExtension
(streamDefinition, SiddhiConstants.ANNOTATION_SINK, transportType, sinkAnnotation, SiddhiConstants
.NAMESPACE_SINK);
destinationOptionHolders.forEach(destinationOption -> {
Sink sink = (Sink) SiddhiClassLoader.loadExtensionImplementation(
sinkExtension, SinkExecutorExtensionHolder.getInstance(siddhiAppContext));
destinationOption.merge(sinkOptionHolder);
sink.initOnlyTransport(streamDefinition, destinationOption, sinkConfigReader, siddhiAppContext);
transports.add(sink);
});
}
开发者ID:wso2,项目名称:siddhi,代码行数:17,代码来源:MultiClientDistributedSink.java
示例17: init
import org.wso2.siddhi.core.util.config.ConfigReader; //导入依赖的package包/类
@Override
protected void init(ExpressionExecutor[] attributeExpressionExecutors,
ConfigReader configReader, SiddhiAppContext siddhiAppContext) {
if (attributeExpressionExecutors.length != 2) {
// check whether all the arguments passed
throw new SiddhiAppValidationException("Invalid no of parameters passed to default() function, " +
"it require only 2 (attribute, default value) , "
+ "but found "
+ attributeExpressionExecutors.length);
} else if (!(attributeExpressionExecutors[1] instanceof ConstantExpressionExecutor)) {
throw new SiddhiAppValidationException("Invalid parameter passed to default() function, " +
"this only consumes constants, but found "
+ attributeExpressionExecutors[1].getClass().getName());
} else if ((attributeExpressionExecutors[0].getReturnType() != attributeExpressionExecutors[1]
.getReturnType())) {
throw new SiddhiAppValidationException("Both attribute and default value parameters need to be of "
+ "same return type but they are of " +
attributeExpressionExecutors[0].getReturnType() + "and" +
attributeExpressionExecutors[1].getReturnType());
}
returnType = attributeExpressionExecutors[0].getReturnType();
}
开发者ID:wso2,项目名称:siddhi,代码行数:24,代码来源:DefaultFunctionExecutor.java
示例18: initExecutor
import org.wso2.siddhi.core.util.config.ConfigReader; //导入依赖的package包/类
public void initExecutor(ExpressionExecutor[] attributeExpressionExecutors, SiddhiAppContext
siddhiAppContext, String queryName, ConfigReader configReader) {
this.configReader = configReader;
try {
this.siddhiAppContext = siddhiAppContext;
this.attributeExpressionExecutors = attributeExpressionExecutors;
attributeSize = attributeExpressionExecutors.length;
this.queryName = queryName;
if (elementId == null) {
elementId = "FunctionExecutor-" + siddhiAppContext.getElementIdGenerator().createNewId();
}
siddhiAppContext.getSnapshotService().addSnapshotable(queryName, this);
init(attributeExpressionExecutors, configReader, siddhiAppContext);
} catch (Throwable t) {
throw new SiddhiAppCreationException(t);
}
}
开发者ID:wso2,项目名称:siddhi,代码行数:18,代码来源:FunctionExecutor.java
示例19: init
import org.wso2.siddhi.core.util.config.ConfigReader; //导入依赖的package包/类
@Override
protected void init(ExpressionExecutor[] attributeExpressionExecutors,
ConfigReader configReader, SiddhiAppContext siddhiAppContext) {
if (attributeExpressionExecutors.length != 3) {
// check whether all the arguments passed
throw new SiddhiAppValidationException("Invalid no of arguments passed to ifThenElse() function, " +
"required only 3, but found " + attributeExpressionExecutors.length);
} else if (!attributeExpressionExecutors[0].getReturnType().equals(Attribute.Type.BOOL)) {
// check whether first argument Boolean or not
throw new SiddhiAppValidationException("Input type of if in ifThenElse function should be of " +
"type BOOL, but found " + attributeExpressionExecutors[0].getReturnType());
} else if (!attributeExpressionExecutors[1].getReturnType().equals(
attributeExpressionExecutors[2].getReturnType())) {
// check whether second and thirds argument's return type are equivalent.
throw new SiddhiAppValidationException("Input type of then in ifThenElse function and else in " +
"ifThenElse function should be of equivalent type. but found then type: " +
attributeExpressionExecutors[1].getReturnType() + " and else type: " +
attributeExpressionExecutors[2].getReturnType());
} else {
returnType = attributeExpressionExecutors[1].getReturnType();
}
}
开发者ID:wso2,项目名称:siddhi,代码行数:23,代码来源:IfThenElseFunctionExecutor.java
示例20: init
import org.wso2.siddhi.core.util.config.ConfigReader; //导入依赖的package包/类
@Override
protected void init(ExpressionExecutor[] attributeExpressionExecutors, ConfigReader configReader,
SiddhiAppContext siddhiAppContext) {
if (attributeExpressionExecutors.length == 1) {
if (attributeExpressionExecutors[0].getReturnType() != Attribute.Type.STRING) {
throw new SiddhiAppValidationException("Only string values are supported for single within clause "
+ "but found, " + attributeExpressionExecutors[0].getReturnType());
}
} else if (attributeExpressionExecutors.length == 2) {
if (!(attributeExpressionExecutors[0].getReturnType() == Attribute.Type.LONG
|| attributeExpressionExecutors[0].getReturnType() == Attribute.Type.STRING)) {
throw new SiddhiAppValidationException(
"Only string and long types are supported as first value of within clause");
}
if (!(attributeExpressionExecutors[1].getReturnType() == Attribute.Type.LONG
|| attributeExpressionExecutors[1].getReturnType() == Attribute.Type.STRING)) {
throw new SiddhiAppValidationException(
"Only string and long types are supported as second value of within clause");
}
} else {
throw new SiddhiAppValidationException("incrementalAggregator:startTimeEndTime() function accepts " +
"only one or two arguments, but found " + attributeExpressionExecutors.length);
}
}
开发者ID:wso2,项目名称:siddhi,代码行数:25,代码来源:IncrementalStartTimeEndTimeFunctionExecutor.java
注:本文中的org.wso2.siddhi.core.util.config.ConfigReader类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论