Package com.cloudera.cdk.morphline.api

Examples of com.cloudera.cdk.morphline.api.MorphlineRuntimeException


  @Override
  protected final boolean doProcess(Record inputRecord, InputStream stream) throws IOException {
    try {
      return doProcess2(inputRecord, stream);
    } catch (SaxonApiException e) {
      throw new MorphlineRuntimeException(e);
    } catch (XMLStreamException e) {
      throw new MorphlineRuntimeException(e);
    }
  }
View Full Code Here


    @Override
    protected boolean doProcess(Record inputRecord, InputStream stream) throws IOException {
      try {
        return doProcess2(inputRecord, stream);
      } catch (SAXNotRecognizedException e) {
        throw new MorphlineRuntimeException(e);
      } catch (SAXNotSupportedException e) {
        throw new MorphlineRuntimeException(e);
      } catch (SAXException e) {
        throw new MorphlineRuntimeException(e);
      }
    }
View Full Code Here

        CloudSolrServer cloudSolrServer = new CloudSolrServer(zkHost);
        cloudSolrServer.setDefaultCollection(collectionName);
        cloudSolrServer.connect();
        return new SolrServerDocumentLoader(cloudSolrServer, batchSize);
      } catch (MalformedURLException e) {
        throw new MorphlineRuntimeException(e);
      }
    } else {
      if (solrUrl == null || solrUrl.length() == 0) {
        throw new MorphlineCompilationException("Missing parameter 'solrUrl'", config);
      }
View Full Code Here

     
      IndexSchema schema = new IndexSchema(solrConfig, "schema.xml", is);
      validateSchema(schema);
      return schema;
    } catch (ParserConfigurationException e) {
      throw new MorphlineRuntimeException(e);
    } catch (IOException e) {
      throw new MorphlineRuntimeException(e);
    } catch (SAXException e) {
      throw new MorphlineRuntimeException(e);
    }
  }
View Full Code Here

    @Override
    protected boolean doProcess(Record record) {
      try {
        return script.evaluate(record, getConfig(), this, getChild(), getContext(), LOG);
      } catch (ScriptException e) {
        throw new MorphlineRuntimeException("Cannot execute script", e);
      }
    } 
View Full Code Here

          }
          tokenStream.end();
          tokenStream.close();
        }
      } catch (IOException e) {
        throw new MorphlineRuntimeException(e);
      }
     
      // pass record to next command in chain:
      return super.doProcess(record);
    }
View Full Code Here

      if (uniqueKeyName == null || (preserveExisting && doc.getFields().containsKey(uniqueKeyName))) {
        ; // we must preserve the existing id
      } else {
        Object baseId = doc.getFirstValue(baseIdFieldName);
        if (baseId == null) {
          throw new MorphlineRuntimeException("Record field " + baseIdFieldName
              + " must not be null as it is needed as a basis for a unique key for solr doc: " + doc);
        }
        doc.replaceValues(uniqueKeyName, baseId.toString() + "#" + num);         
      }
     
View Full Code Here

      }
      case NULL: {
        break;
      }
      default:
        throw new MorphlineRuntimeException("Unknown Avro schema type: " + schema.getType());
      }
    }
View Full Code Here

      }
      case NULL: {
        break;
      }
      default:
        throw new MorphlineRuntimeException("Unknown Avro schema type: " + schema.getType());
      }
    }
View Full Code Here

      CompressorInputStream cis;
      try {
        CompressorStreamFactory factory = new CompressorStreamFactory();
        cis = factory.createCompressorInputStream(stream);
      } catch (CompressorException e) {
        throw new MorphlineRuntimeException("Unable to uncompress document stream", e);
      }

      try {
        return extractor.parseEmbedded(cis, record, name, getChild());
      } finally {
View Full Code Here

TOP

Related Classes of com.cloudera.cdk.morphline.api.MorphlineRuntimeException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.