本文整理汇总了Java中org.pentaho.di.job.JobExecutionConfiguration.setLogLevel方法的典型用法代码示例。如果您正苦于以下问题:Java JobExecutionConfiguration.setLogLevel方法的具体用法?Java JobExecutionConfiguration.setLogLevel怎么用?Java JobExecutionConfiguration.setLogLevel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.pentaho.di.job.JobExecutionConfiguration
的用法示例。
在下文中一共展示了JobExecutionConfiguration.setLogLevel方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: executeJob
import org.pentaho.di.job.JobExecutionConfiguration; //导入方法依赖的package包/类
public void executeJob(JobMeta jobMeta, boolean local, boolean remote, Date replayDate, boolean safe) throws KettleException {
if (jobMeta == null) {
return;
}
JobExecutionConfiguration executionConfiguration = spoon.getJobExecutionConfiguration();
// Remember the variables set previously
//
Object data[] = spoon.variables.getData();
String fields[] = spoon.variables.getRowMeta().getFieldNames();
Map<String, String> variableMap = new HashMap<String, String>();
for (int idx = 0; idx < fields.length; idx++) {
variableMap.put(fields[idx], data[idx].toString());
}
executionConfiguration.setVariables(variableMap);
executionConfiguration.getUsedVariables(jobMeta);
executionConfiguration.setReplayDate(replayDate);
executionConfiguration.setRepository(spoon.rep);
executionConfiguration.setSafeModeEnabled(safe);
executionConfiguration.setLogLevel(spoon.getLog().getLogLevel());
JobExecutionConfigurationDialog dialog = new JobExecutionConfigurationDialog(spoon.getShell(), executionConfiguration, jobMeta);
if (dialog.open()) {
// addJobLog(jobMeta);
JobGraph jobGraph = spoon.getActiveJobGraph();
LogWriter.getInstance().setLogLevel(executionConfiguration.getLogLevel());
// Set the variables that where specified...
//
for (String varName : executionConfiguration.getVariables().keySet())
{
String varValue = executionConfiguration.getVariables().get(varName);
jobMeta.setVariable(varName, varValue);
}
// Set and activate the parameters...
//
for (String paramName : executionConfiguration.getParams().keySet())
{
String paramValue = executionConfiguration.getParams().get(paramName);
jobMeta.setParameterValue(paramName, paramValue);
}
// Set the arguments too...
//
jobMeta.setArguments(executionConfiguration.getArgumentStrings());
// Is this a local execution?
//
if (executionConfiguration.isExecutingLocally()) {
jobGraph.startJob(executionConfiguration);
}
// Are we executing remotely?
//
else if (executionConfiguration.isExecutingRemotely()) {
// Activate the parameters, turn them into variables...
//
jobMeta.activateParameters();
if (executionConfiguration.getRemoteServer() != null) {
Job.sendToSlaveServer(jobMeta, executionConfiguration, spoon.rep);
spoon.delegates.slaves.addSpoonSlave(executionConfiguration.getRemoteServer());
} else {
MessageBox mb = new MessageBox(spoon.getShell(), SWT.OK | SWT.ICON_ERROR);
mb.setMessage(Messages.getString("Spoon.Dialog.NoRemoteServerSpecified.Message"));
mb.setText(Messages.getString("Spoon.Dialog.NoRemoteServerSpecified.Title"));
mb.open();
}
}
}
}
示例2: executeJob
import org.pentaho.di.job.JobExecutionConfiguration; //导入方法依赖的package包/类
public void executeJob(JobMeta jobMeta, boolean local, boolean remote, Date replayDate, boolean safe, String startCopyName, int startCopyNr) throws KettleException {
if (jobMeta == null) {
return;
}
JobExecutionConfiguration executionConfiguration = spoon.getJobExecutionConfiguration();
// Remember the variables set previously
//
Object data[] = spoon.variables.getData();
String fields[] = spoon.variables.getRowMeta().getFieldNames();
Map<String, String> variableMap = new HashMap<String, String>();
for (int idx = 0; idx < fields.length; idx++) {
variableMap.put(fields[idx], data[idx].toString());
}
executionConfiguration.setVariables(variableMap);
executionConfiguration.getUsedVariables(jobMeta);
executionConfiguration.setReplayDate(replayDate);
executionConfiguration.setRepository(spoon.rep);
executionConfiguration.setSafeModeEnabled(safe);
executionConfiguration.setStartCopyName(startCopyName);
executionConfiguration.setStartCopyNr(startCopyNr);
executionConfiguration.setLogLevel(DefaultLogLevel.getLogLevel());
JobExecutionConfigurationDialog dialog = new JobExecutionConfigurationDialog(spoon.getShell(), executionConfiguration, jobMeta);
if (dialog.open()) {
// addJobLog(jobMeta);
JobGraph jobGraph = spoon.getActiveJobGraph();
// Set the variables that where specified...
//
for (String varName : executionConfiguration.getVariables().keySet())
{
String varValue = executionConfiguration.getVariables().get(varName);
jobMeta.setVariable(varName, varValue);
}
// Set and activate the parameters...
//
for (String paramName : executionConfiguration.getParams().keySet())
{
String paramValue = executionConfiguration.getParams().get(paramName);
jobMeta.setParameterValue(paramName, paramValue);
}
// Set the arguments too...
//
jobMeta.setArguments(executionConfiguration.getArgumentStrings());
// Is this a local execution?
//
if (executionConfiguration.isExecutingLocally()) {
jobGraph.startJob(executionConfiguration);
}
// Are we executing remotely?
//
else if (executionConfiguration.isExecutingRemotely()) {
// Activate the parameters, turn them into variables...
//
jobMeta.activateParameters();
if (executionConfiguration.getRemoteServer() != null) {
Job.sendToSlaveServer(jobMeta, executionConfiguration, spoon.rep);
spoon.delegates.slaves.addSpoonSlave(executionConfiguration.getRemoteServer());
} else {
MessageBox mb = new MessageBox(spoon.getShell(), SWT.OK | SWT.ICON_ERROR);
mb.setMessage(BaseMessages.getString(PKG, "Spoon.Dialog.NoRemoteServerSpecified.Message")); //$NON-NLS-1$
mb.setText(BaseMessages.getString(PKG, "Spoon.Dialog.NoRemoteServerSpecified.Title")); //$NON-NLS-1$
mb.open();
}
}
}
}