[ https://issues.apache.org/jira/browse/HBASE-11817?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16280791#comment-16280791 ]
Jean-Marc Spaggiari commented on HBASE-11817: --------------------------------------------- 0.98 is old, tried on 1.0.2 and it works well now. Closing. > HTable.batch() loses operations when region is splited > ------------------------------------------------------ > > Key: HBASE-11817 > URL: https://issues.apache.org/jira/browse/HBASE-11817 > Project: HBase > Issue Type: Bug > Components: Admin, Client > Affects Versions: 0.98.4 > Environment: 0.98.4+hadoop 2.4.1, 0.98.4 stand-alone, jdk1.6 > Reporter: t samkawa > > Using HTable.batch() often loses increment operation when region split ran. > Test code snpipet is below; > Running this 2 code blocks concurrently, different values were often > recoreded although all value should be same 0xffff. > {code} > // --- code 1 --- > HTable table = new HTable(CONF); > byte[] rowKey = new byte[1]; > for (int i=0;i<0xffff;i++){ > ArrayList<Increment> operations = new ArrayList<Increment>(); > for (byte c1 = (byte)'A'; c1<=(byte)'Z'; c1++) { > rowKey[0] = c1; > Increment opIncr = new Increment(rowKey); > opIncr.addColumn(FAM, HConstants.EMPTY_BYTE_ARRAY, 1); > operations.add(opIncr); > } > table.batch(operations, null); > } > // -- code2 -- > HBaseAdmin admin = new HBaseAdmin(CONF); > byte[] rowKey = new byte[1]; > for (byte c1 = (byte)'A'; c1<=(byte)'Z'; c1++) { > try { Thread.sleep(2000L); } catch (InterruptedException iex) {} > rowKey[0] = c1; > admin.split(TABLE_NAME, rowKey); > } > ///// > {code} > Using table.increment() instead of table.batch() works fine. But that change > gets slower . -- This message was sent by Atlassian JIRA (v6.4.14#64029)