/** Create a proxy instance whose methods invoke RPCs. */ public static Object getClient(Class<?> iface, Transceiver transciever) throws IOException { return getClient(iface, transciever, SpecificData.get()); }
/** Create a proxy instance whose methods invoke RPCs. */ public static Object getClient(Class<?> iface, Transceiver transciever) throws IOException { return getClient(iface, transciever, SpecificData.get()); }
protected List<Span> collectAllSpans(List<URL> hosts) { List<Span> out = new ArrayList<Span>(); for (URL url: hosts) { HttpTransceiver trans = new HttpTransceiver(url); try { AvroTrace client = (AvroTrace) SpecificRequestor.getClient(AvroTrace.class, trans); for (Span s: client.getAllSpans()) { out.add(s); } } catch (IOException e) { continue; } } return out; }
protected List<Span> collectRangedSpans(List<URL> hosts, long start, long end) { List<Span> out = new ArrayList<Span>(); for (URL url: hosts) { HttpTransceiver trans = new HttpTransceiver(url); try { AvroTrace client = (AvroTrace) SpecificRequestor.getClient(AvroTrace.class, trans); for (Span s: client.getSpansInRange(start, end)) { out.add(s); } } catch (IOException e) { continue; } } return out; }
public TetheredProcess(JobConf job, OutputCollector<TetherData, NullWritable> collector, Reporter reporter) throws Exception { try { // start server this.outputService = new TetherOutputService(collector, reporter); this.outputServer = new SocketServer (new SpecificResponder(OutputProtocol.class, outputService), new InetSocketAddress(0)); outputServer.start(); // start sub-process, connecting back to server this.subprocess = startSubprocess(job); // open client, connecting to sub-process this.clientTransceiver = new SocketTransceiver(new InetSocketAddress(outputService.inputPort())); this.inputClient = (InputProtocol) SpecificRequestor.getClient(InputProtocol.class, clientTransceiver); } catch (Exception t) { close(); throw t; } }