00001 /* 00002 * SimpleQueryRecordReporter.hpp 00003 * 00004 * Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved. 00005 * 00006 * Oracle is a registered trademarks of Oracle Corporation and/or its 00007 * affiliates. 00008 * 00009 * This software is the confidential and proprietary information of Oracle 00010 * Corporation. You shall not disclose such confidential and proprietary 00011 * information and shall use it only in accordance with the terms of the 00012 * license agreement you entered into with Oracle. 00013 * 00014 * This notice may not be removed or altered. 00015 */ 00016 #ifndef COH_SIMPLE_QUERY_RECORD_REPORTER_HPP 00017 #define COH_SIMPLE_QUERY_RECORD_REPORTER_HPP 00018 00019 #include "coherence/lang.ns" 00020 00021 #include "coherence/util/QueryRecord.hpp" 00022 00023 COH_OPEN_NAMESPACE2(coherence,util) 00024 00025 00026 /** 00027 * Simple query record reporter used to obtain a string representation of 00028 * {@link QueryRecord} object. 00029 * 00030 * @since Coherence 3.7.1 00031 * 00032 * @author tb 2011.05.26 00033 */ 00034 class COH_EXPORT SimpleQueryRecordReporter 00035 : public class_spec<SimpleQueryRecordReporter, 00036 extends<Object> > 00037 { 00038 friend class factory<SimpleQueryRecordReporter>; 00039 00040 // ----- helper methods ------------------------------------------------- 00041 00042 public: 00043 /** 00044 * Return a report for the given query record. 00045 * 00046 * @param record the record 00047 * 00048 * @return a report for the given query record 00049 */ 00050 static String::View report(QueryRecord::View vRecord); 00051 00052 00053 protected: 00054 /** 00055 * Report the given result. 00056 * 00057 * @param vResult the result 00058 * @param type the record type 00059 * @param hListIndexLookups the list of lookup ids 00060 * @param fReportPartition indicates whether or not to report 00061 * partitions 00062 * 00063 * @return a report for the given result 00064 */ 00065 static String::View reportResult( 00066 QueryRecord::PartialResult::View vResult, 00067 QueryRecorder::RecordType type, 00068 List::Handle hListIndexLookups, 00069 bool fReportPartition); 00070 00071 /** 00072 * Report the index look ups. 00073 * 00074 * @param vListIndexLookups the list of lookup ids 00075 * 00076 * @return a report for the index look ups 00077 */ 00078 static String::View reportIndexLookUps(List::View vListIndexLookups); 00079 00080 /** 00081 * Report the given step. 00082 * 00083 * @param vStep the step 00084 * @param type the record type 00085 * @param hListIndexLookups the list of lookup ids 00086 * @param nLevel the indent level 00087 * 00088 * @return a report line for the given step 00089 */ 00090 static String::View reportStep( 00091 QueryRecord::PartialResult::Step::View vStep, 00092 QueryRecorder::RecordType type, 00093 List::Handle hListIndexLookups, 00094 int32_t nLevel); 00095 00096 /** 00097 * Report the given index lookup record with the given id. 00098 * 00099 * @param nIndexLookupId the index lookup id 00100 * @param vRecord the index lookup record 00101 * 00102 * @return a report line for the given index lookup 00103 */ 00104 static String::View reportIndexLookupRecord(int32_t nIndexLookupId, 00105 QueryRecord::PartialResult::IndexLookupRecord::View vRecord); 00106 }; 00107 00108 COH_CLOSE_NAMESPACE2 00109 00110 #endif // COH_SIMPLE_QUERY_RECORD_REPORTER_HPP