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";
if ( logTable.getDatabaseMeta() != null && !Utils.isEmpty( logTable.getTableName() ) ) { db = new Database( jobMeta, logTable.getDatabaseMeta() ); db.shareVariablesWith( jobMeta ); db.connect(); RowMetaInterface fields = logTable.getLogRecord( LogStatus.START, null, null ).getRowMeta(); String tableName = db.environmentSubstitute( logTable.getTableName() ); String schemaTable = logTable.getDatabaseMeta().getQuotedSchemaTableCombination( db.environmentSubstitute( logTable.getSchemaName() ), db.environmentSubstitute( logTable.getTableName() ) ); String createTable = db.getDDL( schemaTable, fields ); ddl.append( "-- " ).append( logTable.getLogTableType() ).append( Const.CR ); ddl.append( "--" ).append( Const.CR ).append( Const.CR ); ddl.append( createTable ).append( Const.CR ); java.util.List<RowMetaInterface> indexes = logTable.getRecommendedIndexes(); for ( int i = 0; i < indexes.size(); i++ ) { RowMetaInterface index = indexes.get( i ); new SQLEditor( jobMeta, shell, SWT.NONE, logTable.getDatabaseMeta(), DBCache.getInstance(), ddl .toString() ); sqledit.open(); MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_INFORMATION ); mb.setText( BaseMessages.getString( PKG, "JobDialog.NoSqlNedds.DialogTitle" ) ); mb.setMessage( logTable.getLogTableType()
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; }
if ( model.logTable.isDefined() ) { message = BaseMessages.getString( PKG, "JobHistory.PleaseRefresh.Message" ); } else { LogTableField logField = model.logTable.getLogField(); if ( logField != null ) { int index = model.logTableFields.indexOf( logField );
wLogconnection.setLayoutData( fdLogconnection ); wLogconnection.setItems( transMeta.getDatabaseNames() ); wLogconnection.setText( Const.NVL( logTable.getConnectionName(), "" ) ); wLogconnection.setToolTipText( BaseMessages.getString( PKG, "TransDialog.LogConnection.Tooltip", logTable .getConnectionNameVariable() ) ); fdLogSchema.right = new FormAttachment( 100, 0 ); wLogSchema.setLayoutData( fdLogSchema ); wLogSchema.setText( Const.NVL( logTable.getSchemaName(), "" ) ); wLogSchema.setToolTipText( BaseMessages.getString( PKG, "TransDialog.LogSchema.Tooltip", logTable .getSchemaNameVariable() ) ); fdLogtable.right = new FormAttachment( 100, 0 ); wLogTable.setLayoutData( fdLogtable ); wLogTable.setText( Const.NVL( logTable.getTableName(), "" ) ); wLogTable.setToolTipText( BaseMessages.getString( PKG, "TransDialog.LogTable.Tooltip", logTable .getTableNameVariable() ) );
if ( jobMeta != null && !Utils.isEmpty( jobMeta.getName() ) && logTable.isDefined() ) { Database database = null; try { DatabaseMeta logConnection = logTable.getDatabaseMeta(); String schemaTable = logTable.getQuotedSchemaTableCombination(); for ( LogTableField field : logTable.getFields() ) { if ( field.isEnabled() && field.isVisible() ) { if ( !first ) { LogTableField nameField = logTable.getNameField(); LogTableField keyField = logTable.getKeyField();
for ( LogTableInterface logTable : new LogTableInterface[] { transLogTable, performanceLogTable, channelLogTable, stepLogTable, } ) { if ( logTable.getDatabaseMeta() != null && !Utils.isEmpty( logTable.getTableName() ) ) { db.connect(); RowMetaInterface fields = logTable.getLogRecord( LogStatus.START, null, null ).getRowMeta(); String schemaTable = logTable.getDatabaseMeta() .getQuotedSchemaTableCombination( logTable.getSchemaName(), logTable.getTableName() ); String sql = db.getDDL( schemaTable, fields ); if ( !Utils.isEmpty( sql ) ) { "Unable to connect to logging database [" + logTable.getDatabaseMeta() + "]", e ); } finally { if ( db != null ) {
LogTableInterface logTable = model.logTable; if ( logTable.isDefined() ) { String schemaTable = logTable.getQuotedSchemaTableCombination(); DatabaseMeta databaseMeta = logTable.getDatabaseMeta();
LogStatus status = null; LogTableField errorsField = model.logTable.getErrorsField(); if ( errorsField != null ) { int index1 = model.logTableFields.indexOf( errorsField ); LogTableField statusField = model.logTable.getStatusField(); if ( statusField != null ) { int index1 = model.logTableFields.indexOf( statusField );
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; }
logTable.loadFromRepository( attributeInterface );
logTable.saveToRepository( attributeInterface );
wLogconnection.setLayoutData( fdLogconnection ); wLogconnection.setItems( jobMeta.getDatabaseNames() ); wLogconnection.setText( Const.NVL( logTable.getConnectionName(), "" ) ); wLogconnection.setToolTipText( BaseMessages.getString( PKG, "JobDialog.LogConnection.Tooltip", logTable .getConnectionNameVariable() ) ); fdLogSchema.right = new FormAttachment( 100, 0 ); wLogSchema.setLayoutData( fdLogSchema ); wLogSchema.setText( Const.NVL( logTable.getSchemaName(), "" ) ); wLogSchema.setToolTipText( BaseMessages.getString( PKG, "JobDialog.LogSchema.Tooltip", logTable .getSchemaNameVariable() ) ); fdLogtable.right = new FormAttachment( 100, 0 ); wLogTable.setLayoutData( fdLogtable ); wLogTable.setText( Const.NVL( logTable.getTableName(), "" ) ); wLogTable.setToolTipText( BaseMessages.getString( PKG, "JobDialog.LogTable.Tooltip", logTable .getTableNameVariable() ) );
if ( transMeta != null && !Utils.isEmpty( transMeta.getName() ) && logTable.isDefined() ) { Database database = null; try { DatabaseMeta logConnection = logTable.getDatabaseMeta(); String schemaTable = logTable.getQuotedSchemaTableCombination(); for ( LogTableField field : logTable.getFields() ) { if ( field.isEnabled() && field.isVisible() ) { if ( !first ) { LogTableField nameField = logTable.getNameField(); LogTableField keyField = logTable.getKeyField();
LogTableInterface logTable = model.logTable; if ( logTable.isDefined() ) { String schemaTable = logTable.getQuotedSchemaTableCombination(); DatabaseMeta databaseMeta = logTable.getDatabaseMeta();
LogStatus status = null; LogTableField errorsField = model.logTable.getErrorsField(); if ( errorsField != null ) { int index1 = model.logTableFields.indexOf( errorsField ); LogTableField statusField = model.logTable.getStatusField(); if ( statusField != null ) { int index1 = model.logTableFields.indexOf( statusField );
break; case ValueMetaInterface.TYPE_BOOLEAN: DatabaseMeta databaseMeta = logTable.getDatabaseMeta(); if ( databaseMeta != null ) { if ( !databaseMeta.supportsBooleanDataType() ) {
if ( model.logTable.isDefined() ) { message = BaseMessages.getString( PKG, "TransHistory.PleaseRefresh.Message" ); } else { LogTableField logField = model.logTable.getLogField(); if ( logField != null ) { int index = model.logTableFields.indexOf( logField );
new KettleDatabaseRepositoryJobAttribute( repository.connectionDelegate, jobMeta.getObjectId() ); for ( LogTableInterface logTable : jobMeta.getLogTables() ) { logTable.loadFromRepository( attributeInterface );
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 ); }