/** * Allows to unblock all blocked senders from an external program, e.g. JMX */ @ManagedOperation(description="Unblocks all senders") public void unblock() { ; }
@ManagedOperation public void resetStats() { request_msgs=response_msgs=bcasts_sent=bcasts_received=bcasts_delivered=0L; sent_requests=received_requests=sent_responses=received_responses=0L; // reset number of sent and received requests and responses }
@ManagedOperation(description="Removes all entries from the fragmentation table. " + "Dangerous: this might remove fragments that are still needed to assemble an entire message") public void clearAllFragments() { fragment_list.clear(); }
@ManagedOperation public void disableReaping() { if(task != null) { task.cancel(false); task=null; } }
@ManagedOperation public void start() { if(timer == null) timer=new ScheduledThreadPoolExecutor(1); }
@ManagedOperation public void stop() { if(timer != null) timer.shutdown(); timer=null; }
@ManagedOperation(description="Removes all entries from the fragmentation table. " + "Dangerous: this might remove fragments that are still needed to assemble an entire message") public void clearAllFragments() { fragment_list.clear(); }
/** * This method is public only so it can be invoked by unit testing, but should not otherwise be used ! */ @ManagedOperation(description="Trashes all connections to other nodes. This is only used for testing") public void removeAllConnections() { send_table.clear(); recv_table.clear(); }
@ManagedOperation(description="Prints the last N conditions that triggered a rule action") public String executions() { StringBuilder sb=new StringBuilder(); for(String execution: executions) sb.append(execution + "\n"); return sb.toString(); }
@ManagedOperation public String printPreviousViews() { StringBuilder sb=new StringBuilder(); for(String view_rep: prev_views) sb.append(view_rep).append("\n"); return sb.toString(); }
@ManagedOperation(description="Print suspect history") public String printSuspectHistory() { StringBuilder sb=new StringBuilder(); for(String addr: suspect_history) sb.append(addr).append("\n"); return sb.toString(); }
@ManagedOperation public String printPreviousMembers() { StringBuilder sb=new StringBuilder(); if(prev_members != null) { for(Address addr: prev_members) { sb.append(addr).append("\n"); } } return sb.toString(); }
@ManagedOperation(description="Keeps information about the last N times a digest was set or merged") public String printDigestHistory() { StringBuilder sb=new StringBuilder(local_addr + ":\n"); for(String tmp: digest_history) sb.append(tmp).append("\n"); return sb.toString(); }
@ManagedOperation(description="Print suspect history") public String printSuspectHistory() { StringBuilder sb=new StringBuilder(); for(String suspect: suspect_history) sb.append(suspect).append("\n"); return sb.toString(); }
@ManagedOperation(description="Prints the contents of the address-physical address mappings") public String printCache() { StringBuilder sb=new StringBuilder(); for(Map.Entry<Address,PhysicalAddress> entry: cache.entrySet()) { sb.append(entry.getKey() + ": " + entry.getValue() + "\n"); } return sb.toString(); }
@ManagedOperation(description="Lists the in-flight threads") protected String printInFlightThreads() { StringBuilder sb=new StringBuilder(); for(Thread thread: in_flight_threads.keySet()) sb.append(thread.toString()).append("\n"); return sb.toString(); }
@ManagedOperation(description="Dumps all counters") public String printCounters() { StringBuilder sb=new StringBuilder(); for(Map.Entry<String,VersionedValue> entry: counters.entrySet()) sb.append(entry.getKey()).append(": ").append(entry.getValue()).append("\n"); return sb.toString(); }
@ManagedOperation(description="Prints the hosts and their associated cluster members") public String printHosts() { StringBuilder sb=new StringBuilder(); synchronized(hosts) { for(Map.Entry<InetAddress,List<Address>> entry: hosts.entrySet()) { sb.append(entry.getKey()).append(": ").append(entry.getValue()).append("\n"); } } return sb.toString(); }
@ManagedOperation(description="Prints all connections") public String printConnections() { StringBuilder sb=new StringBuilder("\n"); synchronized(this) { for(Map.Entry<Address,Connection> entry: conns.entrySet()) sb.append(entry.getKey()).append(": ").append(entry.getValue()).append("\n"); } return sb.toString(); }
@ManagedOperation(description="dumps the address table") public String printAddressTable() { return addr_table.entrySet().stream() .collect(StringBuilder::new, (sb, e) -> sb.append(e.getKey()).append(": ").append(e.getValue()).append("\n"), (l, r) ->{}).toString(); }