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

org.nustaq.reallive.client.DynTableSpaceSharding Maven / Gradle / Ivy

There is a newer version: 5.2.1
Show newest version
package org.nustaq.reallive.client;

import org.nustaq.reallive.api.RealLiveTable;
import org.nustaq.reallive.api.TableDescription;
import org.nustaq.reallive.server.actors.TableSpaceActor;
import org.nustaq.reallive.server.dynamic.DynClusterDistribution;

import java.util.function.Supplier;

public class DynTableSpaceSharding extends TableSpaceSharding {

    private final Supplier distributionSupplier;

    public DynTableSpaceSharding(TableSpaceActor[] shards, Supplier distributionSupplier) {
        super(shards);
        this.distributionSupplier = distributionSupplier;
    }

    protected ShardedTable createShardedTable(TableDescription desc, RealLiveTable[] tableShards) {
        return new DynShardedTable(tableShards, desc, () -> distributionSupplier.get().get(desc.getName()));
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy