test_class.declarator: CANNOT_CREATE_THIS = "cannot-create-this"
test_class.modifier: private final static
test_class.original_string: private final static String CANNOT_CREATE_THIS = "cannot-create-this";
test_class.type: String
test_class.var_name: CANNOT_CREATE_THIS
test_class.declarator: blobUtilsTestDirectory
test_class.modifier: private
test_class.original_string: private File blobUtilsTestDirectory;
test_class.type: File
test_class.var_name: blobUtilsTestDirectory
test_class.file: flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobUtilsTest.java
test_class.identifier: BlobUtilsTest
test_case.body: @Test(expected = Exception.class)
  	public void testExceptionOnCreateStorageDirectoryFailure() {
  		// Should throw an Exception
  		BlobUtils.initStorageDirectory(new File(blobUtilsTestDirectory, CANNOT_CREATE_THIS).getAbsolutePath());
  	}
test_case.class_method_signature: BlobUtilsTest.testExceptionOnCreateStorageDirectoryFailure()
test_case.full_signature: @Test(expected = Exception.class) public void testExceptionOnCreateStorageDirectoryFailure()
test_case.identifier: testExceptionOnCreateStorageDirectoryFailure
test_case.invocations: initStorageDirectory getAbsolutePath
test_case.modifiers: @Test(expected = Exception.class) public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testExceptionOnCreateStorageDirectoryFailure()
focal_class.declarator: HASHING_ALGORITHM = "SHA-1"
focal_class.modifier: private static final
focal_class.original_string: private static final String HASHING_ALGORITHM = "SHA-1";
focal_class.type: String
focal_class.var_name: HASHING_ALGORITHM
focal_class.declarator: BLOB_FILE_PREFIX = "blob_"
focal_class.modifier: static final
focal_class.original_string: static final String BLOB_FILE_PREFIX = "blob_";
focal_class.type: String
focal_class.var_name: BLOB_FILE_PREFIX
focal_class.declarator: JOB_DIR_PREFIX = "job_"
focal_class.modifier: static final
focal_class.original_string: static final String JOB_DIR_PREFIX = "job_";
focal_class.type: String
focal_class.var_name: JOB_DIR_PREFIX
focal_class.declarator: DEFAULT_CHARSET = Charset.forName("utf-8")
focal_class.modifier: static final
focal_class.original_string: static final Charset DEFAULT_CHARSET = Charset.forName("utf-8");
focal_class.type: Charset
focal_class.var_name: DEFAULT_CHARSET
focal_class.file: flink-runtime/src/main/java/org/apache/flink/runtime/blob/BlobUtils.java
focal_class.identifier: BlobUtils
focal_class.class_method_signature: BlobUtils.initStorageDirectory(String storageDirectory)
focal_class.full_signature: static File initStorageDirectory(String storageDirectory)
focal_class.identifier: initStorageDirectory
focal_class.modifiers: static
focal_class.parameters: (String storageDirectory)
focal_class.return: File
focal_class.signature: File initStorageDirectory(String storageDirectory)
focal_class.class_method_signature: BlobUtils.getIncomingDirectory(File storageDir)
focal_class.full_signature: static File getIncomingDirectory(File storageDir)
focal_class.identifier: getIncomingDirectory
focal_class.modifiers: static
focal_class.parameters: (File storageDir)
focal_class.return: File
focal_class.signature: File getIncomingDirectory(File storageDir)
focal_class.class_method_signature: BlobUtils.getCacheDirectory(File storageDir)
focal_class.full_signature: private static File getCacheDirectory(File storageDir)
focal_class.identifier: getCacheDirectory
focal_class.modifiers: private static
focal_class.parameters: (File storageDir)
focal_class.return: File
focal_class.signature: File getCacheDirectory(File storageDir)
focal_class.class_method_signature: BlobUtils.getStorageLocation(File storageDir, BlobKey key)
focal_class.full_signature: static File getStorageLocation(File storageDir, BlobKey key)
focal_class.identifier: getStorageLocation
focal_class.modifiers: static
focal_class.parameters: (File storageDir, BlobKey key)
focal_class.return: File
focal_class.signature: File getStorageLocation(File storageDir, BlobKey key)
focal_class.class_method_signature: BlobUtils.getStorageLocation(File storageDir, JobID jobID, String key)
focal_class.full_signature: static File getStorageLocation(File storageDir, JobID jobID, String key)
focal_class.identifier: getStorageLocation
focal_class.modifiers: static
focal_class.parameters: (File storageDir, JobID jobID, String key)
focal_class.return: File
focal_class.signature: File getStorageLocation(File storageDir, JobID jobID, String key)
focal_class.class_method_signature: BlobUtils.getJobDirectory(File storageDir, JobID jobID)
focal_class.full_signature: private static File getJobDirectory(File storageDir, JobID jobID)
focal_class.identifier: getJobDirectory
focal_class.modifiers: private static
focal_class.parameters: (File storageDir, JobID jobID)
focal_class.return: File
focal_class.signature: File getJobDirectory(File storageDir, JobID jobID)
focal_class.class_method_signature: BlobUtils.encodeKey(String key)
focal_class.full_signature: static String encodeKey(String key)
focal_class.identifier: encodeKey
focal_class.modifiers: static
focal_class.parameters: (String key)
focal_class.return: String
focal_class.signature: String encodeKey(String key)
focal_class.class_method_signature: BlobUtils.deleteJobDirectory(File storageDir, JobID jobID)
focal_class.full_signature: static void deleteJobDirectory(File storageDir, JobID jobID)
focal_class.identifier: deleteJobDirectory
focal_class.modifiers: static
focal_class.parameters: (File storageDir, JobID jobID)
focal_class.return: void
focal_class.signature: void deleteJobDirectory(File storageDir, JobID jobID)
focal_class.class_method_signature: BlobUtils.createMessageDigest()
focal_class.full_signature: static MessageDigest createMessageDigest()
focal_class.identifier: createMessageDigest
focal_class.modifiers: static
focal_class.parameters: ()
focal_class.return: MessageDigest
focal_class.signature: MessageDigest createMessageDigest()
focal_class.class_method_signature: BlobUtils.addShutdownHook(final BlobService service, final Logger logger)
focal_class.full_signature: static Thread addShutdownHook(final BlobService service, final Logger logger)
focal_class.identifier: addShutdownHook
focal_class.modifiers: static
focal_class.parameters: (final BlobService service, final Logger logger)
focal_class.return: Thread
focal_class.signature: Thread addShutdownHook(final BlobService service, final Logger logger)
focal_class.class_method_signature: BlobUtils.writeLength(int length, OutputStream outputStream)
focal_class.full_signature: static void writeLength(int length, OutputStream outputStream)
focal_class.identifier: writeLength
focal_class.modifiers: static
focal_class.parameters: (int length, OutputStream outputStream)
focal_class.return: void
focal_class.signature: void writeLength(int length, OutputStream outputStream)
focal_class.class_method_signature: BlobUtils.readLength(InputStream inputStream)
focal_class.full_signature: static int readLength(InputStream inputStream)
focal_class.identifier: readLength
focal_class.modifiers: static
focal_class.parameters: (InputStream inputStream)
focal_class.return: int
focal_class.signature: int readLength(InputStream inputStream)
focal_class.class_method_signature: BlobUtils.readFully(InputStream inputStream, byte[] buf, int off, int len, String type)
focal_class.full_signature: static void readFully(InputStream inputStream, byte[] buf, int off, int len, String type)
focal_class.identifier: readFully
focal_class.modifiers: static
focal_class.parameters: (InputStream inputStream, byte[] buf, int off, int len, String type)
focal_class.return: void
focal_class.signature: void readFully(InputStream inputStream, byte[] buf, int off, int len, String type)
focal_class.class_method_signature: BlobUtils.closeSilently(Socket socket, Logger LOG)
focal_class.full_signature: static void closeSilently(Socket socket, Logger LOG)
focal_class.identifier: closeSilently
focal_class.modifiers: static
focal_class.parameters: (Socket socket, Logger LOG)
focal_class.return: void
focal_class.signature: void closeSilently(Socket socket, Logger LOG)
focal_class.class_method_signature: BlobUtils.getRecoveryPath(String basePath, BlobKey blobKey)
focal_class.full_signature: static String getRecoveryPath(String basePath, BlobKey blobKey)
focal_class.identifier: getRecoveryPath
focal_class.modifiers: static
focal_class.parameters: (String basePath, BlobKey blobKey)
focal_class.return: String
focal_class.signature: String getRecoveryPath(String basePath, BlobKey blobKey)
focal_class.class_method_signature: BlobUtils.getRecoveryPath(String basePath, JobID jobId, String key)
focal_class.full_signature: static String getRecoveryPath(String basePath, JobID jobId, String key)
focal_class.identifier: getRecoveryPath
focal_class.modifiers: static
focal_class.parameters: (String basePath, JobID jobId, String key)
focal_class.return: String
focal_class.signature: String getRecoveryPath(String basePath, JobID jobId, String key)
focal_class.class_method_signature: BlobUtils.getRecoveryPath(String basePath, JobID jobId)
focal_class.full_signature: static String getRecoveryPath(String basePath, JobID jobId)
focal_class.identifier: getRecoveryPath
focal_class.modifiers: static
focal_class.parameters: (String basePath, JobID jobId)
focal_class.return: String
focal_class.signature: String getRecoveryPath(String basePath, JobID jobId)
focal_class.class_method_signature: BlobUtils.copyFromRecoveryPath(String recoveryPath, File localBlobFile)
focal_class.full_signature: static void copyFromRecoveryPath(String recoveryPath, File localBlobFile)
focal_class.identifier: copyFromRecoveryPath
focal_class.modifiers: static
focal_class.parameters: (String recoveryPath, File localBlobFile)
focal_class.return: void
focal_class.signature: void copyFromRecoveryPath(String recoveryPath, File localBlobFile)
focal_class.class_method_signature: BlobUtils.BlobUtils()
focal_class.full_signature: private  BlobUtils()
focal_class.identifier: BlobUtils
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.signature:  BlobUtils()
focal_method.body: static File initStorageDirectory(String storageDirectory) {
  		File baseDir;
  		if (storageDirectory == null || storageDirectory.trim().isEmpty()) {
  			baseDir = new File(System.getProperty("java.io.tmpdir"));
  		}
  		else {
  			baseDir = new File(storageDirectory);
  		}
  
  		File storageDir;
  		final int MAX_ATTEMPTS = 10;
  		int attempt;
  
  		for(attempt = 0; attempt < MAX_ATTEMPTS; attempt++) {
  			storageDir = new File(baseDir, String.format(
  					"blobStore-%s", UUID.randomUUID().toString()));
  
  			// Create the storage dir if it doesn't exist. Only return it when the operation was
  			// successful.
  			if (!storageDir.exists() && storageDir.mkdirs()) {
  				return storageDir;
  			}
  		}
  
  		// max attempts exceeded to find a storage directory
  		throw new RuntimeException("Could not create storage directory for BLOB store in '" + baseDir + "'.");
  	}
focal_method.class_method_signature: BlobUtils.initStorageDirectory(String storageDirectory)
focal_method.full_signature: static File initStorageDirectory(String storageDirectory)
focal_method.identifier: initStorageDirectory
focal_method.invocations: isEmpty trim getProperty format toString randomUUID exists mkdirs
focal_method.modifiers: static
focal_method.parameters: (String storageDirectory)
focal_method.return: File
focal_method.signature: File initStorageDirectory(String storageDirectory)