Java Code Examples for org.apache.hadoop.yarn.server.resourcemanager.security.RMDelegationTokenSecretManager

The following examples show how to use org.apache.hadoop.yarn.server.resourcemanager.security.RMDelegationTokenSecretManager. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: hadoop   Source File: RMSecretManagerService.java    License: Apache License 2.0 6 votes vote down vote up
@VisibleForTesting
protected RMDelegationTokenSecretManager createRMDelegationTokenSecretManager(
    Configuration conf, RMContext rmContext) {
  long secretKeyInterval =
      conf.getLong(YarnConfiguration.RM_DELEGATION_KEY_UPDATE_INTERVAL_KEY,
          YarnConfiguration.RM_DELEGATION_KEY_UPDATE_INTERVAL_DEFAULT);
  long tokenMaxLifetime =
      conf.getLong(YarnConfiguration.RM_DELEGATION_TOKEN_MAX_LIFETIME_KEY,
          YarnConfiguration.RM_DELEGATION_TOKEN_MAX_LIFETIME_DEFAULT);
  long tokenRenewInterval =
      conf.getLong(YarnConfiguration.RM_DELEGATION_TOKEN_RENEW_INTERVAL_KEY,
          YarnConfiguration.RM_DELEGATION_TOKEN_RENEW_INTERVAL_DEFAULT);

  return new RMDelegationTokenSecretManager(secretKeyInterval,
      tokenMaxLifetime, tokenRenewInterval, 3600000, rmContext);
}
 
Example 2
Source Project: big-c   Source File: RMSecretManagerService.java    License: Apache License 2.0 6 votes vote down vote up
@VisibleForTesting
protected RMDelegationTokenSecretManager createRMDelegationTokenSecretManager(
    Configuration conf, RMContext rmContext) {
  long secretKeyInterval =
      conf.getLong(YarnConfiguration.RM_DELEGATION_KEY_UPDATE_INTERVAL_KEY,
          YarnConfiguration.RM_DELEGATION_KEY_UPDATE_INTERVAL_DEFAULT);
  long tokenMaxLifetime =
      conf.getLong(YarnConfiguration.RM_DELEGATION_TOKEN_MAX_LIFETIME_KEY,
          YarnConfiguration.RM_DELEGATION_TOKEN_MAX_LIFETIME_DEFAULT);
  long tokenRenewInterval =
      conf.getLong(YarnConfiguration.RM_DELEGATION_TOKEN_RENEW_INTERVAL_KEY,
          YarnConfiguration.RM_DELEGATION_TOKEN_RENEW_INTERVAL_DEFAULT);

  return new RMDelegationTokenSecretManager(secretKeyInterval,
      tokenMaxLifetime, tokenRenewInterval, 3600000, rmContext);
}
 
Example 3
Source Project: incubator-myriad   Source File: MyriadOperationsTest.java    License: Apache License 2.0 6 votes vote down vote up
private RMContext generateRMContext(AbstractYarnScheduler<FiCaSchedulerApp, FiCaSchedulerNode> scheduler) throws Exception {
  Configuration conf = new Configuration();
  MockRMContext context = null;
  Dispatcher dispatcher = new MockDispatcher();

  RMApplicationHistoryWriter rmApplicationHistoryWriter = new RMApplicationHistoryWriter(); 
  AMLivelinessMonitor amLivelinessMonitor = new AMLivelinessMonitor(dispatcher);
  AMLivelinessMonitor amFinishingMonitor = new AMLivelinessMonitor(dispatcher);    
  RMDelegationTokenSecretManager delegationTokenSecretManager = new RMDelegationTokenSecretManager(1, 1, 1, 1, context);

  context = new MockRMContext();
  context.setStateStore(TestObjectFactory.getStateStore(conf, "tmp/myriad-operations-test"));
  context.setAmLivelinessMonitor(amLivelinessMonitor);
  context.setAmFinishingMonitor(amFinishingMonitor);
  context.setRMApplicationHistoryWriter(rmApplicationHistoryWriter);
  context.setRMDelegationTokenSecretManager(delegationTokenSecretManager);
  return context;
}
 
Example 4
Source Project: hadoop   Source File: ClientRMService.java    License: Apache License 2.0 5 votes vote down vote up
public ClientRMService(RMContext rmContext, YarnScheduler scheduler,
    RMAppManager rmAppManager, ApplicationACLsManager applicationACLsManager,
    QueueACLsManager queueACLsManager,
    RMDelegationTokenSecretManager rmDTSecretManager) {
  this(rmContext, scheduler, rmAppManager, applicationACLsManager,
      queueACLsManager, rmDTSecretManager, new UTCClock());
}
 
Example 5
Source Project: hadoop   Source File: ClientRMService.java    License: Apache License 2.0 5 votes vote down vote up
public ClientRMService(RMContext rmContext, YarnScheduler scheduler,
    RMAppManager rmAppManager, ApplicationACLsManager applicationACLsManager,
    QueueACLsManager queueACLsManager,
    RMDelegationTokenSecretManager rmDTSecretManager, Clock clock) {
  super(ClientRMService.class.getName());
  this.scheduler = scheduler;
  this.rmContext = rmContext;
  this.rmAppManager = rmAppManager;
  this.applicationsACLsManager = applicationACLsManager;
  this.queueACLsManager = queueACLsManager;
  this.rmDTSecretManager = rmDTSecretManager;
  this.reservationSystem = rmContext.getReservationSystem();
  this.clock = clock;
  this.rValidator = new ReservationInputValidator(clock);
}
 
Example 6
Source Project: hadoop   Source File: TestClientRMTokens.java    License: Apache License 2.0 5 votes vote down vote up
public ClientRMServiceForTest(Configuration conf,
    ResourceScheduler scheduler,
    RMDelegationTokenSecretManager rmDTSecretManager) {
  super(mock(RMContext.class), scheduler, mock(RMAppManager.class),
      new ApplicationACLsManager(conf), new QueueACLsManager(scheduler,
          conf), rmDTSecretManager);
}
 
Example 7
Source Project: hadoop   Source File: TestClientRMTokens.java    License: Apache License 2.0 5 votes vote down vote up
private static RMDelegationTokenSecretManager
    createRMDelegationTokenSecretManager(long secretKeyInterval,
        long tokenMaxLifetime, long tokenRenewInterval) {
  RMContext rmContext = mock(RMContext.class);
  when(rmContext.getStateStore()).thenReturn(new NullRMStateStore());

  RMDelegationTokenSecretManager rmDtSecretManager =
      new RMDelegationTokenSecretManager(secretKeyInterval, tokenMaxLifetime,
        tokenRenewInterval, 3600000, rmContext);
  return rmDtSecretManager;
}
 
Example 8
Source Project: hadoop   Source File: TestKillApplicationWithRMHA.java    License: Apache License 2.0 5 votes vote down vote up
public MyClientRMService(RMContext rmContext, YarnScheduler scheduler,
    RMAppManager rmAppManager,
    ApplicationACLsManager applicationACLsManager,
    QueueACLsManager queueACLsManager,
    RMDelegationTokenSecretManager rmDTSecretManager) {
  super(rmContext, scheduler, rmAppManager, applicationACLsManager,
      queueACLsManager, rmDTSecretManager);
  this.rmContext = rmContext;
}
 
Example 9
Source Project: hadoop   Source File: TestClientRMService.java    License: Apache License 2.0 5 votes vote down vote up
@BeforeClass
public static void setupSecretManager() throws IOException {
  RMContext rmContext = mock(RMContext.class);
  when(rmContext.getStateStore()).thenReturn(new NullRMStateStore());
  dtsm = new RMDelegationTokenSecretManager(60000, 60000, 60000, 60000, rmContext);
  dtsm.startThreads();  
}
 
Example 10
Source Project: hadoop   Source File: ProtocolHATestBase.java    License: Apache License 2.0 5 votes vote down vote up
public CustomedClientRMService(RMContext rmContext,
    YarnScheduler scheduler, RMAppManager rmAppManager,
    ApplicationACLsManager applicationACLsManager,
    QueueACLsManager queueACLsManager,
    RMDelegationTokenSecretManager rmDTSecretManager) {
  super(rmContext, scheduler, rmAppManager, applicationACLsManager,
      queueACLsManager, rmDTSecretManager);
}
 
Example 11
Source Project: big-c   Source File: ClientRMService.java    License: Apache License 2.0 5 votes vote down vote up
public ClientRMService(RMContext rmContext, YarnScheduler scheduler,
    RMAppManager rmAppManager, ApplicationACLsManager applicationACLsManager,
    QueueACLsManager queueACLsManager,
    RMDelegationTokenSecretManager rmDTSecretManager) {
  this(rmContext, scheduler, rmAppManager, applicationACLsManager,
      queueACLsManager, rmDTSecretManager, new UTCClock());
}
 
Example 12
Source Project: big-c   Source File: ClientRMService.java    License: Apache License 2.0 5 votes vote down vote up
public ClientRMService(RMContext rmContext, YarnScheduler scheduler,
    RMAppManager rmAppManager, ApplicationACLsManager applicationACLsManager,
    QueueACLsManager queueACLsManager,
    RMDelegationTokenSecretManager rmDTSecretManager, Clock clock) {
  super(ClientRMService.class.getName());
  this.scheduler = scheduler;
  this.rmContext = rmContext;
  this.rmAppManager = rmAppManager;
  this.applicationsACLsManager = applicationACLsManager;
  this.queueACLsManager = queueACLsManager;
  this.rmDTSecretManager = rmDTSecretManager;
  this.reservationSystem = rmContext.getReservationSystem();
  this.clock = clock;
  this.rValidator = new ReservationInputValidator(clock);
}
 
Example 13
Source Project: big-c   Source File: TestClientRMTokens.java    License: Apache License 2.0 5 votes vote down vote up
public ClientRMServiceForTest(Configuration conf,
    ResourceScheduler scheduler,
    RMDelegationTokenSecretManager rmDTSecretManager) {
  super(mock(RMContext.class), scheduler, mock(RMAppManager.class),
      new ApplicationACLsManager(conf), new QueueACLsManager(scheduler,
          conf), rmDTSecretManager);
}
 
Example 14
Source Project: big-c   Source File: TestClientRMTokens.java    License: Apache License 2.0 5 votes vote down vote up
private static RMDelegationTokenSecretManager
    createRMDelegationTokenSecretManager(long secretKeyInterval,
        long tokenMaxLifetime, long tokenRenewInterval) {
  RMContext rmContext = mock(RMContext.class);
  when(rmContext.getStateStore()).thenReturn(new NullRMStateStore());

  RMDelegationTokenSecretManager rmDtSecretManager =
      new RMDelegationTokenSecretManager(secretKeyInterval, tokenMaxLifetime,
        tokenRenewInterval, 3600000, rmContext);
  return rmDtSecretManager;
}
 
Example 15
Source Project: big-c   Source File: TestKillApplicationWithRMHA.java    License: Apache License 2.0 5 votes vote down vote up
public MyClientRMService(RMContext rmContext, YarnScheduler scheduler,
    RMAppManager rmAppManager,
    ApplicationACLsManager applicationACLsManager,
    QueueACLsManager queueACLsManager,
    RMDelegationTokenSecretManager rmDTSecretManager) {
  super(rmContext, scheduler, rmAppManager, applicationACLsManager,
      queueACLsManager, rmDTSecretManager);
  this.rmContext = rmContext;
}
 
Example 16
Source Project: big-c   Source File: TestClientRMService.java    License: Apache License 2.0 5 votes vote down vote up
@BeforeClass
public static void setupSecretManager() throws IOException {
  RMContext rmContext = mock(RMContext.class);
  when(rmContext.getStateStore()).thenReturn(new NullRMStateStore());
  dtsm = new RMDelegationTokenSecretManager(60000, 60000, 60000, 60000, rmContext);
  dtsm.startThreads();  
}
 
Example 17
Source Project: big-c   Source File: ProtocolHATestBase.java    License: Apache License 2.0 5 votes vote down vote up
public CustomedClientRMService(RMContext rmContext,
    YarnScheduler scheduler, RMAppManager rmAppManager,
    ApplicationACLsManager applicationACLsManager,
    QueueACLsManager queueACLsManager,
    RMDelegationTokenSecretManager rmDTSecretManager) {
  super(rmContext, scheduler, rmAppManager, applicationACLsManager,
      queueACLsManager, rmDTSecretManager);
}
 
Example 18
Source Project: hadoop   Source File: RMActiveServiceContext.java    License: Apache License 2.0 4 votes vote down vote up
@Private
@Unstable
public RMDelegationTokenSecretManager getRMDelegationTokenSecretManager() {
  return this.rmDelegationTokenSecretManager;
}
 
Example 19
Source Project: hadoop   Source File: RMActiveServiceContext.java    License: Apache License 2.0 4 votes vote down vote up
@Private
@Unstable
public void setRMDelegationTokenSecretManager(
    RMDelegationTokenSecretManager delegationTokenSecretManager) {
  this.rmDelegationTokenSecretManager = delegationTokenSecretManager;
}
 
Example 20
Source Project: hadoop   Source File: RMContext.java    License: Apache License 2.0 4 votes vote down vote up
void setRMDelegationTokenSecretManager(
RMDelegationTokenSecretManager delegationTokenSecretManager);
 
Example 21
Source Project: hadoop   Source File: RMContextImpl.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public RMDelegationTokenSecretManager getRMDelegationTokenSecretManager() {
  return activeServiceContext.getRMDelegationTokenSecretManager();
}
 
Example 22
Source Project: hadoop   Source File: RMContextImpl.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void setRMDelegationTokenSecretManager(
    RMDelegationTokenSecretManager delegationTokenSecretManager) {
  activeServiceContext
      .setRMDelegationTokenSecretManager(delegationTokenSecretManager);
}
 
Example 23
Source Project: big-c   Source File: RMActiveServiceContext.java    License: Apache License 2.0 4 votes vote down vote up
@Private
@Unstable
public RMDelegationTokenSecretManager getRMDelegationTokenSecretManager() {
  return this.rmDelegationTokenSecretManager;
}
 
Example 24
Source Project: big-c   Source File: RMActiveServiceContext.java    License: Apache License 2.0 4 votes vote down vote up
@Private
@Unstable
public void setRMDelegationTokenSecretManager(
    RMDelegationTokenSecretManager delegationTokenSecretManager) {
  this.rmDelegationTokenSecretManager = delegationTokenSecretManager;
}
 
Example 25
Source Project: big-c   Source File: RMContext.java    License: Apache License 2.0 4 votes vote down vote up
void setRMDelegationTokenSecretManager(
RMDelegationTokenSecretManager delegationTokenSecretManager);
 
Example 26
Source Project: big-c   Source File: RMContextImpl.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public RMDelegationTokenSecretManager getRMDelegationTokenSecretManager() {
  return activeServiceContext.getRMDelegationTokenSecretManager();
}
 
Example 27
Source Project: big-c   Source File: RMContextImpl.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void setRMDelegationTokenSecretManager(
    RMDelegationTokenSecretManager delegationTokenSecretManager) {
  activeServiceContext
      .setRMDelegationTokenSecretManager(delegationTokenSecretManager);
}
 
Example 28
Source Project: incubator-myriad   Source File: MockRMContext.java    License: Apache License 2.0 4 votes vote down vote up
public void setDelegationTokenSecretManager(RMDelegationTokenSecretManager delegationTokenSecretManager) {
  this.delegationTokenSecretManager = delegationTokenSecretManager;
}
 
Example 29
Source Project: incubator-myriad   Source File: MockRMContext.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public RMDelegationTokenSecretManager getRMDelegationTokenSecretManager() {
  return delegationTokenSecretManager;
}
 
Example 30
Source Project: incubator-myriad   Source File: MockRMContext.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void setRMDelegationTokenSecretManager(RMDelegationTokenSecretManager delegationTokenSecretManager) {
  this.delegationTokenSecretManager = delegationTokenSecretManager;
}