use of cz.o2.proxima.storage.internal.AbstractDataAccessorFactory.Accept in project proxima-platform by O2-Czech-Republic.
the class RemoteConsumer method accept.
@Override
public void accept(T what) {
try {
Item item = Item.newBuilder().setSerialized(ByteString.readFrom(serialize(what))).build();
observer().onNext(item);
} catch (IOException ex) {
throw new RuntimeException(ex);
}
}
use of cz.o2.proxima.storage.internal.AbstractDataAccessorFactory.Accept in project proxima-platform by O2-Czech-Republic.
the class ConsoleRandomReader method list.
public void list(String key, String prefix, @Nullable String offset, int limit, Consumer<KeyValue<?>> consumer) {
AttributeDescriptor<?> desc = entityDesc.findAttribute(prefix + ".*").orElseThrow(() -> new IllegalArgumentException("Unknown attribute " + prefix + ".*"));
RandomAccessReader reader = readerFor(desc);
RandomOffset off = offset == null ? null : reader.fetchOffset(RandomAccessReader.Listing.ATTRIBUTE, offset);
reader.scanWildcard(key, desc, off, limit, consumer::accept);
}
Aggregations