MCPcopy Index your code
hub / github.com/questdb/questdb / rename

Method rename

core/src/main/java/io/questdb/std/FdCache.java:225–236  ·  view source on GitHub ↗

Renames file in the filesystem and updates cache. @param oldName Old file name @param newName New file name @return 0 on success, -1 on failure

(LPSZ oldName, LPSZ newName)

Source from the content-addressed store, hash-verified

223 * @return 0 on success, -1 on failure
224 */
225 public synchronized int rename(LPSZ oldName, LPSZ newName) {
226 int keyIndex = openFdMapByPath.keyIndex(oldName);
227 int result = Files.rename(oldName.ptr(), newName.ptr());
228 if (result == 0 && keyIndex < 0) {
229 FdCacheRecord record = openFdMapByPath.valueAt(keyIndex);
230 openFdMapByPath.removeAt(keyIndex);
231 Utf8String path = Utf8String.newInstance(newName);
232 openFdMapByPath.put(path, record);
233 record.path = path;
234 }
235 return result;
236 }
237
238 /**
239 * Retrieves memory map cache key for given file descriptor.

Callers

nothing calls this directly

Calls 7

renameMethod · 0.95
newInstanceMethod · 0.95
ptrMethod · 0.65
valueAtMethod · 0.65
putMethod · 0.65
keyIndexMethod · 0.45
removeAtMethod · 0.45

Tested by

no test coverage detected