From notifications-return-595-archive-asf-public=cust-asf.ponee.io@nemo.apache.org Wed Jun 19 07:22:58 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id B6C1B1807CA for ; Wed, 19 Jun 2019 09:22:56 +0200 (CEST) Received: (qmail 98202 invoked by uid 500); 19 Jun 2019 07:22:56 -0000 Mailing-List: contact notifications-help@nemo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@nemo.apache.org Delivered-To: mailing list notifications@nemo.apache.org Received: (qmail 98130 invoked by uid 99); 19 Jun 2019 07:22:56 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Jun 2019 07:22:56 +0000 From: GitBox To: notifications@nemo.apache.org Subject: [GitHub] [incubator-nemo] johnyangk commented on a change in pull request #222: [NEMO-350] Implement Off-heap SerializedMemoryStore & [NEMO-384] Implement DirectByteBufferInputStream for Off-heap SerializedMemoryStore Message-ID: <156092897605.3904.4883693545837824890.gitbox@gitbox.apache.org> Date: Wed, 19 Jun 2019 07:22:56 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit johnyangk commented on a change in pull request #222: [NEMO-350] Implement Off-heap SerializedMemoryStore & [NEMO-384] Implement DirectByteBufferInputStream for Off-heap SerializedMemoryStore URL: https://github.com/apache/incubator-nemo/pull/222#discussion_r295146829 ########## File path: runtime/executor/src/main/java/org/apache/nemo/runtime/executor/data/DataUtil.java ########## @@ -147,12 +149,20 @@ private static void serializePartition(final EncoderFactory encoderFactory, for (final SerializedPartition partitionToConvert : partitionsToConvert) { final K key = partitionToConvert.getKey(); - + if (partitionToConvert.isOffheap()) { + try (DirectByteBufferInputStream byteBufferInputStream = + new DirectByteBufferInputStream(partitionToConvert.getBuffer())) { + final NonSerializedPartition deserializePartition = deserializePartition( Review comment: Can you reuse code? L155-L157 and L162-L164 The last argument of `deserializePartition()` is `InputStream`, which both `DirectByteBufferInputStream` and `ByteArrayInputStream` extend. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: users@infra.apache.org With regards, Apache Git Services