use of org.apache.ignite.igfs.IgfsPath in project ignite by apache.
the class IgfsModeResolver method writeExternal.
/**
* {@inheritDoc}
*/
@Override
public void writeExternal(ObjectOutput out) throws IOException {
U.writeEnum(out, dfltMode);
if (modes != null) {
out.writeBoolean(true);
out.writeInt(modes.size());
for (T2<IgfsPath, IgfsMode> pathMode : modes) {
assert pathMode.getKey() != null;
pathMode.getKey().writeExternal(out);
U.writeEnum(out, pathMode.getValue());
}
} else
out.writeBoolean(false);
if (!F.isEmpty(dualParentsWithPrimaryChildren)) {
out.writeBoolean(true);
out.writeInt(dualParentsWithPrimaryChildren.size());
for (IgfsPath p : dualParentsWithPrimaryChildren) p.writeExternal(out);
} else
out.writeBoolean(false);
}
use of org.apache.ignite.igfs.IgfsPath in project ignite by apache.
the class IgfsBenchmark method handleFile.
/**
* {@inheritDoc}
*/
@Override
public void handleFile(String strPath) throws Exception {
IgfsPath path = new IgfsPath(strPath);
IgfsOutputStream out;
try {
out = fs.create(path, false);
} catch (IgniteException ex) {
System.out.println("create file " + path.toString() + " failed: " + ex);
throw ex;
}
try {
for (int i = 0; i < size / dataBufer.capacity(); i++) out.write(dataBufer.array());
} catch (IOException ex) {
System.out.println("write file " + path.toString() + " failed: " + ex);
throw ex;
} finally {
out.close();
}
}
use of org.apache.ignite.igfs.IgfsPath in project ignite by apache.
the class IgfsBenchmark method postHandleDir.
/**
* {@inheritDoc}
*/
@Override
public void postHandleDir(String strPath) throws Exception {
IgfsPath path = new IgfsPath(strPath);
fs.delete(path, false);
}
use of org.apache.ignite.igfs.IgfsPath in project ignite by apache.
the class IgfsMetaManagerSelfTest method mkdirsAndGetInfo.
private IgfsEntryInfo mkdirsAndGetInfo(String path) throws IgniteCheckedException {
IgfsPath p = path(path);
mgr.mkdirs(p, IgfsImpl.DFLT_DIR_META);
IgniteUuid id = mgr.fileId(p);
IgfsEntryInfo info = mgr.info(id);
assert info.isDirectory();
return info;
}
use of org.apache.ignite.igfs.IgfsPath in project ignite by apache.
the class IgfsMetaManagerSelfTest method createFileAndGetInfo.
private IgfsEntryInfo createFileAndGetInfo(String path) throws IgniteCheckedException {
IgfsPath p = path(path);
IgfsEntryInfo res = mgr.create(p, null, false, 400, null, false, null, null).info();
assert res != null;
assert !res.isDirectory();
return res;
}
Aggregations