Skip to content

Instantly share code, notes, and snippets.

@jackeylu
Last active July 1, 2016 11:44
Show Gist options
  • Save jackeylu/63143cbada55c0de25884b233b56b037 to your computer and use it in GitHub Desktop.
Save jackeylu/63143cbada55c0de25884b233b56b037 to your computer and use it in GitHub Desktop.
An Ignite client to do simple put operations.
public class IgniteClientSimplePut {
public static void main(String[] args) {
Ignition.setClientMode(true);
try (Ignite ignite = Ignition.start(args[0])){
String cache_name = "ignite-cache";
IgniteCache cache = ignite.getOrCreateCache(cache_name);
new CacheOperations().putOperations(ignite, cache_name, Integer.valueOf(args[1]));
System.out.println("Cache size: "+cache.size());
ignite.destroyCache(cache_name);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment