1 /* 2 * Copyright (c) 1998-2002 The Jgroup Team. 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU Lesser General Public License version 2 as 6 * published by the Free Software Foundation. 7 * 8 * This program is distributed in the hope that it will be useful, 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 * GNU Lesser General Public License for more details. 12 * 13 * You should have received a copy of the GNU Lesser General Public License 14 * along with this program; if not, write to the Free Software 15 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 16 * 17 */ 18 19 package jgroup.relacs.mss; 20 21 /** 22 * The <code>MssConstants</code> interface declares a number of 23 * constants mainly relevant for the <i>mss</i> level. 24 * 25 * @author Hein Meling 26 * @author Alberto Montresor 27 * @author Salvatore Cammarata 28 * @since Jgroup 1.2 29 */ 30 public interface MssConstants 31 { 32 33 /** 34 * Enabling (setting it to <code>true</code>) NACK suppression sends 35 * only a single NACK for each cluster. Otherwise 36 * <i>cluster.size</i> messages will be sent for each missing 37 * message, for each of the clusters that are missing the message. 38 */ 39 public static final boolean NACKSUPPRESSION = false; 40 41 42 /** 43 * Setting this to true enables routing of messages through 44 * intermediate clusters, if a node (or cluster) is not directly 45 * connected to the destination cluster. 46 * 47 * FIXME NOTE: There is currently a problem with the routing 48 * mechanism, so don't turn it on. 49 */ 50 public static final boolean ROUTING_ENABLED = false; 51 52 53 //////////////////////////////////////////////////////////////////////////////////////////// 54 // Thread priorities 55 //////////////////////////////////////////////////////////////////////////////////////////// 56 57 public static final int MSSUSER_PRIORITY = Thread.NORM_PRIORITY; 58 59 public static final int EHANDLER_PRIORITY = MSSUSER_PRIORITY; 60 61 public static final int NI_PRIORITY = EHANDLER_PRIORITY; 62 63 64 //////////////////////////////////////////////////////////////////////////////////////////// 65 // Reachability and message constants 66 //////////////////////////////////////////////////////////////////////////////////////////// 67 68 /** 69 * If the alive counter of a host is equal to this value, the host is 70 * considered to be unreachable. 71 */ 72 public static final int UNREACHABLE = 0; 73 74 /** 75 * If the alive counter of a host is greater or equal to this value, 76 * the host is considered to be alive. 77 */ 78 public static final int MINIMUM_ALIVE_VALUE = 1; 79 80 /** 81 * Constant used to indicate that <i>all</i> members of a cluster 82 * should receive a message. 83 */ 84 public static final int ALL = 0; 85 86 87 //////////////////////////////////////////////////////////////////////////////////////////// 88 // General constants 89 //////////////////////////////////////////////////////////////////////////////////////////// 90 91 /** 92 * Used to indicate that an <code>int</code> value is undefined. 93 */ 94 public static final int UNDEF = -1; 95 96 97 //////////////////////////////////////////////////////////////////////////////////////////// 98 // Message and Packet constants 99 //////////////////////////////////////////////////////////////////////////////////////////// 100 101 /** 102 * Header size for <i>mss</i> level Jgroup (<code>MsgJG</code>) 103 * messages. Mss messages contains a static header and a dynamic 104 * trailer of unspecified size, whose size is determined at runtime. 105 * The content of the header includes a message tag, message 106 * identifer, pointer to the trailer's position in the message stream 107 * etc. The content of the trailer cannot be accessed until all 108 * message fragments (packets) have been received. 109 */ 110 public static final int MSS_HEADER_SIZE = 15; 111 112 /** 113 * Header size for <i>network</i> level packets (fragments). 114 * Messages sent from the <i>mss</i> level may be split into several 115 * smaller fragments (or packets). Each of these fragments will be 116 * attached a header of the size given below. This fragment header 117 * comes in addition to the payload limit specified in the 118 * <code>config.xml</code> file. The header contains information 119 * about the message type, broadcast, fragment identifier (fid), 120 * sender and incarnation identifier. 121 */ 122 public static final int HEADER_SIZE = 16; 123 124 /** 125 * There is currently no trailer added for each of the 126 * <code>mss</code> level packets. 127 */ 128 public static final int TRAILER_SIZE = 0; 129 130 /** 131 * The overall overhead for each packet sent to the network. 132 */ 133 public static final int OVERHEAD_SIZE = HEADER_SIZE + TRAILER_SIZE; 134 135 }