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

com.palantir.atlasdb.timelock.benchmarks.schema.generated.BenchmarksTableFactory Maven / Gradle / Ivy

There is a newer version: 0.1152.0
Show newest version
package com.palantir.atlasdb.timelock.benchmarks.schema.generated;

import com.google.common.base.Function;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Multimap;
import com.palantir.atlasdb.keyvalue.api.Namespace;
import com.palantir.atlasdb.table.generation.Triggers;
import com.palantir.atlasdb.transaction.api.Transaction;
import java.util.List;
import javax.annotation.processing.Generated;

@Generated("com.palantir.atlasdb.table.description.render.TableFactoryRenderer")
public final class BenchmarksTableFactory {
    private static final Namespace defaultNamespace = Namespace.create("benchmarks", Namespace.UNCHECKED_NAME);

    private static final BenchmarksTableFactory defaultTableFactory = of(defaultNamespace);

    private final List> sharedTriggers;

    private final Namespace namespace;

    private BenchmarksTableFactory(
            List> sharedTriggers, Namespace namespace) {
        this.sharedTriggers = sharedTriggers;
        this.namespace = namespace;
    }

    public static BenchmarksTableFactory of(
            List> sharedTriggers, Namespace namespace) {
        return new BenchmarksTableFactory(sharedTriggers, namespace);
    }

    public static BenchmarksTableFactory of(List> sharedTriggers) {
        return new BenchmarksTableFactory(sharedTriggers, defaultNamespace);
    }

    public static BenchmarksTableFactory of(Namespace namespace) {
        return of(ImmutableList.of(), namespace);
    }

    public static BenchmarksTableFactory of() {
        return defaultTableFactory;
    }

    public BlobsTable getBlobsTable(Transaction t, BlobsTable.BlobsTrigger... triggers) {
        return BlobsTable.of(t, namespace, Triggers.getAllTriggers(t, sharedTriggers, triggers));
    }

    public BlobsSerializableTable getBlobsSerializableTable(
            Transaction t, BlobsSerializableTable.BlobsSerializableTrigger... triggers) {
        return BlobsSerializableTable.of(t, namespace, Triggers.getAllTriggers(t, sharedTriggers, triggers));
    }

    public KvDynamicColumnsTable getKvDynamicColumnsTable(
            Transaction t, KvDynamicColumnsTable.KvDynamicColumnsTrigger... triggers) {
        return KvDynamicColumnsTable.of(t, namespace, Triggers.getAllTriggers(t, sharedTriggers, triggers));
    }

    public KvRowsTable getKvRowsTable(Transaction t, KvRowsTable.KvRowsTrigger... triggers) {
        return KvRowsTable.of(t, namespace, Triggers.getAllTriggers(t, sharedTriggers, triggers));
    }

    public MetadataTable getMetadataTable(Transaction t, MetadataTable.MetadataTrigger... triggers) {
        return MetadataTable.of(t, namespace, Triggers.getAllTriggers(t, sharedTriggers, triggers));
    }

    public interface SharedTriggers
            extends BlobsTable.BlobsTrigger,
                    BlobsSerializableTable.BlobsSerializableTrigger,
                    KvDynamicColumnsTable.KvDynamicColumnsTrigger,
                    KvRowsTable.KvRowsTrigger,
                    MetadataTable.MetadataTrigger {}

    public abstract static class NullSharedTriggers implements SharedTriggers {
        @Override
        public void putBlobs(Multimap> newRows) {
            // do nothing
        }

        @Override
        public void putBlobsSerializable(
                Multimap<
                                BlobsSerializableTable.BlobsSerializableRow,
                                ? extends BlobsSerializableTable.BlobsSerializableNamedColumnValue>
                        newRows) {
            // do nothing
        }

        @Override
        public void putKvDynamicColumns(
                Multimap<
                                KvDynamicColumnsTable.KvDynamicColumnsRow,
                                ? extends KvDynamicColumnsTable.KvDynamicColumnsColumnValue>
                        newRows) {
            // do nothing
        }

        @Override
        public void putKvRows(
                Multimap> newRows) {
            // do nothing
        }

        @Override
        public void putMetadata(
                Multimap> newRows) {
            // do nothing
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy