public TableauMessageBodyGenerator(@Context Configuration configuration, NodeEndpoint endpoint) { this.endpoint = endpoint; this.masterNode = MoreObjects.firstNonNull(endpoint.getAddress(), "localhost"); this.customizationEnabled = MoreObjects.firstNonNull((Boolean) configuration.getProperty(CUSTOMIZATION_ENABLED), false); }
@Override public void failed(final RpcException ex) { if (latch != null) { // this block only applies to intermediate fragments fragmentSubmitFailures.addFailure(endpoint, ex); latch.countDown(); } else { // this block only applies to leaf fragments // since this won't be waited on, we can wait to deliver this event once the AttemptManager is ready exception.addException(new RpcException(String.format("Failure sending leaf fragment to %s:%d.", endpoint.getAddress(), endpoint.getFabricPort()), ex)); } }
@Override public Object next() { QueryProfile profile = iter.next(); return new QueryInfo(profile.getForeman().getAddress(), profile.getUser(), QueryIdHelper.getQueryId(profile.getId()), profile.getQuery(), new Timestamp(profile.getStart())); }
/** * Creates a {@link RemoteNodeFileSystem} instance. * * Only exposed for unit testing */ @VisibleForTesting FileSystem newRemoteFileSystem(final NodeEndpoint endpoint) throws IOException { final FabricCommandRunner runner = runnerFactory.getCommandRunner(endpoint.getAddress(), endpoint.getFabricPort()); RemoteNodeFileSystem rdfs = new RemoteNodeFileSystem(runner, allocator); rdfs.initialize(URI.create(format("sabot://%s:%d", endpoint.getAddress(), endpoint.getFabricPort())), getConf()); return rdfs; }
/** * Create a pause injection on a specific bit. Note this format is not directly accepted by the injection * mechanism. Use the {@link Controls} to build exceptions. */ public static String createPauseOnNode(final Class<?> siteClass, final String desc, final int nSkip, final NodeEndpoint endpoint) { return "{ \"type\" : \"pause\"," + "\"siteClass\" : \"" + siteClass.getName() + "\"," + "\"desc\" : \"" + desc + "\"," + "\"nSkip\" : " + nSkip + "," + "\"address\":\"" + endpoint.getAddress() + "\"," + "\"port\":\"" + endpoint.getUserPort() + "\"}"; }
/** * <code>optional string address = 1;</code> */ public Builder clearAddress() { bitField0_ = (bitField0_ & ~0x00000001); address_ = getDefaultInstance().getAddress(); onChanged(); return this; } /**
public void addSummary(TableBuilder tb) { tb.appendCell(nodeQueryProfile.getEndpoint().getAddress(), null); tb.appendMillis(nodeQueryProfile.getTimeEnqueuedBeforeSubmitMs()); tb.appendBytes(nodeQueryProfile.getMaxMemoryUsed(), null); }
@VisibleForTesting void initialize(URI name, Configuration conf, FileSystem underlyingFS) throws IOException { super.initialize(name, conf); this.allocator = config.getAllocator(); this.localAccessAllowed = config.isLocalAccessAllowed(); this.executor = config.getExecutor(); this.runnerFactory = config.getRunnerFactory(); this.endpointProvider = config.getEndpointProvider(); this.localAddress = config.getLocalIdentity().getAddress(); this.uri = name; this.underlyingFS = underlyingFS; }
private SendEndpoint<DLGetSourceRequest, DLGetSourceResponse> newGetSourceEndpoint() throws RpcException { final NodeEndpoint master = masterEndpoint.get(); if (master == null) { throw new RpcException("master node is down"); } // TODO(DX-10861): separate server-side and client-side code, when the ticket is resolved return getSourceEndpointCreator.getEndpoint(master.getAddress(), master.getFabricPort()); }
private SendEndpoint<DLFindRequest, DLFindResponse> newFindEndpoint() throws RpcException { final NodeEndpoint master = masterEndpoint.get(); if (master == null) { throw new RpcException("master node is down"); } // TODO(DX-10861): separate server-side and client-side code, when the ticket is resolved return findEndpointCreator.getEndpoint(master.getAddress(), master.getFabricPort()); }
@Override public String apply(NodeEndpoint input) { return input.getAddress(); } }).toSet();
@Override public int compare(NodePhaseProfile o1, NodePhaseProfile o2) { return o1.getEndpoint().getAddress().compareTo(o2.getEndpoint().getAddress()); } };
private <Req extends MessageLite, Resp extends MessageLite, T extends SendEndpointCreator<Req, Resp>> SendEndpoint<Req, Resp> newEndpoint(T creator) throws RpcException { NodeEndpoint masterNode = master.get(); if (masterNode == null) { throw new RpcException("master node is down"); } return creator.getEndpoint(masterNode.getAddress(), masterNode.getFabricPort()); }
public AccountingExecTunnel getExecTunnel(final NodeEndpoint endpoint) { AccountingExecTunnel tunnel = tunnels.get(endpoint); if (tunnel == null) { final SharedResource resource = resourceGroup.createResource("send-data-" + endpoint.getAddress(), SharedResourceType.SEND_MSG_DATA); SendingMonitor monitor = new SendingMonitor(resource, accountor); tunnel = new AccountingExecTunnel(connectionCreator.getTunnel(endpoint), monitor, monitor.wrap(statusHandler)); tunnels.put(endpoint, tunnel); } return tunnel; } }
@Override public String apply(NodeEndpoint endpoint) { return endpoint.getAddress(); } });
private SendEndpoint<DLGetSourcesRequest, DLGetSourcesResponse> newGetSourcesEndpoint() throws RpcException { final NodeEndpoint master = masterEndpoint.get(); if (master == null) { throw new RpcException("master node is down"); } // TODO(DX-10861): separate server-side and client-side code, when the ticket is resolved return getSourcesEndpointCreator.getEndpoint(master.getAddress(), master.getFabricPort()); }
private SendEndpoint<SearchRPC.SearchQueryRequest, SearchRPC.SearchQueryResponse> newFindEndpoint() throws RpcException { final NodeEndpoint master = masterEndpoint.get(); if (master == null) { throw new RpcException("master node is down"); } return findEndpointCreator.getEndpoint(master.getAddress(), master.getFabricPort()); }
public ExecToCoordTunnel getTunnel(NodeEndpoint identity){ Preconditions.checkArgument(ClusterCoordinator.Role.fromEndpointRoles(identity.getRoles()).contains(ClusterCoordinator.Role.COORDINATOR), "SabotNode %s is not a coordinator node.", identity); return new ExecToCoordTunnel(identity, factory.getCommandRunner(identity.getAddress(), identity.getFabricPort())); } }
@Override public void failed(final RpcException ex) { final String endpointIdentity = endpoint != null ? endpoint.getAddress() + ":" + endpoint.getUserPort() : "<null>"; logger.error("Failure while attempting to {} fragment {} on endpoint {} with {}.", signal, QueryIdHelper.getQueryIdentifier(value), endpointIdentity, ex); }
@Override public String apply(final CoordinationProtos.NodeEndpoint endpoint) { return endpoint.getAddress(); } }));