@Nonnull public static BufferObjectDataInput createObjectDataInput(@Nonnull NodeEngine engine, @Nonnull byte[] buf) { return ((InternalSerializationService) engine.getSerializationService()) .createObjectDataInput(buf); }
@Override public BufferObjectDataInput takeInputBuffer(Data data) { BufferObjectDataInput in = inputQueue.poll(); if (in == null) { in = serializationService.createObjectDataInput((byte[]) null); } in.init(data.toByteArray(), HeapData.DATA_OFFSET); return in; }
@Override public BufferObjectDataInput takeInputBuffer(Data data) { BufferObjectDataInput in = inputQueue.poll(); if (in == null) { in = serializationService.createObjectDataInput((byte[]) null); } in.init(data.toByteArray(), HeapData.DATA_OFFSET); return in; }
@Override public void readData(ObjectDataInput in) throws IOException { int sz = in.readInt(); if (sz > 0) { results = new ArrayList<>(sz); //repo = SchemaRepositoryImpl.getRepository(); InternalSerializationService ss = in.getSerializationService(); byte[] data = in.readByteArray(); byte[] data2 = IOUtil.decompress(data); //logger.info("readData; compressed size: {}; decompressed size: {}", data.length, data2.length); ObjectDataInput tmp = ss.createObjectDataInput(data2); readResults(tmp, sz); } else { results = new ArrayList<>(); } }
public static Object readCompressedContent(ObjectDataInput in, ContentSerializer<Object> cs) throws IOException { InternalSerializationService ss = in.getSerializationService(); ObjectDataInput odi = ss.createObjectDataInput(IOUtil.decompress(in.readByteArray())); return cs.readContent(odi); }
public static Object readCompressedData(ObjectDataInput in) throws IOException { InternalSerializationService ss = in.getSerializationService(); ObjectDataInput odi = ss.createObjectDataInput(IOUtil.decompress(in.readByteArray())); return odi.readObject(); }
@Override public void readData(ObjectDataInput in) throws IOException { //repo = SchemaRepositoryImpl.getRepository(); InternalSerializationService ss = in.getSerializationService(); ObjectDataInput odi = ss.createObjectDataInput(IOUtil.decompress(in.readByteArray())); super.readData(odi); }
@Override public ClassDefinition lookupClassDefinition(Data data) throws IOException { if (!data.isPortable()) { throw new IllegalArgumentException("Data is not Portable!"); } BufferObjectDataInput in = serializationService.createObjectDataInput(data); int factoryId = in.readInt(); int classId = in.readInt(); int version = in.readInt(); ClassDefinition classDefinition = lookupClassDefinition(factoryId, classId, version); if (classDefinition == null) { classDefinition = readClassDefinition(in, factoryId, classId, version); } return classDefinition; }
@Override public ClassDefinition lookupClassDefinition(Data data) throws IOException { if (!data.isPortable()) { throw new IllegalArgumentException("Data is not Portable!"); } BufferObjectDataInput in = serializationService.createObjectDataInput(data); int factoryId = in.readInt(); int classId = in.readInt(); int version = in.readInt(); ClassDefinition classDefinition = lookupClassDefinition(factoryId, classId, version); if (classDefinition == null) { classDefinition = readClassDefinition(in, factoryId, classId, version); } return classDefinition; }
private Object getDocumentContent(DocumentKey docKey) throws BagriException { Object content = ddSvc.getCachedObject(CN_XDM_CONTENT, docKey, binaryContent); if (compressContent) { InternalSerializationService ss = ddSvc.getSerializationService(); byte[] buff = IOUtil.decompress((byte[]) content); ObjectDataInput odi = ss.createObjectDataInput(buff); try { content = odi.readObject(); } catch (IOException ex) { throw new BagriException(ex, ecDocument); } } return content; }
private Traverser<Object> traverser(byte[] data) { BufferObjectDataInput in = serializationService.createObjectDataInput(data); return () -> uncheckCall(() -> { Object key = in.readObject(); if (key == SnapshotDataValueTerminator.INSTANCE) { in.close(); return null; } Object value = in.readObject(); return key instanceof BroadcastKey ? new BroadcastEntry(key, value) : entry(key, value); }); }
final BufferObjectDataInput input = node.getSerializationService().createObjectDataInput(processed); if (inputProcessor == null) {
final BufferObjectDataInput input = node.getSerializationService().createObjectDataInput(processed); if (inputProcessor == null) {