Package org.lilyproject.repository.api

Examples of org.lilyproject.repository.api.SchemaId


                if (Arrays.equals(RecordCf.DATA.bytes, family.getKey())) {
                    NavigableMap<byte[], NavigableMap<Long, byte[]>> columnsSet = family.getValue();
                    for (Entry<byte[], NavigableMap<Long, byte[]>> column : columnsSet.entrySet()) {
                        try {
                            byte[] columnQualifier = column.getKey();
                            SchemaId schemaId =
                                    new SchemaIdImpl(Bytes.tail(columnQualifier, columnQualifier.length - 1));
                            FieldType fieldType = typeManager.getFieldTypeById(schemaId);
                            ValueType valueType = fieldType.getValueType();
                            NavigableMap<Long, byte[]> cells = column.getValue();
                            Set<Entry<Long, byte[]>> cellsSet = cells.entrySet();
View Full Code Here


            }
        }

        // If the last follow is a RecordFieldFollow, we check that the Value isn't something which requires a real Record
        if (lastFollowIsRecord) {
            SchemaId fieldDependency = value.getFieldDependency();
            if (systemFields.isSystemField(fieldDependency)) {
                checkSystemFieldUsage(fieldEl, valueExpr, fieldDependency, new QName(SystemFields.NS, "id"));
                checkSystemFieldUsage(fieldEl, valueExpr, fieldDependency, new QName(SystemFields.NS, "link"));
            }
        }
View Full Code Here

        assertEquals(1, referrers.size());
    }

    @Test
    public void testLinkIndex_AcrossTables() throws Exception {
        SchemaId liveTag = repository.getIdGenerator().getSchemaId(UUID.randomUUID());

        Set<FieldedLink> links1 = new HashSet<FieldedLink>();
        links1.add(new FieldedLink(ids.newAbsoluteRecordId(TABLE_A, "id1"), field1));
        links1.add(new FieldedLink(ids.newAbsoluteRecordId(TABLE_A, "id2"), field1));
View Full Code Here

        testLinkIndexRetrievalWithProvidedIds(id1, id2, id3, id4);
    }

    private void testLinkIndexRetrievalWithProvidedIds(RecordId id1, RecordId id2, RecordId id3, RecordId id4) throws Exception {
        SchemaId liveTag = repository.getIdGenerator().getSchemaId(UUID.randomUUID());

        Set<FieldedLink> links1 = new HashSet<FieldedLink>();
        links1.add(new FieldedLink(createAbsoluteId(id1), field1));
        links1.add(new FieldedLink(createAbsoluteId(id2), field1));
View Full Code Here

        recordType.addFieldTypeEntry(typeManager.newFieldTypeEntry(versionedMutableFt.getId(), false));
        recordType.addFieldTypeEntry(typeManager.newFieldTypeEntry(nestedFt.getId(), false));
        recordType.addFieldTypeEntry(typeManager.newFieldTypeEntry(complexFt.getId(), false));
        recordType = typeManager.createRecordType(recordType);

        SchemaId lastVTag = typeManager.getFieldTypeByName(VersionTag.LAST).getId();

        //
        // Link extraction from a record without versions
        //
        {
View Full Code Here

            log.debug("Stop run blob incubator monitor");
        }

        private void checkResult(Result result) throws IOException, RepositoryException, InterruptedException {
            byte[] recordIdBytes = result.getValue(BlobIncubatorCf.REF.bytes, BlobIncubatorColumn.RECORD.bytes);
            SchemaId recordId = new SchemaIdImpl(recordIdBytes);
            byte[] blobKey = result.getRow();
            if (Arrays.equals(recordIdBytes,BlobManagerImpl.INCUBATE)) {
                    deleteBlob(blobKey, recordId, null);
            } else {
                SchemaId fieldId = new SchemaIdImpl(result.getValue(BlobIncubatorCf.REF.bytes, BlobIncubatorColumn.FIELD.bytes));
                Result blobUsage;
                try {
                    blobUsage = getBlobUsage(blobKey, recordId, fieldId);
                    if (blobUsage == null || blobUsage.isEmpty()) {
                        deleteBlob(blobKey, recordId, fieldId); // Delete blob and reference
View Full Code Here

    @GET
    @Produces("application/json")
    public Entity<RecordType> get(@PathParam("id") String id, @Context UriInfo uriInfo) {
        try {
            SchemaId schemaId = idGenerator.getSchemaId(id);
            return Entity.create(typeManager.getRecordTypeById(schemaId, null), uriInfo);
        } catch (RecordTypeNotFoundException e) {
            throw new ResourceException(e, NOT_FOUND.getStatusCode());
        } catch (Exception e) {
            throw new ResourceException("Error loading record type with id " + id, e, INTERNAL_SERVER_ERROR.getStatusCode());
View Full Code Here

    @PUT
    @Produces("application/json")
    @Consumes("application/json")
    public Response put(@PathParam("id") String id, RecordType recordType, @Context UriInfo uriInfo) {
        SchemaId schemaId = idGenerator.getSchemaId(id);

        if (recordType.getId() != null && !recordType.getId().equals(schemaId)) {
            throw new ResourceException("ID in submitted record type does not match the id in URI.",
                    BAD_REQUEST.getStatusCode());
        }
View Full Code Here

    @GET
    @Produces("application/json")
    public Entity<RecordType> get(@PathParam("id") String id, @PathParam("version") Long version,
            @Context UriInfo uriInfo) {
        try {
            SchemaId schemaId = idGenerator.getSchemaId(id);
            RecordType recordType = typeManager.getRecordTypeById(schemaId, version);
            return Entity.create(recordType, uriInfo);
        } catch (RecordTypeNotFoundException e) {
            throw new ResourceException(e, NOT_FOUND.getStatusCode());
        } catch (Exception e) {
View Full Code Here

            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

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.