@Override /* close the connection to remote mbean server */ public void close() throws IOException { super.close(); // close the connection to remote mbean server } }
public void refresh(List<String> keyspaces) throws IOException, ExecutionException, InterruptedException { Iterator<Entry<String, ColumnFamilyStoreMBean>> it = super.getColumnFamilyStoreMBeanProxies(); while (it.hasNext()) { Entry<String, ColumnFamilyStoreMBean> entry = it.next(); if (keyspaces.contains(entry.getKey())) { logger.info( "Refreshing {} {}", entry.getKey(), entry.getValue().getColumnFamilyName()); loadNewSSTables(entry.getKey(), entry.getValue().getColumnFamilyName()); } } }
isCassandraStarted.set(true); NodeProbe bean = JMXNodeTool.instance(this.config); instanceState.setIsGossipActive(bean.isGossipRunning()); instanceState.setIsNativeTransportActive(bean.isNativeTransportRunning()); instanceState.setIsThriftActive(bean.isThriftServerRunning()); } else {
private static CmdLineOptions getCmdLineOptions() { CmdLineOptions options = new CmdLineOptions(); options.addOption("c", CLEANUP_OPTION, "clean-up any outstanding transactions"); options.addOption("d", DEBUG_OPTION, "display stack traces"); options.addOption("h", HELP_OPTION, "display this help message"); options.addOption("o", OP_LOG_OPTION, "include operation logs"); options.addOption("t", TYPE_OPTION, true, FileType.descr()); options.addOption("v", VERBOSE_OPTION, "verbose output"); return options; }
private Map<String, Object> getMetricsByHost(String host) { Map<String, Object> metrics = InsertionOrderUtil.newMap(); // JMX client operations for Cassandra. try (NodeProbe probe = this.newNodeProbe(host)) { MemoryUsage heapUsage = probe.getHeapMemoryUsage(); metrics.put(MEM_USED, heapUsage.getUsed() / Bytes.MB); metrics.put(MEM_COMMITED, heapUsage.getCommitted() / Bytes.MB); metrics.put(MEM_MAX, heapUsage.getMax() / Bytes.MB); metrics.put(MEM_UNIT, "MB"); metrics.put(DATA_SIZE, probe.getLoadString()); } catch (Throwable e) { metrics.put(EXCEPTION, e.toString()); } return metrics; }
public LoaderOptions build() { constructAuthProvider(); return new LoaderOptions(this); }
@Override public void execute(NodeProbe probe) { probe.startNativeTransport(); } }
/** * Creates a NodeProbe using the specified JMX host and default port. * * @param host hostname or IP address of the JMX agent * @throws IOException on connection failures */ public NodeProbe(String host) throws IOException { this.host = host; this.port = defaultPort; connect(); }
@Override public void execute(NodeProbe probe) { probe.disableHintedHandoff(); } }
nodeProbe.isGossipRunning(); result = true; nodeProbe.isNativeTransportRunning(); result = true; nodeProbe.isThriftServerRunning(); result = true;
private static CmdLineOptions getCmdLineOptions() { CmdLineOptions options = new CmdLineOptions(); options.addOption("c", CLEANUP_OPTION, "clean-up any outstanding transactions"); options.addOption("d", DEBUG_OPTION, "display stack traces"); options.addOption("h", HELP_OPTION, "display this help message"); options.addOption("o", OP_LOG_OPTION, "include operation logs"); options.addOption("t", TYPE_OPTION, true, FileType.descr()); options.addOption("v", VERBOSE_OPTION, "verbose output"); return options; }
public LoaderOptions build() { constructAuthProvider(); return new LoaderOptions(this); }
/** * You must do the compaction before running this to remove the duplicate tokens out of the * server. TODO code it. */ @SuppressWarnings("unchecked") public JSONObject estimateKeys() throws JSONException { Iterator<Entry<String, ColumnFamilyStoreMBean>> it = super.getColumnFamilyStoreMBeanProxies(); JSONObject object = new JSONObject(); while (it.hasNext()) { Entry<String, ColumnFamilyStoreMBean> entry = it.next(); object.put("keyspace", entry.getKey()); object.put("column_family", entry.getValue().getColumnFamilyName()); object.put("estimated_size", entry.getValue().estimateKeys()); } return object; }
@Override public void close() throws IOException { synchronized (JMXNodeTool.class) { tool = null; super.close(); } }
private static CmdLineOptions getCmdLineOptions() { CmdLineOptions options = new CmdLineOptions(); options.addOption("c", CLEANUP_OPTION, "clean-up any outstanding transactions"); options.addOption("d", DEBUG_OPTION, "display stack traces"); options.addOption("h", HELP_OPTION, "display this help message"); options.addOption("o", OP_LOG_OPTION, "include operation logs"); options.addOption("t", TYPE_OPTION, true, FileType.descr()); options.addOption("v", VERBOSE_OPTION, "verbose output"); return options; }
public LoaderOptions build() { constructAuthProvider(); return new LoaderOptions(this); }