Package org.lilyproject.repository.impl.id

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


        Closer.close(scanner);

        // Now extract the record and field types from the results
        for (Result scanResult : results) {
            if (scanResult.getValue(TypeCf.DATA.bytes, TypeColumn.FIELDTYPE_NAME.bytes) != null) {
                typeBucket.add(extractFieldType(new SchemaIdImpl(scanResult.getRow()), scanResult));
            } else if (scanResult.getValue(TypeCf.DATA.bytes, TypeColumn.RECORDTYPE_NAME.bytes) != null) {
                typeBucket.addAll(extractRecordType(new SchemaIdImpl(scanResult.getRow()), null, scanResult));
            }
        }
        return typeBucket;
    }
View Full Code Here


    /**
     * Generates a SchemaId based on a uuid and checks if it's not already in use
     */
    private SchemaId getValidId() throws IOException {
        SchemaId id = new SchemaIdImpl(UUID.randomUUID());
        byte[] rowId = id.getBytes();
        // The chance it would already exist is small
        if (typeTable.exists(new Get(rowId))) {
            return getValidId();
        }
        // The chance a same uuid is generated after doing the exists check is
View Full Code Here

    @Test
    public void testClone() {
        ValueType valueType = control.createMock(ValueType.class);
        control.replay();
        FieldType fieldType = new FieldTypeImpl(new SchemaIdImpl(UUID.randomUUID()), valueType, new QName("DS9", "name"), Scope.VERSIONED);
        assertEquals(fieldType, fieldType.clone());
        assertEquals(fieldType, fieldType.clone());
        control.verify();
    }
View Full Code Here

    private static final byte[] C1 = Bytes.toBytes("c1");
    private static final byte[] C2 = Bytes.toBytes("c2");
    private static final byte[] C3 = Bytes.toBytes("c3");

    private byte[] putRandomRecord(HTableInterface table) throws IOException {
        SchemaId id = new SchemaIdImpl(UUID.randomUUID());
        byte[] rowId = id.getBytes();
        Put put = new Put(rowId);
        put.add(CF, C1, Bytes.toBytes(random.nextInt()));
        put.add(CF, C2, Bytes.toBytes(random.nextInt()));
        put.add(CF, C3, Bytes.toBytes(random.nextInt()));
        table.put(put);
View Full Code Here

        typeTable.put(put);
    }

    @Test
    public void testGetTypeIgnoresConcurrentCounterRows() throws Exception {
        SchemaId id = new SchemaIdImpl(UUID.randomUUID());
        byte[] rowId = id.getBytes();

        typeTable.incrementColumnValue(rowId, DATA_COLUMN_FAMILY, CONCURRENT_COUNTER_COLUMN_NAME, 1);
        try {
            typeManager.getFieldTypeById(id);
            fail();
View Full Code Here

        if (!Arrays.equals(LilyHBaseSchema.RecordCf.DATA.bytes,kv.getFamily())) {
            return false;
        }
        final byte[] qualifier = kv.getQualifier();
        if (qualifier[0] == LilyHBaseSchema.RecordColumn.DATA_PREFIX) {
            SchemaId fieldId = new SchemaIdImpl(Bytes.tail(qualifier, qualifier.length - 1));
            FieldType fieldType  = null;
            try {
                fieldType = repository.getTypeManager().getFieldTypeById(fieldId);
            } catch (IllegalArgumentException e) {
                // no qualifier
View Full Code Here

TOP

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

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.