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

There is a newer version: 3.14.0
Show newest version
package com.scalar.db.storage.dynamo.bytes;

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

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy