Package org.lilyproject.repository.api

Examples of org.lilyproject.repository.api.IdRecord


        repository.create(record);

        RecordScan scan = new RecordScan();

        IdRecordScanner scanner = repository.getScannerWithIds(scan);
        final IdRecord next = scanner.next();
        assertNotNull(next);
        assertFalse(next.getFieldIdToNameMapping().isEmpty());
    }
View Full Code Here


        RecordScanner scanner = repository.getScanner(scan);
        final Record next = scanner.next();
        assertNotNull(next);

        // this cast will fail
        final IdRecord casted = (IdRecord) next;
    }
View Full Code Here

        scan.setStartRecordId(newDep.id.getMaster());
        scan.setRecordFilter(new RecordVariantFilter(newDep.id.getMaster(), varProps));
        LRepository repository = indexUpdateBuilder.getRepository();
        LTable table = repository.getTable(indexUpdateBuilder.getTable());
        final IdRecordScanner scanner = table.getScannerWithIds(scan);
        IdRecord next;
        while ((next = scanner.next()) != null) {
            try {
                final Record record = VersionTag.getIdRecord(next, indexUpdateBuilder.getVTag(), table, repository);
                result.add(record);
            } catch (RecordNotFoundException rnfe) {
View Full Code Here

        if (nonVersionedRecord == null) {
            if (record.getVersion() == null) {
                // record has no version, so no versioned fields, so no cloning necessary
                this.nonVersionedRecord = record;
            } else {
                IdRecord nonVersionedRecord = record.cloneRecord();
                reduceToNonVersioned(nonVersionedRecord, typeManager);
                this.nonVersionedRecord = nonVersionedRecord;
            }
        }
        return nonVersionedRecord;
View Full Code Here

        record.setRecordType(recordType1.getName(), recordType1.getVersion());
        record.setField(fieldType1.getName(), "hello");
        record.setField(fieldType2.getName(), new Integer(4));
        record = repository.create(record);

        IdRecord idRecord = repository.readWithIds(record.getId(), null, null);
        assertEquals("hello", idRecord.getField(fieldType1.getId()));
        assertTrue(idRecord.hasField(fieldType1.getId()));
        assertEquals(new Integer(4), idRecord.getField(fieldType2.getId()));
        assertTrue(idRecord.hasField(fieldType2.getId()));

        Map<SchemaId, Object> fields = idRecord.getFieldsById();
        assertEquals(2, fields.size());
        assertEquals("hello", fields.get(fieldType1.getId()));
        assertEquals(new Integer(4), fields.get(fieldType2.getId()));

        assertEquals(record, idRecord.getRecord());
    }
View Full Code Here

    private Set<FieldedLink> extractLinks(VTaggedRecord vtRecord, Long version) {
        long before = System.currentTimeMillis();
        try {
            Set<FieldedLink> links;
            IdRecord versionRecord = null;
            try {
                versionRecord = vtRecord.getIdRecord(version);
            } catch (RecordNotFoundException e) {
                // vtag points to a non-existing record
            }
View Full Code Here

            RecordType recordType = typeManager.getRecordTypeByName(record.getRecordTypeName(scope), record.getVersion());
            if (recordType != null) {
                recordTypeIds.put(scope, recordType.getId());
            }
        }
        IdRecord idRecord = new IdRecordImpl(record, map, recordTypeIds);
        return idRecord;
    }
View Full Code Here

        return result;
    }

    private void index(LTable table, VTaggedRecord vtRecord, Set<SchemaId> vtagsToIndex, SolrUpdateWriter solrUpdateWriter) throws Exception {
        IdRecord idRecord = vtRecord.getRecord();
        Map<Long, Set<SchemaId>> vtagsToIndexByVersion = getVtagsByVersion(vtagsToIndex, vtRecord.getVTags());
        for (Map.Entry<Long, Set<SchemaId>> entry : vtagsToIndexByVersion.entrySet()) {

            IdRecord version = null;
            try {
                version = vtRecord.getIdRecord(entry.getKey());
            } catch (VersionNotFoundException e) {
                // ok
            } catch (RecordNotFoundException e) {
View Full Code Here

TOP

Related Classes of org.lilyproject.repository.api.IdRecord

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.