public Map<SnapshotsStreamMetadataRow, com.palantir.atlasdb.protos.generated.StreamPersistence.StreamMetadata> getMetadatas(Collection<SnapshotsStreamMetadataRow> rows) { Map<Cell, SnapshotsStreamMetadataRow> cells = Maps.newHashMapWithExpectedSize(rows.size()); for (SnapshotsStreamMetadataRow row : rows) { cells.put(Cell.create(row.persistToBytes(), PtBytes.toCachedBytes("md")), row); } Map<Cell, byte[]> results = t.get(tableRef, cells.keySet()); Map<SnapshotsStreamMetadataRow, com.palantir.atlasdb.protos.generated.StreamPersistence.StreamMetadata> ret = Maps.newHashMapWithExpectedSize(results.size()); for (Entry<Cell, byte[]> e : results.entrySet()) { com.palantir.atlasdb.protos.generated.StreamPersistence.StreamMetadata val = Metadata.BYTES_HYDRATOR.hydrateFromBytes(e.getValue()).getValue(); ret.put(cells.get(e.getKey()), val); } return ret; }
public void putMetadata(SnapshotsStreamMetadataRow row, com.palantir.atlasdb.protos.generated.StreamPersistence.StreamMetadata value) { put(ImmutableMultimap.of(row, Metadata.of(value))); }
public static Metadata of(com.palantir.atlasdb.protos.generated.StreamPersistence.StreamMetadata value) { return new Metadata(value); }
public void putMetadata(SnapshotsStreamMetadataRow row, com.palantir.atlasdb.protos.generated.StreamPersistence.StreamMetadata value) { put(ImmutableMultimap.of(row, Metadata.of(value))); }
public Map<SnapshotsStreamMetadataRow, com.palantir.atlasdb.protos.generated.StreamPersistence.StreamMetadata> getMetadatas(Collection<SnapshotsStreamMetadataRow> rows) { Map<Cell, SnapshotsStreamMetadataRow> cells = Maps.newHashMapWithExpectedSize(rows.size()); for (SnapshotsStreamMetadataRow row : rows) { cells.put(Cell.create(row.persistToBytes(), PtBytes.toCachedBytes("md")), row); } Map<Cell, byte[]> results = t.get(tableRef, cells.keySet()); Map<SnapshotsStreamMetadataRow, com.palantir.atlasdb.protos.generated.StreamPersistence.StreamMetadata> ret = Maps.newHashMapWithExpectedSize(results.size()); for (Entry<Cell, byte[]> e : results.entrySet()) { com.palantir.atlasdb.protos.generated.StreamPersistence.StreamMetadata val = Metadata.BYTES_HYDRATOR.hydrateFromBytes(e.getValue()).getValue(); ret.put(cells.get(e.getKey()), val); } return ret; }
public void putMetadata(Map<SnapshotsStreamMetadataRow, com.palantir.atlasdb.protos.generated.StreamPersistence.StreamMetadata> map) { Map<SnapshotsStreamMetadataRow, SnapshotsStreamMetadataNamedColumnValue<?>> toPut = Maps.newHashMapWithExpectedSize(map.size()); for (Entry<SnapshotsStreamMetadataRow, com.palantir.atlasdb.protos.generated.StreamPersistence.StreamMetadata> e : map.entrySet()) { toPut.put(e.getKey(), Metadata.of(e.getValue())); } put(Multimaps.forMap(toPut)); }
@Override public Metadata hydrateFromBytes(byte[] bytes) { bytes = CompressionUtils.decompress(bytes, Compression.NONE); try { return of(com.palantir.atlasdb.protos.generated.StreamPersistence.StreamMetadata.parseFrom(bytes)); } catch (InvalidProtocolBufferException e) { throw Throwables.throwUncheckedException(e); } } };
public com.palantir.atlasdb.protos.generated.StreamPersistence.StreamMetadata getMetadata() { byte[] bytes = row.getColumns().get(PtBytes.toCachedBytes("md")); if (bytes == null) { return null; } Metadata value = Metadata.BYTES_HYDRATOR.hydrateFromBytes(bytes); return value.getValue(); }
public static Metadata of(com.palantir.atlasdb.protos.generated.StreamPersistence.StreamMetadata value) { return new Metadata(value); }
@Override public Metadata hydrateFromBytes(byte[] bytes) { bytes = CompressionUtils.decompress(bytes, Compression.NONE); try { return of(com.palantir.atlasdb.protos.generated.StreamPersistence.StreamMetadata.parseFrom(bytes)); } catch (InvalidProtocolBufferException e) { throw Throwables.throwUncheckedException(e); } } };
public void putMetadata(Map<SnapshotsStreamMetadataRow, com.palantir.atlasdb.protos.generated.StreamPersistence.StreamMetadata> map) { Map<SnapshotsStreamMetadataRow, SnapshotsStreamMetadataNamedColumnValue<?>> toPut = Maps.newHashMapWithExpectedSize(map.size()); for (Entry<SnapshotsStreamMetadataRow, com.palantir.atlasdb.protos.generated.StreamPersistence.StreamMetadata> e : map.entrySet()) { toPut.put(e.getKey(), Metadata.of(e.getValue())); } put(Multimaps.forMap(toPut)); }
public com.palantir.atlasdb.protos.generated.StreamPersistence.StreamMetadata getMetadata() { byte[] bytes = row.getColumns().get(PtBytes.toCachedBytes("md")); if (bytes == null) { return null; } Metadata value = Metadata.BYTES_HYDRATOR.hydrateFromBytes(bytes); return value.getValue(); }