use of org.pentaho.metaverse.api.IMetaverseNode in project pentaho-metaverse by pentaho.
the class MongoDbInputStepAnalyzer method createOutputFieldNode.
@Override
protected IMetaverseNode createOutputFieldNode(IAnalysisContext context, ValueMetaInterface fieldMeta, String targetStepName, String nodeType) {
IMetaverseNode mongoFieldNode = super.createOutputFieldNode(context, fieldMeta, targetStepName, nodeType);
List<MongoField> mongoFields = baseStepMeta.getMongoFields();
if (mongoFields != null) {
for (MongoField mongoField : mongoFields) {
if (fieldMeta.getName().equals(mongoField.getName())) {
mongoFieldNode.setProperty(JSON_PATH, mongoField.m_fieldPath);
mongoFieldNode.setProperty(MINMAX_RANGE, mongoField.m_arrayIndexInfo);
mongoFieldNode.setProperty(OCCUR_RATIO, mongoField.m_occurenceFraction);
mongoFieldNode.setProperty(INDEXED_VALS, mongoField.m_indexedVals);
mongoFieldNode.setProperty(DISPARATE_TYPES, mongoField.m_disparateTypes);
break;
}
}
}
return mongoFieldNode;
}
use of org.pentaho.metaverse.api.IMetaverseNode in project pentaho-metaverse by pentaho.
the class RestClientStepAnalyzer method createResourceNode.
@Override
public IMetaverseNode createResourceNode(IExternalResourceInfo resource) throws MetaverseException {
MetaverseComponentDescriptor componentDescriptor = new MetaverseComponentDescriptor(resource.getName(), getResourceInputNodeType(), descriptor.getNamespace(), descriptor.getContext());
IMetaverseNode node = createNodeFromDescriptor(componentDescriptor);
return node;
}
use of org.pentaho.metaverse.api.IMetaverseNode in project pentaho-metaverse by pentaho.
the class TableInputStepAnalyzer method createTableNode.
@Override
protected IMetaverseNode createTableNode(IExternalResourceInfo resource) throws MetaverseAnalyzerException {
BaseDatabaseResourceInfo resourceInfo = (BaseDatabaseResourceInfo) resource;
Object obj = resourceInfo.getAttributes().get(DictionaryConst.PROPERTY_QUERY);
String query = obj == null ? null : obj.toString();
// create a node for the table
MetaverseComponentDescriptor componentDescriptor = new MetaverseComponentDescriptor("SQL", DictionaryConst.NODE_TYPE_SQL_QUERY, getConnectionNode(), getDescriptor().getContext());
// set the namespace to be the id of the connection node.
IMetaverseNode tableNode = createNodeFromDescriptor(componentDescriptor);
tableNode.setProperty(DictionaryConst.PROPERTY_NAMESPACE, componentDescriptor.getNamespace().getNamespaceId());
tableNode.setProperty(DictionaryConst.PROPERTY_QUERY, query);
tableNode.setLogicalIdGenerator(DictionaryConst.LOGICAL_ID_GENERATOR_DB_QUERY);
return tableNode;
}
use of org.pentaho.metaverse.api.IMetaverseNode in project pentaho-metaverse by pentaho.
the class TransExecutorStepAnalyzer method connectToSubTransOutputFields.
protected void connectToSubTransOutputFields(TransExecutorMeta meta, TransMeta subTransMeta, IMetaverseNode subTransNode, IComponentDescriptor descriptor) {
if (meta.getOutputRowsSourceStep() != null) {
String outputStep = meta.getOutputRowsSourceStep();
for (int i = 0; i < meta.getOutputRowsField().length; i++) {
String fieldName = meta.getOutputRowsField()[i];
IMetaverseNode outNode = getOutputs().findNode(outputStep, fieldName);
if (outNode != null) {
// add link, if needed, from sub tran result fields to the node just created
linkResultFieldToSubTrans(outNode, subTransMeta, subTransNode, descriptor);
}
}
}
if (meta.getExecutorsOutputStep() != null) {
String outputStep = meta.getExecutorsOutputStep();
for (int i = 0; i < meta.getOutputRowsField().length; i++) {
String fieldName = meta.getOutputRowsField()[i];
IMetaverseNode outNode = getOutputs().findNode(outputStep, fieldName);
if (outNode != null) {
// add link, if needed, from sub tran result fields to the node just created
linkResultFieldToSubTrans(outNode, subTransMeta, subTransNode, descriptor);
}
}
}
}
use of org.pentaho.metaverse.api.IMetaverseNode in project pentaho-metaverse by pentaho.
the class BlueprintsGraphMetaverseReader method findNode.
@Override
public IMetaverseNode findNode(String id) {
Vertex vertex = getGraph().getVertex(id);
if (vertex == null) {
return null;
}
MetaverseUtil.enhanceVertex(vertex);
MetaverseNode node = new MetaverseNode(vertex);
return node;
}
Aggregations