@Test public void testReadRep() throws KettleException { String commitSize = "${test}"; Repository rep = new MemoryRepository(); rep.saveStepAttribute( null, null, "commit", commitSize ); TableOutputMeta tableOutputMeta = new TableOutputMeta(); tableOutputMeta.readRep( rep, metaStore, null, databases ); assertEquals( commitSize, tableOutputMeta.getCommitSize() ); int commitSizeInt = 1; Repository rep2 = new MemoryRepository(); rep2.saveStepAttribute( null, null, "commit", commitSizeInt ); TableOutputMeta tableOutputMeta2 = new TableOutputMeta(); tableOutputMeta2.readRep( rep2, metaStore, null, databases ); assertEquals( String.valueOf( commitSizeInt ), tableOutputMeta2.getCommitSize() ); }
public void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ) throws KettleException { try { databaseMeta = rep.loadDatabaseMetaFromStepAttribute( id_step, "id_connection", databases ); schemaName = rep.getStepAttributeString( id_step, "schema" ); tableName = rep.getStepAttributeString( id_step, "table" ); commitSize = rep.getStepAttributeString( id_step, "commit" ); truncateTable = rep.getStepAttributeBoolean( id_step, "truncate" ); ignoreErrors = rep.getStepAttributeBoolean( id_step, "ignore_errors" ); useBatchUpdate = rep.getStepAttributeBoolean( id_step, "use_batch" ); specifyFields = rep.getStepAttributeBoolean( id_step, "specify_fields" ); partitioningEnabled = rep.getStepAttributeBoolean( id_step, "partitioning_enabled" ); partitioningField = rep.getStepAttributeString( id_step, "partitioning_field" ); partitioningDaily = rep.getStepAttributeBoolean( id_step, "partitioning_daily" ); partitioningMonthly = rep.getStepAttributeBoolean( id_step, "partitioning_monthly" ); tableNameInField = rep.getStepAttributeBoolean( id_step, "tablename_in_field" ); tableNameField = rep.getStepAttributeString( id_step, "tablename_field" ); tableNameInTable = rep.getStepAttributeBoolean( id_step, "tablename_in_table" ); returningGeneratedKeys = rep.getStepAttributeBoolean( id_step, "return_keys" ); generatedKeyField = rep.getStepAttributeString( id_step, "return_field" ); int nrCols = rep.countNrStepAttributes( id_step, "column_name" ); int nrStreams = rep.countNrStepAttributes( id_step, "stream_name" ); int nrRows = ( nrCols < nrStreams ? nrStreams : nrCols ); allocate( nrRows ); for ( int idx = 0; idx < nrRows; idx++ ) { fieldDatabase[idx] = Const.NVL( rep.getStepAttributeString( id_step, idx, "column_name" ), "" ); fieldStream[idx] = Const.NVL( rep.getStepAttributeString( id_step, idx, "stream_name" ), "" ); } } catch ( Exception e ) { throw new KettleException( "Unexpected error reading step information from the repository", e ); } }
TableOutputMeta extends BaseStepMeta implements StepMetaInterface, ProvidesModelerMeta { public void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ) throws KettleException { try { databaseMeta = rep.loadDatabaseMetaFromStepAttribute( id_step, "id_connection", databases ); schemaName = rep.getStepAttributeString( id_step, "schema" ); tableName = rep.getStepAttributeString( id_step, "table" ); commitSize = rep.getStepAttributeString( id_step, "commit" ); truncateTable = rep.getStepAttributeBoolean( id_step, "truncate" ); ignoreErrors = rep.getStepAttributeBoolean( id_step, "ignore_errors" ); useBatchUpdate = rep.getStepAttributeBoolean( id_step, "use_batch" ); specifyFields = rep.getStepAttributeBoolean( id_step, "specify_fields" ); partitioningEnabled = rep.getStepAttributeBoolean( id_step, "partitioning_enabled" ); partitioningField = rep.getStepAttributeString( id_step, "partitioning_field" ); partitioningDaily = rep.getStepAttributeBoolean( id_step, "partitioning_daily" ); partitioningMonthly = rep.getStepAttributeBoolean( id_step, "partitioning_monthly" ); tableNameInField = rep.getStepAttributeBoolean( id_step, "tablename_in_field" ); tableNameField = rep.getStepAttributeString( id_step, "tablename_field" ); tableNameInTable = rep.getStepAttributeBoolean( id_step, "tablename_in_table" ); returningGeneratedKeys = rep.getStepAttributeBoolean( id_step, "return_keys" ); generatedKeyField = rep.getStepAttributeString( id_step, "return_field" ); int nrCols = rep.countNrStepAttributes( id_step, "column_name" ); int nrStreams = rep.countNrStepAttributes( id_step, "stream_name" ); int nrRows = ( nrCols < nrStreams ? nrStreams : nrCols ); allocate( nrRows ); for ( int idx = 0; idx < nrRows; idx++ ) { fieldDatabase[idx] = Const.NVL( rep.getStepAttributeString( id_step, idx, "column_name" ), "" ); fieldStream[idx] = Const.NVL( rep.getStepAttributeString( id_step, idx, "stream_name" ), "" ); } } catch ( Exception e ) { throw new KettleException( "Unexpected error reading step information from the repository", e ); } } }
TableOutputMeta extends BaseStepMeta implements StepMetaInterface, ProvidesModelerMeta { public void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ) throws KettleException { try { databaseMeta = rep.loadDatabaseMetaFromStepAttribute( id_step, "id_connection", databases ); schemaName = rep.getStepAttributeString( id_step, "schema" ); tableName = rep.getStepAttributeString( id_step, "table" ); commitSize = rep.getStepAttributeString( id_step, "commit" ); truncateTable = rep.getStepAttributeBoolean( id_step, "truncate" ); ignoreErrors = rep.getStepAttributeBoolean( id_step, "ignore_errors" ); useBatchUpdate = rep.getStepAttributeBoolean( id_step, "use_batch" ); specifyFields = rep.getStepAttributeBoolean( id_step, "specify_fields" ); partitioningEnabled = rep.getStepAttributeBoolean( id_step, "partitioning_enabled" ); partitioningField = rep.getStepAttributeString( id_step, "partitioning_field" ); partitioningDaily = rep.getStepAttributeBoolean( id_step, "partitioning_daily" ); partitioningMonthly = rep.getStepAttributeBoolean( id_step, "partitioning_monthly" ); tableNameInField = rep.getStepAttributeBoolean( id_step, "tablename_in_field" ); tableNameField = rep.getStepAttributeString( id_step, "tablename_field" ); tableNameInTable = rep.getStepAttributeBoolean( id_step, "tablename_in_table" ); returningGeneratedKeys = rep.getStepAttributeBoolean( id_step, "return_keys" ); generatedKeyField = rep.getStepAttributeString( id_step, "return_field" ); int nrCols = rep.countNrStepAttributes( id_step, "column_name" ); int nrStreams = rep.countNrStepAttributes( id_step, "stream_name" ); int nrRows = ( nrCols < nrStreams ? nrStreams : nrCols ); allocate( nrRows ); for ( int idx = 0; idx < nrRows; idx++ ) { fieldDatabase[idx] = Const.NVL( rep.getStepAttributeString( id_step, idx, "column_name" ), "" ); fieldStream[idx] = Const.NVL( rep.getStepAttributeString( id_step, idx, "stream_name" ), "" ); } } catch ( Exception e ) { throw new KettleException( "Unexpected error reading step information from the repository", e ); } } TableOutputMeta(); }
TableOutputMeta extends BaseStepMeta implements StepMetaInterface, ProvidesModelerMeta { public void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ) throws KettleException { try { databaseMeta = rep.loadDatabaseMetaFromStepAttribute( id_step, "id_connection", databases ); schemaName = rep.getStepAttributeString( id_step, "schema" ); tableName = rep.getStepAttributeString( id_step, "table" ); commitSize = rep.getStepAttributeString( id_step, "commit" ); truncateTable = rep.getStepAttributeBoolean( id_step, "truncate" ); ignoreErrors = rep.getStepAttributeBoolean( id_step, "ignore_errors" ); useBatchUpdate = rep.getStepAttributeBoolean( id_step, "use_batch" ); specifyFields = rep.getStepAttributeBoolean( id_step, "specify_fields" ); partitioningEnabled = rep.getStepAttributeBoolean( id_step, "partitioning_enabled" ); partitioningField = rep.getStepAttributeString( id_step, "partitioning_field" ); partitioningDaily = rep.getStepAttributeBoolean( id_step, "partitioning_daily" ); partitioningMonthly = rep.getStepAttributeBoolean( id_step, "partitioning_monthly" ); tableNameInField = rep.getStepAttributeBoolean( id_step, "tablename_in_field" ); tableNameField = rep.getStepAttributeString( id_step, "tablename_field" ); tableNameInTable = rep.getStepAttributeBoolean( id_step, "tablename_in_table" ); returningGeneratedKeys = rep.getStepAttributeBoolean( id_step, "return_keys" ); generatedKeyField = rep.getStepAttributeString( id_step, "return_field" ); int nrCols = rep.countNrStepAttributes( id_step, "column_name" ); int nrStreams = rep.countNrStepAttributes( id_step, "stream_name" ); int nrRows = ( nrCols < nrStreams ? nrStreams : nrCols ); allocate( nrRows ); for ( int idx = 0; idx < nrRows; idx++ ) { fieldDatabase[idx] = Const.NVL( rep.getStepAttributeString( id_step, idx, "column_name" ), "" ); fieldStream[idx] = Const.NVL( rep.getStepAttributeString( id_step, idx, "stream_name" ), "" ); } } catch ( Exception e ) { throw new KettleException( "Unexpected error reading step information from the repository", e ); } } TableOutputMeta(); String getGeneratedKeyField(); void setGeneratedKeyField( String generatedKeyField ); boolean isReturningGeneratedKeys(); void setReturningGeneratedKeys( boolean returningGeneratedKeys ); boolean isTableNameInTable(); void setTableNameInTable( boolean tableNameInTable ); String getTableNameField(); void setTableNameField( String tableNameField ); boolean isTableNameInField(); void setTableNameInField( boolean tableNameInField ); boolean isPartitioningDaily(); void setPartitioningDaily( boolean partitioningDaily ); boolean isPartitioningMonthly(); void setPartitioningMonthly( boolean partitioningMontly ); boolean isPartitioningEnabled(); void setPartitioningEnabled( boolean partitioningEnabled ); String getPartitioningField(); void setPartitioningField( String partitioningField ); void allocate( int nrRows ); void loadXML( Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore ); Object clone(); DatabaseMeta getDatabaseMeta(); void setDatabaseMeta( DatabaseMeta database ); String getCommitSize(); void setCommitSize( int commitSizeInt ); void setCommitSize( String commitSize ); String getTableName(); void setTableName( String tableName ); @Deprecated String getTablename(); @Deprecated void setTablename( String tablename ); boolean truncateTable(); void setTruncateTable( boolean truncateTable ); void setIgnoreErrors( boolean ignoreErrors ); boolean ignoreErrors(); void setSpecifyFields( boolean specifyFields ); boolean specifyFields(); void setUseBatchUpdate( boolean useBatchUpdate ); boolean useBatchUpdate(); void setDefault(); String getXML(); void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ); void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ); void getFields( RowMetaInterface row, String origin, RowMetaInterface[] info, StepMeta nextStep,
      VariableSpace space, Repository repository, IMetaStore metaStore ); void check( List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta,
      RowMetaInterface prev, String[] input, String[] output, RowMetaInterface info, VariableSpace space,
      Repository repository, IMetaStore metaStore ); StepInterface getStep( StepMeta stepMeta, StepDataInterface stepDataInterface, int cnr,
      TransMeta transMeta, Trans trans ); StepDataInterface getStepData(); void analyseImpact( List<DatabaseImpact> impact, TransMeta transMeta, StepMeta stepMeta,
      RowMetaInterface prev, String[] input, String[] output, RowMetaInterface info, Repository repository,
      IMetaStore metaStore ); SQLStatement getSQLStatements( TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev,
      Repository repository, IMetaStore metaStore ); SQLStatement getSQLStatements( TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev, String tk,
      boolean use_autoinc, String pk ); RowMetaInterface getRequiredFields( VariableSpace space ); DatabaseMeta[] getUsedDatabaseConnections(); String[] getFieldStream(); void setFieldStream( String[] fieldStream ); @Override RowMeta getRowMeta( StepDataInterface stepData ); @Override List<String> getDatabaseFields(); @Override List<String> getStreamFields(); String[] getFieldDatabase(); void setFieldDatabase( String[] fieldDatabase ); String getSchemaName(); void setSchemaName( String schemaName ); boolean supportsErrorHandling(); @Override String getMissingDatabaseConnectionInformationMessage(); @Override TableOutputMetaInjection getStepMetaInjectionInterface(); List<StepInjectionMetaEntry> extractStepMetadataEntries(); }
TableOutputMeta extends BaseStepMeta implements StepMetaInterface, ProvidesModelerMeta { public void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ) throws KettleException { try { databaseMeta = rep.loadDatabaseMetaFromStepAttribute( id_step, "id_connection", databases ); schemaName = rep.getStepAttributeString( id_step, "schema" ); tableName = rep.getStepAttributeString( id_step, "table" ); commitSize = rep.getStepAttributeString( id_step, "commit" ); truncateTable = rep.getStepAttributeBoolean( id_step, "truncate" ); ignoreErrors = rep.getStepAttributeBoolean( id_step, "ignore_errors" ); useBatchUpdate = rep.getStepAttributeBoolean( id_step, "use_batch" ); specifyFields = rep.getStepAttributeBoolean( id_step, "specify_fields" ); partitioningEnabled = rep.getStepAttributeBoolean( id_step, "partitioning_enabled" ); partitioningField = rep.getStepAttributeString( id_step, "partitioning_field" ); partitioningDaily = rep.getStepAttributeBoolean( id_step, "partitioning_daily" ); partitioningMonthly = rep.getStepAttributeBoolean( id_step, "partitioning_monthly" ); tableNameInField = rep.getStepAttributeBoolean( id_step, "tablename_in_field" ); tableNameField = rep.getStepAttributeString( id_step, "tablename_field" ); tableNameInTable = rep.getStepAttributeBoolean( id_step, "tablename_in_table" ); returningGeneratedKeys = rep.getStepAttributeBoolean( id_step, "return_keys" ); generatedKeyField = rep.getStepAttributeString( id_step, "return_field" ); int nrCols = rep.countNrStepAttributes( id_step, "column_name" ); int nrStreams = rep.countNrStepAttributes( id_step, "stream_name" ); int nrRows = ( nrCols < nrStreams ? nrStreams : nrCols ); allocate( nrRows ); for ( int idx = 0; idx < nrRows; idx++ ) { fieldDatabase[idx] = Const.NVL( rep.getStepAttributeString( id_step, idx, "column_name" ), "" ); fieldStream[idx] = Const.NVL( rep.getStepAttributeString( id_step, idx, "stream_name" ), "" ); } } catch ( Exception e ) { throw new KettleException( "Unexpected error reading step information from the repository", e ); } } TableOutputMeta(); String getGeneratedKeyField(); void setGeneratedKeyField( String generatedKeyField ); boolean isReturningGeneratedKeys(); void setReturningGeneratedKeys( boolean returningGeneratedKeys ); boolean isTableNameInTable(); void setTableNameInTable( boolean tableNameInTable ); String getTableNameField(); void setTableNameField( String tableNameField ); boolean isTableNameInField(); void setTableNameInField( boolean tableNameInField ); boolean isPartitioningDaily(); void setPartitioningDaily( boolean partitioningDaily ); boolean isPartitioningMonthly(); void setPartitioningMonthly( boolean partitioningMontly ); boolean isPartitioningEnabled(); void setPartitioningEnabled( boolean partitioningEnabled ); String getPartitioningField(); void setPartitioningField( String partitioningField ); void allocate( int nrRows ); void loadXML( Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore ); Object clone(); DatabaseMeta getDatabaseMeta(); void setDatabaseMeta( DatabaseMeta database ); String getCommitSize(); void setCommitSize( int commitSizeInt ); void setCommitSize( String commitSize ); String getTableName(); void setTableName( String tableName ); @Deprecated String getTablename(); @Deprecated void setTablename( String tablename ); boolean truncateTable(); void setTruncateTable( boolean truncateTable ); void setIgnoreErrors( boolean ignoreErrors ); boolean ignoreErrors(); void setSpecifyFields( boolean specifyFields ); boolean specifyFields(); void setUseBatchUpdate( boolean useBatchUpdate ); boolean useBatchUpdate(); void setDefault(); String getXML(); void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ); void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ); void getFields( RowMetaInterface row, String origin, RowMetaInterface[] info, StepMeta nextStep,
      VariableSpace space, Repository repository, IMetaStore metaStore ); void check( List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta,
      RowMetaInterface prev, String[] input, String[] output, RowMetaInterface info, VariableSpace space,
      Repository repository, IMetaStore metaStore ); StepInterface getStep( StepMeta stepMeta, StepDataInterface stepDataInterface, int cnr,
      TransMeta transMeta, Trans trans ); StepDataInterface getStepData(); void analyseImpact( List<DatabaseImpact> impact, TransMeta transMeta, StepMeta stepMeta,
      RowMetaInterface prev, String[] input, String[] output, RowMetaInterface info, Repository repository,
      IMetaStore metaStore ); SQLStatement getSQLStatements( TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev,
      Repository repository, IMetaStore metaStore ); SQLStatement getSQLStatements( TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev, String tk,
      boolean use_autoinc, String pk ); RowMetaInterface getRequiredFields( VariableSpace space ); DatabaseMeta[] getUsedDatabaseConnections(); String[] getFieldStream(); void setFieldStream( String[] fieldStream ); @Override RowMeta getRowMeta( StepDataInterface stepData ); @Override List<String> getDatabaseFields(); @Override List<String> getStreamFields(); String[] getFieldDatabase(); void setFieldDatabase( String[] fieldDatabase ); String getSchemaName(); void setSchemaName( String schemaName ); boolean supportsErrorHandling(); @Override String getMissingDatabaseConnectionInformationMessage(); @Override TableOutputMetaInjection getStepMetaInjectionInterface(); List<StepInjectionMetaEntry> extractStepMetadataEntries();  }