All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.cloudgraph.hbase.client.HBasePut Maven / Gradle / Ivy

Go to download

CloudGraph(tm) is a suite of Service Data Object (SDO) 2.1 services designed for relational and big-table style "cloud" databases, such as HBase and others.

The newest version!
package org.cloudgraph.hbase.client;

import java.util.ArrayList;
import java.util.List;

import org.cloudgraph.core.client.Cell;
import org.cloudgraph.core.client.Put;
import org.plasma.sdo.DataType;

public class HBasePut extends HBaseMutation implements Put {
  private org.apache.hadoop.hbase.client.Put put;

  public HBasePut(org.apache.hadoop.hbase.client.Put put) {
    super(put);
    this.put = put;
  }

  public HBasePut(byte[] rowKey) {
    this(new org.apache.hadoop.hbase.client.Put(rowKey));
  }

  public org.apache.hadoop.hbase.client.Put get() {
    return this.put;
  }

  @Override
  public byte[] getRow() {
    return this.put.getRow();
  }

  @Override
  public void addColumn(byte[] family, byte[] qualifier, DataType valueDataType, byte[] value) {
    this.put.addColumn(family, qualifier, value);
  }

  @Override
  public void addColumn(byte[] fam, byte[] qual, long ts, byte[] value) {
    this.put.addColumn(fam, qual, ts, value);
  }

  @Override
  public boolean has(byte[] family, byte[] qualifier) {
    return this.put.has(family, qualifier);
  }

  @Override
  public List get(byte[] family, byte[] qualifier) {
    List list = this.put.get(family, qualifier);
    if (list != null) {
      List resultList = new ArrayList<>(list.size());
      for (org.apache.hadoop.hbase.Cell cell : list) {
        resultList.add(new HBaseCell(cell));
      }
      return resultList;
    }
    return null;
  }

  @Override
  public int size() {
    return this.put.size();
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy