org.wso2.siddhi.query.api.annotation.Annotation.getQueryContextEndIndex()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(4.5k)|赞(0)|评价(0)|浏览(99)

本文整理了Java中org.wso2.siddhi.query.api.annotation.Annotation.getQueryContextEndIndex()方法的一些代码示例,展示了Annotation.getQueryContextEndIndex()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Annotation.getQueryContextEndIndex()方法的具体详情如下:
包路径:org.wso2.siddhi.query.api.annotation.Annotation
类名称:Annotation
方法名:getQueryContextEndIndex

Annotation.getQueryContextEndIndex介绍

暂无

代码示例

代码示例来源:origin: wso2/siddhi

public static Annotation getAnnotation(String annotationName, List<Annotation> annotationList) {
  Annotation annotation = null;
  for (Annotation aAnnotation : annotationList) {
    if (annotationName.equalsIgnoreCase(aAnnotation.getName())) {
      if (annotation == null) {
        annotation = aAnnotation;
      } else {
        throw new DuplicateAnnotationException("Annotation @" + annotationName + " is defined twice",
            aAnnotation.getQueryContextStartIndex(), aAnnotation.getQueryContextEndIndex());
      }
    }
  }
  return annotation;
}

代码示例来源:origin: org.wso2.siddhi/siddhi-query-api

public static Annotation getAnnotation(String annotationName, List<Annotation> annotationList) {
  Annotation annotation = null;
  for (Annotation aAnnotation : annotationList) {
    if (annotationName.equalsIgnoreCase(aAnnotation.getName())) {
      if (annotation == null) {
        annotation = aAnnotation;
      } else {
        throw new DuplicateAnnotationException("Annotation @" + annotationName + " is defined twice",
            aAnnotation.getQueryContextStartIndex(), aAnnotation.getQueryContextEndIndex());
      }
    }
  }
  return annotation;
}

代码示例来源:origin: org.wso2.carbon.analytics/org.wso2.carbon.sp.jobmanager.core

/**
 * If the Stream definition string contains {@link SiddhiTopologyCreatorConstants#SINK_IDENTIFIER} or
 * {@link SiddhiTopologyCreatorConstants#SOURCE_IDENTIFIER} ,meta info related to Sink/Source configuration is
 * removed.
 *
 * @return Stream definition String after removing Sink/Source configuration
 */
private String removeMetaInfoStream(String streamId, String streamDefinition, String identifier) {
  int[] queryContextStartIndex;
  int[] queryContextEndIndex;
  for (Annotation annotation : siddhiApp.getStreamDefinitionMap().get(streamId).getAnnotations()) {
    if (annotation.getName().toLowerCase().equals(identifier.replace("@", ""))) {
      queryContextStartIndex = annotation.getQueryContextStartIndex();
      queryContextEndIndex = annotation.getQueryContextEndIndex();
      streamDefinition = streamDefinition.replace(
          ExceptionUtil.getContext(queryContextStartIndex, queryContextEndIndex,
              siddhiTopologyDataHolder.getUserDefinedSiddhiApp()), "");
    }
  }
  return streamDefinition;
}

代码示例来源:origin: org.wso2.carbon.analytics/org.wso2.carbon.sp.jobmanager.core

/**
 * If {@link Query,Partition} string contains {@link SiddhiTopologyCreatorConstants#DISTRIBUTED_IDENTIFIER},
 * meta info related to distributed deployment is removed.
 */
private String removeMetaInfoQuery(ExecutionElement executionElement, String queryElement) {
  int[] queryContextStartIndex;
  int[] queryContextEndIndex;
  for (Annotation annotation : executionElement.getAnnotations()) {
    if (annotation.getName().toLowerCase()
        .equals(SiddhiTopologyCreatorConstants.DISTRIBUTED_IDENTIFIER)) {
      queryContextStartIndex = annotation.getQueryContextStartIndex();
      queryContextEndIndex = annotation.getQueryContextEndIndex();
      queryElement = queryElement.replace(
          ExceptionUtil.getContext(queryContextStartIndex, queryContextEndIndex,
              siddhiTopologyDataHolder.getUserDefinedSiddhiApp()), "");
      break;
    }
  }
  return queryElement;
}

代码示例来源:origin: org.wso2.carbon.analytics/org.wso2.carbon.sp.jobmanager.core

/**
 * Removes the @dist annotation from given aggregation definition.
 * @param aggregationDefinition Aggregation definition of which meta info to be removed.
 * @return String definition after the removal of @dist annotation.
 */
//This method is not necessary for the current design of aggregation distribution. But this left here considering
// the future works on adding parallel annotation to aggregations.
private String removeMetaInfoAggregation(AggregationDefinition aggregationDefinition) {
  int[] queryContextStartIndex;
  int[] queryContextEndIndex;
  String aggregationDef = ExceptionUtil.getContext(aggregationDefinition.getQueryContextStartIndex(),
      aggregationDefinition.getQueryContextEndIndex(), siddhiTopologyDataHolder.getUserDefinedSiddhiApp());
  for (Annotation annotation : aggregationDefinition.getAnnotations()) {
    if (annotation.getName().toLowerCase()
        .equals(SiddhiTopologyCreatorConstants.DISTRIBUTED_IDENTIFIER)) {
      queryContextStartIndex = annotation.getQueryContextStartIndex();
      queryContextEndIndex = annotation.getQueryContextEndIndex();
      aggregationDef = aggregationDef.replace(ExceptionUtil.getContext(queryContextStartIndex,
          queryContextEndIndex, siddhiTopologyDataHolder.getUserDefinedSiddhiApp()), "");
      break;
    }
  }
  return aggregationDef;
}

相关文章