[
https://issues.apache.org/jira/browse/APEXCORE-10?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15212716#comment-15212716
]
ASF GitHub Bot commented on APEXCORE-10:
----------------------------------------
Github user tweise commented on a diff in the pull request:
https://github.com/apache/incubator-apex-core/pull/250#discussion_r57507058
--- Diff: api/src/main/java/com/datatorrent/api/StringCodec.java ---
@@ -377,4 +383,43 @@ public String toString(Class<? extends T> clazz)
private static final long serialVersionUID = 201312082053L;
}
+ public class JsonStringCodec<T> implements StringCodec<T>, Serializable
+ {
+ private static final long serialVersionUID = 2513932518264776006L;
+ Class<?> clazz;
+
+ public JsonStringCodec(Class<T> clazz)
+ {
+ this.clazz = clazz;
+ }
+
+ @Override
+ public T fromString(String string)
+ {
+ try {
+ ObjectMapper mapper = new ObjectMapper();
+
mapper.configure(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES,
false);
+ ObjectReader reader = mapper.reader(clazz);
+ return reader.readValue(string);
+ } catch (IOException e) {
+ DTThrowable.wrapIfChecked(e);
+ }
+ return null;
+ }
+
+ @Override
+ public String toString(T pojo)
+ {
+ try {
+ ObjectMapper mapper = new ObjectMapper();
+
mapper.configure(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES,
false);
+ ObjectWriter writer = mapper.writer();
+ return writer.writeValueAsString(pojo);
+ } catch (IOException e) {
+ DTThrowable.wrapIfChecked(e);
--- End diff --
This is not specific to this PR but in general, should we consider using
Throwables.propagate() instead?
> Enable non-affinity of operators per node (not containers)
> ----------------------------------------------------------
>
> Key: APEXCORE-10
> URL: https://issues.apache.org/jira/browse/APEXCORE-10
> Project: Apache Apex Core
> Issue Type: Task
> Reporter: Amol Kekre
> Assignee: Isha Arkatkar
> Labels: roadmap
>
> The issue happens on cloud which provides virtual cores with software like
> Xen underneath. In effect if CPU intensive operators land up on same node we
> have a resource bottleneck,
> Need to create an attribute that does the following
> - Operators A & B should not be on same node
> - Stram should use this attribute to try to get containers on different node
> It is understood that the user is making an explicit choice to use NIC
> instead of stream local optimization
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)