Return-Path: X-Original-To: apmail-kafka-dev-archive@www.apache.org Delivered-To: apmail-kafka-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DCAC011BC6 for ; Thu, 17 Jul 2014 02:15:24 +0000 (UTC) Received: (qmail 3902 invoked by uid 500); 17 Jul 2014 02:15:24 -0000 Delivered-To: apmail-kafka-dev-archive@kafka.apache.org Received: (qmail 3860 invoked by uid 500); 17 Jul 2014 02:15:24 -0000 Mailing-List: contact dev-help@kafka.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@kafka.apache.org Delivered-To: mailing list dev@kafka.apache.org Received: (qmail 3849 invoked by uid 99); 17 Jul 2014 02:15:24 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Jul 2014 02:15:24 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [209.85.223.179] (HELO mail-ie0-f179.google.com) (209.85.223.179) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Jul 2014 02:15:20 +0000 Received: by mail-ie0-f179.google.com with SMTP id rl12so1944892iec.10 for ; Wed, 16 Jul 2014 19:14:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=DW0RfCQjDKj4/lE8dlZXMG3m1ta0Z4U+V/4jyoj/Xdg=; b=UhY2JAF69FF3MpVSULFAgoSka28uKgI611O2Kr+fHMMxXysZsoQgVqXSEb2vypd75s 6KokfrHdkexIGIDYYB7vv4uxFNnUmw+T9f7Vz+XXUQzO9q/TBX1dp3UftQP9xtg7kzQA 6EAnq3Gukv62csvSj/Gq7SHgT3NyS7V0aXgsu4JRFD9B+y3whHkojWJAsiOaEdvMuNL7 qm+Emjx3O4X5c2fZdL6m+ha5U6rztqto593Dzdq5ULWGzaZi74jlS+skZHnxuDXyBUSi 9VyqUCG63ZeugikI61IxyqYRQ971cB4K+vhMIRSkVDSkO3wSSB5ZQNJ4tDEecEeVyjvN tRpA== X-Gm-Message-State: ALoCoQlmQHPl87sDisTTceA8oAeiHvfoV2xiZduF7r0KI0KpO1bdGpsDbUPTYiQET4xs/jRuwTM8 MIME-Version: 1.0 X-Received: by 10.60.155.231 with SMTP id vz7mr41441518oeb.56.1405563299689; Wed, 16 Jul 2014 19:14:59 -0700 (PDT) Received: by 10.182.222.232 with HTTP; Wed, 16 Jul 2014 19:14:59 -0700 (PDT) In-Reply-To: <64474308D680D540A4D8151B0F7C03F7026E6231@SHSMSX104.ccr.corp.intel.com> References: <64474308D680D540A4D8151B0F7C03F7026E6231@SHSMSX104.ccr.corp.intel.com> Date: Wed, 16 Jul 2014 22:14:59 -0400 Message-ID: Subject: Re: Question about ConsoleConsumer From: Joe Stein To: "dev@kafka.apache.org" Cc: "users@kafka.apache.org" Content-Type: multipart/alternative; boundary=047d7bd7668e30101004fe5a3557 X-Virus-Checked: Checked by ClamAV on apache.org --047d7bd7668e30101004fe5a3557 Content-Type: text/plain; charset=UTF-8 auto.offset.reset is only when there is not an already established offset to consume from or an offset that no longer exists (and is invalid) in the case of truncated logs or compaction). You can force this behavior by deleting the znode /******************************************* Joe Stein Founder, Principal Consultant Big Data Open Source Security LLC http://www.stealth.ly Twitter: @allthingshadoop ********************************************/ On Wed, Jul 16, 2014 at 10:08 PM, Shao, Saisai wrote: > Hi folks, > > A newbie question when investigating ConsoleConsumer's code, > > When we use ConsoleConsumer by setting "-from-beginning", we will set > property as "auto.offset.reset"="smallest", which means moving the offset > to the beginning of the data. But in the code, we still need to delete > Zookeeper's group metadata as: > > if(options.has(resetBeginningOpt)) > ZkUtils.maybeDeletePath(options.valueOf(zkConnectOpt), "/consumers/" > + options.valueOf(groupIdOpt)) > > From my understanding, setting "auto.offset.rest"="smallest" is enough to > seek to the beginning of the data, why we still need to delete Zookeeper > metadata? Is there any specific reason or some under-the-cover concerns? > > Sorry for the unthoughtful question and really appreciate your answer. > > Thanks > Jerry > --047d7bd7668e30101004fe5a3557--