Search in sources :

Example 6 with IgfsPathControlRequest

use of org.apache.ignite.internal.igfs.common.IgfsPathControlRequest in project ignite by apache.

the class HadoopIgfsOutProc method listFiles.

/**
 * {@inheritDoc}
 */
@Override
public Collection<IgfsFile> listFiles(IgfsPath path) throws IgniteCheckedException {
    final IgfsPathControlRequest msg = new IgfsPathControlRequest();
    msg.command(LIST_FILES);
    msg.path(path);
    msg.userName(userName);
    return io.send(msg).chain(FILE_COL_RES).get();
}
Also used : IgfsPathControlRequest(org.apache.ignite.internal.igfs.common.IgfsPathControlRequest)

Example 7 with IgfsPathControlRequest

use of org.apache.ignite.internal.igfs.common.IgfsPathControlRequest in project ignite by apache.

the class HadoopIgfsOutProc method mkdirs.

/**
 * {@inheritDoc}
 */
@Override
public Boolean mkdirs(IgfsPath path, Map<String, String> props) throws IgniteCheckedException {
    final IgfsPathControlRequest msg = new IgfsPathControlRequest();
    msg.command(MAKE_DIRECTORIES);
    msg.path(path);
    msg.properties(props);
    msg.userName(userName);
    return io.send(msg).chain(BOOL_RES).get();
}
Also used : IgfsPathControlRequest(org.apache.ignite.internal.igfs.common.IgfsPathControlRequest)

Example 8 with IgfsPathControlRequest

use of org.apache.ignite.internal.igfs.common.IgfsPathControlRequest in project ignite by apache.

the class HadoopIgfsOutProc method setTimes.

/**
 * {@inheritDoc}
 */
@Override
public Boolean setTimes(IgfsPath path, long accessTime, long modificationTime) throws IgniteCheckedException {
    final IgfsPathControlRequest msg = new IgfsPathControlRequest();
    msg.command(SET_TIMES);
    msg.path(path);
    msg.accessTime(accessTime);
    msg.modificationTime(modificationTime);
    msg.userName(userName);
    return io.send(msg).chain(BOOL_RES).get();
}
Also used : IgfsPathControlRequest(org.apache.ignite.internal.igfs.common.IgfsPathControlRequest)

Example 9 with IgfsPathControlRequest

use of org.apache.ignite.internal.igfs.common.IgfsPathControlRequest in project ignite by apache.

the class HadoopIgfsOutProc method open.

/**
 * {@inheritDoc}
 */
@Override
public HadoopIgfsStreamDelegate open(IgfsPath path, int seqReadsBeforePrefetch) throws IgniteCheckedException {
    final IgfsPathControlRequest msg = new IgfsPathControlRequest();
    msg.command(OPEN_READ);
    msg.path(path);
    msg.flag(true);
    msg.sequentialReadsBeforePrefetch(seqReadsBeforePrefetch);
    msg.userName(userName);
    IgfsInputStreamDescriptor rmtDesc = io.send(msg).chain(STREAM_DESCRIPTOR_RES).get();
    return new HadoopIgfsStreamDelegate(this, rmtDesc.streamId(), rmtDesc.length());
}
Also used : IgfsPathControlRequest(org.apache.ignite.internal.igfs.common.IgfsPathControlRequest) IgfsInputStreamDescriptor(org.apache.ignite.internal.processors.igfs.IgfsInputStreamDescriptor)

Example 10 with IgfsPathControlRequest

use of org.apache.ignite.internal.igfs.common.IgfsPathControlRequest in project ignite by apache.

the class HadoopIgfsOutProc method append.

/**
 * {@inheritDoc}
 */
@Override
public HadoopIgfsStreamDelegate append(IgfsPath path, boolean create, @Nullable Map<String, String> props) throws IgniteCheckedException {
    final IgfsPathControlRequest msg = new IgfsPathControlRequest();
    msg.command(OPEN_APPEND);
    msg.path(path);
    msg.flag(create);
    msg.properties(props);
    msg.userName(userName);
    Long streamId = io.send(msg).chain(LONG_RES).get();
    return new HadoopIgfsStreamDelegate(this, streamId);
}
Also used : IgfsPathControlRequest(org.apache.ignite.internal.igfs.common.IgfsPathControlRequest)

Aggregations

IgfsPathControlRequest (org.apache.ignite.internal.igfs.common.IgfsPathControlRequest)15 IgfsInputStreamDescriptor (org.apache.ignite.internal.processors.igfs.IgfsInputStreamDescriptor)2 IgniteCheckedException (org.apache.ignite.IgniteCheckedException)1 IgniteException (org.apache.ignite.IgniteException)1 IgfsInputStream (org.apache.ignite.igfs.IgfsInputStream)1 IgfsControlResponse (org.apache.ignite.internal.igfs.common.IgfsControlResponse)1