Return-Path: X-Original-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2CD4018A1F for ; Sat, 6 Jun 2015 01:20:06 +0000 (UTC) Received: (qmail 84897 invoked by uid 500); 6 Jun 2015 01:20:00 -0000 Delivered-To: apmail-hadoop-hdfs-issues-archive@hadoop.apache.org Received: (qmail 84846 invoked by uid 500); 6 Jun 2015 01:20:00 -0000 Mailing-List: contact hdfs-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hdfs-issues@hadoop.apache.org Delivered-To: mailing list hdfs-issues@hadoop.apache.org Received: (qmail 84835 invoked by uid 99); 6 Jun 2015 01:20:00 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 06 Jun 2015 01:20:00 +0000 Date: Sat, 6 Jun 2015 01:20:00 +0000 (UTC) From: "Tsz Wo Nicholas Sze (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HDFS-8546) Use try with resources in DataStorage and Storage MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HDFS-8546?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14575485#comment-14575485 ] Tsz Wo Nicholas Sze commented on HDFS-8546: ------------------------------------------- - There is still a double try-statements in isPreUpgradableLayout. Note that FileLock is AutoCloseable - We should add a message including when creating OverlappingFileLockException. > Use try with resources in DataStorage and Storage > ------------------------------------------------- > > Key: HDFS-8546 > URL: https://issues.apache.org/jira/browse/HDFS-8546 > Project: Hadoop HDFS > Issue Type: Improvement > Components: datanode > Affects Versions: 2.7.0 > Reporter: Andrew Wang > Assignee: Andrew Wang > Priority: Minor > Attachments: HDFS-8546.001.patch, HDFS-8546.002.patch, HDFS-8546.003.patch > > > We have some old-style try/finally to close files in DataStorage and Storage, let's update them. > Also a few small cleanups: > * Actually check that tryLock returns a FileLock in isPreUpgradableLayout > * Remove unused parameter from writeProperties > * Add braces for one-line if statements per coding style -- This message was sent by Atlassian JIRA (v6.3.4#6332)