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

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

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

Util.createUniqueID介绍

暂无

代码示例

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

  1. @Override
  2. public String getID()
  3. {
  4. if( id == null )
  5. id = Util.createUniqueID();
  6. return id;
  7. }

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

  1. public String getID()
  2. {
  3. if( id == null ) // make it lazy
  4. id = Util.createUniqueID();
  5. return id;
  6. }

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

  1. /**
  2. * Method getID returns the ID of this Cascade object.
  3. * <p>
  4. * The ID value is a long HEX String used to identify this instance globally. Subsequent Cascade
  5. * instances created with identical parameters will not return the same ID.
  6. *
  7. * @return the ID (type String) of this Cascade object.
  8. */
  9. @Override
  10. public String getID()
  11. {
  12. if( id == null )
  13. id = Util.createUniqueID();
  14. return id;
  15. }

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

  1. private static String getAppID()
  2. {
  3. if( appID == null )
  4. {
  5. appID = Util.createUniqueID();
  6. LOG.info( "using app.id: {}", appID );
  7. }
  8. return appID;
  9. }

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

  1. public static synchronized String createUniqueIDWhichStartsWithAChar()
  2. {
  3. String value;
  4. do
  5. {
  6. value = createUniqueID();
  7. }
  8. while( Character.isDigit( value.charAt( 0 ) ) );
  9. return value;
  10. }

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

  1. private String getSliceIDFor( TaskID taskID )
  2. {
  3. // using taskID instance as #toString is quite painful
  4. String id = sliceIDCache.get( taskID );
  5. if( id == null )
  6. {
  7. id = Util.createUniqueID();
  8. sliceIDCache.put( taskID, id );
  9. }
  10. return id;
  11. }
  12. }

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

  1. private String getSliceIDFor( TaskID taskID )
  2. {
  3. // using taskID instance as #toString is quite painful
  4. String id = sliceIDCache.get( taskID );
  5. if( id == null )
  6. {
  7. id = Util.createUniqueID();
  8. sliceIDCache.put( taskID, id );
  9. }
  10. return id;
  11. }
  12. }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

相关文章