You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by Nathan Neely <na...@benefitfocus.com> on 2021/01/29 22:05:52 UTC

Query System Views Ignite 2.9.1

How can I query system views from a server node? I have looked at example code for clients: https://ignite.apache.org/docs/latest/monitoring-metrics/system-views, but I can’t seem to find any examples for server nodes.
Can you use SqlFieldsQuery to return data from system views?

IgniteCache<?, ?> cache = getIgnite().cache("SYS");
if(cache != null){
    SqlFieldsQuery sqlq = new SqlFieldsQuery("SELECT * from NODES").setSchema("SYS");
    cache.query(sqlq).getAll();
}


Thanks,

Nathan Neely
Engineer IV, Software 5x Core
Benefitfocus for life™

Benefitfocus® (NASDAQ: BNFT) unifies the entire benefits industry on a single technology platform to protect consumers for life. Our powerful cloud-based software, data-driven insights and thoughtfully-designed services enable employers, insurance brokers, health plans and suppliers to simplify the complexity of benefits administration and deliver health, wealth, property and lifestyle products through a world-class benefits experience. Our mission is simple: to improve lives with benefits. Learn more at www.benefitfocus.com<http://www.benefitfocus.com>, LinkedIn<https://www.linkedin.com/company/benefitfocus> and Twitter<http://www.twitter.com/benefitfocus>.

Re: Query System Views Ignite 2.9.1

Posted by Ilya Kasnacheev <il...@gmail.com>.
Hello!

You can use SqlFieldsQuery to return data from system views (of the node on
which you invoke the SqlFieldsQuery). Please note that cache SYS does not
exist initially, nor any other caches with schema SYS. You may use any
existing cache instead.

You can run any code on the server nodes also, in the form of services,
Spring beans or  distributed compute. You can run compute operations on
server node from the client node, for example.

Regards,
-- 
Ilya Kasnacheev


сб, 30 янв. 2021 г. в 01:06, Nathan Neely <na...@benefitfocus.com>:

> How can I query system views from a server node? I have looked at example
> code for clients:
> https://ignite.apache.org/docs/latest/monitoring-metrics/system-views,
> but I can’t seem to find any examples for server nodes.
>
> Can you use SqlFieldsQuery to return data from system views?
>
>
>
> IgniteCache<?, ?> cache = getIgnite().cache("SYS");
> if(cache != null){
>     SqlFieldsQuery sqlq = new SqlFieldsQuery("SELECT * from NODES"
> ).setSchema("SYS");
>     cache.query(sqlq).getAll();
> }
>
>
>
>
>
> Thanks,
>
>
>
> *Nathan Neely*
>
> *Engineer IV, Software 5x Core*
>
> Benefitfocus for *life*™
>
> Benefitfocus® (NASDAQ: BNFT) unifies the entire benefits industry on a
> single technology platform to protect consumers for life. Our powerful
> cloud-based software, data-driven insights and thoughtfully-designed
> services enable employers, insurance brokers, health plans and suppliers to
> simplify the complexity of benefits administration and deliver health,
> wealth, property and lifestyle products through a world-class benefits
> experience. Our mission is simple: to improve lives with benefits. Learn
> more at www.benefitfocus.com, LinkedIn
> <https://www.linkedin.com/company/benefitfocus> and Twitter
> <http://www.twitter.com/benefitfocus>.
>

Re: Query System Views Ignite 2.9.1

Posted by akorensh <al...@gmail.com>.
Hi,
  You can use any of your caches to perform the query, or alternatively
create a new one like so:
  ignite.getOrCreateCache("MY_TEST_CACHE").query(new SqlFieldsQuery("SELECT
* FROM SYS.NODES")).getAll()

Thanks, Alex



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/