Examples of MapConfig


Examples of org.apache.samza.config.MapConfig

  @Test
  public void testJsonTaskModel() throws Exception {
    ObjectMapper mapper = SamzaObjectMapper.getObjectMapper();
    Map<String, String> configMap = new HashMap<String, String>();
    configMap.put("a", "b");
    Config config = new MapConfig(configMap);
    Set<SystemStreamPartition> inputSystemStreamPartitions = new HashSet<SystemStreamPartition>();
    inputSystemStreamPartitions.add(new SystemStreamPartition("foo", "bar", new Partition(1)));
    TaskName taskName = new TaskName("test");
    TaskModel taskModel = new TaskModel(taskName, inputSystemStreamPartitions, new Partition(2));
    Map<TaskName, TaskModel> tasks = new HashMap<TaskName, TaskModel>();
View Full Code Here

Examples of org.apache.samza.config.MapConfig

  public static class ConfigDeserializer extends JsonDeserializer<Config> {
    @Override
    public Config deserialize(JsonParser jsonParser, DeserializationContext context) throws IOException, JsonProcessingException {
      ObjectCodec oc = jsonParser.getCodec();
      JsonNode node = oc.readTree(jsonParser);
      return new MapConfig(OBJECT_MAPPER.<Map<String, String>> readValue(node, new TypeReference<Map<String, String>>() {
      }));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.