@Override public void initializeApplication(ApplicationInitializationContext context) { String appId = context.getApplicationId().toString(); try { ByteBuffer shuffleSecret = context.getApplicationDataForService(); logger.info("Initializing application {}", appId); if (isAuthenticationEnabled()) { AppId fullId = new AppId(appId); if (db != null) { byte[] key = dbAppKey(fullId); byte[] value = mapper.writeValueAsString(shuffleSecret).getBytes(StandardCharsets.UTF_8); db.put(key, value); } secretManager.registerApp(appId, shuffleSecret); } } catch (Exception e) { logger.error("Exception when initializing application {}", appId, e); } }
@Override public void initializeApplication(ApplicationInitializationContext context) { String appId = context.getApplicationId().toString(); try { ByteBuffer shuffleSecret = context.getApplicationDataForService(); if (isAuthenticationEnabled()) { AppId fullId = new AppId(appId); if (db != null) { byte[] key = dbAppKey(fullId); byte[] value = mapper.writeValueAsString(shuffleSecret).getBytes(StandardCharsets.UTF_8); db.put(key, value); } secretManager.registerApp(appId, shuffleSecret); } } catch (Exception e) { logger.error("Exception when initializing application {}", appId, e); } }
@Override public void initializeApplication(ApplicationInitializationContext context) { String appId = context.getApplicationId().toString(); try { ByteBuffer shuffleSecret = context.getApplicationDataForService(); if (isAuthenticationEnabled()) { AppId fullId = new AppId(appId); if (db != null) { byte[] key = dbAppKey(fullId); byte[] value = mapper.writeValueAsString(shuffleSecret).getBytes(StandardCharsets.UTF_8); db.put(key, value); } secretManager.registerApp(appId, shuffleSecret); } } catch (Exception e) { logger.error("Exception when initializing application {}", appId, e); } }
@Override public void stopApplication(ApplicationTerminationContext context) { String appId = context.getApplicationId().toString(); try { logger.info("Stopping application {}", appId); if (isAuthenticationEnabled()) { AppId fullId = new AppId(appId); if (db != null) { try { db.delete(dbAppKey(fullId)); } catch (IOException e) { logger.error("Error deleting {} from executor state db", appId, e); } } secretManager.unregisterApp(appId); } blockHandler.applicationRemoved(appId, false /* clean up local dirs */); } catch (Exception e) { logger.error("Exception when stopping application {}", appId, e); } }
@Override public void stopApplication(ApplicationTerminationContext context) { String appId = context.getApplicationId().toString(); try { if (isAuthenticationEnabled()) { AppId fullId = new AppId(appId); if (db != null) { try { db.delete(dbAppKey(fullId)); } catch (IOException e) { logger.error("Error deleting {} from executor state db", appId, e); } } secretManager.unregisterApp(appId); } blockHandler.applicationRemoved(appId, false /* clean up local dirs */); } catch (Exception e) { logger.error("Exception when stopping application {}", appId, e); } }
@Override public void stopApplication(ApplicationTerminationContext context) { String appId = context.getApplicationId().toString(); try { if (isAuthenticationEnabled()) { AppId fullId = new AppId(appId); if (db != null) { try { db.delete(dbAppKey(fullId)); } catch (IOException e) { logger.error("Error deleting {} from executor state db", appId, e); } } secretManager.unregisterApp(appId); } blockHandler.applicationRemoved(appId, false /* clean up local dirs */); } catch (Exception e) { logger.error("Exception when stopping application {}", appId, e); } }