Package com.urbanairship.datacube.idservices

Examples of com.urbanairship.datacube.idservices.MapIdService


    private static Logger log = LoggerFactory.getLogger(ErrorHandlingTest.class);
   
    @Test
    public void test() throws Exception {
        log.info("You can ignore exceptions and scary stack traces from this test");
        IdService idService = new CachingIdService(5, new MapIdService(),"test");

        Configuration conf = getTestUtil().getConfiguration();
        HTablePool pool = new HTablePool(conf, Integer.MAX_VALUE);
       
        DbHarness<LongOp> dbHarness = new HBaseDbHarness<LongOp>(pool, "XY".getBytes(),
View Full Code Here


   
    @Test
    public void test() throws Exception {
        Dimension<Color> colorDimension = new Dimension<Color>("color", new EnumToOrdinalBucketer<Color>(1), false, 1);
        Rollup colorRollup = new Rollup(colorDimension);
        IdService idService = new MapIdService();
        ConcurrentMap<BoxedByteArray,byte[]> backingMap = Maps.newConcurrentMap();
        DbHarness<LongOp> dbHarness = new MapDbHarness<LongOp>(backingMap,
                new LongOp.LongOpDeserializer(), CommitType.READ_COMBINE_CAS, idService);
       
        DataCube<LongOp> cube = new DataCube<LongOp>(ImmutableList.<Dimension<?>>of(colorDimension),
View Full Code Here

        List<Dimension<?>> dimensions = ImmutableList.<Dimension<?>>of(dimension);
       
        Rollup rollup = new Rollup(dimension);
        List<Rollup> rollups = ImmutableList.of(rollup);
       
        IdService idService = new MapIdService();
       
        HTablePool pool = new HTablePool(getTestUtil().getConfiguration(), Integer.MAX_VALUE);
        DbHarness<BytesOp> dbHarness = new HBaseDbHarness<BytesOp>(pool, ArrayUtils.EMPTY_BYTE_ARRAY,
                tableName, cfName,  new BytesOpDeserializer(), idService, CommitType.READ_COMBINE_CAS,
                3, 20, 20, "testscope");
View Full Code Here

        List<Dimension<?>> dimensions = ImmutableList.<Dimension<?>>of(time, zipcode);
        List<Rollup> rollups = ImmutableList.of(hourAndZipRollup, dayAndZipRollup, hourRollup, dayRollup);

        DataCube<LongOp> dataCube = new DataCube<LongOp>(dimensions, rollups);
        IdService idService = new MapIdService();

        HTablePool pool = new HTablePool(getTestUtil().getConfiguration(), Integer.MAX_VALUE);
        DbHarness<LongOp> hbaseDbHarness = new HBaseDbHarness<LongOp>(pool,
                "dh".getBytes(), DATA_CUBE_TABLE, CF, LongOp.DESERIALIZER, idService,
                DbHarness.CommitType.INCREMENT, 1, 1 , 1, "none");
View Full Code Here

     * Test the core datacube logic. Don't use a database, use our in-memory pretend storage
     * backend.
     */
    @Test
    public void writeAndRead() throws Exception {
        IdService idService = new CachingIdService(5, new MapIdService(), "test");
        ConcurrentMap<BoxedByteArray,byte[]> backingMap =
                new ConcurrentHashMap<BoxedByteArray,byte[]>();
       
        DbHarness<LongOp> dbHarness = new MapDbHarness<LongOp>(backingMap, LongOp.DESERIALIZER,
                CommitType.READ_COMBINE_CAS, idService);
View Full Code Here

        List<Dimension<?>> dimensions = ImmutableList.<Dimension<?>>of(dimension);
       
        Rollup rollup = new Rollup(dimension);
        List<Rollup> rollups = ImmutableList.of(rollup);
       
        IdService idService = new MapIdService();
       
        HTablePool pool = new HTablePool(getTestUtil().getConfiguration(), Integer.MAX_VALUE);
        DbHarness<BytesOp> dbHarness = new HBaseDbHarness<BytesOp>(pool, ArrayUtils.EMPTY_BYTE_ARRAY,
                tableName, cfName,  new BytesOpDeserializer(), idService, CommitType.OVERWRITE);
       
View Full Code Here

        List<Dimension<?>> dimensions = ImmutableList.<Dimension<?>>of(dimension);
       
        Rollup rollup = new Rollup(dimension);
        List<Rollup> rollups = ImmutableList.of(rollup);
       
        IdService idService = new MapIdService();
       
        HTablePool pool = new HTablePool(getTestUtil().getConfiguration(), Integer.MAX_VALUE);
        DbHarness<BytesOp> dbHarness = new HBaseDbHarness<BytesOp>(pool, ArrayUtils.EMPTY_BYTE_ARRAY,
                tableName, cfName,  new BytesOpDeserializer(), idService, CommitType.READ_COMBINE_CAS);
       
View Full Code Here

        getTestUtil().createTable(IDSERVICE_LOOKUP_TABLE, CF);
    }
   
    @Test
    public void hbaseForCubeDataTest() throws Exception {
        IdService idService = new MapIdService();
       
        HTablePool pool = new HTablePool(getTestUtil().getConfiguration(), Integer.MAX_VALUE);
        DbHarness<LongOp> hbaseDbHarness = new HBaseDbHarness<LongOp>(pool,
                "hbaseForCubeDataTest".getBytes(), CUBE_DATA_TABLE, CF, LongOp.DESERIALIZER, idService,
                CommitType.INCREMENT);
View Full Code Here

        DbHarnessTests.basicTest(hbaseDbHarness);
    }

    @Test
    public void hbaseForCubeDataTestMulti() throws Exception {
        IdService idService = new MapIdService();

        HTablePool pool = new HTablePool(getTestUtil().getConfiguration(), Integer.MAX_VALUE);
        DbHarness<LongOp> hbaseDbHarness = new HBaseDbHarness<LongOp>(pool,
                "hbaseForCubeDataTest".getBytes(), CUBE_DATA_TABLE, CF, LongOp.DESERIALIZER, idService,
                CommitType.INCREMENT);
View Full Code Here

            List<Rollup> rollups = ImmutableList.of(hourRollup, dayRollup, monthRollup);
           
            List<Dimension<?>> dims = ImmutableList.<Dimension<?>>of(timeDimension);
           
            dataCube = new DataCube<LongOp>(dims, rollups);
            IdService idService = new MapIdService();
            ConcurrentMap<BoxedByteArray,byte[]> backingMap = Maps.newConcurrentMap();
            DbHarness<LongOp> dbHarness = new MapDbHarness<LongOp>(backingMap,LongOp.DESERIALIZER,
                    CommitType.READ_COMBINE_CAS, idService);
            this.dataCubeIo = new DataCubeIo<LongOp>(dataCube, dbHarness, 1, Long.MAX_VALUE,
                    SyncLevel.FULL_SYNC);
View Full Code Here

TOP

Related Classes of com.urbanairship.datacube.idservices.MapIdService

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.