本文整理汇总了Java中org.pentaho.di.trans.steps.sort.SortRowsMeta类的典型用法代码示例。如果您正苦于以下问题:Java SortRowsMeta类的具体用法?Java SortRowsMeta怎么用?Java SortRowsMeta使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SortRowsMeta类属于org.pentaho.di.trans.steps.sort包,在下文中一共展示了SortRowsMeta类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createSortRowsStep
import org.pentaho.di.trans.steps.sort.SortRowsMeta; //导入依赖的package包/类
/**
* Create and return a SortRows step.
*
* @param name
* @param sortFields[] Fields to sort by
* @param ascending[] Boolean indicating whether the corresponding field is to be sorted in ascending or descending order.
* @param caseSensitive[] Boolean indicating whether the corresponding field is to have case as a factor in the sort.
* @param directory The directory in the file system where the sort is to take place if it can't fit into memory?
* @param sortSize ???
* @param pluginRegistry The environment's Kettle plugin registry.
* @return
*/
public static synchronized StepMeta createSortRowsStep(String name,
String[] sortFields,
boolean[] ascending,
boolean[] caseSensitive,
String directory,
int sortSize,
PluginRegistry pluginRegistry) {
SortRowsMeta sortRowsMeta = new SortRowsMeta();
sortRowsMeta.setSortSize(Integer.toString(sortSize/10));
sortRowsMeta.setFieldName(sortFields);
sortRowsMeta.setAscending(ascending);
sortRowsMeta.setCaseSensitive(caseSensitive);
sortRowsMeta.setDirectory(directory);
String sortRowsStepPid = pluginRegistry.getPluginId(StepPluginType.class, sortRowsMeta);
StepMeta sortRowsStep = new StepMeta(sortRowsStepPid, name, (StepMetaInterface)sortRowsMeta);
return sortRowsStep;
}
示例2: createSortRowsStep
import org.pentaho.di.trans.steps.sort.SortRowsMeta; //导入依赖的package包/类
/**
* Create and return a SortRows step.
*
* @param name
* @param sortFields [] Fields to sort by
* @param ascending [] Boolean indicating whether the corresponding field is to be sorted in ascending or
* descending order.
* @param caseSensitive [] Boolean indicating whether the corresponding field is to have case as a factor in the
* sort.
* @param directory The directory in the file system where the sort is to take place if it can't fit into
* memory?
* @param sortSize ???
* @param pluginRegistry The environment's Kettle plugin registry.
* @return
*/
public static synchronized StepMeta createSortRowsStep( String name, String[] sortFields, boolean[] ascending,
boolean[] caseSensitive, String directory, int sortSize,
PluginRegistry pluginRegistry ) {
SortRowsMeta sortRowsMeta = new SortRowsMeta();
sortRowsMeta.setSortSize( Integer.toString( sortSize / 10 ) );
sortRowsMeta.setFieldName( sortFields );
sortRowsMeta.setAscending( ascending );
sortRowsMeta.setCaseSensitive( caseSensitive );
sortRowsMeta.setDirectory( directory );
String sortRowsStepPid = pluginRegistry.getPluginId( StepPluginType.class, sortRowsMeta );
StepMeta sortRowsStep = new StepMeta( sortRowsStepPid, name, sortRowsMeta );
return sortRowsStep;
}
示例3: generateSortStep
import org.pentaho.di.trans.steps.sort.SortRowsMeta; //导入依赖的package包/类
private StepMeta generateSortStep(RowMetaInterface rowMeta) throws KettleException {
List<SQLField> fields = sql.getOrderFields().getFields();
List<SQLField> selectFields = sql.getSelectFields().getFields();
SortRowsMeta meta = new SortRowsMeta();
meta.allocate(fields.size());
for (int i=0;i<fields.size();i++) {
SQLField sqlField = fields.get(i);
ValueMetaInterface valueMeta = rowMeta.searchValueMeta(sqlField.getField());
if (valueMeta==null) {
// This could be an alias used in an order by clause.
// In that case, we need to find the correct original name in the selectFields...
//
SQLField selectField = SQLField.searchSQLFieldByFieldOrAlias(selectFields, sqlField.getField());
if (selectField!=null) {
// Yep, verify this original name...
//
valueMeta = rowMeta.searchValueMeta(selectField.getField());
} else {
valueMeta = rowMeta.searchValueMeta(sqlField.getAlias());
}
}
if (valueMeta==null) {
throw new KettleException("Unable to find field to sort on: "+sqlField.getField()+" nor the alias: "+sqlField.getAlias());
}
meta.getFieldName()[i] = valueMeta.getName();
meta.getAscending()[i] = sqlField.isAscending();
meta.getCaseSensitive()[i] = true;
}
meta.setSortSize("1000000");
StepMeta stepMeta = new StepMeta("Sort rows", meta);
stepMeta.setLocation(xLocation, 50);
xLocation+=100;
stepMeta.setDraw(true);
return stepMeta;
}
示例4: SortRowsDialog
import org.pentaho.di.trans.steps.sort.SortRowsMeta; //导入依赖的package包/类
public SortRowsDialog(Shell parent, Object in, TransMeta transMeta, String sname)
{
super(parent, (BaseStepMeta)in, transMeta, sname);
input=(SortRowsMeta)in;
inputFields =new HashMap<String, Integer>();
}
示例5: SortRowsDialog
import org.pentaho.di.trans.steps.sort.SortRowsMeta; //导入依赖的package包/类
public SortRowsDialog( Shell parent, Object in, TransMeta transMeta, String sname ) {
super( parent, (BaseStepMeta) in, transMeta, sname );
input = (SortRowsMeta) in;
inputFields = new HashMap<String, Integer>();
}
示例6: createSortRowsStep
import org.pentaho.di.trans.steps.sort.SortRowsMeta; //导入依赖的package包/类
/**
* Create and return a SortRows step.
*
* @param name
* @param sortFields
* [] Fields to sort by
* @param ascending
* [] Boolean indicating whether the corresponding field is to be sorted in ascending or descending order.
* @param caseSensitive
* [] Boolean indicating whether the corresponding field is to have case as a factor in the sort.
* @param directory
* The directory in the file system where the sort is to take place if it can't fit into memory?
* @param sortSize
* ???
* @param pluginRegistry
* The environment's Kettle plugin registry.
* @return
*/
public static synchronized StepMeta createSortRowsStep( String name, String[] sortFields, boolean[] ascending,
boolean[] caseSensitive, String directory, int sortSize, PluginRegistry pluginRegistry ) {
SortRowsMeta sortRowsMeta = new SortRowsMeta();
sortRowsMeta.setSortSize( Integer.toString( sortSize / 10 ) );
sortRowsMeta.setFieldName( sortFields );
sortRowsMeta.setAscending( ascending );
sortRowsMeta.setCaseSensitive( caseSensitive );
sortRowsMeta.setDirectory( directory );
String sortRowsStepPid = pluginRegistry.getPluginId( StepPluginType.class, sortRowsMeta );
StepMeta sortRowsStep = new StepMeta( sortRowsStepPid, name, sortRowsMeta );
return sortRowsStep;
}