public NavigableSet<Clustering> build() { built = true; if (hasMissingElements) return BTreeSet.empty(comparator); return BTreeSet.of(comparator, size == 0 ? Clustering.EMPTY : Clustering.make(elements)); }
public NavigableSet<Clustering> build() { built = true; if (hasMissingElements) return BTreeSet.empty(comparator); return BTreeSet.of(comparator, size == 0 ? Clustering.EMPTY : Clustering.make(elements)); }
public NavigableSet<Clustering> build() { built = true; if (hasMissingElements) return BTreeSet.empty(comparator); return BTreeSet.of(comparator, size == 0 ? Clustering.EMPTY : Clustering.make(elements)); }
public NavigableSet<Clustering> build() { built = true; if (hasMissingElements) return BTreeSet.empty(comparator); return BTreeSet.of(comparator, size == 0 ? Clustering.EMPTY : Clustering.make(elements)); }
/** * Returns the requested clustering columns. * * @param options the query options * @return the requested clustering columns */ public NavigableSet<Clustering> getClusteringColumns(QueryOptions options) { // If this is a names command and the table is a static compact one, then as far as CQL is concerned we have // only a single row which internally correspond to the static parts. In which case we want to return an empty // set (since that's what ClusteringIndexNamesFilter expects). if (cfm.isStaticCompactTable()) return BTreeSet.empty(cfm.comparator); return clusteringColumnsRestrictions.valuesAsClustering(options); }
/** * Returns the requested clustering columns. * * @param options the query options * @return the requested clustering columns */ public NavigableSet<Clustering> getClusteringColumns(QueryOptions options) { // If this is a names command and the table is a static compact one, then as far as CQL is concerned we have // only a single row which internally correspond to the static parts. In which case we want to return an empty // set (since that's what ClusteringIndexNamesFilter expects). if (cfm.isStaticCompactTable()) return BTreeSet.empty(cfm.comparator); return clusteringColumnsRestrictions.valuesAsClustering(options); }
/** * Returns the requested clustering columns. * * @param options the query options * @return the requested clustering columns */ public NavigableSet<Clustering> getClusteringColumns(QueryOptions options) { // If this is a names command and the table is a static compact one, then as far as CQL is concerned we have // only a single row which internally correspond to the static parts. In which case we want to return an empty // set (since that's what ClusteringIndexNamesFilter expects). if (cfm.isStaticCompactTable()) return BTreeSet.empty(cfm.comparator); return clusteringColumnsRestrictions.valuesAsClustering(options); }
public NavigableSet<ClusteringBound> buildBound(boolean isStart, boolean isInclusive) { built = true; if (hasMissingElements) return BTreeSet.empty(comparator); if (size == 0) return BTreeSet.of(comparator, isStart ? ClusteringBound.BOTTOM : ClusteringBound.TOP); ByteBuffer[] newValues = size == elements.length ? elements : Arrays.copyOf(elements, size); return BTreeSet.of(comparator, ClusteringBound.create(ClusteringBound.boundKind(isStart, isInclusive), newValues)); } }
public NavigableSet<ClusteringBound> buildBound(boolean isStart, boolean isInclusive) { built = true; if (hasMissingElements) return BTreeSet.empty(comparator); if (size == 0) return BTreeSet.of(comparator, isStart ? ClusteringBound.BOTTOM : ClusteringBound.TOP); ByteBuffer[] newValues = size == elements.length ? elements : Arrays.copyOf(elements, size); return BTreeSet.of(comparator, ClusteringBound.create(ClusteringBound.boundKind(isStart, isInclusive), newValues)); } }
public NavigableSet<ClusteringBound> buildBound(boolean isStart, boolean isInclusive) { built = true; if (hasMissingElements) return BTreeSet.empty(comparator); if (size == 0) return BTreeSet.of(comparator, isStart ? ClusteringBound.BOTTOM : ClusteringBound.TOP); ByteBuffer[] newValues = size == elements.length ? elements : Arrays.copyOf(elements, size); return BTreeSet.of(comparator, ClusteringBound.create(ClusteringBound.boundKind(isStart, isInclusive), newValues)); } }
public NavigableSet<ClusteringBound> buildBound(boolean isStart, boolean isInclusive) { built = true; if (hasMissingElements) return BTreeSet.empty(comparator); if (size == 0) return BTreeSet.of(comparator, isStart ? ClusteringBound.BOTTOM : ClusteringBound.TOP); ByteBuffer[] newValues = size == elements.length ? elements : Arrays.copyOf(elements, size); return BTreeSet.of(comparator, ClusteringBound.create(ClusteringBound.boundKind(isStart, isInclusive), newValues)); } }
public NavigableSet<ClusteringBound> buildBound(boolean isStart, boolean isInclusive) { built = true; if (hasMissingElements) return BTreeSet.empty(comparator); CBuilder builder = CBuilder.create(comparator); if (elementsList.isEmpty()) return BTreeSet.of(comparator, builder.buildBound(isStart, isInclusive)); // Use a TreeSet to sort and eliminate duplicates BTreeSet.Builder<ClusteringBound> set = BTreeSet.builder(comparator); for (int i = 0, m = elementsList.size(); i < m; i++) { List<ByteBuffer> elements = elementsList.get(i); set.add(builder.buildBoundWith(elements, isStart, isInclusive)); } return set.build(); } }
public NavigableSet<ClusteringBound> buildBound(boolean isStart, boolean isInclusive) { built = true; if (hasMissingElements) return BTreeSet.empty(comparator); CBuilder builder = CBuilder.create(comparator); if (elementsList.isEmpty()) return BTreeSet.of(comparator, builder.buildBound(isStart, isInclusive)); // Use a TreeSet to sort and eliminate duplicates BTreeSet.Builder<ClusteringBound> set = BTreeSet.builder(comparator); for (int i = 0, m = elementsList.size(); i < m; i++) { List<ByteBuffer> elements = elementsList.get(i); set.add(builder.buildBoundWith(elements, isStart, isInclusive)); } return set.build(); } }
public NavigableSet<ClusteringBound> buildBound(boolean isStart, boolean isInclusive) { built = true; if (hasMissingElements) return BTreeSet.empty(comparator); CBuilder builder = CBuilder.create(comparator); if (elementsList.isEmpty()) return BTreeSet.of(comparator, builder.buildBound(isStart, isInclusive)); // Use a TreeSet to sort and eliminate duplicates BTreeSet.Builder<ClusteringBound> set = BTreeSet.builder(comparator); for (int i = 0, m = elementsList.size(); i < m; i++) { List<ByteBuffer> elements = elementsList.get(i); set.add(builder.buildBoundWith(elements, isStart, isInclusive)); } return set.build(); } }
public NavigableSet<ClusteringBound> buildBound(boolean isStart, boolean isInclusive) { built = true; if (hasMissingElements) return BTreeSet.empty(comparator); CBuilder builder = CBuilder.create(comparator); if (elementsList.isEmpty()) return BTreeSet.of(comparator, builder.buildBound(isStart, isInclusive)); // Use a TreeSet to sort and eliminate duplicates BTreeSet.Builder<ClusteringBound> set = BTreeSet.builder(comparator); for (int i = 0, m = elementsList.size(); i < m; i++) { List<ByteBuffer> elements = elementsList.get(i); set.add(builder.buildBoundWith(elements, isStart, isInclusive)); } return set.build(); } }
public NavigableSet<Clustering> build() { built = true; if (hasMissingElements) return BTreeSet.empty(comparator); CBuilder builder = CBuilder.create(comparator); if (elementsList.isEmpty()) return BTreeSet.of(builder.comparator(), builder.build()); BTreeSet.Builder<Clustering> set = BTreeSet.builder(builder.comparator()); for (int i = 0, m = elementsList.size(); i < m; i++) { List<ByteBuffer> elements = elementsList.get(i); set.add(builder.buildWith(elements)); } return set.build(); }
public NavigableSet<Clustering> build() { built = true; if (hasMissingElements) return BTreeSet.empty(comparator); CBuilder builder = CBuilder.create(comparator); if (elementsList.isEmpty()) return BTreeSet.of(builder.comparator(), builder.build()); BTreeSet.Builder<Clustering> set = BTreeSet.builder(builder.comparator()); for (int i = 0, m = elementsList.size(); i < m; i++) { List<ByteBuffer> elements = elementsList.get(i); set.add(builder.buildWith(elements)); } return set.build(); }
public NavigableSet<Clustering> build() { built = true; if (hasMissingElements) return BTreeSet.empty(comparator); CBuilder builder = CBuilder.create(comparator); if (elementsList.isEmpty()) return BTreeSet.of(builder.comparator(), builder.build()); BTreeSet.Builder<Clustering> set = BTreeSet.builder(builder.comparator()); for (int i = 0, m = elementsList.size(); i < m; i++) { List<ByteBuffer> elements = elementsList.get(i); set.add(builder.buildWith(elements)); } return set.build(); }
public NavigableSet<Clustering> build() { built = true; if (hasMissingElements) return BTreeSet.empty(comparator); CBuilder builder = CBuilder.create(comparator); if (elementsList.isEmpty()) return BTreeSet.of(builder.comparator(), builder.build()); BTreeSet.Builder<Clustering> set = BTreeSet.builder(builder.comparator()); for (int i = 0, m = elementsList.size(); i < m; i++) { List<ByteBuffer> elements = elementsList.get(i); set.add(builder.buildWith(elements)); } return set.build(); }
public NavigableSet<ClusteringBound> boundsAsClustering(Bound bound, QueryOptions options) throws InvalidRequestException { MultiCBuilder builder = MultiCBuilder.create(comparator, hasIN() || hasMultiColumnSlice()); int keyPosition = 0; for (SingleRestriction r : restrictions) { if (handleInFilter(r, keyPosition)) break; if (r.isSlice()) { r.appendBoundTo(builder, bound, options); return builder.buildBoundForSlice(bound.isStart(), r.isInclusive(bound), r.isInclusive(bound.reverse()), r.getColumnDefs()); } r.appendBoundTo(builder, bound, options); if (builder.hasMissingElements()) return BTreeSet.empty(comparator); keyPosition = r.getLastColumn().position() + 1; } // Everything was an equal (or there was nothing) return builder.buildBound(bound.isStart(), true); }