@Override public String getID() { if( id == null ) id = Util.createUniqueID(); return id; }
public String getID() { if( id == null ) // make it lazy id = Util.createUniqueID(); return id; }
/** * 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; }
private static String getAppID() { if( appID == null ) { appID = Util.createUniqueID(); LOG.info( "using app.id: {}", appID ); } return appID; }
public static synchronized String createUniqueIDWhichStartsWithAChar() { String value; do { value = createUniqueID(); } while( Character.isDigit( value.charAt( 0 ) ) ); return value; }
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; } }
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; } }
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(); }
public static String createUniqueName() { return dateFormat.format( new Date() ) + "-" + Util.createUniqueID().substring( 0, 10 ); }
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(); }
@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); }
TezSliceStats sliceStats = new TezSliceStats( Util.createUniqueID(), kind, getStatus(), vertexID, null );
TezSliceStats sliceStats = new TezSliceStats( Util.createUniqueID(), kind, getStatus(), vertexID, null );
private final String id = Util.createUniqueID(); // 3.0 planner relies on this being consistent
sliceStats = new TezSliceStats( Util.createUniqueID(), kind, getStatus(), vertexID, fromTaskId );
sliceStats = new TezSliceStats( Util.createUniqueID(), kind, getStatus(), vertexID, fromTaskId );