private LongArrayValues getIndex2index(@NotNull Wire wire) throws UnrecoverableTimeoutException { LongArrayValuesHolder holder = getIndex2IndexArray(); LongArrayValues values = holder.values; if (((Byteable) values).bytesStore() != null) return values; final long indexToIndex = index2Index.getVolatileValue(); try (DocumentContext ignored = wire.readingDocument(indexToIndex)) { return array(wire, values, true); } }
@Test public void testFacarde() { IFacade f = Values.newNativeReference(IFacade.class); Byteable byteable = (Byteable) f; long capacity = byteable.maxSize(); byteable.bytesStore(NativeBytesStore.nativeStore(capacity), 0, capacity); System.out.println(f); }
if (((Byteable) index2indexArr).bytesStore() == null) { assert false; return;
@Override public void init(JLBH jlbh) { IOTools.deleteDirWithFiles("replica", 10); Byteable byteable = (Byteable) datum; long capacity = byteable.maxSize(); byteable.bytesStore(NativeBytesStore.nativeStore(capacity), 0, capacity); datumBytes = ((Byteable) datum).bytesStore(); datumWrite = datumBytes.bytesForWrite(); sourceQueue = single("replica").build(); sinkQueue = single("replica").build(); appender = sourceQueue.acquireAppender(); tailer = sinkQueue.createTailer(); this.jlbh = jlbh; }
@Override public RandomDataInput bytes() { return instance.bytesStore(); }
@Override public RandomDataInput bytes() { return instance.bytesStore(); }
@Override public T getUsing(@Nullable T using) { if (using == null) using = createInstance(); using.bytesStore(instance.bytesStore(), offset(), size()); return using; }
@NotNull @Override public final T read(@NotNull Bytes in, long size, @Nullable T using) { if (using == null) using = createInstance(); using.bytesStore(in.bytesStore(), in.readPosition(), size); return using; } }
private LongArrayValues getIndex2index(@NotNull Wire wire) throws UnrecoverableTimeoutException { LongArrayValuesHolder holder = getIndex2IndexArray(); LongArrayValues values = holder.values; if (((Byteable) values).bytesStore() != null) return values; final long indexToIndex = index2Index.getVolatileValue(); try (DocumentContext ignored = wire.readingDocument(indexToIndex)) { return array(wire, values, true); } }
private void initTransients() { nativeInstance = (Byteable) Values.newNativeReference(valueType); nativeInstanceAsCopyable = (Copyable) nativeInstance; nativeClass = (Class<? extends T>) nativeInstance.getClass(); heapClass = Values.heapClassFor(valueType); nativeInstance.bytesStore(allocateBytesStoreForInstance(), 0, nativeInstance.maxSize()); }
@NotNull @Override public T read(Bytes in, @Nullable T using) { if (using != null && using.getClass() == nativeClass) { ((Byteable) using).bytesStore(in.bytesStore(), in.readPosition(), nativeReference.maxSize()); return using; } if (using == null) using = createInstance(); nativeReference.bytesStore(in.bytesStore(), in.readPosition(), nativeReference.maxSize()); ((Copyable) using).copyFrom(nativeReference); return using; }
if (((Byteable) index2indexArr).bytesStore() == null) { assert false; return;