Package org.apache.hadoop.hbase.io

Examples of org.apache.hadoop.hbase.io.KeyedDataArrayWritable


     * @see org.apache.hadoop.mapred.RecordWriter#write(org.apache.hadoop.io.WritableComparable, org.apache.hadoop.io.Writable)
     */
    public void write(WritableComparable key, Writable value) throws IOException {
      LOG.debug("start write");
      Text tKey = (Text)key;
      KeyedDataArrayWritable tValue = (KeyedDataArrayWritable) value;
      KeyedData[] columns = tValue.get();

      // start transaction
     
      long xid = m_client.startUpdate(tKey);
     
View Full Code Here


  public void reduce(Text key, @SuppressWarnings("unchecked") Iterator values,
      TableOutputCollector output,
      @SuppressWarnings("unused") Reporter reporter) throws IOException {
   
    while(values.hasNext()) {
      KeyedDataArrayWritable r = (KeyedDataArrayWritable)values.next();
      output.collect(key, r);
    }
  }
View Full Code Here

     * @return KeyedDataArrayWritable of KeyedData
     *
     * @see org.apache.hadoop.mapred.RecordReader#createValue()
     */
    public Writable createValue() {
      return new KeyedDataArrayWritable();
    }
View Full Code Here

      if(hasMore) {
        if(m_endRow.getLength() > 0 && (tKey.getRow().compareTo(m_endRow) < 0)) {
          hasMore = false;
        } else {
          KeyedDataArrayWritable rowVal = (KeyedDataArrayWritable) value;
          ArrayList<KeyedData> columns = new ArrayList<KeyedData>();

          for(Map.Entry<Text, byte[]> e: m_row.entrySet()) {
            HStoreKey keyCol = new HStoreKey(tKey);
            keyCol.setColumn(e.getKey());
            columns.add(new KeyedData(keyCol, e.getValue()));
          }

          // set the output
          rowVal.set(columns.toArray(new KeyedData[columns.size()]));
        }
      }
      LOG.debug("end next");
      return hasMore;
    }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.io.KeyedDataArrayWritable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.