001    /*
002     * Copyright (C) 2008-2009 Holger Arndt, A. Naegele and M. Bundschus
003     *
004     * This file is part of the Java Data Mining Package (JDMP).
005     * See the NOTICE file distributed with this work for additional
006     * information regarding copyright ownership and licensing.
007     *
008     * JDMP is free software; you can redistribute it and/or modify
009     * it under the terms of the GNU Lesser General Public License as
010     * published by the Free Software Foundation; either version 2
011     * of the License, or (at your option) any later version.
012     *
013     * JDMP is distributed in the hope that it will be useful,
014     * but WITHOUT ANY WARRANTY; without even the implied warranty of
015     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
016     * GNU Lesser General Public License for more details.
017     *
018     * You should have received a copy of the GNU Lesser General Public
019     * License along with JDMP; if not, write to the
020     * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
021     * Boston, MA  02110-1301  USA
022     */
023    
024    package org.jdmp.jgroups;
025    
026    public class PropsUDP {
027            private String bindAddress = null;
028    
029            private final String UDP = "UDP(mcast_addr=228.10.10.10;mcast_port=45588;tos=8;ucast_recv_buf_size=20000000;ucast_send_buf_size=640000;mcast_recv_buf_size=25000000;mcast_send_buf_size=640000;loopback=false;discard_incompatible_packets=true;max_bundle_size=64000;max_bundle_timeout=30;use_incoming_packet_handler=true;ip_ttl=2;enable_bundling=true;enable_diagnostics=true;thread_naming_pattern=cl;use_concurrent_stack=true;thread_pool.enabled=true;thread_pool.min_threads=2;thread_pool.max_threads=8;thread_pool.keep_alive_time=5000;thread_pool.queue_enabled=true;thread_pool.queue_max_size=1000;thread_pool.rejection_policy=Run;oob_thread_pool.enabled=true;oob_thread_pool.min_threads=1;oob_thread_pool.max_threads=8;oob_thread_pool.keep_alive_time=5000;oob_thread_pool.queue_enabled=false;oob_thread_pool.queue_max_size=100;oob_thread_pool.rejection_policy=Run)";
030    
031            private final String PING = "PING(timeout=2000;num_initial_members=3)";
032    
033            private final String MERGE = "MERGE2(max_interval=30000;min_interval=10000)";
034    
035            private final String FDSOCK = "FD_SOCK";
036    
037            private final String FD = "FD(timeout=10000;max_tries=5;shun=true)";
038    
039            private final String VERIFY = "VERIFY_SUSPECT(timeout=1500)";
040    
041            private final String BARRIER = "BARRIER";
042    
043            private final String NAKACK = "pbcast.NAKACK(use_stats_for_retransmission=false;exponential_backoff=150;use_mcast_xmit=true;gc_lag=0;retransmit_timeout=50,300,600,1200;discard_delivered_msgs=true)";
044    
045            private final String UNICAST = "UNICAST(timeout=300,600,1200)";
046    
047            private final String STABLE = "pbcast.STABLE(stability_delay=1000;desired_avg_gossip=50000;max_bytes=1000000)";
048    
049            private final String VIEWSYNC = "VIEW_SYNC(avg_send_interval=60000)";
050    
051            private final String GMS = "pbcast.GMS(print_local_addr=true;join_timeout=3000;shun=false;view_bundling=true)";
052    
053            private final String FC = "FC(max_credits=500000;min_threshold=0.20)";
054    
055            private final String FRAG2 = "FRAG2(frag_size=60000)";
056    
057            private final String STATETRANSFER = "pbcast.STATE_TRANSFER";
058    
059            @Override
060            public String toString() {
061                    StringBuilder s = new StringBuilder();
062    
063                    if (bindAddress == null) {
064                            s.append(UDP + ":");
065                    } else {
066                            s.append(UDP.substring(0, UDP.length() - 1));
067                            s.append(";bind_addr=" + bindAddress);
068                            s.append("):");
069                    }
070    
071                    s.append(PING + ":");
072                    s.append(MERGE + ":");
073                    s.append(FDSOCK + ":");
074                    s.append(FD + ":");
075                    s.append(VERIFY + ":");
076                    s.append(BARRIER + ":");
077                    s.append(NAKACK + ":");
078                    s.append(UNICAST + ":");
079                    s.append(STABLE + ":");
080                    s.append(VIEWSYNC + ":");
081                    s.append(GMS + ":");
082                    s.append(FC + ":");
083                    s.append(FRAG2 + ":");
084                    s.append(STATETRANSFER);
085    
086                    return s.toString();
087            }
088    
089            public void setBindAddress(String bindAddress) {
090                    this.bindAddress = bindAddress;
091            }
092    }