Return-Path: X-Original-To: apmail-hadoop-hdfs-dev-archive@minotaur.apache.org Delivered-To: apmail-hadoop-hdfs-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7E1BBF67D for ; Thu, 25 Apr 2013 03:06:33 +0000 (UTC) Received: (qmail 19249 invoked by uid 500); 25 Apr 2013 03:06:32 -0000 Delivered-To: apmail-hadoop-hdfs-dev-archive@hadoop.apache.org Received: (qmail 18868 invoked by uid 500); 25 Apr 2013 03:06:31 -0000 Mailing-List: contact hdfs-dev-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hdfs-dev@hadoop.apache.org Delivered-To: mailing list hdfs-dev@hadoop.apache.org Received: (qmail 18840 invoked by uid 99); 25 Apr 2013 03:06:31 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Apr 2013 03:06:31 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of dkharrat@gmail.com designates 209.85.214.182 as permitted sender) Received: from [209.85.214.182] (HELO mail-ob0-f182.google.com) (209.85.214.182) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Apr 2013 03:06:25 +0000 Received: by mail-ob0-f182.google.com with SMTP id dn14so2132521obc.41 for ; Wed, 24 Apr 2013 20:06:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:from:date:message-id:subject:to :content-type; bh=mOBPPuAXO6nVBTRoC04g99XDGtS/ai0nIqMJqNPUAn8=; b=dqjulPI0DzAcFuhsVhQtlNVu0Y5eYNeZDUPrV0f+lTLWzT3vHfjaovorvWySB9LTEX qIDIiWGZtiGOSb5mb2G7O/yvUIKz9DS6/U2hvnQtEoaMCEh7ZGX4Z/rh6gObBa5FNrbT ePyyh0i9mkflLFK4nzdNpS84n0PTDotr7Vhie1SV5C4328iI9RcL669Kt8MqBIOHuz6R YSW4UN1+Lu7d1Es8aWAcCbbnXjtOJyHphAqYNib78jlgnE6WpBgZj2EB9fwI05Rk2x6Z E8L04CLzmMrMoTah6vzva9tFRYTZZqjX1tHCYNJPoGvEnzb6+LzZ852XJybjmIJhgMES wAYg== X-Received: by 10.182.166.10 with SMTP id zc10mr14508933obb.80.1366859164980; Wed, 24 Apr 2013 20:06:04 -0700 (PDT) MIME-Version: 1.0 Received: by 10.182.225.194 with HTTP; Wed, 24 Apr 2013 20:05:43 -0700 (PDT) From: Dia Kharrat Date: Wed, 24 Apr 2013 20:05:43 -0700 Message-ID: Subject: Unable to delete symlinks in HDFS via FileContext To: hdfs-dev@hadoop.apache.org Content-Type: multipart/alternative; boundary=e89a8ff1cd48fca0aa04db26b27f X-Virus-Checked: Checked by ClamAV on apache.org --e89a8ff1cd48fca0aa04db26b27f Content-Type: text/plain; charset=UTF-8 Hi, We have an HDFS setup (v2.0.0) managed by Cloudera. I'm having trouble getting the FileStatus of a symlink or deleting it. According to the documentation, FileContext#getFileLinkStatus() or FileContext#delete() should operate on the symlink itself if the provided path is a symlink. However, what happens instead is, FileContext#getFileLinkStatus() or delete() resolve the symlink and act on the target path. So, for example, if "/tmp/symlink.file" points to "/tmp/target.file", doing this: Path path = new Path("hdfs://nameservice1:8020/tmp/symlink.file"); fileContext.getFileLinkStatus(path).getPath(); returns a path of: Path("hdfs://nameservice1:8020/tmp/target.file") Similarly, fileContext.delete(path, true) deletes the target file ("/tmp/target.file") instead of the symlink itself. So, this behavior does not match with the documentation. What's interesting is, locally in pseudo-mode, the above works as expected. Any ideas or pointers as to why FileContext#delete and FileContext#getFileLinkStatus() are not operating correctly on the symlinks? Thanks, Dia --e89a8ff1cd48fca0aa04db26b27f--