@SuppressWarnings("unchecked") public SourceExcerpt() { super(InProcessChronicleSource.this.chronicle.createExcerpt()); }
@SuppressWarnings("unchecked") public SinkExcerpt() { super(chronicle.createExcerpt()); }
public EventsWriter(@NotNull Chronicle chronicle) { excerpt = chronicle.createExcerpt(); }
public InProcessChronicleSink(@NotNull Chronicle chronicle, String hostname, int port) { this.chronicle = chronicle; this.address = new InetSocketAddress(hostname, port); logger = Logger.getLogger(getClass().getName() + '.' + chronicle); excerpt = chronicle.createExcerpt(); readBuffer = TcpUtil.createBuffer(256 * 1024, chronicle.byteOrder()); }
public PackedHashedTable(String basePath, int hashBucketBits, int hashCapacityBits, int maxRecordSize) throws IOException { this.basePath = basePath; this.maxRecordSize = maxRecordSize; hash = new IntIndexedChronicle(basePath + ".hash", Math.min(24, hashCapacityBits - 4)); hashRecord = new HashRecord(hash.createExcerpt(), hashBucketBits, hashCapacityBits); while (hash.size() < 1 << hashBucketBits) hashRecord.addEntry(); records = new IntIndexedChronicle(basePath + ".record", Math.min(26, hashCapacityBits - 2)); recordsExcerpt = records.createExcerpt(); }
public SocketGateway(final InetSocketAddress address, @NotNull Chronicle outbound, @NotNull Chronicle inbound, @NotNull WaitingThread waitingThread) { this.address = address; this.outbound = outbound; this.inbound = inbound; Excerpt out = outbound.createExcerpt(); out.index(out.size()); outboundReader = new GatewayEntryReader(out, true) { final ByteBuffer byteBuffer = ByteBuffer.allocateDirect(1 << 20); @Override protected void onEntry(long writeTimeNS, long writeTimeMS, long readTimeMS, int length, char type, @NotNull Excerpt excerpt) { if (type == 'X') return; byteBuffer.position(0); byteBuffer.limit(length); excerpt.read(byteBuffer); byteBuffer.flip(); try { assert socket != null; IOTools.writeAll(socket, byteBuffer); } catch (IOException e) { inboundWriter.onException("Failed to write", e); } } }; Excerpt in = inbound.createExcerpt(); in.index(in.size()); inboundWriter = new GatewayEntryWriter(in); waitingThread.add(this); }
try { long index = readIndex(socket); Excerpt excerpt = chronicle.createExcerpt(); ByteBuffer bb = TcpUtil.createBuffer(1, chronicle.byteOrder()); // minimum size long sendInSync = 0;
@Override public void run() { excerpt = chronicle.createExcerpt(); while (!closed) { boolean found = excerpt.nextIndex(); if (found) { processNextEvent(excerpt.index() <= lastEvent); } else { for (Wrapper wrapper : wrappersArray) { wrapper.notifyOff(false); wrapper.inSync(); } } } } });
ChronicleTools.deleteOnExit(basePath); final Chronicle chronicle = new IntIndexedChronicle(basePath); final Excerpt excerpt = chronicle.createExcerpt(); final int[] consolidates = new int[]{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; int repeats = 10000; int[] nbcs = new int[repeats]; int count = 0; final Excerpt excerpt2 = chronicle.createExcerpt(); while (excerpt2.nextIndex()) { final long timestamp = excerpt2.readLong();
public void start(final long lastEvent) { switch (mode) { case MASTER: excerpt = chronicle.createExcerpt(); long size = excerpt.size(); while (excerpt.index() < size && excerpt.nextIndex()) {
deleteOnExit(basePath); Excerpt record = chronicle.createExcerpt(); final int warmup = 20000; final int rows = 1000000;
final EventsReader reader2 = new EventsReader(chronicle2r.createExcerpt(), new BrokerEvents(writer3), TimingStage.EngineRead, TimingStage.SinkWrite);
@SuppressWarnings("unchecked") public SinkExcerpt() { super(chronicle.createExcerpt()); }
@SuppressWarnings("unchecked") public SourceExcerpt() { super(InProcessChronicleSource.this.chronicle.createExcerpt()); }
public InProcessChronicleSink(@NotNull Chronicle chronicle, String hostname, int port) { this.chronicle = chronicle; this.address = new InetSocketAddress(hostname, port); logger = Logger.getLogger(getClass().getName() + '.' + chronicle); excerpt = chronicle.createExcerpt(); readBuffer = TcpUtil.createBuffer(256 * 1024, chronicle.byteOrder()); }
public SocketGateway(final InetSocketAddress address, @NotNull Chronicle outbound, @NotNull Chronicle inbound, @NotNull WaitingThread waitingThread) { this.address = address; this.outbound = outbound; this.inbound = inbound; Excerpt out = outbound.createExcerpt(); out.index(out.size()); outboundReader = new GatewayEntryReader(out, true) { final ByteBuffer byteBuffer = ByteBuffer.allocateDirect(1 << 20); @Override protected void onEntry(long writeTimeNS, long writeTimeMS, long readTimeMS, int length, char type, @NotNull Excerpt excerpt) { if (type == 'X') return; byteBuffer.position(0); byteBuffer.limit(length); excerpt.read(byteBuffer); byteBuffer.flip(); try { assert socket != null; IOTools.writeAll(socket, byteBuffer); } catch (IOException e) { inboundWriter.onException("Failed to write", e); } } }; Excerpt in = inbound.createExcerpt(); in.index(in.size()); inboundWriter = new GatewayEntryWriter(in); waitingThread.add(this); }
try { long index = readIndex(socket); Excerpt excerpt = chronicle.createExcerpt(); ByteBuffer bb = TcpUtil.createBuffer(1, chronicle.byteOrder()); // minimum size long sendInSync = 0;
@Override public void run() { excerpt = chronicle.createExcerpt(); while (!closed) { boolean found = excerpt.nextIndex(); if (found) { processNextEvent(excerpt.index() <= lastEvent); } else { for (Wrapper wrapper : wrappersArray) { wrapper.notifyOff(false); wrapper.inSync(); } } } } });
public void start(final long lastEvent) { switch (mode) { case MASTER: excerpt = chronicle.createExcerpt(); long size = excerpt.size(); while (excerpt.index() < size && excerpt.nextIndex()) {
@Override public void open(@SuppressWarnings("rawtypes") Map conf, TopologyContext context, SpoutOutputCollector collector) { this.collector = collector; String basePath = TMP + "/TvRemoteClick"; ChronicleTools.deleteOnExit(basePath); try { chronicle = new IndexedChronicle(basePath); excerpt = chronicle.createExcerpt(); for (int i = 0; i < 10000; i++) { excerpt.startExcerpt(20);// three integers TvRemote click = TvRemote.createRandomRecord(); Integer channelId = click.getChannelId(); excerpt.writeInt(click.getUser()); excerpt.writeInt(channelId); excerpt.writeInt(click.getDuration()); excerpt.finish(); } // poison. excerpt.startExcerpt(20); excerpt.writeInt(123); excerpt.writeInt(0); excerpt.writeInt(0); excerpt.finish(); excerpt.toStart(); } catch (IOException e) { throw new RuntimeException(e); } }