abstract protected int ceph_statfs(String path, CephFileSystem.CephStat fill);
/*
- * Check how many times a path should be replicated (if it is
- * degraded it may not actually be replicated this often).
+ * Check how many times a file should be replicated. If it is,
+ * degraded it may not actually be replicated this often.
* Inputs:
- * String path: The path to check.
+ * int fh: a file descriptor
* Returns: an int containing the number of times replicated.
*/
- abstract protected int ceph_replication(String path);
+ abstract protected int ceph_replication(int fh);
/*
* Find the IP address of the primary OSD for a given file and offset.
*/
public FSDataOutputStream create(Path path,
FsPermission permission,
- EnumSet<CreateFlag> flag,
+ boolean overwrite,
// boolean overwrite,
int bufferSize,
short replication,
}
// We ignore replication since that's not configurable here, and
// progress reporting is quite limited.
- // Required semantics: if the file exists, overwrite if CreateFlag.OVERWRITE;
- // throw an exception if !CreateFlag.OVERWRITE.
+ // Required semantics: if the file exists, overwrite if 'overwrite' is set;
+ // otherwise, throw an exception
// Step 1: existence test
boolean exists = exists(abs_path);
"create: Cannot overwrite existing directory \"" + path.toString()
+ "\" with a file");
}
- // if (!overwrite)
- if (!flag.contains(CreateFlag.OVERWRITE)) {
+ if (!overwrite) {
throw new IOException(
"createRaw: Cannot open existing file \"" + abs_path.toString()
+ "\" for writing without overwrite flag");
import java.io.IOException;
import java.net.URI;
-import org.apache.hadoop.fs.FileSystemContractBaseTest;
import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FileSystemContractBaseTest;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;