Quantcast
Channel: Teradata Forums - All forums
Viewing all articles
Browse latest Browse all 27759

TPT - Load Operator consumes from a named pipe provided by a JNI process - response (2) by EricSantAnna

$
0
0
It's simple! My concept of pipes were wrong! You don't need to create the pipe, the TPT creates it for you. I tried to Read too, but I tried with the wrong Reader class (RandomAccessFile). My working PipeLoader constructor: private FileOutputStream pipe;   public PipeLoader() { while(true) { try { getLogger().info("Trying to connect to " + getConnectionUrl()); pipe = new FileOutputStream(getConnectionUrl()); } catch (FileNotFoundException e) { getLogger().debug(e.getMessage()); } }   try { Thread.sleep(6000); } catch (InterruptedException iExc) { iExc.printStackTrace(); } continue; }   getLogger().info(getConnectionUrl() + " conectado."); break; }  My class PipeLoader implements Runnable, and in my run() method I put all my logics and writes:   String line = ""; BufferedReader br = ... while((line = br.readLine()) != null) { pipe.write(line.getBytes()); pipe.write("\n".getBytes()); }   Obs.: I can create the pipe from Java using JNI, but maybe, I never will use this.   Is this.

Viewing all articles
Browse latest Browse all 27759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>