use of org.pentaho.di.core.row.value.ValueMetaInteger in project pentaho-kettle by pentaho.
the class KettleDatabaseRepositoryClusterSchemaDelegate method updateCluster.
public synchronized void updateCluster(ClusterSchema clusterSchema) throws KettleException {
RowMetaAndData table = new RowMetaAndData();
table.addValue(new ValueMetaInteger(KettleDatabaseRepository.FIELD_CLUSTER_ID_CLUSTER), clusterSchema.getObjectId());
table.addValue(new ValueMetaString(KettleDatabaseRepository.FIELD_CLUSTER_NAME), clusterSchema.getName());
table.addValue(new ValueMetaString(KettleDatabaseRepository.FIELD_CLUSTER_BASE_PORT), clusterSchema.getBasePort());
table.addValue(new ValueMetaString(KettleDatabaseRepository.FIELD_CLUSTER_SOCKETS_BUFFER_SIZE), clusterSchema.getSocketsBufferSize());
table.addValue(new ValueMetaString(KettleDatabaseRepository.FIELD_CLUSTER_SOCKETS_FLUSH_INTERVAL), clusterSchema.getSocketsFlushInterval());
table.addValue(new ValueMetaBoolean(KettleDatabaseRepository.FIELD_CLUSTER_SOCKETS_COMPRESSED), Boolean.valueOf(clusterSchema.isSocketsCompressed()));
table.addValue(new ValueMetaBoolean(KettleDatabaseRepository.FIELD_CLUSTER_DYNAMIC), Boolean.valueOf(clusterSchema.isDynamic()));
repository.connectionDelegate.updateTableRow(KettleDatabaseRepository.TABLE_R_CLUSTER, KettleDatabaseRepository.FIELD_CLUSTER_ID_CLUSTER, table, clusterSchema.getObjectId());
}
use of org.pentaho.di.core.row.value.ValueMetaInteger in project pentaho-kettle by pentaho.
the class KettleDatabaseRepository method insertJobNote.
public synchronized void insertJobNote(ObjectId id_job, ObjectId id_note) throws KettleException {
RowMetaAndData table = new RowMetaAndData();
table.addValue(new ValueMetaInteger(KettleDatabaseRepository.FIELD_JOB_NOTE_ID_JOB), id_job);
table.addValue(new ValueMetaInteger(KettleDatabaseRepository.FIELD_JOB_NOTE_ID_NOTE), id_note);
connectionDelegate.insertTableRow(KettleDatabaseRepository.TABLE_R_JOB_NOTE, table);
}
use of org.pentaho.di.core.row.value.ValueMetaInteger in project pentaho-kettle by pentaho.
the class TextFileInputMeta method getFields.
@Override
public void getFields(RowMetaInterface row, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space, Repository repository, IMetaStore metaStore) throws KettleStepException {
if (!inputFiles.passingThruFields) {
// all incoming fields are not transmitted !
row.clear();
} else {
if (info != null) {
boolean found = false;
for (int i = 0; i < info.length && !found; i++) {
if (info[i] != null) {
row.mergeRowMeta(info[i], name);
found = true;
}
}
}
}
for (int i = 0; i < inputFields.length; i++) {
BaseFileField field = inputFields[i];
int type = field.getType();
if (type == ValueMetaInterface.TYPE_NONE) {
type = ValueMetaInterface.TYPE_STRING;
}
try {
ValueMetaInterface v = ValueMetaFactory.createValueMeta(field.getName(), type);
v.setLength(field.getLength());
v.setPrecision(field.getPrecision());
v.setOrigin(name);
v.setConversionMask(field.getFormat());
v.setDecimalSymbol(field.getDecimalSymbol());
v.setGroupingSymbol(field.getGroupSymbol());
v.setCurrencySymbol(field.getCurrencySymbol());
v.setDateFormatLenient(content.dateFormatLenient);
v.setDateFormatLocale(content.dateFormatLocale);
v.setTrimType(field.getTrimType());
row.addValueMeta(v);
} catch (Exception e) {
throw new KettleStepException(e);
}
}
if (errorHandling.errorIgnored) {
if (errorCountField != null && errorCountField.length() > 0) {
ValueMetaInterface v = new ValueMetaInteger(errorCountField);
v.setLength(ValueMetaInterface.DEFAULT_INTEGER_LENGTH, 0);
v.setOrigin(name);
row.addValueMeta(v);
}
if (errorFieldsField != null && errorFieldsField.length() > 0) {
ValueMetaInterface v = new ValueMetaString(errorFieldsField);
v.setOrigin(name);
row.addValueMeta(v);
}
if (errorTextField != null && errorTextField.length() > 0) {
ValueMetaInterface v = new ValueMetaString(errorTextField);
v.setOrigin(name);
row.addValueMeta(v);
}
}
if (content.includeFilename) {
ValueMetaInterface v = new ValueMetaString(content.filenameField);
v.setLength(100);
v.setOrigin(name);
row.addValueMeta(v);
}
if (content.includeRowNumber) {
ValueMetaInterface v = new ValueMetaInteger(content.rowNumberField);
v.setLength(ValueMetaInterface.DEFAULT_INTEGER_LENGTH, 0);
v.setOrigin(name);
row.addValueMeta(v);
}
if (StringUtils.isNotBlank(additionalOutputFields.shortFilenameField)) {
ValueMetaInterface v = new ValueMetaString(space.environmentSubstitute(additionalOutputFields.shortFilenameField));
v.setLength(100, -1);
v.setOrigin(name);
row.addValueMeta(v);
}
if (StringUtils.isNotBlank(additionalOutputFields.extensionField)) {
ValueMetaInterface v = new ValueMetaString(space.environmentSubstitute(additionalOutputFields.extensionField));
v.setLength(100, -1);
v.setOrigin(name);
row.addValueMeta(v);
}
if (StringUtils.isNotBlank(additionalOutputFields.pathField)) {
ValueMetaInterface v = new ValueMetaString(space.environmentSubstitute(additionalOutputFields.pathField));
v.setLength(100, -1);
v.setOrigin(name);
row.addValueMeta(v);
}
if (StringUtils.isNotBlank(additionalOutputFields.sizeField)) {
ValueMetaInterface v = new ValueMetaString(space.environmentSubstitute(additionalOutputFields.sizeField));
v.setOrigin(name);
v.setLength(9);
row.addValueMeta(v);
}
if (StringUtils.isNotBlank(additionalOutputFields.hiddenField)) {
ValueMetaInterface v = new ValueMetaBoolean(space.environmentSubstitute(additionalOutputFields.hiddenField));
v.setOrigin(name);
row.addValueMeta(v);
}
if (StringUtils.isNotBlank(additionalOutputFields.lastModificationField)) {
ValueMetaInterface v = new ValueMetaDate(space.environmentSubstitute(additionalOutputFields.lastModificationField));
v.setOrigin(name);
row.addValueMeta(v);
}
if (StringUtils.isNotBlank(additionalOutputFields.uriField)) {
ValueMetaInterface v = new ValueMetaString(space.environmentSubstitute(additionalOutputFields.uriField));
v.setLength(100, -1);
v.setOrigin(name);
row.addValueMeta(v);
}
if (StringUtils.isNotBlank(additionalOutputFields.rootUriField)) {
ValueMetaInterface v = new ValueMetaString(additionalOutputFields.rootUriField);
v.setLength(100, -1);
v.setOrigin(name);
row.addValueMeta(v);
}
}
use of org.pentaho.di.core.row.value.ValueMetaInteger in project pentaho-kettle by pentaho.
the class FuzzyMatchMeta method getFields.
public void getFields(RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space, Repository repository, IMetaStore metaStore) throws KettleStepException {
// Add match field
ValueMetaInterface v = new ValueMetaString(space.environmentSubstitute(getOutputMatchField()));
v.setOrigin(name);
v.setStorageType(ValueMetaInterface.STORAGE_TYPE_NORMAL);
inputRowMeta.addValueMeta(v);
String mainField = space.environmentSubstitute(getOutputValueField());
if (!Utils.isEmpty(mainField) && isGetCloserValue()) {
switch(getAlgorithmType()) {
case FuzzyMatchMeta.OPERATION_TYPE_DAMERAU_LEVENSHTEIN:
case FuzzyMatchMeta.OPERATION_TYPE_LEVENSHTEIN:
v = new ValueMetaInteger(mainField);
v.setLength(ValueMetaInterface.DEFAULT_INTEGER_LENGTH);
break;
case FuzzyMatchMeta.OPERATION_TYPE_JARO:
case FuzzyMatchMeta.OPERATION_TYPE_JARO_WINKLER:
case FuzzyMatchMeta.OPERATION_TYPE_PAIR_SIMILARITY:
v = new ValueMetaNumber(mainField);
break;
default:
// Phonetic algorithms
v = new ValueMetaString(mainField);
break;
}
v.setStorageType(ValueMetaInterface.STORAGE_TYPE_NORMAL);
v.setOrigin(name);
inputRowMeta.addValueMeta(v);
}
boolean activateAdditionalFields = isGetCloserValue() || (getAlgorithmType() == FuzzyMatchMeta.OPERATION_TYPE_DOUBLE_METAPHONE) || (getAlgorithmType() == FuzzyMatchMeta.OPERATION_TYPE_SOUNDEX) || (getAlgorithmType() == FuzzyMatchMeta.OPERATION_TYPE_REFINED_SOUNDEX) || (getAlgorithmType() == FuzzyMatchMeta.OPERATION_TYPE_METAPHONE);
if (activateAdditionalFields) {
if (info != null && info.length == 1 && info[0] != null) {
for (int i = 0; i < valueName.length; i++) {
v = info[0].searchValueMeta(value[i]);
if (v != null) {
// Configuration error/missing resources...
v.setName(valueName[i]);
v.setOrigin(name);
// Only normal storage goes into the cache
v.setStorageType(ValueMetaInterface.STORAGE_TYPE_NORMAL);
inputRowMeta.addValueMeta(v);
} else {
throw new KettleStepException(BaseMessages.getString(PKG, "FuzzyMatchMeta.Exception.ReturnValueCanNotBeFound", value[i]));
}
}
} else {
for (int i = 0; i < valueName.length; i++) {
v = new ValueMetaString(valueName[i]);
v.setOrigin(name);
inputRowMeta.addValueMeta(v);
}
}
}
}
use of org.pentaho.di.core.row.value.ValueMetaInteger in project pentaho-kettle by pentaho.
the class GetSlaveSequenceMeta method getFields.
@Override
public void getFields(RowMetaInterface row, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space, Repository repository, IMetaStore metaStore) throws KettleStepException {
ValueMetaInterface v = new ValueMetaInteger(valuename);
v.setOrigin(name);
row.addValueMeta(v);
}
Aggregations