public void ensureDistributed(int shardCount, PropertyColumn distributionPropertyColumn, AbstractLabel colocate) { Preconditions.checkState(getProperty(distributionPropertyColumn.getName()).isPresent(), "distributionPropertyColumn \"%s\" not found.", distributionPropertyColumn.getName()); Preconditions.checkState(getProperty(distributionPropertyColumn.getName()).get().equals(distributionPropertyColumn), "distributionPropertyColumn \"%s\" must be a property of \"%s\"", distributionPropertyColumn.getName(), this.getFullName()); Preconditions.checkArgument(getIdentifiers().contains(distributionPropertyColumn.getName()), "The distribution column must be part of the primary key"); if (!this.isDistributed()) { this.getSchema().getTopology().lock(); if (!this.isDistributed()) { TopologyManager.distributeAbstractLabel(this.sqlgGraph, this, shardCount, distributionPropertyColumn, colocate); distribute(shardCount, distributionPropertyColumn, colocate); this.uncommittedDistributionPropertyColumn = distributionPropertyColumn; this.uncommittedDistributionColocateAbstractLabel = colocate; this.uncommittedShardCount = shardCount; } } }
public void ensureDistributed(int shardCount, PropertyColumn distributionPropertyColumn, AbstractLabel colocate) { Preconditions.checkState(getProperty(distributionPropertyColumn.getName()).isPresent(), "distributionPropertyColumn \"%s\" not found.", distributionPropertyColumn.getName()); Preconditions.checkState(getProperty(distributionPropertyColumn.getName()).get().equals(distributionPropertyColumn), "distributionPropertyColumn \"%s\" must be a property of \"%s\"", distributionPropertyColumn.getName(), this.getFullName()); Preconditions.checkArgument(getIdentifiers().contains(distributionPropertyColumn.getName()), "The distribution column must be part of the primary key"); if (!this.isDistributed()) { this.getSchema().getTopology().lock(); if (!this.isDistributed()) { TopologyManager.distributeAbstractLabel(this.sqlgGraph, this, shardCount, distributionPropertyColumn, colocate); distribute(shardCount, distributionPropertyColumn, colocate); this.uncommittedDistributionPropertyColumn = distributionPropertyColumn; this.uncommittedDistributionColocateAbstractLabel = colocate; this.uncommittedShardCount = shardCount; } } }