Search in sources :

Example 11 with RowBuffer

use of org.apache.hop.core.row.RowBuffer in project hop by apache.

the class RemotePipelineEngine method retrieveComponentOutput.

@Override
public void retrieveComponentOutput(IVariables variables, String componentName, int copyNr, int nrRows, IPipelineComponentRowsReceived rowsReceived) throws HopException {
    try {
        Runnable runnable = () -> {
            try {
                String rowBufferXml = hopServer.sniffTransform(this, subject.getName(), componentName, containerId, "" + copyNr, nrRows, SniffTransformServlet.TYPE_OUTPUT);
                Node rowBufferNode = XmlHandler.getSubNode(XmlHandler.loadXmlString(rowBufferXml), RowBuffer.XML_TAG);
                if (rowBufferNode != null) {
                    RowBuffer rowBuffer = new RowBuffer(rowBufferNode);
                    rowsReceived.rowsReceived(RemotePipelineEngine.this, rowBuffer);
                }
            } catch (Exception e) {
                throw new RuntimeException("Unable to get output rows from transform '" + componentName + "' in pipeline '" + subject.getName() + "' on server '" + hopServer.getName(), e);
            }
        };
        new Thread(runnable).start();
    } catch (Exception e) {
        throw new HopException(e);
    }
}
Also used : HopException(org.apache.hop.core.exception.HopException) Node(org.w3c.dom.Node) RowBuffer(org.apache.hop.core.row.RowBuffer) HopException(org.apache.hop.core.exception.HopException)

Aggregations

RowBuffer (org.apache.hop.core.row.RowBuffer)11 FileObject (org.apache.commons.vfs2.FileObject)4 HopException (org.apache.hop.core.exception.HopException)4 HopTransformException (org.apache.hop.core.exception.HopTransformException)4 HopExtensionPoint (org.apache.hop.core.extension.HopExtensionPoint)4 IRowMeta (org.apache.hop.core.row.IRowMeta)4 InvocationTargetException (java.lang.reflect.InvocationTargetException)3 HopValueException (org.apache.hop.core.exception.HopValueException)3 IEngineComponent (org.apache.hop.pipeline.engine.IEngineComponent)3 AreaType (org.apache.hop.core.gui.AreaOwner.AreaType)2 PluginRegistry (org.apache.hop.core.plugins.PluginRegistry)2 IValueMeta (org.apache.hop.core.row.IValueMeta)2 LocalPipelineRunConfiguration (org.apache.hop.pipeline.engines.local.LocalPipelineRunConfiguration)2 SampleType (org.apache.hop.pipeline.engines.local.LocalPipelineRunConfiguration.SampleType)2 IOException (java.io.IOException)1 OutputStream (java.io.OutputStream)1 PrintWriter (java.io.PrintWriter)1 java.util (java.util)1 List (java.util.List)1 ServletException (javax.servlet.ServletException)1