From c01cf8a3157bab462fc93237c17b077a94bc1bf2 Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Mon, 22 Jan 2024 17:02:02 -0800 Subject: [PATCH] Renamed ApplyChanges to UpdateGraph [skip ci] --- src/hnswbuild.c | 8 ++++---- src/hnswinsert.c | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/hnswbuild.c b/src/hnswbuild.c index 1541815..f55f579 100644 --- a/src/hnswbuild.c +++ b/src/hnswbuild.c @@ -415,10 +415,10 @@ HnswUpdateNeighborsInMemory(char *base, FmgrInfo *procinfo, Oid collation, HnswE } /* - * Apply changes in memory + * Update graph in memory */ static void -ApplyChangesInMemory(FmgrInfo *procinfo, Oid collation, HnswElement element, int m, int efConstruction, HnswElement entryPoint, HnswBuildState * buildstate, bool updateEntryPoint) +UpdateGraphInMemory(FmgrInfo *procinfo, Oid collation, HnswElement element, int m, int efConstruction, HnswElement entryPoint, HnswBuildState * buildstate, bool updateEntryPoint) { HnswGraph *graph = buildstate->graph; char *base = buildstate->hnswarea; @@ -475,8 +475,8 @@ InsertTupleInMemory(HnswBuildState * buildstate, HnswElement element) /* Find neighbors for element */ HnswFindElementNeighbors(base, element, entryPoint, NULL, procinfo, collation, m, efConstruction, false); - /* Apply changes in memory */ - ApplyChangesInMemory(procinfo, collation, element, m, efConstruction, entryPoint, buildstate, updateEntryPoint); + /* Update graph in memory */ + UpdateGraphInMemory(procinfo, collation, element, m, efConstruction, entryPoint, buildstate, updateEntryPoint); /* Release entry lock */ LWLockRelease(entryLock); diff --git a/src/hnswinsert.c b/src/hnswinsert.c index fad16d2..315c54f 100644 --- a/src/hnswinsert.c +++ b/src/hnswinsert.c @@ -539,10 +539,10 @@ HnswFindDuplicateOnDisk(Relation index, HnswElement element, bool building) } /* - * Apply changes on disk + * Update graph on disk */ static void -ApplyChangesOnDisk(Relation index, FmgrInfo *procinfo, Oid collation, HnswElement element, int m, int efConstruction, HnswElement entryPoint, bool building) +UpdateGraphOnDisk(Relation index, FmgrInfo *procinfo, Oid collation, HnswElement element, int m, int efConstruction, HnswElement entryPoint, bool building) { BlockNumber newInsertPage = InvalidBlockNumber; @@ -608,11 +608,11 @@ HnswInsertTupleOnDisk(Relation index, Datum value, Datum *values, bool *isnull, entryPoint = HnswGetEntryPoint(index); } - /* Find neighbors for the element */ + /* Find neighbors for element */ HnswFindElementNeighbors(base, element, entryPoint, index, procinfo, collation, m, efConstruction, false); - /* Apply changes on disk */ - ApplyChangesOnDisk(index, procinfo, collation, element, m, efConstruction, entryPoint, building); + /* Update graph on disk */ + UpdateGraphOnDisk(index, procinfo, collation, element, m, efConstruction, entryPoint, building); /* Release lock */ UnlockPage(index, HNSW_UPDATE_LOCK, lockmode);