@itwin/core-orbitgt 4.0.0-dev.44 → 4.0.0-dev.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/core-orbitgt.d.ts +26 -26
- package/lib/cjs/core-orbitgt.js +58 -58
- package/lib/cjs/core-orbitgt.js.map +1 -1
- package/lib/cjs/pointcloud/format/opc/AttributeMask.d.ts +30 -30
- package/lib/cjs/pointcloud/format/opc/AttributeMask.js +47 -47
- package/lib/cjs/pointcloud/format/opc/AttributeMask.js.map +1 -1
- package/lib/cjs/pointcloud/format/opc/AttributeReader.d.ts +63 -63
- package/lib/cjs/pointcloud/format/opc/AttributeReader.js +24 -24
- package/lib/cjs/pointcloud/format/opc/AttributeReader.js.map +1 -1
- package/lib/cjs/pointcloud/format/opc/BlockRecord.d.ts +54 -54
- package/lib/cjs/pointcloud/format/opc/BlockRecord.js +84 -84
- package/lib/cjs/pointcloud/format/opc/BlockRecord.js.map +1 -1
- package/lib/cjs/pointcloud/format/opc/ContainerFile.d.ts +85 -85
- package/lib/cjs/pointcloud/format/opc/ContainerFile.js +199 -199
- package/lib/cjs/pointcloud/format/opc/ContainerFile.js.map +1 -1
- package/lib/cjs/pointcloud/format/opc/ContainerFilePart.d.ts +55 -55
- package/lib/cjs/pointcloud/format/opc/ContainerFilePart.js +75 -75
- package/lib/cjs/pointcloud/format/opc/ContainerFilePart.js.map +1 -1
- package/lib/cjs/pointcloud/format/opc/DirectoryReader.d.ts +75 -75
- package/lib/cjs/pointcloud/format/opc/DirectoryReader.js +169 -169
- package/lib/cjs/pointcloud/format/opc/DirectoryReader.js.map +1 -1
- package/lib/cjs/pointcloud/format/opc/DirectoryRecord.d.ts +59 -59
- package/lib/cjs/pointcloud/format/opc/DirectoryRecord.js +89 -89
- package/lib/cjs/pointcloud/format/opc/DirectoryRecord.js.map +1 -1
- package/lib/cjs/pointcloud/format/opc/EmbeddedAttributeReader.d.ts +106 -106
- package/lib/cjs/pointcloud/format/opc/EmbeddedAttributeReader.js +197 -197
- package/lib/cjs/pointcloud/format/opc/EmbeddedAttributeReader.js.map +1 -1
- package/lib/cjs/pointcloud/format/opc/FileAccess.d.ts +39 -39
- package/lib/cjs/pointcloud/format/opc/FileAccess.js +48 -48
- package/lib/cjs/pointcloud/format/opc/FileAccess.js.map +1 -1
- package/lib/cjs/pointcloud/format/opc/FileReader.d.ts +118 -118
- package/lib/cjs/pointcloud/format/opc/FileReader.js +248 -248
- package/lib/cjs/pointcloud/format/opc/FileReader.js.map +1 -1
- package/lib/cjs/pointcloud/format/opc/FileRecord.d.ts +89 -89
- package/lib/cjs/pointcloud/format/opc/FileRecord.js +125 -125
- package/lib/cjs/pointcloud/format/opc/FileRecord.js.map +1 -1
- package/lib/cjs/pointcloud/format/opc/GeometryReader.d.ts +79 -79
- package/lib/cjs/pointcloud/format/opc/GeometryReader.js +163 -163
- package/lib/cjs/pointcloud/format/opc/GeometryReader.js.map +1 -1
- package/lib/cjs/pointcloud/format/opc/GeometryRecord.d.ts +53 -53
- package/lib/cjs/pointcloud/format/opc/GeometryRecord.js +107 -107
- package/lib/cjs/pointcloud/format/opc/GeometryRecord.js.map +1 -1
- package/lib/cjs/pointcloud/format/opc/OPCReader.d.ts +157 -157
- package/lib/cjs/pointcloud/format/opc/OPCReader.js +319 -319
- package/lib/cjs/pointcloud/format/opc/OPCReader.js.map +1 -1
- package/lib/cjs/pointcloud/format/opc/PointReader.d.ts +72 -72
- package/lib/cjs/pointcloud/format/opc/PointReader.js +152 -152
- package/lib/cjs/pointcloud/format/opc/PointReader.js.map +1 -1
- package/lib/cjs/pointcloud/format/opc/TileReadBuffer.d.ts +63 -63
- package/lib/cjs/pointcloud/format/opc/TileReadBuffer.js +92 -92
- package/lib/cjs/pointcloud/format/opc/TileReadBuffer.js.map +1 -1
- package/lib/cjs/pointcloud/format/opc/TileRecord.d.ts +88 -88
- package/lib/cjs/pointcloud/format/opc/TileRecord.js +161 -161
- package/lib/cjs/pointcloud/format/opc/TileRecord.js.map +1 -1
- package/lib/cjs/pointcloud/model/AttributeTypes.d.ts +37 -37
- package/lib/cjs/pointcloud/model/AttributeTypes.js +64 -64
- package/lib/cjs/pointcloud/model/AttributeTypes.js.map +1 -1
- package/lib/cjs/pointcloud/model/AttributeValue.d.ts +247 -247
- package/lib/cjs/pointcloud/model/AttributeValue.js +508 -508
- package/lib/cjs/pointcloud/model/AttributeValue.js.map +1 -1
- package/lib/cjs/pointcloud/model/BlockIndex.d.ts +49 -49
- package/lib/cjs/pointcloud/model/BlockIndex.js +48 -48
- package/lib/cjs/pointcloud/model/BlockIndex.js.map +1 -1
- package/lib/cjs/pointcloud/model/CloudPoint.d.ts +210 -210
- package/lib/cjs/pointcloud/model/CloudPoint.js +318 -318
- package/lib/cjs/pointcloud/model/CloudPoint.js.map +1 -1
- package/lib/cjs/pointcloud/model/Grid.d.ts +91 -91
- package/lib/cjs/pointcloud/model/Grid.js +129 -129
- package/lib/cjs/pointcloud/model/Grid.js.map +1 -1
- package/lib/cjs/pointcloud/model/GridIndex.d.ts +66 -66
- package/lib/cjs/pointcloud/model/GridIndex.js +93 -93
- package/lib/cjs/pointcloud/model/GridIndex.js.map +1 -1
- package/lib/cjs/pointcloud/model/PointAttribute.d.ts +208 -208
- package/lib/cjs/pointcloud/model/PointAttribute.js +374 -374
- package/lib/cjs/pointcloud/model/PointAttribute.js.map +1 -1
- package/lib/cjs/pointcloud/model/PointCloudReader.d.ts +156 -156
- package/lib/cjs/pointcloud/model/PointCloudReader.js +189 -189
- package/lib/cjs/pointcloud/model/PointCloudReader.js.map +1 -1
- package/lib/cjs/pointcloud/model/PointData.d.ts +17 -17
- package/lib/cjs/pointcloud/model/PointData.js +24 -24
- package/lib/cjs/pointcloud/model/PointData.js.map +1 -1
- package/lib/cjs/pointcloud/model/PointDataRaw.d.ts +34 -34
- package/lib/cjs/pointcloud/model/PointDataRaw.js +69 -69
- package/lib/cjs/pointcloud/model/PointDataRaw.js.map +1 -1
- package/lib/cjs/pointcloud/model/ReadRequest.d.ts +175 -175
- package/lib/cjs/pointcloud/model/ReadRequest.js +239 -239
- package/lib/cjs/pointcloud/model/ReadRequest.js.map +1 -1
- package/lib/cjs/pointcloud/model/StandardAttributes.d.ts +40 -40
- package/lib/cjs/pointcloud/model/StandardAttributes.js +47 -47
- package/lib/cjs/pointcloud/model/StandardAttributes.js.map +1 -1
- package/lib/cjs/pointcloud/model/TileIndex.d.ts +47 -47
- package/lib/cjs/pointcloud/model/TileIndex.js +47 -47
- package/lib/cjs/pointcloud/model/TileIndex.js.map +1 -1
- package/lib/cjs/pointcloud/render/AViewRequest.d.ts +38 -38
- package/lib/cjs/pointcloud/render/AViewRequest.js +24 -24
- package/lib/cjs/pointcloud/render/AViewRequest.js.map +1 -1
- package/lib/cjs/pointcloud/render/Block.d.ts +67 -67
- package/lib/cjs/pointcloud/render/Block.js +119 -119
- package/lib/cjs/pointcloud/render/Block.js.map +1 -1
- package/lib/cjs/pointcloud/render/DataManager.d.ts +136 -136
- package/lib/cjs/pointcloud/render/DataManager.js +342 -342
- package/lib/cjs/pointcloud/render/DataManager.js.map +1 -1
- package/lib/cjs/pointcloud/render/FrameData.d.ts +30 -30
- package/lib/cjs/pointcloud/render/FrameData.js +39 -39
- package/lib/cjs/pointcloud/render/FrameData.js.map +1 -1
- package/lib/cjs/pointcloud/render/Level.d.ts +90 -90
- package/lib/cjs/pointcloud/render/Level.js +119 -119
- package/lib/cjs/pointcloud/render/Level.js.map +1 -1
- package/lib/cjs/pointcloud/render/TileLoadSorter.d.ts +60 -60
- package/lib/cjs/pointcloud/render/TileLoadSorter.js +99 -99
- package/lib/cjs/pointcloud/render/TileLoadSorter.js.map +1 -1
- package/lib/cjs/pointcloud/render/ViewTree.d.ts +113 -113
- package/lib/cjs/pointcloud/render/ViewTree.js +363 -363
- package/lib/cjs/pointcloud/render/ViewTree.js.map +1 -1
- package/lib/cjs/spatial/crs/CRSEngine.d.ts +55 -55
- package/lib/cjs/spatial/crs/CRSEngine.js +93 -93
- package/lib/cjs/spatial/crs/CRSEngine.js.map +1 -1
- package/lib/cjs/spatial/crs/CRSManager.d.ts +49 -49
- package/lib/cjs/spatial/crs/CRSManager.js +109 -109
- package/lib/cjs/spatial/crs/CRSManager.js.map +1 -1
- package/lib/cjs/spatial/ecrs/Axis.d.ts +77 -77
- package/lib/cjs/spatial/ecrs/Axis.js +93 -93
- package/lib/cjs/spatial/ecrs/Axis.js.map +1 -1
- package/lib/cjs/spatial/ecrs/CRS.d.ts +447 -447
- package/lib/cjs/spatial/ecrs/CRS.js +930 -930
- package/lib/cjs/spatial/ecrs/CRS.js.map +1 -1
- package/lib/cjs/spatial/ecrs/CoordinateSystem.d.ts +142 -142
- package/lib/cjs/spatial/ecrs/CoordinateSystem.js +326 -326
- package/lib/cjs/spatial/ecrs/CoordinateSystem.js.map +1 -1
- package/lib/cjs/spatial/ecrs/DataFileUnit.d.ts +10 -10
- package/lib/cjs/spatial/ecrs/DataFileUnit.js +104 -104
- package/lib/cjs/spatial/ecrs/DataFileUnit.js.map +1 -1
- package/lib/cjs/spatial/ecrs/Datum.d.ts +111 -111
- package/lib/cjs/spatial/ecrs/Datum.js +166 -166
- package/lib/cjs/spatial/ecrs/Datum.js.map +1 -1
- package/lib/cjs/spatial/ecrs/Ellipsoid.d.ts +188 -188
- package/lib/cjs/spatial/ecrs/Ellipsoid.js +336 -336
- package/lib/cjs/spatial/ecrs/Ellipsoid.js.map +1 -1
- package/lib/cjs/spatial/ecrs/OnlineEngine.d.ts +48 -48
- package/lib/cjs/spatial/ecrs/OnlineEngine.js +102 -102
- package/lib/cjs/spatial/ecrs/OnlineEngine.js.map +1 -1
- package/lib/cjs/spatial/ecrs/OnlineRegistry.d.ts +37 -37
- package/lib/cjs/spatial/ecrs/OnlineRegistry.js +76 -76
- package/lib/cjs/spatial/ecrs/OnlineRegistry.js.map +1 -1
- package/lib/cjs/spatial/ecrs/Operation.d.ts +191 -191
- package/lib/cjs/spatial/ecrs/Operation.js +345 -345
- package/lib/cjs/spatial/ecrs/Operation.js.map +1 -1
- package/lib/cjs/spatial/ecrs/OperationMethod.d.ts +71 -71
- package/lib/cjs/spatial/ecrs/OperationMethod.js +75 -75
- package/lib/cjs/spatial/ecrs/OperationMethod.js.map +1 -1
- package/lib/cjs/spatial/ecrs/ParameterValue.d.ts +49 -49
- package/lib/cjs/spatial/ecrs/ParameterValue.js +65 -65
- package/lib/cjs/spatial/ecrs/ParameterValue.js.map +1 -1
- package/lib/cjs/spatial/ecrs/ParameterValueList.d.ts +72 -72
- package/lib/cjs/spatial/ecrs/ParameterValueList.js +120 -120
- package/lib/cjs/spatial/ecrs/ParameterValueList.js.map +1 -1
- package/lib/cjs/spatial/ecrs/PrimeMeridian.d.ts +78 -78
- package/lib/cjs/spatial/ecrs/PrimeMeridian.js +108 -108
- package/lib/cjs/spatial/ecrs/PrimeMeridian.js.map +1 -1
- package/lib/cjs/spatial/ecrs/Registry.d.ts +109 -109
- package/lib/cjs/spatial/ecrs/Registry.js +207 -207
- package/lib/cjs/spatial/ecrs/Registry.js.map +1 -1
- package/lib/cjs/spatial/ecrs/Transform.d.ts +77 -77
- package/lib/cjs/spatial/ecrs/Transform.js +396 -396
- package/lib/cjs/spatial/ecrs/Transform.js.map +1 -1
- package/lib/cjs/spatial/ecrs/Unit.d.ts +170 -170
- package/lib/cjs/spatial/ecrs/Unit.js +336 -336
- package/lib/cjs/spatial/ecrs/Unit.js.map +1 -1
- package/lib/cjs/spatial/ecrs/VerticalModel.d.ts +69 -69
- package/lib/cjs/spatial/ecrs/VerticalModel.js +88 -88
- package/lib/cjs/spatial/ecrs/VerticalModel.js.map +1 -1
- package/lib/cjs/spatial/ecrs/WellKnownText.d.ts +153 -153
- package/lib/cjs/spatial/ecrs/WellKnownText.js +494 -494
- package/lib/cjs/spatial/ecrs/WellKnownText.js.map +1 -1
- package/lib/cjs/spatial/ecrs/WellKnownTextNode.d.ts +69 -69
- package/lib/cjs/spatial/ecrs/WellKnownTextNode.js +128 -128
- package/lib/cjs/spatial/ecrs/WellKnownTextNode.js.map +1 -1
- package/lib/cjs/spatial/ecrs/projection/HotineObliqueMercator.d.ts +101 -101
- package/lib/cjs/spatial/ecrs/projection/HotineObliqueMercator.js +162 -162
- package/lib/cjs/spatial/ecrs/projection/HotineObliqueMercator.js.map +1 -1
- package/lib/cjs/spatial/ecrs/projection/KrovakObliqueConformalConic.d.ts +79 -79
- package/lib/cjs/spatial/ecrs/projection/KrovakObliqueConformalConic.js +125 -125
- package/lib/cjs/spatial/ecrs/projection/KrovakObliqueConformalConic.js.map +1 -1
- package/lib/cjs/spatial/ecrs/projection/KrovakObliqueConformalConicEN.d.ts +47 -47
- package/lib/cjs/spatial/ecrs/projection/KrovakObliqueConformalConicEN.js +73 -73
- package/lib/cjs/spatial/ecrs/projection/KrovakObliqueConformalConicEN.js.map +1 -1
- package/lib/cjs/spatial/ecrs/projection/LambertConical1SP.d.ts +72 -72
- package/lib/cjs/spatial/ecrs/projection/LambertConical1SP.js +129 -129
- package/lib/cjs/spatial/ecrs/projection/LambertConical1SP.js.map +1 -1
- package/lib/cjs/spatial/ecrs/projection/LambertConical2SP.d.ts +120 -120
- package/lib/cjs/spatial/ecrs/projection/LambertConical2SP.js +179 -179
- package/lib/cjs/spatial/ecrs/projection/LambertConical2SP.js.map +1 -1
- package/lib/cjs/spatial/ecrs/projection/Mercator1SP.d.ts +73 -73
- package/lib/cjs/spatial/ecrs/projection/Mercator1SP.js +112 -112
- package/lib/cjs/spatial/ecrs/projection/Mercator1SP.js.map +1 -1
- package/lib/cjs/spatial/ecrs/projection/ObliqueMercator.d.ts +96 -96
- package/lib/cjs/spatial/ecrs/projection/ObliqueMercator.js +173 -173
- package/lib/cjs/spatial/ecrs/projection/ObliqueMercator.js.map +1 -1
- package/lib/cjs/spatial/ecrs/projection/ObliqueStereographic.d.ts +123 -123
- package/lib/cjs/spatial/ecrs/projection/ObliqueStereographic.js +208 -208
- package/lib/cjs/spatial/ecrs/projection/ObliqueStereographic.js.map +1 -1
- package/lib/cjs/spatial/ecrs/projection/TransverseMercator.d.ts +108 -108
- package/lib/cjs/spatial/ecrs/projection/TransverseMercator.js +183 -183
- package/lib/cjs/spatial/ecrs/projection/TransverseMercator.js.map +1 -1
- package/lib/cjs/spatial/ecrs/transformation/PositionVector.d.ts +90 -90
- package/lib/cjs/spatial/ecrs/transformation/PositionVector.js +130 -130
- package/lib/cjs/spatial/ecrs/transformation/PositionVector.js.map +1 -1
- package/lib/cjs/spatial/geom/Bounds.d.ts +33 -33
- package/lib/cjs/spatial/geom/Bounds.js +156 -156
- package/lib/cjs/spatial/geom/Bounds.js.map +1 -1
- package/lib/cjs/spatial/geom/Coordinate.d.ts +61 -61
- package/lib/cjs/spatial/geom/Coordinate.js +186 -186
- package/lib/cjs/spatial/geom/Coordinate.js.map +1 -1
- package/lib/cjs/spatial/geom/Line.d.ts +225 -225
- package/lib/cjs/spatial/geom/Line.js +432 -432
- package/lib/cjs/spatial/geom/Line.js.map +1 -1
- package/lib/cjs/spatial/geom/Transform.d.ts +340 -340
- package/lib/cjs/spatial/geom/Transform.js +748 -748
- package/lib/cjs/spatial/geom/Transform.js.map +1 -1
- package/lib/cjs/system/buffer/ABuffer.d.ts +51 -51
- package/lib/cjs/system/buffer/ABuffer.js +90 -90
- package/lib/cjs/system/buffer/ABuffer.js.map +1 -1
- package/lib/cjs/system/buffer/Float32Buffer.d.ts +46 -46
- package/lib/cjs/system/buffer/Float32Buffer.js +60 -60
- package/lib/cjs/system/buffer/Float32Buffer.js.map +1 -1
- package/lib/cjs/system/buffer/LittleEndian.d.ts +149 -149
- package/lib/cjs/system/buffer/LittleEndian.js +303 -303
- package/lib/cjs/system/buffer/LittleEndian.js.map +1 -1
- package/lib/cjs/system/buffer/Uint16Buffer.d.ts +49 -49
- package/lib/cjs/system/buffer/Uint16Buffer.js +65 -65
- package/lib/cjs/system/buffer/Uint16Buffer.js.map +1 -1
- package/lib/cjs/system/buffer/Uint8Buffer.d.ts +49 -49
- package/lib/cjs/system/buffer/Uint8Buffer.js +65 -65
- package/lib/cjs/system/buffer/Uint8Buffer.js.map +1 -1
- package/lib/cjs/system/collection/AList.d.ts +30 -30
- package/lib/cjs/system/collection/AList.js +70 -70
- package/lib/cjs/system/collection/AList.js.map +1 -1
- package/lib/cjs/system/collection/IntMap.d.ts +18 -18
- package/lib/cjs/system/collection/IntMap.js +35 -35
- package/lib/cjs/system/collection/IntMap.js.map +1 -1
- package/lib/cjs/system/collection/StringMap.d.ts +26 -26
- package/lib/cjs/system/collection/StringMap.js +63 -63
- package/lib/cjs/system/collection/StringMap.js.map +1 -1
- package/lib/cjs/system/io/ABufferInStream.d.ts +29 -29
- package/lib/cjs/system/io/ABufferInStream.js +46 -46
- package/lib/cjs/system/io/ABufferInStream.js.map +1 -1
- package/lib/cjs/system/io/InStream.d.ts +23 -23
- package/lib/cjs/system/io/InStream.js +34 -34
- package/lib/cjs/system/io/InStream.js.map +1 -1
- package/lib/cjs/system/io/OutStream.d.ts +23 -23
- package/lib/cjs/system/io/OutStream.js +33 -33
- package/lib/cjs/system/io/OutStream.js.map +1 -1
- package/lib/cjs/system/runtime/ALong.d.ts +329 -329
- package/lib/cjs/system/runtime/ALong.js +687 -687
- package/lib/cjs/system/runtime/ALong.js.map +1 -1
- package/lib/cjs/system/runtime/ASystem.d.ts +14 -14
- package/lib/cjs/system/runtime/ASystem.js +31 -31
- package/lib/cjs/system/runtime/ASystem.js.map +1 -1
- package/lib/cjs/system/runtime/Downloader.d.ts +17 -17
- package/lib/cjs/system/runtime/Downloader.js +38 -38
- package/lib/cjs/system/runtime/Downloader.js.map +1 -1
- package/lib/cjs/system/runtime/DownloaderNode.d.ts +18 -18
- package/lib/cjs/system/runtime/DownloaderNode.js +129 -129
- package/lib/cjs/system/runtime/DownloaderNode.js.map +1 -1
- package/lib/cjs/system/runtime/DownloaderXhr.d.ts +18 -18
- package/lib/cjs/system/runtime/DownloaderXhr.js +131 -131
- package/lib/cjs/system/runtime/DownloaderXhr.js.map +1 -1
- package/lib/cjs/system/runtime/Message.d.ts +16 -16
- package/lib/cjs/system/runtime/Message.js +39 -39
- package/lib/cjs/system/runtime/Message.js.map +1 -1
- package/lib/cjs/system/runtime/Numbers.d.ts +34 -34
- package/lib/cjs/system/runtime/Numbers.js +87 -87
- package/lib/cjs/system/runtime/Numbers.js.map +1 -1
- package/lib/cjs/system/runtime/Strings.d.ts +49 -49
- package/lib/cjs/system/runtime/Strings.js +188 -188
- package/lib/cjs/system/runtime/Strings.js.map +1 -1
- package/lib/cjs/system/runtime/iComparator.d.ts +12 -12
- package/lib/cjs/system/runtime/iComparator.js +9 -9
- package/lib/cjs/system/runtime/iComparator.js.map +1 -1
- package/lib/cjs/system/storage/CacheList.d.ts +39 -39
- package/lib/cjs/system/storage/CacheList.js +80 -80
- package/lib/cjs/system/storage/CacheList.js.map +1 -1
- package/lib/cjs/system/storage/CachedItem.d.ts +21 -21
- package/lib/cjs/system/storage/CachedItem.js +25 -25
- package/lib/cjs/system/storage/CachedItem.js.map +1 -1
- package/lib/cjs/system/storage/ContentLoader.d.ts +64 -64
- package/lib/cjs/system/storage/ContentLoader.js +95 -95
- package/lib/cjs/system/storage/ContentLoader.js.map +1 -1
- package/lib/cjs/system/storage/FileContent.d.ts +19 -19
- package/lib/cjs/system/storage/FileContent.js +24 -24
- package/lib/cjs/system/storage/FileContent.js.map +1 -1
- package/lib/cjs/system/storage/FileRange.d.ts +20 -20
- package/lib/cjs/system/storage/FileRange.js +24 -24
- package/lib/cjs/system/storage/FileRange.js.map +1 -1
- package/lib/cjs/system/storage/FileStorage.d.ts +44 -44
- package/lib/cjs/system/storage/FileStorage.js +62 -62
- package/lib/cjs/system/storage/FileStorage.js.map +1 -1
- package/lib/cjs/system/storage/NodeFS.d.ts +41 -41
- package/lib/cjs/system/storage/NodeFS.js +79 -79
- package/lib/cjs/system/storage/NodeFS.js.map +1 -1
- package/lib/cjs/system/storage/PageCachedFile.d.ts +54 -54
- package/lib/cjs/system/storage/PageCachedFile.js +165 -165
- package/lib/cjs/system/storage/PageCachedFile.js.map +1 -1
- package/lib/cjs/system/storage/UrlFS.d.ts +53 -53
- package/lib/cjs/system/storage/UrlFS.js +114 -114
- package/lib/cjs/system/storage/UrlFS.js.map +1 -1
- package/lib/esm/core-orbitgt.d.ts +26 -26
- package/lib/esm/core-orbitgt.js +31 -31
- package/lib/esm/core-orbitgt.js.map +1 -1
- package/lib/esm/pointcloud/format/opc/AttributeMask.d.ts +30 -30
- package/lib/esm/pointcloud/format/opc/AttributeMask.js +43 -43
- package/lib/esm/pointcloud/format/opc/AttributeMask.js.map +1 -1
- package/lib/esm/pointcloud/format/opc/AttributeReader.d.ts +63 -63
- package/lib/esm/pointcloud/format/opc/AttributeReader.js +20 -20
- package/lib/esm/pointcloud/format/opc/AttributeReader.js.map +1 -1
- package/lib/esm/pointcloud/format/opc/BlockRecord.d.ts +54 -54
- package/lib/esm/pointcloud/format/opc/BlockRecord.js +80 -80
- package/lib/esm/pointcloud/format/opc/BlockRecord.js.map +1 -1
- package/lib/esm/pointcloud/format/opc/ContainerFile.d.ts +85 -85
- package/lib/esm/pointcloud/format/opc/ContainerFile.js +195 -195
- package/lib/esm/pointcloud/format/opc/ContainerFile.js.map +1 -1
- package/lib/esm/pointcloud/format/opc/ContainerFilePart.d.ts +55 -55
- package/lib/esm/pointcloud/format/opc/ContainerFilePart.js +71 -71
- package/lib/esm/pointcloud/format/opc/ContainerFilePart.js.map +1 -1
- package/lib/esm/pointcloud/format/opc/DirectoryReader.d.ts +75 -75
- package/lib/esm/pointcloud/format/opc/DirectoryReader.js +165 -165
- package/lib/esm/pointcloud/format/opc/DirectoryReader.js.map +1 -1
- package/lib/esm/pointcloud/format/opc/DirectoryRecord.d.ts +59 -59
- package/lib/esm/pointcloud/format/opc/DirectoryRecord.js +85 -85
- package/lib/esm/pointcloud/format/opc/DirectoryRecord.js.map +1 -1
- package/lib/esm/pointcloud/format/opc/EmbeddedAttributeReader.d.ts +106 -106
- package/lib/esm/pointcloud/format/opc/EmbeddedAttributeReader.js +193 -193
- package/lib/esm/pointcloud/format/opc/EmbeddedAttributeReader.js.map +1 -1
- package/lib/esm/pointcloud/format/opc/FileAccess.d.ts +39 -39
- package/lib/esm/pointcloud/format/opc/FileAccess.js +44 -44
- package/lib/esm/pointcloud/format/opc/FileAccess.js.map +1 -1
- package/lib/esm/pointcloud/format/opc/FileReader.d.ts +118 -118
- package/lib/esm/pointcloud/format/opc/FileReader.js +244 -244
- package/lib/esm/pointcloud/format/opc/FileReader.js.map +1 -1
- package/lib/esm/pointcloud/format/opc/FileRecord.d.ts +89 -89
- package/lib/esm/pointcloud/format/opc/FileRecord.js +121 -121
- package/lib/esm/pointcloud/format/opc/FileRecord.js.map +1 -1
- package/lib/esm/pointcloud/format/opc/GeometryReader.d.ts +79 -79
- package/lib/esm/pointcloud/format/opc/GeometryReader.js +159 -159
- package/lib/esm/pointcloud/format/opc/GeometryReader.js.map +1 -1
- package/lib/esm/pointcloud/format/opc/GeometryRecord.d.ts +53 -53
- package/lib/esm/pointcloud/format/opc/GeometryRecord.js +103 -103
- package/lib/esm/pointcloud/format/opc/GeometryRecord.js.map +1 -1
- package/lib/esm/pointcloud/format/opc/OPCReader.d.ts +157 -157
- package/lib/esm/pointcloud/format/opc/OPCReader.js +315 -315
- package/lib/esm/pointcloud/format/opc/OPCReader.js.map +1 -1
- package/lib/esm/pointcloud/format/opc/PointReader.d.ts +72 -72
- package/lib/esm/pointcloud/format/opc/PointReader.js +148 -148
- package/lib/esm/pointcloud/format/opc/PointReader.js.map +1 -1
- package/lib/esm/pointcloud/format/opc/TileReadBuffer.d.ts +63 -63
- package/lib/esm/pointcloud/format/opc/TileReadBuffer.js +88 -88
- package/lib/esm/pointcloud/format/opc/TileReadBuffer.js.map +1 -1
- package/lib/esm/pointcloud/format/opc/TileRecord.d.ts +88 -88
- package/lib/esm/pointcloud/format/opc/TileRecord.js +157 -157
- package/lib/esm/pointcloud/format/opc/TileRecord.js.map +1 -1
- package/lib/esm/pointcloud/model/AttributeTypes.d.ts +37 -37
- package/lib/esm/pointcloud/model/AttributeTypes.js +60 -60
- package/lib/esm/pointcloud/model/AttributeTypes.js.map +1 -1
- package/lib/esm/pointcloud/model/AttributeValue.d.ts +247 -247
- package/lib/esm/pointcloud/model/AttributeValue.js +504 -504
- package/lib/esm/pointcloud/model/AttributeValue.js.map +1 -1
- package/lib/esm/pointcloud/model/BlockIndex.d.ts +49 -49
- package/lib/esm/pointcloud/model/BlockIndex.js +44 -44
- package/lib/esm/pointcloud/model/BlockIndex.js.map +1 -1
- package/lib/esm/pointcloud/model/CloudPoint.d.ts +210 -210
- package/lib/esm/pointcloud/model/CloudPoint.js +314 -314
- package/lib/esm/pointcloud/model/CloudPoint.js.map +1 -1
- package/lib/esm/pointcloud/model/Grid.d.ts +91 -91
- package/lib/esm/pointcloud/model/Grid.js +125 -125
- package/lib/esm/pointcloud/model/Grid.js.map +1 -1
- package/lib/esm/pointcloud/model/GridIndex.d.ts +66 -66
- package/lib/esm/pointcloud/model/GridIndex.js +89 -89
- package/lib/esm/pointcloud/model/GridIndex.js.map +1 -1
- package/lib/esm/pointcloud/model/PointAttribute.d.ts +208 -208
- package/lib/esm/pointcloud/model/PointAttribute.js +370 -370
- package/lib/esm/pointcloud/model/PointAttribute.js.map +1 -1
- package/lib/esm/pointcloud/model/PointCloudReader.d.ts +156 -156
- package/lib/esm/pointcloud/model/PointCloudReader.js +185 -185
- package/lib/esm/pointcloud/model/PointCloudReader.js.map +1 -1
- package/lib/esm/pointcloud/model/PointData.d.ts +17 -17
- package/lib/esm/pointcloud/model/PointData.js +20 -20
- package/lib/esm/pointcloud/model/PointData.js.map +1 -1
- package/lib/esm/pointcloud/model/PointDataRaw.d.ts +34 -34
- package/lib/esm/pointcloud/model/PointDataRaw.js +65 -65
- package/lib/esm/pointcloud/model/PointDataRaw.js.map +1 -1
- package/lib/esm/pointcloud/model/ReadRequest.d.ts +175 -175
- package/lib/esm/pointcloud/model/ReadRequest.js +235 -235
- package/lib/esm/pointcloud/model/ReadRequest.js.map +1 -1
- package/lib/esm/pointcloud/model/StandardAttributes.d.ts +40 -40
- package/lib/esm/pointcloud/model/StandardAttributes.js +43 -43
- package/lib/esm/pointcloud/model/StandardAttributes.js.map +1 -1
- package/lib/esm/pointcloud/model/TileIndex.d.ts +47 -47
- package/lib/esm/pointcloud/model/TileIndex.js +43 -43
- package/lib/esm/pointcloud/model/TileIndex.js.map +1 -1
- package/lib/esm/pointcloud/render/AViewRequest.d.ts +38 -38
- package/lib/esm/pointcloud/render/AViewRequest.js +20 -20
- package/lib/esm/pointcloud/render/AViewRequest.js.map +1 -1
- package/lib/esm/pointcloud/render/Block.d.ts +67 -67
- package/lib/esm/pointcloud/render/Block.js +115 -115
- package/lib/esm/pointcloud/render/Block.js.map +1 -1
- package/lib/esm/pointcloud/render/DataManager.d.ts +136 -136
- package/lib/esm/pointcloud/render/DataManager.js +338 -338
- package/lib/esm/pointcloud/render/DataManager.js.map +1 -1
- package/lib/esm/pointcloud/render/FrameData.d.ts +30 -30
- package/lib/esm/pointcloud/render/FrameData.js +35 -35
- package/lib/esm/pointcloud/render/FrameData.js.map +1 -1
- package/lib/esm/pointcloud/render/Level.d.ts +90 -90
- package/lib/esm/pointcloud/render/Level.js +115 -115
- package/lib/esm/pointcloud/render/Level.js.map +1 -1
- package/lib/esm/pointcloud/render/TileLoadSorter.d.ts +60 -60
- package/lib/esm/pointcloud/render/TileLoadSorter.js +95 -95
- package/lib/esm/pointcloud/render/TileLoadSorter.js.map +1 -1
- package/lib/esm/pointcloud/render/ViewTree.d.ts +113 -113
- package/lib/esm/pointcloud/render/ViewTree.js +359 -359
- package/lib/esm/pointcloud/render/ViewTree.js.map +1 -1
- package/lib/esm/spatial/crs/CRSEngine.d.ts +55 -55
- package/lib/esm/spatial/crs/CRSEngine.js +89 -89
- package/lib/esm/spatial/crs/CRSEngine.js.map +1 -1
- package/lib/esm/spatial/crs/CRSManager.d.ts +49 -49
- package/lib/esm/spatial/crs/CRSManager.js +105 -105
- package/lib/esm/spatial/crs/CRSManager.js.map +1 -1
- package/lib/esm/spatial/ecrs/Axis.d.ts +77 -77
- package/lib/esm/spatial/ecrs/Axis.js +89 -89
- package/lib/esm/spatial/ecrs/Axis.js.map +1 -1
- package/lib/esm/spatial/ecrs/CRS.d.ts +447 -447
- package/lib/esm/spatial/ecrs/CRS.js +926 -926
- package/lib/esm/spatial/ecrs/CRS.js.map +1 -1
- package/lib/esm/spatial/ecrs/CoordinateSystem.d.ts +142 -142
- package/lib/esm/spatial/ecrs/CoordinateSystem.js +322 -322
- package/lib/esm/spatial/ecrs/CoordinateSystem.js.map +1 -1
- package/lib/esm/spatial/ecrs/DataFileUnit.d.ts +10 -10
- package/lib/esm/spatial/ecrs/DataFileUnit.js +100 -100
- package/lib/esm/spatial/ecrs/DataFileUnit.js.map +1 -1
- package/lib/esm/spatial/ecrs/Datum.d.ts +111 -111
- package/lib/esm/spatial/ecrs/Datum.js +162 -162
- package/lib/esm/spatial/ecrs/Datum.js.map +1 -1
- package/lib/esm/spatial/ecrs/Ellipsoid.d.ts +188 -188
- package/lib/esm/spatial/ecrs/Ellipsoid.js +332 -332
- package/lib/esm/spatial/ecrs/Ellipsoid.js.map +1 -1
- package/lib/esm/spatial/ecrs/OnlineEngine.d.ts +48 -48
- package/lib/esm/spatial/ecrs/OnlineEngine.js +98 -98
- package/lib/esm/spatial/ecrs/OnlineEngine.js.map +1 -1
- package/lib/esm/spatial/ecrs/OnlineRegistry.d.ts +37 -37
- package/lib/esm/spatial/ecrs/OnlineRegistry.js +72 -72
- package/lib/esm/spatial/ecrs/OnlineRegistry.js.map +1 -1
- package/lib/esm/spatial/ecrs/Operation.d.ts +191 -191
- package/lib/esm/spatial/ecrs/Operation.js +341 -341
- package/lib/esm/spatial/ecrs/Operation.js.map +1 -1
- package/lib/esm/spatial/ecrs/OperationMethod.d.ts +71 -71
- package/lib/esm/spatial/ecrs/OperationMethod.js +71 -71
- package/lib/esm/spatial/ecrs/OperationMethod.js.map +1 -1
- package/lib/esm/spatial/ecrs/ParameterValue.d.ts +49 -49
- package/lib/esm/spatial/ecrs/ParameterValue.js +61 -61
- package/lib/esm/spatial/ecrs/ParameterValue.js.map +1 -1
- package/lib/esm/spatial/ecrs/ParameterValueList.d.ts +72 -72
- package/lib/esm/spatial/ecrs/ParameterValueList.js +116 -116
- package/lib/esm/spatial/ecrs/ParameterValueList.js.map +1 -1
- package/lib/esm/spatial/ecrs/PrimeMeridian.d.ts +78 -78
- package/lib/esm/spatial/ecrs/PrimeMeridian.js +104 -104
- package/lib/esm/spatial/ecrs/PrimeMeridian.js.map +1 -1
- package/lib/esm/spatial/ecrs/Registry.d.ts +109 -109
- package/lib/esm/spatial/ecrs/Registry.js +203 -203
- package/lib/esm/spatial/ecrs/Registry.js.map +1 -1
- package/lib/esm/spatial/ecrs/Transform.d.ts +77 -77
- package/lib/esm/spatial/ecrs/Transform.js +392 -392
- package/lib/esm/spatial/ecrs/Transform.js.map +1 -1
- package/lib/esm/spatial/ecrs/Unit.d.ts +170 -170
- package/lib/esm/spatial/ecrs/Unit.js +332 -332
- package/lib/esm/spatial/ecrs/Unit.js.map +1 -1
- package/lib/esm/spatial/ecrs/VerticalModel.d.ts +69 -69
- package/lib/esm/spatial/ecrs/VerticalModel.js +84 -84
- package/lib/esm/spatial/ecrs/VerticalModel.js.map +1 -1
- package/lib/esm/spatial/ecrs/WellKnownText.d.ts +153 -153
- package/lib/esm/spatial/ecrs/WellKnownText.js +490 -490
- package/lib/esm/spatial/ecrs/WellKnownText.js.map +1 -1
- package/lib/esm/spatial/ecrs/WellKnownTextNode.d.ts +69 -69
- package/lib/esm/spatial/ecrs/WellKnownTextNode.js +124 -124
- package/lib/esm/spatial/ecrs/WellKnownTextNode.js.map +1 -1
- package/lib/esm/spatial/ecrs/projection/HotineObliqueMercator.d.ts +101 -101
- package/lib/esm/spatial/ecrs/projection/HotineObliqueMercator.js +158 -158
- package/lib/esm/spatial/ecrs/projection/HotineObliqueMercator.js.map +1 -1
- package/lib/esm/spatial/ecrs/projection/KrovakObliqueConformalConic.d.ts +79 -79
- package/lib/esm/spatial/ecrs/projection/KrovakObliqueConformalConic.js +121 -121
- package/lib/esm/spatial/ecrs/projection/KrovakObliqueConformalConic.js.map +1 -1
- package/lib/esm/spatial/ecrs/projection/KrovakObliqueConformalConicEN.d.ts +47 -47
- package/lib/esm/spatial/ecrs/projection/KrovakObliqueConformalConicEN.js +69 -69
- package/lib/esm/spatial/ecrs/projection/KrovakObliqueConformalConicEN.js.map +1 -1
- package/lib/esm/spatial/ecrs/projection/LambertConical1SP.d.ts +72 -72
- package/lib/esm/spatial/ecrs/projection/LambertConical1SP.js +125 -125
- package/lib/esm/spatial/ecrs/projection/LambertConical1SP.js.map +1 -1
- package/lib/esm/spatial/ecrs/projection/LambertConical2SP.d.ts +120 -120
- package/lib/esm/spatial/ecrs/projection/LambertConical2SP.js +175 -175
- package/lib/esm/spatial/ecrs/projection/LambertConical2SP.js.map +1 -1
- package/lib/esm/spatial/ecrs/projection/Mercator1SP.d.ts +73 -73
- package/lib/esm/spatial/ecrs/projection/Mercator1SP.js +108 -108
- package/lib/esm/spatial/ecrs/projection/Mercator1SP.js.map +1 -1
- package/lib/esm/spatial/ecrs/projection/ObliqueMercator.d.ts +96 -96
- package/lib/esm/spatial/ecrs/projection/ObliqueMercator.js +169 -169
- package/lib/esm/spatial/ecrs/projection/ObliqueMercator.js.map +1 -1
- package/lib/esm/spatial/ecrs/projection/ObliqueStereographic.d.ts +123 -123
- package/lib/esm/spatial/ecrs/projection/ObliqueStereographic.js +204 -204
- package/lib/esm/spatial/ecrs/projection/ObliqueStereographic.js.map +1 -1
- package/lib/esm/spatial/ecrs/projection/TransverseMercator.d.ts +108 -108
- package/lib/esm/spatial/ecrs/projection/TransverseMercator.js +179 -179
- package/lib/esm/spatial/ecrs/projection/TransverseMercator.js.map +1 -1
- package/lib/esm/spatial/ecrs/transformation/PositionVector.d.ts +90 -90
- package/lib/esm/spatial/ecrs/transformation/PositionVector.js +126 -126
- package/lib/esm/spatial/ecrs/transformation/PositionVector.js.map +1 -1
- package/lib/esm/spatial/geom/Bounds.d.ts +33 -33
- package/lib/esm/spatial/geom/Bounds.js +152 -152
- package/lib/esm/spatial/geom/Bounds.js.map +1 -1
- package/lib/esm/spatial/geom/Coordinate.d.ts +61 -61
- package/lib/esm/spatial/geom/Coordinate.js +182 -182
- package/lib/esm/spatial/geom/Coordinate.js.map +1 -1
- package/lib/esm/spatial/geom/Line.d.ts +225 -225
- package/lib/esm/spatial/geom/Line.js +428 -428
- package/lib/esm/spatial/geom/Line.js.map +1 -1
- package/lib/esm/spatial/geom/Transform.d.ts +340 -340
- package/lib/esm/spatial/geom/Transform.js +744 -744
- package/lib/esm/spatial/geom/Transform.js.map +1 -1
- package/lib/esm/system/buffer/ABuffer.d.ts +51 -51
- package/lib/esm/system/buffer/ABuffer.js +86 -86
- package/lib/esm/system/buffer/ABuffer.js.map +1 -1
- package/lib/esm/system/buffer/Float32Buffer.d.ts +46 -46
- package/lib/esm/system/buffer/Float32Buffer.js +56 -56
- package/lib/esm/system/buffer/Float32Buffer.js.map +1 -1
- package/lib/esm/system/buffer/LittleEndian.d.ts +149 -149
- package/lib/esm/system/buffer/LittleEndian.js +299 -299
- package/lib/esm/system/buffer/LittleEndian.js.map +1 -1
- package/lib/esm/system/buffer/Uint16Buffer.d.ts +49 -49
- package/lib/esm/system/buffer/Uint16Buffer.js +61 -61
- package/lib/esm/system/buffer/Uint16Buffer.js.map +1 -1
- package/lib/esm/system/buffer/Uint8Buffer.d.ts +49 -49
- package/lib/esm/system/buffer/Uint8Buffer.js +61 -61
- package/lib/esm/system/buffer/Uint8Buffer.js.map +1 -1
- package/lib/esm/system/collection/AList.d.ts +30 -30
- package/lib/esm/system/collection/AList.js +66 -66
- package/lib/esm/system/collection/AList.js.map +1 -1
- package/lib/esm/system/collection/IntMap.d.ts +18 -18
- package/lib/esm/system/collection/IntMap.js +31 -31
- package/lib/esm/system/collection/IntMap.js.map +1 -1
- package/lib/esm/system/collection/StringMap.d.ts +26 -26
- package/lib/esm/system/collection/StringMap.js +59 -59
- package/lib/esm/system/collection/StringMap.js.map +1 -1
- package/lib/esm/system/io/ABufferInStream.d.ts +29 -29
- package/lib/esm/system/io/ABufferInStream.js +42 -42
- package/lib/esm/system/io/ABufferInStream.js.map +1 -1
- package/lib/esm/system/io/InStream.d.ts +23 -23
- package/lib/esm/system/io/InStream.js +30 -30
- package/lib/esm/system/io/InStream.js.map +1 -1
- package/lib/esm/system/io/OutStream.d.ts +23 -23
- package/lib/esm/system/io/OutStream.js +29 -29
- package/lib/esm/system/io/OutStream.js.map +1 -1
- package/lib/esm/system/runtime/ALong.d.ts +329 -329
- package/lib/esm/system/runtime/ALong.js +683 -683
- package/lib/esm/system/runtime/ALong.js.map +1 -1
- package/lib/esm/system/runtime/ASystem.d.ts +14 -14
- package/lib/esm/system/runtime/ASystem.js +27 -27
- package/lib/esm/system/runtime/ASystem.js.map +1 -1
- package/lib/esm/system/runtime/Downloader.d.ts +17 -17
- package/lib/esm/system/runtime/Downloader.js +34 -34
- package/lib/esm/system/runtime/Downloader.js.map +1 -1
- package/lib/esm/system/runtime/DownloaderNode.d.ts +18 -18
- package/lib/esm/system/runtime/DownloaderNode.js +125 -125
- package/lib/esm/system/runtime/DownloaderNode.js.map +1 -1
- package/lib/esm/system/runtime/DownloaderXhr.d.ts +18 -18
- package/lib/esm/system/runtime/DownloaderXhr.js +127 -127
- package/lib/esm/system/runtime/DownloaderXhr.js.map +1 -1
- package/lib/esm/system/runtime/Message.d.ts +16 -16
- package/lib/esm/system/runtime/Message.js +35 -35
- package/lib/esm/system/runtime/Message.js.map +1 -1
- package/lib/esm/system/runtime/Numbers.d.ts +34 -34
- package/lib/esm/system/runtime/Numbers.js +83 -83
- package/lib/esm/system/runtime/Numbers.js.map +1 -1
- package/lib/esm/system/runtime/Strings.d.ts +49 -49
- package/lib/esm/system/runtime/Strings.js +184 -184
- package/lib/esm/system/runtime/Strings.js.map +1 -1
- package/lib/esm/system/runtime/iComparator.d.ts +12 -12
- package/lib/esm/system/runtime/iComparator.js +8 -8
- package/lib/esm/system/runtime/iComparator.js.map +1 -1
- package/lib/esm/system/storage/CacheList.d.ts +39 -39
- package/lib/esm/system/storage/CacheList.js +76 -76
- package/lib/esm/system/storage/CacheList.js.map +1 -1
- package/lib/esm/system/storage/CachedItem.d.ts +21 -21
- package/lib/esm/system/storage/CachedItem.js +21 -21
- package/lib/esm/system/storage/CachedItem.js.map +1 -1
- package/lib/esm/system/storage/ContentLoader.d.ts +64 -64
- package/lib/esm/system/storage/ContentLoader.js +91 -91
- package/lib/esm/system/storage/ContentLoader.js.map +1 -1
- package/lib/esm/system/storage/FileContent.d.ts +19 -19
- package/lib/esm/system/storage/FileContent.js +20 -20
- package/lib/esm/system/storage/FileContent.js.map +1 -1
- package/lib/esm/system/storage/FileRange.d.ts +20 -20
- package/lib/esm/system/storage/FileRange.js +20 -20
- package/lib/esm/system/storage/FileRange.js.map +1 -1
- package/lib/esm/system/storage/FileStorage.d.ts +44 -44
- package/lib/esm/system/storage/FileStorage.js +58 -58
- package/lib/esm/system/storage/FileStorage.js.map +1 -1
- package/lib/esm/system/storage/NodeFS.d.ts +41 -41
- package/lib/esm/system/storage/NodeFS.js +75 -75
- package/lib/esm/system/storage/NodeFS.js.map +1 -1
- package/lib/esm/system/storage/PageCachedFile.d.ts +54 -54
- package/lib/esm/system/storage/PageCachedFile.js +161 -161
- package/lib/esm/system/storage/PageCachedFile.js.map +1 -1
- package/lib/esm/system/storage/UrlFS.d.ts +53 -53
- package/lib/esm/system/storage/UrlFS.js +110 -110
- package/lib/esm/system/storage/UrlFS.js.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeFS.js","sourceRoot":"","sources":["../../../../src/system/storage/NodeFS.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GA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,QAAgB,EAAE,WAAoB;QAClE,MAAM,EAAE,GAAW,EAAE,CAAC,QAAQ,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;QAC9C,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE,IAAI,UAAU,CAAC,WAAW,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC;QAC/D,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;IACrB,CAAC;CACJ","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"NodeFS.js","sourceRoot":"","sources":["../../../../src/system/storage/NodeFS.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAQ5C;;GAEG;AACH,gBAAgB;AAChB,MAAM,OAAO,MAAO,SAAQ,WAAW;IACnC;;SAEK;IACL;QACI,KAAK,EAAE,CAAC;IACZ,CAAC;IAED;;SAEK;IACW,KAAK;IACrB,CAAC;IAED;;SAEK;IACW,KAAK,CAAC,aAAa,CAAC,QAAgB;QAChD,MAAM,SAAS,GAAa,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAClD,OAAO,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAC5C,CAAC;IAED;;SAEK;IACW,KAAK,CAAC,YAAY,CAAC,QAAgB,EAAE,MAAa,EAAE,IAAW;QAC3E,MAAM,SAAS,GAAgB,IAAI,WAAW,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AAC,OAAO,CAAC,SAAS,IAAI,KAAK,CAAC,IAAI,EAAE,YAAY,KAAK,CAAC,IAAI,oBAAoB,SAAS,eAAe,QAAQ,YAAY,KAAK,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;YAC1J,OAAO,CAAC,GAAG,CAAC,IAAI,WAAW,CAAC,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;SACvE;QACD,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;QACjB,OAAO,OAAO,CAAC;IACnB,CAAC;IAED;;SAEK;IACW,KAAK,CAAC,SAAS,CAAC,QAAgB,EAAE,WAAoB;QAClE,MAAM,EAAE,GAAW,EAAE,CAAC,QAAQ,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;QAC9C,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE,IAAI,UAAU,CAAC,WAAW,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC;QAC/D,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;IACrB,CAAC;CACJ","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module OrbitGT\n */\n\nimport * as fs from \"fs\";\nimport { ABuffer } from \"../buffer/ABuffer\";\nimport { AList } from \"../collection/AList\";\nimport { ALong } from \"../runtime/ALong\";\nimport { ASystem } from \"../runtime/ASystem\";\nimport { FileContent } from \"./FileContent\";\nimport { FileRange } from \"./FileRange\";\nimport { FileStorage } from \"./FileStorage\";\n\ntype int8 = number;\ntype int16 = number;\ntype int32 = number;\ntype float32 = number;\ntype float64 = number;\n\n/**\n * Class NodeFS provides access to files using the Node platform.\n */\n/** @internal */\nexport class NodeFS extends FileStorage {\n /**\n * Create new storage.\n */\n public constructor() {\n super();\n }\n\n /**\n * FileStorage method.\n */\n public override close(): void {\n }\n\n /**\n * FileStorage method.\n */\n public override async getFileLength(fileName: string): Promise<ALong> {\n const fileStats: fs.Stats = fs.statSync(fileName);\n return ALong.fromDouble(fileStats.size);\n }\n\n /**\n * FileStorage method.\n */\n public override async readFilePart(fileName: string, offset: ALong, size: int32): Promise<ABuffer> {\n const rawBuffer: ArrayBuffer = new ArrayBuffer(size);\n const buffer: Uint8Array = new Uint8Array(rawBuffer);\n const fd: number = fs.openSync(fileName, \"r\");\n const bytesRead: number = fs.readSync(fd, buffer, 0, size, offset.toDouble());\n fs.closeSync(fd);\n ASystem.assert0(bytesRead == size, `Expected ${size} bytes read, not ${bytesRead} from file '${fileName}' offset ${offset.toDouble()}`);\n return ABuffer.wrap(rawBuffer);\n }\n\n /**\n * FileStorage method.\n */\n public override async readFileParts(fileName: string, ranges: AList<FileRange>): Promise<AList<FileContent>> {\n const buffers: AList<FileContent> = new AList<FileContent>();\n const fd: number = fs.openSync(fileName, \"r\");\n for (let i: number = 0; i < ranges.size(); i++) {\n const range: FileRange = ranges.get(i);\n const rawBuffer: ArrayBuffer = new ArrayBuffer(range.size);\n const buffer: Uint8Array = new Uint8Array(rawBuffer);\n const bytesRead: number = fs.readSync(fd, buffer, 0, range.size, range.offset.toDouble());\n ASystem.assert0(bytesRead == range.size, `Expected ${range.size} bytes read, not ${bytesRead} from file '${fileName}' offset ${range.offset.toDouble()}`);\n buffers.add(new FileContent(range.offset, ABuffer.wrap(rawBuffer)));\n }\n fs.closeSync(fd);\n return buffers;\n }\n\n /**\n * FileStorage method.\n */\n public override async writeFile(fileName: string, fileContent: ABuffer): Promise<void> {\n const fd: number = fs.openSync(fileName, \"w\");\n fs.writeSync(fd, new Uint8Array(fileContent.toNativeBuffer()));\n fs.closeSync(fd);\n }\n}\n"]}
|
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
/** @packageDocumentation
|
|
2
|
-
* @module OrbitGT
|
|
3
|
-
*/
|
|
4
|
-
declare type int32 = number;
|
|
5
|
-
import { ABuffer } from "../buffer/ABuffer";
|
|
6
|
-
import { AList } from "../collection/AList";
|
|
7
|
-
import { ALong } from "../runtime/ALong";
|
|
8
|
-
import { FileContent } from "./FileContent";
|
|
9
|
-
import { FileRange } from "./FileRange";
|
|
10
|
-
import { FileStorage } from "./FileStorage";
|
|
11
|
-
/**
|
|
12
|
-
* Class PageCachedFile defines a paged content cache of a single file.
|
|
13
|
-
*/
|
|
14
|
-
/** @internal */
|
|
15
|
-
export declare class PageCachedFile extends FileStorage {
|
|
16
|
-
private _fileStorage;
|
|
17
|
-
private _fileName;
|
|
18
|
-
private _fileSize;
|
|
19
|
-
private _pageSize;
|
|
20
|
-
private _pageCount;
|
|
21
|
-
private _contentCache;
|
|
22
|
-
private _requestCount;
|
|
23
|
-
private _requestSize;
|
|
24
|
-
/**
|
|
25
|
-
* Create a new cached file.
|
|
26
|
-
* @param fileStorage the underlying file storage.
|
|
27
|
-
* @param fileName the name of the file to cache.
|
|
28
|
-
* @param fileSize the length of the file to cache.
|
|
29
|
-
* @param pageSize the byte size of a cache page (common sizes are 32768, 65536, 131072 or 262144).
|
|
30
|
-
* @param maxPageCount the maximum number of pages to cache (the oldest pages are purged when the cache is full).
|
|
31
|
-
*/
|
|
32
|
-
constructor(fileStorage: FileStorage, fileName: string, fileSize: ALong, pageSize: int32, maxPageCount: int32);
|
|
33
|
-
/**
|
|
34
|
-
* FileStorage method.
|
|
35
|
-
*/
|
|
36
|
-
close(): void;
|
|
37
|
-
/**
|
|
38
|
-
* FileStorage method.
|
|
39
|
-
*/
|
|
40
|
-
getFileLength(fileName: string): Promise<ALong>;
|
|
41
|
-
/**
|
|
42
|
-
* FileStorage method.
|
|
43
|
-
*/
|
|
44
|
-
readFileParts(fileName: string, ranges: AList<FileRange>): Promise<AList<FileContent>>;
|
|
45
|
-
/**
|
|
46
|
-
* FileStorage method.
|
|
47
|
-
*/
|
|
48
|
-
readFilePart(fileName: string, offset: ALong, size: int32): Promise<ABuffer>;
|
|
49
|
-
/**
|
|
50
|
-
* FileStorage method.
|
|
51
|
-
*/
|
|
52
|
-
printStatistics(clear: boolean): void;
|
|
53
|
-
}
|
|
54
|
-
export {};
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module OrbitGT
|
|
3
|
+
*/
|
|
4
|
+
declare type int32 = number;
|
|
5
|
+
import { ABuffer } from "../buffer/ABuffer";
|
|
6
|
+
import { AList } from "../collection/AList";
|
|
7
|
+
import { ALong } from "../runtime/ALong";
|
|
8
|
+
import { FileContent } from "./FileContent";
|
|
9
|
+
import { FileRange } from "./FileRange";
|
|
10
|
+
import { FileStorage } from "./FileStorage";
|
|
11
|
+
/**
|
|
12
|
+
* Class PageCachedFile defines a paged content cache of a single file.
|
|
13
|
+
*/
|
|
14
|
+
/** @internal */
|
|
15
|
+
export declare class PageCachedFile extends FileStorage {
|
|
16
|
+
private _fileStorage;
|
|
17
|
+
private _fileName;
|
|
18
|
+
private _fileSize;
|
|
19
|
+
private _pageSize;
|
|
20
|
+
private _pageCount;
|
|
21
|
+
private _contentCache;
|
|
22
|
+
private _requestCount;
|
|
23
|
+
private _requestSize;
|
|
24
|
+
/**
|
|
25
|
+
* Create a new cached file.
|
|
26
|
+
* @param fileStorage the underlying file storage.
|
|
27
|
+
* @param fileName the name of the file to cache.
|
|
28
|
+
* @param fileSize the length of the file to cache.
|
|
29
|
+
* @param pageSize the byte size of a cache page (common sizes are 32768, 65536, 131072 or 262144).
|
|
30
|
+
* @param maxPageCount the maximum number of pages to cache (the oldest pages are purged when the cache is full).
|
|
31
|
+
*/
|
|
32
|
+
constructor(fileStorage: FileStorage, fileName: string, fileSize: ALong, pageSize: int32, maxPageCount: int32);
|
|
33
|
+
/**
|
|
34
|
+
* FileStorage method.
|
|
35
|
+
*/
|
|
36
|
+
close(): void;
|
|
37
|
+
/**
|
|
38
|
+
* FileStorage method.
|
|
39
|
+
*/
|
|
40
|
+
getFileLength(fileName: string): Promise<ALong>;
|
|
41
|
+
/**
|
|
42
|
+
* FileStorage method.
|
|
43
|
+
*/
|
|
44
|
+
readFileParts(fileName: string, ranges: AList<FileRange>): Promise<AList<FileContent>>;
|
|
45
|
+
/**
|
|
46
|
+
* FileStorage method.
|
|
47
|
+
*/
|
|
48
|
+
readFilePart(fileName: string, offset: ALong, size: int32): Promise<ABuffer>;
|
|
49
|
+
/**
|
|
50
|
+
* FileStorage method.
|
|
51
|
+
*/
|
|
52
|
+
printStatistics(clear: boolean): void;
|
|
53
|
+
}
|
|
54
|
+
export {};
|
|
55
55
|
//# sourceMappingURL=PageCachedFile.d.ts.map
|
|
@@ -1,162 +1,162 @@
|
|
|
1
|
-
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
/** @packageDocumentation
|
|
6
|
-
* @module OrbitGT
|
|
7
|
-
*/
|
|
8
|
-
import { ABuffer } from "../buffer/ABuffer";
|
|
9
|
-
import { AList } from "../collection/AList";
|
|
10
|
-
import { StringMap } from "../collection/StringMap";
|
|
11
|
-
import { ALong } from "../runtime/ALong";
|
|
12
|
-
import { ASystem } from "../runtime/ASystem";
|
|
13
|
-
import { Message } from "../runtime/Message";
|
|
14
|
-
import { CacheList } from "./CacheList";
|
|
15
|
-
import { FileContent } from "./FileContent";
|
|
16
|
-
import { FileRange } from "./FileRange";
|
|
17
|
-
import { FileStorage } from "./FileStorage";
|
|
18
|
-
/**
|
|
19
|
-
* Class PageCachedFile defines a paged content cache of a single file.
|
|
20
|
-
*/
|
|
21
|
-
/** @internal */
|
|
22
|
-
export class PageCachedFile extends FileStorage {
|
|
23
|
-
/**
|
|
24
|
-
* Create a new cached file.
|
|
25
|
-
* @param fileStorage the underlying file storage.
|
|
26
|
-
* @param fileName the name of the file to cache.
|
|
27
|
-
* @param fileSize the length of the file to cache.
|
|
28
|
-
* @param pageSize the byte size of a cache page (common sizes are 32768, 65536, 131072 or 262144).
|
|
29
|
-
* @param maxPageCount the maximum number of pages to cache (the oldest pages are purged when the cache is full).
|
|
30
|
-
*/
|
|
31
|
-
constructor(fileStorage, fileName, fileSize, pageSize, maxPageCount) {
|
|
32
|
-
super();
|
|
33
|
-
this._fileStorage = fileStorage;
|
|
34
|
-
this._fileName = fileName;
|
|
35
|
-
this._fileSize = fileSize;
|
|
36
|
-
this._pageSize = pageSize;
|
|
37
|
-
this._pageCount = fileSize.subInt(1).divInt(this._pageSize).addInt(1).toInt();
|
|
38
|
-
this._contentCache = new CacheList(maxPageCount);
|
|
39
|
-
this._requestCount = 0;
|
|
40
|
-
this._requestSize = 0;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* FileStorage method.
|
|
44
|
-
*/
|
|
45
|
-
close() {
|
|
46
|
-
this._fileStorage.close(); // deep close
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* FileStorage method.
|
|
50
|
-
*/
|
|
51
|
-
async getFileLength(fileName) {
|
|
52
|
-
return this._fileSize;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* FileStorage method.
|
|
56
|
-
*/
|
|
57
|
-
async readFileParts(fileName, ranges) {
|
|
58
|
-
/* Define the set of pages we need to fulfill the request */
|
|
59
|
-
const pageMap = new StringMap();
|
|
60
|
-
/* Create a list of missing pages */
|
|
61
|
-
const missingPages = new AList();
|
|
62
|
-
const missingKeys = new AList();
|
|
63
|
-
for (let r = 0; r < ranges.size(); r++) {
|
|
64
|
-
/* Scan the needed pages of the next range */
|
|
65
|
-
const range = ranges.get(r);
|
|
66
|
-
const page0 = range.offset.divInt(this._pageSize).toInt();
|
|
67
|
-
const page1 = range.offset.addInt(range.size - 1).divInt(this._pageSize).toInt() + 1; // exclusive
|
|
68
|
-
for (let i = page0; i < page1; i++) {
|
|
69
|
-
/* Try to get the page from the cache */
|
|
70
|
-
const pageKey = (`${i}`);
|
|
71
|
-
const page = this._contentCache.findEntry(pageKey);
|
|
72
|
-
if (page == null) {
|
|
73
|
-
/* Do not request the same page twice */
|
|
74
|
-
if (missingKeys.contains(pageKey) == false) {
|
|
75
|
-
/* Add a request to read the missing page */
|
|
76
|
-
const pageOffset0 = ALong.fromInt(this._pageSize).mulInt(i);
|
|
77
|
-
const pageOffset1 = ALong.min(pageOffset0.addInt(this._pageSize), this._fileSize);
|
|
78
|
-
const pageSize = pageOffset1.sub(pageOffset0).toInt();
|
|
79
|
-
missingPages.add(new FileRange(pageOffset0, pageSize));
|
|
80
|
-
missingKeys.add(pageKey);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
else {
|
|
84
|
-
/* Keep */
|
|
85
|
-
pageMap.set(pageKey, page);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
/* Do we have to load missing pages? */
|
|
90
|
-
if (missingPages.size() > 0) {
|
|
91
|
-
/* Load all missing pages with one call to the storage */
|
|
92
|
-
Message.log(`Requesting ${missingPages.size()} missing cache pages for '${this._fileName}'`);
|
|
93
|
-
const loadedPages = await this._fileStorage.readFileParts(fileName, missingPages);
|
|
94
|
-
/* Add to the cache for reuse */
|
|
95
|
-
for (let i = 0; i < loadedPages.size(); i++) {
|
|
96
|
-
const pageKey = missingKeys.get(i);
|
|
97
|
-
const pageContent = loadedPages.get(i);
|
|
98
|
-
this._contentCache.addEntry(pageKey, pageContent.content);
|
|
99
|
-
pageMap.set(pageKey, pageContent.content);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
/* Create the responses from the cached content */
|
|
103
|
-
const responseList = new AList();
|
|
104
|
-
for (let r = 0; r < ranges.size(); r++) {
|
|
105
|
-
/* Create the response for the next range */
|
|
106
|
-
const range = ranges.get(r);
|
|
107
|
-
const rangeExtent = range.offset.addInt(range.size);
|
|
108
|
-
const response = new ABuffer(range.size);
|
|
109
|
-
let responseOffset = 0;
|
|
110
|
-
this._requestCount++;
|
|
111
|
-
this._requestSize += range.size;
|
|
112
|
-
/* Scan the needed pages */
|
|
113
|
-
const page0 = range.offset.divInt(this._pageSize).toInt();
|
|
114
|
-
const page1 = range.offset.addInt(range.size - 1).divInt(this._pageSize).toInt() + 1; // exclusive
|
|
115
|
-
for (let i = page0; i < page1; i++) {
|
|
116
|
-
/* Get the next page from the cache */
|
|
117
|
-
const pageKey = (`${i}`);
|
|
118
|
-
const page = pageMap.get(pageKey);
|
|
119
|
-
ASystem.assertNot(page == null, `Missing cache page ${pageKey}`);
|
|
120
|
-
/* Get the extent of the page */
|
|
121
|
-
const pageOffset0 = ALong.fromInt(this._pageSize).mulInt(i);
|
|
122
|
-
const pageOffset1 = ALong.min(pageOffset0.addInt(this._pageSize), this._fileSize);
|
|
123
|
-
/* Copy the overlapping part of the page to the response */
|
|
124
|
-
const currentOffset = range.offset.addInt(responseOffset);
|
|
125
|
-
const copyOffset = currentOffset.sub(pageOffset0).toInt();
|
|
126
|
-
const copySize = ALong.min(pageOffset1, rangeExtent).sub(currentOffset).toInt();
|
|
127
|
-
ABuffer.arrayCopy(page, copyOffset, response, responseOffset, copySize);
|
|
128
|
-
responseOffset += copySize;
|
|
129
|
-
}
|
|
130
|
-
/* Add the response to the list */
|
|
131
|
-
ASystem.assertNot(responseOffset != range.size, `Expected ${range.size} response size, not ${responseOffset}`);
|
|
132
|
-
responseList.add(new FileContent(range.offset, response));
|
|
133
|
-
}
|
|
134
|
-
return responseList;
|
|
135
|
-
}
|
|
136
|
-
/**
|
|
137
|
-
* FileStorage method.
|
|
138
|
-
*/
|
|
139
|
-
async readFilePart(fileName, offset, size) {
|
|
140
|
-
const ranges = new AList();
|
|
141
|
-
ranges.add(new FileRange(offset, size));
|
|
142
|
-
const reponses = await this.readFileParts(fileName, ranges);
|
|
143
|
-
const reponse = reponses.get(0);
|
|
144
|
-
return reponse.content;
|
|
145
|
-
}
|
|
146
|
-
/**
|
|
147
|
-
* FileStorage method.
|
|
148
|
-
*/
|
|
149
|
-
printStatistics(clear) {
|
|
150
|
-
Message.log(`Page cache of file '${this._fileName}':`);
|
|
151
|
-
Message.log(`Request count is ${this._requestCount}`);
|
|
152
|
-
Message.log(`Request size is ${this._requestSize}`);
|
|
153
|
-
Message.log(`Cache hit count is ${this._contentCache.hitCount}`);
|
|
154
|
-
Message.log(`Cache miss count is ${this._contentCache.missCount}`);
|
|
155
|
-
if (clear)
|
|
156
|
-
this._contentCache.hitCount = 0;
|
|
157
|
-
if (clear)
|
|
158
|
-
this._contentCache.missCount = 0;
|
|
159
|
-
this._fileStorage.printStatistics(clear);
|
|
160
|
-
}
|
|
161
|
-
}
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
/** @packageDocumentation
|
|
6
|
+
* @module OrbitGT
|
|
7
|
+
*/
|
|
8
|
+
import { ABuffer } from "../buffer/ABuffer";
|
|
9
|
+
import { AList } from "../collection/AList";
|
|
10
|
+
import { StringMap } from "../collection/StringMap";
|
|
11
|
+
import { ALong } from "../runtime/ALong";
|
|
12
|
+
import { ASystem } from "../runtime/ASystem";
|
|
13
|
+
import { Message } from "../runtime/Message";
|
|
14
|
+
import { CacheList } from "./CacheList";
|
|
15
|
+
import { FileContent } from "./FileContent";
|
|
16
|
+
import { FileRange } from "./FileRange";
|
|
17
|
+
import { FileStorage } from "./FileStorage";
|
|
18
|
+
/**
|
|
19
|
+
* Class PageCachedFile defines a paged content cache of a single file.
|
|
20
|
+
*/
|
|
21
|
+
/** @internal */
|
|
22
|
+
export class PageCachedFile extends FileStorage {
|
|
23
|
+
/**
|
|
24
|
+
* Create a new cached file.
|
|
25
|
+
* @param fileStorage the underlying file storage.
|
|
26
|
+
* @param fileName the name of the file to cache.
|
|
27
|
+
* @param fileSize the length of the file to cache.
|
|
28
|
+
* @param pageSize the byte size of a cache page (common sizes are 32768, 65536, 131072 or 262144).
|
|
29
|
+
* @param maxPageCount the maximum number of pages to cache (the oldest pages are purged when the cache is full).
|
|
30
|
+
*/
|
|
31
|
+
constructor(fileStorage, fileName, fileSize, pageSize, maxPageCount) {
|
|
32
|
+
super();
|
|
33
|
+
this._fileStorage = fileStorage;
|
|
34
|
+
this._fileName = fileName;
|
|
35
|
+
this._fileSize = fileSize;
|
|
36
|
+
this._pageSize = pageSize;
|
|
37
|
+
this._pageCount = fileSize.subInt(1).divInt(this._pageSize).addInt(1).toInt();
|
|
38
|
+
this._contentCache = new CacheList(maxPageCount);
|
|
39
|
+
this._requestCount = 0;
|
|
40
|
+
this._requestSize = 0;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* FileStorage method.
|
|
44
|
+
*/
|
|
45
|
+
close() {
|
|
46
|
+
this._fileStorage.close(); // deep close
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* FileStorage method.
|
|
50
|
+
*/
|
|
51
|
+
async getFileLength(fileName) {
|
|
52
|
+
return this._fileSize;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* FileStorage method.
|
|
56
|
+
*/
|
|
57
|
+
async readFileParts(fileName, ranges) {
|
|
58
|
+
/* Define the set of pages we need to fulfill the request */
|
|
59
|
+
const pageMap = new StringMap();
|
|
60
|
+
/* Create a list of missing pages */
|
|
61
|
+
const missingPages = new AList();
|
|
62
|
+
const missingKeys = new AList();
|
|
63
|
+
for (let r = 0; r < ranges.size(); r++) {
|
|
64
|
+
/* Scan the needed pages of the next range */
|
|
65
|
+
const range = ranges.get(r);
|
|
66
|
+
const page0 = range.offset.divInt(this._pageSize).toInt();
|
|
67
|
+
const page1 = range.offset.addInt(range.size - 1).divInt(this._pageSize).toInt() + 1; // exclusive
|
|
68
|
+
for (let i = page0; i < page1; i++) {
|
|
69
|
+
/* Try to get the page from the cache */
|
|
70
|
+
const pageKey = (`${i}`);
|
|
71
|
+
const page = this._contentCache.findEntry(pageKey);
|
|
72
|
+
if (page == null) {
|
|
73
|
+
/* Do not request the same page twice */
|
|
74
|
+
if (missingKeys.contains(pageKey) == false) {
|
|
75
|
+
/* Add a request to read the missing page */
|
|
76
|
+
const pageOffset0 = ALong.fromInt(this._pageSize).mulInt(i);
|
|
77
|
+
const pageOffset1 = ALong.min(pageOffset0.addInt(this._pageSize), this._fileSize);
|
|
78
|
+
const pageSize = pageOffset1.sub(pageOffset0).toInt();
|
|
79
|
+
missingPages.add(new FileRange(pageOffset0, pageSize));
|
|
80
|
+
missingKeys.add(pageKey);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
/* Keep */
|
|
85
|
+
pageMap.set(pageKey, page);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
/* Do we have to load missing pages? */
|
|
90
|
+
if (missingPages.size() > 0) {
|
|
91
|
+
/* Load all missing pages with one call to the storage */
|
|
92
|
+
Message.log(`Requesting ${missingPages.size()} missing cache pages for '${this._fileName}'`);
|
|
93
|
+
const loadedPages = await this._fileStorage.readFileParts(fileName, missingPages);
|
|
94
|
+
/* Add to the cache for reuse */
|
|
95
|
+
for (let i = 0; i < loadedPages.size(); i++) {
|
|
96
|
+
const pageKey = missingKeys.get(i);
|
|
97
|
+
const pageContent = loadedPages.get(i);
|
|
98
|
+
this._contentCache.addEntry(pageKey, pageContent.content);
|
|
99
|
+
pageMap.set(pageKey, pageContent.content);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
/* Create the responses from the cached content */
|
|
103
|
+
const responseList = new AList();
|
|
104
|
+
for (let r = 0; r < ranges.size(); r++) {
|
|
105
|
+
/* Create the response for the next range */
|
|
106
|
+
const range = ranges.get(r);
|
|
107
|
+
const rangeExtent = range.offset.addInt(range.size);
|
|
108
|
+
const response = new ABuffer(range.size);
|
|
109
|
+
let responseOffset = 0;
|
|
110
|
+
this._requestCount++;
|
|
111
|
+
this._requestSize += range.size;
|
|
112
|
+
/* Scan the needed pages */
|
|
113
|
+
const page0 = range.offset.divInt(this._pageSize).toInt();
|
|
114
|
+
const page1 = range.offset.addInt(range.size - 1).divInt(this._pageSize).toInt() + 1; // exclusive
|
|
115
|
+
for (let i = page0; i < page1; i++) {
|
|
116
|
+
/* Get the next page from the cache */
|
|
117
|
+
const pageKey = (`${i}`);
|
|
118
|
+
const page = pageMap.get(pageKey);
|
|
119
|
+
ASystem.assertNot(page == null, `Missing cache page ${pageKey}`);
|
|
120
|
+
/* Get the extent of the page */
|
|
121
|
+
const pageOffset0 = ALong.fromInt(this._pageSize).mulInt(i);
|
|
122
|
+
const pageOffset1 = ALong.min(pageOffset0.addInt(this._pageSize), this._fileSize);
|
|
123
|
+
/* Copy the overlapping part of the page to the response */
|
|
124
|
+
const currentOffset = range.offset.addInt(responseOffset);
|
|
125
|
+
const copyOffset = currentOffset.sub(pageOffset0).toInt();
|
|
126
|
+
const copySize = ALong.min(pageOffset1, rangeExtent).sub(currentOffset).toInt();
|
|
127
|
+
ABuffer.arrayCopy(page, copyOffset, response, responseOffset, copySize);
|
|
128
|
+
responseOffset += copySize;
|
|
129
|
+
}
|
|
130
|
+
/* Add the response to the list */
|
|
131
|
+
ASystem.assertNot(responseOffset != range.size, `Expected ${range.size} response size, not ${responseOffset}`);
|
|
132
|
+
responseList.add(new FileContent(range.offset, response));
|
|
133
|
+
}
|
|
134
|
+
return responseList;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* FileStorage method.
|
|
138
|
+
*/
|
|
139
|
+
async readFilePart(fileName, offset, size) {
|
|
140
|
+
const ranges = new AList();
|
|
141
|
+
ranges.add(new FileRange(offset, size));
|
|
142
|
+
const reponses = await this.readFileParts(fileName, ranges);
|
|
143
|
+
const reponse = reponses.get(0);
|
|
144
|
+
return reponse.content;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* FileStorage method.
|
|
148
|
+
*/
|
|
149
|
+
printStatistics(clear) {
|
|
150
|
+
Message.log(`Page cache of file '${this._fileName}':`);
|
|
151
|
+
Message.log(`Request count is ${this._requestCount}`);
|
|
152
|
+
Message.log(`Request size is ${this._requestSize}`);
|
|
153
|
+
Message.log(`Cache hit count is ${this._contentCache.hitCount}`);
|
|
154
|
+
Message.log(`Cache miss count is ${this._contentCache.missCount}`);
|
|
155
|
+
if (clear)
|
|
156
|
+
this._contentCache.hitCount = 0;
|
|
157
|
+
if (clear)
|
|
158
|
+
this._contentCache.missCount = 0;
|
|
159
|
+
this._fileStorage.printStatistics(clear);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
162
|
//# sourceMappingURL=PageCachedFile.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageCachedFile.js","sourceRoot":"","sources":["../../../../src/system/storage/PageCachedFile.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAUH,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C;;GAEG;AACH,gBAAgB;AAChB,MAAM,OAAO,cAAe,SAAQ,WAAW;IAW9C;;;;;;;OAOG;IACH,YAAmB,WAAwB,EAAE,QAAgB,EAAE,QAAe,EAAE,QAAe,EAAE,YAAmB;QACnH,KAAK,EAAE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G,CAAC,CAAC;QAC3C,IAAI,KAAK;YAAE,IAAI,CAAC,aAAa,CAAC,SAAS,GAAG,CAAC,CAAC;QAC5C,IAAI,CAAC,YAAY,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IAC1C,CAAC;CACD","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module OrbitGT\r\n */\r\n\r\n// package orbitgt.system.storage;\r\n\r\ntype int8 = number;\r\ntype int16 = number;\r\ntype int32 = number;\r\ntype float32 = number;\r\ntype float64 = number;\r\n\r\nimport { ABuffer } from \"../buffer/ABuffer\";\r\nimport { AList } from \"../collection/AList\";\r\nimport { StringMap } from \"../collection/StringMap\";\r\nimport { ALong } from \"../runtime/ALong\";\r\nimport { ASystem } from \"../runtime/ASystem\";\r\nimport { Message } from \"../runtime/Message\";\r\nimport { CacheList } from \"./CacheList\";\r\nimport { FileContent } from \"./FileContent\";\r\nimport { FileRange } from \"./FileRange\";\r\nimport { FileStorage } from \"./FileStorage\";\r\n\r\n/**\r\n * Class PageCachedFile defines a paged content cache of a single file.\r\n */\r\n/** @internal */\r\nexport class PageCachedFile extends FileStorage {\r\n\tprivate _fileStorage: FileStorage;\r\n\tprivate _fileName: string;\r\n\tprivate _fileSize: ALong;\r\n\tprivate _pageSize: int32;\r\n\tprivate _pageCount: int32;\r\n\r\n\tprivate _contentCache: CacheList<ABuffer>;\r\n\tprivate _requestCount: int32;\r\n\tprivate _requestSize: int32;\r\n\r\n\t/**\r\n\t * Create a new cached file.\r\n\t * @param fileStorage the underlying file storage.\r\n\t * @param fileName the name of the file to cache.\r\n\t * @param fileSize the length of the file to cache.\r\n\t * @param pageSize the byte size of a cache page (common sizes are 32768, 65536, 131072 or 262144).\r\n\t * @param maxPageCount the maximum number of pages to cache (the oldest pages are purged when the cache is full).\r\n\t */\r\n\tpublic constructor(fileStorage: FileStorage, fileName: string, fileSize: ALong, pageSize: int32, maxPageCount: int32) {\r\n\t\tsuper();\r\n\t\tthis._fileStorage = fileStorage;\r\n\t\tthis._fileName = fileName;\r\n\t\tthis._fileSize = fileSize;\r\n\t\tthis._pageSize = pageSize;\r\n\t\tthis._pageCount = fileSize.subInt(1).divInt(this._pageSize).addInt(1).toInt();\r\n\t\tthis._contentCache = new CacheList<ABuffer>(maxPageCount);\r\n\t\tthis._requestCount = 0;\r\n\t\tthis._requestSize = 0;\r\n\t}\r\n\r\n\t/**\r\n\t * FileStorage method.\r\n\t */\r\n\tpublic override close(): void {\r\n\t\tthis._fileStorage.close(); // deep close\r\n\t}\r\n\r\n\t/**\r\n\t * FileStorage method.\r\n\t */\r\n\tpublic override async getFileLength(fileName: string): Promise<ALong> {\r\n\t\treturn this._fileSize;\r\n\t}\r\n\r\n\t/**\r\n\t * FileStorage method.\r\n\t */\r\n\tpublic override async readFileParts(fileName: string, ranges: AList<FileRange>): Promise<AList<FileContent>> {\r\n\t\t/* Define the set of pages we need to fulfill the request */\r\n\t\tconst pageMap: StringMap<ABuffer> = new StringMap<ABuffer>();\r\n\t\t/* Create a list of missing pages */\r\n\t\tconst missingPages: AList<FileRange> = new AList<FileRange>();\r\n\t\tconst missingKeys: AList<string> = new AList<string>();\r\n\t\tfor (let r: number = 0; r < ranges.size(); r++) {\r\n\t\t\t/* Scan the needed pages of the next range */\r\n\t\t\tconst range: FileRange = ranges.get(r);\r\n\t\t\tconst page0: int32 = range.offset.divInt(this._pageSize).toInt();\r\n\t\t\tconst page1: int32 = range.offset.addInt(range.size - 1).divInt(this._pageSize).toInt() + 1; // exclusive\r\n\t\t\tfor (let i: number = page0; i < page1; i++) {\r\n\t\t\t\t/* Try to get the page from the cache */\r\n\t\t\t\tconst pageKey: string = (`${i}`);\r\n\t\t\t\tconst page: ABuffer = this._contentCache.findEntry(pageKey);\r\n\t\t\t\tif (page == null) {\r\n\t\t\t\t\t/* Do not request the same page twice */\r\n\t\t\t\t\tif (missingKeys.contains(pageKey) == false) {\r\n\t\t\t\t\t\t/* Add a request to read the missing page */\r\n\t\t\t\t\t\tconst pageOffset0: ALong = ALong.fromInt(this._pageSize).mulInt(i);\r\n\t\t\t\t\t\tconst pageOffset1: ALong = ALong.min(pageOffset0.addInt(this._pageSize), this._fileSize);\r\n\t\t\t\t\t\tconst pageSize: int32 = pageOffset1.sub(pageOffset0).toInt();\r\n\t\t\t\t\t\tmissingPages.add(new FileRange(pageOffset0, pageSize));\r\n\t\t\t\t\t\tmissingKeys.add(pageKey);\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\t/* Keep */\r\n\t\t\t\t\tpageMap.set(pageKey, page);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t/* Do we have to load missing pages? */\r\n\t\tif (missingPages.size() > 0) {\r\n\t\t\t/* Load all missing pages with one call to the storage */\r\n\t\t\tMessage.log(`Requesting ${missingPages.size()} missing cache pages for '${this._fileName}'`);\r\n\t\t\tconst loadedPages: AList<FileContent> = await this._fileStorage.readFileParts(fileName, missingPages);\r\n\t\t\t/* Add to the cache for reuse */\r\n\t\t\tfor (let i: number = 0; i < loadedPages.size(); i++) {\r\n\t\t\t\tconst pageKey: string = missingKeys.get(i);\r\n\t\t\t\tconst pageContent: FileContent = loadedPages.get(i);\r\n\t\t\t\tthis._contentCache.addEntry(pageKey, pageContent.content);\r\n\t\t\t\tpageMap.set(pageKey, pageContent.content);\r\n\t\t\t}\r\n\t\t}\r\n\t\t/* Create the responses from the cached content */\r\n\t\tconst responseList: AList<FileContent> = new AList<FileContent>();\r\n\t\tfor (let r: number = 0; r < ranges.size(); r++) {\r\n\t\t\t/* Create the response for the next range */\r\n\t\t\tconst range: FileRange = ranges.get(r);\r\n\t\t\tconst rangeExtent: ALong = range.offset.addInt(range.size);\r\n\t\t\tconst response: ABuffer = new ABuffer(range.size);\r\n\t\t\tlet responseOffset: int32 = 0;\r\n\t\t\tthis._requestCount++;\r\n\t\t\tthis._requestSize += range.size;\r\n\t\t\t/* Scan the needed pages */\r\n\t\t\tconst page0: int32 = range.offset.divInt(this._pageSize).toInt();\r\n\t\t\tconst page1: int32 = range.offset.addInt(range.size - 1).divInt(this._pageSize).toInt() + 1; // exclusive\r\n\t\t\tfor (let i: number = page0; i < page1; i++) {\r\n\t\t\t\t/* Get the next page from the cache */\r\n\t\t\t\tconst pageKey: string = (`${i}`);\r\n\t\t\t\tconst page: ABuffer = pageMap.get(pageKey);\r\n\t\t\t\tASystem.assertNot(page == null, `Missing cache page ${pageKey}`);\r\n\t\t\t\t/* Get the extent of the page */\r\n\t\t\t\tconst pageOffset0: ALong = ALong.fromInt(this._pageSize).mulInt(i);\r\n\t\t\t\tconst pageOffset1: ALong = ALong.min(pageOffset0.addInt(this._pageSize), this._fileSize);\r\n\t\t\t\t/* Copy the overlapping part of the page to the response */\r\n\t\t\t\tconst currentOffset: ALong = range.offset.addInt(responseOffset);\r\n\t\t\t\tconst copyOffset: int32 = currentOffset.sub(pageOffset0).toInt();\r\n\t\t\t\tconst copySize: int32 = ALong.min(pageOffset1, rangeExtent).sub(currentOffset).toInt();\r\n\t\t\t\tABuffer.arrayCopy(page, copyOffset, response, responseOffset, copySize);\r\n\t\t\t\tresponseOffset += copySize;\r\n\t\t\t}\r\n\t\t\t/* Add the response to the list */\r\n\t\t\tASystem.assertNot(responseOffset != range.size, `Expected ${range.size} response size, not ${responseOffset}`);\r\n\t\t\tresponseList.add(new FileContent(range.offset, response));\r\n\t\t}\r\n\t\treturn responseList;\r\n\t}\r\n\r\n\t/**\r\n\t * FileStorage method.\r\n\t */\r\n\tpublic override async readFilePart(fileName: string, offset: ALong, size: int32): Promise<ABuffer> {\r\n\t\tconst ranges: AList<FileRange> = new AList<FileRange>();\r\n\t\tranges.add(new FileRange(offset, size));\r\n\t\tconst reponses: AList<FileContent> = await this.readFileParts(fileName, ranges);\r\n\t\tconst reponse: FileContent = reponses.get(0);\r\n\t\treturn reponse.content;\r\n\t}\r\n\r\n\t/**\r\n\t * FileStorage method.\r\n\t */\r\n\tpublic override printStatistics(clear: boolean): void {\r\n\t\tMessage.log(`Page cache of file '${this._fileName}':`);\r\n\t\tMessage.log(`Request count is ${this._requestCount}`);\r\n\t\tMessage.log(`Request size is ${this._requestSize}`);\r\n\t\tMessage.log(`Cache hit count is ${this._contentCache.hitCount}`);\r\n\t\tMessage.log(`Cache miss count is ${this._contentCache.missCount}`);\r\n\t\tif (clear) this._contentCache.hitCount = 0;\r\n\t\tif (clear) this._contentCache.missCount = 0;\r\n\t\tthis._fileStorage.printStatistics(clear);\r\n\t}\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"PageCachedFile.js","sourceRoot":"","sources":["../../../../src/system/storage/PageCachedFile.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAUH,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C;;GAEG;AACH,gBAAgB;AAChB,MAAM,OAAO,cAAe,SAAQ,WAAW;IAW9C;;;;;;;OAOG;IACH,YAAmB,WAAwB,EAAE,QAAgB,EAAE,QAAe,EAAE,QAAe,EAAE,YAAmB;QACnH,KAAK,EAAE,CAAC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C,CAAC;QAC3C,IAAI,KAAK;YAAE,IAAI,CAAC,aAAa,CAAC,SAAS,GAAG,CAAC,CAAC;QAC5C,IAAI,CAAC,YAAY,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IAC1C,CAAC;CACD","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module OrbitGT\n */\n\n// package orbitgt.system.storage;\n\ntype int8 = number;\ntype int16 = number;\ntype int32 = number;\ntype float32 = number;\ntype float64 = number;\n\nimport { ABuffer } from \"../buffer/ABuffer\";\nimport { AList } from \"../collection/AList\";\nimport { StringMap } from \"../collection/StringMap\";\nimport { ALong } from \"../runtime/ALong\";\nimport { ASystem } from \"../runtime/ASystem\";\nimport { Message } from \"../runtime/Message\";\nimport { CacheList } from \"./CacheList\";\nimport { FileContent } from \"./FileContent\";\nimport { FileRange } from \"./FileRange\";\nimport { FileStorage } from \"./FileStorage\";\n\n/**\n * Class PageCachedFile defines a paged content cache of a single file.\n */\n/** @internal */\nexport class PageCachedFile extends FileStorage {\n\tprivate _fileStorage: FileStorage;\n\tprivate _fileName: string;\n\tprivate _fileSize: ALong;\n\tprivate _pageSize: int32;\n\tprivate _pageCount: int32;\n\n\tprivate _contentCache: CacheList<ABuffer>;\n\tprivate _requestCount: int32;\n\tprivate _requestSize: int32;\n\n\t/**\n\t * Create a new cached file.\n\t * @param fileStorage the underlying file storage.\n\t * @param fileName the name of the file to cache.\n\t * @param fileSize the length of the file to cache.\n\t * @param pageSize the byte size of a cache page (common sizes are 32768, 65536, 131072 or 262144).\n\t * @param maxPageCount the maximum number of pages to cache (the oldest pages are purged when the cache is full).\n\t */\n\tpublic constructor(fileStorage: FileStorage, fileName: string, fileSize: ALong, pageSize: int32, maxPageCount: int32) {\n\t\tsuper();\n\t\tthis._fileStorage = fileStorage;\n\t\tthis._fileName = fileName;\n\t\tthis._fileSize = fileSize;\n\t\tthis._pageSize = pageSize;\n\t\tthis._pageCount = fileSize.subInt(1).divInt(this._pageSize).addInt(1).toInt();\n\t\tthis._contentCache = new CacheList<ABuffer>(maxPageCount);\n\t\tthis._requestCount = 0;\n\t\tthis._requestSize = 0;\n\t}\n\n\t/**\n\t * FileStorage method.\n\t */\n\tpublic override close(): void {\n\t\tthis._fileStorage.close(); // deep close\n\t}\n\n\t/**\n\t * FileStorage method.\n\t */\n\tpublic override async getFileLength(fileName: string): Promise<ALong> {\n\t\treturn this._fileSize;\n\t}\n\n\t/**\n\t * FileStorage method.\n\t */\n\tpublic override async readFileParts(fileName: string, ranges: AList<FileRange>): Promise<AList<FileContent>> {\n\t\t/* Define the set of pages we need to fulfill the request */\n\t\tconst pageMap: StringMap<ABuffer> = new StringMap<ABuffer>();\n\t\t/* Create a list of missing pages */\n\t\tconst missingPages: AList<FileRange> = new AList<FileRange>();\n\t\tconst missingKeys: AList<string> = new AList<string>();\n\t\tfor (let r: number = 0; r < ranges.size(); r++) {\n\t\t\t/* Scan the needed pages of the next range */\n\t\t\tconst range: FileRange = ranges.get(r);\n\t\t\tconst page0: int32 = range.offset.divInt(this._pageSize).toInt();\n\t\t\tconst page1: int32 = range.offset.addInt(range.size - 1).divInt(this._pageSize).toInt() + 1; // exclusive\n\t\t\tfor (let i: number = page0; i < page1; i++) {\n\t\t\t\t/* Try to get the page from the cache */\n\t\t\t\tconst pageKey: string = (`${i}`);\n\t\t\t\tconst page: ABuffer = this._contentCache.findEntry(pageKey);\n\t\t\t\tif (page == null) {\n\t\t\t\t\t/* Do not request the same page twice */\n\t\t\t\t\tif (missingKeys.contains(pageKey) == false) {\n\t\t\t\t\t\t/* Add a request to read the missing page */\n\t\t\t\t\t\tconst pageOffset0: ALong = ALong.fromInt(this._pageSize).mulInt(i);\n\t\t\t\t\t\tconst pageOffset1: ALong = ALong.min(pageOffset0.addInt(this._pageSize), this._fileSize);\n\t\t\t\t\t\tconst pageSize: int32 = pageOffset1.sub(pageOffset0).toInt();\n\t\t\t\t\t\tmissingPages.add(new FileRange(pageOffset0, pageSize));\n\t\t\t\t\t\tmissingKeys.add(pageKey);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t/* Keep */\n\t\t\t\t\tpageMap.set(pageKey, page);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t/* Do we have to load missing pages? */\n\t\tif (missingPages.size() > 0) {\n\t\t\t/* Load all missing pages with one call to the storage */\n\t\t\tMessage.log(`Requesting ${missingPages.size()} missing cache pages for '${this._fileName}'`);\n\t\t\tconst loadedPages: AList<FileContent> = await this._fileStorage.readFileParts(fileName, missingPages);\n\t\t\t/* Add to the cache for reuse */\n\t\t\tfor (let i: number = 0; i < loadedPages.size(); i++) {\n\t\t\t\tconst pageKey: string = missingKeys.get(i);\n\t\t\t\tconst pageContent: FileContent = loadedPages.get(i);\n\t\t\t\tthis._contentCache.addEntry(pageKey, pageContent.content);\n\t\t\t\tpageMap.set(pageKey, pageContent.content);\n\t\t\t}\n\t\t}\n\t\t/* Create the responses from the cached content */\n\t\tconst responseList: AList<FileContent> = new AList<FileContent>();\n\t\tfor (let r: number = 0; r < ranges.size(); r++) {\n\t\t\t/* Create the response for the next range */\n\t\t\tconst range: FileRange = ranges.get(r);\n\t\t\tconst rangeExtent: ALong = range.offset.addInt(range.size);\n\t\t\tconst response: ABuffer = new ABuffer(range.size);\n\t\t\tlet responseOffset: int32 = 0;\n\t\t\tthis._requestCount++;\n\t\t\tthis._requestSize += range.size;\n\t\t\t/* Scan the needed pages */\n\t\t\tconst page0: int32 = range.offset.divInt(this._pageSize).toInt();\n\t\t\tconst page1: int32 = range.offset.addInt(range.size - 1).divInt(this._pageSize).toInt() + 1; // exclusive\n\t\t\tfor (let i: number = page0; i < page1; i++) {\n\t\t\t\t/* Get the next page from the cache */\n\t\t\t\tconst pageKey: string = (`${i}`);\n\t\t\t\tconst page: ABuffer = pageMap.get(pageKey);\n\t\t\t\tASystem.assertNot(page == null, `Missing cache page ${pageKey}`);\n\t\t\t\t/* Get the extent of the page */\n\t\t\t\tconst pageOffset0: ALong = ALong.fromInt(this._pageSize).mulInt(i);\n\t\t\t\tconst pageOffset1: ALong = ALong.min(pageOffset0.addInt(this._pageSize), this._fileSize);\n\t\t\t\t/* Copy the overlapping part of the page to the response */\n\t\t\t\tconst currentOffset: ALong = range.offset.addInt(responseOffset);\n\t\t\t\tconst copyOffset: int32 = currentOffset.sub(pageOffset0).toInt();\n\t\t\t\tconst copySize: int32 = ALong.min(pageOffset1, rangeExtent).sub(currentOffset).toInt();\n\t\t\t\tABuffer.arrayCopy(page, copyOffset, response, responseOffset, copySize);\n\t\t\t\tresponseOffset += copySize;\n\t\t\t}\n\t\t\t/* Add the response to the list */\n\t\t\tASystem.assertNot(responseOffset != range.size, `Expected ${range.size} response size, not ${responseOffset}`);\n\t\t\tresponseList.add(new FileContent(range.offset, response));\n\t\t}\n\t\treturn responseList;\n\t}\n\n\t/**\n\t * FileStorage method.\n\t */\n\tpublic override async readFilePart(fileName: string, offset: ALong, size: int32): Promise<ABuffer> {\n\t\tconst ranges: AList<FileRange> = new AList<FileRange>();\n\t\tranges.add(new FileRange(offset, size));\n\t\tconst reponses: AList<FileContent> = await this.readFileParts(fileName, ranges);\n\t\tconst reponse: FileContent = reponses.get(0);\n\t\treturn reponse.content;\n\t}\n\n\t/**\n\t * FileStorage method.\n\t */\n\tpublic override printStatistics(clear: boolean): void {\n\t\tMessage.log(`Page cache of file '${this._fileName}':`);\n\t\tMessage.log(`Request count is ${this._requestCount}`);\n\t\tMessage.log(`Request size is ${this._requestSize}`);\n\t\tMessage.log(`Cache hit count is ${this._contentCache.hitCount}`);\n\t\tMessage.log(`Cache miss count is ${this._contentCache.missCount}`);\n\t\tif (clear) this._contentCache.hitCount = 0;\n\t\tif (clear) this._contentCache.missCount = 0;\n\t\tthis._fileStorage.printStatistics(clear);\n\t}\n}\n"]}
|