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

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

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

Variables.environmentSubstitute介绍

暂无

代码示例

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

@Override
public String[] environmentSubstitute( String[] string ) {
 String[] retval = new String[string.length];
 for ( int i = 0; i < string.length; i++ ) {
  retval[i] = environmentSubstitute( string[i] );
 }
 return retval;
}

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

private String reapplyCurrentDir( String oldCurrentDir, String newCurrentDir, String path ) {
 Variables vars = new Variables();
 vars.setVariable( Const.INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY, oldCurrentDir );
 String newPath = vars.environmentSubstitute( path );
 return getPath( newCurrentDir, newPath );
}

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

@Override
public boolean getBooleanValueOfVariable( String variableName, boolean defaultValue ) {
 if ( !Utils.isEmpty( variableName ) ) {
  String value = environmentSubstitute( variableName );
  if ( !Utils.isEmpty( value ) ) {
   return ValueMetaBase.convertStringToBoolean( value );
  }
 }
 return defaultValue;
}

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

for ( Object key : kettleProperties.keySet() ) {
 String variable = (String) key;
 String value = variables.environmentSubstitute( (String) kettleProperties.get( key ) );
 variables.setVariable( variable, value );

代码示例来源: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 );

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

  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

variables.initializeVariablesFrom( null );
String zooKeeperHost = variables.environmentSubstitute( namedCluster.getZooKeeperHost() );
String zooKeeperPort = variables.environmentSubstitute( namedCluster.getZooKeeperPort() );
if ( Const.isEmpty( zooKeeperHost ) ) {
 return new RuntimeTestResultSummaryImpl(

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

String bootstrapServers = variables.environmentSubstitute( namedCluster.getKafkaBootstrapServers() );
if ( StringUtils.isBlank( bootstrapServers ) ) {
 return new RuntimeTestResultSummaryImpl( new ClusterRuntimeTestEntry(

代码示例来源: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 ) );
  }
 }
}

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

ncFS.append( variables.environmentSubstitute( namedCluster.getHdfsHost() ) );
String port = variables.environmentSubstitute( namedCluster.getHdfsPort() );
if ( !Const.isEmpty( port ) ) {
 ncFS.append( ":" );

相关文章