Package org.lilyproject.repository.impl.id

Examples of org.lilyproject.repository.impl.id.AbsoluteRecordIdImpl


    public void addDependency(SchemaId field) {
        RecordContext ctx = contexts.peek();
        try {
            if (!ctx.dep.moreDimensionedVariants.isEmpty() || !ctx.dep.id.equals(recordId)) { // avoid adding unnecesary self-references
                dependencies.get(DerefMapUtil.newEntry(
                        new AbsoluteRecordIdImpl(table, ctx.dep.id), ctx.dep.moreDimensionedVariants)).add(field);
            }
        } catch (ExecutionException ee) {
            throw new RuntimeException("Failed to update dependencies");
        }
    }
View Full Code Here


    public static void tearDownAfterClass() throws Exception {
        Closer.close(repoSetup);
    }

    private static AbsoluteRecordId absId(RecordId recordId) {
        return new AbsoluteRecordIdImpl(Table.RECORD.name, recordId);
    }
View Full Code Here

            final byte[] masterBytes = dataInput.readBytes(masterBytesLength);

            final DerefMapVariantPropertiesPattern variantPropertiesPattern =
                    deserializeVariantPropertiesPattern(dataInput);

            result.add(new DependencyEntry(new AbsoluteRecordIdImpl(table,
                    idGenerator.newRecordId(idGenerator.fromBytes(masterBytes),
                            variantPropertiesPattern.getConcreteProperties())),
                    variantPropertiesPattern.getPatternProperties()));
        }
View Full Code Here

        // dereferenced into multiple vtagged versions of another record, and we don't know what the [indexed]
        // vtags of that other record are.
        for (SchemaId vtag : allVTags) {
            if ((changedVTagFields != null && changedVTagFields.contains(vtag)) || updatedFieldsByScope == null) {
                // changed vtags or delete: reindex regardless of fields
                AbsoluteRecordId absRecordId = new AbsoluteRecordIdImpl(table, recordId);
                DependantRecordIdsIterator dependants = derefMap.findDependantsOf(absRecordId);
                if (log.isDebugEnabled()) {
                    log.debug("changed vtag: dependants of " + recordId + ": " +
                            depIds(derefMap.findDependantsOf(absRecordId)));
                }
                while (dependants.hasNext()) {
                    referrersAndVTags.put(dependants.next(), vtag);
                }
            } else {
                // vtag didn't change, but some fields did change:
                Set<SchemaId> fields = new HashSet<SchemaId>();
                for (Scope scope : updatedFieldsByScope.keySet()) {
                    fields.addAll(toSchemaIds(updatedFieldsByScope.get(scope)));
                }
                AbsoluteRecordId absRecordId = new AbsoluteRecordIdImpl(table, recordId);
                final DependantRecordIdsIterator dependants = derefMap.findDependantsOf(absRecordId, fields, vtag);
                while (dependants.hasNext()) {
                    referrersAndVTags.put(dependants.next(), vtag);
                }
            }
View Full Code Here

            log.debug("Updating dependencies for " + record.getId());
            logDependencies(record.getId(), solrDocumentBuilder.getDependencies());
        }

        if (derefMap != null) {
            derefMap.updateDependants(new AbsoluteRecordIdImpl(table, record.getId()),
                    vtag, solrDocumentBuilder.getDependencies());
        }
    }
View Full Code Here

    }

    @Test
    public void serializeEntriesForward() throws Exception {
        final Set<DependencyEntry> dependencies = new HashSet<DependencyEntry>();
        dependencies.add(new DependencyEntry(new AbsoluteRecordIdImpl("tableA", ids.newRecordId("id1")),
                new HashSet<String>()));
        dependencies
                .add(new DependencyEntry(new AbsoluteRecordIdImpl("tableB", ids.newRecordId("id2",
                        ImmutableMap.of("bar", "x"))), Sets.newHashSet("foo")));

        final Set<DependencyEntry> deserialized = serializationUtil.deserializeDependenciesForward(
                serializationUtil.serializeDependenciesForward(dependencies));
View Full Code Here

TOP

Related Classes of org.lilyproject.repository.impl.id.AbsoluteRecordIdImpl

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.