private Partition createRangePartitionWithSubPartition(String name, String from, String to, PartitionType partitionType, String partitionExpression) { Preconditions.checkState(!this.getSchema().isSqlgSchema(), "createRangePartitionWithSubPartition may not be called for \"%s\"", SQLG_SCHEMA); this.uncommittedPartitions.remove(name); Partition partition = Partition.createRangePartitionWithSubPartition(this.sqlgGraph, this, name, from, to, partitionType, partitionExpression); this.uncommittedPartitions.put(name, partition); this.getSchema().getTopology().fire(partition, "", TopologyChangeAction.CREATE); return partition; }
private Partition createRangePartitionWithSubPartition(String name, String from, String to, PartitionType partitionType, String partitionExpression) { Preconditions.checkState(!this.getSchema().isSqlgSchema(), "createRangePartitionWithSubPartition may not be called for \"%s\"", SQLG_SCHEMA); this.uncommittedPartitions.remove(name); Partition partition = Partition.createRangePartitionWithSubPartition(this.sqlgGraph, this, name, from, to, partitionType, partitionExpression); this.uncommittedPartitions.put(name, partition); this.getSchema().getTopology().fire(partition, "", TopologyChangeAction.CREATE); return partition; }
public Partition ensureRangePartitionWithSubPartitionExists( String name, String from, String to, PartitionType partitionType, String partitionExpression) { Objects.requireNonNull(name, "Sub-partition's \"name\" must not be null"); Objects.requireNonNull(from, "Sub-partition's \"from\" must not be null"); Objects.requireNonNull(to, "Sub-partition's \"to\" must not be null"); Preconditions.checkState(partitionType != PartitionType.NONE, "ensureRangePartitionWithSubPartitionExists(String name, String from, String to, PartitionType partitionType, String partitionExpression) may not be called with partitionType NONE partition"); Objects.requireNonNull(partitionExpression, "Sub-partition's \"partitionExpression\" must not be null"); Optional<Partition> partitionOptional = this.getPartition(name); if (!partitionOptional.isPresent()) { this.getAbstractLabel().getSchema().getTopology().lock(); partitionOptional = this.getPartition(name); return partitionOptional.orElseGet(() -> this.createRangePartitionWithSubPartition(name, from, to, partitionType, partitionExpression)); } else { return partitionOptional.get(); } }
public Partition ensureRangePartitionWithSubPartitionExists( String name, String from, String to, PartitionType partitionType, String partitionExpression) { Objects.requireNonNull(name, "Sub-partition's \"name\" must not be null"); Objects.requireNonNull(from, "Sub-partition's \"from\" must not be null"); Objects.requireNonNull(to, "Sub-partition's \"to\" must not be null"); Preconditions.checkState(partitionType != PartitionType.NONE, "ensureRangePartitionWithSubPartitionExists(String name, String from, String to, PartitionType partitionType, String partitionExpression) may not be called with partitionType NONE partition"); Objects.requireNonNull(partitionExpression, "Sub-partition's \"partitionExpression\" must not be null"); Optional<Partition> partitionOptional = this.getPartition(name); if (!partitionOptional.isPresent()) { this.getAbstractLabel().getSchema().getTopology().lock(); partitionOptional = this.getPartition(name); return partitionOptional.orElseGet(() -> this.createRangePartitionWithSubPartition(name, from, to, partitionType, partitionExpression)); } else { return partitionOptional.get(); } }