Search in sources :

Example 11 with MetaverseException

use of org.pentaho.metaverse.api.MetaverseException in project pentaho-metaverse by pentaho.

the class ExternalResourceStepAnalyzer method customAnalyze.

@Override
protected void customAnalyze(T meta, IMetaverseNode node) throws MetaverseAnalyzerException {
    // handle all of the external resources
    if (getExternalResourceConsumer() != null) {
        IAnalysisContext context = getDescriptor().getContext();
        Collection<IExternalResourceInfo> resources = getExternalResourceConsumer().getResources(meta, context);
        for (IExternalResourceInfo resource : resources) {
            try {
                if (resource.isInput()) {
                    String label = DictionaryConst.LINK_READBY;
                    IMetaverseNode resourceNode = createResourceNode(resource);
                    getMetaverseBuilder().addNode(resourceNode);
                    getMetaverseBuilder().addLink(resourceNode, label, node);
                }
                if (resource.isOutput()) {
                    String label = DictionaryConst.LINK_WRITESTO;
                    IMetaverseNode resourceNode = createResourceNode(resource);
                    getMetaverseBuilder().addNode(resourceNode);
                    getMetaverseBuilder().addLink(node, label, resourceNode);
                }
            } catch (MetaverseException e) {
                LOGGER.warn(e.getLocalizedMessage());
                LOGGER.debug(Messages.getString("ERROR.ErrorDuringAnalysisStackTrace"), e);
            }
        }
    }
}
Also used : IExternalResourceInfo(org.pentaho.metaverse.api.model.IExternalResourceInfo) IMetaverseNode(org.pentaho.metaverse.api.IMetaverseNode) IAnalysisContext(org.pentaho.metaverse.api.IAnalysisContext) MetaverseException(org.pentaho.metaverse.api.MetaverseException)

Aggregations

MetaverseException (org.pentaho.metaverse.api.MetaverseException)11 Graph (com.tinkerpop.blueprints.Graph)4 IMetaverseBuilder (org.pentaho.metaverse.api.IMetaverseBuilder)4 IMetaverseNode (org.pentaho.metaverse.api.IMetaverseNode)4 TransMeta (org.pentaho.di.trans.TransMeta)3 IDocument (org.pentaho.metaverse.api.IDocument)3 INamespace (org.pentaho.metaverse.api.INamespace)3 Namespace (org.pentaho.metaverse.api.Namespace)3 Vertex (com.tinkerpop.blueprints.Vertex)2 TinkerGraph (com.tinkerpop.blueprints.impls.tg.TinkerGraph)2 GremlinPipeline (com.tinkerpop.gremlin.java.GremlinPipeline)2 File (java.io.File)2 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 HashSet (java.util.HashSet)2 List (java.util.List)2 Set (java.util.Set)2 KettleException (org.pentaho.di.core.exception.KettleException)2 AnalysisContext (org.pentaho.metaverse.api.AnalysisContext)2 IExecutionProfile (org.pentaho.metaverse.api.model.IExecutionProfile)2