Package org.lilyproject.repository.impl.id

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


        HBASE_PROXY = new HBaseProxy();
        HBASE_PROXY.start();
        zooKeeper = ZkUtil.connect(HBASE_PROXY.getZkConnectString(), 10000);
        hbaseTableFactory = new HBaseTableFactoryImpl(HBASE_PROXY.getConf());
        typeTable = LilyHBaseSchema.getTypeTable(hbaseTableFactory);
        typeManager = new HBaseTypeManager(new IdGeneratorImpl(), HBASE_PROXY.getConf(), zooKeeper, hbaseTableFactory);
        valueType = typeManager.getValueType("LONG");
    }
View Full Code Here


        return reader.fromJson(JsonFormat.deserializeNonStd(data), new NamespacesImpl(false), repository);
    }

    @Test
    public void testScanRecordId() throws Exception {
        IdGenerator idGenerator = new IdGeneratorImpl();

        RecordScan scan = new RecordScan();
        scan.setStartRecordId(idGenerator.newRecordId());
        scan.setStopRecordId(idGenerator.newRecordId("foo"));

        byte[] data = scanToBytes(scan);
        RecordScan parsedScan = scanFromBytes(data);

        assertEquals(scan.getStartRecordId(), parsedScan.getStartRecordId());
View Full Code Here

                node.get("recordFilter").get("recordType").getTextValue());
    }

    @Test
    public void testScanRecordIdPrefixFilter() throws Exception {
        IdGenerator idGenerator = new IdGeneratorImpl();

        RecordId recordId = idGenerator.newRecordId("foo");

        RecordScan scan = new RecordScan();
        scan.setRecordFilter(new RecordIdPrefixFilter(recordId));

        byte[] data = scanToBytes(scan);
View Full Code Here

        }
    }

    @Test
    public void testScanRecordVariantFilter() throws Exception {
        IdGenerator idGenerator = new IdGeneratorImpl();

        final Map<String, String> variantProperties = new HashMap<String, String>();
        variantProperties.put("lang", "en");
        variantProperties.put("branch", null);

        RecordId recordId = idGenerator.newRecordId("foo");

        RecordScan scan = new RecordScan();
        scan.setRecordFilter(new RecordVariantFilter(recordId, variantProperties));

        byte[] data = scanToBytes(scan);
View Full Code Here

        assertEquals(null, node.get("recordFilter").get("variantProperties").get("branch").getTextValue());
    }

    @Test
    public void testScanRecordFilterList() throws Exception {
        IdGenerator idGenerator = new IdGeneratorImpl();

        RecordId recordId = idGenerator.newRecordId("foo");

        RecordScan scan = new RecordScan();
        RecordFilterList filterList = new RecordFilterList(RecordFilterList.Operator.MUST_PASS_ONE);
        filterList.addFilter(new RecordIdPrefixFilter(recordId));
        filterList.addFilter(new RecordTypeFilter(new QName("ns", "stringField")));
View Full Code Here

        solrUpdateWriter = new FakeSolrUpdateWriter();
    }

    @Test
    public void testMap() throws Exception {
        IdGenerator idGenerator = new IdGeneratorImpl();
        System.out.println(Bytes.toString(idGenerator.fromString("USER.batch-index-custom").toBytes()));
        LTable table = repository.getDefaultTable();
        Record record = table.recordBuilder()
                .assignNewUuid()
                .recordType(new QName(NS1, "rt1"))
                .field(new QName(NS1, "a_string"), "myvalue")
View Full Code Here

    public void setupTypeManager() throws Exception {
        if (typeManagerSetup) {
            return;
        }

        idGenerator = new IdGeneratorImpl();
        typeManager = new HBaseTypeManager(idGenerator, hadoopConf, zk, hbaseTableFactory);

        typeManagerSetup = true;
    }
View Full Code Here

     * Returns a new instance of a HBaseTypeManager, different than the default
     * typemanager.
     */
    public TypeManager getNewTypeManager() throws IOException, InterruptedException, KeeperException,
            RepositoryException {
        return new HBaseTypeManager(new IdGeneratorImpl(), hadoopConf, zk, hbaseTableFactory);
    }
View Full Code Here

TOP

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

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.