Class AbstractLabel

java.lang.Object
org.umlg.sqlg.structure.topology.AbstractLabel
All Implemented Interfaces:
TopologyInf
Direct Known Subclasses:
EdgeLabel, VertexLabel

public abstract class AbstractLabel extends Object implements TopologyInf
Date: 2016/09/14 Time: 11:19 AM
  • Field Details

    • isForeignAbstractLabel

      protected final boolean isForeignAbstractLabel
  • Method Details

    • isForeign

      public boolean isForeign()
    • ensureRangePartitionExists

      public Partition ensureRangePartitionExists(String name, String from, String to)
      Ensures that a RANGE partition exists.
      Parameters:
      name - The partition's name
      from - The RANGE partition's start clause.
      to - THe RANGE partition's end clause.
      Returns:
      The Partition
    • ensureRangePartitionWithSubPartitionExists

      public Partition ensureRangePartitionWithSubPartitionExists(String name, String from, String to, PartitionType partitionType, String partitionExpression)
      Ensures that a RANGE partition exists.
      Parameters:
      name - The partition's name
      from - The RANGE partition's start clause.
      to - The RANGE partition's end clause.
      partitionType - The partition's PartitionType if is is going to be sub-partitioned.
      partitionExpression - The partition's partitionExpression if is is going to be sub-partitioned.
      Returns:
      The Partition
    • ensureHashPartitionExists

      public Partition ensureHashPartitionExists(String name, int modulus, int remainder)
      Ensures that a HASH partition exists.
      Parameters:
      name - The partition's name.
      modulus - The HASH partition's 'modulus'.
      remainder - The HASH partition's 'remainder'.
      Returns:
      The Partition
    • ensureListPartitionExists

      public Partition ensureListPartitionExists(String name, String in)
      Ensures that a LIST partition exists.
      Parameters:
      name - The partition's name.
      in - The LIST partition's 'in' clause.
      Returns:
      The Partition
    • ensureListPartitionWithSubPartitionExists

      public Partition ensureListPartitionWithSubPartitionExists(String name, String in, PartitionType partitionType, String partitionExpression)
      Ensures that a LIST partition exists.
      Parameters:
      name - The partition's name.
      in - The LIST partition's 'in' clause.
      partitionType - The partition's PartitionType if it is going to be sub-partitioned.
      partitionExpression - The partition's partitionExpression if it is going to be sub-partitioned.
      Returns:
      The Partition
    • ensureHashPartitionWithSubPartitionExists

      public Partition ensureHashPartitionWithSubPartitionExists(String name, Integer modulus, Integer remainder, PartitionType partitionType, String partitionExpression)
      Ensures that a HASH partition exists.
      Parameters:
      name - The partition's name.
      modulus - The HASH partition's 'modulus' clause.
      remainder - The HASH partition's 'remainder' clause.
      partitionType - The partition's PartitionType if it is going to be sub-partitioned.
      partitionExpression - The partition's partitionExpression if it is going to be sub-partitioned.
      Returns:
      The Partition
    • isCommitted

      public boolean isCommitted()
      Specified by:
      isCommitted in interface TopologyInf
    • isRangePartition

      public boolean isRangePartition()
    • isListPartition

      public boolean isListPartition()
    • isHashPartition

      public boolean isHashPartition()
    • isPartition

      public boolean isPartition()
    • ensureIndexExists

      public Index ensureIndexExists(IndexType indexType, List<PropertyColumn> properties)
    • getSchema

      public abstract Schema getSchema()
    • getTopology

      public abstract Topology getTopology()
    • getLabel

      public String getLabel()
    • getName

      public String getName()
      Specified by:
      getName in interface TopologyInf
    • getFullName

      public String getFullName()
    • getPartitionType

      public PartitionType getPartitionType()
    • getPartitionExpression

      public String getPartitionExpression()
    • setPartitionType

      public void setPartitionType(PartitionType partitionType)
    • setPartitionExpression

      public void setPartitionExpression(String partitionExpression)
    • getPartition

      public Optional<Partition> getPartition(String name)
      Does a recursive search for a partition with the given name.
      Parameters:
      name - The partition to returns name.
      Returns:
      The partition as an Optional.
    • getPartitions

      public Map<String,Partition> getPartitions()
    • getProperties

      public Map<String,PropertyColumn> getProperties()
    • getIdentifiers

      public org.apache.commons.collections4.set.ListOrderedSet<String> getIdentifiers()
    • getProperty

      public Optional<PropertyColumn> getProperty(String key)
    • getIndexes

      public Map<String,Index> getIndexes()
    • getIndex

      public Optional<Index> getIndex(String key)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • validateTopology

      protected abstract List<Topology.TopologyValidationError> validateTopology(DatabaseMetaData metadata) throws SQLException
      Throws:
      SQLException
    • getPrefix

      public abstract String getPrefix()
    • internalUpdatePropertyDefinition

      protected void internalUpdatePropertyDefinition(PropertyColumn propertyColumn, PropertyDefinition propertyDefinition, PropertyDefinition currentPropertyDefinition, String name, PropertyColumn copy)
    • removePartition

      public void removePartition(Partition partition, boolean preserveData)
    • hasIDPrimaryKey

      public boolean hasIDPrimaryKey()
    • ensureDistributed

      public void ensureDistributed(int shardCount, PropertyColumn distributionPropertyColumn, AbstractLabel colocate)
    • isDistributed

      public boolean isDistributed()
    • getDistributionPropertyColumn

      public PropertyColumn getDistributionPropertyColumn()
    • getDistributionColocate

      public AbstractLabel getDistributionColocate()
    • getShardCount

      public int getShardCount()