String newId() { return new UID().toString(); }
protected void setId(Object o) { if (OwsUtils.get(o, "id") == null) { String uid = new UID().toString(); OwsUtils.set(o, "id", o.getClass().getSimpleName() + "-" + uid); } } }
protected void setId(Object o) { if (OwsUtils.get(o, "id") == null) { String uid = new UID().toString(); OwsUtils.set(o, "id", o.getClass().getSimpleName() + "-" + uid); } } }
new UID().write(oos);
public AvroGenericRecordReader(JobConf job, FileSplit split, Reporter reporter) throws IOException { this.jobConf = job; Schema latest; try { latest = getSchema(job, split); } catch (AvroSerdeException e) { throw new IOException(e); } GenericDatumReader<GenericRecord> gdr = new GenericDatumReader<GenericRecord>(); if(latest != null) { gdr.setExpected(latest); } if (split.getLength() == 0) { this.isEmptyInput = true; this.start = 0; this.reader = null; } else { this.isEmptyInput = false; this.reader = new DataFileReader<GenericRecord>(new FsInput(split.getPath(), job), gdr); this.reader.sync(split.getStart()); this.start = reader.tell(); } this.stop = split.getStart() + split.getLength(); this.recordReaderID = new UID(); }
public AvroGenericRecordReader(JobConf job, FileSplit split, Reporter reporter) throws IOException { this.jobConf = job; Schema latest; try { latest = getSchema(job, split); } catch (AvroSerdeException e) { throw new IOException(e); } GenericDatumReader<GenericRecord> gdr = new GenericDatumReader<GenericRecord>(); if(latest != null) { gdr.setExpected(latest); } if (split.getLength() == 0) { this.isEmptyInput = true; this.start = 0; this.reader = null; } else { this.isEmptyInput = false; this.reader = new DataFileReader<GenericRecord>(new FsInput(split.getPath(), job), gdr); this.reader.sync(split.getStart()); this.start = reader.tell(); } this.stop = split.getStart() + split.getLength(); this.recordReaderID = new UID(); }
/** Internal method for creating feature id's when none is specified. */ public static String createDefaultFeatureId() { // According to GML and XML schema standards, FID is a XML ID // (http://www.w3.org/TR/xmlschema-2/#ID), whose acceptable values are those that match an // NCNAME production (http://www.w3.org/TR/1999/REC-xml-names-19990114/#NT-NCName): // NCName ::= (Letter | '_') (NCNameChar)* /* An XML Name, minus the ":" */ // NCNameChar ::= Letter | Digit | '.' | '-' | '_' | CombiningChar | Extender // We have to fix the generated UID replacing all non word chars with an _ (it seems // they area all ":") // return "fid-" + NON_WORD_PATTERN.matcher(new UID().toString()).replaceAll("_"); // optimization, since the UID toString uses only ":" and converts long and integers // to strings for the rest, so the only non word character is really ":" return "fid-" + new UID().toString().replace(':', '_'); } /**
public VMID() { addr = localAddr; uid = new UID(); }
public Set newReferringCompSet() { Set refs = new CacheableSet(TransactionManagerImpl.DEPLOYMENT_CACHE + ":" + COMPONENT_ID_TO_DEPLOYABLE_UNIT_ID_MAP + ":" + "newReferringCompSet" + new java.rmi.server.UID()); return refs; }
public Set newReferringDuSet() { Set refs = new CacheableSet(TransactionManagerImpl.DEPLOYMENT_CACHE + ":" + COMPONENT_ID_TO_DEPLOYABLE_UNIT_ID_MAP + ":" + "newReferringDuSet" + new java.rmi.server.UID()); return refs; }
/** * @param uriPrefix - must include schema information * @return a new, random unique URI starting with uriPrefix */ public static URI createNewRandomUniqueURI(String uriPrefix) { return new URIImpl(uriPrefix + new UID().toString()); } }
public static String getGUID() { String localhost = "unknown_local_host"; try { localhost = InetAddress.getLocalHost().getHostAddress(); } catch (UnknownHostException e) { } return localhost + new UID().toString(); }
/** * @see org.geotools.data.jdbc.fidmapper.FIDMapper#getID(java.lang.Object[]) */ public String getID(Object[] attributes) { // optimization, since the UID toString uses only ":" and converts long and integers // to strings for the rest, so the only non word character is really ":" return "nfm-" + new UID().toString().replace(':', '_'); }
protected String generateTokenValue() { StringBuilder sb = new StringBuilder(); sb.append(new UID().toString()); sb.append(":"); sb.append(random.nextLong()); return sb.toString(); }
/** Create a unique id for the download session. */ private String createUID() { String uid; uid = new UID().toString(); if (uid.startsWith("-")) { uid = uid.substring(1); } return uid; } }
public void init(String endpointId){ this.endpointId = endpointId; this.fakeId = new UID().toString(); this.executor = this.stack.getNextExecutor(); }
protected String autoGenerateID(PortletDefinition pd) { String appName = pd.getApplication().getName(); String portletName = pd.getPortletName(); return appName+"::"+portletName+"::"+new UID().toString(); }
private void addAncientJavaApiClasses() { addLazyFactory("java.awt.Color", AWT_FACTORY); addLazyFactory("java.awt.color.ColorSpace", AWT_FACTORY); addLazyFactory("java.awt.color.ICC_ColorSpace", AWT_FACTORY); addLazyFactory("java.awt.color.ICC_Profile", AWT_FACTORY); VMID redVmid = new VMID(); addValues(VMID.class, redVmid, new VMID(), redVmid); UID redUid = new UID(); addValues(UID.class, redUid, new UID(), redUid); }
private void addAncientJavaApiClasses() { addLazyFactory("java.awt.Color", AWT_FACTORY); addLazyFactory("java.awt.color.ColorSpace", AWT_FACTORY); addLazyFactory("java.awt.color.ICC_ColorSpace", AWT_FACTORY); addLazyFactory("java.awt.color.ICC_Profile", AWT_FACTORY); VMID redVmid = new VMID(); addValues(VMID.class, redVmid, new VMID(), redVmid); UID redUid = new UID(); addValues(UID.class, redUid, new UID(), redUid); }
private String createBridgeRequestScope(PortletRequest request) { // Generate an RMI UID, which is a unique identifier WITHIN the local // host. This will be used as the new lifecyleID UID uid = new UID(); return qualifyScopeId(mPortletConfig.getPortletName(), request.getPortletSession(true).getId(), request.getPortletMode().toString(), uid.toString()); }