Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
252,100
VirtualFile () { if (!hasNext()) throw new NoSuchElementException(); VirtualFile next = myNext; myNext = null; return next; }
next
252,101
boolean (Collection<? extends Type> itemsToProcess, Project project) { if (DEBUG) trace("enter processAll"); try { boolean hasMoreToProcess; boolean allItemsProcessed = true; do { hasMoreToProcess = false; if (DEBUG) trace("observing " + itemsToProcess.size()); // todo we can decrease itemsToProcess for (Type item : it...
processAll
252,102
boolean (Type item, Project project) { if (myItemsBeingIndexed.add(item)) { try { doProcess(item, project); return true; } finally { myItemsBeingIndexed.remove(item); } } return false; }
process
252,103
void (String s) { System.out.println(Thread.currentThread() + " " + s); }
trace
252,104
boolean () { return !Boolean.getBoolean("idea.skip.indices.initialization"); }
hasIndices
252,105
boolean () { return Boolean.getBoolean("idea.suspend.indexes.initialization"); }
isIndexesInitializationSuspended
252,106
boolean () { return this != UP_TO_DATE; }
updateRequired
252,107
IndexableFilesIndex (@NotNull Project project) { return project.getService(IndexableFilesIndex.class); }
getInstance
252,108
boolean (VirtualFile file) { int fileId = ((VirtualFileWithId)file).getId(); if (myIndexableFilesFilter != null && !(file instanceof DeletedVirtualFileStub) && !myIndexableFilesFilter.containsFileId(fileId)) { if (myFilesFromOtherProjects >= MAX_FILES_TO_UPDATE_FROM_OTHER_PROJECT) return false; ++myFilesFromOtherProjec...
value
252,109
IndexedFile () { return myFile; }
getIndexedFile
252,110
CharSequence () { throw new UnsupportedOperationException(); }
getContentAsText
252,111
PsiFile () { throw new UnsupportedOperationException(); }
getPsiFile
252,112
FileType () { return myFile.getFileType(); }
getFileType
252,113
VirtualFile () { return myFile.getFile(); }
getFile
252,114
String () { return myFile.getFileName(); }
getFileName
252,115
Project () { return myFile.getProject(); }
getProject
252,116
void (@NotNull PluginDescriptor pluginDescriptor) { myPluginDescriptor = pluginDescriptor; }
setPluginDescriptor
252,117
void () { ProgressManager.checkCanceled(); }
checkCanceled
252,118
void (boolean enabled) { // TODO to be removed throw new UnsupportedOperationException(); }
setBufferingEnabled
252,119
void () { // TODO to be removed throw new UnsupportedOperationException(); }
cleanupMemoryStorage
252,120
void () { // TODO to be removed throw new UnsupportedOperationException(); }
cleanupForNextTest
252,121
void (int inputId) { // TODO to be removed throw new UnsupportedOperationException(); }
removeTransientDataForFile
252,122
void (int inputId, @NotNull InputDataDiffBuilder<Key, Value> diffBuilder) { // TODO to be removed throw new UnsupportedOperationException(); }
removeTransientDataForKeys
252,123
void () { myCachedBytes = ArrayUtilRt.EMPTY_BYTE_ARRAY; }
setEmptyContent
252,124
VirtualFile () { return myVirtualFile; }
getVirtualFile
252,125
long () { if (myCachedTimeStamp == -1) { myCachedTimeStamp = myVirtualFile.getTimeStamp(); } return myCachedTimeStamp; }
getTimeStamp
252,126
boolean () { if (myCachedWritable == null) { myCachedWritable = myVirtualFile.isWritable(); } return myCachedWritable == Boolean.TRUE; }
isWritable
252,127
void (@NotNull Integer key, @Nullable ByteArraySequence value) { if (value == null) { myMap.remove(key); } else { myMap.put(key, value.toBytes()); } }
put
252,128
void () { }
force
252,129
boolean () { return false; }
isDirty
252,130
int () { return myMap.size(); }
keysCountApproximately
252,131
void () { myMap.clear(); }
clear
252,132
void () { }
close
252,133
boolean (@NotNull Processor<? super K> processor, GlobalSearchScope scope, @Nullable IdFilter idFilter) { return ContainerUtil.and(myMap.keySet(), processor::process); }
processKeys
252,134
void (K k, int inputId, V v) { myMap.computeIfAbsent(k, __ -> ValueContainerImpl.createNewValueContainer()).addValue(inputId, v); }
addValue
252,135
void (@NotNull K k, int inputId) { ValueContainerImpl<V> container = myMap.get(k); if (container == null) return; container.removeAssociatedValue(inputId); if (container.size() == 0) { myMap.remove(k); } }
removeAllValues
252,136
void () { myMap.clear(); }
clear
252,137
void () { }
clearCaches
252,138
void () { }
close
252,139
void () { }
flush
252,140
boolean () { return false; }
isDirty
252,141
int () { return myMap.size(); }
keysCountApproximately
252,142
void (@NotNull VirtualFile file, @EventMask short mask) { if (file instanceof VirtualFileWithId) { updateChange(((VirtualFileWithId)file).getId(), file, mask); } }
updateChange
252,143
void (int fileId, @NotNull VirtualFile file, @EventMask short mask) { while (true) { ChangeInfo existingChangeInfo = myChangeInfos.get(fileId); ChangeInfo newChangeInfo = new ChangeInfo(file, mask, existingChangeInfo); if(myChangeInfos.put(fileId, newChangeInfo) == existingChangeInfo) { myPublishedEventIndex.incrementA...
updateChange
252,144
boolean (@NotNull VfsEventProcessor eventProcessor) { if (!myChangeInfos.isEmpty()) { int[] fileIds = myChangeInfos.keys(); // snapshot of the keys for (int fileId : fileIds) { ProgressManager.checkCanceled(); ChangeInfo info = myChangeInfos.remove(fileId); if (info == null) continue; try { if (LOG != null) { LOG.info(...
processChanges
252,145
Iterator<VirtualFile> () { return ContainerUtil.mapIterator(myChangeInfos.values().iterator(), ChangeInfo::getFile); }
getChangedFiles
252,146
short (@EventMask short existingOperation, @EventMask short newOperation) { if (newOperation == FILE_REMOVED) { return FILE_REMOVED; } return (short)(existingOperation | newOperation); }
mergeEventMask
252,147
String () { StringBuilder builder = new StringBuilder(); builder.append("file: ").append(file.getPath()).append("; ") .append("operation: "); if ((eventMask & FILE_TRANSIENT_STATE_CHANGED) != 0) builder.append("TRANSIENT_STATE_CHANGE "); if ((eventMask & FILE_CONTENT_CHANGED) != 0) builder.append("UPDATE "); if ((event...
toString
252,148
void (@NotNull String eventName, @NotNull VirtualFile file) { tryLog(eventName, file, null); }
tryLog
252,149
void (@NotNull String eventName, @NotNull VirtualFile file, @Nullable Supplier<String> additionalMessage) { tryLog(() -> { return "event=" + eventName + ",f=" + file.getPath() + (file instanceof VirtualFileWithId ? (",id=" + ((VirtualFileWithId)file).getId()) : "") + (additionalMessage == null ? "" : ("," + additionalM...
tryLog
252,150
void (Supplier<String> message) { if (LOG != null) { LOG.info(message.get()); } }
tryLog
252,151
Logger (@NotNull String category) { final java.util.logging.Logger logger = java.util.logging.Logger.getLogger(category); JulLogger.clearHandlers(logger); logger.addHandler(myAppender); logger.setUseParentHandlers(false); logger.setLevel(Level.INFO); return new JulLogger(logger); }
getLoggerInstance
252,152
boolean () { VirtualFile originalFile = getOriginalFile(); return originalFile != null && originalFile.isValid(); }
isOriginalValid
252,153
int () { return myFileId; }
getId
252,154
boolean () { return false; }
isValid
252,155
boolean (Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; DeletedVirtualFileStub stub = (DeletedVirtualFileStub)o; return myFileId == stub.myFileId; }
equals
252,156
int () { return myFileId; }
hashCode
252,157
String () { VirtualFile originalFile = getOriginalFile(); String fileText = originalFile == null ? ("deleted in previous session (file id = " + myFileId + ")") : originalFile.toString(); return "invalidated file :" + fileText; }
toString
252,158
EventLogGroup () { return INDEX_USAGE_GROUP; }
getGroup
252,159
T (final @NotNull IndexId<?, ?> indexId) { if (depth > MAX_LOOKUP_DEPTH) { logOrThrowMisuse(); //Even if !THROW_ON_INCORRECT_USAGE -> still do not allow to unwind traces deeper than MAX_LOOKUP_DEPTH, as // this is a risk of OoM. Instead, just overwrite current trace fields with new values (compromises stats // correctn...
lookupStarted
252,160
void (final @NotNull IndexId<?, ?> indexId, final @Nullable T parentTrace) { this.indexId = indexId; this.project = null; this.lookupFailed = false; this.totalKeysIndexed = -1; this.lookupResultSize = -1; this.parentTrace = parentTrace; if (this.parentTrace == null) { depth = 0; } else { depth = this.parentTrace.depth ...
setupTraceBeforeStart
252,161
void () { if (!mustBeStarted()) { //if trace wasn't started -> nothing (meaningful) to report return; } try { requireNonNull(indexId, "indexId must be set here"); final long lookupFinishedAtMs = System.currentTimeMillis(); final long lookupDurationMs = lookupFinishedAtMs - lookupStartedAtMs; if (REPORT_INDIVIDUAL_LOOKU...
lookupFinished
252,162
void () { lookupFinished(); }
close
252,163
T (final @Nullable Project project) { if (traceWasStarted()) { this.project = project; } return typeSafeThis(); }
withProject
252,164
T () { if (traceWasStarted()) { this.lookupFailed = true; } return typeSafeThis(); }
lookupFailed
252,165
T (final int totalKeysIndexed) { if (traceWasStarted()) { this.totalKeysIndexed = totalKeysIndexed; } return typeSafeThis(); }
totalKeysIndexed
252,166
T (final int size) { if (traceWasStarted()) { this.lookupResultSize = size; } return typeSafeThis(); }
lookupResultSize
252,167
String () { return getClass().getSimpleName() + "{indexId=" + indexId + ", project=" + project + ", depth=" + depth + ", is started? =" + traceWasStarted() + ", lookupStartedAtMs=" + lookupStartedAtMs + '}'; }
toString
252,168
T () { try { return (T)super.clone(); } catch (CloneNotSupportedException e) { throw new AssertionError("Code bug: Cloneable must not throw CloneNotSupportedException", e); } }
clone
252,169
T () { return (T)this; }
typeSafeThis
252,170
void () { final String errorMessage = ".lookupStarted() was called " + depth + " times (>" + MAX_LOOKUP_DEPTH + " max) without matching " + ".close()/.lookupFinished() -> probably code bug?\n" + this; if (THROW_ON_INCORRECT_USAGE) { throw new AssertionError(errorMessage); } else { THROTTLED_LOG.warn(errorMessage); } }
logOrThrowMisuse
252,171
boolean () { final boolean wasStarted = traceWasStarted(); if (!wasStarted) { final String errorMessage = "Code bug: .lookupStarted() must be called before. " + this; if (THROW_ON_INCORRECT_USAGE) { throw new AssertionError(errorMessage); } else { THROTTLED_LOG.warn(errorMessage); } } return wasStarted; }
mustBeStarted
252,172
boolean () { return depth >= 0; }
traceWasStarted
252,173
LookupAllKeysTrace () { return new LookupAllKeysTrace(this); }
initialValue
252,174
LookupAllKeysTrace (final @NotNull IndexId<?, ?> indexId) { final LookupAllKeysTrace trace = super.lookupStarted(indexId); this.indexValidationFinishedAtMs = -1; //for re-entrant calls could be != this return trace; }
lookupStarted
252,175
LookupAllKeysTrace () { if (traceWasStarted()) { indexValidationFinishedAtMs = System.currentTimeMillis(); } return this; }
indexValidationFinished
252,176
void (final long lookupFinishedAtMs) { final long lookupDurationMs = lookupFinishedAtMs - lookupStartedAtMs; EVENT_INDEX_ALL_KEYS_LOOKUP.log( project, FIELD_INDEX_ID.with(indexId.getName()), //indexValidationFinishedAtMs==lookupStartedAtMs if not set due to exception // => UP_TO_DATE_CHECK_DURATION_MS would be 0 in tha...
reportDetailedDataToFUS
252,177
void (long lookupFinishedAtMs) { Span lookupSpan = OTEL_TRACER.spanBuilder(SPAN_NAME_INDEX_LOOKUP_ALL_KEYS) .setAttribute("index_id", indexId.getName()) .setAttribute("total_keys_in_index", totalKeysIndexed) .setAttribute("lookup_result_size", lookupResultSize) .setStartTimestamp(lookupStartedAtMs, MILLISECONDS) .start...
reportDetailedDataToOTel
252,178
void (final long lookupFinishedAtMs) { final long lookupDurationMs = lookupFinishedAtMs - lookupStartedAtMs; IndexOperationAggregatesCollector.recordAllKeysLookup(indexId, lookupFailed, lookupDurationMs); }
collectAggregatedData
252,179
LookupAllKeysTrace (final IndexId<?, ?> indexId) { return TRACE_OF_ALL_KEYS_LOOKUP.get().lookupStarted(indexId); }
lookupAllKeysStarted
252,180
LookupEntriesByKeysTrace () { return new LookupEntriesByKeysTrace(this); }
initialValue
252,181
LookupEntriesByKeysTrace (final @NotNull IndexId<?, ?> indexId) { final LookupEntriesByKeysTrace trace = super.lookupStarted(indexId); this.lookupOperation = LookupOperation.UNKNOWN; this.lookupKeysCount = -1; this.indexValidationFinishedAtMs = -1; //for re-entrant calls could be != this return trace; }
lookupStarted
252,182
LookupEntriesByKeysTrace () { if (traceWasStarted()) { indexValidationFinishedAtMs = System.currentTimeMillis(); } return this; }
indexValidationFinished
252,183
void (final long lookupFinishedAtMs) { EVENT_INDEX_LOOKUP_ENTRIES_BY_KEYS.log( project, FIELD_INDEX_ID.with(indexId.getName()), FIELD_UP_TO_DATE_CHECK_DURATION_MS.with( indexValidationFinishedAtMs > 0 ? indexValidationFinishedAtMs - lookupStartedAtMs : 0), FIELD_LOOKUP_DURATION_MS.with(lookupFinishedAtMs - lookupStarte...
reportDetailedDataToFUS
252,184
void (long lookupFinishedAtMs) { Span lookupSpan = OTEL_TRACER.spanBuilder(SPAN_NAME_INDEX_LOOKUP_ENTRIES) .setAttribute("index_id", indexId.getName()) .setAttribute("total_keys_in_index", totalKeysIndexed) .setAttribute("lookup_result_size", lookupResultSize) .setAttribute("lookup_keys", lookupKeysCount) .setAttribute...
reportDetailedDataToOTel
252,185
void (final long lookupFinishedAtMs) { final long lookupDurationMs = lookupFinishedAtMs - lookupStartedAtMs; IndexOperationAggregatesCollector.recordEntriesByKeysLookup(indexId, lookupFailed, lookupDurationMs); }
collectAggregatedData
252,186
LookupEntriesByKeysTrace (final int keysCount) { this.lookupKeysCount = keysCount; this.lookupOperation = LookupOperation.AND; return this; }
keysWithAND
252,187
LookupEntriesByKeysTrace (final int keysCount) { this.lookupKeysCount = keysCount; this.lookupOperation = LookupOperation.OR; return this; }
keysWithOR
252,188
LookupEntriesByKeysTrace (final IndexId<?, ?> indexId) { return TRACE_OF_ENTRIES_LOOKUP.get().lookupStarted(indexId); }
lookupEntriesStarted
252,189
LookupStubEntriesByKeyTrace () { return new LookupStubEntriesByKeyTrace(this); }
initialValue
252,190
LookupStubEntriesByKeyTrace (final @NotNull IndexId<?, ?> indexId) { final LookupStubEntriesByKeyTrace trace = super.lookupStarted(indexId); indexValidationFinishedAtMs = -1; stubTreesDeserializingStarted = -1; //for re-entrant calls could be != this; return trace; }
lookupStarted
252,191
LookupStubEntriesByKeyTrace () { if (traceWasStarted()) { indexValidationFinishedAtMs = System.currentTimeMillis(); } return this; }
indexValidationFinished
252,192
LookupStubEntriesByKeyTrace () { if (traceWasStarted()) { stubTreesDeserializingStarted = System.currentTimeMillis(); } return this; }
stubTreesDeserializingStarted
252,193
void (long lookupFinishedAtMs) { EVENT_STUB_INDEX_LOOKUP_ENTRIES_BY_KEY.log( project, FIELD_INDEX_ID.with(indexId.getName()), FIELD_UP_TO_DATE_CHECK_DURATION_MS.with( indexValidationFinishedAtMs > 0 ? indexValidationFinishedAtMs - lookupStartedAtMs : 0), FIELD_STUB_TREE_DESERIALIZING_DURATION_MS.with( stubTreesDeserial...
reportDetailedDataToFUS
252,194
void (long lookupFinishedAtMs) { Span lookupSpan = OTEL_TRACER.spanBuilder(SPAN_NAME_INDEX_LOOKUP_STUBS) .setAttribute("index_id", indexId.getName()) .setAttribute("total_keys_in_index", totalKeysIndexed) .setAttribute("lookup_result_size", lookupResultSize) .setStartTimestamp(lookupStartedAtMs, MILLISECONDS) .startSpa...
reportDetailedDataToOTel
252,195
void (long lookupFinishedAtMs) { final long lookupDurationMs = lookupFinishedAtMs - lookupStartedAtMs; IndexOperationAggregatesCollector.recordStubEntriesByKeysLookup(indexId, lookupFailed, lookupDurationMs); }
collectAggregatedData
252,196
LookupStubEntriesByKeyTrace (final IndexId<?, ?> indexId) { return TRACE_OF_STUB_ENTRIES_LOOKUP.get().lookupStarted(indexId); }
lookupStubEntriesStarted
252,197
EventLogGroup () { return INDEX_USAGE_AGGREGATES_GROUP; }
getGroup
252,198
void (final IndexId<?, ?> indexId, final boolean failed, final long durationMs) { if (!failed) { final Recorder recorder = allKeysLookupDurationsMsByIndexId.computeIfAbsent( indexId, __ -> new Recorder( MAX_TRACKABLE_DURATION_MS, /* significant digits = */ 2 /* ~1% accuracy */ ) ); final long clampedDurationMs = MathUt...
recordAllKeysLookup
252,199
void (final IndexId<?, ?> indexId, final boolean failed, final long durationMs) { if (!failed) { final Recorder recorder = entriesLookupDurationsMsByIndexId.computeIfAbsent( indexId, __ -> new Recorder( MAX_TRACKABLE_DURATION_MS, /* significant digits = */ 2 /* ~1% accuracy */ ) ); final long clampedDurationMs = MathUt...
recordEntriesByKeysLookup