private void executeOnMember(String[] args) { // executeOnMember <echo-string> <memberIndex> doExecute(false, true, args); }
private void handleAtomicNumberDec(String[] args) { println(getAtomicNumber().decrementAndGet()); }
protected void handleMapPut(String[] args) { if (args.length == 1) { println("m.put requires a key and a value. You have not specified either."); } else if (args.length == 2) { println("m.put requires a key and a value. You have only specified the key " + args[1]); } else if (args.length > 3) { println("m.put takes two arguments, a key and a value. You have specified more than two arguments."); } else { println(getMap().put(args[1], args[2])); } }
protected void handleMultiMapKeys() { Set set = getMultiMap().keySet(); Iterator it = set.iterator(); int count = 0; while (it.hasNext()) { count++; println(it.next()); } println("Total " + count); }
handleEcho(command); handleHelp(command); } else if (first.startsWith("#") && first.length() > 1) { int repeat = Integer.parseInt(first.substring(1)); long started = Clock.currentTimeMillis(); for (int i = 0; i < repeat; i++) { handleCommand(command.substring(first.length()).replaceAll("\\$i", "" + i)); println(String.format("ops/s = %.2f", (double) repeat * 1000 / elapsedMilliSeconds)); } else { println("Bingo, all the operations finished in no time!"); handleAt(first); } else if (command.indexOf(';') != -1) { handleColon(command); } else if ("silent".equals(first)) { silent = Boolean.parseBoolean(args[1]); } else if (equalsIgnoreCase("shutdown", first)) { handleShutdown(); } else if ("echo".equals(first)) { echo = Boolean.parseBoolean(args[1]); println("echo: " + echo); } else if ("ns".equals(first)) { handleNamespace(trim(command.substring(first.length()))); } else if ("whoami".equals(first)) { handleWhoami(); } else if ("who".equals(first)) { handleWho();
protected void handleClear(String[] args) { String iteratorStr = args[0]; if (iteratorStr.startsWith("s.")) { getSet().clear(); } else if (iteratorStr.startsWith("m.")) { getMap().clear(); } else if (iteratorStr.startsWith("mm.")) { getMultiMap().clear(); } else if (iteratorStr.startsWith("q.")) { getQueue().clear(); } else if (iteratorStr.startsWith("l.")) { getList().clear(); } println("Cleared all."); }
public void start() throws Exception { getMap().size(); getList().size(); getSet().size(); getQueue().size(); getTopic().getLocalTopicStats(); getMultiMap().size(); hazelcast.getExecutorService("default").getLocalExecutorStats(); for (int i = 1; i <= LOAD_EXECUTORS_COUNT; i++) { hazelcast.getExecutorService(EXECUTOR_NAMESPACE + " " + i).getLocalExecutorStats(); } if (lineReader == null) { lineReader = new DefaultLineReader(); } running = true; while (running) { print("hazelcast[" + namespace + "] > "); try { final String command = lineReader.readLine(); handleCommand(command); } catch (Throwable e) { e.printStackTrace(); } } }
private void handStats(String[] args) { String iteratorStr = args[0]; if (iteratorStr.startsWith("m.")) { println(getMap().getLocalMapStats()); } else if (iteratorStr.startsWith("mm.")) { println(getMultiMap().getLocalMultiMapStats()); } else if (iteratorStr.startsWith("q.")) { println(getQueue().getLocalQueueStats()); } }
/** * Starts the test application. * <p> * Loads the config from classpath hazelcast.xml, if it fails to load, will use default config. */ public static void main(String[] args) throws Exception { Config config; try { config = new FileSystemXmlConfig("hazelcast.xml"); } catch (FileNotFoundException e) { config = new Config(); } for (int i = 1; i <= LOAD_EXECUTORS_COUNT; i++) { config.addExecutorConfig(new ExecutorConfig(EXECUTOR_NAMESPACE + " " + i).setPoolSize(i)); } ConsoleApp consoleApp = new ConsoleApp(Hazelcast.newHazelcastInstance(config)); consoleApp.start(); } }
handleEcho(command); handleHelp(command); } else if (first.startsWith("#") && first.length() > 1) { int repeat = Integer.parseInt(first.substring(1)); long started = Clock.currentTimeMillis(); for (int i = 0; i < repeat; i++) { handleCommand(command.substring(first.length()).replaceAll("\\$i", "" + i)); println(String.format("ops/s = %.2f", (double) repeat * 1000 / elapsedMilliSeconds)); } else { println("Bingo, all the operations finished in no time!"); handleAt(first); } else if (command.indexOf(';') != -1) { handleColon(command); } else if ("silent".equals(first)) { silent = Boolean.parseBoolean(args[1]); } else if (equalsIgnoreCase("shutdown", first)) { handleShutdown(); } else if ("echo".equals(first)) { echo = Boolean.parseBoolean(args[1]); println("echo: " + echo); } else if ("ns".equals(first)) { handleNamespace(trim(command.substring(first.length()))); } else if ("whoami".equals(first)) { handleWhoami(); } else if ("who".equals(first)) { handleWho();
protected void handleClear(String[] args) { String iteratorStr = args[0]; if (iteratorStr.startsWith("s.")) { getSet().clear(); } else if (iteratorStr.startsWith("m.")) { getMap().clear(); } else if (iteratorStr.startsWith("mm.")) { getMultiMap().clear(); } else if (iteratorStr.startsWith("q.")) { getQueue().clear(); } else if (iteratorStr.startsWith("l.")) { getList().clear(); } println("Cleared all."); }
protected void handleMapPut(String[] args) { if (args.length == 1) { println("m.put requires a key and a value. You have not specified either."); } else if (args.length == 2) { println("m.put requires a key and a value. You have only specified the key " + args[1]); } else if (args.length > 3) { println("m.put takes two arguments, a key and a value. You have specified more than two arguments."); } else { println(getMap().put(args[1], args[2])); } }
public void start() throws Exception { getMap().size(); getList().size(); getSet().size(); getQueue().size(); getTopic().getLocalTopicStats(); getMultiMap().size(); hazelcast.getExecutorService("default").getLocalExecutorStats(); for (int i = 1; i <= LOAD_EXECUTORS_COUNT; i++) { hazelcast.getExecutorService(EXECUTOR_NAMESPACE + " " + i).getLocalExecutorStats(); } if (lineReader == null) { lineReader = new DefaultLineReader(); } running = true; while (running) { print("hazelcast[" + namespace + "] > "); try { final String command = lineReader.readLine(); handleCommand(command); } catch (Throwable e) { e.printStackTrace(); } } }
protected void handleMultiMapValues() { Collection set = getMultiMap().values(); Iterator it = set.iterator(); int count = 0; while (it.hasNext()) { count++; println(it.next()); } println("Total " + count); }
private void handStats(String[] args) { String iteratorStr = args[0]; if (iteratorStr.startsWith("m.")) { println(getMap().getLocalMapStats()); } else if (iteratorStr.startsWith("mm.")) { println(getMultiMap().getLocalMultiMapStats()); } else if (iteratorStr.startsWith("q.")) { println(getQueue().getLocalQueueStats()); } }
/** * Starts the test application. * <p> * Loads the config from classpath hazelcast.xml, if it fails to load, will use default config. */ public static void main(String[] args) throws Exception { Config config; try { config = new FileSystemXmlConfig("hazelcast.xml"); } catch (FileNotFoundException e) { config = new Config(); } for (int i = 1; i <= LOAD_EXECUTORS_COUNT; i++) { config.addExecutorConfig(new ExecutorConfig(EXECUTOR_NAMESPACE + " " + i).setPoolSize(i)); } ConsoleApp consoleApp = new ConsoleApp(Hazelcast.newHazelcastInstance(config)); consoleApp.start(); } }
protected void handleSize(String[] args) { int size = 0; String iteratorStr = args[0]; if (iteratorStr.startsWith("s.")) { size = getSet().size(); } else if (iteratorStr.startsWith("m.")) { size = getMap().size(); } else if (iteratorStr.startsWith("mm.")) { size = getMultiMap().size(); } else if (iteratorStr.startsWith("q.")) { size = getQueue().size(); } else if (iteratorStr.startsWith("l.")) { size = getList().size(); } println("Size: " + size); }
protected void handleMultiMapUnlock(String[] args) { getMultiMap().unlock(args[1]); println("true"); }