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

com.scalar.db.transaction.consensuscommit.AbstractMutationComposer 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.transaction.consensuscommit;

import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.ImmutableList;
import com.scalar.db.api.Mutation;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.concurrent.NotThreadSafe;

@NotThreadSafe
public abstract class AbstractMutationComposer implements MutationComposer {
  protected final String id;
  protected final List mutations;
  protected final long current;

  public AbstractMutationComposer(String id) {
    this.id = id;
    this.mutations = new ArrayList<>();
    this.current = System.currentTimeMillis();
  }

  @VisibleForTesting
  AbstractMutationComposer(String id, long current) {
    this.id = id;
    this.mutations = new ArrayList<>();
    this.current = current;
  }

  @Override
  public List get() {
    return ImmutableList.copyOf(mutations);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy