/** * Decodes a table layout descriptor from binary. * * @param bytes Serialized table layout descriptor. * @return Deserialized table layout descriptor. * @throws IOException on I/O or decoding error. */ private TableLayoutDesc decodeTableLayoutDesc(byte[] bytes) throws IOException { return mCellDecoder.decodeValue(bytes); }
/** {@inheritDoc} */ @Override public <T> NavigableMap<Long, FijiCell<T>> getCells(String family, String qualifier) throws IOException { final FijiCellDecoder<T> decoder = mDecoderProvider.getDecoder(FijiColumnName.create(family, qualifier)); final NavigableMap<Long, FijiCell<T>> result = Maps.newTreeMap(TimestampComparator.INSTANCE); final NavigableMap<Long, byte[]> tmap = getRawTimestampMap(family, qualifier); if (tmap != null) { for (Map.Entry<Long, byte[]> entry : tmap.entrySet()) { final Long timestamp = entry.getKey(); final byte[] bytes = entry.getValue(); final FijiCell<T> cell = FijiCell.create( FijiColumnName.create(family, qualifier), timestamp, decoder.decodeCell(bytes)); result.put(timestamp, cell); } } return result; }
/** {@inheritDoc} */ @Override public <T> FijiCell<T> getMostRecentCell(String family, String qualifier) throws IOException { final FijiCellDecoder<T> decoder = mDecoderProvider.getDecoder(FijiColumnName.create(family, qualifier)); final NavigableMap<Long, byte[]> tmap = getRawTimestampMap(family, qualifier); if (null == tmap) { return null; } final byte[] bytes = tmap.values().iterator().next(); final long timestamp = tmap.firstKey(); return FijiCell.create( FijiColumnName.create(family, qualifier), timestamp, decoder.decodeCell(bytes)); }
/** {@inheritDoc} */ @Override public FijiCell<T> apply(final KeyValue keyValue) { try { final DecodedCell<T> decodedCell = mCellDecoder.decodeCell(keyValue.getValue()); return FijiCell.create(mColumnName, keyValue.getTimestamp(), decodedCell); } catch (IOException e) { throw new FijiIOException(e); } } }
/** * Decodes a table layout descriptor from binary. * * @param bytes Serialized table layout descriptor. * @return Deserialized table layout descriptor. * @throws java.io.IOException on I/O or decoding error. */ private TableLayoutDesc decodeTableLayoutDesc(byte[] bytes) throws IOException { return mCellDecoder.decodeValue(bytes); }
/** {@inheritDoc} */ @Override public <T> FijiCell<T> getCell(String family, String qualifier, long timestamp) throws IOException { final FijiCellDecoder<T> decoder = mDecoderProvider.getDecoder(FijiColumnName.create(family, qualifier)); final byte[] bytes = getRawCell(family, qualifier, timestamp); return FijiCell.create( FijiColumnName.create(family, qualifier), timestamp, decoder.decodeCell(bytes)); }
/** {@inheritDoc} */ @Override public <T> T getMostRecentValue(String family, String qualifier) throws IOException { final FijiCellDecoder<T> decoder = mDecoderProvider.getDecoder(FijiColumnName.create(family, qualifier)); final NavigableMap<Long, byte[]> tmap = getRawTimestampMap(family, qualifier); if (null == tmap) { return null; } final byte[] bytes = tmap.values().iterator().next(); return decoder.decodeValue(bytes); }
/** {@inheritDoc} */ @Override public FijiCell<T> apply(final Row row) { try { final DecodedCell<T> decodedCell = mCellDecoder.decodeCell(ByteUtils.toBytes(row.getBytes(CQLUtils.VALUE_COL))); return FijiCell.create(mColumnName, row.getLong(CQLUtils.VERSION_COL), decodedCell); } catch (IOException e) { throw new FijiIOException(e); } } }
/** {@inheritDoc} */ @Override public <T> T getValue(String family, String qualifier, long timestamp) throws IOException { final FijiCellDecoder<T> decoder = mDecoderProvider.getDecoder(FijiColumnName.create(family, qualifier)); final byte[] bytes = getRawCell(family, qualifier, timestamp); return decoder.decodeValue(bytes); }
final DecodedCell<T> decodedCell = mLastDecoder.decodeCell(keyValue.getValue()); return FijiCell.create(mLastColumn, keyValue.getTimestamp(), decodedCell); } catch (IOException e) {
mLastDecoder.decodeCell( ByteUtils.toBytes(row.getBytes(CQLUtils.VALUE_COL))); return FijiCell.create(mLastColumn, version, decodedCell);
return FijiCell.create(column, next.getTimestamp(), mDecoder.decodeCell(next.getValue())); } else {
final DecodedCell<T> decodedCell = mCellDecoder.decodeCell(keyValue.getValue()); return FijiCell.create(mLastColumn, keyValue.getTimestamp(), decodedCell); } catch (IOException e) {
mCellDecoder.decodeCell( ByteUtils.toBytes(row.getBytes(CQLUtils.VALUE_COL))); return FijiCell.create(mLastColumn, version, decodedCell);