@Override public boolean hasNext() { return indexTrailer.nextIndex(); }
@Override public boolean nextIndex() { return wrappedTailer.nextIndex(); }
@Override public boolean nextIndex() { return wrappedTailer.nextIndex(); }
@Override public boolean nextIndex() { return tailer.nextIndex(); }
public void run() { while (true) { if (isRunning.get()) { if (tailer.nextIndex()) { updatable.incrMessageRead(); } } else { msleep(100); } } }
public void run() { Price p = new Price(); while (true) { if (isRunning.get()) { if (tcpTailer.nextIndex()) { p.readMarshallable(tcpTailer); updatable.incrTcpMessageRead(); } } else { msleep(100); } } }
@Override protected boolean publishData() throws IOException { if(nextIndex) { if (!tailer.nextIndex()) { pause(); if (!closed && !tailer.nextIndex()) { return false; int count = 1; while (count++ < maxMessages) { if (tailer.nextIndex()) { if (tailer.wasPadding()) { throw new AssertionError("Entry should not be padding - remove");
/** * @see com.ottogroup.bi.spqr.pipeline.queue.StreamingMessageQueueConsumer#next() */ public StreamingDataMessage next() { // check if a new message is available and read it from chronicle if possible if(queueReader.nextIndex()) { long timestamp = queueReader.readLong(); int bytes = queueReader.readInt(); byte[] body = new byte[bytes]; queueReader.read(body); queueReader.finish(); if(this.messageRetrievalCounter != null) this.messageRetrievalCounter.inc(); return new StreamingDataMessage(body, timestamp); } // otherwise return null; return null; }
int lines = Integer.parseInt(cl.getOptionValue("tail", "10")); Queue<LoggingEvent> tail = new LinkedBlockingQueue<LoggingEvent>(lines); while (ex.nextIndex()) { LoggingEvent evt = readLoggingEvent(ex, loggerContext); if (!tail.offer(evt)) { String regex = cl.getOptionValue("search"); Pattern regexPatt = Pattern.compile(regex); while (ex.nextIndex()) { LoggingEvent evt = readLoggingEvent(ex, loggerContext); if (null != evt && evt.getLevel().isGreaterOrEqual(level)) {
int lines = Integer.parseInt(cl.getOptionValue("tail", "10")); Queue<LoggingEvent> tail = new LinkedBlockingQueue<LoggingEvent>(lines); while (ex.nextIndex()) { LoggingEvent evt = readLoggingEvent(ex, loggerContext); if (!tail.offer(evt)) { String regex = cl.getOptionValue("search"); Pattern regexPatt = Pattern.compile(regex); while (ex.nextIndex()) { LoggingEvent evt = readLoggingEvent(ex, loggerContext); if (null != evt && evt.getLevel().isGreaterOrEqual(level)) {
public boolean readOne() { if (!excerpt.nextIndex()) { // System.out.println("r- " + excerpt.index()); return false; } long pos = excerpt.position(); // System.out.println("Reading " + excerpt.index()); MessageType mt = excerpt.readEnum(MessageType.class); if (mt == null) { // rewind and read again. excerpt.position(pos); System.err.println("Unknown message type " + excerpt.readUTFΔ()); return true; } switch (mt) { case report: { metaData.readFromEngine(excerpt, sourceId); report.readMarshallable(excerpt); gwEvents.report(metaData, report); break; } default: System.err.println("Unknown message type " + mt); break; } return true; } }
@Override protected boolean write(Object attached) throws IOException { if (nextIndex) { if (!tailer.nextIndex()) { pause(); if (running.get() && !tailer.nextIndex()) { return false; for (int count = builder.maxExcerptsPerMessage(); (count > 0) && tailer.nextIndex(); ) { currentIndex = tailer.index(); bytes = applyMapping(tailer, attached);
public boolean readOne() { if (!excerpt.nextIndex()) { // System.out.println("r- " + excerpt.index()); return false; } long pos = excerpt.position(); // System.out.println("r " + excerpt.index() + " " + excerpt.capacity()); MessageType mt = excerpt.readEnum(MessageType.class); if (mt == null) { // rewind and read again. excerpt.position(pos); System.err.println("Unknown message type " + excerpt.readUTFΔ()); return true; } switch (mt) { case small: { metaData.sourceId = sourceId; metaData.readFromGateway(excerpt); smallCommand.readMarshallable(excerpt); peEvents.small(metaData, smallCommand); break; } default: System.err.println("Unknown message type " + mt); break; } return true; } }
protected boolean onQuery(final SelectionKey key, long data) throws IOException { if (tailer.index(data)) { final long now = System.currentTimeMillis(); setLastHeartbeat(now); while (true) { if (tailer.nextIndex()) { sendSizeAndIndex(ChronicleTcp.SYNC_IDX_LEN, tailer.index()); tailer.finish(); break; } else { if (lastHeartbeat <= now) { sendSizeAndIndex(ChronicleTcp.IN_SYNC_LEN, ChronicleTcp.IDX_NONE); break; } } } } else { sendSizeAndIndex(ChronicleTcp.IN_SYNC_LEN, 0L); } return true; }
protected boolean handleQuery(final SelectionKey key) throws IOException { if(tailer.index(command.data())) { final long now = System.currentTimeMillis(); setLastHeartbeat(now); while (true) { if (tailer.nextIndex()) { sendSizeAndIndex(ChronicleTcp.SYNC_IDX_LEN, tailer.index()); break; } else { if (lastHeartbeat <= now) { sendSizeAndIndex(ChronicleTcp.IN_SYNC_LEN, 0L); break; } } } } else { sendSizeAndIndex(ChronicleTcp.IN_SYNC_LEN, 0L); } return true; }
while (vtail.nextIndex()) { MessageKey key = (MessageKey) vtail.readObject(); System.out.println("key " + key);