Tabnine Logo
Annotation.getQueryContextEndIndex
Code IndexAdd Tabnine to your IDE (free)

How to use
getQueryContextEndIndex
method
in
org.wso2.siddhi.query.api.annotation.Annotation

Best Java code snippets using org.wso2.siddhi.query.api.annotation.Annotation.getQueryContextEndIndex (Showing top 5 results out of 315)

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;
}
org.wso2.siddhi.query.api.annotationAnnotationgetQueryContextEndIndex

Popular methods of Annotation

  • getElements
  • getElement
  • getName
  • getAnnotations
  • <init>
  • annotation
  • element
  • getQueryContextStartIndex
  • toString

Popular in Java

  • Parsing JSON documents to java classes using gson
  • compareTo (BigDecimal)
  • getContentResolver (Context)
  • requestLocationUpdates (LocationManager)
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • JCheckBox (javax.swing)
  • JList (javax.swing)
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now