public NullAwareComparator(TypeComparator<T> wrappedComparator, boolean order) { this.wrappedComparator = wrappedComparator; this.order = order; this.flatFields = wrappedComparator.getFlatComparators().length; }
public CommonRangeBoundaries(TypeComparator<T> typeComparators, Object[][] boundaries) { this.typeComparator = typeComparators; this.flatComparators = typeComparators.getFlatComparators(); this.keys = new Object[flatComparators.length]; this.boundaries = boundaries; }
@SuppressWarnings("unchecked") public GenericPairComparator(TypeComparator<T1> comparator1, TypeComparator<T2> comparator2) { this.comparator1 = comparator1; this.comparator2 = comparator2; this.comparators1 = comparator1.getFlatComparators(); this.comparators2 = comparator2.getFlatComparators(); if(comparators1.length != comparators2.length) { throw new IllegalArgumentException("Number of key fields and comparators differ."); } int numKeys = comparators1.length; for(int i = 0; i < numKeys; i++) { this.comparators1[i] = comparators1[i].duplicate(); this.comparators2[i] = comparators2[i].duplicate(); } this.referenceKeyFields = new Object[numKeys]; this.candidateKeyFields = new Object[numKeys]; }
@Test @SuppressWarnings("unchecked") public void testKeyExtraction() { TypeComparator<T> comparator = getComparator(true); T[] data = getSortedData(); for (T value : data) { TypeComparator[] comparators = comparator.getFlatComparators(); Object[] extractedKeys = new Object[comparators.length]; int insertedKeys = comparator.extractKeys(value, extractedKeys, 0); assertTrue(insertedKeys == comparators.length); for (int i = 0; i < insertedKeys; i++) { // check if some keys are null, although this is not supported if (!supportsNullKeys()) { assertNotNull(extractedKeys[i]); } // compare the extracted key with itself as a basic check // if the extracted key corresponds to the comparator assertTrue(comparators[i].compare(extractedKeys[i], extractedKeys[i]) == 0); } } }
public CommonRangeBoundaries(TypeComparator<T> typeComparators, Object[][] boundaries) { this.typeComparator = typeComparators; this.flatComparators = typeComparators.getFlatComparators(); this.keys = new Object[flatComparators.length]; this.boundaries = boundaries; }
public NullAwareComparator(TypeComparator<T> wrappedComparator, boolean order) { this.wrappedComparator = wrappedComparator; this.order = order; this.flatFields = wrappedComparator.getFlatComparators().length; }
public CommonRangeBoundaries(TypeComparator<T> typeComparators, Object[][] boundaries) { this.typeComparator = typeComparators; this.flatComparators = typeComparators.getFlatComparators(); this.keys = new Object[flatComparators.length]; this.boundaries = boundaries; }
public NullAwareComparator(TypeComparator<T> wrappedComparator, boolean order) { this.wrappedComparator = wrappedComparator; this.order = order; this.flatFields = wrappedComparator.getFlatComparators().length; }
public TypeComparator[] getFlatComparators() { List<TypeComparator> flatComparators = new LinkedList<>(); for (TypeComparator c : nullAwareComparators) { Collections.addAll(flatComparators, c.getFlatComparators()); } return flatComparators.toArray(new TypeComparator[0]); }
@SuppressWarnings("unchecked") public GenericPairComparator(TypeComparator<T1> comparator1, TypeComparator<T2> comparator2) { this.comparator1 = comparator1; this.comparator2 = comparator2; this.comparators1 = comparator1.getFlatComparators(); this.comparators2 = comparator2.getFlatComparators(); if(comparators1.length != comparators2.length) { throw new IllegalArgumentException("Number of key fields and comparators differ."); } int numKeys = comparators1.length; for(int i = 0; i < numKeys; i++) { this.comparators1[i] = comparators1[i].duplicate(); this.comparators2[i] = comparators2[i].duplicate(); } this.referenceKeyFields = new Object[numKeys]; this.candidateKeyFields = new Object[numKeys]; }
@SuppressWarnings("unchecked") public GenericPairComparator(TypeComparator<T1> comparator1, TypeComparator<T2> comparator2) { this.comparator1 = comparator1; this.comparator2 = comparator2; this.comparators1 = comparator1.getFlatComparators(); this.comparators2 = comparator2.getFlatComparators(); if(comparators1.length != comparators2.length) { throw new IllegalArgumentException("Number of key fields and comparators differ."); } int numKeys = comparators1.length; for(int i = 0; i < numKeys; i++) { this.comparators1[i] = comparators1[i].duplicate(); this.comparators2[i] = comparators2[i].duplicate(); } this.referenceKeyFields = new Object[numKeys]; this.candidateKeyFields = new Object[numKeys]; }
channels = new int[1]; if (comparator != null) { this.flatComparators = comparator.getFlatComparators(); this.keys = new Object[flatComparators.length];
channels = new int[1]; if (comparator != null) { this.flatComparators = comparator.getFlatComparators(); this.keys = new Object[flatComparators.length];
channels = new int[1]; if (comparator != null) { this.flatComparators = comparator.getFlatComparators(); this.keys = new Object[flatComparators.length];
case PARTITION_RANGE: if (comparator != null) { this.flatComparators = comparator.getFlatComparators(); this.keys = new Object[flatComparators.length];
if (sampledData.size() > 0) { double avgRange = sampledData.size() / (double) parallelism; int numKey = comparator.getFlatComparators().length; for (int i = 1; i < parallelism; i++) { T record = sampledData.get((int) (i * avgRange));
if (sampledData.size() > 0) { double avgRange = sampledData.size() / (double) parallelism; int numKey = comparator.getFlatComparators().length; for (int i = 1; i < parallelism; i++) { T record = sampledData.get((int) (i * avgRange));
if (sampledData.size() > 0) { double avgRange = sampledData.size() / (double) parallelism; int numKey = comparator.getFlatComparators().length; for (int i = 1; i < parallelism; i++) { T record = sampledData.get((int) (i * avgRange));
if (sampledData.size() > 0) { double avgRange = sampledData.size() / (double) parallelism; int numKey = comparator.getFlatComparators().length; for (int i = 1; i < parallelism; i++) { T record = sampledData.get((int) (i * avgRange));
numPartialKeys = this.comparator.getFlatComparators().length; } catch (Throwable t) { numPartialKeys = 1;