@Override public Object convert(Inspector value) { byte[] content = value.asData(Value.empty().asData()); if (content.length == 0) return null; return TypedBinaryFormat.decode(Optional.empty(), GrowableByteBuffer.wrap(content)); }
@Override public void read(FieldBase field, TensorFieldValue value) { int encodedTensorLength = buf.getInt1_4Bytes(); if (encodedTensorLength > 0) { byte[] encodedTensor = getBytes(null, encodedTensorLength); value.assign(TypedBinaryFormat.decode(Optional.of(value.getDataType().getTensorType()), GrowableByteBuffer.wrap(encodedTensor))); } else { value.clear(); } }
@Override public void read(FieldBase field, TensorFieldValue value) { int encodedTensorLength = buf.getInt1_4Bytes(); if (encodedTensorLength > 0) { byte[] encodedTensor = getBytes(null, encodedTensorLength); value.assign(TypedBinaryFormat.decode(Optional.of(value.getDataType().getTensorType()), GrowableByteBuffer.wrap(encodedTensor))); } else { value.clear(); } }
public ProgressToken(byte[] serialized) { BufferSerializer in = new BufferSerializer(GrowableByteBuffer.wrap(serialized)); distributionBits = in.getInt(null); bucketCursor = in.getLong(null); finishedBucketCount = in.getLong(null); totalBucketCount = in.getLong(null); int progressCount = in.getInt(null); for (int i = 0; i < progressCount; ++i) { long key = in.getLong(null); long value = in.getLong(null); addBucket(new BucketId(key), new BucketId(value), BucketState.BUCKET_PENDING); } }
buf = GrowableByteBuffer.wrap(destination);
buf = GrowableByteBuffer.wrap(destination);
buf = GrowableByteBuffer.wrap(destination);
buf = GrowableByteBuffer.wrap(destination);