Package org.apache.heron.spi.utils
Class UploaderUtils
- java.lang.Object
-
- org.apache.heron.spi.utils.UploaderUtils
-
public final class UploaderUtils extends Object
Utility used by Uploader
-
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_FILENAME_EXTENSION
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
copyToOutputStream(String inFile, OutputStream out)
static String
generateFilename(String topologyName, String role)
Generate a unique filename to upload in the storage servicestatic String
generateFilename(String topologyName, String role, String tag, int version, String extension)
Generate a unique filename to upload in the storage service
-
-
-
Field Detail
-
DEFAULT_FILENAME_EXTENSION
public static final String DEFAULT_FILENAME_EXTENSION
- See Also:
- Constant Field Values
-
-
Method Detail
-
generateFilename
public static String generateFilename(String topologyName, String role)
Generate a unique filename to upload in the storage service- Parameters:
topologyName
- topology namerole
- role owns the topology- Returns:
- a unique filename
-
generateFilename
public static String generateFilename(String topologyName, String role, String tag, int version, String extension)
Generate a unique filename to upload in the storage service- Parameters:
topologyName
- topology namerole
- role owns the topologyversion
- version of the job, put 0 if not neededtag
- extra info to tag the fileextension
- file extension- Returns:
- a unique filename
-
copyToOutputStream
public static void copyToOutputStream(String inFile, OutputStream out) throws IOException
- Throws:
IOException
-
-