当前位置: 首页>>代码示例>>Java>>正文


Java LoggingObject类代码示例

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


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

示例1: stopsAll

import org.pentaho.di.core.logging.LoggingObject; //导入依赖的package包/类
@Test
public void stopsAll() throws KettleException {
  TransMeta parentMeta =
    new TransMeta( this.getClass().getResource( "subtrans-executor-parent.ktr" ).getPath(), new Variables() );
  TransMeta subMeta =
    new TransMeta( this.getClass().getResource( "subtrans-executor-sub.ktr" ).getPath(), new Variables() );
  LoggingObjectInterface loggingObject = new LoggingObject( "anything" );
  Trans parentTrans = new Trans( parentMeta, loggingObject );
  SubtransExecutor subtransExecutor =
    new SubtransExecutor( parentTrans, subMeta, true, new TransExecutorData(), new TransExecutorParameters() );
  subtransExecutor.running = Mockito.spy( subtransExecutor.running );
  RowMetaInterface rowMeta = parentMeta.getStepFields( "Data Grid" );
  List<RowMetaAndData> rows = Arrays.asList(
    new RowMetaAndData( rowMeta, "Pentaho", 1L ),
    new RowMetaAndData( rowMeta, "Pentaho", 2L ),
    new RowMetaAndData( rowMeta, "Pentaho", 3L ),
    new RowMetaAndData( rowMeta, "Pentaho", 4L ) );
  subtransExecutor.execute( rows );
  verify( subtransExecutor.running ).add( any() );
  subtransExecutor.stop();
  assertTrue( subtransExecutor.running.isEmpty() );
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:23,代码来源:SubtransExecutorTest.java

示例2: dataProfile

import org.pentaho.di.core.logging.LoggingObject; //导入依赖的package包/类
public void dataProfile(){
  Shell dbShell = (Shell) dbExplorerDialog.getRootObject();
  try {
    TransProfileFactory profileFactory = new TransProfileFactory(this.model.getDatabaseMeta(), getSchemaAndTable(this.model));
    TransMeta transMeta = profileFactory.generateTransformation(new LoggingObject(model.getTable()));
    TransPreviewProgressDialog progressDialog = new TransPreviewProgressDialog(dbShell,
                                           transMeta,
                                           new String[] { TransProfileFactory.RESULT_STEP_NAME, }, new int[] { 25000, } );

    progressDialog.open();

    if (!progressDialog.isCancelled())
    {
      Trans trans = progressDialog.getTrans();
      String loggingText = progressDialog.getLoggingText();

      if (trans.getResult()!=null && trans.getResult().getNrErrors()>0)
      {
        EnterTextDialog etd = new EnterTextDialog(dbShell, BaseMessages.getString(PKG,"System.Dialog.PreviewError.Title"),
                              BaseMessages.getString(PKG,"System.Dialog.PreviewError.Message"), loggingText, true );
        etd.setReadOnly();
        etd.open();
      }

      PreviewRowsDialog prd = new PreviewRowsDialog(dbShell, transMeta, SWT.NONE, TransProfileFactory.RESULT_STEP_NAME,
                              progressDialog.getPreviewRowsMeta(TransProfileFactory.RESULT_STEP_NAME), progressDialog
                              .getPreviewRows(TransProfileFactory.RESULT_STEP_NAME), loggingText);
      prd.open();

    }


  } catch(Exception e) {
    new ErrorDialog(this.dbExplorerDialog.getShell(), BaseMessages.getString(PKG,"DatabaseExplorerDialog.UnexpectedProfilingError.Title"),
            BaseMessages.getString(PKG,"DatabaseExplorerDialog.UnexpectedProfilingError.Message"), e);
  }

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

示例3: profileTable

import org.pentaho.di.core.logging.LoggingObject; //导入依赖的package包/类
/**
 * Fire off a transformation that data profiles the specified table...<br>
 * 
 * 
 * @param tableName
 */
public void profileTable(String tableName)
{
	try {
		TransProfileFactory profileFactory = new TransProfileFactory(dbMeta, tableName);
		TransMeta transMeta = profileFactory.generateTransformation(new LoggingObject(tableName));
		TransPreviewProgressDialog progressDialog = new TransPreviewProgressDialog(shell, 
				transMeta, 
				new String[] { TransProfileFactory.RESULT_STEP_NAME, }, new int[] { 25000, } );
		progressDialog.open();
		
           if (!progressDialog.isCancelled())
           {
               Trans trans = progressDialog.getTrans();
               String loggingText = progressDialog.getLoggingText();
               
               if (trans.getResult()!=null && trans.getResult().getNrErrors()>0)
               {
               	EnterTextDialog etd = new EnterTextDialog(shell, BaseMessages.getString(PKG,"System.Dialog.PreviewError.Title"),  
               			BaseMessages.getString(PKG,"System.Dialog.PreviewError.Message"), loggingText, true );
               	etd.setReadOnly();
               	etd.open();
               }
                        
               PreviewRowsDialog prd = new PreviewRowsDialog(shell, transMeta, SWT.NONE, TransProfileFactory.RESULT_STEP_NAME,
					progressDialog.getPreviewRowsMeta(TransProfileFactory.RESULT_STEP_NAME), progressDialog
							.getPreviewRows(TransProfileFactory.RESULT_STEP_NAME), loggingText);
			prd.open();
               
           }

		
	} catch(Exception e) {
		new ErrorDialog(shell, BaseMessages.getString(PKG,"DatabaseExplorerDialog.UnexpectedProfilingError.Title"),
				BaseMessages.getString(PKG,"DatabaseExplorerDialog.UnexpectedProfilingError.Message"), e);
	}
	
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:44,代码来源:DatabaseExplorerDialogLegacy.java

示例4: doesNotExecuteWhenStopped

import org.pentaho.di.core.logging.LoggingObject; //导入依赖的package包/类
@Test
public void doesNotExecuteWhenStopped() throws KettleException {

  TransMeta parentMeta =
    new TransMeta( this.getClass().getResource( "subtrans-executor-parent.ktr" ).getPath(), new Variables() );
  TransMeta subMeta =
    new TransMeta( this.getClass().getResource( "subtrans-executor-sub.ktr" ).getPath(), new Variables() );
  LoggingObjectInterface loggingObject = new LoggingObject( "anything" );
  Trans parentTrans = new Trans( parentMeta, loggingObject );
  SubtransExecutor subtransExecutor =
    new SubtransExecutor( parentTrans, subMeta, true, new TransExecutorData(), new TransExecutorParameters() );
  RowMetaInterface rowMeta = parentMeta.getStepFields( "Data Grid" );
  List<RowMetaAndData> rows = Arrays.asList(
    new RowMetaAndData( rowMeta, "Pentaho", 1L ),
    new RowMetaAndData( rowMeta, "Pentaho", 2L ),
    new RowMetaAndData( rowMeta, "Pentaho", 3L ),
    new RowMetaAndData( rowMeta, "Pentaho", 4L ) );
  subtransExecutor.stop();
  subtransExecutor.execute( rows );

  verify( this.logChannel, never() )
    .logBasic(
      "\n"
        + "------------> Linenr 1------------------------------\n"
        + "name = Pentaho\n"
        + "sum = 10\n"
        + "\n"
        + "===================="
    );
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:31,代码来源:SubtransExecutorTest.java

示例5: testValueMetaBaseOnlyHasOneLogger

import org.pentaho.di.core.logging.LoggingObject; //导入依赖的package包/类
@Test
public void testValueMetaBaseOnlyHasOneLogger() throws NoSuchFieldException, IllegalAccessException {
  Field log = ValueMetaBase.class.getDeclaredField( "log" );
  assertTrue( Modifier.isStatic( log.getModifiers() ) );
  assertTrue( Modifier.isFinal( log.getModifiers() ) );
  log.setAccessible( true );
  try {
    assertEquals( LoggingRegistry.getInstance().findExistingLoggingSource( new LoggingObject( "ValueMetaBase" ) )
        .getLogChannelId(),
      ( (LogChannelInterface) log.get( null ) ).getLogChannelId() );
  } finally {
    log.setAccessible( false );
  }
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:15,代码来源:ValueMetaBaseTest.java

示例6: dataProfile

import org.pentaho.di.core.logging.LoggingObject; //导入依赖的package包/类
public void dataProfile(){
  if(model.getTable() == null){
    return;
  }
  Shell dbShell = (Shell) dbExplorerDialog.getRootObject();
  try {
    TransProfileFactory profileFactory = new TransProfileFactory(this.model.getDatabaseMeta(), getSchemaAndTable(this.model));
    TransMeta transMeta = profileFactory.generateTransformation(new LoggingObject(model.getTable()));
    TransPreviewProgressDialog progressDialog = new TransPreviewProgressDialog(dbShell,
                                           transMeta,
                                           new String[] { TransProfileFactory.RESULT_STEP_NAME, }, new int[] { 25000, } );

    progressDialog.open();

    if (!progressDialog.isCancelled())
    {
      Trans trans = progressDialog.getTrans();
      String loggingText = progressDialog.getLoggingText();

      if (trans.getResult()!=null && trans.getResult().getNrErrors()>0)
      {
        EnterTextDialog etd = new EnterTextDialog(dbShell, BaseMessages.getString(PKG,"System.Dialog.PreviewError.Title"),
                              BaseMessages.getString(PKG,"System.Dialog.PreviewError.Message"), loggingText, true );
        etd.setReadOnly();
        etd.open();
      }

      PreviewRowsDialog prd = new PreviewRowsDialog(dbShell, transMeta, SWT.NONE, TransProfileFactory.RESULT_STEP_NAME,
                              progressDialog.getPreviewRowsMeta(TransProfileFactory.RESULT_STEP_NAME), progressDialog
                              .getPreviewRows(TransProfileFactory.RESULT_STEP_NAME), loggingText);
      prd.open();

    }


  } catch(Exception e) {
    new ErrorDialog(this.dbExplorerDialog.getShell(), BaseMessages.getString(PKG,"DatabaseExplorerDialog.UnexpectedProfilingError.Title"),
            BaseMessages.getString(PKG,"DatabaseExplorerDialog.UnexpectedProfilingError.Message"), e);
  }

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

示例7: dataProfile

import org.pentaho.di.core.logging.LoggingObject; //导入依赖的package包/类
public void dataProfile() {
  if ( model.getTable() == null ) {
    return;
  }
  Shell dbShell = (Shell) dbExplorerDialog.getRootObject();
  try {
    TransProfileFactory profileFactory =
      new TransProfileFactory( this.model.getDatabaseMeta(), getSchemaAndTable( this.model ) );
    TransMeta transMeta = profileFactory.generateTransformation( new LoggingObject( model.getTable() ) );
    TransPreviewProgressDialog progressDialog =
      new TransPreviewProgressDialog(
        dbShell, transMeta, new String[] { TransProfileFactory.RESULT_STEP_NAME, }, new int[] { 25000, } );

    progressDialog.open();

    if ( !progressDialog.isCancelled() ) {
      Trans trans = progressDialog.getTrans();
      String loggingText = progressDialog.getLoggingText();

      if ( trans.getResult() != null && trans.getResult().getNrErrors() > 0 ) {
        EnterTextDialog etd =
          new EnterTextDialog(
            dbShell, BaseMessages.getString( PKG, "System.Dialog.PreviewError.Title" ), BaseMessages
              .getString( PKG, "System.Dialog.PreviewError.Message" ), loggingText, true );
        etd.setReadOnly();
        etd.open();
      }

      PreviewRowsDialog prd =
        new PreviewRowsDialog(
          dbShell, transMeta, SWT.NONE, TransProfileFactory.RESULT_STEP_NAME, progressDialog
            .getPreviewRowsMeta( TransProfileFactory.RESULT_STEP_NAME ), progressDialog
            .getPreviewRows( TransProfileFactory.RESULT_STEP_NAME ), loggingText );
      prd.open();

    }

  } catch ( Exception e ) {
    new ErrorDialog( this.dbExplorerDialog.getShell(),
      BaseMessages.getString( PKG, "DatabaseExplorerDialog.UnexpectedProfilingError.Title" ),
      BaseMessages.getString( PKG, "DatabaseExplorerDialog.UnexpectedProfilingError.Message" ), e );
  }

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


注:本文中的org.pentaho.di.core.logging.LoggingObject类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。