Package com.datasift.client.historics

Examples of com.datasift.client.historics.PreparedHistoricsQuery


    public static void main(String... args) throws InterruptedException {
        DataSiftConfig config = new DataSiftConfig("zcourts", "acbf4788f875db9fdf6bbd2131b10752");
        final DataSiftClient datasift = new DataSiftClient(config);
        Stream stream = Stream.fromString("13e9347e7da32f19fcdb08e297019d2e");

        PreparedHistoricsQuery historic = datasift.historics().prepare(stream.hash(), DateTime.now().minusHours(5),
                DateTime.now().minusHours(4), "Historics pull test").sync();

        PushSubscription historicsSubscription = datasift.push()
                .createPull(PullJsonType.JSON_NEW_LINE, historic, "pull test " + DateTime.now()).sync();
View Full Code Here


        m.setSrc_name(src_name);
    }

    @Test
    public void testIfUserCanPreparePlaybackQuery() {
        PreparedHistoricsQuery prepare = datasift.historics().prepare(hash, start, end, name).sync();
        assertTrue(prepare.isSuccessful());

        assertEquals(prepare.getDpus(), dpus, 0.00000001);
        assertEquals(prepare.getId(), id);

        assertEquals(prepare.getAvailability().getEnd(), end.getMillis());
        assertEquals(prepare.getAvailability().getStart(), start.getMillis());
        assertEquals(prepare.getAvailability().getSources().get(src_name).getAugmentations(), augmentations);
        assertEquals(prepare.getAvailability().getSources().get(src_name).getStatus(), status);
        assertEquals(prepare.getAvailability().getSources().get(src_name).getVersions(), versions);
    }
View Full Code Here

        DateTime fiveHrsAgo = DateTime.now().minusHours(5);
        DateTime fourHrsAgo = fiveHrsAgo.plusHours(1);
        String name = "My awesome Historics";
        //prepare our query
        PreparedHistoricsQuery query = datasift.historics().prepare(stream.hash(), fiveHrsAgo, fourHrsAgo, name).sync();
        //have to create a push subscription to the newly created historics before starting
        datasift.push().create(s3, FutureData.wrap(query), "Subscription name").sync();
        DataSiftResult historics = datasift.historics().start(query).sync();

        //stop a query
        datasift.historics().stop(query, "some reason").sync();
        //get a single historics query
        datasift.historics().get(query.getId()).sync();
        //get your list of historics
        datasift.historics().list().sync();
        //delete a query
        datasift.historics().delete(query).sync();
    }
View Full Code Here

TOP

Related Classes of com.datasift.client.historics.PreparedHistoricsQuery

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.