Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-2037

Update javadocs and documentation about LOCAL cache could be created on client node

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Reopened
    • Trivial
    • Resolution: Unresolved
    • ignite-1.4
    • None
    • cache

    Description

      Code that show local cache on client node:

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

      Attachments

        Activity

          People

            kcheng.mvp kcheng.mvp
            kuaw26 Alexey Kuznetsov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: