Skip to content

Commit

Permalink
[BACKLOG-15313] - making SortRowsMeta serializable, extracting method…
Browse files Browse the repository at this point in the history
… for convenience
  • Loading branch information
Kurtis Walker committed Mar 28, 2017
1 parent 3e76098 commit a33b122
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion engine/src/org/pentaho/di/trans/steps/sort/SortRowsMeta.java
Expand Up @@ -23,6 +23,7 @@
package org.pentaho.di.trans.steps.sort;

import java.io.File;
import java.io.Serializable;
import java.text.Collator;
import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -59,7 +60,8 @@
* Created on 02-jun-2003
*/
@InjectionSupported( localizationPrefix = "SortRows.Injection.", groups = { "FIELDS" } )
public class SortRowsMeta extends BaseStepMeta implements StepMetaInterface {
public class SortRowsMeta extends BaseStepMeta implements StepMetaInterface, Serializable {
private static final long serialVersionUID = -9075883720765645655L;
private static Class<?> PKG = SortRowsMeta.class; // for i18n purposes, needed by Translator2!!

/** order by which fields? */
Expand Down Expand Up @@ -380,6 +382,11 @@ public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transform
public void getFields( RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info, StepMeta nextStep,
VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException {
// Set the sorted properties: ascending/descending
assignSortingCriteria( inputRowMeta );
}

@SuppressWarnings( "WeakerAccess" )
public void assignSortingCriteria( RowMetaInterface inputRowMeta ) {
for ( int i = 0; i < fieldName.length; i++ ) {
int idx = inputRowMeta.indexOfValue( fieldName[i] );
if ( idx >= 0 ) {
Expand Down

0 comments on commit a33b122

Please sign in to comment.