00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef COH_SIMPLE_QUERY_RECORD_HPP
00017 #define COH_SIMPLE_QUERY_RECORD_HPP
00018
00019 #include "coherence/lang.ns"
00020
00021 #include "coherence/io/pof/PofReader.hpp"
00022 #include "coherence/io/pof/PofWriter.hpp"
00023 #include "coherence/io/pof/PortableObject.hpp"
00024 #include "coherence/util/Collection.hpp"
00025 #include "coherence/util/List.hpp"
00026 #include "coherence/util/Map.hpp"
00027 #include "coherence/util/QueryRecord.hpp"
00028 #include "coherence/util/Set.hpp"
00029
00030 COH_OPEN_NAMESPACE2(coherence,util)
00031
00032 using coherence::io::pof::PofReader;
00033 using coherence::io::pof::PofWriter;
00034 using coherence::io::pof::PortableObject;
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044 class COH_EXPORT SimpleQueryRecord
00045 : public class_spec<SimpleQueryRecord,
00046 extends<Object>,
00047 implements<PortableObject, QueryRecord> >
00048 {
00049 friend class factory<SimpleQueryRecord>;
00050
00051
00052
00053 public:
00054
00055
00056
00057 SimpleQueryRecord();
00058
00059
00060
00061
00062
00063
00064
00065
00066 SimpleQueryRecord(QueryRecorder::RecordType type,
00067 Collection::View vColResults);
00068
00069
00070
00071
00072 public:
00073
00074
00075
00076 virtual QueryRecorder::RecordType getType() const;
00077
00078
00079
00080
00081 virtual List::View getResults() const;
00082
00083
00084
00085
00086 public:
00087
00088
00089
00090
00091
00092
00093 virtual void mergeResults(Collection::View vColResults);
00094
00095
00096
00097
00098 public:
00099
00100
00101
00102 virtual void readExternal(PofReader::Handle hIn);
00103
00104
00105
00106
00107 virtual void writeExternal(PofWriter::Handle hOut) const;
00108
00109
00110
00111
00112 public:
00113
00114
00115
00116 virtual void toStream(std::ostream& out) const;
00117
00118
00119
00120
00121 public:
00122
00123
00124
00125 class COH_EXPORT PartialResult
00126 : public class_spec<PartialResult,
00127 extends<Object>,
00128 implements<PortableObject, QueryRecord::PartialResult> >
00129 {
00130 friend class factory<PartialResult>;
00131
00132
00133
00134 public:
00135 typedef this_spec::Handle Handle;
00136 typedef this_spec::View View;
00137 typedef this_spec::Holder Holder;
00138
00139
00140
00141 protected:
00142
00143
00144
00145 PartialResult();
00146
00147
00148
00149
00150
00151
00152 PartialResult(QueryRecord::PartialResult::View vThat);
00153
00154
00155
00156 public:
00157
00158
00159
00160
00161 virtual List::View getSteps() const;
00162
00163
00164
00165
00166 virtual PartitionSet::Handle getPartitions();
00167
00168
00169
00170
00171 virtual PartitionSet::View getPartitions() const;
00172
00173
00174
00175
00176 public:
00177
00178
00179
00180
00181
00182 virtual void merge(QueryRecord::PartialResult::View vResult);
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195 virtual bool isMatching(
00196 QueryRecord::PartialResult::View vResult) const;
00197
00198
00199
00200 public:
00201
00202
00203
00204 virtual void readExternal(PofReader::Handle hIn);
00205
00206
00207
00208
00209 virtual void writeExternal(PofWriter::Handle hOut) const;
00210
00211
00212
00213
00214
00215
00216 class COH_EXPORT Step
00217 : public class_spec<Step,
00218 extends<Object>,
00219 implements<PortableObject,
00220 QueryRecord::PartialResult::Step> >
00221 {
00222 friend class factory<Step>;
00223
00224
00225
00226 public:
00227 typedef this_spec::Handle Handle;
00228 typedef this_spec::View View;
00229 typedef this_spec::Holder Holder;
00230
00231
00232
00233 protected:
00234
00235
00236
00237 Step();
00238
00239
00240
00241
00242
00243
00244 Step(QueryRecord::PartialResult::Step::View vThat);
00245
00246
00247
00248 public:
00249
00250
00251
00252 virtual String::View getFilterDescription() const;
00253
00254
00255
00256
00257 virtual Set::View getIndexLookupRecords() const;
00258
00259
00260
00261
00262 virtual size32_t getEfficiency() const;
00263
00264
00265
00266
00267 virtual size32_t getPreFilterKeySetSize() const;
00268
00269
00270
00271
00272 virtual size32_t getPostFilterKeySetSize() const;
00273
00274
00275
00276
00277 virtual int64_t getDuration() const;
00278
00279
00280
00281
00282 virtual List::View getSteps() const;
00283
00284
00285
00286 public:
00287
00288
00289
00290
00291
00292
00293 void merge(QueryRecord::PartialResult::Step::View
00294 vStep);
00295
00296
00297
00298
00299
00300
00301
00302
00303
00304
00305
00306
00307
00308 bool isMatching(QueryRecord::PartialResult::Step::View
00309 vStep) const;
00310
00311
00312
00313 public:
00314
00315
00316
00317 virtual void readExternal(PofReader::Handle hIn);
00318
00319
00320
00321
00322 virtual void writeExternal(PofWriter::Handle hOut)
00323 const;
00324
00325
00326
00327 protected:
00328
00329
00330
00331 FinalView<String> f_vsFilter;
00332
00333
00334
00335
00336 size32_t m_nEfficiency;
00337
00338
00339
00340
00341 size32_t m_nSizeIn;
00342
00343
00344
00345
00346 size32_t m_nSizeOut;
00347
00348
00349
00350
00351 int64_t m_cMillis;
00352
00353
00354
00355
00356 FinalHandle<Set> f_hSetIndexLookupRecords;
00357
00358
00359
00360
00361 FinalHandle<List> f_hListSubSteps;
00362 };
00363
00364
00365
00366
00367
00368
00369
00370 class COH_EXPORT IndexLookupRecord
00371 : public class_spec<IndexLookupRecord,
00372 extends<Object>,
00373 implements<PortableObject,
00374 QueryRecord::PartialResult::IndexLookupRecord> >
00375 {
00376 friend class factory<IndexLookupRecord>;
00377
00378
00379
00380 public:
00381 typedef this_spec::Handle Handle;
00382 typedef this_spec::View View;
00383 typedef this_spec::Holder Holder;
00384
00385
00386
00387 protected:
00388
00389
00390
00391 IndexLookupRecord();
00392
00393
00394
00395
00396
00397
00398 IndexLookupRecord(
00399 QueryRecord::PartialResult::IndexLookupRecord::View
00400 vThat);
00401
00402
00403
00404
00405
00406
00407
00408
00409
00410 IndexLookupRecord(String::View vsExtractor,
00411 String::View vsIndex,
00412 bool fOrdered);
00413
00414
00415
00416 public:
00417
00418
00419
00420 virtual String::View getExtractorDescription() const;
00421
00422
00423
00424
00425 virtual String::View getIndexDescription() const;
00426
00427
00428
00429
00430 virtual bool isOrdered() const;
00431
00432
00433
00434 public:
00435
00436
00437
00438 virtual void readExternal(PofReader::Handle hIn);
00439
00440
00441
00442
00443 virtual void writeExternal(PofWriter::Handle hOut)
00444 const;
00445
00446
00447
00448 public:
00449
00450
00451
00452 virtual bool equals(Object::View v) const;
00453
00454
00455
00456
00457 virtual size32_t hashCode() const;
00458
00459
00460
00461 protected:
00462
00463
00464
00465 FinalView<String> f_vsExtractor;
00466
00467
00468
00469
00470 FinalView<String> f_vsIndex;
00471
00472
00473
00474
00475
00476 bool m_fOrdered;
00477 };
00478
00479
00480
00481 protected:
00482
00483
00484
00485 FinalHandle<List> f_hListSteps;
00486
00487
00488
00489
00490 FinalHandle<PartitionSet> f_hPartMask;
00491 };
00492
00493
00494
00495
00496 protected:
00497
00498
00499
00500 enum QueryRecorder::RecordType m_type;
00501
00502
00503
00504
00505 FinalHandle<List> f_hListResults;
00506 };
00507
00508 COH_CLOSE_NAMESPACE2
00509
00510 #endif // COH_SIMPLE_QUERY_RECORD_HPP