Package alluxio.client
Enum WriteType
- java.lang.Object
-
- java.lang.Enum<WriteType>
-
- alluxio.client.WriteType
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<WriteType>
@PublicApi @ThreadSafe public enum WriteType extends java.lang.Enum<WriteType>
Write types for creating a file in Alluxio.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ASYNC_THROUGH
[Experimental] Write the file asynchronously to the under fs.CACHE_THROUGH
Write the file synchronously to the under fs, and also try to write to the highest tier in a worker's Alluxio storage.MUST_CACHE
Write the file, guaranteeing the data is written to Alluxio storage or failing the operation.NONE
Do not store the data in Alluxio or Under Storage.THROUGH
Write the file synchronously to the under fs, skipping Alluxio storage.TRY_CACHE
Deprecated.This write type is deprecated as of v0.8 and not recommended for use.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static WriteType
fromProto(alluxio.grpc.WritePType writePType)
AlluxioStorageType
getAlluxioStorageType()
UnderStorageType
getUnderStorageType()
int
getValue()
boolean
isAsync()
boolean
isCache()
boolean
isThrough()
alluxio.grpc.WritePType
toProto()
static WriteType
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static WriteType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
MUST_CACHE
public static final WriteType MUST_CACHE
Write the file, guaranteeing the data is written to Alluxio storage or failing the operation. The data will be written to the highest tier in a worker's storage. Data will not be persisted to the under storage.
-
TRY_CACHE
@Deprecated public static final WriteType TRY_CACHE
Deprecated.This write type is deprecated as of v0.8 and not recommended for use. Use eitherMUST_CACHE
orCACHE_THROUGH
depending on your data persistence requirements.Write the file and try to cache it.
-
CACHE_THROUGH
public static final WriteType CACHE_THROUGH
Write the file synchronously to the under fs, and also try to write to the highest tier in a worker's Alluxio storage.
-
THROUGH
public static final WriteType THROUGH
Write the file synchronously to the under fs, skipping Alluxio storage.
-
ASYNC_THROUGH
public static final WriteType ASYNC_THROUGH
[Experimental] Write the file asynchronously to the under fs.
-
NONE
public static final WriteType NONE
Do not store the data in Alluxio or Under Storage. This write type should only be used for development testing.
-
-
Method Detail
-
values
public static WriteType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (WriteType c : WriteType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static WriteType valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
getAlluxioStorageType
public AlluxioStorageType getAlluxioStorageType()
- Returns:
- the
AlluxioStorageType
which is associated with this mode
-
getUnderStorageType
public UnderStorageType getUnderStorageType()
- Returns:
- the
UnderStorageType
which is associated with this mode
-
getValue
public int getValue()
- Returns:
- the value of the write type
-
isAsync
public boolean isAsync()
- Returns:
- true if by this write type data will be persisted asynchronously to under
storage (e.g.,
ASYNC_THROUGH
), false otherwise
-
isCache
public boolean isCache()
- Returns:
- true if by this write type data will be cached in Alluxio space (e.g.,
MUST_CACHE
,CACHE_THROUGH
,TRY_CACHE
, orASYNC_THROUGH
), false otherwise
-
isThrough
public boolean isThrough()
- Returns:
- true if by this write type data will be persisted synchronously to under
storage (e.g.,
CACHE_THROUGH
orTHROUGH
), false otherwise
-
fromProto
public static WriteType fromProto(alluxio.grpc.WritePType writePType)
- Parameters:
writePType
- proto type- Returns:
- wire type for given proto type
-
toProto
public alluxio.grpc.WritePType toProto()
- Returns:
- proto representation of this instance
-
-