@Override public void fail(Object msgId) { DRPCMessageId did = (DRPCMessageId) msgId; DistributedRPCInvocations.Iface client; if (_local_drpc_id == null) { client = _clients.get(did.index); } else { client = (DistributedRPCInvocations.Iface) ServiceRegistry.getService(_local_drpc_id); } try { client.failRequest(did.id); } catch (AuthorizationException aze) { LOG.error("Not authorized to failREquest from DRPC server", aze); } catch (TException e) { LOG.error("Failed to fail request", e); } }
public LocalDRPC() { thread = new Thread(new Runnable() { @Override public void run() { LOG.info("Begin to init local Drpc"); try { killOldDrpcPids(); handler.init(); } catch (Exception e) { LOG.info("Failed to start local drpc"); System.exit(-1); } LOG.info("Successfully started local drpc"); } }); thread.start(); serviceId = ServiceRegistry.registerService(handler); }
@Override public void shutdown() { ServiceRegistry.unregisterService(this.serviceId); this.handler.shutdown(); }
@Override public void fail(Object msgId) { DRPCMessageId did = (DRPCMessageId) msgId; DistributedRPCInvocations.Iface client; if(_local_drpc_id == null) { client = _clients.get(did.index); } else { client = (DistributedRPCInvocations.Iface) ServiceRegistry.getService(_local_drpc_id); } try { client.failRequest(did.id); } catch (TException e) { LOG.error("Failed to fail request", e); } }
@Override public void shutdown() { // TODO Auto-generated method stub ServiceRegistry.unregisterService(this.serviceId); this.handler.shutdown(); }
public LocalDRPC() { thread = new Thread(new Runnable() { @Override public void run() { LOG.info("Begin to init local Drpc"); try { killOldDrpcPids(); handler.init(); } catch (Exception e) { LOG.info("Failed to start local drpc"); System.exit(-1); } LOG.info("Successfully start local drpc"); } }); thread.start(); serviceId = ServiceRegistry.registerService(handler); }
DistributedRPCInvocations.Iface client; if (local) { client = (DistributedRPCInvocations.Iface) ServiceRegistry.getService(host); } else { List server = new ArrayList() {
DistributedRPCInvocations.Iface client; if (local) { client = (DistributedRPCInvocations.Iface) ServiceRegistry.getService(host); } else { List server = new ArrayList() {
DistributedRPCInvocations.Iface client; if(local) { client = (DistributedRPCInvocations.Iface) ServiceRegistry.getService(host); } else { List server = new ArrayList() {{
DistributedRPCInvocations.Iface drpc = (DistributedRPCInvocations.Iface) ServiceRegistry.getService(_local_drpc_id); if (drpc != null) { // can happen during shutdown of drpc while topology is still up try {
DistributedRPCInvocations.Iface drpc = (DistributedRPCInvocations.Iface) ServiceRegistry.getService(_local_drpc_id); try { DRPCRequest req = drpc.fetchRequest(_function);
@Override public void fail(Object msgId) { DRPCMessageId did = (DRPCMessageId) msgId; DistributedRPCInvocations.Iface client; if(_local_drpc_id == null) { client = _clients.get(did.index); } else { client = (DistributedRPCInvocations.Iface) ServiceRegistry.getService(_local_drpc_id); } try { client.failRequest(did.id); } catch (TException e) { LOG.error("Failed to fail request", e); } }
@Override public void fail(Object msgId) { DRPCMessageId did = (DRPCMessageId) msgId; DistributedRPCInvocations.Iface client; if (_local_drpc_id == null) { client = _clients.get(did.index); } else { client = (DistributedRPCInvocations.Iface) ServiceRegistry.getService(_local_drpc_id); } try { client.failRequest(did.id); } catch (AuthorizationException aze) { LOG.error("Not authorized to failREquest from DRPC server", aze); } catch (TException e) { LOG.error("Failed to fail request", e); } }
@Override public void complete(ReturnResultsState state, TridentCollector collector) { // only one of the multireducers will receive the tuples if(state.returnInfo!=null) { String result = JSONValue.toJSONString(state.results); Map retMap = (Map) JSONValue.parse(state.returnInfo); final String host = (String) retMap.get("host"); final int port = Utils.getInt(retMap.get("port")); String id = (String) retMap.get("id"); DistributedRPCInvocations.Iface client; if(local) { client = (DistributedRPCInvocations.Iface) ServiceRegistry.getService(host); } else { List server = new ArrayList() {{ add(host); add(port); }}; if(!_clients.containsKey(server)) { _clients.put(server, new DRPCInvocationsClient(host, port)); } client = _clients.get(server); } try { client.result(id, result); } catch(TException e) { collector.reportError(e); } } }
DistributedRPCInvocations.Iface client; if (local) { client = (DistributedRPCInvocations.Iface) ServiceRegistry.getService(host); } else { List server = new ArrayList() {
DistributedRPCInvocations.Iface client; if(local) { client = (DistributedRPCInvocations.Iface) ServiceRegistry.getService(host); } else { List server = new ArrayList() {{
DistributedRPCInvocations.Iface client; if (local) { client = (DistributedRPCInvocations.Iface) ServiceRegistry.getService(host); } else { List server = new ArrayList() {
DistributedRPCInvocations.Iface drpc = (DistributedRPCInvocations.Iface) ServiceRegistry.getService(_local_drpc_id); if(drpc!=null) { // can happen during shutdown of drpc while topology is still up try {
DistributedRPCInvocations.Iface drpc = (DistributedRPCInvocations.Iface) ServiceRegistry.getService(_local_drpc_id); if (drpc != null) { // can happen during shutdown of drpc while topology is still up try {