You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by chevy <ch...@target.com> on 2016/08/05 09:39:30 UTC

Rest-api: Creating service to read data from cache

Hi,

I have created bean which aligns to my table structure as shown below and
add data to it. While pulling data from cache I need to do some aggregation
on data and then create service using the data. Ignite provides rest-api but
I did not see any variant where I just use that api by mentioning my cache
name and add my data say aggregated(a), b, aggregated(c) as params into URL
and access it directly.

1. Is there a way to do this or should I write my own services using
jetty/spring?
2. If yes, please provide me some sample implementation.

public class TableA implements Serializable {

	private static final long serialVersionUID = 1L;

    @QuerySqlField(index = true)
    public int a;

    @QuerySqlField
    public Date b;

    @QuerySqlField
    public int c;
 
    public TableA(int a, Date b, int c) {
        this.a = a;
        this.b = b;
        this.c = c;
    }

}




--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Rest-api-Creating-service-to-read-data-from-cache-tp6788.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Rest-api: Creating service to read data from cache

Posted by Vladislav Pyatkov <vl...@gmail.com>.
You can see the list of topics:

[1] https://apacheignite.readme.io/docs/rest-api#get
[2] https://apacheignite.readme.io/docs/rest-api#put

On Mon, Aug 8, 2016 at 9:04 AM, Vladislav Pyatkov <vl...@gmail.com>
wrote:

> Hello,
>
> Ignite REST API is predefined.
> You can use access by key[1] or add entries[2] (like often doing it in
> approach of key-value) instead using query.
>
> On Mon, Aug 8, 2016 at 8:37 AM, chevy <ch...@target.com> wrote:
>
>> I have set up ignite-rest-http and able to access api but I do not want to
>> send query in my api and instead prefer to send object or method to fetch
>> data directly. Is there a way to do this?
>>
>>
>>
>> --
>> View this message in context: http://apache-ignite-users.705
>> 18.x6.nabble.com/Rest-api-Creating-service-to-read-data-from
>> -cache-tp6788p6844.html
>> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>>
>
>
>
> --
> Vladislav Pyatkov
>



-- 
Vladislav Pyatkov

Re: Rest-api: Creating service to read data from cache

Posted by Vladislav Pyatkov <vl...@gmail.com>.
Hello,

Ignite REST API is predefined.
You can use access by key[1] or add entries[2] (like often doing it in
approach of key-value) instead using query.

On Mon, Aug 8, 2016 at 8:37 AM, chevy <ch...@target.com> wrote:

> I have set up ignite-rest-http and able to access api but I do not want to
> send query in my api and instead prefer to send object or method to fetch
> data directly. Is there a way to do this?
>
>
>
> --
> View this message in context: http://apache-ignite-users.
> 70518.x6.nabble.com/Rest-api-Creating-service-to-read-data-
> from-cache-tp6788p6844.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>



-- 
Vladislav Pyatkov

Re: Rest-api: Creating service to read data from cache

Posted by chevy <ch...@target.com>.
I have set up ignite-rest-http and able to access api but I do not want to
send query in my api and instead prefer to send object or method to fetch
data directly. Is there a way to do this?



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Rest-api-Creating-service-to-read-data-from-cache-tp6788p6844.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Rest-api: Creating service to read data from cache

Posted by Vladislav Pyatkov <vl...@gmail.com>.
Hello

Ignite REST API has predefined methods. If you need to do some SQL over a
cache (for aggregation), you can see the topic[1].

In order to using REST API you need just put ignite-rest-http into
classpath and Ignite deploys Jetty (with default configuration) automaticly.

If you will have issue with Ignite-rest-http, you could ask any quetion on
User List.

[1] https://apacheignite.readme.io/docs/rest-api#sql-query-execute

On Fri, Aug 5, 2016 at 12:39 PM, chevy <ch...@target.com> wrote:

> Hi,
>
> I have created bean which aligns to my table structure as shown below and
> add data to it. While pulling data from cache I need to do some aggregation
> on data and then create service using the data. Ignite provides rest-api
> but
> I did not see any variant where I just use that api by mentioning my cache
> name and add my data say aggregated(a), b, aggregated(c) as params into URL
> and access it directly.
>
> 1. Is there a way to do this or should I write my own services using
> jetty/spring?
> 2. If yes, please provide me some sample implementation.
>
> public class TableA implements Serializable {
>
>         private static final long serialVersionUID = 1L;
>
>     @QuerySqlField(index = true)
>     public int a;
>
>     @QuerySqlField
>     public Date b;
>
>     @QuerySqlField
>     public int c;
>
>     public TableA(int a, Date b, int c) {
>         this.a = a;
>         this.b = b;
>         this.c = c;
>     }
>
> }
>
>
>
>
> --
> View this message in context: http://apache-ignite-users.
> 70518.x6.nabble.com/Rest-api-Creating-service-to-read-data-
> from-cache-tp6788.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>



-- 
Vladislav Pyatkov