Skip to content

Commit

Permalink
File Storage Engine Choice (#53)
Browse files Browse the repository at this point in the history
* Added associated document storage support to S3 by setting clusterStorageEngine:s3 and configuring an s3 block with s3BucketName and region
  • Loading branch information
millmanw authored Mar 3, 2022
1 parent 42bbb81 commit d51cced
Show file tree
Hide file tree
Showing 7 changed files with 551 additions and 2 deletions.
3 changes: 2 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ grpcVersion=1.43.2
protobufVersion=3.19.2
micronautVersion=3.2.3
okHttpVersion=4.9.3
gsonVersion=2.8.9
gsonVersion=2.8.9
amazonVersion=2.17.140
3 changes: 3 additions & 0 deletions zulia-server/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ val luceneVersion: String by project
val mongoDriverVersion: String by project
val protobufVersion: String by project
val micronautVersion: String by project
val amazonVersion: String by project

defaultTasks("build", "installDist")

Expand All @@ -30,6 +31,8 @@ dependencies {
api("org.mongodb:mongodb-driver-sync:$mongoDriverVersion")

api("org.apache.commons:commons-compress:1.20")
implementation(platform("software.amazon.awssdk:bom:$amazonVersion"))
implementation("software.amazon.awssdk:s3")

annotationProcessor(platform("io.micronaut:micronaut-bom:$micronautVersion"))
annotationProcessor("io.micronaut:micronaut-inject-java")
Expand Down
19 changes: 19 additions & 0 deletions zulia-server/src/main/java/io/zulia/server/config/ZuliaConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import io.zulia.server.config.cluster.MongoAuth;
import io.zulia.server.config.cluster.MongoServer;
import io.zulia.server.config.cluster.S3Config;
import jakarta.inject.Singleton;

import java.util.Collections;
Expand All @@ -13,6 +14,8 @@ public class ZuliaConfig {
private String dataPath = "data";
private boolean cluster = false;
private String clusterName = "zulia";
private String clusterStorageEngine = "gridfs";
private S3Config s3;
private List<MongoServer> mongoServers = Collections.singletonList(new MongoServer());
private MongoAuth mongoAuth;
private String serverAddress = null; //null means autodetect
Expand Down Expand Up @@ -85,4 +88,20 @@ public MongoAuth getMongoAuth() {
public void setMongoAuth(MongoAuth mongoAuth) {
this.mongoAuth = mongoAuth;
}

public String getClusterStorageEngine() {
return clusterStorageEngine;
}

public void setClusterStorageEngine(String clusterStorageEngine) {
this.clusterStorageEngine = clusterStorageEngine;
}

public S3Config getS3() {
return s3;
}

public void setS3(S3Config s3) {
this.s3 = s3;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package io.zulia.server.config.cluster;

public class S3Config {
private String s3BucketName;
private String region;

public String getS3BucketName() {
return s3BucketName;
}

public void setS3BucketName(String s3BucketName) {
this.s3BucketName = s3BucketName;
}

public String getRegion() {
return region;
}

public void setRegion(String region) {
this.region = region;
}
}
Loading

0 comments on commit d51cced

Please sign in to comment.