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

com.scalar.db.api.DistributedStorageProvider 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.api;

import com.scalar.db.config.DatabaseConfig;

/**
 * A class that creates {@link DistributedStorage} and {@link DistributedStorageAdmin} instances.
 * Each storage adapter should implement this class to instantiate its implementations of {@link
 * DistributedStorage} and {@link DistributedStorageAdmin}. The implementations are assumed to be
 * loaded by {@link java.util.ServiceLoader}.
 */
public interface DistributedStorageProvider {

  /**
   * Returns the name of the adapter. This is for the configuration {@link DatabaseConfig#STORAGE}.
   *
   * @return the name of the adapter
   */
  String getName();

  /**
   * Creates an instance of {@link DistributedStorage} for the adapter.
   *
   * @param config a database config
   * @return an instance of {@link DistributedStorage} for the adapter
   */
  DistributedStorage createDistributedStorage(DatabaseConfig config);

  /**
   * Creates an instance of {@link DistributedStorageAdmin} for the adapter.
   *
   * @param config a database config
   * @return an instance of {@link DistributedStorageAdmin} for the adapter
   */
  DistributedStorageAdmin createDistributedStorageAdmin(DatabaseConfig config);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy