public static File writeTapeToFileUsingPipe(Pipe<RawDataSchema> inputPipe, byte[] testData) throws IOException, FileNotFoundException { GraphManager gm = new GraphManager(); File f2 = File.createTempFile("fileTapeWriteTest", "dat"); f2.deleteOnExit(); new ByteArrayProducerStage(gm, testData, inputPipe); new TapeWriteStage(gm, inputPipe, new RandomAccessFile(f2,"rw")); GraphManager.enableBatching(gm); ThreadPerStageScheduler scheduler = new ThreadPerStageScheduler(gm); scheduler.startup(); scheduler.awaitTermination(3, TimeUnit.SECONDS); return f2; }
PronghornStage s2 = new TapeWriteStage(gm, loadedDataPipe, new RandomAccessFile(tempFile,"rw")); //NOTE: use rwd/rws to sync flush with every write (much slower) GraphManager.enableBatching(gm);//lower contention over head and tail
PronghornStage s2 = new FileBlobWriteStage(gm, loadedDataPipe, append, tempFile.getAbsolutePath()); //NOTE: use rwd/rws to sync flush with every write (much slower) GraphManager.enableBatching(gm);//lower contention over head and tail
ConsoleSummaryStage dump = new ConsoleSummaryStage(gm, pipe, out ); GraphManager.enableBatching(gm);
FileBlobWriteStage lastStage = new FileBlobWriteStage(gm, inputPipe, append, f2.getAbsolutePath()); //TODO: need a FileBlobRead that can tail a file GraphManager.enableBatching(gm);
GraphManager.enableBatching(gm);//lower contention over head and tail
new ToOutputStreamStage(gm, loadedDataPipe, outputStream, false); GraphManager.enableBatching(gm);//lower contention over head and tail
GraphManager.enableBatching(gm);
GraphManager.enableBatching(gm); ThreadPerStageScheduler scheduler = new ThreadPerStageScheduler(GraphManager.cloneAll(gm)); scheduler.playNice = true;