org.pentaho.di.core.Const.getHostname()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(2.4k)|赞(0)|评价(0)|浏览(225)

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

Const.getHostname介绍

[英]Determine the hostname of the machine Kettle is running on
[中]

代码示例

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

/**
 * Gets the executing server.
 *
 * @return the executingServer
 */
public String getExecutingServer() {
 if ( executingServer == null ) {
  setExecutingServer( Const.getHostname() );
 }
 return executingServer;
}

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

break;
case TYPE_SYSTEM_INFO_HOSTNAME:
 row[index] = Const.getHostname();
 break;
case TYPE_SYSTEM_INFO_IP_ADDRESS:

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

@Test
 public void testProcessRow() throws Exception {
  SystemDataData systemDataData = new SystemDataData();
  SystemDataMeta systemDataMeta = new SystemDataMeta();
  systemDataMeta.allocate( 2 );
  String[] names = systemDataMeta.getFieldName();
  SystemDataTypes[] types = systemDataMeta.getFieldType();
  names[0] = "hostname";
  names[1] = "hostname_real";
  types[0] = SystemDataTypes.getTypeFromString( SystemDataTypes.TYPE_SYSTEM_INFO_HOSTNAME.getDescription() );
  types[1] = SystemDataTypes.getTypeFromString( SystemDataTypes.TYPE_SYSTEM_INFO_HOSTNAME_REAL.getDescription() );
  SystemDataHandler systemData =
   new SystemDataHandler( stepMockHelper.stepMeta, stepMockHelper.stepDataInterface, 0, stepMockHelper.transMeta,
    stepMockHelper.trans );
  Object[] expectedRow = new Object[] { Const.getHostname(), Const.getHostnameReal() };
  RowMetaInterface inputRowMeta = mock( RowMetaInterface.class );
  when( inputRowMeta.clone() ).thenReturn( inputRowMeta );
  when( inputRowMeta.size() ).thenReturn( 2 );
  systemDataData.outputRowMeta = inputRowMeta;
  systemData.init( systemDataMeta, systemDataData );
  assertFalse( systemData.processRow( systemDataMeta, systemDataData ) );
  Object[] out = systemData.getOutputRow();
  assertArrayEquals( expectedRow, out );
 }
}

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

/**
 * Gets the name of the executing server.
 *
 * @return the executingServer
 */
@Override
public String getExecutingServer() {
 if ( executingServer == null ) {
  setExecutingServer( Const.getHostname() );
 }
 return executingServer;
}

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

br.close();
  } catch ( IOException e ) {
   return getHostname();
  } catch ( InterruptedException e ) {
   return getHostname();
return getHostname();

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

messageString = Const.getHostname() + " " + messageString;

相关文章