cascading.util.Util.createUniqueID()方法的使用及代码示例

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

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

Util.createUniqueID介绍

暂无

代码示例

代码示例来源:origin: cwensel/cascading

@Override
public String getID()
 {
 if( id == null )
  id = Util.createUniqueID();
 return id;
 }

代码示例来源:origin: cwensel/cascading

public String getID()
 {
 if( id == null ) // make it lazy
  id = Util.createUniqueID();
 return id;
 }

代码示例来源:origin: cwensel/cascading

/**
 * Method getID returns the ID of this Cascade object.
 * <p>
 * The ID value is a long HEX String used to identify this instance globally. Subsequent Cascade
 * instances created with identical parameters will not return the same ID.
 *
 * @return the ID (type String) of this Cascade object.
 */
@Override
public String getID()
 {
 if( id == null )
  id = Util.createUniqueID();
 return id;
 }

代码示例来源:origin: cwensel/cascading

private static String getAppID()
 {
 if( appID == null )
  {
  appID = Util.createUniqueID();
  LOG.info( "using app.id: {}", appID );
  }
 return appID;
 }

代码示例来源:origin: cwensel/cascading

public static synchronized String createUniqueIDWhichStartsWithAChar()
 {
 String value;
 do
  {
  value = createUniqueID();
  }
 while( Character.isDigit( value.charAt( 0 ) ) );
 return value;
 }

代码示例来源:origin: cascading/cascading-hadoop2-mr1

private String getSliceIDFor( TaskID taskID )
 {
 // using taskID instance as #toString is quite painful
 String id = sliceIDCache.get( taskID );
 if( id == null )
  {
  id = Util.createUniqueID();
  sliceIDCache.put( taskID, id );
  }
 return id;
 }
}

代码示例来源:origin: cwensel/cascading

private String getSliceIDFor( TaskID taskID )
 {
 // using taskID instance as #toString is quite painful
 String id = sliceIDCache.get( taskID );
 if( id == null )
  {
  id = Util.createUniqueID();
  sliceIDCache.put( taskID, id );
  }
 return id;
 }
}

代码示例来源:origin: cwensel/cascading

protected String makeTemporaryPathDirString( String name )
 {
 // _ is treated as a hidden file, so wipe them out
 name = name.replaceAll( "^[_\\W\\s]+", "" );
 if( name.isEmpty() )
  name = "temp-path";
 return name.replaceAll( "[\\W\\s]+", "_" ) + Util.createUniqueID();
 }

代码示例来源:origin: cascading/lingual-core

public static String createUniqueName()
 {
 return dateFormat.format( new Date() ) + "-" + Util.createUniqueID().substring( 0, 10 );
 }

代码示例来源:origin: cascading/cascading-hadoop2-io

protected String makeTemporaryPathDirString( String name )
 {
 // _ is treated as a hidden file, so wipe them out
 name = name.replaceAll( "^[_\\W\\s]+", "" );
 if( name.isEmpty() )
  name = "temp-path";
 return name.replaceAll( "[\\W\\s]+", "_" ) + Util.createUniqueID();
 }

代码示例来源:origin: ScaleUnlimited/cascading.solr

@Override
public void sinkConfInit(FlowProcess<JobConf> flowProcess, Tap<JobConf, RecordReader<Tuple, Tuple>, OutputCollector<Tuple, Tuple>> tap, JobConf conf) {
  // Pick temp location in HDFS for conf files.
  // TODO KKr - should I get rid of this temp directory when we're done?
  String coreDirname = _solrCoreDir.getName();
  Path hdfsSolrCoreDir = new Path(Hfs.getTempPath(conf),  "solr-core-" + Util.createUniqueID() + "/" + coreDirname);
  
  // Copy Solr core directory into HDFS.
  try {
    FileSystem fs = hdfsSolrCoreDir.getFileSystem(conf);
    fs.copyFromLocalFile(new Path(_solrCoreDir.getAbsolutePath()), hdfsSolrCoreDir);
  } catch (IOException e) {
    throw new TapException("Can't copy Solr core directory into HDFS", e);
  }
  conf.setOutputKeyClass(Tuple.class);
  conf.setOutputValueClass(Tuple.class);
  conf.setOutputFormat(SolrOutputFormat.class);
  try {
    conf.set(SolrOutputFormat.SINK_FIELDS_KEY, HadoopUtil.serializeBase64(getSinkFields(), conf));
  } catch (IOException e) {
    throw new TapException("Can't serialize sink fields", e);
  }
  conf.set(SolrOutputFormat.SOLR_CORE_PATH_KEY, hdfsSolrCoreDir.toString());
  conf.setInt(SolrOutputFormat.MAX_SEGMENTS_KEY, _maxSegments);
  conf.set(SolrOutputFormat.DATA_DIR_PROPERTY_NAME_KEY, _dataDirPropertyName);
}

代码示例来源:origin: cwensel/cascading

TezSliceStats sliceStats = new TezSliceStats( Util.createUniqueID(), kind, getStatus(), vertexID, null );

代码示例来源:origin: cascading/cascading-hadoop2-tez-stats

TezSliceStats sliceStats = new TezSliceStats( Util.createUniqueID(), kind, getStatus(), vertexID, null );

代码示例来源:origin: cwensel/cascading

private final String id = Util.createUniqueID(); // 3.0 planner relies on this being consistent

代码示例来源:origin: cwensel/cascading

sliceStats = new TezSliceStats( Util.createUniqueID(), kind, getStatus(), vertexID, fromTaskId );

代码示例来源:origin: cascading/cascading-hadoop2-tez-stats

sliceStats = new TezSliceStats( Util.createUniqueID(), kind, getStatus(), vertexID, fromTaskId );

相关文章