Package com.ebay.erl.mobius.core.sort

Examples of com.ebay.erl.mobius.core.sort.Sorter


      // there is no sorter, should be reducer/join job
      Column[] keys = (Column[])SerializableUtil.deserializeFromBase64(job.get(ConfigureConstants.ALL_GROUP_KEY_COLUMNS), job);
      sorters = new Sorter[keys.length];
      for( int i=0;i<keys.length;i++ )
      {
        sorters[i] = new Sorter(keys[i].getInputColumnName(), Ordering.ASC);
      }
    }
   
    long proportion = 10L;
    while( (int)(this.freq*proportion)==0 ){
View Full Code Here


     
      // the sorting priority is the same as the sorters
      // array
      for( int i=0;i<sorters.length;i++ )
      {
        Sorter aSorter       = sorters[i];       
       
        String columnName    = aSorter.getColumn();
        boolean forceNumeric   = aSorter.forceSortNumerically();
       
        //////////////////////////////
        // get value from k1, k2
        //////////////////////////////
        Object v1 = this.getValue(k1, columnName, forceNumeric, sorters);       
        Object v2 = this.getValue(k2, columnName, forceNumeric, sorters);
       
        //////////////////////
        // start to compare
        //////////////////////       
        int result;
        try
        {
          this.setType(Tuple.getType(v1), Tuple.getType(v2));
          result = this.compare(v1, v2, conf);       
          if( result!=0 )
          {
            // ordering is decided, return the result
            Ordering ordering   = aSorter.getOrdering();
            switch(ordering)
            {
              case ASC:
                // remain the save
                return result;
View Full Code Here

    final int topK = 5;
   
    Top topFunction = new Top(
        dummy,
        new String[]{"COUNTS", "ID"},
        new Sorter[]{new Sorter("COUNTS", Ordering.ASC, true)},
        topK
    );
   
    topFunction.reset();
   
View Full Code Here

    .build();
   
    this.sort(items)
      .select("ITEM_ID", "ITEM_PRICE", "SELLER_ID", "BUYER_ID")
      .orderBy(
          new Sorter("ITEM_PRICE", Ordering.DESC, true),
          new Sorter("SELLER_ID", Ordering.ASC)
      ).save(this, new Path(args[1]));
   
    return 0;
  }
View Full Code Here

TOP

Related Classes of com.ebay.erl.mobius.core.sort.Sorter

Copyright © 2018 www.massapicom. 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.