fvwusource.ipp 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*##############################################################################
  2. HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems®.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. ############################################################################## */
  13. #ifndef FVWUSOURCE_IPP
  14. #define FVWUSOURCE_IPP
  15. #include "fvdatasource.hpp"
  16. #include "dllserver.hpp"
  17. #include "hqlexpr.hpp"
  18. #include "eclhelper.hpp"
  19. #include "fvsource.ipp"
  20. class WorkUnitDataSource : public FVDataSource
  21. {
  22. public:
  23. WorkUnitDataSource(IConstWUResult * _wuResult, const char * _wuid);
  24. //interface IFvDataSource
  25. virtual bool isIndex() { return false; }
  26. virtual __int64 numRows(bool force = false);
  27. virtual bool init();
  28. protected:
  29. unsigned __int64 totalRows;
  30. unsigned __int64 totalSize;
  31. };
  32. class FullWorkUnitDataSource : public WorkUnitDataSource
  33. {
  34. public:
  35. FullWorkUnitDataSource(IConstWUResult * _wuResult, const char * _wuid);
  36. virtual bool fetchRowData(MemoryBuffer & out, __int64 offset);
  37. virtual bool getRowData(__int64 row, size32_t & length, const void * & data, unsigned __int64 & offset);
  38. virtual bool init();
  39. protected:
  40. Owned<RowBlock> rows;
  41. };
  42. class PagedWorkUnitDataSource : public WorkUnitDataSource
  43. {
  44. public:
  45. PagedWorkUnitDataSource(IConstWUResult * _wuResult, const char * _wuid);
  46. virtual bool fetchRowData(MemoryBuffer & out, __int64 offset);
  47. virtual bool getRowData(__int64 row, size32_t & length, const void * & data, unsigned __int64 & offset);
  48. virtual bool init();
  49. bool loadBlock(__int64 startRow, offset_t startOffset);
  50. protected:
  51. RowCache cache;
  52. };
  53. #endif