• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java LogTableInterface类的典型用法和代码示例

java 1次浏览

本文整理汇总了Java中org.pentaho.di.core.logging.LogTableInterface的典型用法代码示例。如果您正苦于以下问题:Java LogTableInterface类的具体用法?Java LogTableInterface怎么用?Java LogTableInterface使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

LogTableInterface类属于org.pentaho.di.core.logging包,在下文中一共展示了LogTableInterface类的33个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getLogging

点赞 3

import org.pentaho.di.core.logging.LogTableInterface; //导入依赖的package包/类
public static String getLogging(ReportSubjectLocation filename) throws KettleException {
	List<LogTableInterface> logTables;
	if (filename.isTransformation()) {
		TransMeta transMeta = TransformationInformation.getInstance().getTransMeta(filename);
		logTables = transMeta.getLogTables();
	} else {
		JobMeta jobMeta  = JobInformation.getInstance().getJobMeta(filename);
		logTables = jobMeta.getLogTables();
	}
	String logging="";
	for (Iterator<LogTableInterface> iterator = logTables.iterator(); iterator.hasNext();) {
		LogTableInterface logTableInterface = (LogTableInterface) iterator.next();
		if (logTableInterface.getDatabaseMeta()!=null && !Const.isEmpty(logTableInterface.getTableName())) {
			if (logging.length()>0) logging+=", ";
			logging+=logTableInterface.getTableName()+"@"+logTableInterface.getDatabaseMeta().getName();
		}
	}
	return logging;
}
 

开发者ID:yintaoxue,
项目名称:read-open-source-code,
代码行数:20,
代码来源:KettleFileTableModel.java

示例2: getUsedDatabaseMetas

点赞 3

import org.pentaho.di.core.logging.LogTableInterface; //导入依赖的package包/类
private Set<DatabaseMeta> getUsedDatabaseMetas() {
  Set<DatabaseMeta> databaseMetas = new HashSet<DatabaseMeta>();
  for ( JobEntryCopy jobEntryCopy : getJobCopies() ) {
    DatabaseMeta[] dbs = jobEntryCopy.getEntry().getUsedDatabaseConnections();
    if ( dbs != null ) {
      for ( DatabaseMeta db : dbs ) {
        databaseMetas.add( db );
      }
    }
  }

  databaseMetas.add( jobLogTable.getDatabaseMeta() );

  for ( LogTableInterface logTable : getExtraLogTables() ) {
    databaseMetas.add( logTable.getDatabaseMeta() );
  }
  return databaseMetas;
}
 

开发者ID:pentaho,
项目名称:pentaho-kettle,
代码行数:19,
代码来源:JobMeta.java

示例3: JobDialog

点赞 3

import org.pentaho.di.core.logging.LogTableInterface; //导入依赖的package包/类
public JobDialog( Shell parent, int style, JobMeta jobMeta, Repository rep ) {
  super( parent, style );
  this.jobMeta = jobMeta;
  this.props = PropsUI.getInstance();
  this.rep = rep;

  this.newDirectory = null;

  directoryChangeAllowed = true;

  logTables = new ArrayList<LogTableInterface>();
  logTableUserInterfaces = new ArrayList<LogTableUserInterface>();
  for ( LogTableInterface logTable : jobMeta.getLogTables() ) {
    logTables.add( (LogTableInterface) logTable.clone() );
  }
}
 

开发者ID:pentaho,
项目名称:pentaho-kettle,
代码行数:17,
代码来源:JobDialog.java

示例4: getLogInfo

点赞 3

import org.pentaho.di.core.logging.LogTableInterface; //导入依赖的package包/类
private void getLogInfo( int previousLogTableIndex ) {

    if ( previousLogTableIndex < 0 ) {
      return;
    }
    // Remember the that was entered data...
    //
    LogTableInterface modifiedLogTable = logTables.get( previousLogTableIndex );
    LogTableUserInterface logTableUserInterface = logTableUserInterfaces.get( previousLogTableIndex );

    if ( logTableUserInterface != null ) {
      logTableUserInterface.retrieveLogTableOptions( modifiedLogTable );
    } else {
      if ( modifiedLogTable instanceof JobLogTable ) {
        getJobLogTableOptions( (JobLogTable) modifiedLogTable );
      } else if ( modifiedLogTable instanceof ChannelLogTable ) {
        getChannelLogTableOptions( (ChannelLogTable) modifiedLogTable );
      } else if ( modifiedLogTable instanceof JobEntryLogTable ) {
        getJobEntryLogTableOptions( (JobEntryLogTable) modifiedLogTable );
      }
    }

  }
 

开发者ID:pentaho,
项目名称:pentaho-kettle,
代码行数:24,
代码来源:JobDialog.java

示例5: getLogTableUserInterface

点赞 3

import org.pentaho.di.core.logging.LogTableInterface; //导入依赖的package包/类
private LogTableUserInterface getLogTableUserInterface( LogTableInterface logTable, JobMeta jobMeta,
  ModifyListener lsMod ) {

  if ( !( logTable instanceof LogTablePluginInterface ) ) {
    return null;
  }
  LogTablePluginInterface pluginInterface = (LogTablePluginInterface) logTable;

  String uiClassName = pluginInterface.getLogTablePluginUIClassname();

  Class<?> uiClass;
  Class<?>[] paramClasses = new Class<?>[] { JobMeta.class, ModifyListener.class, JobDialog.class, };
  Object[] paramArgs = new Object[] { jobMeta, lsMod, this, };
  Constructor<?> uiConstructor;
  try {
    uiClass = pluginInterface.getClass().getClassLoader().loadClass( uiClassName );
    uiConstructor = uiClass.getConstructor( paramClasses );
    return (LogTableUserInterface) uiConstructor.newInstance( paramArgs );
  } catch ( Exception e ) {
    new ErrorDialog( shell, "Error", "Unable to load UI interface class: " + uiClassName, e );
    return null;
  }

}
 

开发者ID:pentaho,
项目名称:pentaho-kettle,
代码行数:25,
代码来源:JobDialog.java

示例6: setLogTable

点赞 3

import org.pentaho.di.core.logging.LogTableInterface; //导入依赖的package包/类
public void setLogTable( LogTableInterface logTable ) {
  this.logTable = logTable;
  logTableFields.clear();
  for ( LogTableField field : logTable.getFields() ) {
    if ( field.isEnabled() && field.isVisible() ) {
      logTableFields.add( field );
    }
  }

  // Recreate table view as log table has changed
  if ( logDisplayTableView != null ) {
    Composite tableParent = logDisplayTableView.getParent();
    TableView newTable = createJobLogTableView( tableParent );
    newTable.moveAbove( logDisplayTableView );
    logDisplayTableView.dispose();
    tableParent.layout( false );
    logDisplayTableView = newTable;
  }
}
 

开发者ID:pentaho,
项目名称:pentaho-kettle,
代码行数:20,
代码来源:JobHistoryDelegate.java

示例7: saveJobAsXmlFile

点赞 3

import org.pentaho.di.core.logging.LogTableInterface; //导入依赖的package包/类
private boolean saveJobAsXmlFile( JobMeta jobMeta, boolean export ) {
  JobLogTable origJobLogTable = jobMeta.getJobLogTable();
  JobEntryLogTable originEntryLogTable = jobMeta.getJobEntryLogTable();
  ChannelLogTable originChannelLogTable = jobMeta.getChannelLogTable();
  List<LogTableInterface> originExtraLogTables = jobMeta.getExtraLogTables();

  try {
    XmlExportHelper.swapTables( jobMeta );
    return saveXMLFile( jobMeta, export );
  } finally {
    jobMeta.setJobLogTable( origJobLogTable );
    jobMeta.setJobEntryLogTable( originEntryLogTable );
    jobMeta.setChannelLogTable( originChannelLogTable );
    jobMeta.setExtraLogTables( originExtraLogTables );
  }
}
 

开发者ID:pentaho,
项目名称:pentaho-kettle,
代码行数:17,
代码来源:Spoon.java

示例8: setLogTable

点赞 3

import org.pentaho.di.core.logging.LogTableInterface; //导入依赖的package包/类
public void setLogTable( LogTableInterface logTable ) {
  this.logTable = logTable;
  logTableFields.clear();
  for ( LogTableField field : logTable.getFields() ) {
    if ( field.isEnabled() && field.isVisible() ) {
      logTableFields.add( field );
    }
  }

  // Recreate table view as log table has changed
  if ( logDisplayTableView != null ) {
    Composite tableParent = logDisplayTableView.getParent();
    TableView newTable = createTransLogTableView( tableParent );
    newTable.moveAbove( logDisplayTableView );
    logDisplayTableView.dispose();
    tableParent.layout( false );
    logDisplayTableView = newTable;
  }
}
 

开发者ID:pentaho,
项目名称:pentaho-kettle,
代码行数:20,
代码来源:TransHistoryDelegate.java

示例9: getLogging

点赞 3

import org.pentaho.di.core.logging.LogTableInterface; //导入依赖的package包/类
public static String getLogging( ReportSubjectLocation filename ) throws KettleException {
  List<LogTableInterface> logTables;
  if ( filename.isTransformation() ) {
    TransMeta transMeta = TransformationInformation.getInstance().getTransMeta( filename );
    logTables = transMeta.getLogTables();
  } else {
    JobMeta jobMeta = JobInformation.getInstance().getJobMeta( filename );
    logTables = jobMeta.getLogTables();
  }
  String logging = "";
  for ( Iterator<LogTableInterface> iterator = logTables.iterator(); iterator.hasNext(); ) {
    LogTableInterface logTableInterface = iterator.next();
    if ( logTableInterface.getDatabaseMeta() != null && !Utils.isEmpty( logTableInterface.getTableName() ) ) {
      if ( logging.length() > 0 ) {
        logging += ", ";
      }
      logging += logTableInterface.getTableName() + "@" + logTableInterface.getDatabaseMeta().getName();
    }
  }
  return logging;
}
 

开发者ID:pentaho,
项目名称:pentaho-kettle,
代码行数:22,
代码来源:KettleFileTableModel.java

示例10: getLogTables

点赞 2

import org.pentaho.di.core.logging.LogTableInterface; //导入依赖的package包/类
public List<LogTableInterface> getLogTables() {
	List<LogTableInterface> logTables = new ArrayList<LogTableInterface>();
	logTables.add(jobLogTable);
	logTables.add(jobEntryLogTable);
	logTables.add(channelLogTable);
	return logTables;
}
 

开发者ID:yintaoxue,
项目名称:read-open-source-code,
代码行数:8,
代码来源:JobMeta.java

示例11: getLogTables

点赞 2

import org.pentaho.di.core.logging.LogTableInterface; //导入依赖的package包/类
public List<LogTableInterface> getLogTables() {
	List<LogTableInterface> logTables = new ArrayList<LogTableInterface>();
	logTables.add(transLogTable);
	logTables.add(stepLogTable);
	logTables.add(performanceLogTable);
	logTables.add(channelLogTable);
	return logTables;
}
 

开发者ID:yintaoxue,
项目名称:read-open-source-code,
代码行数:9,
代码来源:TransMeta.java

示例12: clearLogTable

点赞 2

import org.pentaho.di.core.logging.LogTableInterface; //导入依赖的package包/类
/**
 * User requested to clear the log table.<br>
 * Better ask confirmation
 */
private void clearLogTable(int index) {

  LogTableInterface logTable = models[index].logTable;

  if (logTable.isDefined()) {
    String schemaTable = logTable.getQuotedSchemaTableCombination();
    DatabaseMeta databaseMeta = logTable.getDatabaseMeta();

    MessageBox mb = new MessageBox(jobGraph.getShell(), SWT.YES | SWT.NO | SWT.ICON_QUESTION);
    mb.setMessage(BaseMessages.getString(PKG, "JobGraph.Dialog.AreYouSureYouWantToRemoveAllLogEntries.Message", schemaTable)); // Nothing found that matches your criteria //$NON-NLS-1$
    mb.setText(BaseMessages.getString(PKG, "JobGraph.Dialog.AreYouSureYouWantToRemoveAllLogEntries.Title")); // Sorry! //$NON-NLS-1$
    if (mb.open() == SWT.YES) {
      Database database = new Database(loggingObject, databaseMeta);
      try {
        database.connect();
        database.truncateTable(schemaTable);
      } catch (Exception e) {
        new ErrorDialog(jobGraph.getShell(), BaseMessages.getString(PKG, "JobGraph.Dialog.ErrorClearningLoggingTable.Title"), BaseMessages.getString(PKG, "JobGraph.Dialog.AreYouSureYouWantToRemoveAllLogEntries.Message"), e); //$NON-NLS-1$//$NON-NLS-2$
      } finally {
        if (database != null) {
          database.disconnect();
        }

        refreshHistory();
        if (wText.get(index) != null) {
          wText.get(index).setText(""); //$NON-NLS-1$
        }
      }
    }
  }
}
 

开发者ID:yintaoxue,
项目名称:read-open-source-code,
代码行数:36,
代码来源:JobHistoryDelegate.java

示例13: clearLogTable

点赞 2

import org.pentaho.di.core.logging.LogTableInterface; //导入依赖的package包/类
/**
 * User requested to clear the log table.<br>
 * Better ask confirmation
 */
private void clearLogTable(int index) {

  LogTableInterface logTable = models[index].logTable;

  if (logTable.isDefined()) {
    String schemaTable = logTable.getQuotedSchemaTableCombination();
    DatabaseMeta databaseMeta = logTable.getDatabaseMeta();

    MessageBox mb = new MessageBox(transGraph.getShell(), SWT.YES | SWT.NO | SWT.ICON_QUESTION);
    mb.setMessage(BaseMessages.getString(PKG, "TransGraph.Dialog.AreYouSureYouWantToRemoveAllLogEntries.Message", schemaTable)); // Nothing found that matches your criteria //$NON-NLS-1$
    mb.setText(BaseMessages.getString(PKG, "TransGraph.Dialog.AreYouSureYouWantToRemoveAllLogEntries.Title")); // Sorry! //$NON-NLS-1$
    if (mb.open() == SWT.YES) {
      Database database = new Database(loggingObject, databaseMeta);
      try {
        database.connect();
        database.truncateTable(schemaTable);
      } catch (Exception e) {
        new ErrorDialog(transGraph.getShell(), BaseMessages.getString(PKG, "TransGraph.Dialog.ErrorClearningLoggingTable.Title"), //$NON-NLS-1$
            BaseMessages.getString(PKG, "TransGraph.Dialog.ErrorClearningLoggingTable.Message"), e); //$NON-NLS-1$
      } finally {
        if (database != null) {
          database.disconnect();
        }

        refreshHistory();
        if (wText.get(index) != null) {
          wText.get(index).setText(""); //$NON-NLS-1$
        }
      }
    }
  }
}
 

开发者ID:yintaoxue,
项目名称:read-open-source-code,
代码行数:37,
代码来源:TransHistoryDelegate.java

示例14: cleanupLogRecords

点赞 2

import org.pentaho.di.core.logging.LogTableInterface; //导入依赖的package包/类
public void cleanupLogRecords(LogTableInterface logTable) throws KettleException {
	try {
		double timeout = Const.toDouble( Const.trim( environmentSubstitute( logTable.getTimeoutInDays())), 0.0 );
		if (timeout>0.000001) { 
			// The timeout has to be at least a few seconds, otherwise we don't bother
			//
			String schemaTable = databaseMeta.getQuotedSchemaTableCombination(
			    environmentSubstitute(logTable.getActualSchemaName()), 
			    environmentSubstitute(logTable.getActualTableName())
			    );
			
			// The log date field
			//
			LogTableField logField = logTable.getLogDateField();
			if (logField!=null) {
				String sql = "DELETE FROM "+schemaTable+" WHERE "+databaseMeta.quoteField(logField.getFieldName())+" < ?"; // $NON-NLS$1 
				
				// Now calculate the date...
				//
				long now = System.currentTimeMillis();
				long limit = now - Math.round(timeout*24*60*60*1000);
				RowMetaAndData row = new RowMetaAndData();
				row.addValue(logField.getFieldName(), ValueMetaInterface.TYPE_DATE, new Date(limit));
				
				execStatement(sql, row.getRowMeta(), row.getData());
				
			} else {
				throw new KettleException(BaseMessages.getString(PKG, "Database.Exception.LogTimeoutDefinedOnTableWithoutLogField", logTable.getActualTableName()));
			}
		}
	} catch(Exception e) {
		throw new KettleDatabaseException(BaseMessages.getString(PKG, "Database.Exception.UnableToCleanUpOlderRecordsFromLogTable", logTable.getActualTableName()), e);
	}
}
 

开发者ID:yintaoxue,
项目名称:read-open-source-code,
代码行数:35,
代码来源:Database.java

示例15: getLogTables

点赞 2

import org.pentaho.di.core.logging.LogTableInterface; //导入依赖的package包/类
/**
 * Gets the log tables.
 *
 * @return the log tables
 */
public List<LogTableInterface> getLogTables() {
	List<LogTableInterface> logTables = new ArrayList<LogTableInterface>();
	logTables.add(jobLogTable);
	logTables.add(jobEntryLogTable);
	logTables.add(channelLogTable);
	return logTables;
}
 

开发者ID:bsspirit,
项目名称:kettle-4.4.0-stable,
代码行数:13,
代码来源:JobMeta.java

示例16: getLogTables

点赞 2

import org.pentaho.di.core.logging.LogTableInterface; //导入依赖的package包/类
/**
 * Gets a list of the log tables (transformation, step, performance, channel) for the transformation.
 *
 * @return a list of LogTableInterfaces for the transformation 
 */
public List<LogTableInterface> getLogTables() {
	List<LogTableInterface> logTables = new ArrayList<LogTableInterface>();
	logTables.add(transLogTable);
	logTables.add(stepLogTable);
	logTables.add(performanceLogTable);
	logTables.add(channelLogTable);
	return logTables;
}
 

开发者ID:bsspirit,
项目名称:kettle-4.4.0-stable,
代码行数:14,
代码来源:TransMeta.java

示例17: getLogTables

点赞 2

import org.pentaho.di.core.logging.LogTableInterface; //导入依赖的package包/类
/**
 * Gets the log tables.
 *
 * @return the log tables
 */
public List<LogTableInterface> getLogTables() {
	List<LogTableInterface> logTables = new ArrayList<LogTableInterface>();
	logTables.add(jobLogTable);
	logTables.add(jobEntryLogTable);
	logTables.add(channelLogTable);
   logTables.add(checkpointLogTable);
	return logTables;
}
 

开发者ID:jjeb,
项目名称:kettle-trunk,
代码行数:14,
代码来源:JobMeta.java

示例18: getLogTables

点赞 2

import org.pentaho.di.core.logging.LogTableInterface; //导入依赖的package包/类
/**
 * Gets a list of the log tables (transformation, step, performance, channel) for the transformation.
 *
 * @return a list of LogTableInterfaces for the transformation 
 */
public List<LogTableInterface> getLogTables() {
	List<LogTableInterface> logTables = new ArrayList<LogTableInterface>();
	logTables.add(transLogTable);
	logTables.add(stepLogTable);
	logTables.add(performanceLogTable);
	logTables.add(channelLogTable);
   logTables.add(metricsLogTable);
	return logTables;
}
 

开发者ID:jjeb,
项目名称:kettle-trunk,
代码行数:15,
代码来源:TransMeta.java

示例19: cleanupLogRecords

点赞 2

import org.pentaho.di.core.logging.LogTableInterface; //导入依赖的package包/类
public void cleanupLogRecords(LogTableInterface logTable) throws KettleException {
  try {
    double timeout = Const.toDouble(Const.trim(environmentSubstitute(logTable.getTimeoutInDays())), 0.0);
    if (timeout > 0.000001) {
      // The timeout has to be at least a few seconds, otherwise we don't
      // bother
      //
      String schemaTable = databaseMeta
          .getQuotedSchemaTableCombination(environmentSubstitute(logTable.getActualSchemaName()),
              environmentSubstitute(logTable.getActualTableName()));

      // The log date field
      //
      LogTableField logField = logTable.getLogDateField();
      if (logField != null) {
        String sql = "DELETE FROM " + schemaTable + " WHERE " + databaseMeta.quoteField(logField.getFieldName())
            + " < ?"; // $NON-NLS$1

        // Now calculate the date...
        //
        long now = System.currentTimeMillis();
        long limit = now - Math.round(timeout * 24 * 60 * 60 * 1000);
        RowMetaAndData row = new RowMetaAndData();
        row.addValue(logField.getFieldName(), ValueMetaInterface.TYPE_DATE, new Date(limit));

        execStatement(sql, row.getRowMeta(), row.getData());

      } else {
        throw new KettleException(BaseMessages.getString(PKG,
            "Database.Exception.LogTimeoutDefinedOnTableWithoutLogField", logTable.getActualTableName()));
      }
    }
  } catch (Exception e) {
    throw new KettleDatabaseException(BaseMessages.getString(PKG,
        "Database.Exception.UnableToCleanUpOlderRecordsFromLogTable", logTable.getActualTableName()), e);
  }
}
 

开发者ID:jjeb,
项目名称:kettle-trunk,
代码行数:38,
代码来源:Database.java

示例20: clear

点赞 2

import org.pentaho.di.core.logging.LogTableInterface; //导入依赖的package包/类
/**
 * Clears or reinitializes many of the JobMeta properties.
 */
@Override
public void clear() {
  jobcopies = new ArrayList<JobEntryCopy>();
  jobhops = new ArrayList<JobHopMeta>();

  jobLogTable = JobLogTable.getDefault( this, this );
  jobEntryLogTable = JobEntryLogTable.getDefault( this, this );
  extraLogTables = new ArrayList<LogTableInterface>();

  List<PluginInterface> plugins = PluginRegistry.getInstance().getPlugins( LogTablePluginType.class );
  for ( PluginInterface plugin : plugins ) {
    try {
      LogTablePluginInterface logTablePluginInterface = (LogTablePluginInterface) PluginRegistry.getInstance()
          .loadClass( plugin );
      if ( logTablePluginInterface.getType() == TableType.JOB ) {
        logTablePluginInterface.setContext( this, this );
        extraLogTables.add( logTablePluginInterface );
      }
    } catch ( Exception e ) {
      LogChannel.GENERAL.logError( "Error loading log table plugin with ID " + plugin.getIds()[0], e );
    }
  }

  arguments = null;

  super.clear();
  loopCache = new HashMap<String, Boolean>();
  addDefaults();
  jobStatus = -1;
  jobVersion = null;

  // setInternalKettleVariables(); Don't clear the internal variables for
  // ad-hoc jobs, it's ruins the previews
  // etc.

  log = LogChannel.GENERAL;
}
 

开发者ID:pentaho,
项目名称:pentaho-kettle,
代码行数:41,
代码来源:JobMeta.java

示例21: getLogTables

点赞 2

import org.pentaho.di.core.logging.LogTableInterface; //导入依赖的package包/类
/**
 * Gets the log tables.
 *
 * @return the log tables
 */
public List<LogTableInterface> getLogTables() {
  List<LogTableInterface> logTables = new ArrayList<LogTableInterface>();
  logTables.add( jobLogTable );
  logTables.add( jobEntryLogTable );
  logTables.add( channelLogTable );
  logTables.addAll( extraLogTables );
  return logTables;
}
 

开发者ID:pentaho,
项目名称:pentaho-kettle,
代码行数:14,
代码来源:JobMeta.java

示例22: getLogTables

点赞 2

import org.pentaho.di.core.logging.LogTableInterface; //导入依赖的package包/类
/**
 * Gets a list of the log tables (transformation, step, performance, channel) for the transformation.
 *
 * @return a list of LogTableInterfaces for the transformation
 */
public List<LogTableInterface> getLogTables() {
  List<LogTableInterface> logTables = new ArrayList<>();
  logTables.add( transLogTable );
  logTables.add( stepLogTable );
  logTables.add( performanceLogTable );
  logTables.add( channelLogTable );
  logTables.add( metricsLogTable );
  return logTables;
}
 

开发者ID:pentaho,
项目名称:pentaho-kettle,
代码行数:15,
代码来源:TransMeta.java

示例23: JobDialogLogTableExtension

点赞 2

import org.pentaho.di.core.logging.LogTableInterface; //导入依赖的package包/类
public JobDialogLogTableExtension( Direction direction, Shell shell, JobMeta jobMeta,
  LogTableInterface logTable, Composite wLogOptionsComposite, ModifyListener lsMod, JobDialog jobDialog ) {
  super();
  this.direction = direction;
  this.shell = shell;
  this.jobMeta = jobMeta;
  this.logTable = logTable;
  this.wLogOptionsComposite = wLogOptionsComposite;
  this.lsMod = lsMod;
  this.jobDialog = jobDialog;
}
 

开发者ID:pentaho,
项目名称:pentaho-kettle,
代码行数:12,
代码来源:JobDialogLogTableExtension.java

示例24: showLogTypeOptions

点赞 2

import org.pentaho.di.core.logging.LogTableInterface; //导入依赖的package包/类
private void showLogTypeOptions( int index ) {

    if ( index != previousLogTableIndex ) {

      getLogInfo( previousLogTableIndex );

      // clean the log options composite...
      //
      for ( Control control : wLogOptionsComposite.getChildren() ) {
        control.dispose();
      }

      previousLogTableIndex = index;

      LogTableInterface logTable = logTables.get( index );
      LogTableUserInterface logTableUserInterface = logTableUserInterfaces.get( index );

      if ( logTableUserInterface != null ) {
        logTableUserInterface.showLogTableOptions( wLogOptionsComposite, logTable );
      } else {
        if ( logTable instanceof JobLogTable ) {
          showJobLogTableOptions( (JobLogTable) logTable );
        } else if ( logTable instanceof ChannelLogTable ) {
          showChannelLogTableOptions( (ChannelLogTable) logTable );
        }
        if ( logTable instanceof JobEntryLogTable ) {
          showJobEntryLogTableOptions( (JobEntryLogTable) logTable );
        }
      }

      wLogOptionsComposite.layout( true, true );
      wLogComp.layout( true, true );
    }
  }
 

开发者ID:pentaho,
项目名称:pentaho-kettle,
代码行数:35,
代码来源:JobDialog.java

示例25: clearLogTable

点赞 2

import org.pentaho.di.core.logging.LogTableInterface; //导入依赖的package包/类
/**
 * User requested to clear the log table.<br>
 * Better ask confirmation
 */
private void clearLogTable( int index ) {
  JobHistoryLogTab model = models[index];
  LogTableInterface logTable = model.logTable;

  if ( logTable.isDefined() ) {
    String schemaTable = logTable.getQuotedSchemaTableCombination();
    DatabaseMeta databaseMeta = logTable.getDatabaseMeta();

    MessageBox mb = new MessageBox( jobGraph.getShell(), SWT.YES | SWT.NO | SWT.ICON_QUESTION );
    //CHECKSTYLE:LineLength:OFF
    mb.setMessage( BaseMessages.getString( PKG, "JobGraph.Dialog.AreYouSureYouWantToRemoveAllLogEntries.Message", schemaTable ) );
    mb.setText( BaseMessages.getString( PKG, "JobGraph.Dialog.AreYouSureYouWantToRemoveAllLogEntries.Title" ) );
    if ( mb.open() == SWT.YES ) {
      Database database = new Database( loggingObject, databaseMeta );
      try {
        database.connect();
        database.truncateTable( schemaTable );
      } catch ( Exception e ) {
        new ErrorDialog( jobGraph.getShell(),
          BaseMessages.getString( PKG, "JobGraph.Dialog.ErrorClearningLoggingTable.Title" ),
          BaseMessages.getString( PKG, "JobGraph.Dialog.AreYouSureYouWantToRemoveAllLogEntries.Message" ), e );
      } finally {
        database.disconnect();

        refreshHistory();
        if ( model.logDisplayText != null ) {
          model.logDisplayText.setText( "" );
        }
      }
    }
  }
}
 

开发者ID:pentaho,
项目名称:pentaho-kettle,
代码行数:37,
代码来源:JobHistoryDelegate.java

示例26: clearLogTable

点赞 2

import org.pentaho.di.core.logging.LogTableInterface; //导入依赖的package包/类
/**
 * User requested to clear the log table.<br>
 * Better ask confirmation
 */
private void clearLogTable( int index ) {
  TransHistoryLogTab model = models[index];
  LogTableInterface logTable = model.logTable;

  if ( logTable.isDefined() ) {
    String schemaTable = logTable.getQuotedSchemaTableCombination();
    DatabaseMeta databaseMeta = logTable.getDatabaseMeta();

    MessageBox mb = new MessageBox( transGraph.getShell(), SWT.YES | SWT.NO | SWT.ICON_QUESTION );
    mb.setMessage( BaseMessages.getString( PKG, "TransGraph.Dialog.AreYouSureYouWantToRemoveAllLogEntries.Message",
      schemaTable ) ); // Nothing found that matches your criteria, sorry!
    mb.setText( BaseMessages.getString( PKG, "TransGraph.Dialog.AreYouSureYouWantToRemoveAllLogEntries.Title" ) );
    if ( mb.open() == SWT.YES ) {
      Database database = new Database( loggingObject, databaseMeta );
      try {
        database.connect();
        database.truncateTable( schemaTable );
      } catch ( Exception e ) {
        new ErrorDialog( transGraph.getShell(),
          BaseMessages.getString( PKG, "TransGraph.Dialog.ErrorClearningLoggingTable.Title" ),
          BaseMessages.getString( PKG, "TransGraph.Dialog.ErrorClearningLoggingTable.Message" ), e );
      } finally {
        database.disconnect();

        refreshHistory();
        if ( model.logDisplayText != null ) {
          model.logDisplayText.setText( "" );
        }
      }
    }
  }
}
 

开发者ID:pentaho,
项目名称:pentaho-kettle,
代码行数:37,
代码来源:TransHistoryDelegate.java

示例27: swapTables

点赞 2

import org.pentaho.di.core.logging.LogTableInterface; //导入依赖的package包/类
/**
 * @param jobMeta
 *            contains log tables to be refactored before export
 */
public static void swapTables( JobMeta jobMeta ) {
  JobLogTable jobLogTable = jobMeta.getJobLogTable();
  if ( jobLogTable != null ) {
    JobLogTable cloneJobLogTable = (JobLogTable) jobLogTable.clone();
    cloneJobLogTable.setAllGlobalParametersToNull();
    jobMeta.setJobLogTable( cloneJobLogTable );
  }

  JobEntryLogTable jobEntryLogTable = jobMeta.getJobEntryLogTable();
  if ( jobEntryLogTable != null ) {
    JobEntryLogTable cloneEntryLogTable = (JobEntryLogTable) jobEntryLogTable.clone();
    cloneEntryLogTable.setAllGlobalParametersToNull();
    jobMeta.setJobEntryLogTable( cloneEntryLogTable );
  }

  ChannelLogTable channelLogTable = jobMeta.getChannelLogTable();
  if ( channelLogTable != null ) {
    ChannelLogTable cloneChannelLogTable = (ChannelLogTable) channelLogTable.clone();
    cloneChannelLogTable.setAllGlobalParametersToNull();
    jobMeta.setChannelLogTable( cloneChannelLogTable );
  }

  List<LogTableInterface> extraLogTables = jobMeta.getExtraLogTables();
  if ( extraLogTables != null ) {
    List<LogTableInterface> cloneExtraLogTables = new ArrayList<>();
    for ( LogTableInterface logTable : extraLogTables ) {
      if ( logTable instanceof BaseLogTable ) {
        if ( logTable instanceof Cloneable ) {
          BaseLogTable cloneExtraLogTable = (BaseLogTable) logTable.clone();
          cloneExtraLogTable.setAllGlobalParametersToNull();
          cloneExtraLogTables.add( (LogTableInterface) cloneExtraLogTable );
        }
      }
    }
    jobMeta.setExtraLogTables( cloneExtraLogTables );
  }
}
 

开发者ID:pentaho,
项目名称:pentaho-kettle,
代码行数:42,
代码来源:XmlExportHelper.java

示例28: saveJobDetails

点赞 2

import org.pentaho.di.core.logging.LogTableInterface; //导入依赖的package包/类
private void saveJobDetails( DataNode rootNode, JobMeta jobMeta ) throws KettleException {
  rootNode.setProperty( PROP_EXTENDED_DESCRIPTION, jobMeta.getExtendedDescription() );
  rootNode.setProperty( PROP_JOB_VERSION, jobMeta.getJobversion() );
  rootNode.setProperty( PROP_JOB_STATUS, jobMeta.getJobstatus() < 0 ? -1L : jobMeta.getJobstatus() );

  if ( jobMeta.getJobLogTable().getDatabaseMeta() != null ) {
    DataNodeRef ref = new DataNodeRef( jobMeta.getJobLogTable().getDatabaseMeta().getObjectId().getId() );
    rootNode.setProperty( PROP_DATABASE_LOG, ref );
  }
  rootNode.setProperty( PROP_TABLE_NAME_LOG, jobMeta.getJobLogTable().getTableName() );

  rootNode.setProperty( PROP_CREATED_USER, jobMeta.getCreatedUser() );
  rootNode.setProperty( PROP_CREATED_DATE, jobMeta.getCreatedDate() );
  rootNode.setProperty( PROP_MODIFIED_USER, jobMeta.getModifiedUser() );
  rootNode.setProperty( PROP_MODIFIED_DATE, jobMeta.getModifiedDate() );
  rootNode.setProperty( PROP_USE_BATCH_ID, jobMeta.getJobLogTable().isBatchIdUsed() );
  rootNode.setProperty( PROP_PASS_BATCH_ID, jobMeta.isBatchIdPassed() );
  rootNode.setProperty( PROP_USE_LOGFIELD, jobMeta.getJobLogTable().isLogFieldUsed() );
  rootNode.setProperty( PROP_SHARED_FILE, jobMeta.getSharedObjectsFile() );

  rootNode.setProperty( PROP_LOG_SIZE_LIMIT, jobMeta.getJobLogTable().getLogSizeLimit() );

  // Save the logging tables too..
  //
  RepositoryAttributeInterface attributeInterface = new PurRepositoryAttribute( rootNode, jobMeta.getDatabases() );
  for ( LogTableInterface logTable : jobMeta.getLogTables() ) {
    logTable.saveToRepository( attributeInterface );
  }

  // Load the attributes map
  //
  AttributesMapUtil.saveAttributesMap( rootNode, jobMeta );
}
 

开发者ID:pentaho,
项目名称:pentaho-kettle,
代码行数:34,
代码来源:JobDelegate.java

示例29: setGlobalVariablesOfLogTablesNull

点赞 2

import org.pentaho.di.core.logging.LogTableInterface; //导入依赖的package包/类
protected void setGlobalVariablesOfLogTablesNull( List<LogTableInterface> logTables ) {
  for ( LogTableInterface logTable : logTables ) {
    if ( logTable instanceof BaseLogTable ) {
      ( (BaseLogTable) logTable ).setAllGlobalParametersToNull();
    }
  }
}
 

开发者ID:pentaho,
项目名称:pentaho-kettle,
代码行数:8,
代码来源:PurRepositoryExporter.java

示例30: onlyGlobalVariablesOfLogTablesSetToNull

点赞 2

import org.pentaho.di.core.logging.LogTableInterface; //导入依赖的package包/类
@Test
public void onlyGlobalVariablesOfLogTablesSetToNull() {
  try {
    System.setProperty( Const.KETTLE_GLOBAL_LOG_VARIABLES_CLEAR_ON_EXPORT, "true" );

    PurRepositoryExporter purRepoExporter = new PurRepositoryExporter( mock( PurRepository.class ) );
    String hardcodedString = "hardcoded";
    String globalParam = "${" + Const.KETTLE_TRANS_LOG_TABLE + "}";

    StepLogTable stepLogTable = StepLogTable.getDefault( mockedVariableSpace, mockedHasDbInterface );
    stepLogTable.setConnectionName( hardcodedString );
    stepLogTable.setSchemaName( hardcodedString );
    stepLogTable.setTimeoutInDays( hardcodedString );
    stepLogTable.setTableName( globalParam );

    JobEntryLogTable jobEntryLogTable = JobEntryLogTable.getDefault( mockedVariableSpace, mockedHasDbInterface );
    jobEntryLogTable.setConnectionName( hardcodedString );
    jobEntryLogTable.setSchemaName( hardcodedString );
    jobEntryLogTable.setTimeoutInDays( hardcodedString );
    jobEntryLogTable.setTableName( globalParam );

    List<LogTableInterface> logTables = new ArrayList<>();
    logTables.add( jobEntryLogTable );
    logTables.add( stepLogTable );

    purRepoExporter.setGlobalVariablesOfLogTablesNull( logTables );

    for ( LogTableInterface logTable : logTables ) {
      assertEquals( logTable.getConnectionName(), hardcodedString );
      assertEquals( logTable.getSchemaName(), hardcodedString );
      assertEquals( logTable.getTimeoutInDays(), hardcodedString );
      assertEquals( logTable.getTableName(), null );
    }
  } finally {
    System.setProperty( Const.KETTLE_GLOBAL_LOG_VARIABLES_CLEAR_ON_EXPORT, "false" );
  }
}
 

开发者ID:pentaho,
项目名称:pentaho-kettle,
代码行数:38,
代码来源:PurRepositoryUnitTest.java

示例31: globalVariablesOfLogTablesNotSetToNull

点赞 2

import org.pentaho.di.core.logging.LogTableInterface; //导入依赖的package包/类
@Test
public void globalVariablesOfLogTablesNotSetToNull() {
  PurRepositoryExporter purRepoExporter = new PurRepositoryExporter( mock( PurRepository.class ) );
  String globalParam = "${" + Const.KETTLE_TRANS_LOG_TABLE + "}";

  StepLogTable stepLogTable = StepLogTable.getDefault( mockedVariableSpace, mockedHasDbInterface );
  stepLogTable.setConnectionName( globalParam );
  stepLogTable.setSchemaName( globalParam );
  stepLogTable.setTimeoutInDays( globalParam );
  stepLogTable.setTableName( globalParam );

  JobEntryLogTable jobEntryLogTable = JobEntryLogTable.getDefault( mockedVariableSpace, mockedHasDbInterface );
  jobEntryLogTable.setConnectionName( globalParam );
  jobEntryLogTable.setSchemaName( globalParam );
  jobEntryLogTable.setTimeoutInDays( globalParam );
  jobEntryLogTable.setTableName( globalParam );

  List<LogTableInterface> logTables = new ArrayList<>();
  logTables.add( jobEntryLogTable );
  logTables.add( stepLogTable );

  purRepoExporter.setGlobalVariablesOfLogTablesNull( logTables );

  for ( LogTableInterface logTable : logTables ) {
    assertEquals( logTable.getConnectionName(), globalParam );
    assertEquals( logTable.getSchemaName(), globalParam );
    assertEquals( logTable.getTimeoutInDays(), globalParam );
    assertEquals( logTable.getTableName(), globalParam );
  }
}
 

开发者ID:pentaho,
项目名称:pentaho-kettle,
代码行数:31,
代码来源:PurRepositoryUnitTest.java

示例32: insertJob

点赞 2

import org.pentaho.di.core.logging.LogTableInterface; //导入依赖的package包/类
private synchronized void insertJob(JobMeta jobMeta) throws KettleException
{
	RowMetaAndData table = new RowMetaAndData();
	
	table.addValue(new ValueMeta(KettleDatabaseRepository.FIELD_JOB_ID_JOB, ValueMetaInterface.TYPE_INTEGER), jobMeta.getObjectId());
	table.addValue(new ValueMeta(KettleDatabaseRepository.FIELD_JOB_ID_DIRECTORY, ValueMetaInterface.TYPE_INTEGER), jobMeta.getRepositoryDirectory().getObjectId());
	table.addValue(new ValueMeta(KettleDatabaseRepository.FIELD_JOB_NAME, ValueMetaInterface.TYPE_STRING), jobMeta.getName());
	table.addValue(new ValueMeta(KettleDatabaseRepository.FIELD_JOB_DESCRIPTION, ValueMetaInterface.TYPE_STRING), jobMeta.getDescription());
	table.addValue(new ValueMeta(KettleDatabaseRepository.FIELD_JOB_EXTENDED_DESCRIPTION, ValueMetaInterface.TYPE_STRING), jobMeta.getExtendedDescription());
	table.addValue(new ValueMeta(KettleDatabaseRepository.FIELD_JOB_JOB_VERSION, ValueMetaInterface.TYPE_STRING), jobMeta.getJobversion());
	table.addValue(new ValueMeta(KettleDatabaseRepository.FIELD_JOB_JOB_STATUS, ValueMetaInterface.TYPE_INTEGER), new Long(jobMeta.getJobstatus()  <0 ? -1L : jobMeta.getJobstatus()));

	table.addValue(new ValueMeta(KettleDatabaseRepository.FIELD_JOB_ID_DATABASE_LOG, ValueMetaInterface.TYPE_INTEGER), jobMeta.getJobLogTable().getDatabaseMeta()!=null ? jobMeta.getJobLogTable().getDatabaseMeta().getObjectId() : -1L);
	table.addValue(new ValueMeta(KettleDatabaseRepository.FIELD_JOB_TABLE_NAME_LOG, ValueMetaInterface.TYPE_STRING), jobMeta.getJobLogTable().getTableName());
	table.addValue(new ValueMeta(KettleDatabaseRepository.FIELD_JOB_USE_BATCH_ID, ValueMetaInterface.TYPE_BOOLEAN), jobMeta.getJobLogTable().isBatchIdUsed());
	table.addValue(new ValueMeta(KettleDatabaseRepository.FIELD_JOB_USE_LOGFIELD, ValueMetaInterface.TYPE_BOOLEAN), jobMeta.getJobLogTable().isLogFieldUsed());
	repository.connectionDelegate.insertJobAttribute(jobMeta.getObjectId(), 0, KettleDatabaseRepository.JOB_ATTRIBUTE_LOG_SIZE_LIMIT, 0, jobMeta.getJobLogTable().getLogSizeLimit());

	table.addValue(new ValueMeta(KettleDatabaseRepository.FIELD_JOB_CREATED_USER, ValueMetaInterface.TYPE_STRING), jobMeta.getCreatedUser());
	table.addValue(new ValueMeta(KettleDatabaseRepository.FIELD_JOB_CREATED_DATE, ValueMetaInterface.TYPE_DATE), jobMeta.getCreatedDate());
	table.addValue(new ValueMeta(KettleDatabaseRepository.FIELD_JOB_MODIFIED_USER, ValueMetaInterface.TYPE_STRING), jobMeta.getModifiedUser());
	table.addValue(new ValueMeta(KettleDatabaseRepository.FIELD_JOB_MODIFIED_DATE, ValueMetaInterface.TYPE_DATE), jobMeta.getModifiedDate());
       table.addValue(new ValueMeta(KettleDatabaseRepository.FIELD_JOB_PASS_BATCH_ID, ValueMetaInterface.TYPE_BOOLEAN), jobMeta.isBatchIdPassed());
       table.addValue(new ValueMeta(KettleDatabaseRepository.FIELD_JOB_SHARED_FILE, ValueMetaInterface.TYPE_STRING), jobMeta.getSharedObjectsFile());
       
       repository.connectionDelegate.getDatabase().prepareInsert(table.getRowMeta(), KettleDatabaseRepository.TABLE_R_JOB);
	repository.connectionDelegate.getDatabase().setValuesInsert(table);
	repository.connectionDelegate.getDatabase().insertRow();
       if (log.isDebug()) log.logDebug("Inserted new record into table "+quoteTable(KettleDatabaseRepository.TABLE_R_JOB)+" with data : " + table);
       repository.connectionDelegate.getDatabase().closeInsert();
	
       
       
	// Save the logging connection link...
	if (jobMeta.getJobLogTable().getDatabaseMeta()!=null) {
		repository.insertJobEntryDatabase(jobMeta.getObjectId(), null, jobMeta.getJobLogTable().getDatabaseMeta().getObjectId());
	}
	
   // Save the logging tables too..
   //
   RepositoryAttributeInterface attributeInterface = new KettleDatabaseRepositoryJobAttribute(repository.connectionDelegate, jobMeta.getObjectId());
   for (LogTableInterface logTable : jobMeta.getLogTables()) {
     logTable.saveToRepository(attributeInterface);
   }
}
 

开发者ID:yintaoxue,
项目名称:read-open-source-code,
代码行数:46,
代码来源:KettleDatabaseRepositoryJobDelegate.java

示例33: getLastExecutionResult

点赞 2

import org.pentaho.di.core.logging.LogTableInterface; //导入依赖的package包/类
public static String getLastExecutionResult(LogChannelInterface log, LoggingObjectInterface parentObject, ReportSubjectLocation filename) throws KettleException {

	LogTableInterface logTable=null;
	if (filename.isTransformation()) {
		TransMeta transMeta = TransformationInformation.getInstance().getTransMeta(filename);
		logTable = transMeta.getTransLogTable();
	} else {
		JobMeta jobMeta  = JobInformation.getInstance().getJobMeta(filename);
		logTable = jobMeta.getJobLogTable();
	}
	if (logTable!=null && logTable.isDefined()) {
		DatabaseMeta dbMeta = logTable.getDatabaseMeta();
		Database database = new Database(parentObject, dbMeta);
		try {
			database.connect();
			String sql="SELECT ";
			sql+=dbMeta.quoteField(logTable.getStatusField().getFieldName())+", ";
			sql+=dbMeta.quoteField(logTable.getLogDateField().getFieldName())+", ";
			sql+=dbMeta.quoteField(logTable.getErrorsField().getFieldName())+"";
			sql+=" FROM ";
			sql+=dbMeta.getQuotedSchemaTableCombination(logTable.getSchemaName(), logTable.getTableName());
			sql+=" ORDER BY "+dbMeta.quoteField(logTable.getLogDateField().getFieldName())+" DESC";
			
			RowMetaAndData oneRow = database.getOneRow(sql);
			String status = oneRow.getString(0, "?");
			Date date = oneRow.getDate(1, null);
			Long nrErrors = oneRow.getInteger(2);
			
			String evaluation;
			if (status.equalsIgnoreCase(LogStatus.END.getStatus())) {
				evaluation = "Ended";
			} else if (status.equalsIgnoreCase(LogStatus.START.getStatus())) {
				evaluation = "Started";
			} else if (status.equalsIgnoreCase(LogStatus.STOP.getStatus())) {
				evaluation = "Stopped";
			} else if (status.equalsIgnoreCase(LogStatus.RUNNING.getStatus())) {
				evaluation = "Running";
			} else if (status.equalsIgnoreCase(LogStatus.PAUSED.getStatus())) {
				evaluation = "Paused";
			} else if (status.equalsIgnoreCase(LogStatus.ERROR.getStatus())) {
				evaluation = "Failed";
			} else {
				evaluation = "Unknown";
			}
			if (nrErrors>0) {
				evaluation+=" with errors";
			} else {
				evaluation+=" with success";
			}
			
			return evaluation+" at "+XMLHandler.date2string(date);
			
		} catch(Exception e) {
			log.logBasic("Unable to get logging information from log table"+logTable);
		} finally {
			database.disconnect();
		}
	}
	return null;
}
 

开发者ID:yintaoxue,
项目名称:read-open-source-code,
代码行数:61,
代码来源:KettleFileTableModel.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)