Class: Humboldt::BinaryPrefixComparator Deprecated

Inherits:
Object
  • Object
show all
Defined in:
lib/humboldt/prefix_grouping.rb

Overview

Deprecated.

Use Rubydoop::JobDescription::secondary_sort

Direct Known Subclasses

DropBinaryPrefixComparator

Instance Method Summary collapse

Constructor Details

#initialize(cutoff_index) ⇒ BinaryPrefixComparator

Returns a new instance of BinaryPrefixComparator.



31
32
33
# File 'lib/humboldt/prefix_grouping.rb', line 31

def initialize(cutoff_index)
  @cutoff_index = cutoff_index
end

Instance Method Details

#compare_raw(bytes1, start1, length1, bytes2, start2, length2) ⇒ Object



35
36
37
38
39
# File 'lib/humboldt/prefix_grouping.rb', line 35

def compare_raw(bytes1, start1, length1, bytes2, start2, length2)
  subset_length1 = @cutoff_index > length1 ? length1 : @cutoff_index
  subset_length2 = @cutoff_index > length2 ? length2 : @cutoff_index
  ::Hadoop::Io::WritableComparator.compareBytes(bytes1, start1, subset_length1, bytes2, start2, subset_length2)
end