Adds the comparator, that uses a function for extract
a {@code long} sort key, to the chain.

@param keyExtractor  the function that extracts the sort key
@return the new {@code ComparatorCompat} instance
970137
@NotNull
    public ComparatorCompat<T> thenComparingLong(@NotNull ToLongFunction<? super T> keyExtractor) {
        return thenComparing(comparingLong(keyExtractor));
    }
136843
public static <T> ItemsUnion<T> getInstance(final Comparator<? super T> comparator) {
    return new ItemsUnion<T>(PreambleUtil.DEFAULT_K, comparator, null);
  }
501993
public void addComparator(Comparator<T> comparator, boolean ascending) {
		this.comparators.add(new InvertibleComparator<T>(comparator, ascending));
	}
832735
public void sort(@NonNull Comparator<? super T> comparator) {
        final ArrayList<T> copy = new ArrayList<>(mObjects);
        Collections.sort(copy, comparator);
        swap(copy);
    }
180980
public <T> Comparator<T> buildComparator() {
        if (sortedAttributes.isEmpty()) {
            return (o1, o2) -> 0;
        } else {
            Comparator<T> comparator = null;
            for (SortedAttribute sortedAttribute : sortedAttributes) {
                if (comparator == null) {
                    comparator = buildComparator(sortedAttribute);
                } else {
                    comparator = comparator.thenComparing(buildComparator(sortedAttribute));
                }
            }
            return comparator;
        }
    }
1359454
public static <T extends List<? extends U>, U> Comparator<T> canonicalComparator(Comparator<? super U> elemComp) {
        return new CanonicalComparator<>(elemComp);
    }
820589
public DependentKeyIndex createDependentKeyIndex(CacheLoaderEngine cacheLoaderEngine, Extractor[] keyExtractors, Operation ownerObjectFilter)
    {
        DependentKeyIndex dependentKeyIndex = null;

        for (DependentKeyIndex each : this.dependentKeyIndexes)
        {
            if (Arrays.equals(each.getKeyExtractors(), keyExtractors))
            {
                dependentKeyIndex = each;
                break;
            }
        }

        if (dependentKeyIndex == null)
        {
            dependentKeyIndex = (keyExtractors.length > 1)
                    ? new DependentTupleKeyIndex(cacheLoaderEngine, this, keyExtractors)
                    : new DependentSingleKeyIndex(cacheLoaderEngine, this, keyExtractors);

            dependentKeyIndex.setOwnerObjectFilter(ownerObjectFilter);

            final LoadingTaskThreadPoolHolder threadPoolHolder = cacheLoaderEngine.getOrCreateThreadPool(this.getThreadPoolName());
            dependentKeyIndex.setLoadingTaskThreadPoolHolder(threadPoolHolder);
            threadPoolHolder.addDependentKeyIndex(dependentKeyIndex);
            this.dependentKeyIndexes.add(dependentKeyIndex);
        }
        else
        {
            dependentKeyIndex.orOwnerObjectFilter(ownerObjectFilter);
        }
        return dependentKeyIndex;
    }
149547
public static ColumnValueSelector<ExprEval> makeExprEvalSelector(
      ColumnSelectorFactory columnSelectorFactory,
      Expr expression
  )
  {
    final List<String> columns = Parser.findRequiredBindings(expression);

    if (columns.size() == 1) {
      final String column = Iterables.getOnlyElement(columns);
      final ColumnCapabilities capabilities = columnSelectorFactory.getColumnCapabilities(column);

      if (capabilities != null && capabilities.getType() == ValueType.LONG) {
        // Optimization for expressions that hit one long column and nothing else.
        return new SingleLongInputCachingExpressionColumnValueSelector(
            columnSelectorFactory.makeColumnValueSelector(column),
            expression,
            !ColumnHolder.TIME_COLUMN_NAME.equals(column) // __time doesn't need an LRU cache since it is sorted.
        );
      } else if (capabilities != null
                 && capabilities.getType() == ValueType.STRING
                 && capabilities.isDictionaryEncoded()) {
        // Optimization for expressions that hit one string column and nothing else.
        return new SingleStringInputCachingExpressionColumnValueSelector(
            columnSelectorFactory.makeDimensionSelector(new DefaultDimensionSpec(column, column, ValueType.STRING)),
            expression
        );
      }
    }

    final Expr.ObjectBinding bindings = createBindings(expression, columnSelectorFactory);

    if (bindings.equals(ExprUtils.nilBindings())) {
      // Optimization for constant expressions.
      return new ConstantExprEvalSelector(expression.eval(bindings));
    }

    // No special optimization.
    return new ExpressionColumnValueSelector(expression, bindings);
  }
1206374
@NotNull
    public ComparatorCompat<T> thenComparingInt(@NotNull ToIntFunction<? super T> keyExtractor) {
        return thenComparing(comparingInt(keyExtractor));
    }
728925
public static <K extends Comparable<K>, V> Ordering<Entry<K, V>> byKeyDescendingOrdering() {
    return Ordering.<K>natural().onResultOf(MapUtils.<K, V>entryKeyFunction());
  }
155005
private void addConstructorByKey() {
    context.constructorByKey = MethodSpec.constructorBuilder().addParameter(keySpec);
    context.constructorByKey.addParameter(keyRefQueueSpec);
    addCommonParameters(context.constructorByKey);
    if (isBaseClass()) {
      callSiblingConstructor();
    } else {
      callParentByKey();
    }
  }
213496
public JRecordExtractor<T, SparseLabeledPoint>
  extractWithSubsetSettingsSparseLabeledPoint(String settings) {
    return new JRecordExtractor<>(JavaOps.extractWithSubsetSettingsSparseLabeledPoint(self, settings));
  }
1230672
public static <MESSAGE, KEY> FunctionKeyReader<MESSAGE, KEY> create(
            final Class<MESSAGE> messageClazz,
            final KeyExtractFunction<MESSAGE, KEY> readFunction) {
        return new FunctionKeyReader<>(messageClazz, ExtractFunctionReader.encapsulate(readFunction));
    }
218436
@Override
  public Extractor<S, D> getExtractor(WorkUnitState state) throws IOException {
    Preconditions.checkNotNull(state, "WorkUnitState should not be null");
    LOG.info("WorkUnitState from getExtractor: " + state);

    try {
      //GoogleDriveExtractor needs GoogleDriveFsHelper
      initFileSystemHelper(state);
    } catch (FileBasedHelperException e) {
      throw new IOException(e);
    }

    Preconditions.checkNotNull(fsHelper, "File system helper should not be null");
    return new GoogleDriveExtractor<>(state, fsHelper);
  }
671191
@NotNull
    public ComparatorCompat<T> thenComparing(@NotNull final Comparator<? super T> other) {
        return new ComparatorCompat<T>(thenComparing(comparator, other));
    }
814812
public <KEY> Where<KEY> where(KeySelector<T1, KEY> keySelector)  {
		Preconditions.checkNotNull(keySelector);
		final TypeInformation<KEY> keyType = TypeExtractor.getKeySelectorTypes(keySelector, input1.getType());
		return where(keySelector, keyType);
	}
714532
public static <T extends Case2<A, B>, A, B> Case2Extractor<T, A, B> create(Class<T> caseClazz) {
    return new Case2Extractor<>(caseClazz);
  }