Search in sources :

Example 76 with RowMetaAndData

use of org.pentaho.di.core.RowMetaAndData in project pentaho-kettle by pentaho.

the class KettleDatabaseRepositoryMetaStoreDelegate method updateElementType.

public ObjectId updateElementType(ObjectId namespaceId, ObjectId elementTypeId, IMetaStoreElementType type) throws KettleException {
    RowMetaAndData table = new RowMetaAndData();
    table.addValue(new ValueMetaInteger(KettleDatabaseRepository.FIELD_ELEMENT_TYPE_ID_ELEMENT_TYPE), elementTypeId);
    table.addValue(new ValueMetaInteger(KettleDatabaseRepository.FIELD_ELEMENT_TYPE_ID_NAMESPACE), namespaceId);
    table.addValue(new ValueMetaString(KettleDatabaseRepository.FIELD_ELEMENT_TYPE_NAME), type.getName());
    table.addValue(new ValueMetaString(KettleDatabaseRepository.FIELD_ELEMENT_TYPE_DESCRIPTION), type.getDescription());
    repository.connectionDelegate.updateTableRow(KettleDatabaseRepository.TABLE_R_ELEMENT_TYPE, KettleDatabaseRepository.FIELD_ELEMENT_TYPE_ID_ELEMENT_TYPE, table);
    if (log.isDebug()) {
        log.logDebug("Updated element type [" + type.getName() + "]");
    }
    return elementTypeId;
}
Also used : ValueMetaString(org.pentaho.di.core.row.value.ValueMetaString) RowMetaAndData(org.pentaho.di.core.RowMetaAndData) ValueMetaInteger(org.pentaho.di.core.row.value.ValueMetaInteger)

Example 77 with RowMetaAndData

use of org.pentaho.di.core.RowMetaAndData in project pentaho-kettle by pentaho.

the class KettleDatabaseRepositoryMetaStoreDelegate method addAttributes.

private void addAttributes(IMetaStoreAttribute parentAttribute, ObjectId elementId, LongObjectId parentAttributeId) throws KettleException {
    Collection<RowMetaAndData> attributeRows = getElementAttributes(elementId, parentAttributeId);
    for (RowMetaAndData attributeRow : attributeRows) {
        KDBRMetaStoreAttribute attribute = parseAttribute(elementId, attributeRow);
        parentAttribute.addChild(attribute);
        // See if this attribute has children...
        addAttributes(attribute, elementId, attribute.getObjectId());
    }
}
Also used : RowMetaAndData(org.pentaho.di.core.RowMetaAndData) KDBRMetaStoreAttribute(org.pentaho.di.repository.kdr.delegates.metastore.KDBRMetaStoreAttribute)

Example 78 with RowMetaAndData

use of org.pentaho.di.core.RowMetaAndData in project pentaho-kettle by pentaho.

the class KettleDatabaseRepository method insertStepDatabase.

public synchronized void insertStepDatabase(ObjectId id_transformation, ObjectId id_step, ObjectId id_database) throws KettleException {
    // First check if the relationship is already there.
    // There is no need to store it twice!
    RowMetaAndData check = getStepDatabase(id_step);
    if (check.getInteger(0) == null) {
        RowMetaAndData table = new RowMetaAndData();
        table.addValue(new ValueMetaInteger(KettleDatabaseRepository.FIELD_STEP_DATABASE_ID_TRANSFORMATION), id_transformation);
        table.addValue(new ValueMetaInteger(KettleDatabaseRepository.FIELD_STEP_DATABASE_ID_STEP), id_step);
        table.addValue(new ValueMetaInteger(KettleDatabaseRepository.FIELD_STEP_DATABASE_ID_DATABASE), id_database);
        connectionDelegate.insertTableRow(KettleDatabaseRepository.TABLE_R_STEP_DATABASE, table);
    }
}
Also used : RowMetaAndData(org.pentaho.di.core.RowMetaAndData) ValueMetaInteger(org.pentaho.di.core.row.value.ValueMetaInteger)

Example 79 with RowMetaAndData

use of org.pentaho.di.core.RowMetaAndData in project pentaho-kettle by pentaho.

the class KettleDatabaseRepository method insertClusterSlave.

public synchronized ObjectId insertClusterSlave(ClusterSchema clusterSchema, SlaveServer slaveServer) throws KettleException {
    ObjectId id = connectionDelegate.getNextClusterSlaveID();
    RowMetaAndData table = new RowMetaAndData();
    table.addValue(new ValueMetaInteger(KettleDatabaseRepository.FIELD_CLUSTER_SLAVE_ID_CLUSTER_SLAVE), id);
    table.addValue(new ValueMetaInteger(KettleDatabaseRepository.FIELD_CLUSTER_SLAVE_ID_CLUSTER), clusterSchema.getObjectId());
    table.addValue(new ValueMetaInteger(KettleDatabaseRepository.FIELD_CLUSTER_SLAVE_ID_SLAVE), slaveServer.getObjectId());
    connectionDelegate.insertTableRow(KettleDatabaseRepository.TABLE_R_CLUSTER_SLAVE, table);
    return id;
}
Also used : RowMetaAndData(org.pentaho.di.core.RowMetaAndData) LongObjectId(org.pentaho.di.repository.LongObjectId) ObjectId(org.pentaho.di.repository.ObjectId) ValueMetaInteger(org.pentaho.di.core.row.value.ValueMetaInteger)

Example 80 with RowMetaAndData

use of org.pentaho.di.core.RowMetaAndData in project pentaho-kettle by pentaho.

the class KettleDatabaseRepository method insertJobEntryDatabase.

public synchronized void insertJobEntryDatabase(ObjectId id_job, ObjectId id_jobentry, ObjectId id_database) throws KettleException {
    // First check if the relationship is already there.
    // There is no need to store it twice!
    RowMetaAndData check = getJobEntryDatabase(id_jobentry);
    if (check.getInteger(0) == null) {
        RowMetaAndData table = new RowMetaAndData();
        table.addValue(new ValueMetaInteger(KettleDatabaseRepository.FIELD_JOBENTRY_DATABASE_ID_JOB), id_job);
        table.addValue(new ValueMetaInteger(KettleDatabaseRepository.FIELD_JOBENTRY_DATABASE_ID_JOBENTRY), id_jobentry);
        table.addValue(new ValueMetaInteger(KettleDatabaseRepository.FIELD_JOBENTRY_DATABASE_ID_DATABASE), id_database);
        connectionDelegate.insertTableRow(KettleDatabaseRepository.TABLE_R_JOBENTRY_DATABASE, table);
    }
}
Also used : RowMetaAndData(org.pentaho.di.core.RowMetaAndData) ValueMetaInteger(org.pentaho.di.core.row.value.ValueMetaInteger)

Aggregations

RowMetaAndData (org.pentaho.di.core.RowMetaAndData)563 ValueMetaString (org.pentaho.di.core.row.value.ValueMetaString)225 ArrayList (java.util.ArrayList)172 RowMetaInterface (org.pentaho.di.core.row.RowMetaInterface)145 TransMeta (org.pentaho.di.trans.TransMeta)116 Test (org.junit.Test)108 ValueMetaInteger (org.pentaho.di.core.row.value.ValueMetaInteger)94 KettleException (org.pentaho.di.core.exception.KettleException)89 StepMeta (org.pentaho.di.trans.step.StepMeta)80 LongObjectId (org.pentaho.di.repository.LongObjectId)75 StepInterface (org.pentaho.di.trans.step.StepInterface)75 RowStepCollector (org.pentaho.di.trans.RowStepCollector)73 Trans (org.pentaho.di.trans.Trans)73 PluginRegistry (org.pentaho.di.core.plugins.PluginRegistry)71 TransHopMeta (org.pentaho.di.trans.TransHopMeta)71 KettleValueException (org.pentaho.di.core.exception.KettleValueException)58 RowProducer (org.pentaho.di.trans.RowProducer)56 DummyTransMeta (org.pentaho.di.trans.steps.dummytrans.DummyTransMeta)54 KettleDatabaseException (org.pentaho.di.core.exception.KettleDatabaseException)53 RowMeta (org.pentaho.di.core.row.RowMeta)51