Exemple #1
0
  public void dispose(StepMetaInterface smi, StepDataInterface sdi) {
    if (log.isBasic()) logBasic("Finished reading query, closing connection.");

    data.mondrianHelper.close();

    super.dispose(smi, sdi);
  }
 /**
  * returns the OutputWiter if exists. Otherwhise it will create a new one.
  *
  * @return
  * @throws KettleException
  */
 Writer getWriter(Object source) throws KettleException {
   try {
     Writer outputStreamWriter = (Writer) writers.get(source);
     if (outputStreamWriter != null) return outputStreamWriter;
     FileObject file =
         getReplayFilename(
             destinationDirectory, processingFilename, dateString, fileExtension, source);
     ResultFile resultFile =
         new ResultFile(
             ResultFile.FILE_TYPE_GENERAL,
             file,
             baseStep.getTransMeta().getName(),
             baseStep.getStepname());
     baseStep.addResultFile(resultFile);
     try {
       if (encoding == null) {
         outputStreamWriter = new OutputStreamWriter(KettleVFS.getOutputStream(file, false));
       } else {
         outputStreamWriter =
             new OutputStreamWriter(KettleVFS.getOutputStream(file, false), encoding);
       }
     } catch (Exception e) {
       throw new KettleException(
           Messages.getString(
                   "AbstractFileErrorHandler.Exception.CouldNotCreateFileErrorHandlerForFile") //$NON-NLS-1$
               + file.getName().getURI(),
           e);
     }
     writers.put(source, outputStreamWriter);
     return outputStreamWriter;
   } catch (IOException e) {
     throw new KettleException(
         Messages.getString(
             "AbstractFileErrorHandler.Exception.CouldNotCreateFileErrorHandlerForFile"),
         e);
   }
 }
Exemple #3
0
 //
 // Run is were the action happens!
 public void run() {
   BaseStep.runStepThread(this, meta, data);
 }