ignite-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexey Kuznetsov (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (IGNITE-2037) Update javadocs and documentation about LOCAL cache could be created on client node
Date Mon, 10 Apr 2017 08:28:42 GMT

     [ https://issues.apache.org/jira/browse/IGNITE-2037?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Alexey Kuznetsov updated IGNITE-2037:
-------------------------------------
    Fix Version/s:     (was: 2.0)
                   2.1

> Update javadocs and documentation about LOCAL cache could be created on client node
> -----------------------------------------------------------------------------------
>
>                 Key: IGNITE-2037
>                 URL: https://issues.apache.org/jira/browse/IGNITE-2037
>             Project: Ignite
>          Issue Type: Bug
>          Components: cache, newbie
>    Affects Versions: ignite-1.4
>            Reporter: Alexey Kuznetsov
>            Assignee: kcheng.mvp
>            Priority: Trivial
>              Labels: newbie
>             Fix For: 2.1
>
>
> Code that show local cache on client node:
> {code}
> public class LocalCacheOnClient {
>     public static void main(String[] args) throws IgniteException {
>         IgniteConfiguration cfgSrv = new IgniteConfiguration();
>         cfgSrv.setGridName("srv");
>         Ignite n1 = Ignition.start(cfgSrv);
>         IgniteConfiguration cfgClm = new IgniteConfiguration();
>         cfgClm.setGridName("cln");
>         cfgClm.setClientMode(true);
>         Ignite n2 = Ignition.start(cfgClm);
>         CacheConfiguration<Integer, Integer> ccfg = new CacheConfiguration<>("local");
>         ccfg.setCacheMode(CacheMode.LOCAL);
>         IgniteCache<Integer, Integer> c = n2.getOrCreateCache(ccfg);
>         c.put(1, 100);
>         n1.close(); // stop server node
>         c.put(2, 200); // local cache works fine.
>         System.out.println(c.get(1));
>         System.out.println(c.get(2));
>     }
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message