Examples of ByteStreamArray


Examples of org.kiji.schema.util.ByteStreamArray

      idTableRowCounter += 1;
      final BytesKey rowKey = new BytesKey(result.getRow());

      long schemaId = -1;
      try {
        schemaId = new ByteStreamArray(result.getRow()).readVarInt64();
      } catch (EncodingException exn) {
        LOG.error(String.format("Unable to decode schema ID encoded in row key %s: %s",
            rowKey, exn));
      }
View Full Code Here

Examples of org.kiji.schema.util.ByteStreamArray

   *          the return value.
   * @return The decoded KijiCell.
   * @throws IOException If there is an error.
   */
  private DecodedCell<T> decode(byte[] bytes, T reuse) throws IOException {
    final ByteStreamArray byteStream = new ByteStreamArray(bytes);
    final Schema writerSchema = mSchemaDecoder.decode(byteStream);
    final Schema readerSchema = (mReaderSchema != null) ? mReaderSchema : writerSchema;
    final ByteBuffer binaryData =
        ByteBuffer.wrap(bytes, byteStream.getOffset(), bytes.length - byteStream.getOffset());
    final T data = decodeAvro(binaryData, writerSchema, readerSchema, reuse);
    return new DecodedCell<T>(writerSchema, readerSchema, data);
  }
View Full Code Here

Examples of org.kiji.schema.util.ByteStreamArray

   * @param bytes The bytes from an HBase table cell.
   * @return the portion of the encoded byte array that contains the binary-encoded avro message.
   * @throws IOException on I/O error (eg. decoding error).
   */
  public ByteBuffer getPayload(byte[] bytes) throws IOException {
    final ByteStreamArray byteStream = new ByteStreamArray(bytes);
    // Decode the writer schema and throw it away:
    mSchemaDecoder.decode(byteStream);
    return ByteBuffer.wrap(bytes, byteStream.getOffset(), bytes.length - byteStream.getOffset());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.