From user-return-7461-archive-asf-public=cust-asf.ponee.io@accumulo.apache.org Wed Jul 24 22:27:09 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 2C93F18025F for ; Thu, 25 Jul 2019 00:27:09 +0200 (CEST) Received: (qmail 83409 invoked by uid 500); 24 Jul 2019 22:27:08 -0000 Mailing-List: contact user-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@accumulo.apache.org Delivered-To: mailing list user@accumulo.apache.org Received: (qmail 83399 invoked by uid 99); 24 Jul 2019 22:27:08 -0000 Received: from Unknown (HELO mailrelay1-lw-us.apache.org) (10.10.3.159) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Jul 2019 22:27:08 +0000 Received: from mail-lf1-f51.google.com (mail-lf1-f51.google.com [209.85.167.51]) by mailrelay1-lw-us.apache.org (ASF Mail Server at mailrelay1-lw-us.apache.org) with ESMTPSA id A6F6B82C6 for ; Wed, 24 Jul 2019 22:27:07 +0000 (UTC) Received: by mail-lf1-f51.google.com with SMTP id u10so33024472lfm.12 for ; Wed, 24 Jul 2019 15:27:07 -0700 (PDT) X-Gm-Message-State: APjAAAXV/lRrmgm0oo00iomthew+zYut2uj7mxQ/3VDB32hpCYZh2/Kh x2cv180imWc6JBs25QTGQg6MNVubGFLDRvVFfA== X-Google-Smtp-Source: APXvYqwq19FZVCEsYGQxYlj+EmM4K6oyNyaAmVg4hIBMamhtawi4nxo/fQ3Mn/Y9Qeo2TEwRBuf5X3XfcIXrcM9Bwk8= X-Received: by 2002:ac2:4202:: with SMTP id y2mr5149042lfh.178.1564007226655; Wed, 24 Jul 2019 15:27:06 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Michael Wall Date: Wed, 24 Jul 2019 18:26:55 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: scan ignores custom Formatter To: Accumulo User List Content-Type: multipart/alternative; boundary="0000000000002bccea058e74cf65" --0000000000002bccea058e74cf65 Content-Type: text/plain; charset="UTF-8" Did you ever get this working? Mike On Wed, Jul 17, 2019 at 12:16 PM mhd wrk wrote: > Basically the sample code (attached) is a copy of DefaultFormatter with > some modifications to `formatEntry` > > On Tue, Jul 16, 2019 at 6:13 PM Michael Wall wrote: > >> If you are still having issues, can you share your code? >> >> Mike >> >> On Tue, Jul 16, 2019 at 6:30 PM Christopher wrote: >> >>> It's possible that the shell itself doesn't have it on its class path. >>> The output of the classpath command is probably the classpath of the >>> tabletserver you've connected to, not the current local shell process. >>> >>> Try `export CLASSPATH=path/to/MyFormatter.jar; bin/accumulo shell ...` >>> >>> On Tue, Jul 16, 2019 at 6:01 PM mhd wrk wrote: >>> > >>> > Yes the jar is on all the tservers and I tried `config`command and >>> `formatter` commands as alternatives. >>> > Unfortunately no luck yet. >>> > >>> > On Tue, Jul 16, 2019 at 1:30 PM Michael Wall >>> wrote: >>> >> >>> >> Couple of thoughts >>> >> >>> >> 1 - Are you putting the jar on all the tservers and restarting >>> everthing? >>> >> 2 - Have you tried setting the formatter on the table as opposed to >>> the scan command. Something like >>> >> 'config -t mytable -s table.formatter=com.example.MyFormatter' >>> >> >>> >> Mike >>> >> >>> >> On Tue, Jul 16, 2019 at 2:50 PM mhd wrk >>> wrote: >>> >>> >>> >>> I'm trying to use a custom formatter with scan command in Accumulo >>> shell, but seems that scan simply ignores the custom formatter and uses the >>> default one! >>> >>> >>> >>> The steps I follow are: >>> >>> >>> >>> 1- Create custom Formatter by extending >>> org.apache.accumulo.core.util.format.Formatter >>> >>> >>> >>> 2- Copy the jar to ${ACCUMULO_HOME}/lib >>> >>> >>> >>> 3- Restart Accumulo to make sure everything is reloaded. >>> >>> >>> >>> 4- run `accumulo shell` >>> >>> >>> >>> 5- run `classpath` and confirm that the formatter jar is included in >>> the path. >>> >>> >>> >>> 5- `scan -f 50 -fm com.example.MyFormatter -st -t mytable` >>> >>> >>> >>> >>> >>> Accumulo version: 1.7.2 >>> >>> >>> >>> >>> >>> Any known issues? >>> >>> >>> >>> >>> >>> Thanks, >>> >>> >>> >>> Mohammad >>> >>> >>> >>> >>> >>> >>> >> --0000000000002bccea058e74cf65 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Did you ever get this working?

Mike

On Wed, Jul 17, 2019 at 12:16 PM mhd wrk <mhdwrkoffice@gmail.com> wrote:
Basically the sample c= ode (attached) is a copy of=C2=A0DefaultFormatter with some mo= difications to `formatEntry`

On Tue, Jul 16, 2019= at 6:13 PM Michael Wall <mjwall@apache.org> wrote:
If you are still having issues, = can you share your code?

Mike

On Tue, Jul 16, 2019= at 6:30 PM Christopher <ctubbsii@apache.org> wrote:
It's possible that the shell itself do= esn't have it on its class path.
The output of the classpath command is probably the classpath of the
tabletserver you've connected to, not the current local shell process.<= br>
Try `export CLASSPATH=3Dpath/to/MyFormatter.jar; bin/accumulo shell ...`
On Tue, Jul 16, 2019 at 6:01 PM mhd wrk <mhdwrkoffice@gmail.com> wrote:
>
> Yes the jar is on all the tservers and I tried `config`command and `fo= rmatter` commands as alternatives.
> Unfortunately no luck yet.
>
> On Tue, Jul 16, 2019 at 1:30 PM Michael Wall <mjwall@apache.org> wrote:
>>
>> Couple of thoughts
>>
>> 1 - Are you putting the jar on all the tservers and restarting eve= rthing?
>> 2 - Have you tried setting the formatter on the table as opposed t= o the scan command.=C2=A0 Something like
>> 'config -t mytable -s table.formatter=3Dcom.example.MyFormatte= r'
>>
>> Mike
>>
>> On Tue, Jul 16, 2019 at 2:50 PM mhd wrk <mhdwrkoffice@gmail.com> wrote:=
>>>
>>> I'm trying to use a custom formatter with scan command in = Accumulo shell, but seems that scan simply ignores the custom formatter and= uses the default one!
>>>
>>> The steps I follow are:
>>>
>>> 1- Create custom Formatter by extending org.apache.accumulo.co= re.util.format.Formatter
>>>
>>> 2- Copy the jar to ${ACCUMULO_HOME}/lib
>>>
>>> 3- Restart Accumulo to make sure everything is reloaded.
>>>
>>> 4- run `accumulo shell`
>>>
>>> 5- run `classpath` and confirm that the formatter jar is inclu= ded in the path.
>>>
>>> 5- `scan -f 50 -fm com.example.MyFormatter -st -t mytable`
>>>
>>>
>>> Accumulo version: 1.7.2
>>>
>>>
>>> Any known issues?
>>>
>>>
>>> Thanks,
>>>
>>> Mohammad
>>>
>>>
>>>
--0000000000002bccea058e74cf65--