Package com.datasift.client

Examples of com.datasift.client.DataSiftClient.push()


        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();

        //don't forget to start it, AFTER creating the pull subscription
        datasift.historics().start(historic).sync();
View Full Code Here


                .createPull(PullJsonType.JSON_NEW_LINE, historic, "pull test " + DateTime.now()).sync();

        //don't forget to start it, AFTER creating the pull subscription
        datasift.historics().start(historic).sync();

        PulledInteractions historicSubscriptions = datasift.push().pull(historicsSubscription).sync();

        Interaction interaction;
        while (!((interaction = historicSubscriptions.take()) instanceof LastInteraction)) {
            System.out.println(interaction);
        }
View Full Code Here

        new Date();
        DataSiftConfig config = new DataSiftConfig("zcourts", "acbf4788f875db9fdf6bbd2131b10752");
        final DataSiftClient datasift = new DataSiftClient(config);
        Stream stream = Stream.fromString("13e9347e7da32f19fcdb08e297019d2e");

        PushSubscription streamSubscription = datasift.push()
                .createPull(PullJsonType.JSON_NEW_LINE, stream, "pull test").sync();

        PulledInteractions streamSubscriptions = datasift.push().pull(streamSubscription).sync();

        Interaction interaction;
View Full Code Here

        Stream stream = Stream.fromString("13e9347e7da32f19fcdb08e297019d2e");

        PushSubscription streamSubscription = datasift.push()
                .createPull(PullJsonType.JSON_NEW_LINE, stream, "pull test").sync();

        PulledInteractions streamSubscriptions = datasift.push().pull(streamSubscription).sync();

        Interaction interaction;
        //non-blocking loop - if no data is available at the time of request the loop will be exited
        //if using this approach you must remember to manually call streamSubscriptions.stopPulling();
        for (Interaction i : streamSubscriptions) {
View Full Code Here

        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
View Full Code Here

                .maxSize(102400)
                .deliveryFrequency(0)
                .acl("acl")
                .bucket("some-bucket")
                .directory("abc");
        FutureData<PushSubscription> subscriptionFuture = datasift.push().create(
                s3,
                null,  //historics must be null, we're creating from a stream
                FutureData.wrap(stream),
                "Example push from stream"
        );
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.