本文整理了Java中org.pentaho.di.core.database.Database.cleanupLogRecords()
方法的一些代码示例,展示了Database.cleanupLogRecords()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Database.cleanupLogRecords()
方法的具体详情如下:
包路径:org.pentaho.di.core.database.Database
类名称:Database
方法名:cleanupLogRecords
暂无
代码示例来源:origin: pentaho/pentaho-kettle
@Test
public void testRecordsCleanUpMethodIsCalled() throws Exception {
Database mockedDataBase = mock( Database.class );
Trans trans = mock( Trans.class );
StepLogTable stepLogTable =
StepLogTable.getDefault( mock( VariableSpace.class ), mock( HasDatabasesInterface.class ) );
stepLogTable.setConnectionName( "connection" );
TransMeta transMeta = new TransMeta();
transMeta.setStepLogTable( stepLogTable );
when( trans.getTransMeta() ).thenReturn( transMeta );
when( trans.createDataBase( any( DatabaseMeta.class ) ) ).thenReturn( mockedDataBase );
when( trans.getSteps() ).thenReturn( new ArrayList<>() );
doCallRealMethod().when( trans ).writeStepLogInformation();
trans.writeStepLogInformation();
verify( mockedDataBase ).cleanupLogRecords( stepLogTable );
}
代码示例来源:origin: pentaho/pentaho-kettle
@Test
public void recordsCleanUpMethodIsCalled_JobLogTable() throws Exception {
JobLogTable jobLogTable = JobLogTable.getDefault( mockedVariableSpace, hasDatabasesInterface );
setAllTableParamsDefault( jobLogTable );
doCallRealMethod().when( mockedJob ).writeLogTableInformation( jobLogTable, LogStatus.END );
mockedJob.writeLogTableInformation( jobLogTable, LogStatus.END );
verify( mockedDataBase ).cleanupLogRecords( jobLogTable );
}
代码示例来源:origin: pentaho/pentaho-kettle
@Test
public void recordsCleanUpMethodIsCalled_JobEntryLogTable() throws Exception {
JobEntryLogTable jobEntryLogTable = JobEntryLogTable.getDefault( mockedVariableSpace, hasDatabasesInterface );
setAllTableParamsDefault( jobEntryLogTable );
JobMeta jobMeta = new JobMeta( );
jobMeta.setJobEntryLogTable( jobEntryLogTable );
when( mockedJob.getJobMeta() ).thenReturn( jobMeta );
doCallRealMethod().when( mockedJob ).writeJobEntryLogInformation();
mockedJob.writeJobEntryLogInformation();
verify( mockedDataBase ).cleanupLogRecords( jobEntryLogTable );
}
代码示例来源:origin: pentaho/pentaho-kettle
db.cleanupLogRecords( metricsLogTable );
} catch ( Exception e ) {
throw new KettleException( BaseMessages.getString( PKG,
代码示例来源:origin: pentaho/pentaho-kettle
ldb.cleanupLogRecords( performanceLogTable );
代码示例来源:origin: pentaho/pentaho-kettle
/**
* Writes step information to a step logging table (if one has been configured).
*
* @throws KettleException if any errors occur during logging
*/
protected void writeStepLogInformation() throws KettleException {
Database db = null;
StepLogTable stepLogTable = getTransMeta().getStepLogTable();
try {
db = createDataBase( stepLogTable.getDatabaseMeta() );
db.shareVariablesWith( this );
db.connect();
db.setCommit( logCommitSize );
for ( StepMetaDataCombi combi : getSteps() ) {
db.writeLogRecord( stepLogTable, LogStatus.START, combi, null );
}
db.cleanupLogRecords( stepLogTable );
} catch ( Exception e ) {
throw new KettleException( BaseMessages.getString( PKG,
"Trans.Exception.UnableToWriteStepInformationToLogTable" ), e );
} finally {
disconnectDb( db );
}
}
代码示例来源:origin: pentaho/pentaho-kettle
/**
* Writes information to Job Log table. Cleans old records, in case job is finished.
*/
protected void writeLogTableInformation( JobLogTable jobLogTable, LogStatus status ) throws KettleJobException,
KettleDatabaseException {
boolean cleanLogRecords = status.equals( LogStatus.END );
String tableName = jobLogTable.getActualTableName();
DatabaseMeta logcon = jobLogTable.getDatabaseMeta();
Database ldb = createDataBase( logcon );
ldb.shareVariablesWith( this );
try {
ldb.connect();
ldb.setCommit( logCommitSize );
ldb.writeLogRecord( jobLogTable, status, this, null );
if ( cleanLogRecords ) {
ldb.cleanupLogRecords( jobLogTable );
}
} catch ( KettleDatabaseException dbe ) {
addErrors( 1 );
throw new KettleJobException( "Unable to end processing by writing log record to table " + tableName, dbe );
} finally {
if ( !ldb.isAutoCommit() ) {
ldb.commitLog( true, jobLogTable );
}
ldb.disconnect();
}
}
代码示例来源:origin: pentaho/pentaho-kettle
/**
* Write job entry log information.
*
* @throws KettleException
* the kettle exception
*/
protected void writeJobEntryLogInformation() throws KettleException {
Database db = null;
JobEntryLogTable jobEntryLogTable = getJobMeta().getJobEntryLogTable();
try {
db = createDataBase( jobEntryLogTable.getDatabaseMeta() );
db.shareVariablesWith( this );
db.connect();
db.setCommit( logCommitSize );
for ( JobEntryCopy copy : getJobMeta().getJobCopies() ) {
db.writeLogRecord( jobEntryLogTable, LogStatus.START, copy, this );
}
db.cleanupLogRecords( jobEntryLogTable );
} catch ( Exception e ) {
throw new KettleException( BaseMessages.getString( PKG, "Job.Exception.UnableToJobEntryInformationToLogTable" ),
e );
} finally {
if ( !db.isAutoCommit() ) {
db.commitLog( true, jobEntryLogTable );
}
db.disconnect();
}
}
代码示例来源:origin: pentaho/pentaho-kettle
db.cleanupLogRecords( channelLogTable );
代码示例来源:origin: pentaho/pentaho-kettle
ldb.cleanupLogRecords( transLogTable );
代码示例来源:origin: pentaho/pentaho-kettle
db.cleanupLogRecords( channelLogTable );
} catch ( Exception e ) {
throw new KettleException( BaseMessages.getString( PKG,
内容来源于网络,如有侵权,请联系作者删除!