Package org.lilyproject.hbaseindex

Examples of org.lilyproject.hbaseindex.QueryResult


        query.addEqualsCondition("dependant_recordid", parentRecordId.toBytes());
        query.addEqualsCondition("dependant_vtag", vtag.getBytes());

        final Set<DependencyEntry> result;

        final QueryResult queryResult = forwardDerefIndex.performQuery(query);
        if (queryResult.next() != null) {
            final byte[] serializedEntries = queryResult.getData(DEPENDENCIES_KEY);
            result = this.serializationUtil.deserializeDependenciesForward(serializedEntries);

            if (queryResult.next() != null) {
                throw new IllegalStateException(
                        "Expected only a single matching entry in " + forwardDerefIndex.getDefinition().getName());
            }

        } else {
View Full Code Here


                query.addEqualsCondition("word", Words.get());

                int resultCount = 0;

                long before = System.nanoTime();
                QueryResult result = index.performQuery(query);
                while (result.next() != null && resultCount < maxResults) {
                    resultCount++;
                }
                double duration = System.nanoTime() - before;
                metrics.increment("Single field query duration", "Q", duration / 1e6d);
                metrics.increment("Single field query # of results", resultCount);
                result.close();
            } catch (Throwable t) {
                t.printStackTrace();
            }
        }
View Full Code Here

                query.setRangeCondition("word", prefix, prefix, true, true);

                int resultCount = 0;

                long before = System.nanoTime();
                QueryResult result = index.performQuery(query);
                while (result.next() != null && resultCount < maxResults) {
                    resultCount++;
                }
                double duration = System.nanoTime() - before;
                metrics.increment("Str rng query duration", "Q", duration / 1e6d);
                metrics.increment("Str rng query # of results", resultCount);
                result.close();
            } catch (Throwable t) {
                t.printStackTrace();
            }
        }
View Full Code Here

                query.addEqualsCondition("sourcefield", sourceField.getBytes());
            }

            Set<AbsoluteRecordId> result = Sets.newHashSet();

            QueryResult qr = backwardIndex.performQuery(query);
            byte[] id;
            while ((id = qr.next()) != null) {
                result.add(getIdGenerator().absoluteFromBytes(id));
            }
            Closer.close(
                    qr); // Not closed in finally block: avoid HBase contact when there could be connection problems.
View Full Code Here

                query.addEqualsCondition("vtag", vtag.getBytes());
            }

            Set<FieldedLink> result = new HashSet<FieldedLink>();

            QueryResult qr = backwardIndex.performQuery(query);
            byte[] id;
            while ((id = qr.next()) != null) {
                SchemaId sourceField = getIdGenerator().getSchemaId(qr.getData(SOURCE_FIELD_KEY));
                result.add(new FieldedLink(getIdGenerator().absoluteFromBytes(id), sourceField));
            }
            Closer.close(
                    qr); // Not closed in finally block: avoid HBase contact when there could be connection problems.
View Full Code Here

            Query query = new Query();
            query.addEqualsCondition("source", record.toBytes());

            Set<Pair<FieldedLink, SchemaId>> result = new HashSet<Pair<FieldedLink, SchemaId>>();

            QueryResult qr = forwardIndex.performQuery(query);
            byte[] id;
            while ((id = qr.next()) != null) {
                SchemaId sourceField = getIdGenerator().getSchemaId(qr.getData(SOURCE_FIELD_KEY));
                SchemaId vtag = getIdGenerator().getSchemaId(qr.getData(VTAG_KEY));
                result.add(
                        new Pair<FieldedLink, SchemaId>(new FieldedLink(getIdGenerator().absoluteFromBytes(id), sourceField), vtag));
            }
            Closer.close(
                    qr); // Not closed in finally block: avoid HBase contact when there could be connection problems.
View Full Code Here

                query.addEqualsCondition("sourcefield", sourceField.getBytes());
            }

            Set<AbsoluteRecordId> result = new HashSet<AbsoluteRecordId>();

            QueryResult qr = forwardIndex.performQuery(query);
            byte[] id;
            while ((id = qr.next()) != null) {
                result.add(getIdGenerator().absoluteFromBytes(id));
            }
            Closer.close(
                    qr); // Not closed in finally block: avoid HBase contact when there could be connection problems.
View Full Code Here

                query.addEqualsCondition("vtag", vtag.getBytes());
            }

            Set<FieldedLink> result = new HashSet<FieldedLink>();

            QueryResult qr = forwardIndex.performQuery(query);
            byte[] id;
            while ((id = qr.next()) != null) {
                SchemaId sourceField = getIdGenerator().getSchemaId(qr.getData(SOURCE_FIELD_KEY));
                result.add(new FieldedLink(getIdGenerator().absoluteFromBytes(id), sourceField));
            }
            Closer.close(
                    qr); // Not closed in finally block: avoid HBase contact when there could be connection problems.
View Full Code Here

TOP

Related Classes of org.lilyproject.hbaseindex.QueryResult

Copyright © 2018 www.massapicom. 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.