apex-dev mailing list archives

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

    https://github.com/apache/incubator-apex-malhar/pull/178#discussion_r50901245
  
    --- 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 --
    
    Why create a separate Kryo instance for every partition?


---
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