hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Edward J. Yoon" <edwardy...@apache.org>
Subject Re: Re[2]: Bulk import question.
Date Thu, 20 Nov 2008 07:00:35 GMT
Sure, only map code was changed. and the input data is a text file
from sqlite dump.

Input line : "999949|4217|0||1211920741.790266.26733.816999|0|Subject:cp949:Y
From:cp949:Y To:cp949:Y Cc::N Bcc::N ReplyTo::Y|..."

Map:

    public void map(LongWritable key, Text value,
        OutputCollector<Text, Text> output, Reporter reporter)
        throws IOException {
      if (table == null)
        throw new IOException("table is null");

      String[] splits = value.toString().split("[|]");
      BatchUpdate update = new BatchUpdate(Bytes.toBytes(Integer
          .parseInt(splits[0])));

      if (splits.length == 31) {
        for (int i = 0; i < splits.length; i++) {
          if (!splits[i].equals("")) {
            update.put(TEXT + fields[i], Bytes.toBytes(splits[i]));
          }
        }
        table.commit(update);
      }
    }


On Thu, Nov 20, 2008 at 3:53 PM, ROL <dmkd@rol.ru> wrote:
> Hi
>
> Can you show source?
>
>> While job running, I scanned that table at the same time.
>
> --
> С уважением,
>  ROL                          mailto:dmkd@rol.ru
>
>



-- 
Best Regards, Edward J. Yoon @ NHN, corp.
edwardyoon@apache.org
http://blog.udanax.org
Mime
View raw message