apex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From siyuanh <...@git.apache.org>
Subject [GitHub] incubator-apex-malhar pull request: APEXMALHAR-1984 refactor out o...
Date Tue, 26 Jan 2016 23:28:35 GMT
Github user siyuanh commented on a diff in the pull request:

    https://github.com/apache/incubator-apex-malhar/pull/178#discussion_r50919003
  
    --- Diff: contrib/src/main/java/com/datatorrent/contrib/couchbase/AbstractCouchBaseInputOperator.java
---
    @@ -149,15 +145,8 @@ public void partitioned(Map<Integer, Partition<AbstractCouchBaseInputOperator<T>
         int numPartitions = conf.getServers().size();
         List<String> list = conf.getServers();
         Collection<Partition<AbstractCouchBaseInputOperator<T>>> newPartitions
= Lists.newArrayListWithExpectedSize(numPartitions);
    -    Kryo kryo = new Kryo();
         for (int i = 0; i < numPartitions; i++) {
    -      ByteArrayOutputStream bos = new ByteArrayOutputStream();
    -      Output output = new Output(bos);
    -      kryo.writeObject(output, this);
    -      output.close();
    -      Input lInput = new Input(bos.toByteArray());
    -      @SuppressWarnings("unchecked")
    -      AbstractCouchBaseInputOperator<T> oper = kryo.readObject(lInput, this.getClass());
    +      AbstractCouchBaseInputOperator<T> oper = PartitionerUtils.cloneOperatorByKryo(this);
    --- End diff --
    
    I don't want to leave the kryo creation code to the developer, it is error prone.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message