Refine search
public void suspect(Address mbr) { if(mbr.equals(gms.local_addr)) { if(log.isWarnEnabled()) log.warn("I am the coord and I'm suspected -- will probably leave shortly"); return; } Collection<Request> suspected=new LinkedHashSet<>(1); suspected.add(new Request(Request.SUSPECT,mbr)); handleMembershipChange(suspected); }
private void logException(String msg, Exception e) { if (log.isDebugEnabled()) { log.debug(msg, e); } else if (log.isWarnEnabled()) { log.warn("%s. Error is %s", msg, e.getLocalizedMessage()); } }
private void waitForUnblock() { try { flush_unblock_promise.reset(); flush_unblock_promise.getResultWithTimeout(end_flush_timeout); } catch (TimeoutException t) { if (log.isWarnEnabled()) log.warn(localAddress + ": waiting for UNBLOCK timed out after " + end_flush_timeout + " ms"); } }
protected void unknownMember(Address sender, Object message) { if(leaving) return; if(log_discard_msgs && log.isWarnEnabled()) { if(suppress_log_non_member != null) suppress_log_non_member.log(SuppressLog.Level.warn, sender, suppress_time_non_member_warnings, local_addr, message, sender, view); else log.warn(Util.getMessage("MsgDroppedNak"), local_addr, message, sender, view); } }
public AttributeList setAttributes(AttributeList list) { AttributeList results=new AttributeList(); for(int i=0;i < list.size();i++) { Attribute attr=(Attribute)list.get(i); if(setNamedAttribute(attr)) results.add(attr); else { if(log.isWarnEnabled()) log.warn("Failed to update attribute name " + attr.getName() + " with value " + attr.getValue()); } } return results; }
public static void removeDeprecatedProperties(Object obj, Map<String,String> props) throws Exception { //traverse class hierarchy and find all deprecated properties for(Class<?> clazz=obj.getClass(); clazz != null; clazz=clazz.getSuperclass()) { if(clazz.isAnnotationPresent(DeprecatedProperty.class)) { DeprecatedProperty declaredAnnotation=clazz.getAnnotation(DeprecatedProperty.class); String[] deprecatedProperties=declaredAnnotation.names(); for(String propertyName : deprecatedProperties) { String propertyValue=props.get(propertyName); if(propertyValue != null) { if(log.isWarnEnabled()) { String name=obj instanceof Protocol? ((Protocol)obj).getName() : obj.getClass().getName(); log.warn(Util.getMessage("Deprecated"), name + "." + propertyName, "will be ignored"); } props.remove(propertyName); } } } } }
public static MulticastSocket createMulticastSocket(SocketFactory factory,String service_name,InetAddress mcast_addr,int port,Log log) throws IOException { if(mcast_addr != null && !mcast_addr.isMulticastAddress()) throw new IllegalArgumentException("mcast_addr (" + mcast_addr + ") is not a valid multicast address"); SocketAddress saddr=new InetSocketAddress(mcast_addr,port); MulticastSocket retval=null; try { retval=factory.createMulticastSocket(service_name,saddr); } catch(IOException ex) { if(log != null && log.isWarnEnabled()) { StringBuilder sb=new StringBuilder(); String type=mcast_addr != null? mcast_addr instanceof Inet4Address? "IPv4" : "IPv6" : "n/a"; sb.append("could not bind to ").append(mcast_addr).append(" (").append(type).append(" address)") .append("; make sure your mcast_addr is of the same type as the preferred IP stack (IPv4 or IPv6)") .append(" by checking the value of the system properties java.net.preferIPv4Stack and java.net.preferIPv6Addresses.") .append("\nWill ignore mcast_addr, but this may lead to cross talking " + "(see http://www.jboss.org/community/docs/DOC-9469 for details). ") .append("\nException was: ").append(ex); log.warn(sb.toString()); } } if(retval == null) retval=factory.createMulticastSocket(service_name,port); return retval; }
private void mcastPut(K key, V val, short repl_count, long caching_time, boolean synchronous) { try { ResponseMode mode=synchronous? ResponseMode.GET_ALL : ResponseMode.GET_NONE; disp.callRemoteMethods(null, new MethodCall(PUT, key, val, repl_count, caching_time), new RequestOptions(mode, call_timeout)); } catch(Throwable t) { if(log.isWarnEnabled()) log.warn("put() failed", t); } }
private void sendPut(Address dest, K key, V val, long caching_time, boolean synchronous) { try { ResponseMode mode=synchronous? ResponseMode.GET_ALL : ResponseMode.GET_NONE; disp.callRemoteMethod(dest, new MethodCall(PUT, key, val, caching_time), new RequestOptions(mode, call_timeout)); } catch(Throwable t) { if(log.isWarnEnabled()) log.warn("_put() failed", t); } }
private void move(Address dest, K key, V val, short repl_count, long caching_time, boolean synchronous) { try { ResponseMode mode=synchronous? ResponseMode.GET_ALL : ResponseMode.GET_NONE; disp.callRemoteMethod(dest, new MethodCall(PUT_FORCE, key, val, repl_count, caching_time, true), new RequestOptions(mode, call_timeout)); } catch(Throwable t) { if(log.isWarnEnabled()) log.warn("move() failed", t); } }
public boolean authenticate(AuthToken token, Message msg) { if ((token != null) && (token instanceof SimpleToken)) { // Found a valid Token to authenticate against SimpleToken serverToken = (SimpleToken) token; if ((this.auth_value != null) && (serverToken.auth_value != null) && (this.auth_value.equalsIgnoreCase(serverToken.auth_value))) { // validated if (log.isDebugEnabled()) { log.debug("SimpleToken match"); } return true; } else { // if(log.isWarnEnabled()){ // log.warn("Authentication failed on SimpleToken"); // } return false; } } if (log.isWarnEnabled()) { log.warn("Invalid AuthToken instance - wrong type or null"); } return false; }
private void mcastClear(Set<K> keys, boolean synchronous) { try { ResponseMode mode=synchronous? ResponseMode.GET_ALL : ResponseMode.GET_NONE; disp.callRemoteMethods(null, new MethodCall(REMOVE_MANY, keys), new RequestOptions(mode, call_timeout)); } catch(Throwable t) { if(log.isWarnEnabled()) log.warn("clear() failed", t); } }
protected void process(Socket socket) { OutputStream output=null; try { socket.setSendBufferSize(buffer_size); if(log.isDebugEnabled()) log.debug(local_addr + ": accepted request for state transfer from " + socket.getInetAddress() + ":" + socket.getPort()); DataInput in=new DataInputStream(socket.getInputStream()); Address stateRequester=Util.readAddress(in); output=new BufferedOutputStream(socket.getOutputStream(), buffer_size); getStateFromApplication(stateRequester, output, false); } catch(Throwable e) { if(log.isWarnEnabled()) log.warn(local_addr + ": failed handling request from requester", e); } // getStateFromApplication() is run in the same thread; it closes the output stream, and we close the socket finally { Util.close(socket); } }
public void mcastEntries() { for(Map.Entry<K,Cache.Value<Value<V>>> entry: l2_cache.entrySet()) { K key=entry.getKey(); Cache.Value<Value<V>> val=entry.getValue(); if(val == null) { if(log.isWarnEnabled()) log.warn(key + " has no value associated; ignoring"); continue; } Value<V> tmp=val.getValue(); if(tmp == null) { if(log.isWarnEnabled()) log.warn(key + " has no value associated; ignoring"); continue; } V real_value=tmp.getVal(); short repl_count=tmp.getReplicationCount(); if(repl_count > 1) { _remove(key); mcastPut(key, real_value, repl_count, val.getTimeout(), false); } } }
/** * Places a key/value pair into one or several nodes in the cluster. * @param key The key, needs to be serializable * @param val The value, needs to be serializable * @param repl_count Number of replicas. The total number of times a data item should be present in a cluster. * Needs to be > 0 * <ul> * <li>-1: create key/val in all the nodes in the cluster * <li>1: create key/val only in one node in the cluster, picked by computing the consistent hash of KEY * <li>K > 1: create key/val in those nodes in the cluster which match the consistent hashes created for KEY * </ul> * @param timeout Expiration time for key/value. * <ul> * <li>-1: don't cache at all in the L1 cache * <li>0: cache forever, until removed or evicted because we need space for newer elements * <li>> 0: number of milliseconds to keep an idle element in the cache. An element is idle when not accessed. * </ul> * @param synchronous Whether or not to block until all cluster nodes have applied the change */ @ManagedOperation public void put(K key, V val, short repl_count, long timeout, boolean synchronous) { if(repl_count == 0) { if(log.isWarnEnabled()) log.warn("repl_count of 0 is invalid, data will not be stored in the cluster"); return; } mcastPut(key, val, repl_count, timeout, synchronous); if(l1_cache != null && timeout >= 0) l1_cache.put(key, val, timeout); }
protected void setBufferSize(DatagramSocket sock, int send_buf_size, int recv_buf_size) { try { sock.setSendBufferSize(send_buf_size); int actual_size=sock.getSendBufferSize(); if(actual_size < send_buf_size && log.isWarnEnabled()) { log.warn(Util.getMessage("IncorrectBufferSize"), "send", sock.getClass().getSimpleName(), Util.printBytes(send_buf_size), Util.printBytes(actual_size), "send", "net.core.wmem_max"); } } catch(Throwable ex) { log.warn(Util.getMessage("BufferSizeFailed"), "send", send_buf_size, sock, ex); } try { sock.setReceiveBufferSize(recv_buf_size); int actual_size=sock.getReceiveBufferSize(); if(actual_size < recv_buf_size && log.isWarnEnabled()) { log.warn(Util.getMessage("IncorrectBufferSize"), "receive", sock.getClass().getSimpleName(), Util.printBytes(recv_buf_size), Util.printBytes(actual_size), "receive", "net.core.rmem_max"); } } catch(Throwable ex) { log.warn(Util.getMessage("BufferSizeFailed"), "receive", recv_buf_size, sock, ex); } }
protected void handleXmitRequest(Address sender, SeqnoList missing) { if(is_trace) log.trace("%s <-- XMIT(%s: #%s)", local_addr, sender, missing); SenderEntry entry=send_table.get(sender); xmit_reqs_received.add(missing.size()); Table<Message> win=entry != null? entry.msgs : null; if(win != null) { for(long seqno: missing) { Message msg=win.get(seqno); if(msg == null) { if(log.isWarnEnabled() && log_not_found_msgs && !local_addr.equals(sender) && seqno > win.getLow()) log.warn(Util.getMessage("MessageNotFound"), local_addr, sender, seqno); continue; } down_prot.down(msg); xmit_rsps_sent.increment(); } } }
/** * Removes key in all nodes in the cluster, both from their local hashmaps and L1 caches * @param key The key, needs to be serializable */ @ManagedOperation public void remove(K key, boolean synchronous) { try { disp.callRemoteMethods(null, new MethodCall(REMOVE, key), new RequestOptions(synchronous? ResponseMode.GET_ALL : ResponseMode.GET_NONE, call_timeout)); if(l1_cache != null) l1_cache.remove(key); } catch(Throwable t) { if(log.isWarnEnabled()) log.warn("remove() failed", t); } }
if(isSetMethod(method)) { if(attr.setter != null) { if(log.isWarnEnabled()) log.warn("setter for \"" + attr_name + "\" is already defined (new method=" + method.getName() + ")"); if(log.isWarnEnabled()) log.warn("getter for \"" + attr_name + "\" is already defined (new method=" + method.getName() + ")");
RELAY2.class.getSimpleName(), tp.getClass().getSimpleName())); if(max_site_masters < 1) { log.warn("max_size_masters was " + max_site_masters + ", changed to 1"); max_site_masters=1; log.warn(local_addr + ": forwarding routes are currently not supported and will be ignored. This will change " + "with hierarchical routing (https://issues.jboss.org/browse/JGRP-1506)"); if(!forwarding_protocol_present && warn_when_ftc_missing && log.isWarnEnabled()) log.warn(local_addr + ": " + FORWARD_TO_COORD.class.getSimpleName() + " protocol not found below; " + "unable to re-submit messages to the new coordinator if the current coordinator crashes");