Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 68F01200B62 for ; Fri, 12 Aug 2016 08:47:23 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 67819160AB6; Fri, 12 Aug 2016 06:47:23 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id B047C160AB0 for ; Fri, 12 Aug 2016 08:47:22 +0200 (CEST) Received: (qmail 24339 invoked by uid 500); 12 Aug 2016 06:47:20 -0000 Mailing-List: contact dev-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list dev@hbase.apache.org Received: (qmail 23969 invoked by uid 99); 12 Aug 2016 06:47:20 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Aug 2016 06:47:20 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 879052C02AA for ; Fri, 12 Aug 2016 06:47:20 +0000 (UTC) Date: Fri, 12 Aug 2016 06:47:20 +0000 (UTC) From: "Dima Spivak (JIRA)" To: dev@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (HBASE-16406) import data to hbase error by using hbase api MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 12 Aug 2016 06:47:23 -0000 [ https://issues.apache.org/jira/browse/HBASE-16406?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Dima Spivak resolved HBASE-16406. --------------------------------- Resolution: Invalid > import data to hbase error by using hbase api > --------------------------------------------- > > Key: HBASE-16406 > URL: https://issues.apache.org/jira/browse/HBASE-16406 > Project: HBase > Issue Type: Bug > Reporter: xiboliyalangwolf > > The code i wrote belows: > public static void addRow(String tableName, String row,String columnFamily, String column, String value) throws Exception { > HTable table = new HTable(conf,tableName); > Put put = new Put(Bytes.toBytes(row)); > put.add(Bytes.toBytes(columnFamily), Bytes.toBytes(column),Bytes.toBytes(value)); > table.put(put); > table.close(); > } > public static void main(String[] args){ > String tableName = "test1"; > String[] columnFamilys = { "info", "course" }; > //createTable(tableName,columnFamilys); > try { > addRow(tableName, "tht", "info", "age", "20"); > // addRow(tableName, "tht", "info", "sex", "boy"); > addRow(tableName, "tht", "course", "china", "97"); > // addRow(tableName, "tht", "course", "math", "128"); > // addRow(tableName, "tht", "course", "english", "85"); > } catch (Exception e) { > // TODO Auto-generated catch block > e.printStackTrace(); > } > And The error: > org.apache.hadoop.hbase.client.RetriesExhaustedWithDetailsException: Failed 1 action: test1: 1 time, > at org.apache.hadoop.hbase.client.AsyncProcess$BatchErrors.makeException(AsyncProcess.java:228) > at org.apache.hadoop.hbase.client.AsyncProcess$BatchErrors.access$1700(AsyncProcess.java:208) > at org.apache.hadoop.hbase.client.AsyncProcess.waitForAllPreviousOpsAndReset(AsyncProcess.java:1700) > at org.apache.hadoop.hbase.client.BufferedMutatorImpl.backgroundFlushCommits(BufferedMutatorImpl.java:208) > at org.apache.hadoop.hbase.client.BufferedMutatorImpl.flush(BufferedMutatorImpl.java:183) > at org.apache.hadoop.hbase.client.HTable.flushCommits(HTable.java:1449) > at org.apache.hadoop.hbase.client.HTable.put(HTable.java:1040) > at hbase2.testCreate.addRow(testCreate.java:45) > at hbase2.testCreate.main(testCreate.java:53) > How can i solve it? -- This message was sent by Atlassian JIRA (v6.3.4#6332)