Package com.urbanairship.datacube.ops

Examples of com.urbanairship.datacube.ops.LongOp


                LongOp.DESERIALIZER, CommitType.READ_COMBINE_CAS, idService);
        DataCubeIo<LongOp> dataCubeIo = new DataCubeIo<LongOp>(dataCube, dbHarness, 1,
                Long.MAX_VALUE, SyncLevel.FULL_SYNC);

        public void addEvent(DeviceType deviceType, City city, DateTime when) throws IOException, InterruptedException {
            dataCubeIo.writeSync(new LongOp(1), new WriteBuilder(dataCube)
                    .at(time, when)
                    .at(device, deviceType)
                    .at(location, city));
        }
View Full Code Here


            dataCubeIo = new DataCubeIo<LongOp>(dataCube, hbaseDbHarness, 1, Long.MAX_VALUE,
                    SyncLevel.FULL_SYNC);
        }

        public void put(Event event) throws Exception {
            dataCubeIo.writeSync(new LongOp(1), new WriteBuilder(dataCube)
                    .at(timeDimension, event.time));
        }
View Full Code Here

       
        public void put(Event event) throws IOException, InterruptedException {
            WriteBuilder writeBuilder = new WriteBuilder(dataCube)
                .at(timeDimension, event.time)
                .attachForRollupFilter(uniqueCountFilter, event.username);
            dataCubeIo.writeSync(new LongOp(1), writeBuilder);
        }
View Full Code Here

        cubeIo = new DataCubeIo<LongOp>(cube, dbHarness, 1, Long.MAX_VALUE, SyncLevel.FULL_SYNC);
       
        DateTime now = new DateTime(DateTimeZone.UTC);
       
        // Do an increment of 5 for a certain time and zipcode
        cubeIo.writeSync(new LongOp(5), new WriteBuilder(cube)
                .at(time, now)
                .at(zipcode, "97201"));
       
        // Do an increment of 10 for the same zipcode in a different hour of the same day
        DateTime differentHour = now.withHourOfDay((now.getHourOfDay()+1)%24);
        cubeIo.writeSync(new LongOp(10), new WriteBuilder(cube)
                .at(time, differentHour)
                .at(zipcode, "97201"));

        // Read back the value that we wrote for the current hour, should be 5
        Optional<LongOp> thisHourCount = cubeIo.get(new ReadBuilder(cube)
View Full Code Here

        cubeIo = new DataCubeIo<LongOp>(cube, dbHarness, 1, Long.MAX_VALUE, SyncLevel.FULL_SYNC);

        DateTime now = new DateTime(DateTimeZone.UTC);

        // Do an increment of 5 for a certain time and zipcode
        cubeIo.writeSync(new LongOp(5), new WriteBuilder(cube)
                .at(time, now)
                .at(zipcode, "97201"));

        // Do an increment of 10 for the same zipcode in a different hour of the same day
        DateTime differentHour = now.withHourOfDay((now.getHourOfDay()+1)%24);
        cubeIo.writeSync(new LongOp(10), new WriteBuilder(cube)
                .at(time, differentHour)
                .at(zipcode, "97201"));


        List<Optional<LongOp>> optionals = cubeIo.multiGet(Lists.newArrayList(
View Full Code Here

        DataCube<LongOp> cube = new DataCube<LongOp>(dims, rollups);

        DataCubeIo<LongOp> cubeIo = new DataCubeIo<LongOp>(cube, dbHarness, 1, Long.MAX_VALUE, SyncLevel.FULL_SYNC);

        cubeIo.writeSync(new LongOp(1), new WriteBuilder(cube).at(X, 1L).at(Y, 1L));
        assertEquals(1L, cubeIo.get(new ReadBuilder(cube).at(X, 1L).at(Y, 1L)).get().getLong());

        cubeIo.writeSync(new LongOp(1), new WriteBuilder(cube).at(Y, 1L).at(Z, 1L));
        assertEquals(1L, cubeIo.get(new ReadBuilder(cube).at(Y, 1L).at(Z, 1L)).get().getLong());
    }
View Full Code Here

TOP

Related Classes of com.urbanairship.datacube.ops.LongOp

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.