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 8DCAB18BBA for ; Mon, 15 Jun 2015 20:30:16 +0000 (UTC) Received: (qmail 80316 invoked by uid 500); 15 Jun 2015 20:30:15 -0000 Delivered-To: apmail-hadoop-hdfs-dev-archive@hadoop.apache.org Received: (qmail 80215 invoked by uid 500); 15 Jun 2015 20:30:15 -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 80203 invoked by uid 99); 15 Jun 2015 20:30:15 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Jun 2015 20:30:15 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 2072B1A5659 for ; Mon, 15 Jun 2015 20:30:15 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.791 X-Spam-Level: * X-Spam-Status: No, score=1.791 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=3, RCVD_IN_MSPIKE_H2=-1.108, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id DGn0mwAoXmKl for ; Mon, 15 Jun 2015 20:30:13 +0000 (UTC) Received: from mail-ig0-f176.google.com (mail-ig0-f176.google.com [209.85.213.176]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTPS id A2DA9249EA for ; Mon, 15 Jun 2015 20:30:13 +0000 (UTC) Received: by igbzc4 with SMTP id zc4so63752855igb.0 for ; Mon, 15 Jun 2015 13:30:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=TH432lN8pSkL7G7JTV/ARIhpBlPxfBZ6tqHKA/kO/mA=; b=R0ZdR/WbRmYTxjvWrisNpa726Iqhk4XhoAzuBifqZGybtSD/CcOjBYOI+rZfxa/nWJ viCqrjBag42GntU4kKfDwHDCxpICLJ+paA2XTEfcxkc5ydWjQD95rppfn1Bef0vBlPu6 WaRwOEwK6XQqmG07QdNHszGcSPhSp/n3vwoYz+C+e6meMvSTbBzjA4HRcG7xNQxUy6mp dgIaCNEDKtNu+DR7HCmTzjeG7LK2cQmJv1SCGItkvz87AYXN/NyquLhvwWcCsOjRg4Qu aOwFjPmzqwvp5ysUotnWddxecSOOisJD9UiVIjHouNvImVP6Ug3MZn5EkjiSILPlDVWa Vc/w== MIME-Version: 1.0 X-Received: by 10.43.140.5 with SMTP id iy5mr32906142icc.77.1434400213060; Mon, 15 Jun 2015 13:30:13 -0700 (PDT) Received: by 10.107.129.199 with HTTP; Mon, 15 Jun 2015 13:30:13 -0700 (PDT) In-Reply-To: References: Date: Mon, 15 Jun 2015 13:30:13 -0700 Message-ID: Subject: Re: How to Tag a request using optional field From: lohit To: "hdfs-dev@hadoop.apache.org" Content-Type: multipart/alternative; boundary=001a11c2c5882a5771051894534b --001a11c2c5882a5771051894534b Content-Type: text/plain; charset=UTF-8 It sounds like you would need way to store UUID somewhere so that on INotify about file you can retrieve it. How about using HDFS extended attributes to save UUID for inode and on notification, fetch extended attributes? 2015-06-15 13:11 GMT-07:00 Colin P. McCabe : > On Thu, Jun 4, 2015 at 2:46 PM, Rahul Shrivastava > wrote: > > Hi, > > > > > > Suppose I write a Java client to create a directory on HDFS. Is there a > way > > to tag this request and get the tagged information on NameNode via > > DFSInotifyEventInputStream or otherwise ? > > > > In short, is there a way to give optional information attached to every > > request ? > > > > I do not want to save this information in File System but just to use > this > > information via DFSInotifyEventInputStream to relate it back to the > client. > > > > The requirement is attach a UUID with every request on the client and > > process this UUID from NameNode. > > > > thanks > > Rahul > > Hi Rahul, > > By definition, inotify reports on things which are "saved" i.e. > persisted somehow on the NameNode. If the information were not > persisted, we'd run into trouble using inotify in scenarios like > shutting down the NameNode and bringing it back up, or failing over > between namenodes. > > Requests do have UUIDs in the form of RPC call IDs. It would be > rather difficult to expose this information through the Java API, > though. I'm not sure how we would allow the calling code for mkdirs > (for example) to get the call ID of the RPC it made. Certainly we > don't want to change the return signature of mkdirs, and using > thread-local data seems kind of ugly. I'm also not sure if we want to > make the call ID part of the inotify API since it's an implementation > detail. > > We had a discussion at Hadoop Summit about ways to use inotify > effectively. One thing that came up is that we should add support for > determining that an HDFS snapshot had occurred to inotify. This would > allow users to do things like: > > 1. start listening for events > 2. take a snapshot named Foo_2015-06-15_13:09 > 3. get a SnapshotCreateEvent for Foo_2015-06-15_13:09 > 4. do a full scan on the snapshot and buffer that information somewhere > 5. ask for all events that happened since the SnapshotCreateEvent and > apply them to the buffered information > > At the end of #5, you have a fully consistent view of the filesystem. > I'm not sure if this is your exact usecase, but perhaps it's helpful. > > best, > Colin > -- Have a Nice Day! Lohit --001a11c2c5882a5771051894534b--