Package com.thinkaurelius.titan.diskstorage

Examples of com.thinkaurelius.titan.diskstorage.StaticBuffer.compareTo()


            OperationStatus status = cursor.getSearchKeyRange(foundKey, foundData, LockMode.DEFAULT);
            //Iterate until given condition is satisfied or end of records
            while (status == OperationStatus.SUCCESS) {
                StaticBuffer key = getBuffer(foundKey);

                if (key.compareTo(keyEnd) >= 0)
                    break;

                if (selector.include(key)) {
                    result.add(new KeyValueEntry(key, getBuffer(foundData)));
                }
View Full Code Here


                    int vallen = oldValue.getInt(oldindex);
                    oldindex += VALUE_LEN_BYTES;
                    StaticBuffer col = oldValue.subrange(oldindex, collen);
                    int cmp = -1;
                    boolean replace = false;
                    while (addindex < additions.size() && (cmp = col.compareTo(additions.get(addindex).getColumn())) >= 0) {
                        //insert before
                        insert(additions.get(addindex), out);
                        addindex++;
                        if (cmp == 0) replace = true;
                    }
View Full Code Here

                        //insert before
                        insert(additions.get(addindex), out);
                        addindex++;
                        if (cmp == 0) replace = true;
                    }
                    if (delindex < deletions.size() && col.compareTo(deletions.get(delindex)) == 0) {
                        delindex++;
                    } else if (!replace) {
                        insert(col, oldValue.subrange(oldindex + collen, vallen), out);
                    }
                    //Iterate out missing deletions
View Full Code Here

                        delindex++;
                    } else if (!replace) {
                        insert(col, oldValue.subrange(oldindex + collen, vallen), out);
                    }
                    //Iterate out missing deletions
                    while (delindex < deletions.size() && col.compareTo(deletions.get(delindex)) >= 0) {
                        delindex++;
                    }
                    oldindex += collen + vallen;
                }
                //Write remaining additions
View Full Code Here

                        int collen = fromUnsignedShort(value.getShort(index));
                        index += COLUMN_LEN_BYTES;
                        int vallen = value.getInt(index);
                        index += VALUE_LEN_BYTES;
                        StaticBuffer col = value.subrange(index, collen);
                        if (col.compareTo(slice.getSliceStart()) >= 0 && col.compareTo(slice.getSliceEnd()) < 0) {
                            return true;
                        }
                        index += collen + vallen;
                    }
                    return false;
View Full Code Here

                        int collen = fromUnsignedShort(value.getShort(index));
                        index += COLUMN_LEN_BYTES;
                        int vallen = value.getInt(index);
                        index += VALUE_LEN_BYTES;
                        StaticBuffer col = value.subrange(index, collen);
                        if (col.compareTo(slice.getSliceStart()) >= 0 && col.compareTo(slice.getSliceEnd()) < 0) {
                            return true;
                        }
                        index += collen + vallen;
                    }
                    return false;
View Full Code Here

                index += COLUMN_LEN_BYTES;
                int vallen = value.getInt(index);
                index += VALUE_LEN_BYTES;
                StaticBuffer col = value.subrange(index, collen);
                if (!foundStart) {
                    if (col.compareTo(slice.getSliceStart()) >= 0) {
                        foundStart = true;
                    } else {
                        index += collen + vallen;
                        continue;
                    }
View Full Code Here

                    } else {
                        index += collen + vallen;
                        continue;
                    }
                }
                if (foundStart && col.compareTo(slice.getSliceEnd()) >= 0) //the end
                    return null;

                StaticBuffer val = value.subrange(index + collen, vallen);
                index += collen + vallen;
                return new StaticBufferEntry(col, val);
View Full Code Here

                            break;

                        default: throw new AssertionError(type.getSortOrder().toString());
                    }

                    assert sliceStart.compareTo(sliceEnd)<=0;
                    wroteInterval = true;
                    break;
                }
            }
            boolean wroteEntireSortKey = (i >= sortKeyIDs.length);
View Full Code Here

        return true;
    }

    private boolean columnInRange(StaticBuffer concat, StaticBuffer columnStart, StaticBuffer columnEnd) {
        StaticBuffer column = getColumn(concat);
        return column.compareTo(columnStart) >= 0 && column.compareTo(columnEnd) < 0;
    }

    private class ContainsSelector implements KeySelector {

        private final StaticBuffer checkKey;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.