org.pentaho.di.core.variables.Variables.initializeVariablesFrom()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(11.4k)|赞(0)|评价(0)|浏览(103)

本文整理了Java中org.pentaho.di.core.variables.Variables.initializeVariablesFrom()方法的一些代码示例,展示了Variables.initializeVariablesFrom()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Variables.initializeVariablesFrom()方法的具体详情如下:
包路径:org.pentaho.di.core.variables.Variables
类名称:Variables
方法名:initializeVariablesFrom

Variables.initializeVariablesFrom介绍

暂无

代码示例

代码示例来源:origin: pentaho/pentaho-kettle

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() );
}

代码示例来源:origin: pentaho/pentaho-kettle

/**
 * 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 );
}

代码示例来源:origin: pentaho/pentaho-kettle

Variables tmpSpace = new Variables();
tmpSpace.setParentVariableSpace( parentVariables );
tmpSpace.initializeVariablesFrom( parentVariables );

代码示例来源:origin: pentaho/big-data-plugin

public GatewayConnectivityTestImpl( MessageGetterFactory messageGetterFactory, URI uri, String testPath,
                  String user, String password, RuntimeTestEntrySeverity severity ) {
 super( messageGetterFactory, uri.getHost(), Integer.toString( uri.getPort() ), true,
  severity );
 // The connection information might be parameterized. Since we aren't tied to a transformation or job, in order to
 // use a parameter, the value would have to be set as a system property or in kettle.properties, etc.
 // Here we try to resolve the parameters if we can:
 variables = new Variables();
 variables.initializeVariablesFrom( null );
 this.path = variables.environmentSubstitute( testPath );
 this.password = variables.environmentSubstitute( password );
 this.user = variables.environmentSubstitute( user );
 this.uri = uri.resolve( uri.getPath() + path );
}

代码示例来源:origin: pentaho/big-data-plugin

public ConnectivityTestImpl( MessageGetterFactory messageGetterFactory, String hostname, String port,
               boolean haPossible,
               RuntimeTestEntrySeverity severityOfFailures, SocketFactory socketFactory,
               InetAddressFactory inetAddressFactory ) {
 this.messageGetter = messageGetterFactory.create( PKG );
 // The connection information might be parameterized. Since we aren't tied to a transformation or job, in order to
 // use a parameter, the value would have to be set as a system property or in kettle.properties, etc.
 // Here we try to resolve the parameters if we can:
 Variables variables = new Variables();
 variables.initializeVariablesFrom( null );
 this.hostname = variables.environmentSubstitute( hostname );
 this.port = variables.environmentSubstitute( port );
 this.haPossible = haPossible;
 this.severityOfFalures = severityOfFailures;
 this.socketFactory = socketFactory;
 this.inetAddressFactory = inetAddressFactory;
}

代码示例来源:origin: pentaho/big-data-plugin

@Override public RuntimeTestResultSummary runTest( Object objectUnderTest ) {
  // Safe to cast as our accepts method will only return true for named clusters
  NamedCluster namedCluster = (NamedCluster) objectUnderTest;

  // The connection information might be parameterized. Since we aren't tied to a transformation or job, in order to
  // use a parameter, the value would have to be set as a system property or in kettle.properties, etc.
  // Here we try to resolve the parameters if we can:
  Variables variables = new Variables();
  variables.initializeVariablesFrom( null );

  String oozieUrl = variables.environmentSubstitute( namedCluster.getOozieUrl() );
  try {
   URL url = new URL( oozieUrl );
   return new RuntimeTestResultSummaryImpl(
    new ClusterRuntimeTestEntry( messageGetterFactory, connectivityTestFactory.create(
     messageGetterFactory, url.getHost(), String.valueOf( url.getPort() ), false ).runTest(),
     ClusterRuntimeTestEntry.DocAnchor.OOZIE ) );
  } catch ( MalformedURLException e ) {
   return new RuntimeTestResultSummaryImpl(
    new ClusterRuntimeTestEntry( messageGetterFactory, RuntimeTestEntrySeverity.FATAL,
     messageGetter.getMessage( PING_OOZIE_HOST_TEST_MALFORMED_URL_DESC ),
     messageGetter.getMessage( PING_OOZIE_HOST_TEST_MALFORMED_URL_MESSAGE, oozieUrl ), e,
     ClusterRuntimeTestEntry.DocAnchor.OOZIE ) );
  }
 }
}

代码示例来源:origin: pentaho/big-data-plugin

@Override public RuntimeTestResultSummary runTest( Object objectUnderTest ) {
  // Safe to cast as our accepts method will only return true for named clusters
  NamedCluster namedCluster = (NamedCluster) objectUnderTest;

  // The connection information might be parameterized. Since we aren't tied to a transformation or job, in order to
  // use a parameter, the value would have to be set as a system property or in kettle.properties, etc.
  // Here we try to resolve the parameters if we can:
  Variables variables = new Variables();
  variables.initializeVariablesFrom( null );

  if ( !namedCluster.isUseGateway()  ) {
   return super.runTest( objectUnderTest );
  } else {
   return new RuntimeTestResultSummaryImpl(
    new ClusterRuntimeTestEntry( RuntimeTestEntrySeverity.SKIPPED,
     messageGetter.getMessage( GATEWAY_PING_ZOOKEEPER_NOT_SUPPORT_DESC ),
     messageGetter.getMessage( GATEWAY_PING_ZOOKEEPER_NOT_SUPPORT_MESSAGE ), null
    )
   );
  }
 }
}

代码示例来源:origin: pentaho/big-data-plugin

variables.initializeVariablesFrom( null );
String bootstrapServers = variables.environmentSubstitute( namedCluster.getKafkaBootstrapServers() );
if ( StringUtils.isBlank( bootstrapServers ) ) {

代码示例来源:origin: pentaho/big-data-plugin

variables.initializeVariablesFrom( null );

代码示例来源:origin: pentaho/big-data-plugin

variables.initializeVariablesFrom( null );

代码示例来源:origin: pentaho/big-data-plugin

@Override public RuntimeTestResultSummary runTest( Object objectUnderTest ) {
  // Safe to cast as our accepts method will only return true for named clusters
  NamedCluster namedCluster = (NamedCluster) objectUnderTest;

  // The connection information might be parameterized. Since we aren't tied to a transformation or job, in order to
  // use a parameter, the value would have to be set as a system property or in kettle.properties, etc.
  // Here we try to resolve the parameters if we can:
  Variables variables = new Variables();
  variables.initializeVariablesFrom( null );

  if ( !namedCluster.isUseGateway() ) {
   return super.runTest( objectUnderTest );
  } else {
   return new RuntimeTestResultSummaryImpl( new ClusterRuntimeTestEntry( messageGetterFactory,
    connectivityTestFactory.create( messageGetterFactory,
     variables.environmentSubstitute( namedCluster.getGatewayUrl() ), TEST_PATH,
     variables.environmentSubstitute( namedCluster.getGatewayUsername() ),
     variables.environmentSubstitute( namedCluster.getGatewayPassword() ) )
     .runTest(), ClusterRuntimeTestEntry.DocAnchor.OOZIE ) );
  }
 }
}

代码示例来源:origin: pentaho/big-data-plugin

@Override public RuntimeTestResultSummary runTest( Object objectUnderTest ) {
  // Safe to cast as our accepts method will only return true for named clusters
  NamedCluster namedCluster = (NamedCluster) objectUnderTest;

  // The connection information might be parameterized. Since we aren't tied to a transformation or job, in order to
  // use a parameter, the value would have to be set as a system property or in kettle.properties, etc.
  // Here we try to resolve the parameters if we can:
  Variables variables = new Variables();
  variables.initializeVariablesFrom( null );

  if ( !namedCluster.isUseGateway() ) {
   return super.runTest( objectUnderTest );
  } else {
   return new RuntimeTestResultSummaryImpl( new ClusterRuntimeTestEntry( messageGetterFactory,
    connectivityTestFactory.create( messageGetterFactory,
     variables.environmentSubstitute( namedCluster.getGatewayUrl() ), TEST_PATH,
     variables.environmentSubstitute( namedCluster.getGatewayUsername() ),
     variables.environmentSubstitute( namedCluster.getGatewayPassword() ) )
     .runTest(), ClusterRuntimeTestEntry.DocAnchor.CLUSTER_CONNECT_GATEWAY ) );
  }
 }
}

代码示例来源:origin: pentaho/big-data-plugin

@Override public RuntimeTestResultSummary runTest( Object objectUnderTest ) {
  // Safe to cast as our accepts method will only return true for named clusters
  NamedCluster namedCluster = (NamedCluster) objectUnderTest;

  // The connection information might be parameterized. Since we aren't tied to a transformation or job, in order to
  // use a parameter, the value would have to be set as a system property or in kettle.properties, etc.
  // Here we try to resolve the parameters if we can:
  Variables variables = new Variables();
  variables.initializeVariablesFrom( null );

  if ( !namedCluster.isUseGateway() ) {
   return super.runTest( objectUnderTest );
  } else {
   return new RuntimeTestResultSummaryImpl( new ClusterRuntimeTestEntry( messageGetterFactory,
    connectivityTestFactory.create( messageGetterFactory,
     variables.environmentSubstitute( namedCluster.getGatewayUrl() ), TEST_PATH,
     variables.environmentSubstitute( namedCluster.getGatewayUsername() ),
     variables.environmentSubstitute( namedCluster.getGatewayPassword() ) )
     .runTest(), ClusterRuntimeTestEntry.DocAnchor.CLUSTER_CONNECT_GATEWAY ) );
  }
 }
}

代码示例来源:origin: pentaho/big-data-plugin

@Override public RuntimeTestResultSummary runTest( Object objectUnderTest ) {
  // Safe to cast as our accepts method will only return true for named clusters
  NamedCluster namedCluster = (NamedCluster) objectUnderTest;

  // The connection information might be parameterized. Since we aren't tied to a transformation or job, in order to
  // use a parameter, the value would have to be set as a system property or in kettle.properties, etc.
  // Here we try to resolve the parameters if we can:
  Variables variables = new Variables();
  variables.initializeVariablesFrom( null );

  // The connectivity test (ping the name node) is not applicable for MapR clusters due to their native client, so
  // just pass this test and move on
  if ( namedCluster.isMapr() ) {
   return new RuntimeTestResultSummaryImpl(
    new ClusterRuntimeTestEntry( RuntimeTestEntrySeverity.INFO,
     messageGetter.getMessage( "PingJobTrackerTest.isMapr.Desc" ),
     messageGetter.getMessage( "PingJobTrackerTest.isMapr.Message" ), null
    )
   );
  } else {
   return new RuntimeTestResultSummaryImpl( new ClusterRuntimeTestEntry( messageGetterFactory, connectivityTestFactory
    .create( messageGetterFactory,
     variables.environmentSubstitute( namedCluster.getJobTrackerHost() ),
     variables.environmentSubstitute( namedCluster.getJobTrackerPort() ), true )
    .runTest(), ClusterRuntimeTestEntry.DocAnchor.CLUSTER_CONNECT ) );
  }
 }
}

代码示例来源:origin: pentaho/big-data-plugin

@Override
 public RuntimeTestResultSummary runTest( Object objectUnderTest ) {
  // Safe to cast as our accepts method will only return true for named clusters
  NamedCluster namedCluster = (NamedCluster) objectUnderTest;
  // The connection information might be parameterized. Since we aren't tied to a transformation or job, in order to
  // use a parameter, the value would have to be set as a system property or in kettle.properties, etc.
  // Here we try to resolve the parameters if we can:
  Variables variables = new Variables();
  variables.initializeVariablesFrom( null );

  // The connectivity test (ping the name node) is not applicable for MapR clusters due to their native client, so
  // just pass this test and move on
  if ( namedCluster.isMapr() ) {
   return new RuntimeTestResultSummaryImpl(
    new ClusterRuntimeTestEntry( RuntimeTestEntrySeverity.INFO,
     messageGetter.getMessage( PING_FILE_SYSTEM_ENTRY_POINT_TEST_IS_MAPR_DESC ),
     messageGetter.getMessage( PING_FILE_SYSTEM_ENTRY_POINT_TEST_IS_MAPR_MESSAGE ), null
    )
   );
  } else {

   return new RuntimeTestResultSummaryImpl( new ClusterRuntimeTestEntry( messageGetterFactory,
    connectivityTestFactory.create( messageGetterFactory,
     variables.environmentSubstitute( namedCluster.getHdfsHost() ),
     variables.environmentSubstitute( namedCluster.getHdfsPort() ),
     true ).runTest(), ClusterRuntimeTestEntry.DocAnchor.CLUSTER_CONNECT ) );
  }
 }
}

相关文章