Return-Path: X-Original-To: apmail-incubator-accumulo-user-archive@minotaur.apache.org Delivered-To: apmail-incubator-accumulo-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 965819FA9 for ; Wed, 29 Feb 2012 21:31:17 +0000 (UTC) Received: (qmail 39215 invoked by uid 500); 29 Feb 2012 21:31:17 -0000 Delivered-To: apmail-incubator-accumulo-user-archive@incubator.apache.org Received: (qmail 39185 invoked by uid 500); 29 Feb 2012 21:31:17 -0000 Mailing-List: contact accumulo-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: accumulo-user@incubator.apache.org Delivered-To: mailing list accumulo-user@incubator.apache.org Received: (qmail 39177 invoked by uid 99); 29 Feb 2012 21:31:17 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Feb 2012 21:31:17 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [209.85.216.175] (HELO mail-qy0-f175.google.com) (209.85.216.175) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Feb 2012 21:31:12 +0000 Received: by qcso7 with SMTP id o7so1614561qcs.6 for ; Wed, 29 Feb 2012 13:30:51 -0800 (PST) Received-SPF: pass (google.com: domain of keith@deenlo.com designates 10.229.102.148 as permitted sender) client-ip=10.229.102.148; Authentication-Results: mr.google.com; spf=pass (google.com: domain of keith@deenlo.com designates 10.229.102.148 as permitted sender) smtp.mail=keith@deenlo.com Received: from mr.google.com ([10.229.102.148]) by 10.229.102.148 with SMTP id g20mr605096qco.124.1330551051142 (num_hops = 1); Wed, 29 Feb 2012 13:30:51 -0800 (PST) MIME-Version: 1.0 Received: by 10.229.102.148 with SMTP id g20mr505255qco.124.1330551050802; Wed, 29 Feb 2012 13:30:50 -0800 (PST) Received: by 10.229.145.3 with HTTP; Wed, 29 Feb 2012 13:30:50 -0800 (PST) In-Reply-To: References: Date: Wed, 29 Feb 2012 16:30:50 -0500 Message-ID: Subject: Re: MockInstance usage not working...? From: Keith Turner To: accumulo-user@incubator.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQneTS5k6pKCqNWDxPA2GT3dM+SUX6zhUCFzuBPmEGZ0myGbaUCSB3MLUUn1aUTmIUaweJh2 X-Virus-Checked: Checked by ClamAV on apache.org When you try to scan it calls IteratorUtil.loadIterators() which calls AccumuloClassLoader.loadClass(). The AccumuloClassLoader expects ACCUMULO_HOME env var to be set, if it is not it does some vodo to try to figure things out. This could be failing. Are you setting ACCUMULO_HOME ? On Mon, Feb 27, 2012 at 5:19 PM, Jason Trost wrote: > Any idea why this doesn't work (see code and stack trace below)? =A0I am > using accumulo trunk. =A0This problem only occurs when I use a Scanner > or BatchScanner. =A0If I comment out the scanning section there are no > errors. > > Thanks, > > --Jason > > Java code (https://gist.github.com/1927202) > > package accumulo; > > import java.util.Map.Entry; > > import org.apache.accumulo.core.client.BatchWriter; > import org.apache.accumulo.core.client.Connector; > import org.apache.accumulo.core.client.Instance; > import org.apache.accumulo.core.client.Scanner; > import org.apache.accumulo.core.client.mock.MockInstance; > import org.apache.accumulo.core.data.Key; > import org.apache.accumulo.core.data.Mutation; > import org.apache.accumulo.core.data.Value; > import org.apache.accumulo.core.security.Authorizations; > > public class Mock { > > =A0 =A0 =A0 =A0public static void main(String[] args) throws Exception { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0String table =3D "data"; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0String user =3D "root"; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Instance inst =3D new MockInstance("inst")= ; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Connector conn =3D inst.getConnector(user,= "secret"); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0conn.securityOperations().changeUserAuthor= izations(user, new > Authorizations("auth")); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Authorizations auths =3D conn.securityOper= ations().getUserAuthorizations(user); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0conn.tableOperations().create(table); > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0System.out.println("Ingesting data ..."); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0BatchWriter wr =3D conn.createBatchWriter(= table, 10000000, 10000, 5); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0for(int i =3D 0; i < 1000; ++i) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{ > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Mutation m =3D new Mutatio= n("row_"+i); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0m.put("cf_"+i, "cq_"+1, "v= al_"+1); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0wr.addMutation(m); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0wr.close(); > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0System.out.println("Reading data ..."); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Scanner s =3D conn.createScanner(table, au= ths); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0for(Entry e : s) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{ > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0System.out.println(e); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0System.out.println("Done"); > =A0 =A0 =A0 =A0} > } > > stack trace (https://gist.github.com/1927225) > > Ingesting data ... > Reading data ... > Exception in thread > "org.apache.accumulo.start.classloader.AccumuloFilesystemAlterationMonito= r" > java.lang.NullPointerException > =A0 =A0 =A0 =A0at org.apache.commons.jci.monitor.FilesystemAlterationObse= rverImpl$MonitorFileImpl.listFiles(FilesystemAlterationObserverImpl.java:64= ) > =A0 =A0 =A0 =A0at org.apache.commons.jci.monitor.FilesystemAlterationObse= rverImpl$Entry.compareChilds(FilesystemAlterationObserverImpl.java:119) > =A0 =A0 =A0 =A0at org.apache.commons.jci.monitor.FilesystemAlterationObse= rverImpl$Entry.needsToBeDeleted(FilesystemAlterationObserverImpl.java:203) > =A0 =A0 =A0 =A0at org.apache.commons.jci.monitor.FilesystemAlterationObse= rverImpl$Entry.compareChilds(FilesystemAlterationObserverImpl.java:137) > =A0 =A0 =A0 =A0at org.apache.commons.jci.monitor.FilesystemAlterationObse= rverImpl$Entry.needsToBeDeleted(FilesystemAlterationObserverImpl.java:203) > =A0 =A0 =A0 =A0at org.apache.commons.jci.monitor.FilesystemAlterationObse= rverImpl$Entry.compareChilds(FilesystemAlterationObserverImpl.java:137) > =A0 =A0 =A0 =A0at org.apache.commons.jci.monitor.FilesystemAlterationObse= rverImpl$Entry.needsToBeDeleted(FilesystemAlterationObserverImpl.java:203) > =A0 =A0 =A0 =A0at org.apache.commons.jci.monitor.FilesystemAlterationObse= rverImpl$Entry.compareChilds(FilesystemAlterationObserverImpl.java:137) > =A0 =A0 =A0 =A0at org.apache.commons.jci.monitor.FilesystemAlterationObse= rverImpl$Entry.needsToBeDeleted(FilesystemAlterationObserverImpl.java:203) > =A0 =A0 =A0 =A0at org.apache.commons.jci.monitor.FilesystemAlterationObse= rverImpl.checkEntries(FilesystemAlterationObserverImpl.java:317) > =A0 =A0 =A0 =A0at org.apache.commons.jci.monitor.FilesystemAlterationObse= rverImpl.checkAndNotify(FilesystemAlterationObserverImpl.java:331) > =A0 =A0 =A0 =A0at org.apache.accumulo.start.classloader.AccumuloFilesyste= mAlterationMonitor.run(AccumuloFilesystemAlterationMonitor.java:121) > =A0 =A0 =A0 =A0at java.lang.Thread.run(Thread.java:722)