code: @Override
      public long getStreamSegmentId(String streamSegmentName, boolean updateLastUsed) {
          synchronized (this.lock) {
              StreamSegmentMetadata metadata = this.metadataByName.getOrDefault(streamSegmentName, null);
              if (updateLastUsed && metadata != null) {
                  metadata.setLastUsed(getOperationSequenceNumber());
              }
  
              return metadata != null ? metadata.getId() : NO_STREAM_SEGMENT_ID;
          }
      }
docs: region SegmentMetadataCollection Implementation