@Override public void readMarshallable(@NotNull WireIn wire) throws IORuntimeException { ValueIn valueIn = wire.getValueIn(); for (int i = 0; i < NUMBER_OF_LONGS; i++) assertEquals(i, valueIn.int64()); //Jvm.pause(PAUSE_READ_MS); }
appender.writeDocument(writer -> writer.getValueOut().text(tmpText)); tailer.readDocument(reader -> reader.getValueIn().textTo(tmpReadback)); String actual = tmpReadback.toString(); Assert.assertEquals(problematic[p].length(), actual.length());
private boolean nextItemFromQueue(ExcerptTailer tailer,DataItemProcessor dim) { return !tailer.readDocument(w -> { ValueIn in = w.getValueIn(); dim.process(in, null); }); }
private boolean nextItemFromQueue(ExcerptTailer tailer, PlayOptions options, DataItemProcessor dim) { return !tailer.readDocument(w -> { ValueIn in = w.getValueIn(); dim.process(in, options.using()); }); } }
private void readMarshallable(String path, @NotNull WireIn wire) { @NotNull StringBuilder name = new StringBuilder(); while (!wire.isEmpty()) { @NotNull ValueIn in = wire.read(name); long pos = wire.bytes().readPosition(); @NotNull String path2 = path + "/" + name; if (wire.getValueIn().isTyped()) { wire.bytes().readPosition(pos); @Nullable Object o = in.typedMarshallable(); installableMap.put(path2, (Installable) o); } else { in.marshallable(w -> this.readMarshallable(path2, w)); } } }
private static void writeQueueToFile(ExcerptTailer tailer, String fileName, boolean toStdout, ZoneId zoneId) throws IOException { FileWriter fileWriter = new FileWriter(fileName); tailer.toStart(); DataItemProcessor dim = new DataItemProcessor(); while(tailer.readDocument( w -> { ValueIn in = w.getValueIn(); dim.process(in,null); String time = null; if(zoneId != null) { LocalDateTime dateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(dim.getTime()), zoneId); time = dateTime.toString(); }else{ time = String.valueOf(dim.getTime()); } try { String item = ReactiveStatus.toString(dim.getStatus()) + "\t" + dim.getMessageCount() + "\t" + time + "\t" + dim.getFilter() + "\t" + dim.getObject(); fileWriter.write(item + "\n"); if(toStdout) { LOG.info(item); } } catch (IOException e) { LOG.error("Problem writing to file[" + fileName + "]", e); } })); fileWriter.close(); } }