You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@whirr.apache.org by Apurv Verma <da...@gmail.com> on 2012/03/21 16:14:32 UTC
CdhHBaseServiceTest.java problems
Hi,
I pulled the latest whirr-trunk and imported it into eclipse. The
class CdhHBaseServiceTest in whirr-cdh is having problems.
--
thanks and regards,
Apurv Verma
B. Tech.(CSE)
IIT- Ropar
Re: CdhHBaseServiceTest.java problems
Posted by Ashish <pa...@gmail.com>.
On Thu, Mar 22, 2012 at 9:50 PM, Andrei Savu <sa...@gmail.com> wrote:
>
> On Wed, Mar 21, 2012 at 8:24 PM, Ashish <pa...@gmail.com> wrote:
>>
>> Andrei - can you check your settings?
>
>
> I have re-imported the project & invalidated the caches and I still see the
> errors.
>
> What version of IDEA are you using?
False Alarm.. I was looking at Cdh3HBaseServiceTest.java
Damnn.. i need to get my eyes checked :)
Sorry for noise.
Re: CdhHBaseServiceTest.java problems
Posted by Andrei Savu <sa...@gmail.com>.
On Wed, Mar 21, 2012 at 8:24 PM, Ashish <pa...@gmail.com> wrote:
> Andrei - can you check your settings?
I have re-imported the project & invalidated the caches and I still see the
errors.
What version of IDEA are you using?
Re: CdhHBaseServiceTest.java problems
Posted by Ashish <pa...@gmail.com>.
On Wed, Mar 21, 2012 at 11:36 PM, Andrei Savu <sa...@gmail.com> wrote:
> I see the same issue. I think that IDEA is using a different version of the
> HBase artefacts,
> a version that's not the one specified in the pom file.
>
> I will investigate more because I don't have a clear answer to why is this
> happening.
>
> I think there is nothing wrong with the project pom files because everything
> builds fine
> with maven 3.
IDEA doesn't show me any errors.
No special settings, just created the project from Maven and done.
My project setting uses SDK 1.6 and project language level is 5.0
(autoboxing and stuff)
Andrei - can you check your settings?
thanks
ashsih
Re: CdhHBaseServiceTest.java problems
Posted by Andrei Savu <sa...@gmail.com>.
I see the same issue. I think that IDEA is using a different version of the
HBase artefacts,
a version that's not the one specified in the pom file.
I will investigate more because I don't have a clear answer to why is this
happening.
I think there is nothing wrong with the project pom files because
everything builds fine
with maven 3.
On Wed, Mar 21, 2012 at 5:41 PM, Apurv Verma <da...@gmail.com> wrote:
> Consider this function there.
>
> @Test(timeout = TestConstants.ITEST_TIMEOUT)
> public void test() throws Exception {
> ArrayList<ColumnDescriptor> columns = new
> ArrayList<ColumnDescriptor>();
> ColumnDescriptor cd = new ColumnDescriptor();
> cd.name = FAMILY1;
> columns.add(cd);
> cd = new ColumnDescriptor();
> cd.name = FAMILY2;
> columns.add(cd);
>
> Hbase.Client client = controller.getThriftClient();
> client.createTable(TABLE, columns);
>
> ArrayList<Mutation> mutations = new ArrayList<Mutation>();
> mutations.add(new Mutation(false, COLUMN, VALUE));
> client.mutateRow(TABLE, ROW, mutations);
>
> int scan1 = client.scannerOpen(TABLE, FIRST,
> Lists.newArrayList(FAMILY1));
> List<TRowResult> rows = client.scannerGet(scan1);
> assertThat(rows.size(), is(1));
> assertThat(Bytes.toString(rows.get(0).getRow()), is("testRow"));
> assertTrue("No more rows", client.scannerGet(scan1).isEmpty());
> client.scannerClose(scan1);
>
> int scan2 = client.scannerOpen(TABLE, FIRST,
> Lists.newArrayList(FAMILY2));
> assertTrue("No more rows", client.scannerGet(scan2).isEmpty());
> client.scannerClose(scan2);
> }
>
> The name attribute in a ColumnDescriptor is of type byte buffer whereas
> FAMILY1 is a byte[] array. In eclipse the red marks say, "Type mismatch:
> cannot convert from byte[] to ByteBuffer"
>
> --
> thanks and regards,
>
> Apurv Verma
> B. Tech.(CSE)
> IIT- Ropar
>
>
>
>
>
>
> On Wed, Mar 21, 2012 at 8:46 PM, Andrei Savu <sa...@gmail.com>wrote:
>
>> What kind of problems?
>>
>> On Wed, Mar 21, 2012 at 5:14 PM, Apurv Verma <da...@gmail.com> wrote:
>>
>>> Hi,
>>> I pulled the latest whirr-trunk and imported it into eclipse. The
>>> class CdhHBaseServiceTest in whirr-cdh is having problems.
>>>
>>>
>>> --
>>> thanks and regards,
>>>
>>> Apurv Verma
>>> B. Tech.(CSE)
>>> IIT- Ropar
>>>
>>>
>>>
>>>
>>>
>>
>
Re: CdhHBaseServiceTest.java problems
Posted by Apurv Verma <da...@gmail.com>.
Consider this function there.
@Test(timeout = TestConstants.ITEST_TIMEOUT)
public void test() throws Exception {
ArrayList<ColumnDescriptor> columns = new ArrayList<ColumnDescriptor>();
ColumnDescriptor cd = new ColumnDescriptor();
cd.name = FAMILY1;
columns.add(cd);
cd = new ColumnDescriptor();
cd.name = FAMILY2;
columns.add(cd);
Hbase.Client client = controller.getThriftClient();
client.createTable(TABLE, columns);
ArrayList<Mutation> mutations = new ArrayList<Mutation>();
mutations.add(new Mutation(false, COLUMN, VALUE));
client.mutateRow(TABLE, ROW, mutations);
int scan1 = client.scannerOpen(TABLE, FIRST,
Lists.newArrayList(FAMILY1));
List<TRowResult> rows = client.scannerGet(scan1);
assertThat(rows.size(), is(1));
assertThat(Bytes.toString(rows.get(0).getRow()), is("testRow"));
assertTrue("No more rows", client.scannerGet(scan1).isEmpty());
client.scannerClose(scan1);
int scan2 = client.scannerOpen(TABLE, FIRST,
Lists.newArrayList(FAMILY2));
assertTrue("No more rows", client.scannerGet(scan2).isEmpty());
client.scannerClose(scan2);
}
The name attribute in a ColumnDescriptor is of type byte buffer whereas
FAMILY1 is a byte[] array. In eclipse the red marks say, "Type mismatch:
cannot convert from byte[] to ByteBuffer"
--
thanks and regards,
Apurv Verma
B. Tech.(CSE)
IIT- Ropar
On Wed, Mar 21, 2012 at 8:46 PM, Andrei Savu <sa...@gmail.com> wrote:
> What kind of problems?
>
> On Wed, Mar 21, 2012 at 5:14 PM, Apurv Verma <da...@gmail.com> wrote:
>
>> Hi,
>> I pulled the latest whirr-trunk and imported it into eclipse. The
>> class CdhHBaseServiceTest in whirr-cdh is having problems.
>>
>>
>> --
>> thanks and regards,
>>
>> Apurv Verma
>> B. Tech.(CSE)
>> IIT- Ropar
>>
>>
>>
>>
>>
>
Re: CdhHBaseServiceTest.java problems
Posted by Andrei Savu <sa...@gmail.com>.
What kind of problems?
On Wed, Mar 21, 2012 at 5:14 PM, Apurv Verma <da...@gmail.com> wrote:
> Hi,
> I pulled the latest whirr-trunk and imported it into eclipse. The
> class CdhHBaseServiceTest in whirr-cdh is having problems.
>
>
> --
> thanks and regards,
>
> Apurv Verma
> B. Tech.(CSE)
> IIT- Ropar
>
>
>
>
>