You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Zheng Hu (JIRA)" <ji...@apache.org> on 2017/07/19 08:02:00 UTC

[jira] [Reopened] (HBASE-18402) Thrift2 should support DeleteFamily and DeleteFamilyVersion type

     [ https://issues.apache.org/jira/browse/HBASE-18402?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Zheng Hu reopened HBASE-18402:
------------------------------

Seems like ThriftUtilities#deleteFromThrift only support 3 deleteType:  delete/deleteColumn/deleteFamily,  but NOT deleteFamilyVersion.  :( 

SO I reopened the issue.... 

{code}
public static Delete deleteFromThrift(TDelete in) {
    Delete out;

    if (in.isSetColumns()) {
      out = new Delete(in.getRow());
      for (TColumn column : in.getColumns()) {
        if (column.isSetQualifier()) {
          if (column.isSetTimestamp()) {
            if (in.isSetDeleteType() &&
                in.getDeleteType().equals(TDeleteType.DELETE_COLUMNS))
              out.addColumns(column.getFamily(), column.getQualifier(), column.getTimestamp());
            else
              out.addColumn(column.getFamily(), column.getQualifier(), column.getTimestamp());
          } else {
            if (in.isSetDeleteType() &&
                in.getDeleteType().equals(TDeleteType.DELETE_COLUMNS))
              out.addColumns(column.getFamily(), column.getQualifier());
            else
              out.addColumn(column.getFamily(), column.getQualifier());
          }

        } else {
          if (column.isSetTimestamp()) {
            out.addFamily(column.getFamily(), column.getTimestamp());
          } else {
            out.addFamily(column.getFamily());
          }
        }
      }
    } else {
      if (in.isSetTimestamp()) {
        out = new Delete(in.getRow(), in.getTimestamp());
      } else {
        out = new Delete(in.getRow());
      }
    }

    if (in.isSetAttributes()) {
      addAttributes(out,in.getAttributes());
    }

    if (in.isSetDurability()) {
      out.setDurability(durabilityFromThrift(in.getDurability()));
    }

    return out;
  }
{code}

> Thrift2 should support  DeleteFamily and DeleteFamilyVersion type
> -----------------------------------------------------------------
>
>                 Key: HBASE-18402
>                 URL: https://issues.apache.org/jira/browse/HBASE-18402
>             Project: HBase
>          Issue Type: Bug
>          Components: Thrift
>    Affects Versions: 2.0.0-alpha-1
>            Reporter: Zheng Hu
>            Assignee: Zheng Hu
>
> Currently,  our thrift2 only support two delete types, Actually, there are four delete types.and  we should support the other delete type:  DeleteFamily and DeleteFamilyVersion. 
> {code}
> /**
>  * Specify type of delete:
>  *  - DELETE_COLUMN means exactly one version will be removed,
>  *  - DELETE_COLUMNS means previous versions will also be removed.
>  */
> enum TDeleteType {
>   DELETE_COLUMN = 0,
>   DELETE_COLUMNS = 1
> }
> {code} 



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)