maedhroz commented on code in PR #2267: URL: https://github.com/apache/cassandra/pull/2267#discussion_r1184153167
########## src/java/org/apache/cassandra/io/tries/ReverseValueIterator.java: ########## @@ -0,0 +1,182 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.cassandra.io.tries; + +import javax.annotation.concurrent.NotThreadSafe; + +import org.apache.cassandra.io.util.Rebufferer; +import org.apache.cassandra.utils.bytecomparable.ByteComparable; +import org.apache.cassandra.utils.bytecomparable.ByteSource; + +/** + * Thread-unsafe reverse value iterator for on-disk tries. Uses the assumptions of Walker. + */ +@NotThreadSafe +public class ReverseValueIterator<Concrete extends ReverseValueIterator<Concrete>> extends Walker<Concrete> +{ + private final ByteSource limit; + private IterationPosition stack; + private long next; + private boolean reportingPrefixes; + + static class IterationPosition + { + final long node; + final int limit; + final IterationPosition prev; + int childIndex; + + public IterationPosition(long node, int childIndex, int limit, IterationPosition prev) + { + super(); + this.node = node; + this.childIndex = childIndex; + this.limit = limit; + this.prev = prev; + } + } + + protected ReverseValueIterator(Rebufferer source, long root) Review Comment: nit: Anything use this ctor? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]

