Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id B8E62200BB6 for ; Fri, 4 Nov 2016 22:49:08 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id B76EC160AFE; Fri, 4 Nov 2016 21:49:08 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 0B140160AEA for ; Fri, 4 Nov 2016 22:49:07 +0100 (CET) Received: (qmail 60588 invoked by uid 500); 4 Nov 2016 21:49:07 -0000 Mailing-List: contact reviews-help@impala.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list reviews@impala.incubator.apache.org Received: (qmail 60572 invoked by uid 99); 4 Nov 2016 21:49:07 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Nov 2016 21:49:07 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 93AFFC7E2B for ; Fri, 4 Nov 2016 21:49:06 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.362 X-Spam-Level: X-Spam-Status: No, score=0.362 tagged_above=-999 required=6.31 tests=[RDNS_DYNAMIC=0.363, SPF_PASS=-0.001] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id wVpI6Pumh2f4 for ; Fri, 4 Nov 2016 21:49:04 +0000 (UTC) Received: from ip-10-146-233-104.ec2.internal (ec2-75-101-130-251.compute-1.amazonaws.com [75.101.130.251]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 7BAFB5F3BD for ; Fri, 4 Nov 2016 21:49:04 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by ip-10-146-233-104.ec2.internal (8.14.4/8.14.4) with ESMTP id uA4Ln0a0008842; Fri, 4 Nov 2016 21:49:00 GMT Message-Id: <201611042149.uA4Ln0a0008842@ip-10-146-233-104.ec2.internal> Date: Fri, 4 Nov 2016 21:49:00 +0000 From: "Alex Behm (Code Review)" To: Laszlo Gaal , impala-cr@cloudera.com, reviews@impala.incubator.apache.org CC: Tim Armstrong Reply-To: alex.behm@cloudera.com X-Gerrit-MessageType: comment Subject: =?UTF-8?Q?=5BImpala-ASF-CR=5D_IMPALA-4172=3A_Switch_to_BlockLocation_methods_for_disk_IDs=0A?= X-Gerrit-Change-Id: Ibbff94cef9a9db7b3945f8e7b0286866d2cc3b61 X-Gerrit-ChangeURL: X-Gerrit-Commit: 045244bef8959239d359b4e6e90a9219a45489ad In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Content-Disposition: inline User-Agent: Gerrit/2.12.2 archived-at: Fri, 04 Nov 2016 21:49:08 -0000 Alex Behm has posted comments on this change. Change subject: IMPALA-4172: Switch to BlockLocation methods for disk IDs ...................................................................... Patch Set 1: (11 comments) Some high-level comments before digging in deeper. http://gerrit.cloudera.org:8080/#/c/4914/1//COMMIT_MSG Commit Message: Line 9: This change enables Impala to use BlockLocation#getStorageIds, nit: we usually use () after names to denote they are e function/method i.e. getStorageIds -> getStorageIds() getFileBlockLocations -> getFileBlockLocations() Line 12: getFileBlockLocations call which will be deprecated in Hadoop-3. extra space after "be" http://gerrit.cloudera.org:8080/#/c/4914/1/fe/src/main/java/org/apache/impala/catalog/HdfsTable.java File fe/src/main/java/org/apache/impala/catalog/HdfsTable.java: Line 287: clazz = null; remove Line 290: if ( clazz != null ) { style: extra spaces, we do if (clazz != null) { ... } Line 295: m = null; remove Line 311: LOG.info("SUPPORTS_STORAGE_ID is: " + (SUPPORTS_STORAGE_ID ? "true" : "false")); no need for this ternary logic, just: LOG.info("SUPPORTS_STORAGE_ID is: " + SUPPORTS_STORAGE_ID); Line 352: private static int getSequentialDiskId(String storageId) While this solution is minimally invasive, I'm not a big fan of the extra locking and memory consumption of this map. An overall better design is to convert the UUID to a 128-bit int and use that everywhere. Also see my comments below. Let me know what you think. Line 353: { move to previous line Line 379: private static int getDiskId(String storageId) { As much as I'd like to use this simpler alternative, I think it could lead to serious performance problems that could be very hard to debug. I don't think we can use this. Perhaps we should consider switching to a 128-bit integer to represent the UUID everywhere (including all thrift structures and the BE). The BE only needs a number that it can mod against the number of local data dirs (see DiskIoMgr::AssignQueue()). Using a 128-bit int would also work with the old volume id API. We have an existing TUniqueId which may be suitable. Line 437: BlockLocation[] locations = fs.getFileBlockLocations(file, 0, file.getLen()); still using the old API? My understanding is that switching to a new API for these calls here will make the extra loadDiskIds() unnecessary. Line 526: if (SUPPORTS_STORAGE_ID) { This seems fine as a first cut, but we should consider taking this a step further in a follow-on change. This is still grabbing the storage ids partition-by-partition, but ideally we could get all the blocks and their locations for an entire table. We'd need to handle partitions with non-standard locations specially. -- To view, visit http://gerrit.cloudera.org:8080/4914 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibbff94cef9a9db7b3945f8e7b0286866d2cc3b61 Gerrit-PatchSet: 1 Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-Owner: Laszlo Gaal Gerrit-Reviewer: Alex Behm Gerrit-Reviewer: Laszlo Gaal Gerrit-Reviewer: Tim Armstrong Gerrit-HasComments: Yes