/** * Create a proxy object that will speak the binary protocol on a socket. * Upward messages are passed on the specified handler and downward * downward messages are public methods on this object. * @param sock The socket to communicate on. * @param handler The handler for the received messages. * @param key The object to read keys into. * @param value The object to read values into. * @param config The job's configuration * @throws IOException */ public BinaryProtocol(Socket sock, UpwardProtocol<K2, V2> handler, K2 key, V2 value, JobConf config) throws IOException { OutputStream raw = sock.getOutputStream(); // If we are debugging, save a copy of the downlink commands to a file if (Submitter.getKeepCommandFile(config)) { raw = new TeeOutputStream("downlink.data", raw); } stream = new DataOutputStream(new BufferedOutputStream(raw, BUFFER_SIZE)) ; uplink = new UplinkReaderThread<K2, V2>(sock.getInputStream(), handler, key, value); uplink.setName("pipe-uplink-handler"); uplink.start(); }
/** * Create a proxy object that will speak the binary protocol on a socket. * Upward messages are passed on the specified handler and downward * downward messages are public methods on this object. * @param sock The socket to communicate on. * @param handler The handler for the received messages. * @param key The object to read keys into. * @param value The object to read values into. * @param config The job's configuration * @throws IOException */ public BinaryProtocol(Socket sock, UpwardProtocol<K2, V2> handler, K2 key, V2 value, JobConf config) throws IOException { OutputStream raw = sock.getOutputStream(); // If we are debugging, save a copy of the downlink commands to a file if (Submitter.getKeepCommandFile(config)) { raw = new TeeOutputStream("downlink.data", raw); } stream = new DataOutputStream(new BufferedOutputStream(raw, BUFFER_SIZE)) ; uplink = new UplinkReaderThread<K2, V2>(sock.getInputStream(), handler, key, value); uplink.setName("pipe-uplink-handler"); uplink.start(); }
/** * Create a proxy object that will speak the binary protocol on a socket. * Upward messages are passed on the specified handler and downward * downward messages are public methods on this object. * @param sock The socket to communicate on. * @param handler The handler for the received messages. * @param key The object to read keys into. * @param value The object to read values into. * @param config The job's configuration * @throws IOException */ public BinaryProtocol(Socket sock, UpwardProtocol<K2, V2> handler, K2 key, V2 value, JobConf config) throws IOException { OutputStream raw = sock.getOutputStream(); // If we are debugging, save a copy of the downlink commands to a file if (Submitter.getKeepCommandFile(config)) { raw = new TeeOutputStream("downlink.data", raw); } stream = new DataOutputStream(new BufferedOutputStream(raw, BUFFER_SIZE)) ; uplink = new UplinkReaderThread<K2, V2>(sock.getInputStream(), handler, key, value); uplink.setName("pipe-uplink-handler"); uplink.start(); }
/** * Create a proxy object that will speak the binary protocol on a socket. * Upward messages are passed on the the specified handler and downward * downward messages are public methods on this object. * @param sock The socket to communicate on. * @param handler The handler for the received messages. * @param key The object to read keys into. * @param value The object to read values into. * @param config The job's configuration * @throws IOException */ public BinaryProtocol(Socket sock, UpwardProtocol<K2, V2> handler, K2 key, V2 value, JobConf config) throws IOException { OutputStream raw = sock.getOutputStream(); // If we are debugging, save a copy of the downlink commands to a file if (Submitter.getKeepCommandFile(config)) { raw = new TeeOutputStream("downlink.data", raw); } stream = new DataOutputStream(new BufferedOutputStream(raw, BUFFER_SIZE)) ; uplink = new UplinkReaderThread<K2, V2>(sock.getInputStream(), handler, key, value); uplink.setName("pipe-uplink-handler"); uplink.start(); }
/** * Create a proxy object that will speak the binary protocol on a socket. * Upward messages are passed on the specified handler and downward * downward messages are public methods on this object. * @param sock The socket to communicate on. * @param handler The handler for the received messages. * @param key The object to read keys into. * @param value The object to read values into. * @param config The job's configuration * @throws IOException */ public BinaryProtocol(Socket sock, UpwardProtocol<K2, V2> handler, K2 key, V2 value, JobConf config) throws IOException { OutputStream raw = sock.getOutputStream(); // If we are debugging, save a copy of the downlink commands to a file if (Submitter.getKeepCommandFile(config)) { raw = new TeeOutputStream("downlink.data", raw); } stream = new DataOutputStream(new BufferedOutputStream(raw, BUFFER_SIZE)) ; uplink = new UplinkReaderThread<K2, V2>(sock.getInputStream(), handler, key, value); uplink.setName("pipe-uplink-handler"); uplink.start(); }
/** * Create a proxy object that will speak the binary protocol on a socket. * Upward messages are passed on the specified handler and downward * downward messages are public methods on this object. * @param sock The socket to communicate on. * @param handler The handler for the received messages. * @param key The object to read keys into. * @param value The object to read values into. * @param config The job's configuration * @throws IOException */ public BinaryProtocol(Socket sock, UpwardProtocol<K2, V2> handler, K2 key, V2 value, JobConf config) throws IOException { OutputStream raw = sock.getOutputStream(); // If we are debugging, save a copy of the downlink commands to a file if (Submitter.getKeepCommandFile(config)) { raw = new TeeOutputStream("downlink.data", raw); } stream = new DataOutputStream(new BufferedOutputStream(raw, BUFFER_SIZE)) ; uplink = new UplinkReaderThread<K2, V2>(sock.getInputStream(), handler, key, value); uplink.setName("pipe-uplink-handler"); uplink.start(); }
/** * Create a proxy object that will speak the binary protocol on a socket. * Upward messages are passed on the specified handler and downward * downward messages are public methods on this object. * @param sock The socket to communicate on. * @param handler The handler for the received messages. * @param key The object to read keys into. * @param value The object to read values into. * @param config The job's configuration * @throws IOException */ public BinaryProtocol(Socket sock, UpwardProtocol<K2, V2> handler, K2 key, V2 value, JobConf config) throws IOException { OutputStream raw = sock.getOutputStream(); // If we are debugging, save a copy of the downlink commands to a file if (Submitter.getKeepCommandFile(config)) { raw = new TeeOutputStream("downlink.data", raw); } stream = new DataOutputStream(new BufferedOutputStream(raw, BUFFER_SIZE)) ; uplink = new UplinkReaderThread<K2, V2>(sock.getInputStream(), handler, key, value); uplink.setName("pipe-uplink-handler"); uplink.start(); }