Skip to content

Commit

Permalink
Added method to harvest DB design for DQL speedup
Browse files Browse the repository at this point in the history
  • Loading branch information
klehmann committed Sep 19, 2019
1 parent fb61763 commit 8f28e9d
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 0 deletions.
17 changes: 17 additions & 0 deletions domino-jna/src/main/java/com/mindoo/domino/jna/NotesDatabase.java
Original file line number Diff line number Diff line change
Expand Up @@ -5530,4 +5530,21 @@ else if (executionEx!=null) {
}
}

public enum HarvestMode { UPDATE, ADD }

/**
* Harvest view design elements for optimized DQL performance.
*
* @param mode harvest mode
*/
public void harvestDesign(HarvestMode mode) {
short result;
if (PlatformUtils.is64Bit()) {
result = NotesNativeAPI64.get().NSFDesignHarvest(m_hDB64, mode==HarvestMode.ADD ? 1 : 0);
}
else {
result = NotesNativeAPI32.get().NSFDesignHarvest(m_hDB32, mode==HarvestMode.ADD ? 1 : 0);
}
NotesErrorUtils.checkResult(result);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,8 @@ public short NSFNoteOpenWithLock(
public short NSFDbStampNotesMultiItem(int hDB, int hTable, int hInNote);
public short NSFDbOpen(Memory dbName, IntByReference dbHandle);
public short NSFDbOpenExtended (Memory PathName, short Options, int hNames, NotesTimeDateStruct ModifiedTime, IntByReference rethDB, NotesTimeDateStruct retDataModified, NotesTimeDateStruct retNonDataModified);
@UndocumentedAPI
public short NSFDesignHarvest (int hDB, int flags);
public short NSFDbGenerateOID(int hDB, NotesOriginatorIdStruct retOID);
public short NSFDbClose(int dbHandle);
public int NSFDbGetOpenDatabaseID(int hDBU);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,8 @@ public short NSFNoteOpenWithLock(
public short NSFDbOpen(Memory dbName, LongByReference dbHandle);
public short NSFDbClose(long dbHandle);
public short NSFDbOpenExtended (Memory PathName, short Options, long hNames, NotesTimeDateStruct ModifiedTime, LongByReference rethDB, NotesTimeDateStruct retDataModified, NotesTimeDateStruct retNonDataModified);
@UndocumentedAPI
public short NSFDesignHarvest (long hDB, int flags);
public short NSFDbGenerateOID(long hDB, NotesOriginatorIdStruct retOID);
public int NSFDbGetOpenDatabaseID(long hDBU);
public short NSFDbReopen(long hDB, LongByReference rethDB);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,7 @@ public native short NSFNoteOpenWithLock(int hDB, int NoteID, int LockFlags, int
public native short NSFDbStampNotesMultiItem(int hDB, int hTable, int hInNote);
public native short NSFDbOpen(Memory dbName, IntByReference dbHandle);
public native short NSFDbOpenExtended (Memory PathName, short Options, int hNames, NotesTimeDateStruct ModifiedTime, IntByReference rethDB, NotesTimeDateStruct retDataModified, NotesTimeDateStruct retNonDataModified);
public native short NSFDesignHarvest(int hDB, int flags);
public native short NSFDbGenerateOID(int hDB, NotesOriginatorIdStruct retOID);
public native short NSFDbClose(int dbHandle);
public native int NSFDbGetOpenDatabaseID(int hDBU);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,7 @@ public native short NSFNoteOpenWithLock(long hDB, int NoteID, int LockFlags, int
public native short NSFDbOpen(Memory dbName, LongByReference dbHandle);
public native short NSFDbClose(long dbHandle);
public native short NSFDbOpenExtended (Memory PathName, short Options, long hNames, NotesTimeDateStruct ModifiedTime, LongByReference rethDB, NotesTimeDateStruct retDataModified, NotesTimeDateStruct retNonDataModified);
public native short NSFDesignHarvest(long hDB, int flags);
public native short NSFDbGenerateOID(long hDB, NotesOriginatorIdStruct retOID);
public native int NSFDbGetOpenDatabaseID(long hDBU);
public native short NSFDbReopen(long hDB, LongByReference rethDB);
Expand Down

0 comments on commit 8f28e9d

Please sign in to comment.