@TokenInfo(JobTokenSelector.class) public interface LlapTaskUmbilicalProtocol extends VersionedProtocol { // Why are we still using writables in 2017? public class TezAttemptArray extends ArrayWritable { public TezAttemptArray() { super(TezTaskAttemptID.class); } } public class BooleanArray extends ArrayWritable { public BooleanArray() { super(BooleanWritable.class); } } public static final long versionID = 1L; // From Tez. Eventually changes over to the LLAP protocol and ProtocolBuffers boolean canCommit(TezTaskAttemptID taskid) throws IOException; public TezHeartbeatResponse heartbeat(TezHeartbeatRequest request) throws IOException, TezException; public void nodeHeartbeat(Text hostname, Text uniqueId, int port, TezAttemptArray aw, BooleanArray guaranteed) throws IOException; public void taskKilled(TezTaskAttemptID taskAttemptId) throws IOException; }
/** * Try to locate the required token for the server. * * @param authType of the SASL client * @return Token for server, or null if no token available * @throws IOException - token selector cannot be instantiated */ private Token<?> getServerToken(SaslAuth authType) throws IOException { TokenInfo tokenInfo = SecurityUtil.getTokenInfo(protocol, conf); LOG.debug("Get token info proto:" + protocol + " info:" + tokenInfo); if (tokenInfo == null) { // protocol has no support for tokens return null; } TokenSelector<?> tokenSelector = null; try { tokenSelector = tokenInfo.value().newInstance(); } catch (InstantiationException | IllegalAccessException e) { throw new IOException(e.toString(), e); } return tokenSelector.selectToken( SecurityUtil.buildTokenService(serverAddr), ugi.getTokens()); }
@ProtocolInfo(protocolName = "org.apache.hadoop.hive.llap.protocol.LlapPluginProtocolPB", protocolVersion = 1) @TokenInfo(JobTokenSelector.class) @InterfaceAudience.Private public interface LlapPluginProtocolPB extends LlapPluginProtocolProtos.LlapPluginProtocol.BlockingInterface { }
/** * Try to locate the required token for the server. * * @param authType of the SASL client * @return Token<?> for server, or null if no token available * @throws IOException - token selector cannot be instantiated */ private Token<?> getServerToken(SaslAuth authType) throws IOException { TokenInfo tokenInfo = SecurityUtil.getTokenInfo(protocol, conf); LOG.debug("Get token info proto:"+protocol+" info:"+tokenInfo); if (tokenInfo == null) { // protocol has no support for tokens return null; } TokenSelector<?> tokenSelector = null; try { tokenSelector = tokenInfo.value().newInstance(); } catch (InstantiationException e) { throw new IOException(e.toString()); } catch (IllegalAccessException e) { throw new IOException(e.toString()); } return tokenSelector.selectToken( SecurityUtil.buildTokenService(serverAddr), ugi.getTokens()); }
@ProtocolInfo(protocolName = "org.apache.hadoop.hive.llap.protocol.LlapProtocolBlockingPB", protocolVersion = 1) @KerberosInfo(serverPrincipal = HiveConf.HIVE_LLAP_DAEMON_SERVICE_PRINCIPAL_NAME) @TokenInfo(LlapTokenSelector.class) @InterfaceAudience.Private public interface LlapProtocolBlockingPB extends LlapDaemonProtocolProtos.LlapDaemonProtocol.BlockingInterface { }
/** * Try to locate the required token for the server. * * @param authType of the SASL client * @return Token<?> for server, or null if no token available * @throws IOException - token selector cannot be instantiated */ private Token<?> getServerToken(SaslAuth authType) throws IOException { TokenInfo tokenInfo = SecurityUtil.getTokenInfo(protocol, conf); LOG.debug("Get token info proto:"+protocol+" info:"+tokenInfo); if (tokenInfo == null) { // protocol has no support for tokens return null; } TokenSelector<?> tokenSelector = null; try { tokenSelector = tokenInfo.value().newInstance(); } catch (InstantiationException e) { throw new IOException(e.toString()); } catch (IllegalAccessException e) { throw new IOException(e.toString()); } return tokenSelector.selectToken( SecurityUtil.buildTokenService(serverAddr), ugi.getTokens()); }
@TokenInfo(TestTokenSelector.class) public interface TestProtocol extends VersionedProtocol { public static final long versionID = 1L; String aMethod() throws IOException; }
/** * Try to locate the required token for the server. * * @param authType of the SASL client * @return Token<?> for server, or null if no token available * @throws IOException - token selector cannot be instantiated */ private Token<?> getServerToken(SaslAuth authType) throws IOException { TokenInfo tokenInfo = SecurityUtil.getTokenInfo(protocol, conf); LOG.debug("Get token info proto:"+protocol+" info:"+tokenInfo); if (tokenInfo == null) { // protocol has no support for tokens return null; } TokenSelector<?> tokenSelector = null; try { tokenSelector = tokenInfo.value().newInstance(); } catch (InstantiationException e) { throw new IOException(e.toString()); } catch (IllegalAccessException e) { throw new IOException(e.toString()); } return tokenSelector.selectToken( SecurityUtil.buildTokenService(serverAddr), ugi.getTokens()); }
@TokenInfo(TestTokenSelector.class) public interface TestProtocol extends VersionedProtocol { public static final long versionID = 1L; String aMethod() throws IOException; String getServerRemoteUser() throws IOException; }
/** * Try to locate the required token for the server. * * @param authType of the SASL client * @return Token<?> for server, or null if no token available * @throws IOException - token selector cannot be instantiated */ private Token<?> getServerToken(SaslAuth authType) throws IOException { TokenInfo tokenInfo = SecurityUtil.getTokenInfo(protocol, conf); LOG.debug("Get token info proto:"+protocol+" info:"+tokenInfo); if (tokenInfo == null) { // protocol has no support for tokens return null; } TokenSelector<?> tokenSelector = null; try { tokenSelector = tokenInfo.value().newInstance(); } catch (InstantiationException e) { throw new IOException(e.toString()); } catch (IllegalAccessException e) { throw new IOException(e.toString()); } return tokenSelector.selectToken( SecurityUtil.buildTokenService(serverAddr), ugi.getTokens()); }
@TokenInfo(TestTokenSelector.class) public interface TestProtocol extends VersionedProtocol { public static final long versionID = 1L; String aMethod() throws IOException; String getServerRemoteUser() throws IOException; }
@KerberosInfo( serverPrincipal = SERVER_PRINCIPAL_KEY) @TokenInfo(TestTokenSelector.class) public interface TestSaslProtocol extends TestRPC.TestProtocol { public AuthenticationMethod getAuthMethod() throws IOException; }
@KerberosInfo( serverPrincipal=USER_NAME_KEY) @TokenInfo(TestDelegationTokenSelector.class) public static interface MiniProtocol extends VersionedProtocol { public static final long versionID = 1L; /** * Get a Delegation Token. */ public Token<TestDelegationTokenIdentifier> getDelegationToken(Text renewer) throws IOException; }
@TokenInfo(ClientToAMTokenSelector.class) @ProtocolInfo( protocolName = "com.linkedin.tony.rpc.TensorFlowCluster", protocolVersion = 1) public interface TensorFlowCluster extends VersionedProtocol { long versionID = 1L; GetTaskUrlsResponse getTaskUrls(GetTaskUrlsRequest request) throws IOException, YarnException; GetClusterSpecResponse getClusterSpec(GetClusterSpecRequest request) throws YarnException, IOException; RegisterWorkerSpecResponse registerWorkerSpec(RegisterWorkerSpecRequest request) throws YarnException, IOException; RegisterTensorBoardUrlResponse registerTensorBoardUrl(RegisterTensorBoardUrlRequest request) throws Exception; RegisterExecutionResultResponse registerExecutionResult(RegisterExecutionResultRequest request) throws Exception; Empty finishApplication(Empty request) throws YarnException, IOException; HeartbeatResponse taskExecutorHeartbeat(HeartbeatRequest request) throws YarnException, IOException; }
/** Protocol that task child process uses to contact its parent process. The * parent is a daemon which which polls the central master for a new map or * reduce task and runs it as a child process. All communication between child * and parent is via this protocol. */ @TokenInfo(JobTokenSelector.class) @InterfaceAudience.Private @InterfaceStability.Stable // ProtocolInfo will be required once we move to Hadoop PB RPC //@ProtocolInfo(protocolName = "TezTaskUmbilicalProtocol", protocolVersion = 1) public interface TezTaskUmbilicalProtocol extends VersionedProtocol { public static final long versionID = 19L; ContainerTask getTask(ContainerContext containerContext) throws IOException; boolean canCommit(TezTaskAttemptID taskid) throws IOException; /// Copies from TezUmbilical until complete re-factor is done // TODONEWTEZ public TezHeartbeatResponse heartbeat(TezHeartbeatRequest request) throws IOException, TezException; }
@KerberosInfo( serverPrincipal = HdfsClientConfigKeys.DFS_DATANODE_KERBEROS_PRINCIPAL_KEY) @TokenInfo(BlockTokenSelector.class) @ProtocolInfo(protocolName = "org.apache.hadoop.hdfs.protocol.ClientDatanodeProtocol", protocolVersion = 1) @InterfaceAudience.Private public interface ClientDatanodeProtocolPB extends ClientDatanodeProtocolService.BlockingInterface { }
@KerberosInfo( serverPrincipal = SERVER_PRINCIPAL_KEY) @TokenInfo(TestTokenSelector.class) public interface TestSaslProtocol extends TestRPC.TestProtocol { public AuthMethod getAuthMethod() throws IOException; public String getAuthUser() throws IOException; }
@KerberosInfo( serverPrincipal = DFSConfigKeys.DFS_DATANODE_KERBEROS_PRINCIPAL_KEY) @TokenInfo(BlockTokenSelector.class) @ProtocolInfo(protocolName = "org.apache.hadoop.hdfs.protocol.ClientDatanodeProtocol", protocolVersion = 1) @InterfaceAudience.Private public interface ClientDatanodeProtocolPB extends ClientDatanodeProtocolService.BlockingInterface { }
@TokenInfo(ClientToAMTokenSelector.class) @ProtocolInfo(protocolName = "org.apache.hadoop.yarn.server.resourcemanager.security$CustomProtocol", protocolVersion = 1) public interface CustomProtocol extends TestRpcServiceProtos.CustomProto.BlockingInterface { }
@KerberosInfo( serverPrincipal=USER_NAME_KEY) @TokenInfo(TestDelegationTokenSelector.class) public static interface MiniProtocol extends VersionedProtocol { public static final long versionID = 1L; /** * Get a Delegation Token. */ public Token<TestDelegationTokenIdentifier> getDelegationToken(Text renewer) throws IOException; }