hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anoop Sam John (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-14988) AssertionError: results.length when doing batch with large number of increment
Date Thu, 17 Dec 2015 07:34:46 GMT

    [ https://issues.apache.org/jira/browse/HBASE-14988?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15061657#comment-15061657
] 

Anoop Sam John commented on HBASE-14988:
----------------------------------------

bq.table.batch(increments, Array.empty[Object])
You seems not passing the Result array of required size.  The size should be same as that
of the 'increments' list.
In case of deprecated API, it was internally creating a Result array of needed size correctly.
 Pls correct the code and check once.

> AssertionError: results.length when doing batch with large number of increment
> ------------------------------------------------------------------------------
>
>                 Key: HBASE-14988
>                 URL: https://issues.apache.org/jira/browse/HBASE-14988
>             Project: HBase
>          Issue Type: Bug
>    Affects Versions: 1.0.0
>            Reporter: Keith Lui
>
> Tried to do a 10K increment with batch. When using 
> public void batch(List<? extends Row> actions, Object[] results) 
> got 
> java.lang.reflect.InvocationTargetException
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:606)
> 	at com.simontuffs.onejar.Boot.run(Boot.java:340)
> 	at com.simontuffs.onejar.Boot.main(Boot.java:166)
> Caused by: java.lang.AssertionError: results.length
> 	at org.apache.hadoop.hbase.client.AsyncProcess$AsyncRequestFutureImpl.<init>(AsyncProcess.java:763)
> 	at org.apache.hadoop.hbase.client.AsyncProcess.createAsyncRequestFuture(AsyncProcess.java:1578)
> 	at org.apache.hadoop.hbase.client.AsyncProcess.submitAll(AsyncProcess.java:554)
> 	at org.apache.hadoop.hbase.client.HTable.batch(HTable.java:1000)
> Interestingly no exception is thrown when using the deprecated method 
> public Object[] batch(List<? extends Row> actions)
> This is a sample code in Scala:
> val table = connection.getTable(TableName.valueOf("test_table"))
> val increments = for (i <- 0 until 10000) yield {
> val increment = new Increment(Random.nextDouble().toString.getBytes)
> increment.addColumn(family, qualifier, Random.nextLong())
> increment
> }
> table.batch(increments, Array.empty[Object])



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message