Codota Logo
Utils.getSchemaFromConfig
Code IndexAdd Codota to your IDE (free)

How to use
getSchemaFromConfig
method
in
com.hortonworks.streamline.common.util.Utils

Best Java code snippets using com.hortonworks.streamline.common.util.Utils.getSchemaFromConfig (Showing top 6 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Dictionary d =
  • Codota Iconnew Hashtable()
  • Codota IconBundle bundle;bundle.getHeaders()
  • Codota Iconnew Properties()
  • Smart code suggestions by Codota
}
origin: hortonworks/streamline

private Schema getCustomProcessorInputSchema (Map config) throws IOException {
  return Utils.getSchemaFromConfig((Map) config.get(TopologyLayoutConstants.JSON_KEY_INPUT_SCHEMA));
}
origin: hortonworks/streamline

/**
 * This method takes in a schema represented as a map and returns a {@link Schema}
 * @param schemaConfig A map representing {@link Schema}
 * @return schema generated from the map argument
 * @throws IOException
 */
public static Schema getSchemaFromConfig (Map schemaConfig) throws IOException {
  ObjectMapper objectMapper = new ObjectMapper();
  return getSchemaFromConfig(objectMapper.writeValueAsString(schemaConfig));
}
/**
origin: hortonworks/streamline

private Map<String, Schema> getCustomProcessorOutputSchema (Map config) throws IOException {
  Map<String, Schema> result = new LinkedHashMap<>();
  Map<String, Object> outputSchemaConfig = (Map<String, Object>) config.get(TopologyLayoutConstants.JSON_KEY_OUTPUT_STREAMS_SCHEMA);
  for (Map.Entry<String, Object> entry: outputSchemaConfig.entrySet()) {
    result.put(entry.getKey(), Utils.getSchemaFromConfig((Map) entry.getValue()));
  }
  return result;
}
origin: hortonworks/streamline

/**
 * Associate output schema that is a json string
 * @param outputSchemaJson
 * @return
 */
public CustomProcessorBolt outputSchema (String outputSchemaJson) {
  ObjectMapper mapper = new ObjectMapper();
  Map<String,Schema> outputSchema = new HashMap<>();
  try {
    Map<String, Map> output = mapper.readValue(outputSchemaJson, Map.class);
    for (Map.Entry<String, Map> entry: output.entrySet()) {
      outputSchema.put(entry.getKey(), Utils.getSchemaFromConfig(entry.getValue()));
    }
  } catch (IOException e) {
    LOG.error("Error during deserialization of output schema JSON string: {}", outputSchemaJson, e);
    throw new RuntimeException(e);
  }
  return outputSchema(outputSchema);
}
origin: hortonworks/streamline

public static CustomProcessorInfo fromTopologyComponentBundle(TopologyComponentBundle topologyComponentBundle) throws IOException {
  Preconditions.checkNotNull(topologyComponentBundle, "topologyComponentBundle can not bre null");
  ComponentUISpecification topologyComponentUISpecification = topologyComponentBundle.getTopologyComponentUISpecification();
  List<ComponentUISpecification.UIField> uiFields = topologyComponentUISpecification.getFields();
  Map<String, String> config = getPropertiesFromUIFields(uiFields);
  return new CustomProcessorInfo(config.get(NAME),
      config.get(DESCRIPTION),
      topologyComponentBundle.getStreamingEngine(),
      config.get(JAR_FILE_NAME),
      config.get(CUSTOM_PROCESSOR_IMPL),
      Utils.getSchemaFromConfig(config.get(INPUT_SCHEMA)),
      Utils.getSchemaFromConfig(config.get(OUTPUT_SCHEMA)),
      getCustomProcessorUISpecification(topologyComponentUISpecification),
      config.get(DIGEST));
}
origin: hortonworks/streamline

@Override
public void validateConfig () throws ComponentConfigException {
  super.validateConfig();
  validateStringFields();
  String fieldToValidate = TopologyLayoutConstants.JSON_KEY_OUTPUT_STREAMS_SCHEMA;
  try {
    Map<String, Map> outputSchema = (Map) conf.get(fieldToValidate);
    if (outputSchema == null || outputSchema.keySet().isEmpty()) {
      throw new ComponentConfigException(String.format(TopologyLayoutConstants.ERR_MSG_MISSING_INVALID_CONFIG, fieldToValidate));
    }
    for (Map.Entry<String, Map> entry: outputSchema.entrySet()) {
      Utils.getSchemaFromConfig(entry.getValue());
    }
    this.validateCustomConfigFields();
  } catch (ClassCastException|IOException e) {
    throw new ComponentConfigException(String.format(TopologyLayoutConstants.ERR_MSG_MISSING_INVALID_CONFIG, fieldToValidate));
  }
}
com.hortonworks.streamline.common.utilUtilsgetSchemaFromConfig

Javadoc

This method takes in a schema represented as a json string and returns a Schema

Popular methods of Utils

  • requireNonEmpty
    Checks that the given string is not null or empty. Throws an IllegalArgumentException if it is.
  • getPrefix
    Gets the prefix part a string with a given suffix part. E.g. getPrefix("test-foo", "-foo") returns "
  • createObjectFromJson
    Deserialize a json string to a java object
  • getLatestName
    Returns the latest name from a given list of names that matches the given prefix and suffix part. E.
  • getNextName
    Generates the next name for the given name and suffix. E.g. getNextName("test-foo", "-foo") returns
  • getNumPart
    Gets the number part a string with a given suffix part. E.g. getNumPart("test-foo2", "-foo") returns

Popular in Java

  • Creating JSON documents from java classes using gson
  • getContentResolver (Context)
  • getSharedPreferences (Context)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • Pattern (java.util.regex)
    A compiled representation of a regular expression. A regular expression, specified as a string, must
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • JList (javax.swing)
  • JTextField (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now