gerlowskija commented on a change in pull request #120:
URL: https://github.com/apache/solr/pull/120#discussion_r667947282



##########
File path: solr/contrib/s3-repository/README.md
##########
@@ -0,0 +1,41 @@
+Apache Solr - S3 Repository
+===========================
+
+This S3 repository is a backup repository implementation designed to provide 
backup/restore functionality to Amazon S3.
+
+# Getting Started
+
+Add this to your `solr.xml`:
+
+    <backup>
+        <repository name="s3" class="org.apache.solr.s3.S3BackupRepository" 
default="false">
+            <str name="blob.s3.bucket.name">BUCKET_NAME</str>
+            <str name="blob.s3.region">us-west-2</str>
+        </repository>
+    </backup>
+
+This plugin uses the [default AWS credentials provider 
chain](https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/credentials.html),
 so ensure that your credentials are set appropriately (e.g., via env var, or 
in `~/.aws/credentials`, etc.).
+
+## Testing locally
+
+To run / test locally, first spin up S3Mock:
+
+    mkdir /tmp/s3
+    docker run -p 9090:9090 --env initialBuckets=TEST_BUCKET --env root=/data 
-v /tmp/s3:/data -t adobe/s3mock
+
+Add this to your `solr.xml`:
+
+    <backup>
+        <repository name="s3" class="org.apache.solr.s3.S3BackupRepository" 
default="false">
+            <str name="blob.s3.bucket.name">TEST_BUCKET</str>
+            <bool name="blob.s3.mock">true</bool>
+        </repository>
+    </backup>
+
+Start Solr, and create a collection (e.g., "foo"). Then hit the following URL, 
which will take a backup and persist it in S3Mock under the name `test`:

Review comment:
       [+1] This is pretty cool!  AFAIK GCS has no standalone mock/stub like 
this - it would've been really helpful in writing the GCS repository impl.

##########
File path: 
solr/contrib/s3-repository/src/java/org/apache/solr/s3/S3BackupRepository.java
##########
@@ -0,0 +1,339 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 org.apache.solr.s3;
+
+import com.google.common.base.Preconditions;
+import com.google.common.base.Strings;
+import org.apache.lucene.index.CorruptIndexException;
+import org.apache.lucene.store.Directory;
+import org.apache.lucene.store.IOContext;
+import org.apache.lucene.store.IndexInput;
+import org.apache.lucene.store.IndexOutput;
+import org.apache.solr.common.SolrException;
+import org.apache.solr.common.StringUtils;
+import org.apache.solr.common.util.NamedList;
+import org.apache.solr.core.backup.repository.BackupRepository;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.lang.invoke.MethodHandles;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.nio.file.Paths;
+import java.time.Duration;
+import java.time.Instant;
+import java.util.Collection;
+import java.util.Objects;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+/**
+ * A concrete implementation of {@link BackupRepository} interface supporting 
backup/restore of Solr indexes to a blob store like S3, GCS.

Review comment:
       [0] Is the mention of 'GCS' here just a holdover from when this was 
BlobRepository?  If so it should prob be removed.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to