本文整理汇总了Java中org.pentaho.di.core.variables.Variables.initializeVariablesFrom方法的典型用法代码示例。如果您正苦于以下问题:Java Variables.initializeVariablesFrom方法的具体用法?Java Variables.initializeVariablesFrom怎么用?Java Variables.initializeVariablesFrom使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.pentaho.di.core.variables.Variables
的用法示例。
在下文中一共展示了Variables.initializeVariablesFrom方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: resetKettleEnvironmentInitializationFlag
import org.pentaho.di.core.variables.Variables; //导入方法依赖的package包/类
private void resetKettleEnvironmentInitializationFlag() throws SecurityException, NoSuchFieldException,
IllegalArgumentException, IllegalAccessException, NoSuchMethodException, InvocationTargetException,
InstantiationException {
Field f = KettleEnvironment.class.getDeclaredField( "initialized" );
f.setAccessible( true );
f.set( null, new AtomicReference<SettableFuture<Boolean>>( null ) );
Constructor<KettleVFS> constructor;
constructor = KettleVFS.class.getDeclaredConstructor();
constructor.setAccessible( true );
KettleVFS KVFS = constructor.newInstance();
f = KVFS.getClass().getDeclaredField( "kettleVFS" );
f.setAccessible( true );
Field modifiersField = Field.class.getDeclaredField( "modifiers" );
modifiersField.setAccessible( true );
modifiersField.setInt( f, f.getModifiers() & ~Modifier.FINAL | Modifier.VOLATILE );
f.set( null, KVFS );
f = KVFS.getClass().getDeclaredField( "defaultVariableSpace" );
f.setAccessible( true );
modifiersField.setInt( f, f.getModifiers() & ~Modifier.FINAL );
Variables var = new Variables();
var.initializeVariablesFrom( null );
f.set( null, var );
}
示例2: get
import org.pentaho.di.core.variables.Variables; //导入方法依赖的package包/类
/**
* Creates the appropriate trans. Either
* 1) A {@link TransWebSocketEngineAdapter} wrapping an Engine
* if an alternate execution engine has been selected
* 2) A legacy {@link Trans} otherwise.
*/
public Trans get() {
if ( Utils.isEmpty( transMeta.getVariable( "engine" ) ) ) {
log.logBasic( "Using legacy execution engine" );
return fallbackSupplier.get();
}
Variables variables = new Variables();
variables.initializeVariablesFrom( null );
String protocol = transMeta.getVariable( "engine.protocol" );
String host = transMeta.getVariable( "engine.host" );
String port = transMeta.getVariable( "engine.port" );
//default value for ssl for now false
boolean ssl = "https".equalsIgnoreCase( protocol ) || "wss".equalsIgnoreCase( protocol );
return new TransWebSocketEngineAdapter( transMeta, host, port, ssl );
}
示例3: setAuthProperties
import org.pentaho.di.core.variables.Variables; //导入方法依赖的package包/类
private void setAuthProperties() {
Variables variables = new Variables();
variables.initializeVariablesFrom( null );
this.principal = variables.getVariable( KETTLE_AEL_PDI_DAEMON_PRINCIPAL, null );
this.keytab = variables.getVariable( KETTLE_AEL_PDI_DAEMON_KEYTAB, null );
String reuse = variables.getVariable( KETTLE_AEL_PDI_DAEMON_CONTEXT_REUSE, Boolean.FALSE.toString() );
this.reuseSparkContext =
Boolean.TRUE.toString().equals( reuse.toLowerCase() ) || Y_LWC.equals( reuse.toLowerCase() );
}
示例4: resolveCurrentDirectory
import org.pentaho.di.core.variables.Variables; //导入方法依赖的package包/类
public VariableSpace resolveCurrentDirectory( VariableSpace parentVariables, RepositoryDirectoryInterface directory,
String filename ) {
Variables tmpSpace = new Variables();
tmpSpace.setParentVariableSpace( parentVariables );
tmpSpace.initializeVariablesFrom( parentVariables );
if ( directory != null ) {
tmpSpace.setVariable( Const.INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY, directory.toString() );
tmpSpace.setVariable( Const.INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY, directory.toString() );
tmpSpace.setVariable( Const.INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY, directory.toString() );
} else if ( filename != null ) {
try {
FileObject fileObject = KettleVFS.getFileObject( filename, tmpSpace );
if ( !fileObject.exists() ) {
// don't set variables if the file doesn't exist
return tmpSpace;
}
FileName fileName = fileObject.getName();
// The filename of the transformation
tmpSpace.setVariable( Const.INTERNAL_VARIABLE_JOB_FILENAME_NAME, fileName.getBaseName() );
// The directory of the transformation
FileName fileDir = fileName.getParent();
tmpSpace.setVariable( Const.INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY, fileDir.getURI() );
tmpSpace.setVariable( Const.INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY, fileDir.getURI() );
tmpSpace.setVariable( Const.INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY, fileDir.getURI() );
} catch ( Exception e ) {
}
}
return tmpSpace;
}