-
Notifications
You must be signed in to change notification settings - Fork 360
/
S3TileFeatureSpaceTimeSpec.scala
66 lines (59 loc) · 2.53 KB
/
S3TileFeatureSpaceTimeSpec.scala
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/*
* Copyright 2016 Azavea
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package geotrellis.spark.store.s3
import geotrellis.raster.{Tile, TileFeature}
import geotrellis.layer._
import geotrellis.store._
import geotrellis.store.index._
import geotrellis.store.s3._
import geotrellis.spark.store._
import geotrellis.spark.store.s3.testkit._
import geotrellis.spark._
import geotrellis.spark.testkit.io._
import geotrellis.spark.testkit.testfiles.TestTileFeatureFiles
import geotrellis.spark.testkit.TestEnvironment
import org.scalatest._
class S3TileFeatureSpaceTimeSpec
extends PersistenceSpec[SpaceTimeKey, TileFeature[Tile, Tile], TileLayerMetadata[SpaceTimeKey]]
with SpaceTimeKeyIndexMethods
with TestEnvironment
with TestTileFeatureFiles
with CoordinateSpaceTimeTileFeatureSpec
with LayerUpdateSpaceTimeTileFeatureSpec
with BeforeAndAfterAll {
lazy val bucket = "mock-bucket"
lazy val prefix = "catalog"
val client = MockS3Client()
S3TestUtils.cleanBucket(client, bucket)
registerAfterAll { () =>
S3TestUtils.cleanBucket(client, bucket)
}
S3ClientProducer.set(() => MockS3Client())
lazy val threads = 2
lazy val getS3Client = () => MockS3Client()
lazy val attributeStore = new S3AttributeStore(bucket, prefix, getS3Client)
lazy val rddReader = new S3RDDReader(getS3Client, threads)
lazy val rddWriter = new S3RDDWriter(getS3Client, threads)
lazy val reader = new S3LayerReader(attributeStore, getS3Client, threads)
lazy val writer = new S3LayerWriter(attributeStore, bucket, prefix, identity, getS3Client, threads)
lazy val deleter = new S3LayerDeleter(attributeStore, getS3Client)
lazy val copier = new S3LayerCopier(attributeStore, bucket, prefix, getS3Client)
lazy val creader = new S3CollectionLayerReader(attributeStore)
lazy val reindexer = GenericLayerReindexer[S3LayerHeader](attributeStore, reader, writer, deleter, copier)
lazy val mover = GenericLayerMover(copier, deleter)
lazy val tiles = new S3ValueReader(attributeStore, getS3Client)
lazy val sample = CoordinateSpaceTime
}