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

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

Best Java code snippets using org.wso2.siddhi.query.api.annotation.Annotation.getQueryContextStartIndex (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.annotationAnnotationgetQueryContextStartIndex

Popular methods of Annotation

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

Popular in Java

  • Making http post requests using okhttp
  • putExtra (Intent)
  • notifyDataSetChanged (ArrayAdapter)
  • requestLocationUpdates (LocationManager)
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • Socket (java.net)
    Provides a client-side TCP socket.
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • JCheckBox (javax.swing)
  • 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