You can also use Guava's UnsignedBytes.lexicographicalComparator(). On Tue, May 10, 2016 at 10:40 AM Mario Pastorelli < [email protected]> wrote:
> Hi Josh, > > Thanks for the answer and sorry for my question not being clear. I need > the same comparator that accumulo is using for arrays of bytes and I think > your suggestion pointed me to the right class: I can use Hadoop > WritableComparable.compareBytes static method to obtain the lexicographic > order of binary data that is used by Accumulo. > > Thanks for the help, > Mario > > On Tue, May 10, 2016 at 4:22 PM, Josh Elser <[email protected]> wrote: > >> Hi Mario, >> >> I'm not sure I 100% understand your question. Are you asking about the >> code which sorts Accumulo Keys? >> >> If so, Key implements the Comparable interface (the `compareTo(Key)` >> method). You might be able to make use of the `compareTo(Key, PartialKey)` >> method as well. You can use this with standard sorting implementations >> (e.g. Collections.sort(..) or any SortedMap implementation). >> >> - Josh >> >> Mario Pastorelli wrote: >> >>> Hi, >>> I would like to reuse the ordering of byte arrays that Accumulo uses for >>> the keys. Is it exposed to the users? Where can I find it? >>> >>> Thanks, >>> Mario >>> >>> -- >>> Mario Pastorelli| TERALYTICS >>> >>> *software engineer* >>> >>> Teralytics AG | Zollstrasse 62 | 8005 Zurich | Switzerland >>> phone:+41794381682 >>> email: [email protected] >>> <mailto:[email protected]> >>> www.teralytics.net <http://www.teralytics.net/> >>> >>> Company registration number: CH-020.3.037.709-7 | Trade register Canton >>> Zurich >>> Board of directors: Georg Polzer, Luciano Franceschina, Mark Schmitz, >>> Yann de Vries >>> >>> This e-mail message contains confidential information which is for the >>> sole attention and use of the intended recipient. Please notify us at >>> once if you think that it may not be intended for you and delete it >>> immediately. >>> >>> > > > -- > Mario Pastorelli | TERALYTICS > > *software engineer* > > Teralytics AG | Zollstrasse 62 | 8005 Zurich | Switzerland > phone: +41794381682 > email: [email protected] > www.teralytics.net > > Company registration number: CH-020.3.037.709-7 | Trade register Canton > Zurich > Board of directors: Georg Polzer, Luciano Franceschina, Mark Schmitz, Yann > de Vries > > This e-mail message contains confidential information which is for the > sole attention and use of the intended recipient. Please notify us at once > if you think that it may not be intended for you and delete it immediately. >
