public ClusteringPrefix deserialize(DataInputPlus in) throws IOException { // We're reading the old cellname/composite ByteBuffer bb = ByteBufferUtil.readWithShortLength(in); assert bb.hasRemaining(); // empty cellnames were invalid int clusteringSize = metadata.clusteringColumns().size(); // If the table has no clustering column, then the cellname will just be the "column" name, which we ignore here. if (clusteringSize == 0) return Clustering.EMPTY; if (!metadata.isCompound()) return Clustering.make(bb); List<ByteBuffer> components = CompositeType.splitName(bb); byte eoc = CompositeType.lastEOC(bb); if (eoc == 0 || components.size() >= clusteringSize) { // That's a clustering. if (components.size() > clusteringSize) components = components.subList(0, clusteringSize); return Clustering.make(components.toArray(new ByteBuffer[clusteringSize])); } else { // It's a range tombstone bound. It is a start since that's the only part we've ever included // in the index entries. ClusteringPrefix.Kind boundKind = eoc > 0 ? ClusteringPrefix.Kind.EXCL_START_BOUND : ClusteringPrefix.Kind.INCL_START_BOUND; return ClusteringBound.create(boundKind, components.toArray(new ByteBuffer[components.size()])); } }
public ClusteringPrefix deserialize(DataInputPlus in) throws IOException { // We're reading the old cellname/composite ByteBuffer bb = ByteBufferUtil.readWithShortLength(in); assert bb.hasRemaining(); // empty cellnames were invalid int clusteringSize = metadata.clusteringColumns().size(); // If the table has no clustering column, then the cellname will just be the "column" name, which we ignore here. if (clusteringSize == 0) return Clustering.EMPTY; if (!metadata.isCompound()) return Clustering.make(bb); List<ByteBuffer> components = CompositeType.splitName(bb); byte eoc = CompositeType.lastEOC(bb); if (eoc == 0 || components.size() >= clusteringSize) { // That's a clustering. if (components.size() > clusteringSize) components = components.subList(0, clusteringSize); return Clustering.make(components.toArray(new ByteBuffer[clusteringSize])); } else { // It's a range tombstone bound. It is a start since that's the only part we've ever included // in the index entries. ClusteringPrefix.Kind boundKind = eoc > 0 ? ClusteringPrefix.Kind.EXCL_START_BOUND : ClusteringPrefix.Kind.INCL_START_BOUND; return ClusteringBound.create(boundKind, components.toArray(new ByteBuffer[components.size()])); } }
public ClusteringPrefix deserialize(DataInputPlus in) throws IOException { // We're reading the old cellname/composite ByteBuffer bb = ByteBufferUtil.readWithShortLength(in); assert bb.hasRemaining(); // empty cellnames were invalid int clusteringSize = metadata.clusteringColumns().size(); // If the table has no clustering column, then the cellname will just be the "column" name, which we ignore here. if (clusteringSize == 0) return Clustering.EMPTY; if (!metadata.isCompound()) return Clustering.make(bb); List<ByteBuffer> components = CompositeType.splitName(bb); byte eoc = CompositeType.lastEOC(bb); if (eoc == 0 || components.size() >= clusteringSize) { // That's a clustering. if (components.size() > clusteringSize) components = components.subList(0, clusteringSize); return Clustering.make(components.toArray(new ByteBuffer[clusteringSize])); } else { // It's a range tombstone bound. It is a start since that's the only part we've ever included // in the index entries. ClusteringPrefix.Kind boundKind = eoc > 0 ? ClusteringPrefix.Kind.EXCL_START_BOUND : ClusteringPrefix.Kind.INCL_START_BOUND; return ClusteringBound.create(boundKind, components.toArray(new ByteBuffer[components.size()])); } }
public ClusteringPrefix deserialize(DataInputPlus in) throws IOException { // We're reading the old cellname/composite ByteBuffer bb = ByteBufferUtil.readWithShortLength(in); assert bb.hasRemaining(); // empty cellnames were invalid int clusteringSize = metadata.clusteringColumns().size(); // If the table has no clustering column, then the cellname will just be the "column" name, which we ignore here. if (clusteringSize == 0) return Clustering.EMPTY; if (!metadata.isCompound()) return Clustering.make(bb); List<ByteBuffer> components = CompositeType.splitName(bb); byte eoc = CompositeType.lastEOC(bb); if (eoc == 0 || components.size() >= clusteringSize) { // That's a clustering. if (components.size() > clusteringSize) components = components.subList(0, clusteringSize); return Clustering.make(components.toArray(new ByteBuffer[clusteringSize])); } else { // It's a range tombstone bound. It is a start since that's the only part we've ever included // in the index entries. ClusteringPrefix.Kind boundKind = eoc > 0 ? ClusteringPrefix.Kind.EXCL_START_BOUND : ClusteringPrefix.Kind.INCL_START_BOUND; return ClusteringBound.create(boundKind, components.toArray(new ByteBuffer[components.size()])); } }
byte eoc = CompositeType.lastEOC(bound);
byte eoc = CompositeType.lastEOC(bound);
byte eoc = CompositeType.lastEOC(bound);
byte eoc = CompositeType.lastEOC(bound);