galenwarren commented on a change in pull request #15599:
URL: https://github.com/apache/flink/pull/15599#discussion_r633119344



##########
File path: 
flink-filesystems/flink-gs-fs-hadoop/src/main/java/org/apache/flink/fs/gs/storage/BlobStorage.java
##########
@@ -0,0 +1,120 @@
+/*
+ * 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.flink.fs.gs.storage;
+
+import com.google.cloud.storage.BlobId;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.Optional;
+
+/** Abstract blob storage, used to simplify interface to Google storage and 
make it mockable. */
+public interface BlobStorage {
+
+    /** Abstract blob metadata. */
+    interface BlobMetadata {
+
+        /**
+         * The crc32 checksum for the blob.
+         *
+         * @return The checksum
+         */
+        String getChecksum();
+    }
+
+    /** Abstract blob write channel. */
+    interface WriteChannel {
+
+        /**
+         * Sets the chunk size for upload.
+         *
+         * @param chunkSize The chunk size
+         */
+        void setChunkSize(int chunkSize);
+
+        /**
+         * Writes data to the channel.
+         *
+         * @param content The data buffer
+         * @param start Start offset in the data buffer
+         * @param length Number of bytes to write
+         * @return The number of bytes written
+         * @throws IOException On underlying failure
+         */
+        int write(byte[] content, int start, int length) throws IOException;
+
+        /**
+         * Closes the channel.
+         *
+         * @throws IOException On underlying failure
+         */
+        void close() throws IOException;
+    }
+
+    /**
+     * Creates a write channel.
+     *
+     * @param blobId The blob id to write
+     * @param uploadContentType The content type for the upload
+     * @return The WriteChannel helper
+     */
+    WriteChannel write(BlobId blobId, String uploadContentType);

Review comment:
       Done in 
[df17222](https://github.com/apache/flink/pull/15599/commits/df17222b8b4e1cea268da7589e8cb808535d7dd8).
   




-- 
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to