Return-Path: X-Original-To: apmail-hbase-user-archive@www.apache.org Delivered-To: apmail-hbase-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D9207106F9 for ; Fri, 17 Oct 2014 02:36:03 +0000 (UTC) Received: (qmail 91677 invoked by uid 500); 17 Oct 2014 02:36:02 -0000 Delivered-To: apmail-hbase-user-archive@hbase.apache.org Received: (qmail 91593 invoked by uid 500); 17 Oct 2014 02:36:02 -0000 Mailing-List: contact user-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hbase.apache.org Delivered-To: mailing list user@hbase.apache.org Received: (qmail 91581 invoked by uid 99); 17 Oct 2014 02:36:01 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Oct 2014 02:36:01 +0000 X-ASF-Spam-Status: No, hits=1.7 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of matvey1414@gmail.com designates 209.85.223.182 as permitted sender) Received: from [209.85.223.182] (HELO mail-ie0-f182.google.com) (209.85.223.182) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Oct 2014 02:35:36 +0000 Received: by mail-ie0-f182.google.com with SMTP id rp18so4806502iec.13 for ; Thu, 16 Oct 2014 19:35:35 -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=Won/Oc9HrSxfGpMAe8P4lWoKpkx/rG4Cawh3YQSJJTQ=; b=mT2TAjsHZCNd/6x2QEDqPs6gxzctD0SY+N5q80K2UKW4NgGoWkVSkrcAJOImmwathf Dhz+eJFOdopLAlBadpBbQmERX0kAeJkXGztvwtnE48fGiQm4KVlMjTEROWSkrqOfu9Uf NAnEoRdQISg9F1/oRkztVx0OvtEtDo+1enWU9Z7a7Igm24YPXm0LKpfVWIAIKc6sStAL iqgM1bZkWPR5n6fm/pkm0QnxoVskfqaoCxndPHqCYx/NgUWSljDWvRFpeUEYXQF0AwP2 fY09oH3kPqhnL/a7EZsY9aAcR699r08d6fh44pRfpLFASRH1Quk3ngaMXtNyOAPlHEhR uI+Q== MIME-Version: 1.0 X-Received: by 10.50.25.71 with SMTP id a7mr26294893igg.48.1413513335002; Thu, 16 Oct 2014 19:35:35 -0700 (PDT) Received: by 10.50.141.65 with HTTP; Thu, 16 Oct 2014 19:35:34 -0700 (PDT) In-Reply-To: References: Date: Thu, 16 Oct 2014 22:35:34 -0400 Message-ID: Subject: Re: custom filter on hbase 0.96 From: Matt K To: "user@hbase.apache.org" Content-Type: multipart/alternative; boundary=047d7bd74a1c37dd750505953841 X-Virus-Checked: Checked by ClamAV on apache.org --047d7bd74a1c37dd750505953841 Content-Type: text/plain; charset=UTF-8 Hi, can anyone help with above? Feels like I'm missing something obvious. On Wednesday, October 15, 2014, Nishanth S wrote: > Thanks Ted .I will take a look. > > -Nishanth > > On Wed, Oct 15, 2014 at 3:43 PM, Ted Yu > wrote: > > > Nishanth: > > Good question. > > > > As a general coding guide, writing unit test is always a good start. > Using > > Matt's case as an example, take a look at TestPrefixFilter. > > > > There're various unit tests for Filters in hbase code. > > > > Cheers > > > > On Wed, Oct 15, 2014 at 2:30 PM, Nishanth S > > > wrote: > > > > > Hi Ted , > > > Since I am also working on similar thing is there a way we can first > > test > > > the filter on client side?.You know what I mean without disrupting > > others > > > who are using the same cluster for other work? > > > > > > Thanks, > > > Nishanth > > > > > > On Wed, Oct 15, 2014 at 3:17 PM, Ted Yu > wrote: > > > > > > > bq. Or create a new file, compile it into ... > > > > > > > > You should go with the above approach. > > > > > > > > On Wed, Oct 15, 2014 at 2:08 PM, Matt K > wrote: > > > > > > > > > Hi all, > > > > > > > > > > I'm trying to get a custom filter to work on HBase 0.96. After some > > > > > searching, I found that starting from 0.96, the implementer is > > required > > > > to > > > > > implement "toByteArray" and "parseFrom" methods, using Protocol > > > Buffers. > > > > > But I'm having trouble with the "how". > > > > > > > > > > The "proto" file for the existing filters is located here: > > > > > > > > > > > > > > > > > > > > https://github.com/apache/hbase/blob/master/hbase-protocol/src/main/protobuf/Filter.proto > > > > > > > > > > Am I supposed to modify that file? Or create a new file, compile it > > > into > > > > > Java, and package it up with the filter? > > > > > > > > > > In the meantime, I've taken a shortcut that's not working. Here's > my > > > > code: > > > > > http://pastebin.com/iHFKu9Xz > > > > > > > > > > I'm using "PrefixFilter", which comes with HBase, since I'm also > > > > filtering > > > > > by "prefix". However, that errors out with the following: > > > > > http://pastebin.com/zBg47p6Z > > > > > > > > > > Thanks in advance for helping! > > > > > > > > > > -Matt > > > > > > > > > > > > > > > -- www.calcmachine.com - easy online calculator. --047d7bd74a1c37dd750505953841--