congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
EventTypeRepositoryImpl.addType
Code IndexAdd Tabnine to your IDE (free)

How to use
addType
method
in
com.espertech.esper.common.internal.event.eventtyperepo.EventTypeRepositoryImpl

Best Java code snippets using com.espertech.esper.common.internal.event.eventtyperepo.EventTypeRepositoryImpl.addType (Showing top 8 results out of 315)

origin: espertechinc/esper

public void mergeFrom(EventTypeRepositoryImpl other) {
  for (Map.Entry<String, EventType> entry : other.getNameToTypeMap().entrySet()) {
    if (nameToTypeMap.containsKey(entry.getKey())) {
      continue;
    }
    addType(entry.getValue());
  }
}
origin: espertechinc/esper

  private static void addVariantStream(String name, ConfigurationCommonVariantStream config, EventTypeRepositoryImpl repo, EventTypeFactory eventTypeFactory) {
    VariantSpec variantSpec = validateVariantStream(name, config, repo);
    EventTypeMetadata metadata = new EventTypeMetadata(name, null, EventTypeTypeClass.VARIANT, EventTypeApplicationType.VARIANT, NameAccessModifier.PRECONFIGURED, EventTypeBusModifier.BUS, false, new EventTypeIdPair(CRC32Util.computeCRC32(name), -1));
    VariantEventType variantEventType = eventTypeFactory.createVariant(metadata, variantSpec);
    repo.addType(variantEventType);
  }
}
origin: espertechinc/esper

public EPCompilerPathable getRuntimePath() {
  EPServicesContext services = runtimeEnvironment.getServices();
  VariableRepositoryPreconfigured variables = new VariableRepositoryPreconfigured();
  for (Map.Entry<String, VariableDeployment> entry : services.getVariableManagementService().getDeploymentsWithVariables().entrySet()) {
    for (Map.Entry<String, Variable> variableEntry : entry.getValue().getVariables().entrySet()) {
      if (variableEntry.getValue().getMetaData().isPreconfigured()) {
        variables.addVariable(variableEntry.getKey(), variableEntry.getValue().getMetaData());
      }
    }
  }
  EventTypeRepositoryImpl eventTypes = new EventTypeRepositoryImpl(true);
  for (Map.Entry<String, EventType> entry : services.getEventTypeRepositoryBus().getNameToTypeMap().entrySet()) {
    if (entry.getValue().getMetadata().getAccessModifier() == NameAccessModifier.PRECONFIGURED) {
      eventTypes.addType(entry.getValue());
    }
  }
  return new EPCompilerPathableImpl(
    services.getVariablePathRegistry().copy(),
    services.getEventTypePathRegistry().copy(),
    services.getExprDeclaredPathRegistry().copy(),
    services.getNamedWindowPathRegistry().copy(),
    services.getTablePathRegistry().copy(),
    services.getContextPathRegistry().copy(),
    services.getScriptPathRegistry().copy(),
    eventTypes,
    variables);
}
origin: espertechinc/esper

  private static void buildAvroType(EventTypeRepositoryImpl eventTypeRepositoryPreconfigured, String eventTypeName, ConfigurationCommonEventTypeAvro config, EventTypeAvroHandler eventTypeAvroHandler, EventBeanTypedEventFactory eventBeanTypedEventFactory) {
    EventTypeMetadata metadata = new EventTypeMetadata(eventTypeName, null, EventTypeTypeClass.APPLICATION, EventTypeApplicationType.AVRO, NameAccessModifier.PRECONFIGURED, EventTypeBusModifier.BUS, false, new EventTypeIdPair(CRC32Util.computeCRC32(eventTypeName), -1));
    Pair<EventType[], Set<EventType>> avroSuperTypes = EventTypeUtility.getSuperTypesDepthFirst(config.getSuperTypes(), EventUnderlyingType.AVRO, eventTypeRepositoryPreconfigured);
    AvroSchemaEventType newEventType = eventTypeAvroHandler.newEventTypeFromSchema(metadata, eventBeanTypedEventFactory, config, avroSuperTypes.getFirst(), avroSuperTypes.getSecond());
    eventTypeRepositoryPreconfigured.addType(newEventType);
  }
}
origin: espertechinc/esper

private static void addNestableObjectArrayType(String eventTypeName, LinkedHashMap<String, Object> propertyTypesMayHavePrimitive, ConfigurationCommonEventTypeObjectArray optionalConfig, BeanEventTypeFactory beanEventTypeFactory, EventTypeRepositoryImpl repo) {
  if (optionalConfig != null && optionalConfig.getSuperTypes().size() > 1) {
    throw new EventAdapterException(ConfigurationCommonEventTypeObjectArray.SINGLE_SUPERTYPE_MSG);
  }
  LinkedHashMap<String, Object> propertyTypes = EventTypeUtility.getPropertyTypesNonPrimitive(propertyTypesMayHavePrimitive);
  EventTypeMetadata metadata = new EventTypeMetadata(eventTypeName, null, EventTypeTypeClass.APPLICATION, EventTypeApplicationType.OBJECTARR, NameAccessModifier.PRECONFIGURED, EventTypeBusModifier.BUS, false, new EventTypeIdPair(CRC32Util.computeCRC32(eventTypeName), -1));
  String[] superTypes = null;
  if (optionalConfig != null && optionalConfig.getSuperTypes() != null && !optionalConfig.getSuperTypes().isEmpty()) {
    superTypes = optionalConfig.getSuperTypes().toArray(new String[optionalConfig.getSuperTypes().size()]);
  }
  ObjectArrayEventType newEventType = beanEventTypeFactory.getEventTypeFactory().createObjectArray(metadata, propertyTypes, superTypes,
    optionalConfig != null ? optionalConfig.getStartTimestampPropertyName() : null,
    optionalConfig != null ? optionalConfig.getEndTimestampPropertyName() : null,
    beanEventTypeFactory, repo);
  EventType existingType = repo.getTypeByName(eventTypeName);
  if (existingType != null) {
    // The existing type must be the same as the type createdStatement
    if (newEventType.equalsCompareType(existingType) != null) {
      ExprValidationException message = newEventType.compareEquals(existingType);
      throw new EPException("Event type named '" + eventTypeName +
        "' has already been declared with differing column name or type information: " + message.getMessage(), message);
    }
    // Since it's the same, return the existing type
    return;
  }
  repo.addType(newEventType);
}
origin: espertechinc/esper

private static void addNestableMapType(String eventTypeName,
                    LinkedHashMap<String, Object> propertyTypesMayHavePrimitive,
                    ConfigurationCommonEventTypeMap optionalConfig,
                    EventTypeRepositoryImpl repo,
                    BeanEventTypeFactory beanEventTypeFactory,
                    EventTypeNameResolver eventTypeNameResolver) throws EventAdapterException {
  EventTypeMetadata metadata = new EventTypeMetadata(eventTypeName, null, EventTypeTypeClass.APPLICATION, EventTypeApplicationType.MAP, NameAccessModifier.PRECONFIGURED, EventTypeBusModifier.BUS, false, new EventTypeIdPair(CRC32Util.computeCRC32(eventTypeName), -1));
  LinkedHashMap<String, Object> propertyTypes = EventTypeUtility.getPropertyTypesNonPrimitive(propertyTypesMayHavePrimitive);
  String[] superTypes = null;
  if (optionalConfig != null && optionalConfig.getSuperTypes() != null && !optionalConfig.getSuperTypes().isEmpty()) {
    superTypes = optionalConfig.getSuperTypes().toArray(new String[optionalConfig.getSuperTypes().size()]);
  }
  MapEventType newEventType = beanEventTypeFactory.getEventTypeFactory().createMap(metadata, propertyTypes,
    superTypes,
    optionalConfig != null ? optionalConfig.getStartTimestampPropertyName() : null,
    optionalConfig != null ? optionalConfig.getEndTimestampPropertyName() : null,
    beanEventTypeFactory, eventTypeNameResolver);
  EventType existingType = repo.getTypeByName(eventTypeName);
  if (existingType != null) {
    // The existing type must be the same as the type createdStatement
    if (newEventType.equalsCompareType(existingType) != null) {
      ExprValidationException message = newEventType.compareEquals(existingType);
      throw new EPException("Event type named '" + eventTypeName +
        "' has already been declared with differing column name or type information: " + message.getMessage(), message);
    }
    return;
  }
  repo.addType(newEventType);
}
origin: espertechinc/esper

if (eventTypeMetadata.getBusModifier() == EventTypeBusModifier.BUS) {
  eventTypeSPI.setMetadataId(nameTypeId, -1);
  services.getEventTypeRepositoryBus().addType(eventTypeSPI);
} else {
  eventTypeSPI.setMetadataId(deploymentIdCrc32, nameTypeId);
origin: espertechinc/esper

  private static void addXMLDOMType(EventTypeRepositoryImpl repo, String eventTypeName, ConfigurationCommonEventTypeXMLDOM detail, SchemaModel schemaModel, BeanEventTypeFactory beanEventTypeFactory, XMLFragmentEventTypeFactory xmlFragmentEventTypeFactory) {
    if (detail.getRootElementName() == null) {
      throw new EventAdapterException("Required root element name has not been supplied");
    }

    EventType existingType = repo.getTypeByName(eventTypeName);
    if (existingType != null) {
      String message = "Event type named '" + eventTypeName + "' has already been declared with differing column name or type information";
      throw new ConfigurationException(message);
    }

    boolean propertyAgnostic = detail.getSchemaResource() == null && detail.getSchemaText() == null;
    EventTypeMetadata metadata = new EventTypeMetadata(eventTypeName, null, EventTypeTypeClass.STREAM, EventTypeApplicationType.XML, NameAccessModifier.PRECONFIGURED, EventTypeBusModifier.BUS, propertyAgnostic, new EventTypeIdPair(CRC32Util.computeCRC32(eventTypeName), -1));
    EventType type = beanEventTypeFactory.getEventTypeFactory().createXMLType(metadata, detail, schemaModel, null, metadata.getName(), beanEventTypeFactory, xmlFragmentEventTypeFactory, repo);
    repo.addType(type);

    if (type instanceof SchemaXMLEventType) {
      xmlFragmentEventTypeFactory.addRootType((SchemaXMLEventType) type);
    }
  }
}
com.espertech.esper.common.internal.event.eventtyperepoEventTypeRepositoryImpladdType

Popular methods of EventTypeRepositoryImpl

  • getNameToTypeMap
  • getTypeByName
  • <init>
  • getTypeById
  • getAllTypes
  • mergeFrom
  • removeType

Popular in Java

  • Creating JSON documents from java classes using gson
  • onCreateOptionsMenu (Activity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • runOnUiThread (Activity)
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • 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