accumulo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Medinets <david.medin...@gmail.com>
Subject Re: Incorrectly setting TKey causes NPE (to nobody's surprise)
Date Tue, 26 Jun 2012 13:17:55 GMT
I play 'stupid developer' fairly well. I saw something that defines a
key and started to use it. If I set row, cf, cq, and visibility then
the iterator works fine.

Is there any reasons why default values of "" should not be provided
for cf, cq, and visibility?

On Tue, Jun 26, 2012 at 9:09 AM, Marc P. <marc.parisi@gmail.com> wrote:
> I realized that Mr Slacum and I addressed the concern of using thrift;
> however, perhaps you are doing something internally. Have you tried
> setting the stop key on the TRange just for S&Gs?
>
> On Tue, Jun 26, 2012 at 9:03 AM, Marc P. <marc.parisi@gmail.com> wrote:
>> Why are you using that accepts the thrift key and range? They're
>> internal communication objects within accumulo. I haven't looked the
>> code directly, but they're likely contracted to be set in a different
>> manner.
>>
>>
>> On Tue, Jun 26, 2012 at 8:56 AM, David Medinets
>> <david.medinets@gmail.com> wrote:
>>> I did this:
>>>
>>> TKey tKey = new TKey();
>>> tKey.setRow(row_id.getBytes());
>>>
>>>
>>> TRange tRange = new TRange();
>>> trange.setStart(tKey);
>>>
>>> scan.setRange(tRange);
>>>
>>> Iterator iterator = scan.iterator();
>>> iterator.hasNext();
>>>
>>> This resulted in an NPE in:
>>>
>>> org.apache.accumulo.core.data.Key.rowColumnStringBuilder(Key.java:472)
>>>
>>> While I have no real objection to this NPE (my code is clearly
>>> deficient), I wonder if a more cogent error message is possible.
>>> Should there be guard statements somewhere to ensure a valid object?

Mime
View raw message