0

I have issue with Hbase Result Scanner

This is my scenario

  1. i have a list of Resultscanner(ListofScanner)
  2. from this Resultscanner list i want extract all results as list of
    result(ListofResult)
  3. and from result list i want iterate all cell values add to custom class list (Listclass)

So i coded like this

for(ResultScanner resca:ListofScanner)
{
for(Result Res:resca)
    {

    ListofResult.add(Res);


    }
}


for(Result rs:ListofResult)
{

   Listclass.add(Conver(rs));//Conver is function that converts results and return as a my class object

}

Here is the O/p

suppose i expect this result form Listclass if a print a all values

gattner
lisa
Miely
luzz

But actual list i got

luzz
luzz
luzz
luzz

The last element of Listclass is got updated to all values

I checked for each Result output after conversion ( Conver(rs) ) it returns as expected. But only issue adding Listofclass.

I running with maven .so i couldn't debug this with Breakpointer .so Where did i miss?

2
  • 2
    Please add exact code you are using. The code you places is pseudo once , and hard to interpret which line is causing the issue
    – Ramzy
    Jun 3, 2015 at 17:47
  • Place a debugger point and debug it line by line to see where the values are getting over written by the value "luzz" . With this partial code we cannot intepret whats going on in there. If you are not using debugger, please use the following link to integrate the debugger practicalweb.co.uk/blog/2014/11/19/…
    – jaycyborg
    Jun 4, 2015 at 8:00

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.