@VisibleForTesting public ColumnDefinition(String ksName, String cfName, ColumnIdentifier name, AbstractType<?> type, int position, Kind kind) { super(ksName, cfName, name, type); assert name != null && type != null && kind != null; assert name.isInterned(); assert (position == NO_POSITION) == !kind.isPrimaryKeyKind(); // The position really only make sense for partition and clustering columns (and those must have one), // so make sure we don't sneak it for something else since it'd breaks equals() this.kind = kind; this.position = position; this.cellPathComparator = makeCellPathComparator(kind, type); this.cellComparator = cellPathComparator == null ? ColumnData.comparator : (a, b) -> cellPathComparator.compare(a.path(), b.path()); this.asymmetricCellPathComparator = cellPathComparator == null ? null : (a, b) -> cellPathComparator.compare(((Cell)a).path(), (CellPath) b); this.comparisonOrder = comparisonOrder(kind, isComplex(), Math.max(0, position), name); }
@VisibleForTesting public ColumnDefinition(String ksName, String cfName, ColumnIdentifier name, AbstractType<?> type, int position, Kind kind) { super(ksName, cfName, name, type); assert name != null && type != null && kind != null; assert name.isInterned(); assert (position == NO_POSITION) == !kind.isPrimaryKeyKind(); // The position really only make sense for partition and clustering columns (and those must have one), // so make sure we don't sneak it for something else since it'd breaks equals() this.kind = kind; this.position = position; this.cellPathComparator = makeCellPathComparator(kind, type); this.cellComparator = cellPathComparator == null ? ColumnData.comparator : (a, b) -> cellPathComparator.compare(a.path(), b.path()); this.asymmetricCellPathComparator = cellPathComparator == null ? null : (a, b) -> cellPathComparator.compare(((Cell)a).path(), (CellPath) b); this.comparisonOrder = comparisonOrder(kind, isComplex(), Math.max(0, position), name); }
@VisibleForTesting public ColumnDefinition(String ksName, String cfName, ColumnIdentifier name, AbstractType<?> type, int position, Kind kind) { super(ksName, cfName, name, type); assert name != null && type != null && kind != null; assert name.isInterned(); assert (position == NO_POSITION) == !kind.isPrimaryKeyKind(); // The position really only make sense for partition and clustering columns (and those must have one), // so make sure we don't sneak it for something else since it'd breaks equals() this.kind = kind; this.position = position; this.cellPathComparator = makeCellPathComparator(kind, type); this.cellComparator = cellPathComparator == null ? ColumnData.comparator : (a, b) -> cellPathComparator.compare(a.path(), b.path()); this.asymmetricCellPathComparator = cellPathComparator == null ? null : (a, b) -> cellPathComparator.compare(((Cell)a).path(), (CellPath) b); this.comparisonOrder = comparisonOrder(kind, isComplex(), Math.max(0, position), name); }
@VisibleForTesting public ColumnDefinition(String ksName, String cfName, ColumnIdentifier name, AbstractType<?> type, int position, Kind kind) { super(ksName, cfName, name, type); assert name != null && type != null && kind != null; assert name.isInterned(); assert (position == NO_POSITION) == !kind.isPrimaryKeyKind(); // The position really only make sense for partition and clustering columns (and those must have one), // so make sure we don't sneak it for something else since it'd breaks equals() this.kind = kind; this.position = position; this.cellPathComparator = makeCellPathComparator(kind, type); this.cellComparator = cellPathComparator == null ? ColumnData.comparator : (a, b) -> cellPathComparator.compare(a.path(), b.path()); this.asymmetricCellPathComparator = cellPathComparator == null ? null : (a, b) -> cellPathComparator.compare(((Cell)a).path(), (CellPath) b); this.comparisonOrder = comparisonOrder(kind, isComplex(), Math.max(0, position), name); }