<commit_before>// $Id$

package org.jgroups.protocols.pbcast;

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectInput;
import java.io.ObjectOutput;
import java.io.OutputStream;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.ServerSocket;
import java.net.Socket;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Vector;

import org.jgroups.Address;
import org.jgroups.Event;
import org.jgroups.Header;
import org.jgroups.Message;
import org.jgroups.View;
import org.jgroups.stack.IpAddress;
import org.jgroups.stack.Protocol;
import org.jgroups.stack.StateTransferInfo;
import org.jgroups.util.Streamable;
import org.jgroups.util.Util;

import EDU.oswego.cs.dl.util.concurrent.BoundedBuffer;
import EDU.oswego.cs.dl.util.concurrent.PooledExecutor;


/**
 * 
 */
public class STREAMING_STATE_TRANSFER extends Protocol {
    Address        local_addr=null;
    final Vector   members=new Vector();
    long           state_id=1; 
    
    final List     state_requesters=new ArrayList();

    /** set to true while waiting for a STATE_RSP */
    boolean        waiting_for_state_response=false;<commit_msg>added javadoc<commit_after>// $Id$

package org.jgroups.protocols.pbcast;

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectInput;
import java.io.ObjectOutput;
import java.io.OutputStream;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.ServerSocket;
import java.net.Socket;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Vector;

import org.jgroups.Address;
import org.jgroups.Event;
import org.jgroups.Header;
import org.jgroups.Message;
import org.jgroups.View;
import org.jgroups.stack.IpAddress;
import org.jgroups.stack.Protocol;
import org.jgroups.stack.StateTransferInfo;
import org.jgroups.util.Streamable;
import org.jgroups.util.Util;

import EDU.oswego.cs.dl.util.concurrent.BoundedBuffer;
import EDU.oswego.cs.dl.util.concurrent.PooledExecutor;


/**
 * <code>STREAMING_STATE_TRANSFER</code>, as its name implies, allows a streaming 
 * state transfer between two channel instances. 
 * 
 * <p>
 * 
 * Major advantage of this approach is that transfering application state to a 
 * joining member of a group does not entail loading of the complete application 
 * state into memory. Application state, for example, might be located entirely 
 * in some form of disk based storage. The default <code>STATE_TRANSFER</code> 
 * requires this state be loaded entirely into memory before being transferred 
 * to a group member while <code>STREAMING_STATE_TRANSFER</code> does not. 
 * Thus <code>STREAMING_STATE_TRANSFER</code> protocol is able to transfer 
 * application state that is very large (>1Gb) without a likelihood of such transfer 
 * resulting in OutOfMemoryException.
 * 
 * <p>
 * 
 * Channel instance can be configured with either <code>STREAMING_STATE_TRANSFER</code> 
 * or <code>STATE_TRANSFER</code> but not both protocols at the same time. 
 * 
 * <p>
 * 
 * In order to process streaming state transfer an application has to implement 
 * <code>StreamingMessageListener</code> if it is using channel in a push style 
 * mode or it has to process <code>StreamingSetStateEvent</code> and 
 * <code>StreamingGetStateEvent</code> if it is using channel in a pull style mode.    
 * 
 * 
 * @author <NAME>
 * @see org.jgroups.StreamingMessageListener
 * @see org.jgroups.StreamingGetStateEvent
 * @see org.jgroups.StreamingSetStateEvent
 * @see org.jgroups.protocols.pbcast.STATE_TRANSFER
 * @since 2.4
 * 
 * 
 */
public class STREAMING_STATE_TRANSFER extends Protocol {
    Address        local_addr=null;
    final Vector   members=new Vector();
    long           state_id=1; 
    
    final List     state_requesters=new ArrayList();

    /** set to true while waiting for a STATE_RSP */
    boolean        waiting_for_state_response=false;
{'fraction_non_alphanumeric': 0.09312485628880203, 'fraction_numerical': 0.0011496895838123706, 'mean_word_length': 4.390334572490707, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 26, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6646440', 'n_tokens_mistral': 1329, 'n_tokens_neox': 1296, 'n_words': 362}