Generate new storage ID.

@return unique storage ID
<p/>
Note: that collisions are still possible if somebody will try
to bring in a data storage from a different cluster.
556572
private String newStorageID() {
    String newID = null;
    while (newID == null) {
      newID = "DS" + Integer.toString(r.nextInt());
      if (datanodeMap.get(newID) != null) {
        newID = null;
      }
    }
    return newID;
  }
128605
@Override
    public String generateId() {
        StringBuilder sb = new StringBuilder();

        int bitsLeft = bitsPerId;
        while (bitsLeft > 0) {
            long random = ThreadLocalRandom.current().nextLong();

            if (bitsLeft < BITS_PER_LONG) {
                random >>>= (BITS_PER_LONG - bitsLeft);
            }

            encode(random, sb);

            bitsLeft -= BITS_PER_LONG;
        }

        while (sb.length() < encodedIdLength) {
            sb.append(characters[0]);
        }

        // It's possible we could generate a string larger than we expect.  Cut it down if needed.
        return sb.length() == encodedIdLength ? sb.toString() : sb.substring(0, encodedIdLength);
    }
1030510
public CmsUUID getId() {

        if (m_id != null) {
            return m_id;
        } else if (m_resource != null) {
            return m_resource.getStructureId();
        } else {
            // only in case of the default element view
            return CmsUUID.getNullUUID();
        }
    }
124163
public UUID getMessageId() {
        final ByteBuffer wrap = ByteBuffer.wrap(messageIdBytes);
        return new UUID(wrap.asLongBuffer().get(0), wrap.asLongBuffer().get(1));
    }
1300846
@Override
    public Long generate() {
        // get maximum identifier we can use (before obtaining new identifier to make sure it is in the current pool)
        long max = maximum.get();
        // generate new identifier
        long identifier = atomicLong.incrementAndGet();
        // check we need to obtain new identifier pool (identifier is out of range for current pool)
        if (identifier > max) {
            // loop until we get an identifier value
            do {
                // log information
                if (logger.isDebugEnabled())
                    logger.debug("About to request a pool of identifiers from database, maximum id: {}", max);
                // make sure only one thread gets a new range of identifiers
                synchronized (monitor) {
                    // update maximum number in pool, do not switch the next two statements (in case another thread was executing the synchronized block while the current thread was waiting)
                    max = maximum.get();
                    identifier = atomicLong.incrementAndGet();
                    // verify a new identifier is needed (compare it with current maximum)
                    if (identifier >= max) {
                        // create database session
                        try (Session session = driver.session()) {
                            // create transaction
                            try (Transaction transaction = session.beginTransaction()) {
                                // create cypher command, reserve poolSize identifiers
                                Statement statement = new Statement("MERGE (g:`" + sequenceNodeLabel + "`) ON CREATE SET g.nextId = 1 ON MATCH SET g.nextId = g.nextId + {poolSize} RETURN g.nextId", Collections.singletonMap("poolSize", poolSize));
                                // execute statement
                                StatementResult result = transaction.run(statement);
                                // process result
                                if (result.hasNext()) {
                                    // get record
                                    Record record = result.next();
                                    // get nextId value
                                    long nextId = record.get(0).asLong();
                                    // set value for next identifier (do not switch the next two statements!)
                                    atomicLong.set(nextId - poolSize);
                                    maximum.set(nextId);
                                }
                                // commit
                                transaction.success();
                            }
                        }
                        // update maximum number in pool
                        max = maximum.get();
                        // get a new identifier
                        identifier = atomicLong.incrementAndGet();
                        // log information
                        if (logger.isDebugEnabled())
                            logger.debug("Requested new pool of identifiers from database, current id: {}, maximum id: {}", identifier, max);
                    }
                    else if (logger.isDebugEnabled())
                        logger.debug("No need to request pool of identifiers, current id: {}, maximum id: {}", identifier, max);
                }
            }
            while (identifier > max);
        }
        else if (logger.isDebugEnabled())
            logger.debug("Current identifier: {}", identifier);
        // return identifier
        return identifier;
    }
1168134
public String generateId() throws IOException {
        HashCode currentHash = this.getRawComponentHash();
        currentHash = AceFunctions.generateHCId(currentHash.asBytes(), this.ic.getRawComponentHash().asBytes());
        for(AceRecord r: this.ic.getSoilLayers()) {
            currentHash = AceFunctions.generateHCId(currentHash.asBytes(), r.getRawComponentHash().asBytes());
        }
        for(AceEvent e: this.events.asList()) {
            currentHash = AceFunctions.generateHCId(currentHash.asBytes(), e.getRawComponentHash().asBytes());
        }
        currentHash = AceFunctions.generateHCId(currentHash.asBytes(), this.observed.getRawComponentHash().asBytes());
        for(AceRecord r: this.observed.getTimeseries()) {
            currentHash = AceFunctions.generateHCId(currentHash.asBytes(), r.getRawComponentHash().asBytes());
        }
        return currentHash.toString();
    }
387221
public int getStorageStrategy()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(this, tc, "getStorageStrategy");

    int storageStrategy;

    storageStrategy = STORE_ALWAYS;

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "getStorageStrategy", new Integer(storageStrategy));

    return storageStrategy;
  }
611415
public static long getNextGenerationId() {
        // ENG-14511- these calls may hit assertion failures in testing environments
        try {
            return UniqueIdGenerator.makeIdFromComponents(System.currentTimeMillis(),
                    m_generationId.incrementAndGet(),
                    MpInitiator.MP_INIT_PID);
        }
        catch (Throwable t) {
            // Try resetting the generation
            m_generationId.set(0L);
            return UniqueIdGenerator.makeIdFromComponents(System.currentTimeMillis(),
                    m_generationId.incrementAndGet(),
                    MpInitiator.MP_INIT_PID);
        }
    }
814700
Delta newDeleteStorage(Storage storage) {
        return Deltas.mapBuilder()
                .update(STORAGE.key(), Deltas.mapBuilder()
                        .remove(storage.getUuidString())
                        .deleteIfEmpty()
                        .build())
                .deleteIfEmpty()
                .build();
    }
846840
public CacheEntry getEntryDisk(Object cacheId) {
		CacheEntry cacheEntry = new CacheEntry(cacheInstance.getEntryDisk(cacheId));	 
		return cacheEntry;
	}
243764
private String getOrGenerateFailureId()
	{
		final HttpCallContext ctx = HttpCallContext.peek();

		if (ctx != null && ctx.getLogId() != null)
		{
			return ctx.getLogId();
		}
		else
		{
			// Generate a random UUID
			return UUID.randomUUID().toString();
		}
	}
526063
@Nonnull
  @Nonempty
  public static String createNewGraphObjectID ()
  {
    return s_aRWLock.readLocked ( () -> s_aIDFactory != null ? s_aIDFactory.getNewID ()
                                                             : GlobalIDFactory.getNewStringID ());
  }
277871
public java.util.List<String> getIds() {
        if (ids == null) {
            ids = new com.amazonaws.internal.SdkInternalList<String>();
        }
        return ids;
    }
1187968
public String getID() {
        byte[] genBytes = new byte[_byteArraySize];
        synchronized(_random) {
            _random.nextBytes(genBytes);
        }
        String id = convertSessionIdBytesToSessionId(genBytes, _sessionIDLength);
        if (logger.isLoggable(Level.FINE)) {
            logger.logp(Level.FINE, methodClassName, "getSessionID", "sessionID=" + id);
        }
        return id;
    }
139354
public CacheId[] getCacheIds(){
		CacheId[] cacheIds = new CacheId[configEntry.cacheIds.length];
		for ( int i=0; i<configEntry.cacheIds.length; i++ ){
			cacheIds[i] = new CacheId(configEntry.cacheIds[i]);
		}
		return cacheIds;
	}
853778
@Override
    public byte[] createUniqueId()
                    throws SIConnectionUnavailableException, SIConnectionDroppedException,
                    SIErrorException
    {
        if (TraceComponent.isAnyTracingEnabled() && CoreSPIConnection.tc.isEntryEnabled())
            SibTr.entry(CoreSPIConnection.tc, "createUniqueId", this);

        //See if this connection has been closed
        checkNotClosed();

        SIBUuid12 id = new SIBUuid12();

        if (TraceComponent.isAnyTracingEnabled() && CoreSPIConnection.tc.isEntryEnabled())
            SibTr.exit(CoreSPIConnection.tc, "createUniqueId", id);
        //SIBUuid extends UUID which is 128bit == 16bytes
        return id.toByteArray();
    }
1247054
public String getID() {
        byte[] genBytes = new byte[_byteArraySize];
        synchronized (_random) {
            _random.nextBytes(genBytes);
        }
        String id = convertSessionIdBytesToSessionId(genBytes, _sessionIDLength);
        if (tc.isDebugEnabled()) {
            Tr.debug(tc, "sessionID=" + id);
        }
        return id;
    }