本文整理汇总了Java中org.pentaho.di.trans.Trans.setLogLevel方法的典型用法代码示例。如果您正苦于以下问题:Java Trans.setLogLevel方法的具体用法?Java Trans.setLogLevel怎么用?Java Trans.setLogLevel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.pentaho.di.trans.Trans
的用法示例。
在下文中一共展示了Trans.setLogLevel方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: startTransformation
import org.pentaho.di.trans.Trans; //导入方法依赖的package包/类
protected void startTransformation( Repository repository, IMetaStore metaStore, final StreamingService service ) {
try {
TransMeta transMeta = StreamingConst.loadTransMeta( repository, metaStore, service );
Trans trans = new Trans( transMeta );
String carteObjectId = UUID.randomUUID().toString();
trans.setContainerObjectId( carteObjectId );
if (service.getLogLevel()!=null) {
trans.setLogLevel(service.getLogLevel());
}
TransExecutionConfiguration transExecutionConfiguration = new TransExecutionConfiguration();
TransConfiguration transConfiguration = new TransConfiguration( transMeta, transExecutionConfiguration );
transformationMap.addTransformation( transMeta.getName(), carteObjectId, trans, transConfiguration );
trans.prepareExecution( null );
// Start the transformation
trans.startThreads();
// This transformation routinely never ends so we won't wait for it...
} catch ( Exception e ) {
throw new RuntimeException( "Unable to start transformation for streaming service '" + service.getName() + "'", e );
}
}
示例2: runTransformationFromResource
import org.pentaho.di.trans.Trans; //导入方法依赖的package包/类
public Trans runTransformationFromResource(String resource, List<TransVariable> listVaribale) {
try {
// load latest revision of the transformation
// The TransMeta object is the programmatic representation of a transformation definition.
TransMeta transMeta = new TransMeta(getClass().getResourceAsStream(resource), null, false, null, null);
// Creating a transformation object which is the programmatic representation of a transformation
// A transformation object can be executed, report success, etc.
Trans transformation = new Trans(transMeta);
if (listVaribale != null) {
for (TransVariable variable : listVaribale) {
transformation.setVariable(variable.getName(), variable.getValue());
}
}
// adjust the log level
transformation.setLogLevel(LogLevel.BASIC);
// starting the transformation, which will execute asynchronously
transformation.execute(null);
// waiting for the transformation to finish
transformation.waitUntilFinished();
return transformation;
} catch (KettleException ex) {
MessageInf msg = new MessageInf(MessageInf.SGN_WARNING, AppLocal.getIntString("message.syncerror"), ex);
msg.show(this);
return null;
}
}