Package org.lilyproject.repository.api

Examples of org.lilyproject.repository.api.SchemaId


    @Test
    public void multipleDependencies() throws Exception {
        String idPrefix = newIdPrefix();

        final SchemaId dummyVtag = ids.getSchemaId(UUID.randomUUID());
        final SchemaId dependencyField = ids.getSchemaId(UUID.randomUUID());
        final RecordId dependant = ids.newRecordId(idPrefix + "dependant");
        final RecordId dependency1 = ids.newRecordId(idPrefix + "dependency1");
        final RecordId dependency2 = ids.newRecordId(idPrefix + "dependency2");

        // the dependant depends on the dependencyField of the dependency1 and dependency2
View Full Code Here


    @Test
    public void multipleVariantsDependingOnMaster() throws Exception {
        String idPrefix = newIdPrefix();

        final SchemaId dummyVtag = ids.getSchemaId(UUID.randomUUID());
        final SchemaId dependencyField = ids.getSchemaId(UUID.randomUUID());

        final RecordId master = ids.newRecordId(idPrefix + "myrecord");
        final RecordId v1variant = ids.newRecordId(idPrefix + "myrecord", Collections.singletonMap("v1", "x"));
        final RecordId v1v2variant = ids.newRecordId(idPrefix + "myrecord", map("v1", "x", "v2", "y"));
View Full Code Here

    @Test
    public void multipleDependants() throws Exception {
        String idPrefix = newIdPrefix();

        final SchemaId dummyVtag = ids.getSchemaId(UUID.randomUUID());
        final SchemaId dependencyField = ids.getSchemaId(UUID.randomUUID());
        final RecordId dependant1 = ids.newRecordId(idPrefix + "dependant1");
        final RecordId dependant2 = ids.newRecordId(idPrefix + "dependant2");
        final RecordId dependency = ids.newRecordId(idPrefix + "dependency");

        // the dependant1 and dependant2 depend on the dependencyField of the dependency
View Full Code Here

    }

    @Test
    public void resultIndependentOfOrder() throws Exception {
        for (int i = 0; i < 10; i++) {
            final SchemaId dummyVtag = ids.getSchemaId(UUID.randomUUID());
            final SchemaId dependencyField = ids.getSchemaId(UUID.randomUUID());

            final RecordId master = ids.newRecordId();
            final RecordId var1 = ids.newRecordId(master, Collections.singletonMap("prop1", "x"));
            final RecordId var2 = ids.newRecordId(master, map("prop1", "x", "prop2", "y"));
View Full Code Here

        }
    }

    @Test
    public void twoVTagsDependingOnOneRecord() throws Exception {
        final SchemaId tag1 = ids.getSchemaId(UUID.randomUUID());
        final SchemaId tag2 = ids.getSchemaId(UUID.randomUUID());
        final SchemaId field = ids.getSchemaId(UUID.randomUUID());
        final Set<SchemaId> fields = Sets.newHashSet(field);

        final RecordId a = ids.newRecordId();
        final RecordId b = ids.newRecordId();
View Full Code Here

     * @param fieldType
     */
    public void update(FieldType fieldType) {
        // Clone the FieldType to avoid changes to it while it is in the cache
        FieldType ftToCache = fieldType.clone();
        SchemaId id = ftToCache.getId();
        String bucketId = AbstractSchemaCache.encodeHex(id.getBytes());
        // First increment the number of buckets that are being updated
        incCount();
        // Get a lock on the bucket to be updated
        synchronized (getBucketMonitor(bucketId)) {
            Map<SchemaId, FieldType> bucket = buckets.get(bucketId);
View Full Code Here

        if (subRecordType.equals(superRecordType)) {
            return true;
        }

        // Check the ancestor record types
        SchemaId superRecordTypeId = typeManager.getRecordTypeByName(superRecordType, null).getId();
        RecordType subRecordTypeObject = typeManager.getRecordTypeByName(subRecordType, null);
        return searchParentsLatestVersion(subRecordTypeObject, superRecordTypeId, typeManager);
    }
View Full Code Here

        if (record.getRecordTypeName().equals(requestedRecordTypeName)) {
            return true;
        }

        // Check the ancestor record types
        SchemaId searchedRecordType = typeManager.getRecordTypeByName(requestedRecordTypeName, null).getId();
        RecordType recordType = typeManager.getRecordTypeByName(record.getRecordTypeName(), record.getRecordTypeVersion());
        return searchParents(recordType, searchedRecordType, typeManager);
    }
View Full Code Here

            idxSel.setNewRecordExists(true);

            if (indexesInfo.getRecordFilterDependsOnRecordType()) {
                // Because record type names can change, this is not guaranteed to be the same as what gets
                // stored in the repo, but that doesn't matter as it is only for indexing purposes.
                SchemaId oldRecordTypeId = typeMgr.getRecordTypeByName(originalRecord.getRecordTypeName(), null).getId();
                idxSel.setOldRecordType(oldRecordTypeId);
                // on update, specifying record type is optional
                idxSel.setNewRecordType(record.getRecordTypeName() != null ?
                        typeMgr.getRecordTypeByName(record.getRecordTypeName(), null).getId() : oldRecordTypeId);
            }
View Full Code Here

        for (Map.Entry<byte[], NavigableMap<Long, byte[]>> column : cf.entrySet()) {
            byte[] columnKey = column.getKey();

            if (columnKey[0] == RecordColumn.DATA_PREFIX) {
                SchemaId fieldId = new SchemaIdImpl(Arrays.copyOfRange(columnKey, 1, columnKey.length));

                for (Map.Entry<Long, byte[]> version : column.getValue().entrySet()) {
                    long versionNr = version.getKey();
                    byte[] value = version.getValue();
View Full Code Here

TOP

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

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.