code stringlengths 23 201k | docstring stringlengths 17 96.2k | func_name stringlengths 0 235 | language stringclasses 1
value | repo stringlengths 8 72 | path stringlengths 11 317 | url stringlengths 57 377 | license stringclasses 7
values |
|---|---|---|---|---|---|---|---|
@Override
public boolean accept(final File path) {
if (path.isDirectory() && path.lastModified() < pastTimeThreshold) {
return true;
}
return false;
} | Validates and saves a report, returning the project id of the saved report
if successful, and null otherwise.
@return The project id of the saved report if successful, and null
otherwise | accept | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/viewer/reportal/ReportalServlet.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/viewer/reportal/ReportalServlet.java | Apache-2.0 |
@Override
protected void configure() {
install(new AzkabanCoreModule(this.props));
bind(Storage.class).to(resolveStorageClassType());
bind(AzkabanDataSource.class).to(resolveDataSourceType());
bind(TriggerLoader.class).to(JdbcTriggerImpl.class);
bind(ProjectLoader.class).to(JdbcProjectImpl.class);... | This Guice module is currently a one place container for all bindings in the current module. This
is intended to help during the migration process to Guice. Once this class starts growing we can
move towards more modular structuring of Guice components. | configure | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/AzkabanCommonModule.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/AzkabanCommonModule.java | Apache-2.0 |
public Class<? extends Storage> resolveStorageClassType() {
final StorageImplementationType type = StorageImplementationType
.from(this.config.getStorageImplementation());
if (type == StorageImplementationType.HDFS || type == StorageImplementationType.LOCAL_HADOOP) {
install(new HadoopModule());
... | This Guice module is currently a one place container for all bindings in the current module. This
is intended to help during the migration process to Guice. Once this class starts growing we can
move towards more modular structuring of Guice components. | resolveStorageClassType | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/AzkabanCommonModule.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/AzkabanCommonModule.java | Apache-2.0 |
private Class<? extends Storage> loadCustomStorageClass(final String storageImplementation) {
try {
return (Class<? extends Storage>) Class.forName(storageImplementation);
} catch (final ClassNotFoundException e) {
throw new StorageException(e);
}
} | This Guice module is currently a one place container for all bindings in the current module. This
is intended to help during the migration process to Guice. Once this class starts growing we can
move towards more modular structuring of Guice components. | loadCustomStorageClass | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/AzkabanCommonModule.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/AzkabanCommonModule.java | Apache-2.0 |
private Class<? extends AzkabanDataSource> resolveDataSourceType() {
final String databaseType = this.props.getString("database.type");
if (databaseType.equals("h2")) {
return H2FileDataSource.class;
} else {
return MySQLDataSource.class;
}
} | This Guice module is currently a one place container for all bindings in the current module. This
is intended to help during the migration process to Guice. Once this class starts growing we can
move towards more modular structuring of Guice components. | resolveDataSourceType | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/AzkabanCommonModule.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/AzkabanCommonModule.java | Apache-2.0 |
@Provides
public QueryRunner createQueryRunner(final AzkabanDataSource dataSource) {
return new QueryRunner(dataSource);
} | This Guice module is currently a one place container for all bindings in the current module. This
is intended to help during the migration process to Guice. Once this class starts growing we can
move towards more modular structuring of Guice components. | createQueryRunner | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/AzkabanCommonModule.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/AzkabanCommonModule.java | Apache-2.0 |
@Inject
@Provides
@Singleton
public AzkabanEventReporter createAzkabanEventReporter() {
final boolean eventReporterEnabled =
this.props.getBoolean(AZKABAN_EVENT_REPORTING_ENABLED, false);
if (!eventReporterEnabled) {
logger.info("Event reporter is not enabled");
return null;
}
... | This Guice module is currently a one place container for all bindings in the current module. This
is intended to help during the migration process to Guice. Once this class starts growing we can
move towards more modular structuring of Guice components. | createAzkabanEventReporter | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/AzkabanCommonModule.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/AzkabanCommonModule.java | Apache-2.0 |
private void bindOfflineLogsLoader() {
final boolean eventReporterEnabled =
this.props.getBoolean(AZKABAN_OFFLINE_LOGS_LOADER_ENABLED, false);
ExecutionLogsLoader executionLogsLoader = null;
if (!eventReporterEnabled) {
logger.info("Offline logs loader is not enabled");
} else {
fin... | This Guice module is currently a one place container for all bindings in the current module. This
is intended to help during the migration process to Guice. Once this class starts growing we can
move towards more modular structuring of Guice components. | bindOfflineLogsLoader | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/AzkabanCommonModule.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/AzkabanCommonModule.java | Apache-2.0 |
private void bindImageManagementDependencies() {
if (isContainerizedDispatchMethodEnabled()) {
bind(ImageTypeDao.class).to(ImageTypeDaoImpl.class).in(Scopes.SINGLETON);
bind(ImageVersionDao.class).to(ImageVersionDaoImpl.class).in(Scopes.SINGLETON);
bind(ImageRampupDao.class).to(ImageRampupDaoImpl.... | This Guice module is currently a one place container for all bindings in the current module. This
is intended to help during the migration process to Guice. Once this class starts growing we can
move towards more modular structuring of Guice components. | bindImageManagementDependencies | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/AzkabanCommonModule.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/AzkabanCommonModule.java | Apache-2.0 |
private boolean isContainerizedDispatchMethodEnabled() {
return DispatchMethod.isContainerizedMethodEnabled(this.props
.getString(Constants.ConfigurationKeys.AZKABAN_EXECUTION_DISPATCH_METHOD,
DispatchMethod.PUSH.name()));
} | This Guice module is currently a one place container for all bindings in the current module. This
is intended to help during the migration process to Guice. Once this class starts growing we can
move towards more modular structuring of Guice components. | isContainerizedDispatchMethodEnabled | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/AzkabanCommonModule.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/AzkabanCommonModule.java | Apache-2.0 |
public Props getProps() {
return this.props;
} | Storage Implementation This can be any of the {@link StorageImplementationType} values in which
case {@link StorageFactory} will create the appropriate storage instance. Or one can feed in a
custom implementation class using the full qualified path required by a classloader.
examples: LOCAL, DATABASE, azkaban.storage.... | getProps | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/AzkabanCommonModuleConfig.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/AzkabanCommonModuleConfig.java | Apache-2.0 |
public String getStorageImplementation() {
return this.storageImplementation;
} | Storage Implementation This can be any of the {@link StorageImplementationType} values in which
case {@link StorageFactory} will create the appropriate storage instance. Or one can feed in a
custom implementation class using the full qualified path required by a classloader.
examples: LOCAL, DATABASE, azkaban.storage.... | getStorageImplementation | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/AzkabanCommonModuleConfig.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/AzkabanCommonModuleConfig.java | Apache-2.0 |
public String getLocalStorageBaseDirPath() {
return this.localStorageBaseDirPath;
} | Storage Implementation This can be any of the {@link StorageImplementationType} values in which
case {@link StorageFactory} will create the appropriate storage instance. Or one can feed in a
custom implementation class using the full qualified path required by a classloader.
examples: LOCAL, DATABASE, azkaban.storage.... | getLocalStorageBaseDirPath | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/AzkabanCommonModuleConfig.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/AzkabanCommonModuleConfig.java | Apache-2.0 |
public URI getHdfsProjectRootUri() {
return this.hdfsProjectRootUri;
} | Storage Implementation This can be any of the {@link StorageImplementationType} values in which
case {@link StorageFactory} will create the appropriate storage instance. Or one can feed in a
custom implementation class using the full qualified path required by a classloader.
examples: LOCAL, DATABASE, azkaban.storage.... | getHdfsProjectRootUri | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/AzkabanCommonModuleConfig.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/AzkabanCommonModuleConfig.java | Apache-2.0 |
public URI getCacheDependencyRootUri() {
return this.cacheDependencyRootUri;
} | Storage Implementation This can be any of the {@link StorageImplementationType} values in which
case {@link StorageFactory} will create the appropriate storage instance. Or one can feed in a
custom implementation class using the full qualified path required by a classloader.
examples: LOCAL, DATABASE, azkaban.storage.... | getCacheDependencyRootUri | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/AzkabanCommonModuleConfig.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/AzkabanCommonModuleConfig.java | Apache-2.0 |
public URI getOriginDependencyRootUri() {
return this.originDependencyRootUri;
} | Storage Implementation This can be any of the {@link StorageImplementationType} values in which
case {@link StorageFactory} will create the appropriate storage instance. Or one can feed in a
custom implementation class using the full qualified path required by a classloader.
examples: LOCAL, DATABASE, azkaban.storage.... | getOriginDependencyRootUri | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/AzkabanCommonModuleConfig.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/AzkabanCommonModuleConfig.java | Apache-2.0 |
public boolean getDependencyCachingEnabled() {
return this.dependencyCachingEnabled; } | Storage Implementation This can be any of the {@link StorageImplementationType} values in which
case {@link StorageFactory} will create the appropriate storage instance. Or one can feed in a
custom implementation class using the full qualified path required by a classloader.
examples: LOCAL, DATABASE, azkaban.storage.... | getDependencyCachingEnabled | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/AzkabanCommonModuleConfig.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/AzkabanCommonModuleConfig.java | Apache-2.0 |
public int getNumVal() {
return this.numVal;
} | This enum contains list of dispatch types implemented in Azkaban. | getNumVal | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/DispatchMethod.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/DispatchMethod.java | Apache-2.0 |
public static DispatchMethod fromNumVal(final int numVal) {
for (DispatchMethod dispatchMethod : DispatchMethod.values()) {
if (dispatchMethod.getNumVal() == numVal) {
return dispatchMethod;
}
}
throw new IllegalArgumentException("No Dispatch Method corresponding to num value " + numVal)... | This enum contains list of dispatch types implemented in Azkaban. | fromNumVal | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/DispatchMethod.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/DispatchMethod.java | Apache-2.0 |
public static DispatchMethod getDispatchMethod(String value) {
try {
logger.info("Value of dispatch method is : " + value);
return DispatchMethod.valueOf(value.toUpperCase());
} catch (IllegalArgumentException iae) {
logger.info("Incorrect value is set for dispatch method. The default dispatch... | This enum contains list of dispatch types implemented in Azkaban. | getDispatchMethod | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/DispatchMethod.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/DispatchMethod.java | Apache-2.0 |
public static boolean isPollMethodEnabled(String dispatchMethod) {
return DispatchMethod.getDispatchMethod(dispatchMethod) == DispatchMethod.POLL;
} | This enum contains list of dispatch types implemented in Azkaban. | isPollMethodEnabled | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/DispatchMethod.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/DispatchMethod.java | Apache-2.0 |
public static boolean isPushMethodEnabled(String dispatchMethod) {
return DispatchMethod.getDispatchMethod(dispatchMethod) == DispatchMethod.PUSH;
} | This enum contains list of dispatch types implemented in Azkaban. | isPushMethodEnabled | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/DispatchMethod.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/DispatchMethod.java | Apache-2.0 |
public static boolean isContainerizedMethodEnabled(String dispatchMethod) {
return DispatchMethod.getDispatchMethod(dispatchMethod) == DispatchMethod.CONTAINERIZED;
} | This enum contains list of dispatch types implemented in Azkaban. | isContainerizedMethodEnabled | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/DispatchMethod.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/DispatchMethod.java | Apache-2.0 |
@Inject
@Provides
@Singleton
@Named(HADOOP_CONF)
public Configuration createHadoopConfiguration(final AzkabanCommonModuleConfig azConfig) {
final String hadoopConfDirPath = requireNonNull(
azConfig.getProps().getString(HADOOP_CONF_DIR_PATH));
final File hadoopConfDir = new File(requireNonNull(h... | Place Hadoop dependencies in this module. Since Hadoop is not included in the Azkaban Runtime
dependency, we only install this module when Hadoop related injection (e.g., HDFS storage) is
needed. | createHadoopConfiguration | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/HadoopModule.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/HadoopModule.java | Apache-2.0 |
@Inject
@Provides
@Singleton
@Named(HADOOP_FS_AUTH)
public AbstractHdfsAuth createHdfsAuth(final AzkabanCommonModuleConfig azConfig,
@Named(HADOOP_CONF) final Configuration conf) {
final String hdfsAuthImplClass = azConfig.getProps()
.getString(AZKABAN_HDFS_AUTH_IMPL_CLASS, DEFAULT_AZKABAN_HDF... | This method is used to instantiate the class that performs authentication and authorization
with the Hadoop file system. To provide a custom class the property {@link
#AZKABAN_HDFS_AUTH_IMPL_CLASS} should be set. If this property is not configured then {@link
azkaban.storage.HdfsAuth} will be used as the default.
@par... | createHdfsAuth | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/HadoopModule.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/HadoopModule.java | Apache-2.0 |
@Inject
@Provides
@Singleton
@Named(HTTP_CONF)
public Configuration createHTTPConfiguration(final AzkabanCommonModuleConfig azConfig) {
// NOTE (for the future): If we want to permanently remove the caching layer and simply pull dependencies
// directly from the HTTP origin, swap out CachedHttpFileSyste... | This method is used to instantiate the class that performs authentication and authorization
with the Hadoop file system. To provide a custom class the property {@link
#AZKABAN_HDFS_AUTH_IMPL_CLASS} should be set. If this property is not configured then {@link
azkaban.storage.HdfsAuth} will be used as the default.
@par... | createHTTPConfiguration | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/HadoopModule.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/HadoopModule.java | Apache-2.0 |
@Inject
@Provides
@Singleton
@Named(LOCAL_CONF)
public Configuration createLocalConfiguration() {
final Configuration conf = new Configuration(false);
conf.set("fs.file.impl", org.apache.hadoop.fs.LocalFileSystem.class.getName());
return conf;
} | This method is used to instantiate the class that performs authentication and authorization
with the Hadoop file system. To provide a custom class the property {@link
#AZKABAN_HDFS_AUTH_IMPL_CLASS} should be set. If this property is not configured then {@link
azkaban.storage.HdfsAuth} will be used as the default.
@par... | createLocalConfiguration | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/HadoopModule.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/HadoopModule.java | Apache-2.0 |
@Inject
@Provides
@Singleton
@Named(HADOOP_FILE_CONTEXT)
public FileContext createHadoopFileContext(
@Named(HADOOP_CONF) final Configuration conf,
@Named(HADOOP_FS_AUTH) final AbstractHdfsAuth auth) {
try {
auth.authorize();
final FileContext fileContext = FileContext.getFileContext(... | This method is used to instantiate the class that performs authentication and authorization
with the Hadoop file system. To provide a custom class the property {@link
#AZKABAN_HDFS_AUTH_IMPL_CLASS} should be set. If this property is not configured then {@link
azkaban.storage.HdfsAuth} will be used as the default.
@par... | createHadoopFileContext | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/HadoopModule.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/HadoopModule.java | Apache-2.0 |
@Inject
@Provides
@Singleton
@Named(HDFS_CACHED_HTTP_FS)
public FileSystem createHDFSCachedHttpFileSystem(
@Named(HADOOP_CONF) final Configuration conf,
@Named(HADOOP_FS_AUTH) final AbstractHdfsAuth auth,
@Named(HADOOP_FILE_CONTEXT) final FileContext fileContext,
@Named(HTTP_CONF) @Nulla... | This method is used to instantiate the class that performs authentication and authorization
with the Hadoop file system. To provide a custom class the property {@link
#AZKABAN_HDFS_AUTH_IMPL_CLASS} should be set. If this property is not configured then {@link
azkaban.storage.HdfsAuth} will be used as the default.
@par... | createHDFSCachedHttpFileSystem | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/HadoopModule.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/HadoopModule.java | Apache-2.0 |
@Inject
@Provides
@Singleton
@Named(LOCAL_CACHED_HTTP_FS)
public FileSystem createLocalCachedHttpFileSystem(
@Named(LOCAL_CONF) final Configuration localConf,
@Named(HTTP_CONF) @Nullable final Configuration httpConf,
final AzkabanCommonModuleConfig azConfig) {
if (httpConf == null) {
... | This method is used to instantiate the class that performs authentication and authorization
with the Hadoop file system. To provide a custom class the property {@link
#AZKABAN_HDFS_AUTH_IMPL_CLASS} should be set. If this property is not configured then {@link
azkaban.storage.HdfsAuth} will be used as the default.
@par... | createLocalCachedHttpFileSystem | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/HadoopModule.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/HadoopModule.java | Apache-2.0 |
private static FileSystem getCachedHttpFileSystem(final Configuration conf,
final AzkabanCommonModuleConfig azConfig) {
// Ensure the necessary props are not specified to enable CachedHttpFileSystem
if (azConfig.getOriginDependencyRootUri() == null) {
return null;
}
// Ensure the origin URI... | This method is used to instantiate the class that performs authentication and authorization
with the Hadoop file system. To provide a custom class the property {@link
#AZKABAN_HDFS_AUTH_IMPL_CLASS} should be set. If this property is not configured then {@link
azkaban.storage.HdfsAuth} will be used as the default.
@par... | getCachedHttpFileSystem | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/HadoopModule.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/HadoopModule.java | Apache-2.0 |
private static void validateURI(final URI uri, final String scheme,
final boolean mustHaveAuthority) {
if (mustHaveAuthority) {
requireNonNull(uri.getAuthority(), "URI must have host:port mentioned.");
}
checkArgument(scheme.equals(uri.getScheme()));
} | Ensure a URI is valid for a given scheme and contains an authority (if required). | validateURI | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/HadoopModule.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/HadoopModule.java | Apache-2.0 |
@Override
protected void configure() {
} | Ensure a URI is valid for a given scheme and contains an authority (if required). | configure | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/HadoopModule.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/HadoopModule.java | Apache-2.0 |
public synchronized void setInjector(final Injector injector) {
checkState(this.injector == null, "Injector is already set");
this.injector = requireNonNull(injector, "arg injector is null");
} | Ensure that injector is set only once!
@param injector Guice injector is itself used for providing services. | setInjector | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/ServiceProvider.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/ServiceProvider.java | Apache-2.0 |
public synchronized void unsetInjector() {
this.injector = null;
} | Ensure that injector is set only once!
@param injector Guice injector is itself used for providing services. | unsetInjector | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/ServiceProvider.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/ServiceProvider.java | Apache-2.0 |
public <T> T getInstance(final Class<T> clazz) {
return requireNonNull(this.injector).getInstance(clazz);
} | Ensure that injector is set only once!
@param injector Guice injector is itself used for providing services. | getInstance | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/ServiceProvider.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/ServiceProvider.java | Apache-2.0 |
default List<HTMLFormElement> getViewParameters() {
return Collections.emptyList();
} | Parameters users should set to enable alerts on SLA misses via Web UI. Currently used to
render the SLA definition page. | getViewParameters | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/alert/Alerter.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/alert/Alerter.java | Apache-2.0 |
public String getClusterId() {
return clusterId;
} | A in-memory representation of a Hadoop cluster loaded by {@link ClusterLoader} for each directory
where there is a cluster.properties file.
The id of a cluster is determined by the name of the its corresponding directory (so we can
ensure its uniqueness) and its properties are loaded from its cluster.properties file.
... | getClusterId | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/cluster/Cluster.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/cluster/Cluster.java | Apache-2.0 |
public Props getProperties() {
return properties;
} | A in-memory representation of a Hadoop cluster loaded by {@link ClusterLoader} for each directory
where there is a cluster.properties file.
The id of a cluster is determined by the name of the its corresponding directory (so we can
ensure its uniqueness) and its properties are loaded from its cluster.properties file.
... | getProperties | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/cluster/Cluster.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/cluster/Cluster.java | Apache-2.0 |
public HadoopSecurityManagerClassLoader getSecurityManagerClassLoader() {
if (this.securityManagerClassLoader == null) {
synchronized(this) {
if (this.securityManagerClassLoader == null) {
final List<String> hadoopSecurityManagerDependencyComponents = this.properties.getStringList(
... | A in-memory representation of a Hadoop cluster loaded by {@link ClusterLoader} for each directory
where there is a cluster.properties file.
The id of a cluster is determined by the name of the its corresponding directory (so we can
ensure its uniqueness) and its properties are loaded from its cluster.properties file.
... | getSecurityManagerClassLoader | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/cluster/Cluster.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/cluster/Cluster.java | Apache-2.0 |
@Override
public String toString() {
return String.format("cluster: %s with properties %s", this.clusterId, this.properties);
} | A in-memory representation of a Hadoop cluster loaded by {@link ClusterLoader} for each directory
where there is a cluster.properties file.
The id of a cluster is determined by the name of the its corresponding directory (so we can
ensure its uniqueness) and its properties are loaded from its cluster.properties file.
... | toString | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/cluster/Cluster.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/cluster/Cluster.java | Apache-2.0 |
@Override
public boolean equals(final Object obj) {
if (obj == this) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof Cluster)) {
return false;
}
final Cluster other = (Cluster) obj;
return Objects.equals(other.clusterId, this.clusterId) &&
... | A in-memory representation of a Hadoop cluster loaded by {@link ClusterLoader} for each directory
where there is a cluster.properties file.
The id of a cluster is determined by the name of the its corresponding directory (so we can
ensure its uniqueness) and its properties are loaded from its cluster.properties file.
... | equals | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/cluster/Cluster.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/cluster/Cluster.java | Apache-2.0 |
@Override
public int hashCode() {
return Objects.hash(this.clusterId, this.properties, this.excludedLibraryPatterns);
} | A in-memory representation of a Hadoop cluster loaded by {@link ClusterLoader} for each directory
where there is a cluster.properties file.
The id of a cluster is determined by the name of the its corresponding directory (so we can
ensure its uniqueness) and its properties are loaded from its cluster.properties file.
... | hashCode | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/cluster/Cluster.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/cluster/Cluster.java | Apache-2.0 |
public List<URL> getClusterComponentURLs(final Collection<String> components)
throws IOException {
final List<URL> urls = new ArrayList<>();
final Map<String, String> componentClasspath = this.properties.getMapByPrefix(
Cluster.LIBRARY_PATH_PREFIX);
for (final String component : components) {
... | Get library URLs for a given set of components. | getClusterComponentURLs | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/cluster/Cluster.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/cluster/Cluster.java | Apache-2.0 |
private List<URL> getResourcesFromClasspath(final String clusterLibraryPath)
throws IOException {
final List<URL> resources = new ArrayList<>();
if (Strings.isNullOrEmpty(clusterLibraryPath)) {
return resources;
}
// The syntax of a library path follows the pattern allowed by java's -cp op... | Get library URLs for a given set of components. | getResourcesFromClasspath | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/cluster/Cluster.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/cluster/Cluster.java | Apache-2.0 |
public String getNativeLibraryPath(final Collection<String> components) {
return getNativeLibraryPath(this.properties, components);
} | Get the native library path as a String to be provided through -Djava.library.path to job JVM
process. | getNativeLibraryPath | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/cluster/Cluster.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/cluster/Cluster.java | Apache-2.0 |
public static String getNativeLibraryPath(final Props properties,
final Collection<String> components) {
final List<String> nativeLibraryLibPaths = new ArrayList<>();
final Map<String, String> compoNativeLibPaths = properties.getMapByPrefix(
Cluster.NATIVE_LIBRARY_PATH_PREFIX);
for (final Stri... | Get the native library path as a String to be provided through -Djava.library.path to job JVM
process. | getNativeLibraryPath | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/cluster/Cluster.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/cluster/Cluster.java | Apache-2.0 |
public String getJavaLibraryPath(final Collection<String> components) {
return getJavaLibraryPath(this.properties, components);
} | Get library paths for a given set of components as a ':' separated string. | getJavaLibraryPath | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/cluster/Cluster.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/cluster/Cluster.java | Apache-2.0 |
public static String getJavaLibraryPath(final Props properties,
final Collection<String> components) {
final List<String> classpaths = new ArrayList<>();
final Map<String, String> componentClasspaths = properties.getMapByPrefix(
Cluster.LIBRARY_PATH_PREFIX);
for (final String component : compo... | Get library paths for a given set of components as a ':' separated string. | getJavaLibraryPath | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/cluster/Cluster.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/cluster/Cluster.java | Apache-2.0 |
@Override
public URL getResource(final String name) {
URL url = findResource(name);
// borrowed from Hadoop, if the resource that starts with '/' is not found, and tries again
// with the leading '/' removed, in case the resource name was incorrectly specified
if (url == null && name.startsW... | Try to load resources from this classloader's URLs. Note that this is like the servlet spec,
not the usual Java behaviour where we ask the parent classloader to attempt to load first. | getResource | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/cluster/Cluster.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/cluster/Cluster.java | Apache-2.0 |
@Override
protected Class<?> loadClass(final String name, final boolean resolve)
throws ClassNotFoundException {
synchronized (getClassLoadingLock(name)) {
Class<?> c = findLoadedClass(name);
ClassNotFoundException ex = null;
if (c == null && !name.startsWith(LOG4J_CLASS_PREF... | Try to load class from this classloader's URLs. Note that this is like servlet, not the
standard behaviour where we ask the parent to attempt to load first. | loadClass | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/cluster/Cluster.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/cluster/Cluster.java | Apache-2.0 |
@VisibleForTesting
void addURL(Class clazz) {
super.addURL(clazz.getProtectionDomain().getCodeSource().getLocation());
} | Try to load class from this classloader's URLs. Note that this is like servlet, not the
standard behaviour where we ask the parent to attempt to load first. | addURL | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/cluster/Cluster.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/cluster/Cluster.java | Apache-2.0 |
public void loadClusters() throws IOException {
if (this.clustersDir.exists()) {
LOG.info("Loading clusters from directory " + this.clustersDir);
for (final File clusterDir : this.clustersDir.listFiles()) {
if (clusterDir.isDirectory() && clusterDir.canRead()) {
LOG.info("Loading clust... | Loads clusters and their information from a directory and adds them to {@link ClusterRegistry}. | loadClusters | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/cluster/ClusterLoader.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/cluster/ClusterLoader.java | Apache-2.0 |
public static void loadCluster(final File clusterDir, final ClusterRegistry clusterRegistry)
throws IOException {
final File clusterConfigFile = new File(clusterDir, CLUSTER_CONF_FILE);
if (!clusterConfigFile.exists()) {
throw new FileNotFoundException(CLUSTER_CONF_FILE + " is missing under " + clus... | Load a cluster from a directory into the ClusterRegistry. | loadCluster | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/cluster/ClusterLoader.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/cluster/ClusterLoader.java | Apache-2.0 |
public synchronized Cluster getCluster(final String clusterId) {
return this.clusterInfoMap.getOrDefault(clusterId, Cluster.UNKNOWN);
} | A registry of all {@link Cluster}s loaded from a local directory of cluster configurations
Each instance of {@link Cluster} is created from a directory with the directory
name being the cluster id (to ensure uniqueness) and its properties being loaded from
the cluster.properties file under that directory.
For example,... | getCluster | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/cluster/ClusterRegistry.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/cluster/ClusterRegistry.java | Apache-2.0 |
public synchronized Cluster addCluster(final String clusterId, final Cluster cluster) {
return this.clusterInfoMap.put(clusterId, cluster);
} | A registry of all {@link Cluster}s loaded from a local directory of cluster configurations
Each instance of {@link Cluster} is created from a directory with the directory
name being the cluster id (to ensure uniqueness) and its properties being loaded from
the cluster.properties file under that directory.
For example,... | addCluster | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/cluster/ClusterRegistry.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/cluster/ClusterRegistry.java | Apache-2.0 |
public synchronized boolean isEmpty() {
return this.clusterInfoMap.isEmpty();
} | A registry of all {@link Cluster}s loaded from a local directory of cluster configurations
Each instance of {@link Cluster} is created from a directory with the directory
name being the cluster id (to ensure uniqueness) and its properties being loaded from
the cluster.properties file under that directory.
For example,... | isEmpty | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/cluster/ClusterRegistry.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/cluster/ClusterRegistry.java | Apache-2.0 |
@Override
public Cluster getCluster(final String jobId, final Props jobProps,
final Logger jobLogger, final Collection<String> componentDependency) {
final Cluster cluster = this.clusterRegistry.getCluster(Cluster.DEFAULT_CLUSTER);
if (cluster == null) {
jobLogger.error(
String.format("C... | An implementation of {@link ClusterRouter} that always routes jobs to the default cluster. | getCluster | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/cluster/DefaultClusterRouter.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/cluster/DefaultClusterRouter.java | Apache-2.0 |
@Override
public Cluster getCluster(final String jobId, final Props jobProps,
final Logger jobLogger, final Collection<String> componentDependency) {
return Cluster.UNKNOWN;
} | An implementation of {@link ClusterRouter} that routes jobs to the UNKNOWN cluster
so that the cluster implicitly loaded through Azkaban JVM will be used. | getCluster | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/cluster/DisabledClusterRouter.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/cluster/DisabledClusterRouter.java | Apache-2.0 |
public static synchronized AzKubernetesV1PodTemplate getInstance(String templatePath)
throws IOException {
if (null == instance) {
instance = new AzKubernetesV1PodTemplate(templatePath);
}
return instance;
} | @param templatePath Path where the template file is located.
@return Singleton instance of this class.
@throws IOException If unable to read the template file. | getInstance | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/container/models/AzKubernetesV1PodTemplate.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/container/models/AzKubernetesV1PodTemplate.java | Apache-2.0 |
public V1PodSpec getPodSpecFromTemplate() throws IOException {
return ((V1Pod) Yaml.load(this.templatePodString)).getSpec();
} | Always returns a new instance of V1PodSpec generated from the template.
@return the {@link V1PodSpec} POD spec generated from the template.
@throws IOException If unable to read the template file. | getPodSpecFromTemplate | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/container/models/AzKubernetesV1PodTemplate.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/container/models/AzKubernetesV1PodTemplate.java | Apache-2.0 |
public V1ObjectMeta getPodMetadataFromTemplate() throws IOException {
return ((V1Pod) Yaml.load(this.templatePodString)).getMetadata();
} | Always returns a new instance of {@link V1ObjectMeta} generated from the template to prevent
data corruption through setter methods.
@return the pod metadata object.
@throws IOException If unable to read the template file. | getPodMetadataFromTemplate | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/container/models/AzKubernetesV1PodTemplate.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/container/models/AzKubernetesV1PodTemplate.java | Apache-2.0 |
public AzKubernetesV1ServiceBuilder withExecId(final String execId) {
this.templateValuesMapBuilder.put(EXEC_ID, execId);
return this;
} | Constructor for instantiation of this class
@param templateName name of the resource within the package
@throws IOException if the resource file is not readable | withExecId | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/container/models/AzKubernetesV1ServiceBuilder.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/container/models/AzKubernetesV1ServiceBuilder.java | Apache-2.0 |
public AzKubernetesV1ServiceBuilder withServiceName(final String serviceName) {
this.templateValuesMapBuilder.put(SERVICE_NAME, serviceName);
return this;
} | Constructor for instantiation of this class
@param templateName name of the resource within the package
@throws IOException if the resource file is not readable | withServiceName | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/container/models/AzKubernetesV1ServiceBuilder.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/container/models/AzKubernetesV1ServiceBuilder.java | Apache-2.0 |
public AzKubernetesV1ServiceBuilder withNamespace(final String namespace) {
this.templateValuesMapBuilder.put(NAMESPACE, namespace);
return this;
} | Constructor for instantiation of this class
@param templateName name of the resource within the package
@throws IOException if the resource file is not readable | withNamespace | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/container/models/AzKubernetesV1ServiceBuilder.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/container/models/AzKubernetesV1ServiceBuilder.java | Apache-2.0 |
public AzKubernetesV1ServiceBuilder withApiVersion(final String apiVersion) {
this.templateValuesMapBuilder.put(API_VERSION, apiVersion);
return this;
} | Constructor for instantiation of this class
@param templateName name of the resource within the package
@throws IOException if the resource file is not readable | withApiVersion | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/container/models/AzKubernetesV1ServiceBuilder.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/container/models/AzKubernetesV1ServiceBuilder.java | Apache-2.0 |
public AzKubernetesV1ServiceBuilder withKind(final String kind) {
this.templateValuesMapBuilder.put(KIND, kind);
return this;
} | Constructor for instantiation of this class
@param templateName name of the resource within the package
@throws IOException if the resource file is not readable | withKind | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/container/models/AzKubernetesV1ServiceBuilder.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/container/models/AzKubernetesV1ServiceBuilder.java | Apache-2.0 |
public AzKubernetesV1ServiceBuilder withPort(final String port) {
this.templateValuesMapBuilder.put(PORT, port);
return this;
} | Constructor for instantiation of this class
@param templateName name of the resource within the package
@throws IOException if the resource file is not readable | withPort | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/container/models/AzKubernetesV1ServiceBuilder.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/container/models/AzKubernetesV1ServiceBuilder.java | Apache-2.0 |
public AzKubernetesV1ServiceBuilder withTimeoutMs(final String timeoutMs) {
this.templateValuesMapBuilder.put(TIMEOUT_MS, timeoutMs);
return this;
} | Constructor for instantiation of this class
@param templateName name of the resource within the package
@throws IOException if the resource file is not readable | withTimeoutMs | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/container/models/AzKubernetesV1ServiceBuilder.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/container/models/AzKubernetesV1ServiceBuilder.java | Apache-2.0 |
public V1Service build() throws IOException {
final ImmutableMap<Object, Object> templateValuesMap = this.templateValuesMapBuilder.build();
final StrSubstitutor strSubstitutor = new StrSubstitutor(templateValuesMap);
final String serviceYaml = strSubstitutor.replace(this.template);
return (V1Service) Ya... | @return {@link V1Service} object by replacing the values from the templateValuesMap within the
template
@throws IOException if the object can't be constructed from the substituted YAML String | build | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/container/models/AzKubernetesV1ServiceBuilder.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/container/models/AzKubernetesV1ServiceBuilder.java | Apache-2.0 |
public AzKubernetesV1SpecBuilder addEnvVarToFlowContainer(final String envKey,
final String envVal) {
this.flowContainerBuilder.addNewEnv().withName(envKey).withValue(envVal).endEnv();
return this;
} | @param envKey Key for the environment variable to be added to the flow container.
@param envVal Value for the environment variable to be added to the flow container. | addEnvVarToFlowContainer | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/container/models/AzKubernetesV1SpecBuilder.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/container/models/AzKubernetesV1SpecBuilder.java | Apache-2.0 |
public AzKubernetesV1SpecBuilder addFlowContainer(String name, String image, ImagePullPolicy imagePullPolicy, String confVersion) {
V1EnvVar azConfVersion = new V1EnvVarBuilder()
.withName(AZ_CONF_VERSION_KEY)
.withValue(confVersion)
.build();
this.flowCon... | @param name Flow-container/ application-container name
@param image Docker image path in the image registry
@param imagePullPolicy Docker image pull policy
@param confVersion Version for the Azkaban configuration resource
This method adds the configured application-container to the Pod spec.
This application container... | addFlowContainer | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/container/models/AzKubernetesV1SpecBuilder.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/container/models/AzKubernetesV1SpecBuilder.java | Apache-2.0 |
public AzKubernetesV1SpecBuilder addInitContainerType(String name, String image,
ImagePullPolicy imagePullPolicy, String initMountPath, String appMountPath,
final InitContainerType initContainerType) {
LOGGER.info("Creating spec objects for type " + name);
String jobTypeVolumeName = init... | @param name Name to uniquely identify the init container names
@param image Docker image path in the image registry
@param imagePullPolicy Docker image pull policy
@param initMountPath Path to be utilized by the init container image
@param appMountPath Path mounted to flow-container/application-container corresponding ... | addInitContainerType | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/container/models/AzKubernetesV1SpecBuilder.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/container/models/AzKubernetesV1SpecBuilder.java | Apache-2.0 |
public AzKubernetesV1SpecBuilder addSecurityInitContainer(String image,
ImagePullPolicy imagePullPolicy,
final InitContainerType initContainerType,
Set<String> proxyUserList, String projectUploadUser, Boolean fetchAdhocCert) {
V1EnvVar proxyUserEnv = new V1EnvVarBuilder()
.wi... | @param name Name to uniquely identify the init container names
@param image Docker image path in the image registry
@param imagePullPolicy Docker image pull policy
@param initMountPath Path to be utilized by the init container image
@param appMountPath Path mounted to flow-container/application-container corresponding ... | addSecurityInitContainer | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/container/models/AzKubernetesV1SpecBuilder.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/container/models/AzKubernetesV1SpecBuilder.java | Apache-2.0 |
public AzKubernetesV1SpecBuilder addHostPathVolume(final String volName, final String hostPath,
final String hostPathType, final String volMountPath, final boolean readOnly) {
final V1Volume hostPathVolume = new V1VolumeBuilder().withName(volName).withNewHostPath()
.withPath(hostPath).withTy... | This method adds a HostPath volume to the pod-spec and also mounts the volume to the flow
container.
@param volName Name of the volume.
@param hostPath Path for the hostPath volume.
@param hostPathType Type for the hostPath volume.
@param volMountPath Path to be mounted for the flow container. | addHostPathVolume | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/container/models/AzKubernetesV1SpecBuilder.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/container/models/AzKubernetesV1SpecBuilder.java | Apache-2.0 |
public AzKubernetesV1SpecBuilder addSecretVolume(final String volName,
final String secretName, final String volMountPath) {
final V1SecretVolumeSource secretVolumeSource =
new V1SecretVolumeSourceBuilder()
.withSecretName(secretName)
.withDefaultMode(SECRET_V... | Adds a volume mount populated from a kubernetes secret.
@param volName volume name
@param secretName secret name
@param volMountPath directory where secret will be mounted | addSecretVolume | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/container/models/AzKubernetesV1SpecBuilder.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/container/models/AzKubernetesV1SpecBuilder.java | Apache-2.0 |
public static void mergePodSpec(V1PodSpec podSpec, V1PodSpec podSpecFromTemplate) {
mergeVolumes(podSpec, podSpecFromTemplate);
mergeInitContainers(podSpec, podSpecFromTemplate);
mergeFlowContainer(podSpec, podSpecFromTemplate);
} | Items extracted from the podSpecFromTemplate will be merged with the pod-spec. Merging criteria is such
that, if the item, in the already created pod-spec, has the same name as of the item extracted
from the podSpecFromTemplate, then it will retained.
@param podSpec Already created podSpec using the {@link AzKuber... | mergePodSpec | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/container/models/PodTemplateMergeUtils.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/container/models/PodTemplateMergeUtils.java | Apache-2.0 |
private static void mergeFlowContainer(V1PodSpec podSpec, V1PodSpec podSpecFromTemplate) {
V1Container podSpecFlowContainer = getFlowContainer(podSpec);
V1Container podTemplateFlowContainer = getFlowContainer(podSpecFromTemplate);
mergeTemplateAndPodSpecContainer(podTemplateFlowContainer, podSpecFlowContain... | Items extracted from the podSpecFromTemplate will be merged with the pod-spec. Merging criteria is such
that, if the item, in the already created pod-spec, has the same name as of the item extracted
from the podSpecFromTemplate, then it will retained.
@param podSpec Already created podSpec using the {@link AzKuber... | mergeFlowContainer | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/container/models/PodTemplateMergeUtils.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/container/models/PodTemplateMergeUtils.java | Apache-2.0 |
private static void mergeInitContainers(V1PodSpec podSpec,
V1PodSpec podSpecFromTemplate) {
List<V1Container> podSpecInitContainers = podSpec.getInitContainers();
if (null == podSpecInitContainers) {
return;
}
// Get init containers from podSpecFromTemplate which are not part of pod-spec ini... | Merge InitContainers from the dynamically generated pod-spec and podSpecFromTemplate, such that: 1) Add
all the init containers which are only part of podSpecFromTemplate. 2) Add all the init containers
which are only part of pod-spec. 3) Add the init containers which are part of both pod-spec and
podSpecFromTemplate b... | mergeInitContainers | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/container/models/PodTemplateMergeUtils.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/container/models/PodTemplateMergeUtils.java | Apache-2.0 |
private static List<V1Container> getMergedInitContainers(
List<V1Container> templateAlsoInitContainers,
Map<String, V1Container> podSpecAlsoInitContainers) {
final List<V1Container> mergedInitContainers = new ArrayList<>();
for (V1Container templateInitContainer : templateAlsoInitContainers) {
... | This method combines the templateAlsoInitContainers with their corresponding
podSpecAlsoInitContainers.
@param templateAlsoInitContainers List of all initContainers form the pod-spec template which
are also part of dynamically generated pod-spec.
@param podSpecAlsoInitContainers List... | getMergedInitContainers | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/container/models/PodTemplateMergeUtils.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/container/models/PodTemplateMergeUtils.java | Apache-2.0 |
private static void mergeTemplateAndPodSpecContainer(V1Container templateContainer,
V1Container podSpecContainer) {
// Add env from podSpecContainer to templateContainer.
final List<V1EnvVar> podSpecInitContainerEnv = podSpecContainer.getEnv();
if (null != podSpecInitContainerEnv && !podSpecInitContai... | This method combines the templateContainer and podSpecContainer such that: 1) Skeleton of
templateContainer is utilized. 2) Environment variables from podSpecContainer are added to
corresponding templateContainer. 3) ImagePullPolicy, Image, and VolumeMounts are overridden
from podSpecContainer to templateContainer.
@p... | mergeTemplateAndPodSpecContainer | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/container/models/PodTemplateMergeUtils.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/container/models/PodTemplateMergeUtils.java | Apache-2.0 |
private static List<V1VolumeMount> getMergedContainerVolumeMounts(
final List<V1VolumeMount> templateContainerVolumeMounts,
final List<V1VolumeMount> podSpecContainerVolumeMounts) {
final List<V1VolumeMount> allContainerVolumeMounts = new ArrayList<>();
if (null != templateContainerVolumeMounts && n... | This method merges VolumeMounts such that: 1) All VolumeMounts from the
podSpecContainerVolumeMounts are added. 2) Only those VolumeMounts of
templateContainerVolumeMounts are added which are not already part of
podSpecContainerVolumeMounts.
@param templateContainerVolumeMounts List of VolumeMounts from templateContai... | getMergedContainerVolumeMounts | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/container/models/PodTemplateMergeUtils.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/container/models/PodTemplateMergeUtils.java | Apache-2.0 |
private static void mergeVolumes(V1PodSpec podSpec, V1PodSpec podSpecFromTemplate) {
List<V1Volume> podSpecVolumes = podSpec.getVolumes();
if (null != podSpecVolumes) {
List<V1Volume> templateVolumes = getVolumes(podSpecFromTemplate,
tempVol -> podSpecVolumes.stream().map(V1Volume::getName)
... | Add those volumes which are not already available in the podSpec
@param podSpec Already created podSpec using the {@link AzKubernetesV1SpecBuilder}
@param podSpecFromTemplate PodSpec from {@link AzKubernetesV1PodTemplate} | mergeVolumes | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/container/models/PodTemplateMergeUtils.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/container/models/PodTemplateMergeUtils.java | Apache-2.0 |
private static V1Container getFlowContainer(V1PodSpec podSpec) {
final List<V1Container> containers = podSpec.getContainers();
return containers.isEmpty() ? null : containers.get(FLOW_CONTAINER_INDEX);
} | @return The Flow Container which must be the first container among all app-containers | getFlowContainer | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/container/models/PodTemplateMergeUtils.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/container/models/PodTemplateMergeUtils.java | Apache-2.0 |
private static List<V1Container> getInitContainers(V1PodSpec podSpec, Predicate<?
super V1Container> filterPredicate) {
if (null == podSpec) {
return Collections.emptyList();
}
List<V1Container> initContainers = podSpec.getInitContainers();
return initContainers == null ? Collections.emptyLi... | @param filterPredicate Predicate to filter the init containers.
@return The list of filtered init Containers derived from the pod-spec. | getInitContainers | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/container/models/PodTemplateMergeUtils.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/container/models/PodTemplateMergeUtils.java | Apache-2.0 |
private static List<V1Volume> getVolumes(V1PodSpec podSpec,
Predicate<? super V1Volume> filterPredicate) {
if (null == podSpec) {
return Collections.emptyList();
}
List<V1Volume> volumes = podSpec.getVolumes();
return volumes == null ?
Collections.emptyList() :
volumes.stream... | @param filterPredicate Predicate to filter the volumes.
@return The list of filtered Volumes derived from the pod-spec. | getVolumes | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/container/models/PodTemplateMergeUtils.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/container/models/PodTemplateMergeUtils.java | Apache-2.0 |
public static void mergePodMetadata(V1ObjectMeta podMetadata,
V1ObjectMeta podMetadataFromTemplate) {
final Map<String, String> labels = podMetadata.getLabels() != null ?
podMetadata.getLabels() : new HashMap<>();
// if the same label exists in both metadata objects the template value has preceden... | Combines pod metadata generated by the Azkaban code with the one obtained from an external pod
spec yaml file. Metadata from the external pod spec has precedence when resolving collisions.
@param podMetadata the metadata generated by the app code
@param podMetadataFromTemplate the metadata derived from external templat... | mergePodMetadata | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/container/models/PodTemplateMergeUtils.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/container/models/PodTemplateMergeUtils.java | Apache-2.0 |
public void loadTableInfo() throws IOException, SQLException {
this.tables = new HashMap<>();
this.installedVersions = new HashMap<>();
this.missingTables = new HashSet<>();
this.upgradeList = new HashMap<>();
final Props dbProps = loadDBProps();
this.version = dbProps.getString("version");
... | @deprecated in favor of {@link azkaban.db.DatabaseSetup}. | loadTableInfo | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/database/AzkabanDatabaseSetup.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/database/AzkabanDatabaseSetup.java | Apache-2.0 |
public boolean needsUpdating() {
if (this.version == null) {
throw new RuntimeException("Uninitialized. Call loadTableInfo first.");
}
return this.needsUpdating;
} | @deprecated in favor of {@link azkaban.db.DatabaseSetup}. | needsUpdating | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/database/AzkabanDatabaseSetup.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/database/AzkabanDatabaseSetup.java | Apache-2.0 |
public void printUpgradePlan() {
if (!this.tables.isEmpty()) {
logger.info("The following are installed tables");
for (final Map.Entry<String, String> installedTable : this.tables.entrySet()) {
logger.info(" " + installedTable.getKey() + " version:"
+ installedTable.getValue());
... | @deprecated in favor of {@link azkaban.db.DatabaseSetup}. | printUpgradePlan | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/database/AzkabanDatabaseSetup.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/database/AzkabanDatabaseSetup.java | Apache-2.0 |
public void updateDatabase(final boolean createTable, final boolean updateTable)
throws SQLException, IOException {
// We call this because it has an unitialize check.
if (!needsUpdating()) {
logger.info("Nothing to be done.");
return;
}
if (createTable && !this.missingTables.isEmpty(... | @deprecated in favor of {@link azkaban.db.DatabaseSetup}. | updateDatabase | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/database/AzkabanDatabaseSetup.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/database/AzkabanDatabaseSetup.java | Apache-2.0 |
private Props loadDBProps() throws IOException {
final File dbPropsFile = new File(this.scriptPath, "database.properties");
if (!dbPropsFile.exists()) {
throw new IOException(
"Cannot find 'database.properties' file in " + dbPropsFile.getAbsolutePath());
}
return new Props(null, dbProp... | @deprecated in favor of {@link azkaban.db.DatabaseSetup}. | loadDBProps | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/database/AzkabanDatabaseSetup.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/database/AzkabanDatabaseSetup.java | Apache-2.0 |
private void loadTableVersion() throws SQLException {
logger.info("Searching for table versions in the properties table");
if (this.tables.containsKey("properties")) {
// Load version from settings
final QueryRunner runner = new QueryRunner(this.dataSource);
final Map<String, String> map =
... | @deprecated in favor of {@link azkaban.db.DatabaseSetup}. | loadTableVersion | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/database/AzkabanDatabaseSetup.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/database/AzkabanDatabaseSetup.java | Apache-2.0 |
private void loadInstalledTables() throws SQLException {
logger.info("Searching for installed tables");
Connection conn = null;
try {
conn = this.dataSource.getConnection();
final ResultSet rs =
conn.getMetaData().getTables(conn.getCatalog(), null, null,
new String[]{"TAB... | @deprecated in favor of {@link azkaban.db.DatabaseSetup}. | loadInstalledTables | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/database/AzkabanDatabaseSetup.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/database/AzkabanDatabaseSetup.java | Apache-2.0 |
private void findMissingTables() {
final File directory = new File(this.scriptPath);
final File[] createScripts =
directory.listFiles(new FileIOUtils.PrefixSuffixFileFilter(
CREATE_SCRIPT_PREFIX, SQL_SCRIPT_SUFFIX));
if (createScripts != null) {
for (final File script : createScrip... | @deprecated in favor of {@link azkaban.db.DatabaseSetup}. | findMissingTables | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/database/AzkabanDatabaseSetup.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/database/AzkabanDatabaseSetup.java | Apache-2.0 |
private void findOutOfDateTables() {
for (final String key : this.tables.keySet()) {
final String version = this.tables.get(key);
final List<String> upgradeVersions = findOutOfDateTable(key, version);
if (upgradeVersions != null && !upgradeVersions.isEmpty()) {
this.upgradeList.put(key, u... | @deprecated in favor of {@link azkaban.db.DatabaseSetup}. | findOutOfDateTables | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/database/AzkabanDatabaseSetup.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/database/AzkabanDatabaseSetup.java | Apache-2.0 |
private List<String> findOutOfDateTable(final String table, final String currentVersion) {
final File directory = new File(this.scriptPath);
final ArrayList<String> versions = new ArrayList<>();
final File[] createScripts =
directory.listFiles(new FileIOUtils.PrefixSuffixFileFilter(
UPD... | @deprecated in favor of {@link azkaban.db.DatabaseSetup}. | findOutOfDateTable | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/database/AzkabanDatabaseSetup.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/database/AzkabanDatabaseSetup.java | Apache-2.0 |
private void createNewTables() throws SQLException, IOException {
final Connection conn = this.dataSource.getConnection();
conn.setAutoCommit(false);
try {
// Make sure that properties table is created first.
if (this.missingTables.contains("properties")) {
runTableScripts(conn, "propert... | @deprecated in favor of {@link azkaban.db.DatabaseSetup}. | createNewTables | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/database/AzkabanDatabaseSetup.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/database/AzkabanDatabaseSetup.java | Apache-2.0 |
private void updateTables() throws SQLException, IOException {
final Connection conn = this.dataSource.getConnection();
conn.setAutoCommit(false);
try {
// Make sure that properties table is created first.
if (this.upgradeList.containsKey("properties")) {
for (final String version : this... | @deprecated in favor of {@link azkaban.db.DatabaseSetup}. | updateTables | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/database/AzkabanDatabaseSetup.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/database/AzkabanDatabaseSetup.java | Apache-2.0 |
private void runTableScripts(final Connection conn, final String table, final String version,
final String dbType, final boolean update) throws IOException, SQLException {
String scriptName = "";
if (update) {
scriptName = "update." + table + "." + version;
logger.info("Update table " + table ... | @deprecated in favor of {@link azkaban.db.DatabaseSetup}. | runTableScripts | java | azkaban/azkaban | azkaban-common/src/main/java/azkaban/database/AzkabanDatabaseSetup.java | https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/database/AzkabanDatabaseSetup.java | Apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.