Examples of sortComparatorClass()


Examples of org.apache.crunch.GroupingOptions.Builder.sortComparatorClass()

    PType<K> ptype = ptable.getKeyType();
    PTypeFamily tf = ptable.getTypeFamily();
    Builder builder = GroupingOptions.builder();
    if (order == Order.DESCENDING) {
      if (tf == WritableTypeFamily.getInstance()) {
        builder.sortComparatorClass(ReverseWritableComparator.class);
      } else if (tf == AvroTypeFamily.getInstance()) {
        AvroType<K> avroType = (AvroType<K>) ptype;
        Schema schema = avroType.getSchema();
        builder.conf("crunch.schema", schema.toString());
        builder.sortComparatorClass(ReverseAvroComparator.class);
View Full Code Here

Examples of org.apache.crunch.GroupingOptions.Builder.sortComparatorClass()

        builder.sortComparatorClass(ReverseWritableComparator.class);
      } else if (tf == AvroTypeFamily.getInstance()) {
        AvroType<K> avroType = (AvroType<K>) ptype;
        Schema schema = avroType.getSchema();
        builder.conf("crunch.schema", schema.toString());
        builder.sortComparatorClass(ReverseAvroComparator.class);
      } else {
        throw new RuntimeException("Unrecognized type family: " + tf);
      }
    } else if (tf == AvroTypeFamily.getInstance()) {
      builder.conf("crunch.schema", ((AvroType<K>) ptype).getSchema().toString());
View Full Code Here

Examples of org.apache.crunch.GroupingOptions.Builder.sortComparatorClass()

    PTypeFamily tf = ptable.getTypeFamily();
    PType<K> keyType = ptable.getKeyType();
    Builder builder = GroupingOptions.builder();
    if (tf == WritableTypeFamily.getInstance()) {
      if (columnOrders.length == 1 && columnOrders[0].order == Order.DESCENDING) {
        builder.sortComparatorClass(ReverseWritableComparator.class);
      } else {
        TupleWritableComparator.configureOrdering(conf, columnOrders);
        builder.sortComparatorClass(TupleWritableComparator.class);
      }
    } else if (tf == AvroTypeFamily.getInstance()) {
View Full Code Here

Examples of org.apache.crunch.GroupingOptions.Builder.sortComparatorClass()

    if (tf == WritableTypeFamily.getInstance()) {
      if (columnOrders.length == 1 && columnOrders[0].order == Order.DESCENDING) {
        builder.sortComparatorClass(ReverseWritableComparator.class);
      } else {
        TupleWritableComparator.configureOrdering(conf, columnOrders);
        builder.sortComparatorClass(TupleWritableComparator.class);
      }
    } else if (tf == AvroTypeFamily.getInstance()) {
      AvroType<K> avroType = (AvroType<K>) keyType;
      Schema schema = avroType.getSchema();
      builder.conf("crunch.schema", schema.toString());
View Full Code Here

Examples of org.apache.crunch.GroupingOptions.Builder.sortComparatorClass()

    } else if (tf == AvroTypeFamily.getInstance()) {
      AvroType<K> avroType = (AvroType<K>) keyType;
      Schema schema = avroType.getSchema();
      builder.conf("crunch.schema", schema.toString());
      if (columnOrders.length == 1 && columnOrders[0].order == Order.DESCENDING) {
        builder.sortComparatorClass(ReverseAvroComparator.class);
      }
    } else {
      throw new RuntimeException("Unrecognized type family: " + tf);
    }
    configureReducers(builder, ptable, conf, numReducers);
View Full Code Here

Examples of org.apache.crunch.GroupingOptions.Builder.sortComparatorClass()

  private static <T> GroupingOptions buildGroupingOptions(Configuration conf, PTypeFamily tf, PType<T> ptype,
      Order order) {
    Builder builder = GroupingOptions.builder();
    if (order == Order.DESCENDING) {
      if (tf == WritableTypeFamily.getInstance()) {
        builder.sortComparatorClass(ReverseWritableComparator.class);
      } else if (tf == AvroTypeFamily.getInstance()) {
        AvroType<T> avroType = (AvroType<T>) ptype;
        Schema schema = avroType.getSchema();
        conf.set("crunch.schema", schema.toString());
        builder.sortComparatorClass(ReverseAvroComparator.class);
View Full Code Here

Examples of org.apache.crunch.GroupingOptions.Builder.sortComparatorClass()

        builder.sortComparatorClass(ReverseWritableComparator.class);
      } else if (tf == AvroTypeFamily.getInstance()) {
        AvroType<T> avroType = (AvroType<T>) ptype;
        Schema schema = avroType.getSchema();
        conf.set("crunch.schema", schema.toString());
        builder.sortComparatorClass(ReverseAvroComparator.class);
      } else {
        throw new RuntimeException("Unrecognized type family: " + tf);
      }
    }
    // TODO:CRUNCH-23: Intermediate Fix for release 1. More elaborate fix is
View Full Code Here

Examples of org.apache.crunch.GroupingOptions.Builder.sortComparatorClass()

  private static <T> GroupingOptions buildGroupingOptions(Configuration conf, PTypeFamily tf, PType<T> ptype,
      ColumnOrder[] columnOrders) {
    Builder builder = GroupingOptions.builder();
    if (tf == WritableTypeFamily.getInstance()) {
      TupleWritableComparator.configureOrdering(conf, columnOrders);
      builder.sortComparatorClass(TupleWritableComparator.class);
    } else if (tf == AvroTypeFamily.getInstance()) {
      TupleAvroComparator.configureOrdering(conf, columnOrders, ptype);
      builder.sortComparatorClass(TupleAvroComparator.class);
    } else {
      throw new RuntimeException("Unrecognized type family: " + tf);
View Full Code Here

Examples of org.apache.crunch.GroupingOptions.Builder.sortComparatorClass()

    if (tf == WritableTypeFamily.getInstance()) {
      TupleWritableComparator.configureOrdering(conf, columnOrders);
      builder.sortComparatorClass(TupleWritableComparator.class);
    } else if (tf == AvroTypeFamily.getInstance()) {
      TupleAvroComparator.configureOrdering(conf, columnOrders, ptype);
      builder.sortComparatorClass(TupleAvroComparator.class);
    } else {
      throw new RuntimeException("Unrecognized type family: " + tf);
    }
    // TODO:CRUNCH-23: Intermediate Fix for release 1. More elaborate fix is
    // required check JIRA for details.
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.