All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.scalar.db.storage.dynamo.bytes.BytesEncoder Maven / Gradle / Ivy

Go to download

A universal transaction manager that achieves database-agnostic transactions and distributed transactions that span multiple databases

The newest version!
package com.scalar.db.storage.dynamo.bytes;

import com.scalar.db.api.Scan.Ordering.Order;
import com.scalar.db.io.Column;
import java.nio.ByteBuffer;

/**
 * A bytes-encoder that encodes a column to bytes while preserving the sort order.
 *
 * @param  the value type
 */
public interface BytesEncoder> {

  /**
   * Calculates the encoded bytes length.
   *
   * @param column a column
   * @param order an order
   * @return the encoded bytes length
   */
  int encodedLength(T column, Order order);

  /**
   * Encodes the column to bytes
   *
   * @param column a column
   * @param order an order
   * @param dst a ByteBuffer to write the encoded bytes
   */
  void encode(T column, Order order, ByteBuffer dst);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy