[ 
https://issues.apache.org/jira/browse/APEXMALHAR-1984?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15118265#comment-15118265
 ] 

ASF GitHub Bot commented on APEXMALHAR-1984:
--------------------------------------------

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.



> Operators that use Kryo directly would throw exception in local mode
> --------------------------------------------------------------------
>
>                 Key: APEXMALHAR-1984
>                 URL: https://issues.apache.org/jira/browse/APEXMALHAR-1984
>             Project: Apache Apex Malhar
>          Issue Type: Bug
>            Reporter: Siyuan Hua
>            Assignee: Siyuan Hua
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to