Package org.apache.iceberg.gcp.gcs
Class GCSOutputFile
- java.lang.Object
-
- org.apache.iceberg.gcp.gcs.GCSOutputFile
-
- All Implemented Interfaces:
OutputFile
public class GCSOutputFile extends java.lang.Object implements OutputFile
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description PositionOutputStream
create()
Create an output stream for the specified location if the target object does not exist in GCS at the time of invocation.PositionOutputStream
createOrOverwrite()
Create a new file and return aPositionOutputStream
to it.boolean
exists()
static GCSOutputFile
fromLocation(java.lang.String location, com.google.cloud.storage.Storage storage, GCPProperties gcpProperties)
protected GCPProperties
gcpProperties()
protected com.google.cloud.storage.Blob
getBlob()
java.lang.String
location()
InputFile
toInputFile()
Return anInputFile
for the location of this output file.java.lang.String
toString()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.iceberg.io.OutputFile
location
-
-
-
-
Method Detail
-
fromLocation
public static GCSOutputFile fromLocation(java.lang.String location, com.google.cloud.storage.Storage storage, GCPProperties gcpProperties)
-
create
public PositionOutputStream create()
Create an output stream for the specified location if the target object does not exist in GCS at the time of invocation.- Specified by:
create
in interfaceOutputFile
- Returns:
- output stream
-
createOrOverwrite
public PositionOutputStream createOrOverwrite()
Description copied from interface:OutputFile
Create a new file and return aPositionOutputStream
to it.If the file already exists, this will not throw an exception and will replace the file.
- Specified by:
createOrOverwrite
in interfaceOutputFile
- Returns:
- an output stream that can report its position
-
toInputFile
public InputFile toInputFile()
Description copied from interface:OutputFile
Return anInputFile
for the location of this output file.- Specified by:
toInputFile
in interfaceOutputFile
- Returns:
- an input file for the location of this output file
-
location
public java.lang.String location()
-
gcpProperties
protected GCPProperties gcpProperties()
-
exists
public boolean exists()
-
getBlob
protected com.google.cloud.storage.Blob getBlob()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-