-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from VEuPathDB/object-stream
Add object stream APIs that will support lazy pagination
- Loading branch information
Showing
5 changed files
with
119 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
src/main/kotlin/org/veupathdb/lib/s3/s34k/objects/ObjectStream.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package org.veupathdb.lib.s3.s34k.objects | ||
|
||
import java.util.stream.Stream | ||
|
||
// TODO: Document me | ||
interface ObjectStream { | ||
|
||
// TODO: Document me | ||
fun stream(): Stream<S3Object> | ||
|
||
fun toObjectList(): ObjectList | ||
} |
15 changes: 15 additions & 0 deletions
15
src/main/kotlin/org/veupathdb/lib/s3/s34k/params/object/ObjectStreamAllParams.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package org.veupathdb.lib.s3.s34k.params.`object` | ||
|
||
import org.veupathdb.lib.s3.s34k.objects.ObjectStream | ||
import org.veupathdb.lib.s3.s34k.params.RegionRequestParams | ||
|
||
interface ObjectStreamAllParams : RegionRequestParams { | ||
|
||
/** | ||
* Callback that will be executed on successful completion of the S3 | ||
* operation. | ||
* | ||
* The callback will be passed an [ObjectStream] value. | ||
*/ | ||
var callback: ((objects: ObjectStream) -> Unit)? | ||
} |
24 changes: 24 additions & 0 deletions
24
src/main/kotlin/org/veupathdb/lib/s3/s34k/params/object/ObjectStreamParams.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package org.veupathdb.lib.s3.s34k.params.`object` | ||
|
||
import org.veupathdb.lib.s3.s34k.objects.ObjectContainer | ||
import org.veupathdb.lib.s3.s34k.objects.ObjectStream | ||
import org.veupathdb.lib.s3.s34k.params.RegionRequestParams | ||
|
||
interface ObjectStreamParams : RegionRequestParams { | ||
|
||
/** | ||
* Filtering prefix for the paths to return. | ||
* | ||
* If set to `null` or a blank string, this operation is the same as | ||
* [ObjectContainer.streamAll]. | ||
*/ | ||
var prefix: String? | ||
|
||
/** | ||
* Optional callback that will be executed on successful completion of the S3 | ||
* operation. | ||
* | ||
* This callback will be passed a stream of objects retrieved from the store. | ||
*/ | ||
var callback: ((ObjectStream) -> Unit)? | ||
} |