Package alluxio.underfs.gcs
Class GCSOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- alluxio.underfs.gcs.GCSOutputStream
-
- All Implemented Interfaces:
alluxio.underfs.ContentHashable,java.io.Closeable,java.io.Flushable,java.lang.AutoCloseable
@NotThreadSafe public final class GCSOutputStream extends java.io.OutputStream implements alluxio.underfs.ContentHashableA stream for writing a file into GCS. The data will be persisted to a temporary directory on the local disk and copied as a complete file when theclose()method is called.
-
-
Constructor Summary
Constructors Constructor Description GCSOutputStream(java.lang.String bucketName, java.lang.String key, org.jets3t.service.impl.rest.httpclient.GoogleStorageService client, java.util.List<java.lang.String> tmpDirs)Constructs a new stream for writing a file.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidflush()java.util.Optional<java.lang.String>getContentHash()voidwrite(byte[] b)voidwrite(byte[] b, int off, int len)voidwrite(int b)
-
-
-
Constructor Detail
-
GCSOutputStream
public GCSOutputStream(java.lang.String bucketName, java.lang.String key, org.jets3t.service.impl.rest.httpclient.GoogleStorageService client, java.util.List<java.lang.String> tmpDirs) throws java.io.IOExceptionConstructs a new stream for writing a file.- Parameters:
bucketName- the name of the bucketkey- the key of the fileclient- the JetS3t clienttmpDirs- a list of temporary directories- Throws:
java.io.IOException
-
-
Method Detail
-
write
public void write(int b) throws java.io.IOException- Specified by:
writein classjava.io.OutputStream- Throws:
java.io.IOException
-
write
public void write(byte[] b) throws java.io.IOException- Overrides:
writein classjava.io.OutputStream- Throws:
java.io.IOException
-
write
public void write(byte[] b, int off, int len) throws java.io.IOException- Overrides:
writein classjava.io.OutputStream- Throws:
java.io.IOException
-
flush
public void flush() throws java.io.IOException- Specified by:
flushin interfacejava.io.Flushable- Overrides:
flushin classjava.io.OutputStream- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.io.OutputStream- Throws:
java.io.IOException
-
getContentHash
public java.util.Optional<java.lang.String> getContentHash()
- Specified by:
getContentHashin interfacealluxio.underfs.ContentHashable
-
-