📄 libgist.java
字号:
writeAnalysis() throws LibgistException{ libWriteAnalysis();}///////////////////////////////////////////////////////////////////////////////// getAnalysisInfo - return info about progress of analysis, etc.//// Description://///////////////////////////////////////////////////////////////////////////////public static voidgetAnalysisInfo( AnalysisInfo info) throws OutOfMemoryError{ //LibgistException exc = new LibgistException(); //exc.printStackTrace(); libGetAnalysisInfo(info);}///////////////////////////////////////////////////////////////////////////////// getQueryStats - get query stats from analysis//// Description://///////////////////////////////////////////////////////////////////////////////public static voidgetQueryStats( int queryNo, // in: number of query; = 0: cumulative stats QueryStats stats) // out{ stats.reset(); libGetQueryStats(queryNo, stats);}///////////////////////////////////////////////////////////////////////////////// getSplitStats - get split stats from analysis//// Description://///////////////////////////////////////////////////////////////////////////////public static voidgetSplitStats( int leafNo, // in: page # of split leaf; = 0: cumulative stats boolean weighted, // in: if true, return weighted I/O values SplitStats stats) // out{ stats.reset(); libGetSplitStats(leafNo, weighted, stats);}///////////////////////////////////////////////////////////////////////////////// getSplitLeaves - returns page numbers of leaves whose split was analyzed//// Description://///////////////////////////////////////////////////////////////////////////////public static voidgetSplitLeaves( int[] leafNos) // out{ libGetSplitLeaves(leafNos);}///////////////////////////////////////////////////////////////////////////////// getPenaltyStats - get penalty stats from analysis//// Description://///////////////////////////////////////////////////////////////////////////////public static voidgetPenaltyStats( int keyNo, // in: # of key used for insertion boolean weighted, // in: if true, return weighted I/O values PenaltyStats stats) // out{ stats.reset(); libGetPenaltyStats(keyNo, weighted, stats);}///////////////////////////////////////////////////////////////////////////////// getNumInsertions - get # of insertions analyzed in penalty stats//// Description://///////////////////////////////////////////////////////////////////////////////public static intgetNumInsertions(){ return(libGetNumInsertions());}///////////////////////////////////////////////////////////////////////////////// getWkldNodeStats - get per-node stats from amdb_wkldprofile/-stats//// Description:// - resize displayStats and nodeStats to match the number of // pages in the tree///////////////////////////////////////////////////////////////////////////////static public final int TRAVERSALS = 0; // amdb_wkldprofile::TraversalStats.traversalCntstatic public final int RETRIEVALS = 1; // amdb_wkldprofile::TraversalStats.retrievalCntstatic public final int EMPTYSUBTREES = 2; // amdb_wkldprofile::TraversalStats.emptySubtreestatic public final int CLUSTERLOSS = 3; // amdb_wkldstats::NodeStats.[min|opt]ClusterLossstatic public final int CLUSTEROH = 4; // amdb_wkldstats::NodeStats.[min|opt]ClusterOhstatic public final int UTILLOSS = 5; // amdb_wkldstats::NodeStats.[min|opt]UtilLossstatic public final int UTILOH = 6; // amdb_wkldstats::NodeStats.[min|opt]UtilOhstatic public final int EXCCOVLOSS = 7; // amdb_wkldstats::NodeStats.[min|opt]ExcCovLossstatic public final int EXCCOVOH = 8; // amdb_wkldstats::NodeStats.[min|opt]ExcCovOhstatic public final int NODEUTIL = 9; // amdb_treemap::PageInfo.utilstatic public final int SLOTCNT = 10; // amdb_treemap::PageInfo.itemCntstatic public final int PREDSIZE = 11; // amdb_treemap::PageInfo.avgPredLenpublic static voidgetWkldNodeStats( int statType, // in: one of the above constants int queryNo, // in: number of query, = 0: cumulative stats boolean minBased) // in: if true, return min-, not opt-based statistic{ if (nodeCnt < libPageCount()) { nodeCnt = libPageCount(); displayStats = new float[nodeCnt]; //nodeStats = new NodeStats[nodeCnt]; } libGetWkldNodeStats(statType, queryNo, minBased, displayStats);}///////////////////////////////////////////////////////////////////////////////// getSplitNodeStats - get per-node stats from amdb_splitstats//// Description:// - resize displayStats and nodeStats to match the number of // pages in the tree// - split stats are always aggregates over all queries///////////////////////////////////////////////////////////////////////////////static public final int SPLITCLUSTLOSS = 0; // amdb_splitstats::FullSplitStats::clustLoss()static public final int SPLITEXCCOVLOSS = 1; // amdb_splitstats::FullSplitStats::excCovLoss()static public final int SPLITCLUSTSUCC = 2; // amdb_splitstats::FullSplitStats::clustSuccess()static public final int SPLITEXCCOVSUCC = 3; // amdb_splitstats::FullSplitStats::excCovSuccess()static public final int OPTCLUSTDELTA = 4; // amdb_splitstats::FullSplitStats::optClustDelta()static public final int ACTCLUSTDELTA = 5; // amdb_splitstats::FullSplitStats::actualClustDeltastatic public final int EXCCOVDELTA = 6; // amdb_splitstats::FullSplitStats::excCovDelta()public static voidgetSplitNodeStats( int statType, // in: one of the above constants boolean delta, // in: if true, return deltas, not abs. values boolean weighted) // in: if true, return weighted I/O numbers{ if (nodeCnt < libPageCount()) { nodeCnt = libPageCount(); displayStats = new float[nodeCnt]; //nodeStats = new NodeStats[nodeCnt]; } libGetSplitNodeStats(statType, delta, weighted, displayStats);}/* * Scripts */// returns script IDpublic static intopenScript(String filename) throws LibgistException{ return libOpenScript(filename);}///////////////////////////////////////////////////////////////////////////////// gist::insert - insert a new entry into the tree//// Description://// Exceptions://// Return Values:// < 0: error// >= 0: cmd///////////////////////////////////////////////////////////////////////////////// command constants (return values of getCommand())static final int FILEERROR = -3;static final int PARSEERROR = -2;static final int EOF = -1;public static intgetCommand(int scriptId, LibgistCommand cmd) throws LibgistException{ cmd.reset(); return libGetCommand(scriptId, cmd);}/* * Scripts */public static voidsetDbgLevel(int dbgLevel){ libSetDbgLevel(dbgLevel);}/* * JNI stuff */private static native ExtensionInfo[]libGetExtensionInfo();private static native voidlibCreate(String fileName, int extId) throws LibgistException;private static native voidlibOpen(String fileName) throws LibgistException; private static native voidlibClose() throws LibgistException;private static native voidlibFlush() throws LibgistException;private static native voidlibSave(String filename) throws LibgistException; private static native voidlibInsert(String key, String data) throws LibgistException;private static native voidlibRemove(String query) throws LibgistException;private static native voidlibFetch(String query, int limit, ResultProcessor procResult) throws LibgistException;private static native voidlibCheck() throws LibgistException;private static native intlibDump(JTextArea area, int pgNo) throws LibgistException;private static native voidlibDisplayPreds(Graphics g, int width, int height, Color[] colors) throws LibgistException;// returns root page noprivate static native intlibGetRoot();// returns root page noprivate static native intlibGetPageCount();// returns pageno of parentprivate static native intlibGetParent(int pgNo);// returns level of page (leaf level = 1)private static native intlibGetLevel(int pgNo);// returns position in parentprivate static native intlibGetParentPos(int pgNo) throws LibgistException;// returns pgnos of all childrenprivate static native intlibGetChildren(int parent, int[] children) throws LibgistException;private static native intlibMaxChildren();// returns path from root to node with pgNoprivate static native intlibGetPath(int pgNo, int[] path) throws LibgistException;// returns the nonce of the node with pgNoprivate static native intlibGetNonce(int pgNo) throws LibgistException;private static native voidlibInit();private static native voidlibSetBreakHandler(BreakHandler handler);private static native voidlibSingleStep();private static native voidlibDeleteBps();private static native voidlibCreateBp(Breakpoint bp);private static native voidlibDisableAll(boolean disable);private static native voidlibOpenAnalysis(String name);private static native voidlibCloseAnalysis();private static native voidlibWriteAnalysis() throws LibgistException;private static native voidlibGetAnalysisInfo(AnalysisInfo info);private static native voidlibGetQueryStats(int queryNo, QueryStats stats);private static native voidlibGetSplitStats(int leafNo, boolean weighted, SplitStats stats);private static native voidlibGetSplitLeaves(int[] leafNos);private static native voidlibGetPenaltyStats(int keyNo, boolean weighted, PenaltyStats stats);private static native voidlibGetWkldNodeStats(int statsType, int queryNo, boolean minBased, float[] stats);private static native voidlibGetSplitNodeStats(int statsType, boolean delta, boolean weighted, float[] stats);private static native intlibPageCount();private static native intlibPickSplit(int pgno, int splitItems[]);private static native intlibOpenScript(String filename) throws LibgistException;private static native intlibGetCommand(int scriptId, LibgistCommand cmd) throws LibgistException;// ignore LibgistException in this case, we're exitingprivate static native voidlibCleanup();private static native voidlibGetPredInfo(int root, int levels);private static native voidlibDisplay(int pgno, int highlights[], int numHighlights, Graphics g, Color normalColor, Color highlightColor, int width, int height) throws LibgistException;private static native intlibGetNumInsertions();private static native voidlibSetDbgLevel(int dbgLevel);private static native voidlibHighlightSubtree(int root, int levels, int color);private static native voidlibHighlightSplit(int[] rightEntries, int numRight, int color);private static native voidlibHighlightPath(int topNode, int bottomNode, int color);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -