Class: Apache::Hadoop::Hbase::Thrift2::TDelete

Inherits:
Object
  • Object
show all
Includes:
Thrift::Struct, Thrift::Struct_Union
Defined in:
lib/hbase/hbase_types.rb

Overview

The scope can be further narrowed down by specifying a list of columns or column families as TColumns.

Specifying only a family in a TColumn will delete the whole family. If a timestamp is specified all versions with a timestamp less than or equal to this will be deleted. If no timestamp is specified the current time will be used.

Specifying a family and a column qualifier in a TColumn will delete only this qualifier. If a timestamp is specified only versions equal to this timestamp will be deleted. If no timestamp is specified the most recent version will be deleted. To delete all previous versions, specify the DELETE_COLUMNS TDeleteType.

The top level timestamp is only used if a complete row should be deleted (i.e. no columns are passed) and if it is specified it works the same way as if you had added a TColumn for every column family and this timestamp (i.e. all versions older than or equal in all column families will be deleted)

You can specify how this Delete should be written to the write-ahead Log (WAL) by changing the durability. If you don’t provide durability, it defaults to column family’s default setting for durability.

Constant Summary collapse

ROW =
1
COLUMNS =
2
TIMESTAMP =
3
DELETETYPE =
4
ATTRIBUTES =
6
DURABILITY =
7
FIELDS =
{
  ROW => {:type => ::Thrift::Types::STRING, :name => 'row', :binary => true},
  COLUMNS => {:type => ::Thrift::Types::LIST, :name => 'columns', :element => {:type => ::Thrift::Types::STRUCT, :class => ::Apache::Hadoop::Hbase::Thrift2::TColumn}, :optional => true},
  TIMESTAMP => {:type => ::Thrift::Types::I64, :name => 'timestamp', :optional => true},
  DELETETYPE => {:type => ::Thrift::Types::I32, :name => 'deleteType', :default =>             1, :optional => true, :enum_class => ::Apache::Hadoop::Hbase::Thrift2::TDeleteType},
  ATTRIBUTES => {:type => ::Thrift::Types::MAP, :name => 'attributes', :key => {:type => ::Thrift::Types::STRING, :binary => true}, :value => {:type => ::Thrift::Types::STRING, :binary => true}, :optional => true},
  DURABILITY => {:type => ::Thrift::Types::I32, :name => 'durability', :optional => true, :enum_class => ::Apache::Hadoop::Hbase::Thrift2::TDurability}
}

Instance Method Summary collapse

Instance Method Details

#struct_fieldsObject



301
# File 'lib/hbase/hbase_types.rb', line 301

def struct_fields; FIELDS; end

#validateObject

Raises:

  • (::Thrift::ProtocolException)


303
304
305
306
307
308
309
310
311
# File 'lib/hbase/hbase_types.rb', line 303

def validate
  raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field row is unset!') unless @row
  unless @deleteType.nil? || ::Apache::Hadoop::Hbase::Thrift2::TDeleteType::VALID_VALUES.include?(@deleteType)
    raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field deleteType!')
  end
  unless @durability.nil? || ::Apache::Hadoop::Hbase::Thrift2::TDurability::VALID_VALUES.include?(@durability)
    raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field durability!')
  end
end