public static <T> Map<Cell, T> convertRowResultsToCells(Collection<RowResult<T>> rows) { Map<Cell, T> ret = Maps.newHashMapWithExpectedSize(rows.size()); for (RowResult<T> row : rows) { byte[] rowName = row.getRowName(); for (Map.Entry<byte[], T> col : row.getColumns().entrySet()) { Cell cell = Cell.create(rowName, col.getKey()); ret.put(cell, col.getValue()); } } return ret; }
public static DataStreamHashAidxRowResult of(RowResult<byte[]> rowResult) { DataStreamHashAidxRow rowName = DataStreamHashAidxRow.BYTES_HYDRATOR.hydrateFromBytes(rowResult.getRowName()); Set<DataStreamHashAidxColumnValue> columnValues = Sets.newHashSetWithExpectedSize(rowResult.getColumns().size()); for (Entry<byte[], byte[]> e : rowResult.getColumns().entrySet()) { DataStreamHashAidxColumn col = DataStreamHashAidxColumn.BYTES_HYDRATOR.hydrateFromBytes(e.getKey()); Long value = DataStreamHashAidxColumnValue.hydrateValue(e.getValue()); columnValues.add(DataStreamHashAidxColumnValue.of(col, value)); } return new DataStreamHashAidxRowResult(rowName, ImmutableSet.copyOf(columnValues)); }
public static ValueStreamIdxRowResult of(RowResult<byte[]> rowResult) { ValueStreamIdxRow rowName = ValueStreamIdxRow.BYTES_HYDRATOR.hydrateFromBytes(rowResult.getRowName()); Set<ValueStreamIdxColumnValue> columnValues = Sets.newHashSetWithExpectedSize(rowResult.getColumns().size()); for (Entry<byte[], byte[]> e : rowResult.getColumns().entrySet()) { ValueStreamIdxColumn col = ValueStreamIdxColumn.BYTES_HYDRATOR.hydrateFromBytes(e.getKey()); Long value = ValueStreamIdxColumnValue.hydrateValue(e.getValue()); columnValues.add(ValueStreamIdxColumnValue.of(col, value)); } return new ValueStreamIdxRowResult(rowName, ImmutableSet.copyOf(columnValues)); }
public static UserBirthdaysIdxRowResult of(RowResult<byte[]> rowResult) { UserBirthdaysIdxRow rowName = UserBirthdaysIdxRow.BYTES_HYDRATOR.hydrateFromBytes(rowResult.getRowName()); Set<UserBirthdaysIdxColumnValue> columnValues = Sets.newHashSetWithExpectedSize(rowResult.getColumns().size()); for (Entry<byte[], byte[]> e : rowResult.getColumns().entrySet()) { UserBirthdaysIdxColumn col = UserBirthdaysIdxColumn.BYTES_HYDRATOR.hydrateFromBytes(e.getKey()); Long value = UserBirthdaysIdxColumnValue.hydrateValue(e.getValue()); columnValues.add(UserBirthdaysIdxColumnValue.of(col, value)); } return new UserBirthdaysIdxRowResult(rowName, ImmutableSet.copyOf(columnValues)); }
public static UserPhotosStreamHashAidxRowResult of(RowResult<byte[]> rowResult) { UserPhotosStreamHashAidxRow rowName = UserPhotosStreamHashAidxRow.BYTES_HYDRATOR.hydrateFromBytes(rowResult.getRowName()); Set<UserPhotosStreamHashAidxColumnValue> columnValues = Sets.newHashSetWithExpectedSize(rowResult.getColumns().size()); for (Entry<byte[], byte[]> e : rowResult.getColumns().entrySet()) { UserPhotosStreamHashAidxColumn col = UserPhotosStreamHashAidxColumn.BYTES_HYDRATOR.hydrateFromBytes(e.getKey()); Long value = UserPhotosStreamHashAidxColumnValue.hydrateValue(e.getValue()); columnValues.add(UserPhotosStreamHashAidxColumnValue.of(col, value)); } return new UserPhotosStreamHashAidxRowResult(rowName, ImmutableSet.copyOf(columnValues)); }
private static Multimap<ValueStreamMetadataRow, ValueStreamMetadataNamedColumnValue<?>> getRowMapFromRowResults(Collection<RowResult<byte[]>> rowResults) { Multimap<ValueStreamMetadataRow, ValueStreamMetadataNamedColumnValue<?>> rowMap = HashMultimap.create(); for (RowResult<byte[]> result : rowResults) { ValueStreamMetadataRow row = ValueStreamMetadataRow.BYTES_HYDRATOR.hydrateFromBytes(result.getRowName()); for (Entry<byte[], byte[]> e : result.getColumns().entrySet()) { rowMap.put(row, shortNameToHydrator.get(PtBytes.toString(e.getKey())).hydrateFromBytes(e.getValue())); } } return rowMap; }
private static Multimap<BlobsSerializableRow, BlobsSerializableNamedColumnValue<?>> getRowMapFromRowResults(Collection<RowResult<byte[]>> rowResults) { Multimap<BlobsSerializableRow, BlobsSerializableNamedColumnValue<?>> rowMap = HashMultimap.create(); for (RowResult<byte[]> result : rowResults) { BlobsSerializableRow row = BlobsSerializableRow.BYTES_HYDRATOR.hydrateFromBytes(result.getRowName()); for (Entry<byte[], byte[]> e : result.getColumns().entrySet()) { rowMap.put(row, shortNameToHydrator.get(PtBytes.toString(e.getKey())).hydrateFromBytes(e.getValue())); } } return rowMap; }
private static Multimap<KvRowsRow, KvRowsNamedColumnValue<?>> getRowMapFromRowResults(Collection<RowResult<byte[]>> rowResults) { Multimap<KvRowsRow, KvRowsNamedColumnValue<?>> rowMap = HashMultimap.create(); for (RowResult<byte[]> result : rowResults) { KvRowsRow row = KvRowsRow.BYTES_HYDRATOR.hydrateFromBytes(result.getRowName()); for (Entry<byte[], byte[]> e : result.getColumns().entrySet()) { rowMap.put(row, shortNameToHydrator.get(PtBytes.toString(e.getKey())).hydrateFromBytes(e.getValue())); } } return rowMap; }
private static Multimap<UserPhotosStreamIdxRow, UserPhotosStreamIdxColumnValue> getRowMapFromRowResults(Collection<RowResult<byte[]>> rowResults) { Multimap<UserPhotosStreamIdxRow, UserPhotosStreamIdxColumnValue> rowMap = HashMultimap.create(); for (RowResult<byte[]> result : rowResults) { UserPhotosStreamIdxRow row = UserPhotosStreamIdxRow.BYTES_HYDRATOR.hydrateFromBytes(result.getRowName()); for (Entry<byte[], byte[]> e : result.getColumns().entrySet()) { UserPhotosStreamIdxColumn col = UserPhotosStreamIdxColumn.BYTES_HYDRATOR.hydrateFromBytes(e.getKey()); Long val = UserPhotosStreamIdxColumnValue.hydrateValue(e.getValue()); rowMap.put(row, UserPhotosStreamIdxColumnValue.of(col, val)); } } return rowMap; }
public Long getValue() { byte[] bytes = row.getColumns().get(PtBytes.toCachedBytes("v")); if (bytes == null) { return null; } Value value = Value.BYTES_HYDRATOR.hydrateFromBytes(bytes); return value.getValue(); }
public byte[] getValue() { byte[] bytes = row.getColumns().get(PtBytes.toCachedBytes("v")); if (bytes == null) { return null; } Value value = Value.BYTES_HYDRATOR.hydrateFromBytes(bytes); return value.getValue(); }
public Long getStreamId() { byte[] bytes = row.getColumns().get(PtBytes.toCachedBytes("s")); if (bytes == null) { return null; } StreamId value = StreamId.BYTES_HYDRATOR.hydrateFromBytes(bytes); return value.getValue(); }
public com.palantir.atlasdb.sweep.queue.id.SweepTableIdentifier getId() { byte[] bytes = row.getColumns().get(PtBytes.toCachedBytes("i")); if (bytes == null) { return null; } Id value = Id.BYTES_HYDRATOR.hydrateFromBytes(bytes); return value.getValue(); }
public Long getLastClearedTimestamp() { byte[] bytes = row.getColumns().get(PtBytes.toCachedBytes("l")); if (bytes == null) { return null; } LastClearedTimestamp value = LastClearedTimestamp.BYTES_HYDRATOR.hydrateFromBytes(bytes); return value.getValue(); }
public Long getLastSweepTime() { byte[] bytes = row.getColumns().get(PtBytes.toCachedBytes("t")); if (bytes == null) { return null; } LastSweepTime value = LastSweepTime.BYTES_HYDRATOR.hydrateFromBytes(bytes); return value.getValue(); }
public Long getMinimumSweptTimestamp() { byte[] bytes = row.getColumns().get(PtBytes.toCachedBytes("m")); if (bytes == null) { return null; } MinimumSweptTimestamp value = MinimumSweptTimestamp.BYTES_HYDRATOR.hydrateFromBytes(bytes); return value.getValue(); }
public byte[] getValue() { byte[] bytes = row.getColumns().get(PtBytes.toCachedBytes("v")); if (bytes == null) { return null; } Value value = Value.BYTES_HYDRATOR.hydrateFromBytes(bytes); return value.getValue(); }
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 com.fasterxml.jackson.databind.JsonNode getJson() { byte[] bytes = row.getColumns().get(PtBytes.toCachedBytes("j")); if (bytes == null) { return null; } Json value = Json.BYTES_HYDRATOR.hydrateFromBytes(bytes); return value.getValue(); }
public com.palantir.example.profile.protos.generated.ProfilePersistence.UserProfile getMetadata() { byte[] bytes = row.getColumns().get(PtBytes.toCachedBytes("m")); if (bytes == null) { return null; } Metadata value = Metadata.BYTES_HYDRATOR.hydrateFromBytes(bytes); return value.getValue(); }